@arcgis/core 4.25.0-next.20221108 → 4.25.1
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.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{4726c869d80257488a38.js → 0690434cb3d7df4188aa.js} +1 -1
- package/assets/esri/core/workers/chunks/{bf097a329b91fcd7a300.js → 0a9813558c89a8824080.js} +1 -1
- package/assets/esri/core/workers/chunks/{33ea3449d32ac21adc91.js → 0d10010d8db4ebd20356.js} +1 -1
- package/assets/esri/core/workers/chunks/0ea80e26c937441c2bc5.js +1 -0
- package/assets/esri/core/workers/chunks/52b6711572ac7e058ce6.js +1 -0
- package/assets/esri/core/workers/chunks/{e031a2fee155aa168858.js → 61959a85261218b22376.js} +1 -1
- package/assets/esri/core/workers/chunks/{363700f66277a9176991.js → 7c255fe7a231d93a2048.js} +1 -1
- package/assets/esri/core/workers/chunks/8750c7463968f0c183ba.js +1 -0
- package/assets/esri/core/workers/chunks/a16641c79f56012b0d66.js +1 -0
- package/assets/esri/core/workers/chunks/{211ad79ff0b187c52449.js → afd87bc92895517b0877.js} +1 -1
- package/assets/esri/core/workers/chunks/b04984f048b75b2b4dd2.js +1 -0
- package/assets/esri/core/workers/chunks/bc878858cf5fb3237206.js +1 -0
- package/assets/esri/core/workers/chunks/{5de864843c0d3f4d291d.js → d4bfb6a3b8965be6f0d6.js} +1 -1
- package/assets/esri/core/workers/chunks/{086dafcd10b310ba1a30.js → d9bba06ef5d22bd2d789.js} +1 -1
- package/assets/esri/core/workers/chunks/ee261fdc2a82d05e458e.js +1 -0
- package/assets/esri/core/workers/chunks/f29c6965e9e8f904be40.js +1 -0
- package/config.js +1 -1
- package/identity/IdentityManagerBase.js +1 -1
- package/interfaces.d.ts +8 -2
- package/layers/WMSLayer.js +1 -1
- package/layers/WMTSLayer.js +1 -1
- package/package.json +1 -1
- package/portal/support/urlUtils.js +1 -1
- package/request.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMImageColorSubstitutionHelper.js +1 -1
- package/views/2d/layers/WMSLayerView2D.js +1 -1
- package/views/2d/layers/WMTSLayerView2D.js +1 -1
- package/widgets/FeatureForm/FormExpressionArcadeExecutor.js +1 -1
- package/widgets/FeatureForm/FormExpressionsManager.js +1 -1
- package/widgets/FeatureForm/InputField.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/assets/esri/core/workers/chunks/6dfb2ddfd72009564a34.js +0 -1
- package/assets/esri/core/workers/chunks/83879da1ff7938a76574.js +0 -1
- package/assets/esri/core/workers/chunks/878bc2b24cc45418e819.js +0 -1
- package/assets/esri/core/workers/chunks/b5e6a868256c5aae6d5e.js +0 -1
- package/assets/esri/core/workers/chunks/c2a8813b618f98d0016d.js +0 -1
- package/assets/esri/core/workers/chunks/c868ffdc6bb8a49d82d7.js +0 -1
- package/assets/esri/core/workers/chunks/d573ec98401fbae26383.js +0 -1
- package/assets/esri/core/workers/chunks/f23d8ec18740eb2e5e8f.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1761,9880],{41993:e=>{function t(e){return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}))}t.keys=()=>[],t.resolve=t,t.id=41993,e.exports=t},99880:(e,t,r)=>{"use strict";r.d(t,{V:()=>l});var s=r(68773),i=(r(3172),r(20102)),n=r(92604),o=r(17452);const a=n.Z.getLogger("esri.assets");function l(e){if(!s.Z.assetsPath)throw a.errorOnce("The API assets location needs to be set using config.assetsPath. More information: https://arcg.is/1OzLe50"),new i.Z("assets:path-not-set","config.assetsPath is not set");return(0,o.v_)(s.Z.assetsPath,e)}},32448:(e,t,r)=>{"use strict";r.d(t,{Z:()=>l});var s=r(43697),i=r(15923),n=r(50758),o=r(52011);class a{constructor(){this._emitter=new a.EventEmitter(this)}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}}!function(e){class t{constructor(e=null){this._target=e,this._listenersMap=null}clear(){this._listenersMap&&this._listenersMap.clear(),this._listenersMap=null}emit(e,t){const r=this._listenersMap&&this._listenersMap.get(e);if(!r)return!1;const s=this._target||this;return[...r].forEach((e=>{e.call(s,t)})),r.length>0}on(e,t){if(Array.isArray(e)){const r=e.map((e=>this.on(e,t)));return(0,n.AL)(r)}if(e.includes(","))throw new TypeError("Evented.on() with a comma delimited string of event types is not supported");this._listenersMap||(this._listenersMap=new Map);const r=this._listenersMap.get(e)||[];return r.push(t),this._listenersMap.set(e,r),{remove:()=>{const r=this._listenersMap&&this._listenersMap.get(e)||[],s=r.indexOf(t);s>=0&&r.splice(s,1)}}}once(e,t){const r=this.on(e,(e=>{r.remove(),t.call(null,e)}));return r}hasEventListener(e){const t=this._listenersMap&&this._listenersMap.get(e);return null!=t&&t.length>0}}e.EventEmitter=t,e.EventedMixin=e=>{let r=class extends e{constructor(){super(...arguments),this._emitter=new t}destroy(){this._emitter.clear()}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}};return r=(0,s._)([(0,o.j)("esri.core.Evented")],r),r};let r=class extends i.Z{constructor(){super(...arguments),this._emitter=new a.EventEmitter(this)}destroy(){this._emitter.clear()}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}};r=(0,s._)([(0,o.j)("esri.core.Evented")],r),e.EventedAccessor=r}(a||(a={}));const l=a},609:(e,t,r)=>{"use strict";r.d(t,{D:()=>u,v:()=>c});var s,i,n=r(43697),o=r(15923),a=r(70586),l=r(95330),h=r(52011);(i=s||(s={}))[i.PENDING=0]="PENDING",i[i.RESOLVED=1]="RESOLVED",i[i.REJECTED=2]="REJECTED";class d{constructor(e){this.instance=e,this._resolver=(0,l.dD)(),this._status=s.PENDING,this._resolvingPromises=[],this._resolver.promise.then((()=>{this._status=s.RESOLVED,this._cleanUp()}),(()=>{this._status=s.REJECTED,this._cleanUp()}))}addResolvingPromise(e){this._resolvingPromises.push(e),this._tryResolve()}isResolved(){return this._status===s.RESOLVED}isRejected(){return this._status===s.REJECTED}isFulfilled(){return this._status!==s.PENDING}abort(){this._resolver.reject((0,l.zE)())}when(e,t){return this._resolver.promise.then(e,t)}_cleanUp(){this._allPromise=this._resolvingPromises=this._allPromise=null}_tryResolve(){if(this.isFulfilled())return;const e=(0,l.dD)(),t=[...this._resolvingPromises,(0,a.j0)(e.promise)],r=this._allPromise=Promise.all(t);r.then((()=>{this.isFulfilled()||this._allPromise!==r||this._resolver.resolve(this.instance)}),(e=>{this.isFulfilled()||this._allPromise!==r||(0,l.D_)(e)||this._resolver.reject(e)})),e.resolve()}}const c=e=>{let t=class extends e{constructor(...e){super(...e),this._promiseProps=new d(this),this.addResolvingPromise(Promise.resolve())}isResolved(){return this._promiseProps.isResolved()}isRejected(){return this._promiseProps.isRejected()}isFulfilled(){return this._promiseProps.isFulfilled()}when(e,t){return new Promise(((e,t)=>{this._promiseProps.when(e,t)})).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)}};return t=(0,n._)([(0,h.j)("esri.core.Promise")],t),t};let u=class extends(c(o.Z)){};u=(0,n._)([(0,h.j)("esri.core.Promise")],u)},17445:(e,t,r)=>{"use strict";r.d(t,{N1:()=>u,YP:()=>l,Z_:()=>f,gx:()=>h,nn:()=>g,on:()=>c,tX:()=>_});var s=r(91460),i=r(50758),n=r(70586),o=r(95330),a=r(26258);function l(e,t,r={}){return d(e,t,r,p)}function h(e,t,r={}){return d(e,t,r,m)}function d(e,t,r={},s){let i=null;const o=r.once?(e,r)=>{s(e)&&((0,n.hw)(i),t(e,r))}:(e,r)=>{s(e)&&t(e,r)};if(i=(0,a.aQ)(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.hw)(d),r(e)}const p=l(e,((e,r)=>{c(),(0,s.vT)(e)&&(a=e,h=(0,s.on)(e,t,u),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return d=(0,i.kB)((()=>{p.remove(),c()})),d}function u(e,t){return function(e,t,r){if((0,o.Hc)(r))return Promise.reject((0,o.zE)());const s=e();if(t?.(s))return Promise.resolve(s);let a=null;function l(){a=(0,n.hw)(a)}return new Promise(((s,n)=>{a=(0,i.AL)([(0,o.fu)(r,(()=>{l(),n((0,o.zE)())})),d(e,(e=>{l(),s(e)}),{sync:!1,once:!0},t??p)])}))}(e,m,t)}function p(e){return!0}function m(e){return!!e}r(87538);const f={sync:!0},g={initial:!0},_={sync:!0,initial:!0}},41123:(e,t,r)=>{"use strict";r.d(t,{D:()=>i});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)}},55142:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>pt});var s=r(40330),i=r(43697),n=r(68773),o=r(3172),a=r(20102),l=r(32448),h=r(91460),d=r(22974),c=r(78286),u=r(95330),p=r(17445),m=r(17452),f=r(5600),g=(r(75215),r(52011)),_=(r(67676),r(940));r(2587),(()=>{if("function"==typeof Element.prototype.closest)return(e,t)=>e.closest(t);Element.prototype.matches||Element.prototype.msMatchesSelector})();var v=r(61247),y=(r(80442),r(92604)),w=r(70586),S=r(609),I=r(41123),k=r(90578),b=r(58971),A=r(38805),T=r(8728),U=r(3894),C=r(50758);const x=new Map;function P(){x.clear()}function R(e){x.delete(e)}y.Z.getLogger("esri.widgets.support.widgetUtils");function O(e){const t=U.Z.acquire();for(let e=0;e<arguments.length;e++){const r=arguments[e],s=typeof r;if("string"===s)t.push(r);else if(Array.isArray(r))t.push.apply(t,r);else if("object"===s)for(const e in r)r[e]&&t.push(e)}const r=t.join(" ");return U.Z.release(t),r}function D(e){this[e.getAttribute("data-node-ref")]=e}(()=>{const e=new Map;new ResizeObserver((t=>{P();for(const r of t)e.get(r.target)?.(r)}))})();const E=["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"],L=new T.Z({whiteList:E,onTagAttr:(e,t,r)=>{const s=`${t}="${r}"`;if(N.includes(t))return s},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0),j="http://www.w3.org/",M=`${j}2000/svg`,q=`${j}1999/xlink`;let F,V=[],$=(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},B=(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),z=e=>{if("string"!=typeof e)throw new Error("Style values must be strings")},Z=(e,t,r)=>{if(""!==t.vnodeSelector)for(let s=r;s<e.length;s++)if(B(e[s],t))return s;return-1},H=(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(B(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.`)}},J=e=>{if(e.properties){let t=e.properties.enterAnimation;t&&t(e.domNode,e.properties)}},W=[],G=!1,Y=e=>{(e.children||[]).forEach(Y),e.properties&&e.properties.afterRemoved&&e.properties.afterRemoved.apply(e.properties.bind||e.properties,[e.domNode])},K=()=>{G=!1,W.forEach(Y),W.length=0},X=e=>{W.push(e),G||(G=!0,"undefined"!=typeof window&&"requestIdleCallback"in window?window.requestIdleCallback(K,{timeout:16}):setTimeout(K,16))},Q=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),X(e))};return void r(t,s,e.properties)}}t.parentNode&&(t.parentNode.removeChild(t),X(e))},ee=(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)se(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&&(z(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===M?"href"===n?e.setAttributeNS(q,n,a):e.setAttribute(n,a):"string"===i&&"value"!==n?"innerHTML"===n?e[n]=L.sanitize(a):e.setAttribute(n,a):e[n]=a}}},te=(e,t,r)=>{((e,t,r)=>{if(t)for(let s of t)re(s,e,void 0,r)})(e,t.children,r),t.text&&(e.textContent=t.text),ee(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])},re=(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=$(s,{namespace:M})),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}}te(i,e,s)}},se=(e,t,r)=>{t&&t.split(" ").forEach((t=>{t&&e.classList.toggle(t,r)}))};F=(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=$(r,{namespace:M})),e.text!==t.text&&(n=!0,void 0===t.text?s.removeChild(s.firstChild):s.textContent=t.text),t.domNode=s,n=((e,t,r,s,i)=>{if(r===s)return!1;s=s||V;let n,o=(r=r||V).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&&B(a,c))d=F(a,c,i)||d,l++;else{let a=Z(r,c,l+1);if(a>=0){for(n=l;n<a;n++)Q(r[n]),H(r,n,e,"removed");d=F(r[a],c,i)||d,l=a+1}else re(c,t,l<o?r[l].domNode:void 0,i),J(c),H(s,h,e,"added")}h++}if(o>l)for(n=l;n<o;n++)Q(r[n]),H(r,n,e,"removed");return d})(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&&(se(e,h,!1),se(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?(z(o),s.styleApplyer(e,r,o)):s.styleApplyer(e,r,""))}}else if(l||"string"!=typeof h||(l=""),"value"===o){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)}else if(l!==h){let t=typeof l;"function"===t&&s.eventHandlerInterceptor||(s.namespace===M?"href"===o?e.setAttributeNS(q,o,l):e.setAttribute(o,l):"string"===t?"innerHTML"===o?e[o]=L.sanitize(l):"role"===o&&""===l?e.removeAttribute(o):e.setAttribute(o,l):e[o]!==l&&(e[o]=l),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 ie=(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,F(s,r,t)},domNode:e.domNode});const ne={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,r)=>{"-"===t.charAt(0)?e.style.setProperty(t,r):e.style[t]=r}};let oe,ae=e=>$(ne,e),le=(e,t,r)=>(r=ae(r),re(t,e,void 0,r),ie(t,r)),he=(e,t,r)=>(r=ae(r),re(t,e.parentNode,e,r),ie(t,r)),de=(e,t,r)=>(r=ae(r),t.domNode=e,te(e,t,r),ie(t,r)),ce=(e,t,r)=>(r=ae(r),re(t,e.parentNode,e,r),e.parentNode.removeChild(e),ie(t,r));oe=Array.prototype.find?(e,t)=>e.find(t):(e,t)=>e.filter(t)[0];const ue={handleInterceptedEvent:(e,t,r,s)=>(e.scheduleRender(),t.properties[`on${s.type}`].apply(t.properties.bind||r,[s]))},pe={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,r)=>{e.style[t]=r}},me=(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 fe=r(65161),ge=r(99880);let _e;_e="components/assets";const ve=Symbol("widget"),ye=[],we={},Se=new WeakMap;function Ie(e,t){let r=t.children;if(r&&r.length)for(let t=0;t<r.length;++t)r[t]=Ie(e,r[t]);else r=ye;const s=t.vnodeSelector;if(Te(s)){const i=t.properties||we,n=i.key||s;return{vnodeSelector:"div",properties:{key:n,afterCreate:ke,afterUpdate:be,afterRemoved:Ae,parentWidget:e,widgetConstructor:s,widgetProperties:{...i,key:n,children:r}},children:void 0,text:void 0,domNode:null}}return t}function ke(e,t,r,{parentWidget:s,widgetConstructor:i,widgetProperties:n}){const o=new i(n);o.container=e,Se.set(e,o),o.afterCreate?.(o,e),s._internalHandles.add((0,C.kB)((()=>Ae(e))))}function be(e,t,r,{widgetProperties:s}){const i=Se.get(e);i&&(i.set(s),i.afterUpdate?.(i,e))}function Ae(e){const t=Se.get(e);t&&(t.destroy(),Se.delete(e))}function Te(e){return"function"==typeof e&&e[ve]}const Ue=new Set;var Ce=r(70171),xe=r(94443);let Pe=0;function Re(e,t){for(const r in t)null!=e[r]&&("object"==typeof e[r]&&"object"==typeof t[r]?Re(e[r],t?.[r]):e[r]=t[r]);return e}const Oe=(e=>{let t;const r={...ue,...e},s=(n=r,{...pe,...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)).filter((e=>e.getRootNode()===e.ownerDocument)).reverse();s=me(a.getLastRender(),r,!0)}else n.reverse(),s=me(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),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),h[e].update(t),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(le,e,t)},insertBefore:(e,t)=>{c(he,e,t)},merge:(e,t)=>{c(de,e,t)},replace:(e,t)=>{c(ce,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))&&(P(),e.scheduleRender(),l[a].call(l.bind||r,s))}});let De=!1,Ee=class extends((0,S.v)(l.Z.EventedAccessor)){constructor(e,t){super(e,t),this._attached=!1,this._internalHandles=new v.Z,this._projector=Oe,this._readyForTrueRender=!1,this.iconClass="esri-icon-checkbox-unchecked",this.key=this,this._loadLocale=(0,u.Ds)((async()=>{if(this._messageBundleProps&&this._messageBundleProps.length){const e=await(0,u.as)(this._messageBundleProps.map((async({bundlePath:e,propertyName:t})=>{let r=await(0,xe.ME)(e);this.uiStrings&&Object.keys(this.uiStrings)&&(r=Re((0,d.d9)(r),this.uiStrings)),this[t]=r})));for(const t of e)t.error&&y.Z.getLogger(this.declaredClass).error("widget-intl:locale-error",this.declaredClass,t.error)}await this.loadLocale()})),(0,fe.Y)((0,m.hF)((0,ge.V)("components/assets")));const r="esri-widget-uid-"+(0,I.D)(),s=this.render.bind(this);this._trackingTarget=new A.M((()=>this.scheduleRender()));const i=()=>{if(!this._readyForTrueRender||this.destroyed)return null;if(!this.visible)return{vnodeSelector:"div",properties:{key:r,class:"",styles:{display:"none"}},domNode:null,children:void 0,text:void 0};const e=s();let{properties:t}=e;t||(e.properties=t={});let{key:i,styles:n}=t;i||(t.key=r),n||(t.styles=n={}),n.display||(n.display="");let o=0;return e.children?.forEach((e=>{if(Te(e.vnodeSelector))return;let{properties:t}=e;t||(e.properties=t={}),t.key||(t.key=`${this.id}--${o++}`)})),Ie(this,e)};var n;this.render=()=>{if(De)return i();let e=function(e){return x.get(e)}(this)??null;if(e)return e;this._trackingTarget.clear(),De=!0;try{e=(0,b.LJ)(this._trackingTarget,i)}catch(e){throw console.error(e),e}finally{De=!1}return e&&function(e,t){x.set(e,t)}(this,e),e},this.addResolvingPromise(this._resourcesFetch=this.beforeFirstRender().then((()=>{this._readyForTrueRender=!0,this._postInitialize()}))),n=this._resourcesFetch,Ue.add(n),n.finally((()=>Ue.delete(n)))}normalizeCtorArgs(e,t){const r={...e};return t&&(r.container=t),r}postInitialize(){}beforeFirstRender(){return Promise.all([this.loadDependencies(),this._loadLocale()]).then((()=>{})).catch(u.H9)}async loadDependencies(){}async loadLocale(){}destroy(){this.destroyed||((0,w.SC)(this._trackingTarget),(0,w.SC)(this.viewModel),this._detach(this.container),this._set("container",null),this._internalHandles.destroy(),this._emitter.clear(),this.render=()=>null,this._projector=null,R(this))}set container(e){this._get("container")||this._set("container",e)}castContainer(e){return function(e){return"string"==typeof e?document.getElementById(e):e??null}(e)}get domNode(){return this.container}set domNode(e){this.container=e}get id(){return this._get("id")||this.get("container.id")||Date.now().toString(16)+"-widget-"+Pe++}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 test(){return{projector:this._projector}}render(){throw new Error("not implemented")}scheduleRender(){this.destroyed||(R(this),this._projector.scheduleRender())}classes(...e){return O.apply(this,e)}renderNow(){R(this),this._projector.renderNow()}_postInitialize(){if(this.destroyed)return;this.scheduleRender(),this._delegatedEventNames?.length&&this._internalHandles.add((0,p.YP)((()=>this.viewModel),((e,t)=>{t&&this._internalHandles.remove("delegated-events"),e&&(0,h.vT)(e)&&this._internalHandles.add(this._delegatedEventNames.map((t=>(0,h.on)(e,t,(e=>{this.emit(t,e)})))),"delegated-events")}),p.nn)),this.postInitialize();const e=async()=>{await this._loadLocale().catch(u.H9),this.scheduleRender()};this._internalHandles.add([(0,Ce.qe)(e),(0,p.YP)((()=>this.uiStrings),e),(0,p.gx)((()=>this.container),(e=>{this.destroyed||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)}};Ee[ve]=!0,(0,i._)([(0,f.Cb)()],Ee.prototype,"_readyForTrueRender",void 0),(0,i._)([(0,f.Cb)({value:null})],Ee.prototype,"container",null),(0,i._)([(0,k.p)("container")],Ee.prototype,"castContainer",null),(0,i._)([(0,f.Cb)()],Ee.prototype,"domNode",null),(0,i._)([(0,f.Cb)()],Ee.prototype,"iconClass",void 0),(0,i._)([(0,f.Cb)()],Ee.prototype,"id",null),(0,i._)([(0,f.Cb)()],Ee.prototype,"label",null),(0,i._)([(0,f.Cb)()],Ee.prototype,"renderable",null),(0,i._)([(0,f.Cb)()],Ee.prototype,"uiStrings",void 0),(0,i._)([(0,f.Cb)()],Ee.prototype,"viewModel",void 0),(0,i._)([(0,f.Cb)({value:!0})],Ee.prototype,"visible",null),(0,i._)([(0,f.Cb)()],Ee.prototype,"key",void 0),(0,i._)([(0,f.Cb)()],Ee.prototype,"children",void 0),(0,i._)([(0,f.Cb)()],Ee.prototype,"afterCreate",void 0),(0,i._)([(0,f.Cb)()],Ee.prototype,"afterUpdate",void 0),(0,i._)([(0,f.Cb)()],Ee.prototype,"afterRemoved",void 0),Ee=(0,i._)([(0,g.j)("esri.widgets.Widget")],Ee);const Ne=Ee;function Le(e){return(t,r)=>{t.hasOwnProperty("_messageBundleProps")||(t._messageBundleProps=t._messageBundleProps?t._messageBundleProps.slice():[]),t._messageBundleProps.push({bundlePath:e,propertyName:r})}}var je=function(e){return{vnodeSelector:"",properties:void 0,children:void 0,text:e.toString(),domNode:null}},Me=function(e,t){for(var r=0,s=e.length;r<s;r++){var i=e[r];Array.isArray(i)?Me(i,t):null!=i&&!1!==i&&(i.hasOwnProperty("vnodeSelector")||(i=je(i)),t.push(i))}};function qe(e,t,...r){return"function"!=typeof e||Te(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 Me(r,i),{vnodeSelector:e,properties:t||void 0,children:i,text:void 0,domNode:null}}(e,t,...r):e(t,...r)}const Fe="esri-identity-form__group",Ve="esri-identity-form__label",$e="esri-input",Be="esri-button";let ze=class extends Ne{constructor(e,t){super(e,t),this._usernameInputNode=null,this._passwordInputNode=null,this.signingIn=!1,this.server=null,this.resource=null,this.error=null,this.oAuthPrompt=!1}render(){const{error:e,server:t,resource:r,signingIn:s,oAuthPrompt:i,messages:n}=this,o=qe("div",{class:Fe},(0,_.n)(i?n.oAuthInfo:n.info,{server:t&&/\.arcgis\.com/i.test(t)?"ArcGIS Online":t,resource:`(${r||n.lblItem})`})),a=i?null:qe("div",{class:Fe,key:"username"},qe("label",{class:Ve},n.lblUser,qe("input",{value:"",required:!0,autocomplete:"off",spellcheck:!1,type:"text",bind:this,afterCreate:D,"data-node-ref":"_usernameInputNode",class:$e}))),l=i?null:qe("div",{class:Fe,key:"password"},qe("label",{class:Ve},n.lblPwd,qe("input",{value:"",required:!0,type:"password",bind:this,afterCreate:D,"data-node-ref":"_passwordInputNode",class:$e}))),h=qe("div",{class:this.classes(Fe,"esri-identity-form__footer")},qe("input",{type:"submit",disabled:!!s,value:s?n.lblSigning:n.lblOk,class:Be}),qe("input",{type:"button",value:n.lblCancel,bind:this,onclick:this._cancel,class:this.classes(Be,"esri-button--secondary")})),d=e?qe("div",null,e.details&&e.details.httpStatus?n.invalidUser:n.noAuthService):null;return qe("form",{class:"esri-identity-form",bind:this,onsubmit:this._submit},o,d,a,l,h)}_cancel(){this._set("signingIn",!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&&this._usernameInputNode.value,password:this._passwordInputNode&&this._passwordInputNode.value};this.emit("submit",t)}};(0,i._)([(0,f.Cb)(),Le("esri/identity/t9n/identity")],ze.prototype,"messages",void 0),(0,i._)([(0,f.Cb)()],ze.prototype,"signingIn",void 0),(0,i._)([(0,f.Cb)()],ze.prototype,"server",void 0),(0,i._)([(0,f.Cb)()],ze.prototype,"resource",void 0),(0,i._)([(0,f.Cb)()],ze.prototype,"error",void 0),(0,i._)([(0,f.Cb)()],ze.prototype,"oAuthPrompt",void 0),ze=(0,i._)([(0,g.j)("esri.identity.IdentityForm")],ze);const Ze=ze;var He=r(44291);const Je="esri-identity-modal__content";let We=class extends Ne{constructor(e,t){super(e,t),this.container=document.createElement("div"),this.content=null,this.open=!1,this._focusTrap=null,this._close=()=>{this.open=!1},document.body.appendChild(this.container),this.addHandles((0,p.YP)((()=>this.open),(()=>this._toggleFocusTrap())))}destroy(){this._destroyFocusTrap()}get title(){return this.messages?.auth.signIn}render(){const e=this.id,{open:t,content:r,title:s,messages:i}=this,n=t&&!!r,o={"esri-identity-modal--open":n,"esri-identity-modal--closed":!n},a=qe("button",{class:"esri-identity-modal__close-button","aria-label":i.close,title:i.close,bind:this,onclick:this._close,type:"button"},qe("span",{"aria-hidden":"true",class:"esri-icon-close"})),l=`${e}_title`,h=`${e}_content`,d=s?qe("h1",{id:l,class:"esri-identity-modal__title"},s):null,c=n?qe("div",{bind:this,class:"esri-identity-modal__dialog",role:"dialog","aria-labelledby":l,"aria-describedby":h,afterCreate:this._createFocusTrap},a,d,this._renderContent(h)):null;return qe("div",{tabIndex:-1,class:this.classes("esri-identity-modal",o)},c)}_destroyFocusTrap(){this._focusTrap?.deactivate({onDeactivate:()=>{}}),this._focusTrap=null}_toggleFocusTrap(){const{_focusTrap:e,open:t}=this;e&&(t?e.activate():e.deactivate())}_createFocusTrap(e){this._destroyFocusTrap();const t=requestAnimationFrame((()=>{this._focusTrap=(0,He.v)(e,{initialFocus:"input",onDeactivate:this._close}),this._toggleFocusTrap()}));this.addHandles((0,C.kB)((()=>cancelAnimationFrame(t))))}_renderContent(e){const t=this.content;return"string"==typeof t?qe("div",{class:Je,id:e,innerHTML:t}):function(e){return e&&"function"==typeof e.render}(t)?qe("div",{class:Je,id:e},t.render()):t instanceof HTMLElement?qe("div",{class:Je,id:e,bind:t,afterCreate:this._attachToNode}):null}_attachToNode(e){e.appendChild(this)}};(0,i._)([(0,f.Cb)({readOnly:!0})],We.prototype,"container",void 0),(0,i._)([(0,f.Cb)()],We.prototype,"content",void 0),(0,i._)([(0,f.Cb)()],We.prototype,"open",void 0),(0,i._)([(0,f.Cb)(),Le("esri/t9n/common")],We.prototype,"messages",void 0),(0,i._)([(0,f.Cb)()],We.prototype,"title",null),We=(0,i._)([(0,g.j)("esri.identity.IdentityModal")],We);const Ge=We,Ye="esriJSAPIOAuth";class Ke{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&&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(Ye,JSON.stringify(e))}catch(e){return console.warn(e),!1}return!0}return!1}destroy(){const e=this._load(),t=this.oAuthInfo;if(t&&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",r=new FormData;if(r.append("f","json"),r.append("auth_token",this.refreshToken||this.token),r.append("client_id",t.appId),r.append("token_type_hint",this.refreshToken?"refresh_token":"access_token"),"function"==typeof navigator.sendBeacon)navigator.sendBeacon(e,r);else{const t=new XMLHttpRequest;t.open("POST",e),t.send(r)}}if(t&&t.authNamespace&&t.portalUrl&&this.storage){const r=e[t.authNamespace];if(r){delete r[t.portalUrl];try{this.storage.setItem(Ye,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&&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(Ye);if(t)try{e=JSON.parse(t)}catch(e){console.warn(e)}}return e}}Ke.prototype.declaredClass="esri.identity.OAuthCredential";var Xe,Qe=r(96674);let et=Xe=class extends Qe.wq{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 Xe.fromJSON(this.toJSON())}};(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"appId",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"authNamespace",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"expiration",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"flowType",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"forceLogin",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"forceUserId",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"locale",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"minTimeUntilExpiration",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"popup",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"popupCallbackUrl",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"popupWindowFeatures",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"portalUrl",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"preserveUrlHash",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],et.prototype,"userId",void 0),et=Xe=(0,i._)([(0,g.j)("esri.identity.OAuthInfo")],et);const tt=et;let rt=class extends Qe.wq{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,i._)([(0,f.Cb)({json:{write:!0}})],rt.prototype,"adminTokenServiceUrl",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],rt.prototype,"currentVersion",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],rt.prototype,"hasPortal",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],rt.prototype,"hasServer",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],rt.prototype,"owningSystemUrl",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],rt.prototype,"owningTenant",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],rt.prototype,"server",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],rt.prototype,"shortLivedTokenValidity",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],rt.prototype,"tokenServiceUrl",void 0),(0,i._)([(0,f.Cb)({json:{write:!0}})],rt.prototype,"webTierAuth",void 0),rt=(0,i._)([(0,g.j)("esri.identity.ServerInfo")],rt);const st=rt;var it=r(19745);const nt={},ot=e=>{const t=new m.R9(e.owningSystemUrl).host,r=new m.R9(e.server).host,s=/.+\.arcgis\.com$/i;return s.test(t)&&s.test(r)},at=(e,t)=>!!(ot(e)&&t&&t.some((t=>t.test(e.server))));let lt=null,ht=null;try{lt=window.localStorage,ht=window.sessionStorage}catch{}class dt extends l.Z{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.formConstructor=Ze,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin="null"!==window.origin?window.origin:window.location.origin,this._appUrlObj=(0,m.mN)(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|MobileServer|NAServer|NetworkDiagramServer|OGCFeatureServer|ParcelFabricServer|RelationalCatalogServer|SceneServer|StreamServer|UtilityNetworkServer|ValidationServer|VectorTileServer|VersionManagementServer)).*/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._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 st,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 ct({userId:e.userId,server:i.server,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,d.yd)({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 st(t))})),e.length&&this.registerServers(e)}if(r){const e=[];r.forEach((t=>{t.appId&&e.push(t.declaredClass?t:new tt(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 ct(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,i=!0;t&&(r=!!t.token,s=t.error,i=!1!==t.prompt),t={...t},e=this._sanitizeUrl(e);const n=new AbortController,o=(0,u.hh)();if(t.signal&&(0,u.fu)(t.signal,(()=>{n.abort()})),(0,u.fu)(n,(()=>{o.reject(new a.Z("identity-manager:user-aborted","ABORTED"))})),(0,u.Hc)(n))return o.promise;t.signal=n.signal;const l=this._isAdminResource(e),h=r?this.findCredential(e):null;let d;if(h&&s&&s.details&&498===s.details.httpStatus)h.destroy();else if(h)return d=new a.Z("identity-manager:not-authorized","You are currently signed in as: '"+h.userId+"'. You do not have access to this resource: "+e,{error:s}),o.reject(d),o.promise;const c=this._findCredential(e,t);if(c)return o.resolve(c),o.promise;let p=this.findServerInfo(e);if(p)!p.hasServer&&this._isServerRsrc(e)&&(p._restInfoPms=this._getTokenSvcUrl(e),p.hasServer=!0);else{const t=this._getTokenSvcUrl(e);if(!t)return d=new a.Z("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),o.reject(d),o.promise;p=new st,p.server=this._getServerInstanceRoot(e),"string"==typeof t?(p.tokenServiceUrl=t,p.hasPortal=!0):(p._restInfoPms=t,p.hasServer=!0),this.registerServers([p])}return p.hasPortal&&void 0===p._selfReq&&(i||(0,m.D6)(p.tokenServiceUrl,this._appOrigin)||this._gwDomains.some((e=>e.tokenServiceUrl===p.tokenServiceUrl)))&&(p._selfReq={owningTenant:t&&t.owningTenant,selfDfd:this._getPortalSelf(p.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,p,t,o,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 m.R9(this._appOrigin),n=e.shortLivedTokenValidity;let l,h,d,c,u,p,f,g;t&&(g=this.tokenValidity||n||this._defaultTokenValidity,g>n&&n>0&&(g=n)),r&&(l=r.isAdmin,h=r.serverUrl,d=r.token,p=r.signal,f=r.ssl,e.customParameters=r.customParameters),l?c=e.adminTokenServiceUrl:(c=e.tokenServiceUrl,u=new m.R9(c.toLowerCase()),e.webTierAuth&&r?.serverUrl&&!f&&"http"===i.scheme&&((0,m.D6)(i.uri,c,!0)||"https"===u.scheme&&i.host===u.host&&"7080"===i.port&&"7443"===u.port)&&(c=c.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const _={query:{request:"getToken",username:t?.username,password:t?.password,serverUrl:h,token:d,expiration:g,referer:l||s?this._appOrigin:null,client:l?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,r),signal:p,...r?.ioArgs};return s||(_.withCredentials=!1),(0,o.default)(c,_).then((r=>{const s=r.data;if(!s||!s.token)return new a.Z("identity-manager:authentication-failed","Unable to generate token");const i=e.server;return nt[i]||(nt[i]={}),t&&(nt[i][t.username]=t.password),s.validity=g,s}))}isBusy(){return!!this._busy}checkSignInStatus(e){return this.checkAppAccess(e,"").then((e=>e.credential))}checkAppAccess(e,t,r){let s=!1;return this.getCredential(e,{prompt:!1}).then((i=>{let n;const l={f:"json"};if("portal"===i.scope)if(t&&(this._doPortalSignIn(e)||r&&r.force))n=i.server+"/sharing/rest/oauth2/validateAppAccess",l.client_id=t;else{if(!i.token)return{credential:i};n=i.server+"/sharing/rest"}else{if(!i.token)return{credential:i};n=i.server+"/rest/services"}return i.token&&(l.token=i.token),(0,o.default)(n,{query:l,authMode:"anonymous"}).then((e=>{if(!1===e.data.valid)throw new a.Z("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&&e.details.httpStatus;if(498===t)throw i.destroy(),new a.Z("identity-manager:not-authenticated","User is not signed in.");if(400===t)throw new a.Z("identity-manager:invalid-request");return{credential:i}}))})).then((e=>({credential:e.credential,viewOnly:s})))}setOAuthResponseHash(e){e&&("#"===e.charAt(0)&&(e=e.substring(1)),this._processOAuthPopupParams((0,m.u0)(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,t,r={}){const s=(0,u.hh)(),i=()=>{l?.remove(),h?.remove(),d?.remove(),o?.destroy(),this.dialog?.destroy(),this.dialog=o=l=h=d=null},n=()=>{i(),this._oAuthDfd=null,s.reject(new a.Z("identity-manager:user-aborted","ABORTED"))};r.signal&&(0,u.fu)(r.signal,(()=>{n()}));let o=new this.formConstructor;o.resource=this.getResourceName(e),o.server=t.server,this.dialog=new Ge,this.dialog.content=o,this.dialog.open=!0,this.emit("dialog-create");let l=o.on("cancel",n),h=(0,p.YP)((()=>this.dialog.open),n),d=o.on("submit",(e=>{this.generateToken(t,e,{isAdmin:r.isAdmin,signal:r.signal}).then((n=>{i();const o=new ct({userId:e.username,server:t.server,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=>{o.error=e,o.signingIn=!1}))}));return s.promise}oAuthSignIn(e,t,r,s){this._oAuthDfd=(0,u.hh)();const i=this._oAuthDfd;let n;s?.signal&&(0,u.fu)(s.signal,(()=>{const e=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;e&&!e.closed?e.close():this.dialog&&f()})),i.resUrl_=e,i.sinfo_=t,i.oinfo_=r;const o=r._oAuthCred;if(o.storage&&("authorization-code"===r.flowType||"auto"===r.flowType&&!r.popup&&t.currentVersion>=8.4)){let e=crypto.getRandomValues(new Uint8Array(32));n=(0,m.rS)(e),o.codeVerifier=n,e=crypto.getRandomValues(new Uint8Array(32)),o.stateUID=(0,m.rS)(e),o.save()||(o.codeVerifier=n=null)}else o.codeVerifier=null;let l,h,d,c;this._getCodeChallenge(n).then((i=>{const n=!s||!1!==s.oAuthPopupConfirmation;r.popup&&n?(l=new this.formConstructor,l.oAuthPrompt=!0,l.server=t.server,this.dialog=new Ge,this.dialog.content=l,this.dialog.open=!0,this.emit("dialog-create"),h=l.on("cancel",f),d=(0,p.YP)((()=>this.dialog.open),f),c=l.on("submit",(()=>{g(),this._doOAuthSignIn(e,t,r,i)}))):this._doOAuthSignIn(e,t,r,i)}));const f=()=>{g(),this._oAuthDfd=null,i.reject(new a.Z("identity-manager:user-aborted","ABORTED"))},g=()=>{h?.remove(),d?.remove(),c?.remove(),l?.destroy(),this.dialog?.destroy(),this.dialog=null};return i.promise}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,h.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.charAt(0)&&(e=e.substring(1));const t=(0,m.u0)(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.charAt(0)&&(t=t.substring(1));const e=(0,m.u0)(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,m.B7)(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,o.default)(`${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))}_getCodeChallenge(e){if(e&&globalThis.isSecureContext){const t=(new TextEncoder).encode(e);return crypto.subtle.digest("SHA-256",t).then((e=>(0,m.rS)(new Uint8Array(e))))}return Promise.resolve(null)}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const e=new a.Z("identity-manager:user-aborted","ABORTED");this._errbackFunc(e)}}_findCredential(e,t){let r,s,i,n,o=-1;const a=t&&t.token,l=t&&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&&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&&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&&t.isAdmin&&!(0,m.D6)(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&"10.1"===String(e.currentVersion)&&!(0,m.D6)(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const t=new m.R9(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,it.P)(t)||(r=t.indexOf("/sharing")),-1===r&&"/"===t.substr(-1)&&(r=t.length-1),r>-1?e.substring(0,r):e}_hasSameServerInstance(e,t){return"/"===e.substr(-1)&&(e=e.slice(0,-1)),e=e.toLowerCase(),t=this._getServerInstanceRoot(t).toLowerCase(),e=this._normalizeAGOLorgDomain(e),t=this._normalizeAGOLorgDomain(t),(e=e.substr(e.indexOf(":")))===t.substr(t.indexOf(":"))}_normalizeAGOLorgDomain(e){const t=/^https?:\/\/(?:cdn|[a-z\d-]+\.maps)\.arcgis\.com/i,r=/^https?:\/\/(?:cdndev|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,s=/^https?:\/\/(?:cdnqa|[a-z\d-]+\.mapsqa)\.arcgis\.com/i;return t.test(e)?e=e.replace(t,"https://www.arcgis.com"):r.test(e)?e=e.replace(r,"https://devext.arcgis.com"):s.test(e)&&(e=e.replace(s,"https://qaext.arcgis.com")),e}_sanitizeUrl(e){const t=(n.Z.request.proxyUrl||"").toLowerCase(),r=t?e.toLowerCase().indexOf(t+"?"):-1;return-1!==r&&(e=e.substring(r+t.length+1)),e=(0,m.Fv)(e),(0,m.mN)(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.replace(e,"$1")===i.replace(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 m.R9(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||n.Z.portalUrl&&(s=(0,m.D6)(t,n.Z.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&&r.owningSystemUrl;s&&ot(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,o.default)(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.substring(0,s)+this._gwTokenUrl)),t||(t=this._getOrigin(e)+this._gwTokenUrl),t){const r=new m.R9(e).port;/^http:\/\//i.test(e)&&"7080"===r&&(t=t.replace(/:7080/i,":7443")),t=t.replace(/http:/i,"https:")}return t}if(e.toLowerCase().includes("premium.arcgisonline.com"))return"https://premium.arcgisonline.com/server/tokens"}_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 ct({userId:i.username,server:r.server,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?lt:ht,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 ct({userId:e.username,server:r.server,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?lt:ht,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 a.Z(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.charAt(0)&&(e=e.substring(1)),this._processOAuthPopupParams((0,m.u0)(e)))}_exchangeToken(e,t,r){return(0,o.default)(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:t,token:r}}).then((e=>e.data.token))}_getPlatformSelf(e,t){return e=e.replace(/^http:/i,"https:"),(0,o.default)(`${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}).then((e=>e.data))}_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,o.default)(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,m.D6)(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,m.ed)(n)&&(i=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:t}),!i)&&r(new a.Z("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=(0,u.hh)()),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_&&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,o,l)=>{const d=e.sinfo_,c=!e.options_||!1!==e.options_.prompt,p=d.hasPortal&&this._findOAuthInfo(e.resUrl_);let f,g;if(i)t(new ct({userId:i,server:d.server,token:o||null,expires:null!=l?Number(l):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,h.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 a.Z("identity-manager:credential-request-failed","Parent application's token has expired.")):t(new ct(e.data.credential))):"arcgis:auth:error"===e.data.type&&(s.remove(),"tokenExpiredError"===e.data.error.name?r(new a.Z("identity-manager:credential-request-failed","Parent application's token has expired.")):r(a.Z.fromJSON(e.data.error))))}));(0,u.fu)(e.options_?.signal,(()=>{s.remove()}))}else if(p){let i=p._oAuthCred;if(!i){const e=new Ke(p,lt),t=new Ke(p,ht);e.isValid()&&t.isValid()?e.expires>t.expires?(i=e,t.destroy()):(i=t,e.destroy()):i=e.isValid()?e:t,p._oAuthCred=i}if(i.isValid()){f=new ct({userId:i.userId,server:d.server,token:i.token,expires:i.expires,ssl:i.ssl,_oAuthCred:i});const r=p.appId!==i.appId&&this._doPortalSignIn(e.resUrl_);r||i.refreshToken?(e._pendingDfd=i.refreshToken?this._getOAuthToken(d.server,i.refreshToken,i.appId).then((e=>(f.expires=Date.now()+1e3*e.expires_in,f.token=e.access_token,f))):Promise.resolve(f),e._pendingDfd.then((e=>r?this._exchangeToken(e.server,p.appId,e.token).then((t=>(e.token=t,e))).catch((()=>e)):e)).then((e=>{t(e)})).catch((()=>{i?.destroy(),s()}))):t(f)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(p.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,p,d).then((e=>{t(e)})).catch(r)}else{const s=()=>{c?e._pendingDfd=this.oAuthSignIn(e.resUrl_,d,p,e.options_).then(t,r):(g=new a.Z("identity-manager:not-authenticated","User is not signed in."),r(g))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(d.server,p.appId).then((e=>{(0,m.D6)(e.portalUrl,this._appOrigin,!0)?(f=new ct({userId:e.username,server:d.server,expires:Date.now()+1e3*e.expires_in,token:e.token}),t(f)):s()})).catch(s):s()}}else if(c){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 g=new a.Z("identity-manager:not-authenticated","User is not signed in."),r(g)},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(at(s,this._legacyFed)){const e=h.toJSON();e.server=s.server,e.resources=null,t(new ct(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 ct({userId:h?.userId,server:s.server,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,o=this._isServerRsrc(e.resUrl_),l=e.sinfo_._restInfoPms;l?l.promise.then((t=>{const r=e.sinfo_;if(r._restInfoPms){r.adminTokenServiceUrl=r._restInfoPms.adminUrl,r._restInfoPms=null,r.tokenServiceUrl=((0,c.hS)("authInfo.tokenServicesUrl",t)||(0,c.hS)("authInfo.tokenServiceUrl",t)||(0,c.hS)("tokenServiceUrl",t))??null,r.shortLivedTokenValidity=(0,c.hS)("authInfo.shortLivedTokenValidity",t)??null,r.currentVersion=t.currentVersion,r.owningTenant=t.owningTenant;const e=r.owningSystemUrl=t.owningSystemUrl;e&&this._portals.push(e)}o&&r.owningSystemUrl?i():s()}),(()=>{e.sinfo_._restInfoPms=null;const t=new a.Z("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");r(t)})):o&&n?i():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then((t=>{const r={};let s,i,n,o;return t&&(s=t.user&&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&&e.token,r.tokenExpiration=e&&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,n=e.owningTenant,a=!this._defaultOAuthInfo&&this._createDefaultOAuthInfo&&!this._hasTestedIfAppIsOnPortal;if(a){r=window.location.href;let e=r.indexOf("?");e>-1&&(r=r.slice(0,e)),e=r.search(/\/(apps|home)\//),r=e>-1?r.slice(0,e):null}return a&&r?(this._hasTestedIfAppIsOnPortal=!0,t=(0,o.default)(r+"/sharing/rest",{query:{f:"json"}}).then((()=>{this._defaultOAuthInfo=new tt({appId:"arcgisonline",popupCallbackUrl:r+"/home/oauth-callback.html"})}))):t=Promise.resolve(),t.then((()=>{if(this._defaultOAuthInfo)return s=s.replace(/^http:/i,"https:"),(0,o.default)(s+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:n,client_id:this._defaultOAuthInfo.appId,redirect_uri:(0,m.hF)(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,m.D6)(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 o={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&&(o.force_login=!0),r.forceUserId&&r.userId&&(o.prepopulatedusername=r.userId),!r.popup&&this._doPortalSignIn(e)&&(o.redirectToUserOrgUrl=!0),i.codeVerifier&&(o.code_challenge=s||i.codeVerifier,o.code_challenge_method=s?"S256":"plain");const l=r.portalUrl.replace(/^http:/i,"https:")+"/sharing/oauth2/authorize",d=l+"?"+(0,m.B7)(o);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 a.Z("identity-manager:user-aborted","ABORTED");e.reject(t)}}}),500),this._oAuthOnPopupHandle=(0,h.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 a.Z("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(e)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:o,authorizeUrl:l,resourceUrl:e,serverInfo:t,oAuthInfo:r}):window.location.href=d}_getRedirectURI(e,t){const r=window.location.href.replace(/#.*$/,"");if(e.popup)return(0,m.hF)(e.popupCallbackUrl);if(t){const e=(0,m.mN)(r);return e.query&&["code","error","error_description","message_code","persist","state"].forEach((t=>{delete e.query[t]})),(0,m.fl)(e.path,e.query)}return r}}dt.prototype.declaredClass="esri.identity.IdentityManagerBase";let ct=class extends l.Z.EventedAccessor{constructor(e){super(e),this._oAuthCred=null,this.tokenRefreshBuffer=2,e&&e._oAuthCred&&(this._oAuthCred=e._oAuthCred)}initialize(){this.resources=this.resources||[],null==this.creationTime&&(this.creationTime=Date.now())}refreshToken(){const e=s.id.findServerInfo(this.server),t=e&&e.owningSystemUrl,r=!!t&&"server"===this.scope,i=r&&at(e,s.id._legacyFed),n=e.webTierAuth,o=n&&s.id.normalizeWebTierAuth,a=nt[this.server],l=a&&a[this.userId];let h,d=this.resources&&this.resources[0],c=r?s.id.findServerInfo(t):null,u={username:this.userId,password:l};if(n&&!o)return;r&&!c&&s.id.serverInfos.some((e=>(s.id._isIdProvider(t,e.server)&&(c=e),!!c)));const p=c?s.id.findCredential(c.server,this.userId):null;if(!r||p){if(!i){if(r)h={serverUrl:d,token:p&&p.token,ssl:p&&p.ssl};else if(o)u=null,h={ssl:this.ssl};else{if(!l){let t;return d&&(d=s.id._sanitizeUrl(d),this._enqueued=1,t=s.id._enqueue(d,e,null,null,this.isAdmin,this),t.then((()=>{this._enqueued=0,this.refreshServerTokens()})).catch((()=>{this._enqueued=0}))),t}this.isAdmin&&(h={isAdmin:!0})}return s.id.generateToken(r?c:e,r?null:u,h).then((e=>{this.token=e.token,this.expires=null!=e.expires?Number(e.expires):null,this.creationTime=Date.now(),this.validity=e.validity,this.emitTokenChange(),this.refreshServerTokens()})).catch((()=>{}))}p?.refreshToken()}}refreshServerTokens(){"portal"===this.scope&&s.id.credentials.forEach((e=>{const t=s.id.findServerInfo(e.server),r=t&&t.owningSystemUrl;e!==this&&e.userId===this.userId&&r&&"server"===e.scope&&(s.id._hasSameServerInstance(this.server,r)||s.id._isIdProvider(r,this.server))&&(at(t,s.id._legacyFed)?(e.token=this.token,e.expires=this.expires,e.creationTime=this.creationTime,e.validity=this.validity,e.emitTokenChange()):e.refreshToken())}))}emitTokenChange(e){clearTimeout(this._refreshTimer);const t=this.server&&s.id.findServerInfo(this.server),r=t&&t.owningSystemUrl,i=r&&s.id.findServerInfo(r);!1===e||r&&"portal"!==this.scope&&(!i||!i.webTierAuth||s.id.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.credentials.indexOf(this);e>-1&&s.id.credentials.splice(e,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const e=(0,d.yd)({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,i._)([(0,f.Cb)()],ct.prototype,"creationTime",void 0),(0,i._)([(0,f.Cb)()],ct.prototype,"expires",void 0),(0,i._)([(0,f.Cb)()],ct.prototype,"isAdmin",void 0),(0,i._)([(0,f.Cb)()],ct.prototype,"oAuthState",void 0),(0,i._)([(0,f.Cb)()],ct.prototype,"resources",void 0),(0,i._)([(0,f.Cb)()],ct.prototype,"scope",void 0),(0,i._)([(0,f.Cb)()],ct.prototype,"server",void 0),(0,i._)([(0,f.Cb)()],ct.prototype,"ssl",void 0),(0,i._)([(0,f.Cb)()],ct.prototype,"token",void 0),(0,i._)([(0,f.Cb)()],ct.prototype,"tokenRefreshBuffer",void 0),(0,i._)([(0,f.Cb)()],ct.prototype,"userId",void 0),(0,i._)([(0,f.Cb)()],ct.prototype,"validity",void 0),ct=(0,i._)([(0,g.j)("esri.identity.Credential")],ct);class ut extends dt{}ut.prototype.declaredClass="esri.identity.IdentityManager";const pt=new ut;(0,s.qh)(pt)},2587:(e,t,r)=>{"use strict";r(90344),r(18848),r(940),r(70171);var s=r(94443),i=r(3172),n=r(20102),o=r(70586);async function a(e){if((0,o.pC)(h.fetchBundleAsset))return h.fetchBundleAsset(e);const t=await(0,i.default)(e,{responseType:"text"});return JSON.parse(t.data)}class l{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,i){const o=t.exec(r);if(!o)throw new n.Z("esri-intl:invalid-bundle",`Bundle id "${r}" is not compatible with the pattern "${t}"`);const l=o[1]?`${o[1]}/`:"",h=o[2],d=(0,s.Su)(i),c=`${l}${h}.json`,u=d?`${l}${h}_${d}.json`:c;let p;try{p=await a(e(u))}catch(t){if(u===c)throw new n.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:t});try{p=await a(e(c))}catch(e){throw new n.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:e})}}return p}(this.getAssetUrl,this.matcher,e,t)}}const h={};var d,c=r(99880);(0,s.tz)((d={pattern:"esri/",location:c.V},new l(d)))},90344:(e,t,r)=>{"use strict";r.d(t,{Ze:()=>g,p6:()=>_});var s=r(35454),i=r(70171);const n={year:"numeric",month:"numeric",day:"numeric"},o={year:"numeric",month:"long",day:"numeric"},a={year:"numeric",month:"short",day:"numeric"},l={year:"numeric",month:"long",weekday:"long",day:"numeric"},h={hour:"numeric",minute:"numeric"},d={...h,second:"numeric"},c={"short-date":n,"short-date-short-time":{...n,...h},"short-date-short-time-24":{...n,...h,hour12:!1},"short-date-long-time":{...n,...d},"short-date-long-time-24":{...n,...d,hour12:!1},"short-date-le":n,"short-date-le-short-time":{...n,...h},"short-date-le-short-time-24":{...n,...h,hour12:!1},"short-date-le-long-time":{...n,...d},"short-date-le-long-time-24":{...n,...d,hour12:!1},"long-month-day-year":o,"long-month-day-year-short-time":{...o,...h},"long-month-day-year-short-time-24":{...o,...h,hour12:!1},"long-month-day-year-long-time":{...o,...d},"long-month-day-year-long-time-24":{...o,...d,hour12:!1},"day-short-month-year":a,"day-short-month-year-short-time":{...a,...h},"day-short-month-year-short-time-24":{...a,...h,hour12:!1},"day-short-month-year-long-time":{...a,...d},"day-short-month-year-long-time-24":{...a,...d,hour12:!1},"long-date":l,"long-date-short-time":{...l,...h},"long-date-short-time-24":{...l,...h,hour12:!1},"long-date-long-time":{...l,...d},"long-date-long-time-24":{...l,...d,hour12:!1},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":h,"long-time":d},u=(0,s.w)()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"}),p=(u.apiValues,u.toJSON.bind(u),u.fromJSON.bind(u),{ar:"ar-u-nu-latn-ca-gregory"});let m=new WeakMap,f=c["short-date-short-time"];function g(e){return e?c[e]:null}function _(e,t){return function(e){const t=e||f;let r=m.get(t);if(!r){const e=(0,i.Kd)(),s=p[(0,i.Kd)()]||e;r=new Intl.DateTimeFormat(s,t),m.set(t,r)}return r}(t).format(e)}(0,i.Ze)((()=>{m=new WeakMap,f=c["short-date-short-time"]}))},70171:(e,t,r)=>{"use strict";let s;r.d(t,{Kd:()=>o,Ze:()=>d,qe:()=>l});const i=globalThis.esriConfig?.locale??globalThis.dojoConfig?.locale;function n(){return i??globalThis.navigator?.language??"en"}function o(){return void 0===s&&(s=n()),s}const a=[];function l(e){return a.push(e),{remove(){a.splice(a.indexOf(e),1)}}}const h=[];function d(e){return h.push(e),{remove(){a.splice(h.indexOf(e),1)}}}globalThis.addEventListener?.("languagechange",(function(){const e=n();s!==e&&(s=e,[...h].forEach((t=>{t.call(null,e)})),[...a].forEach((t=>{t.call(null,e)})))}))},94443:(e,t,r)=>{"use strict";r.d(t,{ME:()=>p,Su:()=>m,tz:()=>u});var s=r(20102),i=r(95330),n=r(70171);const o=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,a={ar:!0,bg:!0,bs:!0,ca:!0,cs:!0,da:!0,de:!0,el:!0,en:!0,es:!0,et:!0,fi:!0,fr:!0,he:!0,hr:!0,hu:!0,id:!0,it:!0,ja:!0,ko:!0,lt:!0,lv:!0,nb:!0,nl:!0,pl:!0,"pt-BR":!0,"pt-PT":!0,ro:!0,ru:!0,sk:!0,sl:!0,sr:!0,sv:!0,th:!0,tr:!0,uk:!0,vi:!0,"zh-CN":!0,"zh-HK":!0,"zh-TW":!0};function l(e){return a[e]??!1}const h=[],d=new Map;function c(e){for(const t of d.keys())f(e.pattern,t)&&d.delete(t)}function u(e){return h.includes(e)||(c(e),h.unshift(e)),{remove(){const t=h.indexOf(e);t>-1&&(h.splice(t,1),c(e))}}}async function p(e){const t=(0,n.Kd)();d.has(e)||d.set(e,async function(e,t){const r=[];for(const s of h)if(f(s.pattern,e))try{return await s.fetchMessageBundle(e,t)}catch(e){r.push(e)}if(r.length)throw new s.Z("intl:message-bundle-error",`Errors occurred while loading "${e}"`,{errors:r});throw new s.Z("intl:no-message-bundle-loader",`No loader found for message bundle "${e}"`)}(e,t));const r=d.get(e);return r&&await g.add(r),r}function m(e){if(!o.test(e))return null;const t=o.exec(e);if(null===t)return null;const[,r,s]=t,i=r+(s?"-"+s.toUpperCase():"");return l(i)?i:l(r)?r:null}function f(e,t){return"string"==typeof e?t.startsWith(e):e.test(t)}(0,n.Ze)((()=>{d.clear()}));const g=new class{constructor(){this._numLoading=0,this._dfd=null}async waitForAll(){this._dfd&&await this._dfd.promise}add(e){return this._increase(),e.then((()=>this._decrease()),(()=>this._decrease())),this.waitForAll()}_increase(){this._numLoading++,this._dfd||(this._dfd=(0,i.dD)())}_decrease(){this._numLoading=Math.max(this._numLoading-1,0),this._dfd&&0===this._numLoading&&(this._dfd.resolve(),this._dfd=null)}}},18848:(e,t,r)=>{"use strict";r.d(t,{sh:()=>l,uf:()=>h});var s=r(70586),i=r(70171);const n={ar:"ar-u-nu-latn"};let o=new WeakMap,a={};function l(e={}){const t={};return null!=e.digitSeparator&&(t.useGrouping=e.digitSeparator),null!=e.places&&(t.minimumFractionDigits=t.maximumFractionDigits=e.places),t}function h(e,t){return-0===e&&(e=0),function(e){const t=e||a;if(!o.has(t)){const r=(0,i.Kd)(),s=n[(0,i.Kd)()]||r;o.set(t,new Intl.NumberFormat(s,e))}return(0,s.j0)(o.get(t))}(t).format(e)}(0,i.Ze)((()=>{o=new WeakMap,a={}}))},940:(e,t,r)=>{"use strict";r.d(t,{n:()=>h});var s=r(92604),i=r(78286),n=r(19153),o=r(90344),a=r(18848);const l=s.Z.getLogger("esri.intl.substitute");function h(e,t,r={}){const{format:s={}}=r;return(0,n.gx)(e,(e=>function(e,t,r){let s,n;const o=e.indexOf(":");if(-1===o?s=e.trim():(s=e.slice(0,o).trim(),n=e.slice(o+1).trim()),!s)return"";const a=(0,i.hS)(s,t);if(null==a)return"";const l=(n?r?.[n]:null)??r?.[s];return l?d(a,l):n?c(a,n):u(a)}(e,t,s)))}function d(e,t){switch(t.type){case"date":return(0,o.p6)(e,t.intlOptions);case"number":return(0,a.uf)(e,t.intlOptions);default:return l.warn("missing format descriptor for key {key}"),u(e)}}function c(e,t){switch(t.toLowerCase()){case"dateformat":return(0,o.p6)(e);case"numberformat":return(0,a.uf)(e);default:return l.warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?(0,o.p6)(e):/^numberformat/i.test(t)?(0,a.uf)(e):u(e)}}function u(e){switch(typeof e){case"string":return e;case"number":return(0,a.uf)(e);case"boolean":return""+e;default:return e instanceof Date?(0,o.p6)(e):""}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4370,3172,9880,661],{22303:(e,t,r)=>{r.d(t,{Z:()=>m});var n,s,a=r(35270),o=r(22021),i=r(70586),l=r(75215);function u(e){return(0,o.uZ)((0,l.vU)(e),0,255)}function c(e,t,r){return e=Number(e),isNaN(e)?r:e<t?t:e>r?r:e}class h{constructor(e){this.r=255,this.g=255,this.b=255,this.a=1,e&&this.setColor(e)}static blendColors(e,t,r,n=new h){return n.r=Math.round(e.r+(t.r-e.r)*r),n.g=Math.round(e.g+(t.g-e.g)*r),n.b=Math.round(e.b+(t.b-e.b)*r),n.a=e.a+(t.a-e.a)*r,n._sanitize()}static fromRgb(e,t){const r=e.toLowerCase().match(/^(rgba?|hsla?)\(([\s\.\-,%0-9]+)\)/);if(r){const e=r[2].split(/\s*,\s*/),n=r[1];if("rgb"===n&&3===e.length||"rgba"===n&&4===e.length){const r=e[0];if("%"===r.charAt(r.length-1)){const r=e.map((e=>2.56*parseFloat(e)));return 4===e.length&&(r[3]=parseFloat(e[3])),h.fromArray(r,t)}return h.fromArray(e.map((e=>parseFloat(e))),t)}if("hsl"===n&&3===e.length||"hsla"===n&&4===e.length)return h.fromArray((0,a.B7)(parseFloat(e[0]),parseFloat(e[1])/100,parseFloat(e[2])/100,parseFloat(e[3])),t)}return null}static fromHex(e,t=new h){if(4!==e.length&&7!==e.length||"#"!==e[0])return null;const r=4===e.length?4:8,n=(1<<r)-1;let s=Number("0x"+e.substr(1));return isNaN(s)?null:(["b","g","r"].forEach((e=>{const a=s&n;s>>=r,t[e]=4===r?17*a:a})),t.a=1,t)}static fromArray(e,t=new h){return t._set(Number(e[0]),Number(e[1]),Number(e[2]),Number(e[3])),isNaN(t.a)&&(t.a=1),t._sanitize()}static fromString(e,t){const r=(0,a.St)(e)?(0,a.h$)(e):null;return r&&h.fromArray(r,t)||h.fromRgb(e,t)||h.fromHex(e,t)}static fromJSON(e){return e&&new h([e[0],e[1],e[2],e[3]/255])}static toUnitRGB(e){return(0,i.pC)(e)?[e.r/255,e.g/255,e.b/255]:null}static toUnitRGBA(e){return(0,i.pC)(e)?[e.r/255,e.g/255,e.b/255,null!=e.a?e.a:1]:null}get isBright(){return.299*this.r+.587*this.g+.114*this.b>=127}setColor(e){return"string"==typeof e?h.fromString(e,this):Array.isArray(e)?h.fromArray(e,this):(this._set(e.r??0,e.g??0,e.b??0,e.a??1),e instanceof h||this._sanitize()),this}toRgb(){return[this.r,this.g,this.b]}toRgba(){return[this.r,this.g,this.b,this.a]}toHex(){const e=this.r.toString(16),t=this.g.toString(16),r=this.b.toString(16);return`#${e.length<2?"0"+e:e}${t.length<2?"0"+t:t}${r.length<2?"0"+r:r}`}toCss(e=!1){const t=this.r+", "+this.g+", "+this.b;return e?`rgba(${t}, ${this.a})`:`rgb(${t})`}toString(){return this.toCss(!0)}toJSON(){return this.toArray()}toArray(e=h.AlphaMode.ALWAYS){const t=u(this.r),r=u(this.g),n=u(this.b);return e===h.AlphaMode.ALWAYS||1!==this.a?[t,r,n,u(255*this.a)]:[t,r,n]}clone(){return new h(this.toRgba())}hash(){return this.r<<24|this.g<<16|this.b<<8|255*this.a}equals(e){return(0,i.pC)(e)&&e.r===this.r&&e.g===this.g&&e.b===this.b&&e.a===this.a}_sanitize(){return this.r=Math.round(c(this.r,0,255)),this.g=Math.round(c(this.g,0,255)),this.b=Math.round(c(this.b,0,255)),this.a=c(this.a,0,1),this}_set(e,t,r,n){this.r=e,this.g=t,this.b=r,this.a=n}}h.prototype.declaredClass="esri.Color",n=h||(h={}),(s=n.AlphaMode||(n.AlphaMode={}))[s.ALWAYS=0]="ALWAYS",s[s.UNLESS_OPAQUE=1]="UNLESS_OPAQUE";const m=h},99880:(e,t,r)=>{r.d(t,{V:()=>l});var n=r(68773),s=(r(3172),r(20102)),a=r(92604),o=r(17452);const i=a.Z.getLogger("esri.assets");function l(e){if(!n.Z.assetsPath)throw i.errorOnce("The API assets location needs to be set using config.assetsPath. More information: https://arcg.is/1OzLe50"),new s.Z("assets:path-not-set","config.assetsPath is not set");return(0,o.v_)(n.Z.assetsPath,e)}},52138:(e,t,r)=>{r.d(t,{a:()=>l,d:()=>f,e:()=>m,f:()=>d,g:()=>b,h:()=>v,i:()=>o,j:()=>M,k:()=>h,m:()=>u,s:()=>a,t:()=>i,v:()=>c,x:()=>S,y:()=>p});var n=r(65617),s=r(46851);function a(e,t,r,n,s,a,o,i,l,u,c,h,m,d,f,p,g){return e[0]=t,e[1]=r,e[2]=n,e[3]=s,e[4]=a,e[5]=o,e[6]=i,e[7]=l,e[8]=u,e[9]=c,e[10]=h,e[11]=m,e[12]=d,e[13]=f,e[14]=p,e[15]=g,e}function o(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function i(e,t){if(e===t){const r=t[1],n=t[2],s=t[3],a=t[6],o=t[7],i=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=a,e[11]=t[14],e[12]=s,e[13]=o,e[14]=i}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function l(e,t){const r=t[0],n=t[1],s=t[2],a=t[3],o=t[4],i=t[5],l=t[6],u=t[7],c=t[8],h=t[9],m=t[10],d=t[11],f=t[12],p=t[13],g=t[14],y=t[15],b=r*i-n*o,w=r*l-s*o,M=r*u-a*o,v=n*l-s*i,S=n*u-a*i,k=s*u-a*l,q=c*p-h*f,x=c*g-m*f,O=c*y-d*f,C=h*g-m*p,U=h*y-d*p,T=m*y-d*g;let P=b*T-w*U+M*C+v*O-S*x+k*q;return P?(P=1/P,e[0]=(i*T-l*U+u*C)*P,e[1]=(s*U-n*T-a*C)*P,e[2]=(p*k-g*S+y*v)*P,e[3]=(m*S-h*k-d*v)*P,e[4]=(l*O-o*T-u*x)*P,e[5]=(r*T-s*O+a*x)*P,e[6]=(g*M-f*k-y*w)*P,e[7]=(c*k-m*M+d*w)*P,e[8]=(o*U-i*O+u*q)*P,e[9]=(n*O-r*U-a*q)*P,e[10]=(f*S-p*M+y*b)*P,e[11]=(h*M-c*S-d*b)*P,e[12]=(i*x-o*C-l*q)*P,e[13]=(r*C-n*x+s*q)*P,e[14]=(p*w-f*v-g*b)*P,e[15]=(c*v-h*w+m*b)*P,e):null}function u(e,t,r){const n=t[0],s=t[1],a=t[2],o=t[3],i=t[4],l=t[5],u=t[6],c=t[7],h=t[8],m=t[9],d=t[10],f=t[11],p=t[12],g=t[13],y=t[14],b=t[15];let w=r[0],M=r[1],v=r[2],S=r[3];return e[0]=w*n+M*i+v*h+S*p,e[1]=w*s+M*l+v*m+S*g,e[2]=w*a+M*u+v*d+S*y,e[3]=w*o+M*c+v*f+S*b,w=r[4],M=r[5],v=r[6],S=r[7],e[4]=w*n+M*i+v*h+S*p,e[5]=w*s+M*l+v*m+S*g,e[6]=w*a+M*u+v*d+S*y,e[7]=w*o+M*c+v*f+S*b,w=r[8],M=r[9],v=r[10],S=r[11],e[8]=w*n+M*i+v*h+S*p,e[9]=w*s+M*l+v*m+S*g,e[10]=w*a+M*u+v*d+S*y,e[11]=w*o+M*c+v*f+S*b,w=r[12],M=r[13],v=r[14],S=r[15],e[12]=w*n+M*i+v*h+S*p,e[13]=w*s+M*l+v*m+S*g,e[14]=w*a+M*u+v*d+S*y,e[15]=w*o+M*c+v*f+S*b,e}function c(e,t,r){const n=r[0],s=r[1],a=r[2];if(t===e)e[12]=t[0]*n+t[4]*s+t[8]*a+t[12],e[13]=t[1]*n+t[5]*s+t[9]*a+t[13],e[14]=t[2]*n+t[6]*s+t[10]*a+t[14],e[15]=t[3]*n+t[7]*s+t[11]*a+t[15];else{const r=t[0],o=t[1],i=t[2],l=t[3],u=t[4],c=t[5],h=t[6],m=t[7],d=t[8],f=t[9],p=t[10],g=t[11];e[0]=r,e[1]=o,e[2]=i,e[3]=l,e[4]=u,e[5]=c,e[6]=h,e[7]=m,e[8]=d,e[9]=f,e[10]=p,e[11]=g,e[12]=r*n+u*s+d*a+t[12],e[13]=o*n+c*s+f*a+t[13],e[14]=i*n+h*s+p*a+t[14],e[15]=l*n+m*s+g*a+t[15]}return e}function h(e,t,r){const n=r[0],s=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*s,e[5]=t[5]*s,e[6]=t[6]*s,e[7]=t[7]*s,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function m(e,t,r,n){let a,o,i,l,u,c,h,m,d,f,p,g,y,b,w,M,v,S,k,q,x,O,C,U,T=n[0],P=n[1],Z=n[2],B=Math.sqrt(T*T+P*P+Z*Z);return B<(0,s.g)()?null:(B=1/B,T*=B,P*=B,Z*=B,a=Math.sin(r),o=Math.cos(r),i=1-o,l=t[0],u=t[1],c=t[2],h=t[3],m=t[4],d=t[5],f=t[6],p=t[7],g=t[8],y=t[9],b=t[10],w=t[11],M=T*T*i+o,v=P*T*i+Z*a,S=Z*T*i-P*a,k=T*P*i-Z*a,q=P*P*i+o,x=Z*P*i+T*a,O=T*Z*i+P*a,C=P*Z*i-T*a,U=Z*Z*i+o,e[0]=l*M+m*v+g*S,e[1]=u*M+d*v+y*S,e[2]=c*M+f*v+b*S,e[3]=h*M+p*v+w*S,e[4]=l*k+m*q+g*x,e[5]=u*k+d*q+y*x,e[6]=c*k+f*q+b*x,e[7]=h*k+p*q+w*x,e[8]=l*O+m*C+g*U,e[9]=u*O+d*C+y*U,e[10]=c*O+f*C+b*U,e[11]=h*O+p*C+w*U,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function d(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function f(e,t,r){if(0===t)return o(e);let n,a,i,l=r[0],u=r[1],c=r[2],h=Math.sqrt(l*l+u*u+c*c);return h<(0,s.g)()?null:(h=1/h,l*=h,u*=h,c*=h,n=Math.sin(t),a=Math.cos(t),i=1-a,e[0]=l*l*i+a,e[1]=u*l*i+c*n,e[2]=c*l*i-u*n,e[3]=0,e[4]=l*u*i-c*n,e[5]=u*u*i+a,e[6]=c*u*i+l*n,e[7]=0,e[8]=l*c*i+u*n,e[9]=u*c*i-l*n,e[10]=c*c*i+a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function p(e,t){const r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function g(e,t,r){const n=t[0],s=t[1],a=t[2],o=t[3],i=n+n,l=s+s,u=a+a,c=n*i,h=n*l,m=n*u,d=s*l,f=s*u,p=a*u,g=o*i,y=o*l,b=o*u;return e[0]=1-(d+p),e[1]=h+b,e[2]=m-y,e[3]=0,e[4]=h-b,e[5]=1-(c+p),e[6]=f+g,e[7]=0,e[8]=m+y,e[9]=f-g,e[10]=1-(c+d),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}const y=(0,n.c)();function b(e,t,r,n){const s=t[0],a=t[1],o=t[2],i=t[3],l=s+s,u=a+a,c=o+o,h=s*l,m=s*u,d=s*c,f=a*u,p=a*c,g=o*c,y=i*l,b=i*u,w=i*c,M=n[0],v=n[1],S=n[2];return e[0]=(1-(f+g))*M,e[1]=(m+w)*M,e[2]=(d-b)*M,e[3]=0,e[4]=(m-w)*v,e[5]=(1-(h+g))*v,e[6]=(p+y)*v,e[7]=0,e[8]=(d+b)*S,e[9]=(p-y)*S,e[10]=(1-(h+f))*S,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function w(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function M(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function v(e,t){if(e===t)return!0;const r=e[0],n=e[1],a=e[2],o=e[3],i=e[4],l=e[5],u=e[6],c=e[7],h=e[8],m=e[9],d=e[10],f=e[11],p=e[12],g=e[13],y=e[14],b=e[15],w=t[0],M=t[1],v=t[2],S=t[3],k=t[4],q=t[5],x=t[6],O=t[7],C=t[8],U=t[9],T=t[10],P=t[11],Z=t[12],B=t[13],E=t[14],N=t[15],A=(0,s.g)();return Math.abs(r-w)<=A*Math.max(1,Math.abs(r),Math.abs(w))&&Math.abs(n-M)<=A*Math.max(1,Math.abs(n),Math.abs(M))&&Math.abs(a-v)<=A*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(o-S)<=A*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(i-k)<=A*Math.max(1,Math.abs(i),Math.abs(k))&&Math.abs(l-q)<=A*Math.max(1,Math.abs(l),Math.abs(q))&&Math.abs(u-x)<=A*Math.max(1,Math.abs(u),Math.abs(x))&&Math.abs(c-O)<=A*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(h-C)<=A*Math.max(1,Math.abs(h),Math.abs(C))&&Math.abs(m-U)<=A*Math.max(1,Math.abs(m),Math.abs(U))&&Math.abs(d-T)<=A*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(f-P)<=A*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(p-Z)<=A*Math.max(1,Math.abs(p),Math.abs(Z))&&Math.abs(g-B)<=A*Math.max(1,Math.abs(g),Math.abs(B))&&Math.abs(y-E)<=A*Math.max(1,Math.abs(y),Math.abs(E))&&Math.abs(b-N)<=A*Math.max(1,Math.abs(b),Math.abs(N))}function S(e){const t=(0,s.g)(),r=e[0],n=e[1],a=e[2],o=e[4],i=e[5],l=e[6],u=e[8],c=e[9],h=e[10];return Math.abs(1-(r*r+o*o+u*u))<=t&&Math.abs(1-(n*n+i*i+c*c))<=t&&Math.abs(1-(a*a+l*l+h*h))<=t}const k=u,q=w;Object.freeze(Object.defineProperty({__proto__:null,copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},set:a,identity:o,transpose:i,invert:l,adjoint:function(e,t){const r=t[0],n=t[1],s=t[2],a=t[3],o=t[4],i=t[5],l=t[6],u=t[7],c=t[8],h=t[9],m=t[10],d=t[11],f=t[12],p=t[13],g=t[14],y=t[15];return e[0]=i*(m*y-d*g)-h*(l*y-u*g)+p*(l*d-u*m),e[1]=-(n*(m*y-d*g)-h*(s*y-a*g)+p*(s*d-a*m)),e[2]=n*(l*y-u*g)-i*(s*y-a*g)+p*(s*u-a*l),e[3]=-(n*(l*d-u*m)-i*(s*d-a*m)+h*(s*u-a*l)),e[4]=-(o*(m*y-d*g)-c*(l*y-u*g)+f*(l*d-u*m)),e[5]=r*(m*y-d*g)-c*(s*y-a*g)+f*(s*d-a*m),e[6]=-(r*(l*y-u*g)-o*(s*y-a*g)+f*(s*u-a*l)),e[7]=r*(l*d-u*m)-o*(s*d-a*m)+c*(s*u-a*l),e[8]=o*(h*y-d*p)-c*(i*y-u*p)+f*(i*d-u*h),e[9]=-(r*(h*y-d*p)-c*(n*y-a*p)+f*(n*d-a*h)),e[10]=r*(i*y-u*p)-o*(n*y-a*p)+f*(n*u-a*i),e[11]=-(r*(i*d-u*h)-o*(n*d-a*h)+c*(n*u-a*i)),e[12]=-(o*(h*g-m*p)-c*(i*g-l*p)+f*(i*m-l*h)),e[13]=r*(h*g-m*p)-c*(n*g-s*p)+f*(n*m-s*h),e[14]=-(r*(i*g-l*p)-o*(n*g-s*p)+f*(n*l-s*i)),e[15]=r*(i*m-l*h)-o*(n*m-s*h)+c*(n*l-s*i),e},determinant:function(e){const t=e[0],r=e[1],n=e[2],s=e[3],a=e[4],o=e[5],i=e[6],l=e[7],u=e[8],c=e[9],h=e[10],m=e[11],d=e[12],f=e[13],p=e[14],g=e[15];return(t*o-r*a)*(h*g-m*p)-(t*i-n*a)*(c*g-m*f)+(t*l-s*a)*(c*p-h*f)+(r*i-n*o)*(u*g-m*d)-(r*l-s*o)*(u*p-h*d)+(n*l-s*i)*(u*f-c*d)},multiply:u,translate:c,scale:h,rotate:m,rotateX:function(e,t,r){const n=Math.sin(r),s=Math.cos(r),a=t[4],o=t[5],i=t[6],l=t[7],u=t[8],c=t[9],h=t[10],m=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*s+u*n,e[5]=o*s+c*n,e[6]=i*s+h*n,e[7]=l*s+m*n,e[8]=u*s-a*n,e[9]=c*s-o*n,e[10]=h*s-i*n,e[11]=m*s-l*n,e},rotateY:function(e,t,r){const n=Math.sin(r),s=Math.cos(r),a=t[0],o=t[1],i=t[2],l=t[3],u=t[8],c=t[9],h=t[10],m=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*s-u*n,e[1]=o*s-c*n,e[2]=i*s-h*n,e[3]=l*s-m*n,e[8]=a*n+u*s,e[9]=o*n+c*s,e[10]=i*n+h*s,e[11]=l*n+m*s,e},rotateZ:function(e,t,r){const n=Math.sin(r),s=Math.cos(r),a=t[0],o=t[1],i=t[2],l=t[3],u=t[4],c=t[5],h=t[6],m=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*s+u*n,e[1]=o*s+c*n,e[2]=i*s+h*n,e[3]=l*s+m*n,e[4]=u*s-a*n,e[5]=c*s-o*n,e[6]=h*s-i*n,e[7]=m*s-l*n,e},fromTranslation:d,fromScaling:function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},fromRotation:f,fromXRotation:p,fromYRotation:function(e,t){const r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},fromZRotation:function(e,t){const r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},fromRotationTranslation:g,fromQuat2:function(e,t){const r=y,n=-t[0],s=-t[1],a=-t[2],o=t[3],i=t[4],l=t[5],u=t[6],c=t[7],h=n*n+s*s+a*a+o*o;return h>0?(r[0]=2*(i*o+c*n+l*a-u*s)/h,r[1]=2*(l*o+c*s+u*n-i*a)/h,r[2]=2*(u*o+c*a+i*s-l*n)/h):(r[0]=2*(i*o+c*n+l*a-u*s),r[1]=2*(l*o+c*s+u*n-i*a),r[2]=2*(u*o+c*a+i*s-l*n)),g(e,t,r),e},getTranslation:function(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e},getScaling:function(e,t){const r=t[0],n=t[1],s=t[2],a=t[4],o=t[5],i=t[6],l=t[8],u=t[9],c=t[10];return e[0]=Math.sqrt(r*r+n*n+s*s),e[1]=Math.sqrt(a*a+o*o+i*i),e[2]=Math.sqrt(l*l+u*u+c*c),e},getRotation:function(e,t){const r=t[0]+t[5]+t[10];let n=0;return r>0?(n=2*Math.sqrt(r+1),e[3]=.25*n,e[0]=(t[6]-t[9])/n,e[1]=(t[8]-t[2])/n,e[2]=(t[1]-t[4])/n):t[0]>t[5]&&t[0]>t[10]?(n=2*Math.sqrt(1+t[0]-t[5]-t[10]),e[3]=(t[6]-t[9])/n,e[0]=.25*n,e[1]=(t[1]+t[4])/n,e[2]=(t[8]+t[2])/n):t[5]>t[10]?(n=2*Math.sqrt(1+t[5]-t[0]-t[10]),e[3]=(t[8]-t[2])/n,e[0]=(t[1]+t[4])/n,e[1]=.25*n,e[2]=(t[6]+t[9])/n):(n=2*Math.sqrt(1+t[10]-t[0]-t[5]),e[3]=(t[1]-t[4])/n,e[0]=(t[8]+t[2])/n,e[1]=(t[6]+t[9])/n,e[2]=.25*n),e},fromRotationTranslationScale:b,fromRotationTranslationScaleOrigin:function(e,t,r,n,s){const a=t[0],o=t[1],i=t[2],l=t[3],u=a+a,c=o+o,h=i+i,m=a*u,d=a*c,f=a*h,p=o*c,g=o*h,y=i*h,b=l*u,w=l*c,M=l*h,v=n[0],S=n[1],k=n[2],q=s[0],x=s[1],O=s[2],C=(1-(p+y))*v,U=(d+M)*v,T=(f-w)*v,P=(d-M)*S,Z=(1-(m+y))*S,B=(g+b)*S,E=(f+w)*k,N=(g-b)*k,A=(1-(m+p))*k;return e[0]=C,e[1]=U,e[2]=T,e[3]=0,e[4]=P,e[5]=Z,e[6]=B,e[7]=0,e[8]=E,e[9]=N,e[10]=A,e[11]=0,e[12]=r[0]+q-(C*q+P*x+E*O),e[13]=r[1]+x-(U*q+Z*x+N*O),e[14]=r[2]+O-(T*q+B*x+A*O),e[15]=1,e},fromQuat:function(e,t){const r=t[0],n=t[1],s=t[2],a=t[3],o=r+r,i=n+n,l=s+s,u=r*o,c=n*o,h=n*i,m=s*o,d=s*i,f=s*l,p=a*o,g=a*i,y=a*l;return e[0]=1-h-f,e[1]=c+y,e[2]=m-g,e[3]=0,e[4]=c-y,e[5]=1-u-f,e[6]=d+p,e[7]=0,e[8]=m+g,e[9]=d-p,e[10]=1-u-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},frustum:function(e,t,r,n,s,a,o){const i=1/(r-t),l=1/(s-n),u=1/(a-o);return e[0]=2*a*i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*a*l,e[6]=0,e[7]=0,e[8]=(r+t)*i,e[9]=(s+n)*l,e[10]=(o+a)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*u,e[15]=0,e},perspective:function(e,t,r,n,s){const a=1/Math.tan(t/2);let o;return e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=s&&s!==1/0?(o=1/(n-s),e[10]=(s+n)*o,e[14]=2*s*n*o):(e[10]=-1,e[14]=-2*n),e},perspectiveFromFieldOfView:function(e,t,r,n){const s=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),i=Math.tan(t.rightDegrees*Math.PI/180),l=2/(o+i),u=2/(s+a);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=-(o-i)*l*.5,e[9]=(s-a)*u*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e},ortho:function(e,t,r,n,s,a,o){const i=1/(t-r),l=1/(n-s),u=1/(a-o);return e[0]=-2*i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+r)*i,e[13]=(s+n)*l,e[14]=(o+a)*u,e[15]=1,e},lookAt:function(e,t,r,n){let a,i,l,u,c,h,m,d,f,p;const g=t[0],y=t[1],b=t[2],w=n[0],M=n[1],v=n[2],S=r[0],k=r[1],q=r[2],x=(0,s.g)();return Math.abs(g-S)<x&&Math.abs(y-k)<x&&Math.abs(b-q)<x?o(e):(m=g-S,d=y-k,f=b-q,p=1/Math.sqrt(m*m+d*d+f*f),m*=p,d*=p,f*=p,a=M*f-v*d,i=v*m-w*f,l=w*d-M*m,p=Math.sqrt(a*a+i*i+l*l),p?(p=1/p,a*=p,i*=p,l*=p):(a=0,i=0,l=0),u=d*l-f*i,c=f*a-m*l,h=m*i-d*a,p=Math.sqrt(u*u+c*c+h*h),p?(p=1/p,u*=p,c*=p,h*=p):(u=0,c=0,h=0),e[0]=a,e[1]=u,e[2]=m,e[3]=0,e[4]=i,e[5]=c,e[6]=d,e[7]=0,e[8]=l,e[9]=h,e[10]=f,e[11]=0,e[12]=-(a*g+i*y+l*b),e[13]=-(u*g+c*y+h*b),e[14]=-(m*g+d*y+f*b),e[15]=1,e)},targetTo:function(e,t,r,n){const s=t[0],a=t[1],o=t[2],i=n[0],l=n[1],u=n[2];let c=s-r[0],h=a-r[1],m=o-r[2],d=c*c+h*h+m*m;d>0&&(d=1/Math.sqrt(d),c*=d,h*=d,m*=d);let f=l*m-u*h,p=u*c-i*m,g=i*h-l*c;return d=f*f+p*p+g*g,d>0&&(d=1/Math.sqrt(d),f*=d,p*=d,g*=d),e[0]=f,e[1]=p,e[2]=g,e[3]=0,e[4]=h*g-m*p,e[5]=m*f-c*g,e[6]=c*p-h*f,e[7]=0,e[8]=c,e[9]=h,e[10]=m,e[11]=0,e[12]=s,e[13]=a,e[14]=o,e[15]=1,e},str:function(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"},frob:function(e){return Math.sqrt(e[0]**2+e[1]**2+e[2]**2+e[3]**2+e[4]**2+e[5]**2+e[6]**2+e[7]**2+e[8]**2+e[9]**2+e[10]**2+e[11]**2+e[12]**2+e[13]**2+e[14]**2+e[15]**2)},add:function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e},subtract:w,multiplyScalar:function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e},multiplyScalarAndAdd:function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e[9]=t[9]+r[9]*n,e[10]=t[10]+r[10]*n,e[11]=t[11]+r[11]*n,e[12]=t[12]+r[12]*n,e[13]=t[13]+r[13]*n,e[14]=t[14]+r[14]*n,e[15]=t[15]+r[15]*n,e},exactEquals:M,equals:v,isOrthoNormal:S,mul:k,sub:q},Symbol.toStringTag,{value:"Module"}))},35270:(e,t,r)=>{r.d(t,{B7:()=>l,St:()=>s,VL:()=>o,h$:()=>a,rW:()=>u});const n={transparent:[0,0,0,0],black:[0,0,0,1],silver:[192,192,192,1],gray:[128,128,128,1],white:[255,255,255,1],maroon:[128,0,0,1],red:[255,0,0,1],purple:[128,0,128,1],fuchsia:[255,0,255,1],green:[0,128,0,1],lime:[0,255,0,1],olive:[128,128,0,1],yellow:[255,255,0,1],navy:[0,0,128,1],blue:[0,0,255,1],teal:[0,128,128,1],aqua:[0,255,255,1],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],blanchedalmond:[255,235,205,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],oldlace:[253,245,230,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],rebeccapurple:[102,51,153,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],whitesmoke:[245,245,245,1],yellowgreen:[154,205,50,1]};function s(e){return n[e]||n[e.toLowerCase()]}function a(e){return n[e]??n[e.toLowerCase()]}function o(e){return[...a(e)]}function i(e,t,r){r<0&&++r,r>1&&--r;const n=6*r;return n<1?e+(t-e)*n:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}function l(e,t,r,n=1){const s=(e%360+360)%360/360,a=r<=.5?r*(t+1):r+t-r*t,o=2*r-a;return[Math.round(255*i(o,a,s+1/3)),Math.round(255*i(o,a,s)),Math.round(255*i(o,a,s-1/3)),n]}function u(e){const t=e.length>5,r=t?8:4,n=(1<<r)-1,s=t?1:17,a=t?9===e.length:5===e.length;let o=Number("0x"+e.substr(1));if(isNaN(o))return null;const i=[0,0,0,1];let l;return a&&(l=o&n,o>>=r,i[3]=s*l/255),l=o&n,o>>=r,i[2]=s*l,l=o&n,o>>=r,i[1]=s*l,l=o&n,o>>=r,i[0]=s*l,i}},36030:(e,t,r)=>{r.d(t,{J:()=>a});var n=r(35454),s=r(5600);function a(e,t={}){const r=e instanceof n.X?e:new n.X(e,t),a={type:t?.ignoreUnknown??1?r.apiValues:String,json:{type:r.jsonValues,read:!t?.readOnly&&{reader:r.read},write:{writer:r.write}}};return void 0!==t?.readOnly&&(a.readOnly=!!t.readOnly),void 0!==t?.default&&(a.json.default=t.default),void 0!==t?.name&&(a.json.name=t.name),(0,s.Cb)(a)}},10661:(e,t,r)=>{r.d(t,{s:()=>s});var n=r(39020);class s{constructor(){this._observers=[]}observe(e){return this._observers.includes(e)||this._observers.push(e),new n.X(this._observers,e)}notify(){const e=this._observers.slice();for(let t=0;t<e.length;++t){const r=e[t];r.onInvalidated(),r.onCommitted()}}}},67900:(e,t,r)=>{r.d(t,{$C:()=>q,En:()=>S,Jo:()=>_,_R:()=>x,c9:()=>C,cM:()=>O,gV:()=>A,hd:()=>u,qE:()=>P,ty:()=>k}),r(80442);var n=r(35454),s=r(70586),a=r(24678),o=r(68441),i=r(8744),l=r(58116);const u=39.37,c=o.sv.radius*Math.PI/200,h=/UNIT\[([^\]]+)\]\]$/i,m=l.Z,d=/UNIT\[([^\]]+)\]/i,f=new Set([4261,4305,4807,4810,4811,4812,4816,4819,4821,4901,4902,37225,104139,104140]),p=(0,n.w)()({meter:"meters",foot:"feet",foot_us:"us-feet",foot_clarke:"clarke-feet",yard_clarke:"clarke-yards",link_clarke:"clarke-links",yard_sears:"sears-yards",foot_sears:"sears-feet",chain_sears:"sears-chains",chain_benoit_1895_b:"benoit-1895-b-chains",yard_indian:"indian-yards",yard_indian_1937:"indian-1937-yards",foot_gold_coast:"gold-coast-feet",chain_sears_1922_truncated:"sears-1922-truncated-chains","50_kilometers":"50-kilometers","150_kilometers":"150-kilometers"}),g=e=>e*e,y=e=>e*e*e,b={length:{baseUnit:"meters",units:{millimeters:{inBaseUnits:.001},centimeters:{inBaseUnits:.01},decimeters:{inBaseUnits:.1},meters:{inBaseUnits:1},kilometers:{inBaseUnits:1e3},inches:{inBaseUnits:.0254},feet:{inBaseUnits:.3048},yards:{inBaseUnits:.9144},miles:{inBaseUnits:1609.344},"nautical-miles":{inBaseUnits:1852},"us-feet":{inBaseUnits:1200/3937}}},area:{baseUnit:"square-meters",units:{"square-millimeters":{inBaseUnits:g(.001)},"square-centimeters":{inBaseUnits:g(.01)},"square-decimeters":{inBaseUnits:g(.1)},"square-meters":{inBaseUnits:1},"square-kilometers":{inBaseUnits:g(1e3)},"square-inches":{inBaseUnits:g(.0254)},"square-feet":{inBaseUnits:g(.3048)},"square-yards":{inBaseUnits:g(.9144)},"square-miles":{inBaseUnits:g(1609.344)},"square-us-feet":{inBaseUnits:g(1200/3937)},acres:{inBaseUnits:.0015625*g(1609.344)},ares:{inBaseUnits:100},hectares:{inBaseUnits:1e4}}},volume:{baseUnit:"liters",units:{liters:{inBaseUnits:1},"cubic-millimeters":{inBaseUnits:1e3*y(.001)},"cubic-centimeters":{inBaseUnits:1e3*y(.01)},"cubic-decimeters":{inBaseUnits:1e3*y(.1)},"cubic-meters":{inBaseUnits:1e3},"cubic-kilometers":{inBaseUnits:1e3*y(1e3)},"cubic-inches":{inBaseUnits:1e3*y(.0254)},"cubic-feet":{inBaseUnits:1e3*y(.3048)},"cubic-yards":{inBaseUnits:1e3*y(.9144)},"cubic-miles":{inBaseUnits:1e3*y(1609.344)}}},angle:{baseUnit:"radians",units:{radians:{inBaseUnits:1},degrees:{inBaseUnits:Math.PI/180}}}},w=(()=>{const e={};for(const t in b)for(const r in b[t].units)e[r]=t;return e})();function M(e){const t=w[e];if(!t)throw new Error("unknown type");return t}function v(e,t=null){return t=t||M(e),b[t].baseUnit===e}function S(e,t,r){if(t===r)return e;const n=M(t);if(n!==M(r))throw new Error("incompatible units");const s=v(t,n)?e:function(e,t,r){return e*b[r].units[t].inBaseUnits}(e,t,n);return v(r,n)?s:function(e,t,r){return e/b[r].units[t].inBaseUnits}(s,r,n)}function k(e,t,r){return S(e,t,"meters")/(r*Math.PI/180)}function q(e){return p.fromJSON(e.toLowerCase())||null}function x(e){if((0,s.pC)(e)&&!(0,i.N$)(e))return 1;const t=C(e);return t>1e5?1:t}function O(e){return C(e)>=(0,a.Iu)(e).metersPerDegree?"meters":P(e)}function C(e,t=o.sv.metersPerDegree){return(0,s.Pt)(function(e,t=!1){const r=(0,s.pC)(e)?e.wkid:null,n=(0,s.pC)(e)?e.wkt:null;let a=null;if(r){if((0,i.o$)(r))return o.yr.metersPerDegree;if((0,i.ME)(r))return o.Z1.metersPerDegree;a=m.values[m[r]],!a&&t&&f.has(r)&&(a=c)}else n&&(B(n)?a=U(h.exec(n),a):Z(n)&&(a=U(d.exec(n),a)));return a}(e,!0),t)}function U(e,t){return e&&e[1]?T(e[1]):t}function T(e){return parseFloat(e.split(",")[1])}function P(e){const t=(0,s.pC)(e)?e.wkid:null,r=(0,s.pC)(e)?e.wkt:null;let n=null;if(t)n=m.units[m[t]];else if(r){const e=B(r)?h:Z(r)?d:null;if(e){const t=e.exec(r);t&&t[1]&&(n=function(e){const t=/[\\"\\']{1}([^\\"\\']+)/.exec(e);let r=t&&t[1];if(!r||!m.units.includes(r)){const t=T(e);r=null;const n=m.values;for(let e=0;e<n.length;++e)if(Math.abs(t-n[e])<1e-7){r=m.units[e];break}}return r}(t[1]))}}return(0,s.pC)(n)?q(n):null}function Z(e){return/^GEOCCS/i.test(e)}function B(e){return/^PROJCS/i.test(e)}new Map([["meters","square-meters"],["feet","square-feet"],["us-feet","square-us-feet"]]);const E={esriAcres:"acres",esriAres:"ares",esriHectares:"hectares",esriSquareCentimeters:"square-centimeters",esriSquareDecimeters:"square-decimeters",esriSquareFeet:"square-feet",esriSquareInches:"square-inches",esriSquareKilometers:"square-kilometers",esriSquareMeters:"square-meters",esriSquareMiles:"square-miles",esriSquareMillimeters:"square-millimeters",esriSquareUsFeet:"square-us-feet",esriSquareYards:"square-yards"},N={esriCentimeters:"centimeters",esriDecimeters:"decimeters",esriFeet:"feet",esriInches:"inches",esriKilometers:"kilometers",esriMeters:"meters",esriMiles:"miles",esriMillimeters:"millimeters",esriNauticalMiles:"nautical-miles",esriYards:"yards"},A=(0,n.w)()(E),_=(0,n.w)()(N);(0,n.w)()({...E,...N})},66577:(e,t,r)=>{r.d(t,{qM:()=>c});var n=r(75215),s=r(6570),a=r(9361),o=r(65091),i=r(94139),l=r(38913),u=r(58901);r(82971),r(86973),r(33955);const c={base:a.Z,key:"type",typeMap:{extent:s.Z,multipoint:o.Z,point:i.Z,polyline:u.Z,polygon:l.Z}};(0,n.N7)(c)},24678:(e,t,r)=>{r.d(t,{GG:()=>l,HQ:()=>u,Iu:()=>d,VY:()=>c,e8:()=>f,rS:()=>m,wY:()=>h});var n=r(70586),s=r(82971),a=r(68441),o=r(8744);function i(e){return new s.Z({wkt:`GEOCCS["Spherical geocentric",\n DATUM["Not specified",\n SPHEROID["Sphere",${e.radius},0]],\n PRIMEM["Greenwich",0.0,\n AUTHORITY["EPSG","8901"]],\n UNIT["m",1.0],\n AXIS["Geocentric X",OTHER],\n AXIS["Geocentric Y",EAST],\n AXIS["Geocentric Z",NORTH]\n ]`})}const l=i(a.sv),u=i(a.yr),c=i(a.Z1),h=new s.Z({wkt:`GEOCCS["WGS 84",\n DATUM["WGS_1984",\n SPHEROID["WGS 84",${a.sv.radius},298.257223563,\n AUTHORITY["EPSG","7030"]],\n AUTHORITY["EPSG","6326"]],\n PRIMEM["Greenwich",0,\n AUTHORITY["EPSG","8901"]],\n UNIT["m",1.0,\n AUTHORITY["EPSG","9001"]],\n AXIS["Geocentric X",OTHER],\n AXIS["Geocentric Y",OTHER],\n AXIS["Geocentric Z",NORTH],\n AUTHORITY["EPSG","4978"]\n]`});function m(e){return e&&((0,o.BZ)(e)||e===u)?u:e&&((0,o.V2)(e)||e===c)?c:l}function d(e){return(0,n.pC)(e)&&((0,o.BZ)(e)||e===u)?a.yr:(0,n.pC)(e)&&((0,o.V2)(e)||e===c)?a.Z1:a.sv}function f(e){return(0,o.o$)(e)?a.yr:(0,o.ME)(e)?a.Z1:a.sv}},24470:(e,t,r)=>{r.d(t,{Gv:()=>b,HH:()=>u,SO:()=>h,Ue:()=>a,al:()=>i,cS:()=>p,fS:()=>y,jE:()=>m,jn:()=>c,kK:()=>d,oJ:()=>l,r3:()=>f}),r(80442),r(22021);var n=r(70586),s=r(6570);function a(e=w){return[e[0],e[1],e[2],e[3]]}function o(e,t){return e!==t&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3]),e}function i(e,t,r,n,s=a()){return s[0]=e,s[1]=t,s[2]=r,s[3]=n,s}function l(e,t=a()){return t[0]=e.xmin,t[1]=e.ymin,t[2]=e.xmax,t[3]=e.ymax,t}function u(e,t){return new s.Z({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:t})}function c(e,t,r){if((0,n.Wi)(t))o(r,e);else if("length"in t)g(t)?(r[0]=Math.min(e[0],t[0]),r[1]=Math.min(e[1],t[1]),r[2]=Math.max(e[2],t[2]),r[3]=Math.max(e[3],t[3])):2!==t.length&&3!==t.length||(r[0]=Math.min(e[0],t[0]),r[1]=Math.min(e[1],t[1]),r[2]=Math.max(e[2],t[0]),r[3]=Math.max(e[3],t[1]));else switch(t.type){case"extent":r[0]=Math.min(e[0],t.xmin),r[1]=Math.min(e[1],t.ymin),r[2]=Math.max(e[2],t.xmax),r[3]=Math.max(e[3],t.ymax);break;case"point":r[0]=Math.min(e[0],t.x),r[1]=Math.min(e[1],t.y),r[2]=Math.max(e[2],t.x),r[3]=Math.max(e[3],t.y)}}function h(e){return function(e){return(0,n.Wi)(e)||e[0]>=e[2]?0:e[2]-e[0]}(e)*function(e){return e[1]>=e[3]?0:e[3]-e[1]}(e)}function m(e,t,r){return t>=e[0]&&r>=e[1]&&t<=e[2]&&r<=e[3]}function d(e,t){return Math.max(t[0],e[0])<=Math.min(t[2],e[2])&&Math.max(t[1],e[1])<=Math.min(t[3],e[3])}function f(e,t){return t[0]>=e[0]&&t[2]<=e[2]&&t[1]>=e[1]&&t[3]<=e[3]}function p(e){return e?o(e,b):a(b)}function g(e){return null!=e&&4===e.length}function y(e,t){return g(e)&&g(t)?e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]:e===t}const b=[1/0,1/0,-1/0,-1/0],w=[0,0,0,0]},33955:(e,t,r)=>{r.d(t,{Ji:()=>g,YX:()=>c,aW:()=>h,im:()=>p,l9:()=>d,oU:()=>f,q9:()=>b,wp:()=>m});var n=r(70586),s=r(6570),a=r(9361),o=r(65091),i=r(94139),l=r(38913),u=r(58901);function c(e){return void 0!==e.xmin&&void 0!==e.ymin&&void 0!==e.xmax&&void 0!==e.ymax}function h(e){return void 0!==e.points}function m(e){return void 0!==e.x&&void 0!==e.y}function d(e){return void 0!==e.paths}function f(e){return void 0!==e.rings}function p(e){return(0,n.Wi)(e)?null:e instanceof a.Z?e:m(e)?i.Z.fromJSON(e):d(e)?u.Z.fromJSON(e):f(e)?l.Z.fromJSON(e):h(e)?o.Z.fromJSON(e):c(e)?s.Z.fromJSON(e):null}function g(e){return e?m(e)?"esriGeometryPoint":d(e)?"esriGeometryPolyline":f(e)?"esriGeometryPolygon":c(e)?"esriGeometryEnvelope":h(e)?"esriGeometryMultipoint":null:null}const y={esriGeometryPoint:i.Z,esriGeometryPolyline:u.Z,esriGeometryPolygon:l.Z,esriGeometryEnvelope:s.Z,esriGeometryMultipoint:o.Z};function b(e){return e&&y[e]||null}},86973:(e,t,r)=>{r.d(t,{Mk:()=>s,P$:()=>a});var n=r(35454);const s=(0,n.w)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),a=(0,n.w)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"})},61576:(e,t,r)=>{r.r(t),r.d(t,{default:()=>g}),r(66577);var n=r(70586),s=r(18571),a=r(5847),o=r(75993),i=r(55914),l=r(55444),u=r(73506),c=r(15612),h=r(80676),m=r(87521),d=r(72758),f=r(23808),p=r(6570);class g{convertVectorFieldData(e){const t=a.Z.fromJSON(e.pixelBlock),r=(0,h.KC)(t,e.type);return Promise.resolve((0,n.pC)(r)&&r.toJSON())}async decode(e){const t=await(0,o.J)(e.data,e.options);return t&&t.toJSON()}symbolize(e){e.pixelBlock=a.Z.fromJSON(e.pixelBlock),e.extent=e.extent?p.Z.fromJSON(e.extent):null;const t=this.symbolizer.symbolize(e);return Promise.resolve((0,n.pC)(t)&&t.toJSON())}async updateSymbolizer(e){this.symbolizer=d.Z.fromJSON(e.symbolizerJSON),e.histograms&&"rasterStretch"===this.symbolizer?.rendererJSON.type&&(this.symbolizer.rendererJSON.histograms=e.histograms)}async updateRasterFunction(e){this.rasterFunction=(0,l.Ue)(e.rasterFunctionJSON)}async process(e){const t=this.rasterFunction.process({extent:p.Z.fromJSON(e.extent),primaryPixelBlocks:e.primaryPixelBlocks.map((e=>(0,n.pC)(e)?a.Z.fromJSON(e):null)),primaryRasterIds:e.primaryRasterIds});return(0,n.pC)(t)?t.toJSON():null}stretch(e){const t=this.symbolizer.simpleStretch(a.Z.fromJSON(e.srcPixelBlock),e.stretchParams);return Promise.resolve((0,n.pC)(t)&&t.toJSON())}estimateStatisticsHistograms(e){const t=(0,c.Hv)(a.Z.fromJSON(e.srcPixelBlock));return Promise.resolve(t)}split(e){const t=(0,i.Vl)(a.Z.fromJSON(e.srcPixelBlock),e.tileSize,e.maximumPyramidLevel);return t&&t.forEach(((e,r)=>{t.set(r,e?.toJSON())})),Promise.resolve(t)}async mosaicAndTransform(e){const t=e.srcPixelBlocks.map((e=>e?new a.Z(e):null)),r=(0,i.us)(t,e.srcMosaicSize,{blockWidths:e.blockWidths,alignmentInfo:e.alignmentInfo,clipOffset:e.clipOffset,clipSize:e.clipSize});let s,o=r;return e.coefs&&(o=(0,i.Uk)(r,e.destDimension,e.coefs,e.sampleSpacing,e.interpolation)),e.projectDirections&&e.gcsGrid&&(s=(0,i.Qh)(e.destDimension,e.gcsGrid),o=(0,n.Wg)((0,h.xQ)(o,e.isUV?"vector-uv":"vector-magdir",s))),{pixelBlock:o?.toJSON(),localNorthDirections:s}}async createFlowMesh(e,t){const r={data:new Float32Array(e.flowData.buffer),mask:new Uint8Array(e.flowData.maskBuffer),width:e.flowData.width,height:e.flowData.height},{vertexData:n,indexData:s}=await(0,f.GE)(e.meshType,e.simulationSettings,r,t.signal);return{result:{vertexBuffer:n.buffer,indexBuffer:s.buffer},transferList:[n.buffer,s.buffer]}}async getProjectionOffsetGrid(e){const t=p.Z.fromJSON(e.projectedExtent),r=p.Z.fromJSON(e.srcBufferExtent);let n=null;e.datumTransformationSteps&&(n=new s.Z({steps:e.datumTransformationSteps})),(e.includeGCSGrid||(0,u.Mk)(t.spatialReference,r.spatialReference,n))&&await(0,u.zD)();const a=e.rasterTransform?(0,m.c)(e.rasterTransform):null;return(0,u.Qp)({...e,projectedExtent:t,srcBufferExtent:r,datumTransformation:n,rasterTransform:a})}}},19745:(e,t,r)=>{r.d(t,{P:()=>o,a:()=>a});const n=/^https:\/\/([a-z\d-]+)(\.maps([^.]*))?\.arcgis\.com/i,s={devext:{customBaseUrl:"mapsdevext.arcgis.com",portalHostname:"devext.arcgis.com"},qaext:{customBaseUrl:"mapsqa.arcgis.com",portalHostname:"qaext.arcgis.com"},www:{customBaseUrl:"maps.arcgis.com",portalHostname:"www.arcgis.com"}};function a(e){const t=e?.match(n);if(!t)return null;const[,r,a,o]=t;if(!r)return null;let i=null,l=null,u=null;const{devext:c,qaext:h,www:m}=s;if(a)if(i=r,o)switch(o.toLowerCase()){case"devext":({customBaseUrl:l,portalHostname:u}=c);break;case"qa":({customBaseUrl:l,portalHostname:u}=h);break;default:return null}else({customBaseUrl:l,portalHostname:u}=m);else switch(r.toLowerCase()){case"devext":({customBaseUrl:l,portalHostname:u}=c);break;case"qaext":({customBaseUrl:l,portalHostname:u}=h);break;case"www":({customBaseUrl:l,portalHostname:u}=m);break;default:return null}return{customBaseUrl:l,isPortal:!1,portalHostname:u,urlKey:i}}function o(e){return/\/(sharing|usrsvcs)\/(appservices|servers)\//i.test(e)}},3172:(e,t,r)=>{r.r(t),r.d(t,{default:()=>f});var n=r(68773),s=r(40330),a=r(20102),o=r(80442),i=r(22974),l=r(70586),u=r(95330),c=r(17452),h=r(19745),m=r(71058),d=r(85958);async function f(e,t){const i=(0,c.HK)(e),h=(0,c.jc)(e);h||i||(e=(0,c.Fv)(e));const b={url:e,requestOptions:{...(0,l.Wg)(t)}};let w=(0,c.oh)(e);if(w){const e=await async function(e,t){if(null!=e.responseData)return e.responseData;if(e.headers&&(t.requestOptions.headers={...t.requestOptions.headers,...e.headers}),e.query&&(t.requestOptions.query={...t.requestOptions.query,...e.query}),e.before){let r,n;try{n=await e.before(t)}catch(e){r=q("request:interceptor",e,t)}if((n instanceof Error||n instanceof a.Z)&&(r=q("request:interceptor",n,t)),r)throw e.error&&e.error(r),r;return n}}(w,b);if(null!=e)return{data:e,getHeader:v,requestOptions:b.requestOptions,url:b.url};w.after||w.error||(w=null)}if(e=b.url,"image"===(t=b.requestOptions).responseType){if((0,o.Z)("host-webworker")||(0,o.Z)("host-node"))throw q("request:invalid-parameters",new Error("responseType 'image' is not supported in Web Workers or Node environment"),b)}else if(i)throw q("request:invalid-parameters",new Error("Data URLs are not supported for responseType = "+t.responseType),b);if("head"===t.method){if(t.body)throw q("request:invalid-parameters",new Error("body parameter cannot be set when method is 'head'"),b);if(i||h)throw q("request:invalid-parameters",new Error("data and blob URLs are not supported for method 'head'"),b)}if(await async function(){(0,o.Z)("host-webworker")?p||(p=await r.e(9884).then(r.bind(r,29884))):f._abortableFetch||(f._abortableFetch=globalThis.fetch.bind(globalThis))}(),p)return p.execute(e,t);const M=new AbortController;(0,u.fu)(t,(()=>M.abort()));const S={controller:M,credential:void 0,credentialToken:void 0,fetchOptions:void 0,hasToken:!1,interceptor:w,params:b,redoRequest:!1,useIdentity:g.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},k=await async function(e){let t,r;await async function(e){const t=e.params.url,r=e.params.requestOptions,a=e.controller.signal,o=r.body;let i=null,l=null;if(y&&"HTMLFormElement"in globalThis&&(o instanceof FormData?i=o:o instanceof HTMLFormElement&&(i=new FormData(o))),"string"==typeof o&&(l=o),e.fetchOptions={cache:r.cacheBust&&!f._abortableFetch.polyfill?"no-cache":"default",credentials:"same-origin",headers:r.headers||{},method:"head"===r.method?"HEAD":"GET",mode:"cors",priority:g.priority,redirect:"follow",signal:a},(i||l)&&(e.fetchOptions.body=i||l),"anonymous"===r.authMode&&(e.useIdentity=!1),e.hasToken=!!(/token=/i.test(t)||r.query?.token||i?.get("token")),!e.hasToken&&n.Z.apiKey&&(0,m.r)(t)&&(r.query||(r.query={}),r.query.token=n.Z.apiKey,e.hasToken=!0),e.useIdentity&&!e.hasToken&&!e.credentialToken&&!O(t)&&!(0,u.Hc)(a)){let n;"immediate"===r.authMode?(await x(),n=await s.id.getCredential(t,{signal:a}),e.credential=n):"no-prompt"===r.authMode?(await x(),n=await s.id.getCredential(t,{prompt:!1,signal:a}).catch((()=>{})),e.credential=n):s.id&&(n=s.id.findCredential(t)),n&&(e.credentialToken=n.token,e.useSSL=!!n.ssl)}}(e);try{do{[t,r]=await C(e)}while(!await T(e,t,r))}catch(r){const n=q("request:server",r,e.params,t);throw n.details.ssl=e.useSSL,e.interceptor&&e.interceptor.error&&e.interceptor.error(n),n}const a=e.params.url;if(r&&/\/sharing\/rest\/(accounts|portals)\/self/i.test(a)){if(!e.hasToken&&!e.credentialToken&&r.user?.username&&!(0,c.kl)(a)){const e=(0,c.P$)(a,!0);e&&g.trustedServers.push(e)}Array.isArray(r.authorizedCrossOriginNoCorsDomains)&&(0,d.Hu)(r.authorizedCrossOriginNoCorsDomains)}const o=e.credential;if(o&&s.id){const e=s.id.findServerInfo(o.server);let t=e&&e.owningSystemUrl;if(t){t=t.replace(/\/?$/,"/sharing");const e=s.id.findCredential(t,o.userId);e&&-1===s.id._getIdenticalSvcIdx(t,e)&&e.resources.unshift(t)}}return{data:r,getHeader:t?e=>t?.headers.get(e):v,requestOptions:e.params.requestOptions,ssl:e.useSSL,url:e.params.url}}(S);return w?.after?.(k),k}let p;const g=n.Z.request,y="FormData"in globalThis,b=[499,498,403,401],w=["COM_0056","COM_0057","SB_0008"],M=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i],v=()=>null,S=Symbol();function k(e){const t=(0,c.P$)(e);return!t||t.endsWith(".arcgis.com")||f._corsServers.includes(t)||(0,c.kl)(t)}function q(e,t,r,n){let s="Error";const o={url:r.url,requestOptions:r.requestOptions,getHeader:v,ssl:!1};if(t instanceof a.Z)return t.details?(t.details=(0,i.d9)(t.details),t.details.url=r.url,t.details.requestOptions=r.requestOptions):t.details=o,t;if(t){const e=n&&(e=>n.headers.get(e)),r=n&&n.status,a=t.message;a&&(s=a),e&&(o.getHeader=e),o.httpStatus=(null!=t.httpCode?t.httpCode:t.code)||r||0,o.subCode=t.subcode,o.messageCode=t.messageCode,"string"==typeof t.details?o.messages=[t.details]:o.messages=t.details,o.raw=S in t?t[S]:t}return(0,u.D_)(t)?(0,u.zE)():new a.Z(e,s,o)}async function x(){s.id||await Promise.all([r.e(6261),r.e(1400),r.e(1761)]).then(r.bind(r,55142))}function O(e){return M.some((t=>t.test(e)))}async function C(e){let t=e.params.url;const r=e.params.requestOptions,n=e.fetchOptions??{},a=(0,c.jc)(t)||(0,c.HK)(t),i=r.responseType||"json",l=a?0:null!=r.timeout?r.timeout:g.timeout;let m=!1;if(!a){e.useSSL&&(t=(0,c.hO)(t)),r.cacheBust&&"default"===n.cache&&(t=(0,c.ZN)(t,"request.preventCache",Date.now()));let a={...r.query};e.credentialToken&&(a.token=e.credentialToken);let i=(0,c.B7)(a);(0,o.Z)("esri-url-encodes-apostrophe")&&(i=i.replace(/'/g,"%27"));const l=t.length+1+i.length;let u;m="delete"===r.method||"post"===r.method||"put"===r.method||!!r.body||l>g.maxUrlLength;const f=r.useProxy||!!(0,c.ed)(t);if(f){const e=(0,c.b7)(t);u=e.path,!m&&u.length+1+l>g.maxUrlLength&&(m=!0),e.query&&(a={...e.query,...a})}if("HEAD"===n.method&&(m||f)){if(m){if(l>g.maxUrlLength)throw q("request:invalid-parameters",new Error("URL exceeds maximum length"),e.params);throw q("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),e.params)}if(f)throw q("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),e.params)}if(m?(n.method="delete"===r.method?"DELETE":"put"===r.method?"PUT":"POST",r.body?t=(0,c.fl)(t,a):(n.body=(0,c.B7)(a),n.headers||(n.headers={}),n.headers["Content-Type"]="application/x-www-form-urlencoded")):t=(0,c.fl)(t,a),f&&(e.useProxy=!0,t=`${u}?${t}`),a.token&&y&&n.body instanceof FormData&&!(0,h.P)(t)&&n.body.set("token",a.token),r.hasOwnProperty("withCredentials"))e.withCredentials=r.withCredentials;else if(!(0,c.D6)(t,(0,c.TI)()))if((0,c.kl)(t))e.withCredentials=!0;else if(s.id){const r=s.id.findServerInfo(t);r&&r.webTierAuth&&(e.withCredentials=!0)}e.withCredentials&&(n.credentials="include",(0,d.jH)(t)&&await(0,d.jz)(m?(0,c.fl)(t,a):t))}let p,b,w=0,M=!1;l>0&&(w=setTimeout((()=>{M=!0,e.controller.abort()}),l));try{if("native-request-init"===r.responseType)b=n,b.url=t;else if("image"!==r.responseType||"default"!==n.cache||"GET"!==n.method||m||function(e){if(e)for(const t of Object.getOwnPropertyNames(e))if(e[t])return!0;return!1}(r.headers)||!a&&!e.useProxy&&g.proxyUrl&&!k(t)){if(p=await f._abortableFetch(t,n),e.useProxy||function(e){const t=(0,c.P$)(e);t&&!f._corsServers.includes(t)&&f._corsServers.push(t)}(t),"native"===r.responseType)b=p;else if("HEAD"!==n.method)if(p.ok){switch(i){case"array-buffer":b=await p.arrayBuffer();break;case"blob":case"image":b=await p.blob();break;default:b=await p.text()}if(w&&(clearTimeout(w),w=0),"json"===i||"xml"===i||"document"===i)if(b)switch(i){case"json":b=JSON.parse(b);break;case"xml":b=U(b,"application/xml");break;case"document":b=U(b,"text/html")}else b=null;if(b){if("array-buffer"===i||"blob"===i){const e=p.headers.get("Content-Type");if(e&&/application\/json|text\/plain/i.test(e)&&b["blob"===i?"size":"byteLength"]<=750)try{const e=await new Response(b).json();e.error&&(b=e)}catch{}}"image"===i&&b instanceof Blob&&(b=await P(URL.createObjectURL(b),e,!0))}}else b=await p.text()}else b=await P(t,e)}catch(n){if("AbortError"===n.name){if(M)throw new Error("Timeout exceeded");throw(0,u.zE)("Request canceled")}if(!(!p&&n instanceof TypeError&&g.proxyUrl)||r.body||"delete"===r.method||"head"===r.method||"post"===r.method||"put"===r.method||e.useProxy||k(t))throw n;e.redoRequest=!0,(0,c.tD)({proxyUrl:g.proxyUrl,urlPrefix:(0,c.P$)(t)??""})}finally{w&&clearTimeout(w)}return[p,b]}function U(e,t){let r;try{r=(new DOMParser).parseFromString(e,t)}catch{}if(!r||r.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return r}async function T(e,t,r){if(e.redoRequest)return e.redoRequest=!1,!1;const n=e.params.requestOptions;if(!t||"native"===n.responseType||"native-request-init"===n.responseType)return!0;let a,o;if(!t.ok)throw a=new Error(`Unable to load ${t.url} status: ${t.status}`),a[S]=r,a;r&&(r.error?a=r.error:"error"===r.status&&Array.isArray(r.messages)&&(a={...r},a[S]=r,a.details=r.messages));let i,l=null;a&&(o=Number(a.code),l=a.hasOwnProperty("subcode")?Number(a.subcode):null,i=a.messageCode,i=i&&i.toUpperCase());const u=n.authMode;if(403===o&&(4===l||a.message&&a.message.toLowerCase().includes("ssl")&&!a.message.toLowerCase().includes("permission"))){if(!e.useSSL)return e.useSSL=!0,!1}else if(!e.hasToken&&e.useIdentity&&("no-prompt"!==u||498===o)&&void 0!==o&&b.includes(o)&&!O(e.params.url)&&(403!==o||i&&!w.includes(i)&&(null==l||2===l&&e.credentialToken))){await x();try{const t=await s.id.getCredential(e.params.url,{error:q("request:server",a,e.params),prompt:"no-prompt"!==u,signal:e.controller.signal,token:e.credentialToken});return e.credential=t,e.credentialToken=t.token,e.useSSL=e.useSSL||t.ssl,!1}catch(t){if("no-prompt"===u)return e.credential=void 0,e.credentialToken=void 0,!1;a=t}}if(a)throw a;return!0}function P(e,t,r=!1){const n=t.controller.signal,s=new Image;return t.withCredentials?s.crossOrigin="use-credentials":s.crossOrigin="anonymous",s.alt="",s.fetchPriority=g.priority,s.src=e,(0,d.fY)(s,e,r,n)}f._abortableFetch=null,f._corsServers=["https://server.arcgisonline.com","https://services.arcgisonline.com"]},98046:(e,t,r)=>{r.d(t,{Z:()=>d});var n,s=r(43697),a=r(22303),o=r(22974),i=r(5600),l=r(75215),u=r(36030),c=r(52011),h=r(899);let m=n=class extends h.Z{constructor(e){super(e),this.algorithm=null,this.fromColor=null,this.toColor=null,this.type="algorithmic"}clone(){return new n({fromColor:(0,o.d9)(this.fromColor),toColor:(0,o.d9)(this.toColor),algorithm:this.algorithm})}};(0,s._)([(0,u.J)({esriCIELabAlgorithm:"cie-lab",esriHSVAlgorithm:"hsv",esriLabLChAlgorithm:"lab-lch"})],m.prototype,"algorithm",void 0),(0,s._)([(0,i.Cb)({type:a.Z,json:{type:[l.z8],write:!0}})],m.prototype,"fromColor",void 0),(0,s._)([(0,i.Cb)({type:a.Z,json:{type:[l.z8],write:!0}})],m.prototype,"toColor",void 0),(0,s._)([(0,i.Cb)({type:["algorithmic"]})],m.prototype,"type",void 0),m=n=(0,s._)([(0,c.j)("esri.rest.support.AlgorithmicColorRamp")],m);const d=m},899:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(43697),s=r(96674),a=r(5600),o=(r(67676),r(75215),r(52011));let i=class extends s.wq{constructor(e){super(e),this.type=null}};(0,n._)([(0,a.Cb)({readOnly:!0,json:{read:!1,write:!0}})],i.prototype,"type",void 0),i=(0,n._)([(0,o.j)("esri.rest.support.ColorRamp")],i);const l=i},1515:(e,t,r)=>{r.d(t,{Z:()=>h});var n,s=r(43697),a=r(22974),o=r(5600),i=(r(75215),r(52011)),l=r(98046),u=r(899);let c=n=class extends u.Z{constructor(e){super(e),this.colorRamps=null,this.type="multipart"}clone(){return new n({colorRamps:(0,a.d9)(this.colorRamps)})}};(0,s._)([(0,o.Cb)({type:[l.Z],json:{write:!0}})],c.prototype,"colorRamps",void 0),(0,s._)([(0,o.Cb)({type:["multipart"]})],c.prototype,"type",void 0),c=n=(0,s._)([(0,i.j)("esri.rest.support.MultipartColorRamp")],c);const h=c},94593:(e,t,r)=>{r.d(t,{V:()=>o,i:()=>i});var n=r(98046),s=r(899),a=r(1515);const o={key:"type",base:s.Z,typeMap:{algorithmic:n.Z,multipart:a.Z}};function i(e){return e&&e.type?"algorithmic"===e.type?n.Z.fromJSON(e):"multipart"===e.type?a.Z.fromJSON(e):null:null}},71058:(e,t,r)=>{r.d(t,{r:()=>a});var n=r(17452);const s=["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"];function a(e){const t=(0,n.P$)(e,!0);return!!t&&t.endsWith(".arcgis.com")&&!s.includes(t)&&!e.endsWith("/sharing/rest/generateToken")}},85958:(e,t,r)=>{r.d(t,{Hu:()=>c,fY:()=>l,jH:()=>h,jz:()=>m});var n=r(68773),s=r(80442),a=r(70586),o=r(95330),i=r(17452);function l(e,t,r=!1,n){return new Promise(((i,l)=>{if((0,o.Hc)(n))return void l(u());let c=()=>{d(),l(new Error(`Unable to load ${t}`))},h=()=>{const t=e;d(),i(t)},m=()=>{if(!e)return;const t=e;d(),t.src="",l(u())};const d=()=>{(0,s.Z)("esri-image-decode")||(e.removeEventListener("error",c),e.removeEventListener("load",h)),c=null,h=null,e=null,(0,a.pC)(n)&&n.removeEventListener("abort",m),m=null,r&&URL.revokeObjectURL(t)};(0,a.pC)(n)&&n.addEventListener("abort",m),(0,s.Z)("esri-image-decode")?e.decode().then(h,c):(e.addEventListener("error",c),e.addEventListener("load",h))}))}function u(){try{return new DOMException("Aborted","AbortError")}catch{const e=new Error;return e.name="AbortError",e}}function c(e){n.Z.request.crossOriginNoCorsDomains||(n.Z.request.crossOriginNoCorsDomains={});const t=n.Z.request.crossOriginNoCorsDomains;for(let r of e)r=r.toLowerCase(),/^https?:\/\//.test(r)?t[(0,i.P$)(r)??""]=0:(t[(0,i.P$)("http://"+r)??""]=0,t[(0,i.P$)("https://"+r)??""]=0)}function h(e){const t=n.Z.request.crossOriginNoCorsDomains;if(t){let r=(0,i.P$)(e);if(r)return r=r.toLowerCase(),!(0,i.D6)(r,(0,i.TI)())&&t[r]<Date.now()-36e5}return!1}async function m(e){const t=n.Z.request.crossOriginNoCorsDomains,r=(0,i.P$)(e);t&&r&&(t[r.toLowerCase()]=Date.now());const s=(0,i.mN)(e);e=s.path,"json"===s.query?.f&&(e+="?f=json");try{await fetch(e,{mode:"no-cors",credentials:"include"})}catch{}}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5853],{17445:(e,t,r)=>{r.d(t,{N1:()=>d,YP:()=>a,Z_:()=>y,gx:()=>u,nn:()=>f,on:()=>p,tX:()=>g});var i=r(91460),s=r(50758),n=r(70586),l=r(95330),o=r(26258);function a(e,t,r={}){return c(e,t,r,m)}function u(e,t,r={}){return c(e,t,r,h)}function c(e,t,r={},i){let s=null;const l=r.once?(e,r)=>{i(e)&&((0,n.hw)(s),t(e,r))}:(e,r)=>{i(e)&&t(e,r)};if(s=(0,o.aQ)(e,l,r.sync,r.equals),r.initial){const t=e();l(t,t)}return s}function p(e,t,r,l={}){let o=null,u=null,c=null;function p(){o&&u&&(u.remove(),l.onListenerRemove?.(o),o=null,u=null)}function d(e){l.once&&l.once&&(0,n.hw)(c),r(e)}const m=a(e,((e,r)=>{p(),(0,i.vT)(e)&&(o=e,u=(0,i.on)(e,t,d),l.onListenerAdd?.(e))}),{sync:l.sync,initial:!0});return c=(0,s.kB)((()=>{m.remove(),p()})),c}function d(e,t){return function(e,t,r){if((0,l.Hc)(r))return Promise.reject((0,l.zE)());const i=e();if(t?.(i))return Promise.resolve(i);let o=null;function a(){o=(0,n.hw)(o)}return new Promise(((i,n)=>{o=(0,s.AL)([(0,l.fu)(r,(()=>{a(),n((0,l.zE)())})),c(e,(e=>{a(),i(e)}),{sync:!1,once:!0},t??m)])}))}(e,h,t)}function m(e){return!0}function h(e){return!!e}r(87538);const y={sync:!0},f={initial:!0},g={sync:!0,initial:!0}},55853:(e,t,r)=>{r.r(t),r.d(t,{default:()=>me});var i=r(43697),s=r(3172),n=r(46791),l=r(20102),o=r(22974),a=r(70586),u=r(16453),c=r(78286),p=r(95330),d=r(17445),m=r(17452),h=r(5600),y=(r(75215),r(71715)),f=r(52011),g=r(30556),w=r(6570),v=r(87085),x=r(16199),S=r(71612),M=r(38009),C=r(16859),b=r(34760),I=r(72965),L=r(11145);class T{constructor(e,t=0,r=e.lods.length-1){this.tileInfo=e,this.minLOD=t,this.maxLOD=r}getAvailability(e,t,r){const i=this.tileInfo?.lodAt(e);return!i||e<this.minLOD||e>this.maxLOD?"unavailable":i.cols&&i.rows?r>=i.cols[0]&&r<=i.cols[1]&&t>=i.rows[0]&&t<=i.rows[1]?"available":"unavailable":"available"}async fetchAvailability(e,t,r,i){return await(0,p.Yn)(i),this.getAvailability(e,t,r)}async fetchAvailabilityUpsample(e,t,r,i,s){await(0,p.Yn)(s),i.level=e,i.row=t,i.col=r;const n=this.tileInfo;for(n.updateTileInfo(i);;){const e=this.getAvailability(i.level,i.row,i.col);if("unavailable"!==e)return e;if(!n.upsampleTile(i))return"unavailable"}}}var _,P=r(5833),E=r(96674);r(67676);let R=_=class extends E.wq{constructor(e){super(e),this.fullExtent=null,this.id=null,this.tileInfo=null}clone(){const e=new _;return this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent&&this.fullExtent.clone()),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("tileInfo")&&(e.tileInfo=this.tileInfo&&this.tileInfo.clone()),e}};(0,i._)([(0,h.Cb)({type:w.Z,json:{read:{source:"fullExtent"}}})],R.prototype,"fullExtent",void 0),(0,i._)([(0,h.Cb)({type:String,json:{read:{source:"id"}}})],R.prototype,"id",void 0),(0,i._)([(0,h.Cb)({type:L.Z,json:{read:{source:"tileInfo"}}})],R.prototype,"tileInfo",void 0),R=_=(0,i._)([(0,f.j)("esri.layer.support.TileMatrixSet")],R);const O=R;var F;let A=F=class extends E.wq{constructor(e){super(e),this.id=null,this.title=null,this.description=null,this.legendUrl=null}clone(){const e=new F;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("isDefault")&&(e.isDefault=this.isDefault),this.hasOwnProperty("keywords")&&(e.keywords=this.keywords&&this.keywords.slice()),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("title")&&(e.title=this.title),e}};(0,i._)([(0,h.Cb)({json:{read:{source:"id"}}})],A.prototype,"id",void 0),(0,i._)([(0,h.Cb)({json:{read:{source:"title"}}})],A.prototype,"title",void 0),(0,i._)([(0,h.Cb)({json:{read:{source:"abstract"}}})],A.prototype,"description",void 0),(0,i._)([(0,h.Cb)({json:{read:{source:"legendUrl"}}})],A.prototype,"legendUrl",void 0),(0,i._)([(0,h.Cb)({json:{read:{source:"isDefault"}}})],A.prototype,"isDefault",void 0),(0,i._)([(0,h.Cb)({json:{read:{source:"keywords"}}})],A.prototype,"keywords",void 0),A=F=(0,i._)([(0,f.j)("esri.layer.support.WMTSStyle")],A);const V=A;var j;let U=j=class extends E.wq{constructor(e){super(e),this.fullExtent=null,this.fullExtents=null,this.imageFormats=null,this.id=null,this.layer=null,this.styles=null,this.tileMatrixSetId=null,this.tileMatrixSets=null}get description(){return this._get("description")}set description(e){this._set("description",e)}readFullExtent(e,t){return(e=t.fullExtent)?w.Z.fromJSON(e):null}readFullExtents(e,t){return t.fullExtents?.length?t.fullExtents.map((e=>w.Z.fromJSON(e))):t.tileMatrixSets?.map((e=>w.Z.fromJSON(e.fullExtent))).filter((e=>e))??[]}get imageFormat(){let e=this._get("imageFormat");return e||(e=this.imageFormats&&this.imageFormats.length?this.imageFormats[0]:""),e}set imageFormat(e){const t=this.imageFormats;e&&(e.includes("image/")||t&&!t.includes(e))&&(e.includes("image/")||(e="image/"+e),t&&!t.includes(e))?console.error("The layer doesn't support the format of "+e):this._set("imageFormat",e)}get styleId(){let e=this._get("styleId");return e||(e=this.styles?.length?this.styles.getItemAt(0).id:""),e}set styleId(e){this._set("styleId",e)}get title(){return this._get("title")}set title(e){this._set("title",e)}get tileMatrixSet(){return this.tileMatrixSets?this.tileMatrixSets.find((e=>e.id===this.tileMatrixSetId)):null}clone(){const e=new j;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("imageFormats")&&(e.imageFormats=this.imageFormats&&this.imageFormats.slice()),this.hasOwnProperty("imageFormat")&&(e.imageFormat=this.imageFormat),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent&&this.fullExtent.clone()),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("styleId")&&(e.styleId=this.styleId),this.hasOwnProperty("styles")&&(e.styles=this.styles&&this.styles.clone()),this.hasOwnProperty("tileMatrixSetId")&&(e.tileMatrixSetId=this.tileMatrixSetId),this.hasOwnProperty("tileMatrixSets")&&(e.tileMatrixSets=this.tileMatrixSets?.clone()),this.hasOwnProperty("title")&&(e.title=this.title),e}};(0,i._)([(0,h.Cb)()],U.prototype,"description",null),(0,i._)([(0,h.Cb)()],U.prototype,"fullExtent",void 0),(0,i._)([(0,y.r)("fullExtent",["fullExtent"])],U.prototype,"readFullExtent",null),(0,i._)([(0,h.Cb)({readOnly:!0})],U.prototype,"fullExtents",void 0),(0,i._)([(0,y.r)("fullExtents",["fullExtents","tileMatrixSets"])],U.prototype,"readFullExtents",null),(0,i._)([(0,h.Cb)()],U.prototype,"imageFormat",null),(0,i._)([(0,h.Cb)({json:{read:{source:"formats"}}})],U.prototype,"imageFormats",void 0),(0,i._)([(0,h.Cb)()],U.prototype,"id",void 0),(0,i._)([(0,h.Cb)()],U.prototype,"layer",void 0),(0,i._)([(0,h.Cb)()],U.prototype,"styleId",null),(0,i._)([(0,h.Cb)({type:n.Z.ofType(V),json:{read:{source:"styles"}}})],U.prototype,"styles",void 0),(0,i._)([(0,h.Cb)({value:null,json:{write:{ignoreOrigin:!0}}})],U.prototype,"title",null),(0,i._)([(0,h.Cb)()],U.prototype,"tileMatrixSetId",void 0),(0,i._)([(0,h.Cb)({readOnly:!0})],U.prototype,"tileMatrixSet",null),(0,i._)([(0,h.Cb)({type:n.Z.ofType(O),json:{read:{source:"tileMatrixSets"}}})],U.prototype,"tileMatrixSets",void 0),U=j=(0,i._)([(0,f.j)("esri.layers.support.WMTSSublayer")],U);const N=U;var Z=r(94139),k=r(24678),D=r(58116),W=r(52162),B=r(88724);const K=90.71428571428571;function $(e){const t=e.replace(/ows:/gi,"");if(!Y("Contents",(new DOMParser).parseFromString(t,"text/xml").documentElement))throw new l.Z("wmtslayer:wmts-capabilities-xml-is-not-valid","the wmts get capabilities response is not compliant",{text:e})}function q(e){return e.nodeType===Node.ELEMENT_NODE}function Y(e,t){for(let r=0;r<t.childNodes.length;r++){const i=t.childNodes[r];if(q(i)&&i.nodeName===e)return i}return null}function G(e,t){const r=[];for(let i=0;i<t.childNodes.length;i++){const s=t.childNodes[i];q(s)&&s.nodeName===e&&r.push(s)}return r}function H(e,t){const r=[];for(let i=0;i<t.childNodes.length;i++){const s=t.childNodes[i];q(s)&&s.nodeName===e&&r.push(s)}return r.map((e=>e.textContent)).filter(a.pC)}function J(e,t){return e.split(">").forEach((e=>{t&&(t=Y(e,t))})),t&&t.textContent}function z(e,t,r,i){let s;return Array.prototype.slice.call(i.childNodes).some((i=>{if(i.nodeName.includes(e)){const e=Y(t,i),n=e&&e.textContent;if(n===r||r.split(":")&&r.split(":")[1]===n)return s=i,!0}return!1})),s}function Q(e,t,r,i,s){const n=J("Abstract",t),l=H("Format",t);return{id:e,fullExtent:ee(t),fullExtents:te(t),description:n,formats:l,styles:re(t,i),title:J("Title",t),tileMatrixSets:ie(s,t,r)}}function X(e,t){const r=[],i=e.layerMap?.get(t);if(!i)return null;const s=G("ResourceURL",i),n=G("Dimension",i);let l,o,a,u;return n.length&&(l=J("Identifier",n[0]),o=H("Default",n[0])||H("Value",n[0])),n.length>1&&(a=J("Identifier",n[1]),u=H("Default",n[1])||H("Value",n[1])),e.dimensionMap.set(t,{dimensions:o,dimensions2:u}),s.forEach((e=>{let t=e.getAttribute("template");if("tile"===e.getAttribute("resourceType")){if(l&&o.length)if(t.includes("{"+l+"}"))t=t.replace("{"+l+"}","{dimensionValue}");else{const e=t.toLowerCase().indexOf("{"+l.toLowerCase()+"}");e>-1&&(t=t.substring(0,e)+"{dimensionValue}"+t.substring(e+l.length+2))}if(a&&u.length)if(t.includes("{"+a+"}"))t=t.replace("{"+a+"}","{dimensionValue2}");else{const e=t.toLowerCase().indexOf("{"+a.toLowerCase()+"}");e>-1&&(t=t.substring(0,e)+"{dimensionValue2}"+t.substring(e+a.length+2))}r.push({template:t,format:e.getAttribute("format"),resourceType:"tile"})}})),r}function ee(e){const t=Y("WGS84BoundingBox",e),r=t?J("LowerCorner",t).split(" "):["-180","-90"],i=t?J("UpperCorner",t).split(" "):["180","90"];return{xmin:parseFloat(r[0]),ymin:parseFloat(r[1]),xmax:parseFloat(i[0]),ymax:parseFloat(i[1]),spatialReference:{wkid:4326}}}function te(e){const t=[];return(0,B.h)(e,{BoundingBox:e=>{if(!e.getAttribute("crs"))return;const r=e.getAttribute("crs").toLowerCase(),i=se(r),s=r.includes("epsg")&&(0,W.A)(i.wkid);let n,l,o,a;(0,B.h)(e,{LowerCorner:e=>{[n,l]=e.textContent.split(" ").map((e=>Number.parseFloat(e))),s&&([n,l]=[l,n])},UpperCorner:e=>{[o,a]=e.textContent.split(" ").map((e=>Number.parseFloat(e))),s&&([o,a]=[a,o])}}),t.push({xmin:n,ymin:l,xmax:o,ymax:a,spatialReference:i})}}),t}function re(e,t){return G("Style",e).map((e=>{const r=Y("LegendURL",e),i=Y("Keywords",e),s=i?H("Keyword",i):[];let n=r&&r.getAttribute("xlink:href");return t&&(n=n&&n.replace(/^http:/i,"https:")),{abstract:J("Abstract",e),id:J("Identifier",e),isDefault:"true"===e.getAttribute("isDefault"),keywords:s,legendUrl:n,title:J("Title",e)}}))}function ie(e,t,r){return G("TileMatrixSetLink",t).map((t=>function(e,t,r){const i=Y("TileMatrixSet",t).textContent,s=H("TileMatrix",t),n=r.find((e=>{const t=Y("Identifier",e),r=t&&t.textContent;return!!(r===i||i.split(":")&&i.split(":")[1]===r)})),l=Y("TileMatrixSetLimits",t),o=l&&G("TileMatrixLimits",l),a=new Map;if(o?.length)for(const e of o){const t=Y("TileMatrix",e).textContent,r=+Y("MinTileRow",e).textContent,i=+Y("MaxTileRow",e).textContent,s=+Y("MinTileCol",e).textContent,n=+Y("MaxTileCol",e).textContent;a.set(t,{minCol:s,maxCol:n,minRow:r,maxRow:i})}const u=J("SupportedCRS",n).toLowerCase(),c=function(e,t){return ne(Y("TileMatrix",e),t)}(n,u),p=c.spatialReference,d=Y("TileMatrix",n),m=[parseInt(J("TileWidth",d),10),parseInt(J("TileHeight",d),10)],h=[];s.length?s.forEach(((e,t)=>{const r=z("TileMatrix","Identifier",e,n);h.push(ae(r,u,t,i,a))})):G("TileMatrix",n).forEach(((e,t)=>{h.push(ae(e,u,t,i,a))}));const y=function(e,t,r,i,s){const n=Y("BoundingBox",t);let l,o,a,u,c,p;if(n&&(l=J("LowerCorner",n).split(" "),o=J("UpperCorner",n).split(" ")),l&&l.length>1&&o&&o.length>1)a=parseFloat(l[0]),c=parseFloat(l[1]),u=parseFloat(o[0]),p=parseFloat(o[1]);else{const e=Y("TileMatrix",t),n=parseInt(J("MatrixWidth",e),10),l=parseInt(J("MatrixHeight",e),10);a=r.x,p=r.y,u=a+n*i[0]*s.resolution,c=p-l*i[1]*s.resolution}return function(e,t,r){return"1.0.0"===e&&(0,W.A)(t.wkid)&&!(r.spatialReference.isGeographic&&r.x<-90&&r.y>=-90)}(e,r.spatialReference,r)?new w.Z(c,a,p,u,r.spatialReference):new w.Z(a,c,u,p,r.spatialReference)}(e,n,c,m,h[0]).toJSON(),f=new L.Z({dpi:96,spatialReference:p,size:m,origin:c,lods:h}).toJSON();return{id:i,fullExtent:y,tileInfo:f}}(e,t,r)))}function se(e){e=e.toLowerCase();let t=parseInt(e.split(":").pop(),10);900913!==t&&3857!==t||(t=102100);const r=function(e){return e.includes("crs84")||e.includes("crs:84")?le.CRS84:e.includes("crs83")||e.includes("crs:83")?le.CRS83:e.includes("crs27")||e.includes("crs:27")?le.CRS27:null}(e);return(0,a.pC)(r)&&(t=r),{wkid:t}}function ne(e,t){const r=se(t),[i,s]=J("TopLeftCorner",e).split(" ").map((e=>parseFloat(e))),n=t.includes("epsg")&&(0,W.A)(r.wkid);return new Z.Z(n?{x:s,y:i,spatialReference:r}:{x:i,y:s,spatialReference:r})}var le,oe;function ae(e,t,r,i,s){const n=se(t),l=J("Identifier",e);let o=parseFloat(J("ScaleDenominator",e));const a=ue(n.wkid,o,i);o*=96/K;const u=+J("MatrixWidth",e),c=+J("MatrixHeight",e),{maxCol:p=u-1,maxRow:d=c-1,minCol:m=0,minRow:h=0}=s.get(l)??{},{x:y,y:f}=ne(e,t);return{cols:[m,p],level:r,levelValue:l,origin:[y,f],scale:o,resolution:a,rows:[h,d]}}function ue(e,t,r){let i;return i=D.Z.hasOwnProperty(""+e)?D.Z.values[D.Z[e]]:"default028mm"===r?6370997*Math.PI/180:(0,k.e8)(e).metersPerDegree,7*t/25e3/i}(oe=le||(le={}))[oe.CRS84=4326]="CRS84",oe[oe.CRS83=4269]="CRS83",oe[oe.CRS27=4267]="CRS27";const ce={"image/png":".png","image/png8":".png","image/png24":".png","image/png32":".png","image/jpg":".jpg","image/jpeg":".jpeg","image/gif":".gif","image/bmp":".bmp","image/tiff":".tif","image/jpgpng":"","image/jpegpng":"","image/unknown":""},pe=new Set(["version","service","request","layer","style","format","tilematrixset","tilematrix","tilerow","tilecol"]);let de=class extends((0,S.h)((0,b.Q)((0,I.M)((0,M.q)((0,C.I)((0,u.R)(v.Z))))))){constructor(...e){super(...e),this.copyright="",this.customParameters=null,this.customLayerParameters=null,this.fullExtent=null,this.operationalLayerType="WebTiledLayer",this.resourceInfo=null,this.serviceMode="RESTful",this.sublayers=null,this.type="wmts",this.version="1.0.0",this.addHandles([(0,d.YP)((()=>this.activeLayer),((e,t)=>{t&&(t.layer=null),e&&(e.layer=this)}),d.Z_),(0,d.on)((()=>this.sublayers),"after-add",(({item:e})=>{e.layer=this}),d.Z_),(0,d.on)((()=>this.sublayers),"after-remove",(({item:e})=>{e.layer=null}),d.Z_),(0,d.YP)((()=>this.sublayers),((e,t)=>{if(t)for(const e of t)e.layer=null;if(e)for(const t of e)t.layer=this}),d.Z_)])}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){if("KVP"===this.serviceMode||"RESTful"===this.serviceMode)return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMTS"]},e).catch(p.r9).then((()=>this._fetchService(e))).catch((e=>{throw(0,p.r9)(e),new l.Z("wmtslayer:unsupported-service-data","Invalid response from the WMTS service.",{error:e})}))),Promise.resolve(this);console.error("WMTS mode could only be 'KVP' or 'RESTful'")}get activeLayer(){return this._get("activeLayer")}set activeLayer(e){this._set("activeLayer",e)}readActiveLayerFromService(e,t,r){this.activeLayer||(this.activeLayer=new N);let i=t.layers.find((e=>e.id===this.activeLayer.id));return i||(i=t.layers[0]),this.activeLayer.read(i,r),this.activeLayer}readActiveLayerFromItemOrWebDoc(e,t){const{templateUrl:r,wmtsInfo:i}=t,s=r?this._getLowerCasedUrlParams(r):null,n=i?.layerIdentifier;let l=null;const o=i?.tileMatrixSet;o&&(Array.isArray(o)?o.length&&(l=o[0]):l=o);const a=s?.format,u=s?.style;return new N({id:n,imageFormat:a,styleId:u,tileMatrixSetId:l})}writeActiveLayer(e,t,r,i){const s=this.activeLayer;t.templateUrl=this.getUrlTemplate(s.id,s.tileMatrixSetId,s.imageFormat,s.styleId);const n=(0,c.hS)("tileMatrixSet.tileInfo",s);t.tileInfo=n?n.toJSON(i):null,t.wmtsInfo={...t.wmtsInfo,layerIdentifier:s.id,tileMatrixSet:s.tileMatrixSetId}}readCustomParameters(e,t){const r=t.wmtsInfo;return r?this._mergeParams(r.customParameters,r.url):null}get fullExtents(){return this.activeLayer.fullExtents}readServiceMode(e,t){return t.templateUrl.includes("?")?"KVP":"RESTful"}readSublayersFromService(e,t,r){return function(e,t){return e.map((e=>{const r=new N;return r.read(e,t),r}))}(t.layers,r)}get supportedSpatialReferences(){return this.activeLayer.tileMatrixSets?.map((e=>e.tileInfo?.spatialReference)).toArray().filter(a.pC)??[]}get tilemapCache(){const e=this.activeLayer?.tileMatrixSet?.tileInfo;return e?new T(e):void 0}get title(){return this.activeLayer?.title??"Layer"}set title(e){this._overrideIfSome("title",e)}get url(){return this._get("url")}set url(e){e&&"/"===e.substr(-1)?this._set("url",e.slice(0,-1)):this._set("url",e)}createWebTileLayer(e){const t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),r=this._getTileMatrixSetById(e.tileMatrixSetId)?.tileInfo,i=e.fullExtent,s=new P.B({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(s.customLayerParameters=this.customLayerParameters),this.customParameters&&(s.customParameters=this.customParameters),new x.default({fullExtent:i,urlTemplate:t,tileInfo:r,wmtsInfo:s})}fetchTile(e,t,r){const i=this.getTileUrl(e,t,r);return(0,s.default)(i,{responseType:"image"}).then((e=>e.data))}async fetchImageBitmapTile(e,t,r){const i=this.getTileUrl(e,t,r),{data:n}=await(0,s.default)(i,{responseType:"image"});return createImageBitmap(n)}findSublayerById(e){return this.sublayers?.find((t=>t.id===e))}getTileUrl(e,t,r){const i=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId)?.tileInfo?.lods[e],s=i?i.levelValue?i.levelValue:`${i.level}`:`${e}`;let n=this.resourceInfo?"":function(e,t,r,i,s,n,l,o){const a=function(e,t,r){const i=X(e,t),s=i?.filter((e=>e.format===r));return(s?.length?s:i)??[]}(e,t,i);if(!(a?.length>0))return"";const{dimensionMap:u}=e,c=u.get(t).dimensions?.[0],p=u.get(t).dimensions2?.[0];return a[l%a.length].template.replace(/\{Style\}/gi,s??"").replace(/\{TileMatrixSet\}/gi,r??"").replace(/\{TileMatrix\}/gi,n).replace(/\{TileRow\}/gi,""+l).replace(/\{TileCol\}/gi,""+o).replace(/\{dimensionValue\}/gi,c).replace(/\{dimensionValue2\}/gi,p)}({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId,s,t,r);return n||(n=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId).replace(/\{level\}/gi,s).replace(/\{row\}/gi,`${t}`).replace(/\{col\}/gi,`${r}`)),n=this._appendCustomLayerParameters(n),n}getUrlTemplate(e,t,r,i){if(!this.resourceInfo){const r=function(e,t,r,i){const{dimensionMap:s}=e,n=X(e,t);let l="";if(n&&n.length>0){const e=s.get(t).dimensions&&s.get(t).dimensions[0],o=s.get(t).dimensions2&&s.get(t).dimensions2[0];l=n[0].template,l.indexOf(".xxx")===l.length-4&&(l=l.slice(0,l.length-4)),l=l.replace(/\{Style\}/gi,i),l=l.replace(/\{TileMatrixSet\}/gi,r),l=l.replace(/\{TileMatrix\}/gi,"{level}"),l=l.replace(/\{TileRow\}/gi,"{row}"),l=l.replace(/\{TileCol\}/gi,"{col}"),l=l.replace(/\{dimensionValue\}/gi,e),l=l.replace(/\{dimensionValue2\}/gi,o)}return l}({dimensionMap:this.dimensionMap,layerMap:this.layerMap},e,t,i);if(r)return r}if("KVP"===this.serviceMode)return this.url+"?SERVICE=WMTS&VERSION="+this.version+"&REQUEST=GetTile&LAYER="+e+"&STYLE="+i+"&FORMAT="+r+"&TILEMATRIXSET="+t+"&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}";if("RESTful"===this.serviceMode){let s="";return ce[r.toLowerCase()]&&(s=ce[r.toLowerCase()]),this.url+e+"/"+i+"/"+t+"/{level}/{row}/{col}"+s}return""}async _fetchService(e){let t;if(this.resourceInfo)"KVP"===this.resourceInfo.serviceMode&&(this.url+=this.url.includes("?")?"":"?"),t={ssl:!1,data:this.resourceInfo};else try{t=await this._getCapabilities(this.serviceMode,e),$(t.data)}catch{const r="KVP"===this.serviceMode?"RESTful":"KVP";try{t=await this._getCapabilities(r,e),$(t.data),this.serviceMode=r}catch(e){throw new l.Z("wmtslayer:unsupported-service-data","Services does not support RESTful or KVP service modes.",{error:e})}}this.resourceInfo?t.data=function(e){return e.layers.forEach((e=>{e.tileMatrixSets?.forEach((e=>{const t=e.tileInfo;t&&96!==t.dpi&&(t.lods?.forEach((r=>{r.scale=96*r.scale/t.dpi,r.resolution=ue(t.spatialReference?.wkid,r.scale*K/96,e.id)})),t.dpi=96)}))})),e}(t.data):t.data=function(e,t){e=e.replace(/ows:/gi,"");const r=(new DOMParser).parseFromString(e,"text/xml").documentElement,i=new Map,s=new Map,n=Y("Contents",r);if(!n)throw new l.Z("wmtslayer:wmts-capabilities-xml-is-not-valid");const o=Y("OperationsMetadata",r)?.querySelector("[name='GetTile']"),a=o?.getElementsByTagName("Get"),u=a&&Array.prototype.slice.call(a),c=t.url?.indexOf("https"),p=void 0!==c&&c>-1;let d,m,h=t.serviceMode,y=t?.url;if(u&&u.length&&u.some((e=>{const t=Y("Constraint",e);return!t||z("AllowedValues","Value",h,t)?(y=e.attributes[0].nodeValue,!0):(!t||z("AllowedValues","Value","RESTful",t)||z("AllowedValues","Value","REST",t)?m=e.attributes[0].nodeValue:t&&!z("AllowedValues","Value","KVP",t)||(d=e.attributes[0].nodeValue),!1)})),!y)if(m)y=m,h="RESTful";else if(d)y=d,h="KVP";else{const e=Y("ServiceMetadataURL",r);y=e?.getAttribute("xlink:href")}const f=y.indexOf("1.0.0/");-1===f&&"RESTful"===h?y+="/":f>-1&&(y=y.substring(0,f)),"KVP"===h&&(y+=f>-1?"":"?"),p&&(y=y.replace(/^http:/i,"https:"));const g=J("ServiceIdentification>ServiceTypeVersion",r),w=J("ServiceIdentification>AccessConstraints",r),v=w&&/^none$/i.test(w)?null:w,x=G("Layer",n),S=G("TileMatrixSet",n),M=x.map((e=>{const t=J("Identifier",e);return i.set(t,e),Q(t,e,S,p,g)}));return{copyright:v,dimensionMap:s,layerMap:i,layers:M,serviceMode:h,tileUrl:y}}(t.data,{serviceMode:this.serviceMode,url:this.url}),t.data&&this.read(t.data,{origin:"service"})}async _getCapabilities(e,t){const r=this._getCapabilitiesUrl(e);return await(0,s.default)(r,{...t,responseType:"text"})}_getTileMatrixSetById(e){const t=this.findSublayerById(this.activeLayer.id)?.tileMatrixSets?.find((t=>t.id===e));return t}_appendCustomParameters(e){return this._appendParameters(e,this.customParameters)}_appendCustomLayerParameters(e){return this._appendParameters(e,{...(0,o.d9)(this.customParameters),...this.customLayerParameters})}_appendParameters(e,t){const r=(0,m.mN)(e),i={...r.query,...t},s=(0,m.B7)(i);return""===s?r.path:`${r.path}?${s}`}_getCapabilitiesUrl(e){this.url=this.url.split("?")[0];const t="KVP"===e?`${this.url}?request=GetCapabilities&service=WMTS&version=${this.version}`:`${this.url}/${this.version}/WMTSCapabilities.xml`;return this._appendCustomParameters(t)}_getLowerCasedUrlParams(e){if(!e)return null;const t=(0,m.mN)(e).query;if(!t)return null;const r={};return Object.keys(t).forEach((e=>{r[e.toLowerCase()]=t[e]})),r}_mergeParams(e,t){const r=this._getLowerCasedUrlParams(t);if(r){const t=Object.keys(r);t.length&&(e=e?(0,o.d9)(e):{},t.forEach((t=>{e.hasOwnProperty(t)||pe.has(t)||(e[t]=r[t])})))}return e}};(0,i._)([(0,h.Cb)()],de.prototype,"dimensionMap",void 0),(0,i._)([(0,h.Cb)()],de.prototype,"layerMap",void 0),(0,i._)([(0,h.Cb)({type:N,json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],de.prototype,"activeLayer",null),(0,i._)([(0,y.r)("service","activeLayer",["layers"])],de.prototype,"readActiveLayerFromService",null),(0,i._)([(0,y.r)(["web-document","portal-item"],"activeLayer",["wmtsInfo"])],de.prototype,"readActiveLayerFromItemOrWebDoc",null),(0,i._)([(0,g.c)(["web-document","portal-item"],"activeLayer",{templateUrl:{type:String},tileInfo:{type:L.Z},"wmtsInfo.layerIdentifier":{type:String},"wmtsInfo.tileMatrixSet":{type:String}})],de.prototype,"writeActiveLayer",null),(0,i._)([(0,h.Cb)({type:String,value:"",json:{write:!0}})],de.prototype,"copyright",void 0),(0,i._)([(0,h.Cb)({type:["show","hide"]})],de.prototype,"listMode",void 0),(0,i._)([(0,h.Cb)({json:{read:!0,write:!0}})],de.prototype,"blendMode",void 0),(0,i._)([(0,h.Cb)({json:{origins:{"web-document":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}},"portal-item":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}}}}})],de.prototype,"customParameters",void 0),(0,i._)([(0,y.r)(["portal-item","web-document"],"customParameters")],de.prototype,"readCustomParameters",null),(0,i._)([(0,h.Cb)({json:{origins:{"web-document":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}},"portal-item":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}}}}})],de.prototype,"customLayerParameters",void 0),(0,i._)([(0,h.Cb)({type:w.Z,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:"fullExtent"}},"portal-item":{read:{source:"fullExtent"}}}}})],de.prototype,"fullExtent",void 0),(0,i._)([(0,h.Cb)({readOnly:!0})],de.prototype,"fullExtents",null),(0,i._)([(0,h.Cb)({type:["WebTiledLayer"]})],de.prototype,"operationalLayerType",void 0),(0,i._)([(0,h.Cb)()],de.prototype,"resourceInfo",void 0),(0,i._)([(0,h.Cb)()],de.prototype,"serviceMode",void 0),(0,i._)([(0,y.r)(["portal-item","web-document"],"serviceMode",["templateUrl"])],de.prototype,"readServiceMode",null),(0,i._)([(0,h.Cb)({type:n.Z.ofType(N)})],de.prototype,"sublayers",void 0),(0,i._)([(0,y.r)("service","sublayers",["layers"])],de.prototype,"readSublayersFromService",null),(0,i._)([(0,h.Cb)({readOnly:!0})],de.prototype,"supportedSpatialReferences",null),(0,i._)([(0,h.Cb)({readOnly:!0})],de.prototype,"tilemapCache",null),(0,i._)([(0,h.Cb)({json:{read:{source:"title"}}})],de.prototype,"title",null),(0,i._)([(0,h.Cb)({json:{read:!1},readOnly:!0,value:"wmts"})],de.prototype,"type",void 0),(0,i._)([(0,h.Cb)({json:{origins:{service:{read:{source:"tileUrl"}},"web-document":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}},"portal-item":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}}}}})],de.prototype,"url",null),(0,i._)([(0,h.Cb)()],de.prototype,"version",void 0),de=(0,i._)([(0,f.j)("esri.layers.WMTSLayer")],de);const me=de},52162:(e,t,r)=>{r.d(t,{A:()=>s});const i=[[3819,3819],[3821,3824],[3889,3889],[3906,3906],[4001,4025],[4027,4036],[4039,4047],[4052,4055],[4074,4075],[4080,4081],[4120,4176],[4178,4185],[4188,4216],[4218,4289],[4291,4304],[4306,4319],[4322,4326],[4463,4463],[4470,4470],[4475,4475],[4483,4483],[4490,4490],[4555,4558],[4600,4646],[4657,4765],[4801,4811],[4813,4821],[4823,4824],[4901,4904],[5013,5013],[5132,5132],[5228,5229],[5233,5233],[5246,5246],[5252,5252],[5264,5264],[5324,5340],[5354,5354],[5360,5360],[5365,5365],[5370,5373],[5381,5381],[5393,5393],[5451,5451],[5464,5464],[5467,5467],[5489,5489],[5524,5524],[5527,5527],[5546,5546],[2044,2045],[2081,2083],[2085,2086],[2093,2093],[2096,2098],[2105,2132],[2169,2170],[2176,2180],[2193,2193],[2200,2200],[2206,2212],[2319,2319],[2320,2462],[2523,2549],[2551,2735],[2738,2758],[2935,2941],[2953,2953],[3006,3030],[3034,3035],[3038,3051],[3058,3059],[3068,3068],[3114,3118],[3126,3138],[3150,3151],[3300,3301],[3328,3335],[3346,3346],[3350,3352],[3366,3366],[3389,3390],[3416,3417],[3833,3841],[3844,3850],[3854,3854],[3873,3885],[3907,3910],[4026,4026],[4037,4038],[4417,4417],[4434,4434],[4491,4554],[4839,4839],[5048,5048],[5105,5130],[5253,5259],[5269,5275],[5343,5349],[5479,5482],[5518,5519],[5520,5520],[20004,20032],[20064,20092],[21413,21423],[21473,21483],[21896,21899],[22171,22177],[22181,22187],[22191,22197],[25884,25884],[27205,27232],[27391,27398],[27492,27492],[28402,28432],[28462,28492],[30161,30179],[30800,30800],[31251,31259],[31275,31279],[31281,31290],[31466,31700]];function s(e){return null!=e&&i.some((([t,r])=>e>=t&&e<=r))}},88724:(e,t,r)=>{function i(e,t){if(e&&t)for(const r of e.children)if(r.localName in t){const e=t[r.localName];if("function"==typeof e){const t=e(r);t&&i(r,t)}else i(r,e)}}function*s(e,t){for(const r of e.children)if(r.localName in t){const e=t[r.localName];"function"==typeof e?yield e(r):yield*s(r,e)}}r.d(t,{H:()=>s,h:()=>i})}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5853],{17445:(e,t,r)=>{r.d(t,{N1:()=>d,YP:()=>a,Z_:()=>y,gx:()=>u,nn:()=>f,on:()=>p,tX:()=>g});var i=r(91460),s=r(50758),n=r(70586),l=r(95330),o=r(26258);function a(e,t,r={}){return c(e,t,r,m)}function u(e,t,r={}){return c(e,t,r,h)}function c(e,t,r={},i){let s=null;const l=r.once?(e,r)=>{i(e)&&((0,n.hw)(s),t(e,r))}:(e,r)=>{i(e)&&t(e,r)};if(s=(0,o.aQ)(e,l,r.sync,r.equals),r.initial){const t=e();l(t,t)}return s}function p(e,t,r,l={}){let o=null,u=null,c=null;function p(){o&&u&&(u.remove(),l.onListenerRemove?.(o),o=null,u=null)}function d(e){l.once&&l.once&&(0,n.hw)(c),r(e)}const m=a(e,((e,r)=>{p(),(0,i.vT)(e)&&(o=e,u=(0,i.on)(e,t,d),l.onListenerAdd?.(e))}),{sync:l.sync,initial:!0});return c=(0,s.kB)((()=>{m.remove(),p()})),c}function d(e,t){return function(e,t,r){if((0,l.Hc)(r))return Promise.reject((0,l.zE)());const i=e();if(t?.(i))return Promise.resolve(i);let o=null;function a(){o=(0,n.hw)(o)}return new Promise(((i,n)=>{o=(0,s.AL)([(0,l.fu)(r,(()=>{a(),n((0,l.zE)())})),c(e,(e=>{a(),i(e)}),{sync:!1,once:!0},t??m)])}))}(e,h,t)}function m(e){return!0}function h(e){return!!e}r(87538);const y={sync:!0},f={initial:!0},g={sync:!0,initial:!0}},55853:(e,t,r)=>{r.r(t),r.d(t,{default:()=>me});var i=r(43697),s=r(3172),n=r(46791),l=r(20102),o=r(22974),a=r(70586),u=r(16453),c=r(78286),p=r(95330),d=r(17445),m=r(17452),h=r(5600),y=(r(75215),r(71715)),f=r(52011),g=r(30556),w=r(6570),v=r(87085),x=r(16199),S=r(71612),b=r(38009),M=r(16859),C=r(34760),I=r(72965),L=r(11145);class T{constructor(e,t=0,r=e.lods.length-1){this.tileInfo=e,this.minLOD=t,this.maxLOD=r}getAvailability(e,t,r){const i=this.tileInfo?.lodAt(e);return!i||e<this.minLOD||e>this.maxLOD?"unavailable":i.cols&&i.rows?r>=i.cols[0]&&r<=i.cols[1]&&t>=i.rows[0]&&t<=i.rows[1]?"available":"unavailable":"available"}async fetchAvailability(e,t,r,i){return await(0,p.Yn)(i),this.getAvailability(e,t,r)}async fetchAvailabilityUpsample(e,t,r,i,s){await(0,p.Yn)(s),i.level=e,i.row=t,i.col=r;const n=this.tileInfo;for(n.updateTileInfo(i);;){const e=this.getAvailability(i.level,i.row,i.col);if("unavailable"!==e)return e;if(!n.upsampleTile(i))return"unavailable"}}}var _,P=r(5833),E=r(96674);r(67676);let R=_=class extends E.wq{constructor(e){super(e),this.fullExtent=null,this.id=null,this.tileInfo=null}clone(){const e=new _;return this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent&&this.fullExtent.clone()),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("tileInfo")&&(e.tileInfo=this.tileInfo&&this.tileInfo.clone()),e}};(0,i._)([(0,h.Cb)({type:w.Z,json:{read:{source:"fullExtent"}}})],R.prototype,"fullExtent",void 0),(0,i._)([(0,h.Cb)({type:String,json:{read:{source:"id"}}})],R.prototype,"id",void 0),(0,i._)([(0,h.Cb)({type:L.Z,json:{read:{source:"tileInfo"}}})],R.prototype,"tileInfo",void 0),R=_=(0,i._)([(0,f.j)("esri.layer.support.TileMatrixSet")],R);const O=R;var F;let A=F=class extends E.wq{constructor(e){super(e),this.id=null,this.title=null,this.description=null,this.legendUrl=null}clone(){const e=new F;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("isDefault")&&(e.isDefault=this.isDefault),this.hasOwnProperty("keywords")&&(e.keywords=this.keywords&&this.keywords.slice()),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("title")&&(e.title=this.title),e}};(0,i._)([(0,h.Cb)({json:{read:{source:"id"}}})],A.prototype,"id",void 0),(0,i._)([(0,h.Cb)({json:{read:{source:"title"}}})],A.prototype,"title",void 0),(0,i._)([(0,h.Cb)({json:{read:{source:"abstract"}}})],A.prototype,"description",void 0),(0,i._)([(0,h.Cb)({json:{read:{source:"legendUrl"}}})],A.prototype,"legendUrl",void 0),(0,i._)([(0,h.Cb)({json:{read:{source:"isDefault"}}})],A.prototype,"isDefault",void 0),(0,i._)([(0,h.Cb)({json:{read:{source:"keywords"}}})],A.prototype,"keywords",void 0),A=F=(0,i._)([(0,f.j)("esri.layer.support.WMTSStyle")],A);const V=A;var j;let U=j=class extends E.wq{constructor(e){super(e),this.fullExtent=null,this.fullExtents=null,this.imageFormats=null,this.id=null,this.layer=null,this.styles=null,this.tileMatrixSetId=null,this.tileMatrixSets=null}get description(){return this._get("description")}set description(e){this._set("description",e)}readFullExtent(e,t){return(e=t.fullExtent)?w.Z.fromJSON(e):null}readFullExtents(e,t){return t.fullExtents?.length?t.fullExtents.map((e=>w.Z.fromJSON(e))):t.tileMatrixSets?.map((e=>w.Z.fromJSON(e.fullExtent))).filter((e=>e))??[]}get imageFormat(){let e=this._get("imageFormat");return e||(e=this.imageFormats&&this.imageFormats.length?this.imageFormats[0]:""),e}set imageFormat(e){const t=this.imageFormats;e&&(e.includes("image/")||t&&!t.includes(e))&&(e.includes("image/")||(e="image/"+e),t&&!t.includes(e))?console.error("The layer doesn't support the format of "+e):this._set("imageFormat",e)}get styleId(){let e=this._get("styleId");return e||(e=this.styles?.length?this.styles.getItemAt(0).id:""),e}set styleId(e){this._set("styleId",e)}get title(){return this._get("title")}set title(e){this._set("title",e)}get tileMatrixSet(){return this.tileMatrixSets?this.tileMatrixSets.find((e=>e.id===this.tileMatrixSetId)):null}clone(){const e=new j;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("imageFormats")&&(e.imageFormats=this.imageFormats&&this.imageFormats.slice()),this.hasOwnProperty("imageFormat")&&(e.imageFormat=this.imageFormat),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent&&this.fullExtent.clone()),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("styleId")&&(e.styleId=this.styleId),this.hasOwnProperty("styles")&&(e.styles=this.styles&&this.styles.clone()),this.hasOwnProperty("tileMatrixSetId")&&(e.tileMatrixSetId=this.tileMatrixSetId),this.hasOwnProperty("tileMatrixSets")&&(e.tileMatrixSets=this.tileMatrixSets?.clone()),this.hasOwnProperty("title")&&(e.title=this.title),e}};(0,i._)([(0,h.Cb)()],U.prototype,"description",null),(0,i._)([(0,h.Cb)()],U.prototype,"fullExtent",void 0),(0,i._)([(0,y.r)("fullExtent",["fullExtent"])],U.prototype,"readFullExtent",null),(0,i._)([(0,h.Cb)({readOnly:!0})],U.prototype,"fullExtents",void 0),(0,i._)([(0,y.r)("fullExtents",["fullExtents","tileMatrixSets"])],U.prototype,"readFullExtents",null),(0,i._)([(0,h.Cb)()],U.prototype,"imageFormat",null),(0,i._)([(0,h.Cb)({json:{read:{source:"formats"}}})],U.prototype,"imageFormats",void 0),(0,i._)([(0,h.Cb)()],U.prototype,"id",void 0),(0,i._)([(0,h.Cb)()],U.prototype,"layer",void 0),(0,i._)([(0,h.Cb)()],U.prototype,"styleId",null),(0,i._)([(0,h.Cb)({type:n.Z.ofType(V),json:{read:{source:"styles"}}})],U.prototype,"styles",void 0),(0,i._)([(0,h.Cb)({value:null,json:{write:{ignoreOrigin:!0}}})],U.prototype,"title",null),(0,i._)([(0,h.Cb)()],U.prototype,"tileMatrixSetId",void 0),(0,i._)([(0,h.Cb)({readOnly:!0})],U.prototype,"tileMatrixSet",null),(0,i._)([(0,h.Cb)({type:n.Z.ofType(O),json:{read:{source:"tileMatrixSets"}}})],U.prototype,"tileMatrixSets",void 0),U=j=(0,i._)([(0,f.j)("esri.layers.support.WMTSSublayer")],U);const N=U;var Z=r(94139),k=r(24678),D=r(58116),W=r(52162),B=r(88724);const K=90.71428571428571;function $(e){const t=e.replace(/ows:/gi,"");if(!Y("Contents",(new DOMParser).parseFromString(t,"text/xml").documentElement))throw new l.Z("wmtslayer:wmts-capabilities-xml-is-not-valid","the wmts get capabilities response is not compliant",{text:e})}function q(e){return e.nodeType===Node.ELEMENT_NODE}function Y(e,t){for(let r=0;r<t.childNodes.length;r++){const i=t.childNodes[r];if(q(i)&&i.nodeName===e)return i}return null}function G(e,t){const r=[];for(let i=0;i<t.childNodes.length;i++){const s=t.childNodes[i];q(s)&&s.nodeName===e&&r.push(s)}return r}function H(e,t){const r=[];for(let i=0;i<t.childNodes.length;i++){const s=t.childNodes[i];q(s)&&s.nodeName===e&&r.push(s)}return r.map((e=>e.textContent)).filter(a.pC)}function J(e,t){return e.split(">").forEach((e=>{t&&(t=Y(e,t))})),t&&t.textContent}function z(e,t,r,i){let s;return Array.prototype.slice.call(i.childNodes).some((i=>{if(i.nodeName.includes(e)){const e=Y(t,i),n=e&&e.textContent;if(n===r||r.split(":")&&r.split(":")[1]===n)return s=i,!0}return!1})),s}function Q(e,t,r,i,s){const n=J("Abstract",t),l=H("Format",t);return{id:e,fullExtent:ee(t),fullExtents:te(t),description:n,formats:l,styles:re(t,i),title:J("Title",t),tileMatrixSets:ie(s,t,r)}}function X(e,t){const r=[],i=e.layerMap?.get(t);if(!i)return null;const s=G("ResourceURL",i),n=G("Dimension",i);let l,o,a,u;return n.length&&(l=J("Identifier",n[0]),o=H("Default",n[0])||H("Value",n[0])),n.length>1&&(a=J("Identifier",n[1]),u=H("Default",n[1])||H("Value",n[1])),e.dimensionMap.set(t,{dimensions:o,dimensions2:u}),s.forEach((e=>{let t=e.getAttribute("template");if("tile"===e.getAttribute("resourceType")){if(l&&o.length)if(t.includes("{"+l+"}"))t=t.replace("{"+l+"}","{dimensionValue}");else{const e=t.toLowerCase().indexOf("{"+l.toLowerCase()+"}");e>-1&&(t=t.substring(0,e)+"{dimensionValue}"+t.substring(e+l.length+2))}if(a&&u.length)if(t.includes("{"+a+"}"))t=t.replace("{"+a+"}","{dimensionValue2}");else{const e=t.toLowerCase().indexOf("{"+a.toLowerCase()+"}");e>-1&&(t=t.substring(0,e)+"{dimensionValue2}"+t.substring(e+a.length+2))}r.push({template:t,format:e.getAttribute("format"),resourceType:"tile"})}})),r}function ee(e){const t=Y("WGS84BoundingBox",e),r=t?J("LowerCorner",t).split(" "):["-180","-90"],i=t?J("UpperCorner",t).split(" "):["180","90"];return{xmin:parseFloat(r[0]),ymin:parseFloat(r[1]),xmax:parseFloat(i[0]),ymax:parseFloat(i[1]),spatialReference:{wkid:4326}}}function te(e){const t=[];return(0,B.h)(e,{BoundingBox:e=>{if(!e.getAttribute("crs"))return;const r=e.getAttribute("crs").toLowerCase(),i=se(r),s=r.includes("epsg")&&(0,W.A)(i.wkid);let n,l,o,a;(0,B.h)(e,{LowerCorner:e=>{[n,l]=e.textContent.split(" ").map((e=>Number.parseFloat(e))),s&&([n,l]=[l,n])},UpperCorner:e=>{[o,a]=e.textContent.split(" ").map((e=>Number.parseFloat(e))),s&&([o,a]=[a,o])}}),t.push({xmin:n,ymin:l,xmax:o,ymax:a,spatialReference:i})}}),t}function re(e,t){return G("Style",e).map((e=>{const r=Y("LegendURL",e),i=Y("Keywords",e),s=i?H("Keyword",i):[];let n=r&&r.getAttribute("xlink:href");return t&&(n=n&&n.replace(/^http:/i,"https:")),{abstract:J("Abstract",e),id:J("Identifier",e),isDefault:"true"===e.getAttribute("isDefault"),keywords:s,legendUrl:n,title:J("Title",e)}}))}function ie(e,t,r){return G("TileMatrixSetLink",t).map((t=>function(e,t,r){const i=Y("TileMatrixSet",t).textContent,s=H("TileMatrix",t),n=r.find((e=>{const t=Y("Identifier",e),r=t&&t.textContent;return!!(r===i||i.split(":")&&i.split(":")[1]===r)})),l=Y("TileMatrixSetLimits",t),o=l&&G("TileMatrixLimits",l),a=new Map;if(o?.length)for(const e of o){const t=Y("TileMatrix",e).textContent,r=+Y("MinTileRow",e).textContent,i=+Y("MaxTileRow",e).textContent,s=+Y("MinTileCol",e).textContent,n=+Y("MaxTileCol",e).textContent;a.set(t,{minCol:s,maxCol:n,minRow:r,maxRow:i})}const u=J("SupportedCRS",n).toLowerCase(),c=function(e,t){return ne(Y("TileMatrix",e),t)}(n,u),p=c.spatialReference,d=Y("TileMatrix",n),m=[parseInt(J("TileWidth",d),10),parseInt(J("TileHeight",d),10)],h=[];s.length?s.forEach(((e,t)=>{const r=z("TileMatrix","Identifier",e,n);h.push(ae(r,u,t,i,a))})):G("TileMatrix",n).forEach(((e,t)=>{h.push(ae(e,u,t,i,a))}));const y=function(e,t,r,i,s){const n=Y("BoundingBox",t);let l,o,a,u,c,p;if(n&&(l=J("LowerCorner",n).split(" "),o=J("UpperCorner",n).split(" ")),l&&l.length>1&&o&&o.length>1)a=parseFloat(l[0]),c=parseFloat(l[1]),u=parseFloat(o[0]),p=parseFloat(o[1]);else{const e=Y("TileMatrix",t),n=parseInt(J("MatrixWidth",e),10),l=parseInt(J("MatrixHeight",e),10);a=r.x,p=r.y,u=a+n*i[0]*s.resolution,c=p-l*i[1]*s.resolution}return function(e,t,r){return"1.0.0"===e&&(0,W.A)(t.wkid)&&!(r.spatialReference.isGeographic&&r.x<-90&&r.y>=-90)}(e,r.spatialReference,r)?new w.Z(c,a,p,u,r.spatialReference):new w.Z(a,c,u,p,r.spatialReference)}(e,n,c,m,h[0]).toJSON(),f=new L.Z({dpi:96,spatialReference:p,size:m,origin:c,lods:h}).toJSON();return{id:i,fullExtent:y,tileInfo:f}}(e,t,r)))}function se(e){e=e.toLowerCase();let t=parseInt(e.split(":").pop(),10);900913!==t&&3857!==t||(t=102100);const r=function(e){return e.includes("crs84")||e.includes("crs:84")?le.CRS84:e.includes("crs83")||e.includes("crs:83")?le.CRS83:e.includes("crs27")||e.includes("crs:27")?le.CRS27:null}(e);return(0,a.pC)(r)&&(t=r),{wkid:t}}function ne(e,t){const r=se(t),[i,s]=J("TopLeftCorner",e).split(" ").map((e=>parseFloat(e))),n=t.includes("epsg")&&(0,W.A)(r.wkid);return new Z.Z(n?{x:s,y:i,spatialReference:r}:{x:i,y:s,spatialReference:r})}var le,oe;function ae(e,t,r,i,s){const n=se(t),l=J("Identifier",e);let o=parseFloat(J("ScaleDenominator",e));const a=ue(n.wkid,o,i);o*=96/K;const u=+J("MatrixWidth",e),c=+J("MatrixHeight",e),{maxCol:p=u-1,maxRow:d=c-1,minCol:m=0,minRow:h=0}=s.get(l)??{},{x:y,y:f}=ne(e,t);return{cols:[m,p],level:r,levelValue:l,origin:[y,f],scale:o,resolution:a,rows:[h,d]}}function ue(e,t,r){let i;return i=D.Z.hasOwnProperty(""+e)?D.Z.values[D.Z[e]]:"default028mm"===r?6370997*Math.PI/180:(0,k.e8)(e).metersPerDegree,7*t/25e3/i}(oe=le||(le={}))[oe.CRS84=4326]="CRS84",oe[oe.CRS83=4269]="CRS83",oe[oe.CRS27=4267]="CRS27";const ce={"image/png":".png","image/png8":".png","image/png24":".png","image/png32":".png","image/jpg":".jpg","image/jpeg":".jpeg","image/gif":".gif","image/bmp":".bmp","image/tiff":".tif","image/jpgpng":"","image/jpegpng":"","image/unknown":""},pe=new Set(["version","service","request","layer","style","format","tilematrixset","tilematrix","tilerow","tilecol"]);let de=class extends((0,S.h)((0,C.Q)((0,I.M)((0,b.q)((0,M.I)((0,u.R)(v.Z))))))){constructor(...e){super(...e),this.copyright="",this.customParameters=null,this.customLayerParameters=null,this.fullExtent=null,this.operationalLayerType="WebTiledLayer",this.resourceInfo=null,this.serviceMode="RESTful",this.sublayers=null,this.type="wmts",this.version="1.0.0",this.addHandles([(0,d.YP)((()=>this.activeLayer),((e,t)=>{t&&(t.layer=null),e&&(e.layer=this)}),d.Z_),(0,d.on)((()=>this.sublayers),"after-add",(({item:e})=>{e.layer=this}),d.Z_),(0,d.on)((()=>this.sublayers),"after-remove",(({item:e})=>{e.layer=null}),d.Z_),(0,d.YP)((()=>this.sublayers),((e,t)=>{if(t)for(const e of t)e.layer=null;if(e)for(const t of e)t.layer=this}),d.Z_)])}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){if("KVP"===this.serviceMode||"RESTful"===this.serviceMode)return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMTS"]},e).catch(p.r9).then((()=>this._fetchService(e))).catch((e=>{throw(0,p.r9)(e),new l.Z("wmtslayer:unsupported-service-data","Invalid response from the WMTS service.",{error:e})}))),Promise.resolve(this);console.error("WMTS mode could only be 'KVP' or 'RESTful'")}get activeLayer(){return this._get("activeLayer")}set activeLayer(e){this._set("activeLayer",e)}readActiveLayerFromService(e,t,r){this.activeLayer||(this.activeLayer=new N);let i=t.layers.find((e=>e.id===this.activeLayer.id));return i||(i=t.layers[0]),this.activeLayer.read(i,r),this.activeLayer}readActiveLayerFromItemOrWebDoc(e,t){const{templateUrl:r,wmtsInfo:i}=t,s=r?this._getLowerCasedUrlParams(r):null,n=i?.layerIdentifier;let l=null;const o=i?.tileMatrixSet;o&&(Array.isArray(o)?o.length&&(l=o[0]):l=o);const a=s?.format,u=s?.style;return new N({id:n,imageFormat:a,styleId:u,tileMatrixSetId:l})}writeActiveLayer(e,t,r,i){const s=this.activeLayer;t.templateUrl=this.getUrlTemplate(s.id,s.tileMatrixSetId,s.imageFormat,s.styleId);const n=(0,c.hS)("tileMatrixSet.tileInfo",s);t.tileInfo=n?n.toJSON(i):null,t.wmtsInfo={...t.wmtsInfo,layerIdentifier:s.id,tileMatrixSet:s.tileMatrixSetId}}readCustomParameters(e,t){const r=t.wmtsInfo;return r?this._mergeParams(r.customParameters,r.url):null}get fullExtents(){return this.activeLayer.fullExtents}readServiceMode(e,t){return t.templateUrl.includes("?")?"KVP":"RESTful"}readSublayersFromService(e,t,r){return function(e,t){return e.map((e=>{const r=new N;return r.read(e,t),r}))}(t.layers,r)}get supportedSpatialReferences(){return this.activeLayer.tileMatrixSets?.map((e=>e.tileInfo?.spatialReference)).toArray().filter(a.pC)??[]}get tilemapCache(){const e=this.activeLayer?.tileMatrixSet?.tileInfo;return e?new T(e):void 0}get title(){return this.activeLayer?.title??"Layer"}set title(e){this._overrideIfSome("title",e)}get url(){return this._get("url")}set url(e){e&&"/"===e.substr(-1)?this._set("url",e.slice(0,-1)):this._set("url",e)}createWebTileLayer(e){const t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),r=this._getTileMatrixSetById(e.tileMatrixSetId)?.tileInfo,i=e.fullExtent,s=new P.B({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(s.customLayerParameters=this.customLayerParameters),this.customParameters&&(s.customParameters=this.customParameters),new x.default({fullExtent:i,urlTemplate:t,tileInfo:r,wmtsInfo:s})}fetchTile(e,t,r){const i=this.getTileUrl(e,t,r);return(0,s.default)(i,{responseType:"image"}).then((e=>e.data))}async fetchImageBitmapTile(e,t,r){const i=this.getTileUrl(e,t,r),{data:n}=await(0,s.default)(i,{responseType:"blob"});return createImageBitmap(n)}findSublayerById(e){return this.sublayers?.find((t=>t.id===e))}getTileUrl(e,t,r){const i=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId)?.tileInfo?.lods[e],s=i?i.levelValue?i.levelValue:`${i.level}`:`${e}`;let n=this.resourceInfo?"":function(e,t,r,i,s,n,l,o){const a=function(e,t,r){const i=X(e,t),s=i?.filter((e=>e.format===r));return(s?.length?s:i)??[]}(e,t,i);if(!(a?.length>0))return"";const{dimensionMap:u}=e,c=u.get(t).dimensions?.[0],p=u.get(t).dimensions2?.[0];return a[l%a.length].template.replace(/\{Style\}/gi,s??"").replace(/\{TileMatrixSet\}/gi,r??"").replace(/\{TileMatrix\}/gi,n).replace(/\{TileRow\}/gi,""+l).replace(/\{TileCol\}/gi,""+o).replace(/\{dimensionValue\}/gi,c).replace(/\{dimensionValue2\}/gi,p)}({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId,s,t,r);return n||(n=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId).replace(/\{level\}/gi,s).replace(/\{row\}/gi,`${t}`).replace(/\{col\}/gi,`${r}`)),n=this._appendCustomLayerParameters(n),n}getUrlTemplate(e,t,r,i){if(!this.resourceInfo){const r=function(e,t,r,i){const{dimensionMap:s}=e,n=X(e,t);let l="";if(n&&n.length>0){const e=s.get(t).dimensions&&s.get(t).dimensions[0],o=s.get(t).dimensions2&&s.get(t).dimensions2[0];l=n[0].template,l.indexOf(".xxx")===l.length-4&&(l=l.slice(0,l.length-4)),l=l.replace(/\{Style\}/gi,i),l=l.replace(/\{TileMatrixSet\}/gi,r),l=l.replace(/\{TileMatrix\}/gi,"{level}"),l=l.replace(/\{TileRow\}/gi,"{row}"),l=l.replace(/\{TileCol\}/gi,"{col}"),l=l.replace(/\{dimensionValue\}/gi,e),l=l.replace(/\{dimensionValue2\}/gi,o)}return l}({dimensionMap:this.dimensionMap,layerMap:this.layerMap},e,t,i);if(r)return r}if("KVP"===this.serviceMode)return this.url+"?SERVICE=WMTS&VERSION="+this.version+"&REQUEST=GetTile&LAYER="+e+"&STYLE="+i+"&FORMAT="+r+"&TILEMATRIXSET="+t+"&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}";if("RESTful"===this.serviceMode){let s="";return ce[r.toLowerCase()]&&(s=ce[r.toLowerCase()]),this.url+e+"/"+i+"/"+t+"/{level}/{row}/{col}"+s}return""}async _fetchService(e){let t;if(this.resourceInfo)"KVP"===this.resourceInfo.serviceMode&&(this.url+=this.url.includes("?")?"":"?"),t={ssl:!1,data:this.resourceInfo};else try{t=await this._getCapabilities(this.serviceMode,e),$(t.data)}catch{const r="KVP"===this.serviceMode?"RESTful":"KVP";try{t=await this._getCapabilities(r,e),$(t.data),this.serviceMode=r}catch(e){throw new l.Z("wmtslayer:unsupported-service-data","Services does not support RESTful or KVP service modes.",{error:e})}}this.resourceInfo?t.data=function(e){return e.layers.forEach((e=>{e.tileMatrixSets?.forEach((e=>{const t=e.tileInfo;t&&96!==t.dpi&&(t.lods?.forEach((r=>{r.scale=96*r.scale/t.dpi,r.resolution=ue(t.spatialReference?.wkid,r.scale*K/96,e.id)})),t.dpi=96)}))})),e}(t.data):t.data=function(e,t){e=e.replace(/ows:/gi,"");const r=(new DOMParser).parseFromString(e,"text/xml").documentElement,i=new Map,s=new Map,n=Y("Contents",r);if(!n)throw new l.Z("wmtslayer:wmts-capabilities-xml-is-not-valid");const o=Y("OperationsMetadata",r)?.querySelector("[name='GetTile']"),a=o?.getElementsByTagName("Get"),u=a&&Array.prototype.slice.call(a),c=t.url?.indexOf("https"),p=void 0!==c&&c>-1;let d,m,h=t.serviceMode,y=t?.url;if(u&&u.length&&u.some((e=>{const t=Y("Constraint",e);return!t||z("AllowedValues","Value",h,t)?(y=e.attributes[0].nodeValue,!0):(!t||z("AllowedValues","Value","RESTful",t)||z("AllowedValues","Value","REST",t)?m=e.attributes[0].nodeValue:t&&!z("AllowedValues","Value","KVP",t)||(d=e.attributes[0].nodeValue),!1)})),!y)if(m)y=m,h="RESTful";else if(d)y=d,h="KVP";else{const e=Y("ServiceMetadataURL",r);y=e?.getAttribute("xlink:href")}const f=y.indexOf("1.0.0/");-1===f&&"RESTful"===h?y+="/":f>-1&&(y=y.substring(0,f)),"KVP"===h&&(y+=f>-1?"":"?"),p&&(y=y.replace(/^http:/i,"https:"));const g=J("ServiceIdentification>ServiceTypeVersion",r),w=J("ServiceIdentification>AccessConstraints",r),v=w&&/^none$/i.test(w)?null:w,x=G("Layer",n),S=G("TileMatrixSet",n),b=x.map((e=>{const t=J("Identifier",e);return i.set(t,e),Q(t,e,S,p,g)}));return{copyright:v,dimensionMap:s,layerMap:i,layers:b,serviceMode:h,tileUrl:y}}(t.data,{serviceMode:this.serviceMode,url:this.url}),t.data&&this.read(t.data,{origin:"service"})}async _getCapabilities(e,t){const r=this._getCapabilitiesUrl(e);return await(0,s.default)(r,{...t,responseType:"text"})}_getTileMatrixSetById(e){const t=this.findSublayerById(this.activeLayer.id)?.tileMatrixSets?.find((t=>t.id===e));return t}_appendCustomParameters(e){return this._appendParameters(e,this.customParameters)}_appendCustomLayerParameters(e){return this._appendParameters(e,{...(0,o.d9)(this.customParameters),...this.customLayerParameters})}_appendParameters(e,t){const r=(0,m.mN)(e),i={...r.query,...t},s=(0,m.B7)(i);return""===s?r.path:`${r.path}?${s}`}_getCapabilitiesUrl(e){this.url=this.url.split("?")[0];const t="KVP"===e?`${this.url}?request=GetCapabilities&service=WMTS&version=${this.version}`:`${this.url}/${this.version}/WMTSCapabilities.xml`;return this._appendCustomParameters(t)}_getLowerCasedUrlParams(e){if(!e)return null;const t=(0,m.mN)(e).query;if(!t)return null;const r={};return Object.keys(t).forEach((e=>{r[e.toLowerCase()]=t[e]})),r}_mergeParams(e,t){const r=this._getLowerCasedUrlParams(t);if(r){const t=Object.keys(r);t.length&&(e=e?(0,o.d9)(e):{},t.forEach((t=>{e.hasOwnProperty(t)||pe.has(t)||(e[t]=r[t])})))}return e}};(0,i._)([(0,h.Cb)()],de.prototype,"dimensionMap",void 0),(0,i._)([(0,h.Cb)()],de.prototype,"layerMap",void 0),(0,i._)([(0,h.Cb)({type:N,json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],de.prototype,"activeLayer",null),(0,i._)([(0,y.r)("service","activeLayer",["layers"])],de.prototype,"readActiveLayerFromService",null),(0,i._)([(0,y.r)(["web-document","portal-item"],"activeLayer",["wmtsInfo"])],de.prototype,"readActiveLayerFromItemOrWebDoc",null),(0,i._)([(0,g.c)(["web-document","portal-item"],"activeLayer",{templateUrl:{type:String},tileInfo:{type:L.Z},"wmtsInfo.layerIdentifier":{type:String},"wmtsInfo.tileMatrixSet":{type:String}})],de.prototype,"writeActiveLayer",null),(0,i._)([(0,h.Cb)({type:String,value:"",json:{write:!0}})],de.prototype,"copyright",void 0),(0,i._)([(0,h.Cb)({type:["show","hide"]})],de.prototype,"listMode",void 0),(0,i._)([(0,h.Cb)({json:{read:!0,write:!0}})],de.prototype,"blendMode",void 0),(0,i._)([(0,h.Cb)({json:{origins:{"web-document":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}},"portal-item":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}}}}})],de.prototype,"customParameters",void 0),(0,i._)([(0,y.r)(["portal-item","web-document"],"customParameters")],de.prototype,"readCustomParameters",null),(0,i._)([(0,h.Cb)({json:{origins:{"web-document":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}},"portal-item":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}}}}})],de.prototype,"customLayerParameters",void 0),(0,i._)([(0,h.Cb)({type:w.Z,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:"fullExtent"}},"portal-item":{read:{source:"fullExtent"}}}}})],de.prototype,"fullExtent",void 0),(0,i._)([(0,h.Cb)({readOnly:!0})],de.prototype,"fullExtents",null),(0,i._)([(0,h.Cb)({type:["WebTiledLayer"]})],de.prototype,"operationalLayerType",void 0),(0,i._)([(0,h.Cb)()],de.prototype,"resourceInfo",void 0),(0,i._)([(0,h.Cb)()],de.prototype,"serviceMode",void 0),(0,i._)([(0,y.r)(["portal-item","web-document"],"serviceMode",["templateUrl"])],de.prototype,"readServiceMode",null),(0,i._)([(0,h.Cb)({type:n.Z.ofType(N)})],de.prototype,"sublayers",void 0),(0,i._)([(0,y.r)("service","sublayers",["layers"])],de.prototype,"readSublayersFromService",null),(0,i._)([(0,h.Cb)({readOnly:!0})],de.prototype,"supportedSpatialReferences",null),(0,i._)([(0,h.Cb)({readOnly:!0})],de.prototype,"tilemapCache",null),(0,i._)([(0,h.Cb)({json:{read:{source:"title"}}})],de.prototype,"title",null),(0,i._)([(0,h.Cb)({json:{read:!1},readOnly:!0,value:"wmts"})],de.prototype,"type",void 0),(0,i._)([(0,h.Cb)({json:{origins:{service:{read:{source:"tileUrl"}},"web-document":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}},"portal-item":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}}}}})],de.prototype,"url",null),(0,i._)([(0,h.Cb)()],de.prototype,"version",void 0),de=(0,i._)([(0,f.j)("esri.layers.WMTSLayer")],de);const me=de},52162:(e,t,r)=>{r.d(t,{A:()=>s});const i=[[3819,3819],[3821,3824],[3889,3889],[3906,3906],[4001,4025],[4027,4036],[4039,4047],[4052,4055],[4074,4075],[4080,4081],[4120,4176],[4178,4185],[4188,4216],[4218,4289],[4291,4304],[4306,4319],[4322,4326],[4463,4463],[4470,4470],[4475,4475],[4483,4483],[4490,4490],[4555,4558],[4600,4646],[4657,4765],[4801,4811],[4813,4821],[4823,4824],[4901,4904],[5013,5013],[5132,5132],[5228,5229],[5233,5233],[5246,5246],[5252,5252],[5264,5264],[5324,5340],[5354,5354],[5360,5360],[5365,5365],[5370,5373],[5381,5381],[5393,5393],[5451,5451],[5464,5464],[5467,5467],[5489,5489],[5524,5524],[5527,5527],[5546,5546],[2044,2045],[2081,2083],[2085,2086],[2093,2093],[2096,2098],[2105,2132],[2169,2170],[2176,2180],[2193,2193],[2200,2200],[2206,2212],[2319,2319],[2320,2462],[2523,2549],[2551,2735],[2738,2758],[2935,2941],[2953,2953],[3006,3030],[3034,3035],[3038,3051],[3058,3059],[3068,3068],[3114,3118],[3126,3138],[3150,3151],[3300,3301],[3328,3335],[3346,3346],[3350,3352],[3366,3366],[3389,3390],[3416,3417],[3833,3841],[3844,3850],[3854,3854],[3873,3885],[3907,3910],[4026,4026],[4037,4038],[4417,4417],[4434,4434],[4491,4554],[4839,4839],[5048,5048],[5105,5130],[5253,5259],[5269,5275],[5343,5349],[5479,5482],[5518,5519],[5520,5520],[20004,20032],[20064,20092],[21413,21423],[21473,21483],[21896,21899],[22171,22177],[22181,22187],[22191,22197],[25884,25884],[27205,27232],[27391,27398],[27492,27492],[28402,28432],[28462,28492],[30161,30179],[30800,30800],[31251,31259],[31275,31279],[31281,31290],[31466,31700]];function s(e){return null!=e&&i.some((([t,r])=>e>=t&&e<=r))}},88724:(e,t,r)=>{function i(e,t){if(e&&t)for(const r of e.children)if(r.localName in t){const e=t[r.localName];if("function"==typeof e){const t=e(r);t&&i(r,t)}else i(r,e)}}function*s(e,t){for(const r of e.children)if(r.localName in t){const e=t[r.localName];"function"==typeof e?yield e(r):yield*s(r,e)}}r.d(t,{H:()=>s,h:()=>i})}}]);
|