/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
v4.33.0-next.166 */
var g=class{constructor(){this.promise=new Promise((t,n)=>{this.resolve=t,this.reject=n})}},y=(e,t)=>{let n=e;for(;n;){if(n===t)return!0;if(!n.parentNode)return!1;n.parentNode instanceof ShadowRoot?n=n.parentNode.host:n=n.parentNode}return!1},$=(e,t,n)=>{let o=A(t).subscribe;return o(s=>{s.some(r=>y(e,r.target))&&n()})},p={},A=e=>{let t=e.join(","),n=p[t];if(n!==void 0)return n;let o=new Set,s=new MutationObserver(r=>o.forEach(i=>i(r)));globalThis.document&&s.observe(document.documentElement,{attributes:!0,attributeFilter:e,subtree:!0});let c={subscribe:r=>(o.add(r),()=>{o.delete(r),o.size===0&&(s.disconnect(),p[t]=void 0)})};return p[t]=c,c},E=(e,t)=>{let n=e;for(;n;){let o=n.closest?.(t);if(o)return o;let s=n.getRootNode?.();if(s===globalThis.document)return null;n=s.host}return null},U=e=>E(e,":is(.calcite-mode-light, .calcite-mode-dark)")?.classList.contains("calcite-mode-dark")?"dark":"light";var N=(e,t,n)=>E(e,`[${t}]`)?.getAttribute(t)??n,S=e=>e.nodeType===Node.ELEMENT_NODE,w=e=>typeof e.setFocus=="function",l=(e,t="")=>{if(!S(e))return!1;if(e.matches(t))return w(e)&&setTimeout(()=>void e.setFocus(),0),!0;for(let o of e.children)if(l(o,t))return!0;let n=e.shadowRoot;if(n){for(let o of n.children)if(l(o,t))return!0}return!1},M=async e=>{e!=null&&(w(e)?await e.setFocus():e.focus())},V=(e,t)=>{if(e?.shadowRoot){if(e.hasAttribute("hydrated")||e.hasAttribute("calcite-hydrated")){l(e,t);return}Promise.resolve(e.componentOnReady?.()).then(()=>l(e,t))}};var q=(e,t,...n)=>{try{return e?.call(t,...n)}catch(o){console.error(o,e)}},_=async(e,t,...n)=>{try{return await e?.call(t,...n)}catch(o){console.error(o,e)}},a=e=>{let t="";for(let n=0;n<e;n++)t+=((1+Math.random())*65536|0).toString(16).substring(1);return t},B=()=>[a(2),a(1),a(1),a(1),a(3)].join("-"),j="ar,bg,bs,ca,cs,da,de,el,en,es,et,fi,fr,he,hr,hu,id,it,ja,ko,lt,lv,nl,nb,no,pl,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,th,tr,uk,vi,zh-CN,zh-HK,zh-TW".split(","),C=new Set(j),u="en",R={pt:"pt-PT",nb:"no",nn:"no",zh:"zh-CN"},z=async(e,t,n="")=>{let o=`${t}/${n}`,s=`${o}${e}.json`;return f[s]??(f[s]=L(e,o)),await f[s]},f={},L=async(e,t)=>{let n=`${t}${e}.json`;try{let o=await fetch(n);if(o.ok)return await o.json()}catch(o){return console.error(o),{}}return e===u?{}:await L(u,t)},O=e=>{let t=N(e,"lang",globalThis.navigator?.language||u);return{lang:t,t9nLocale:T(t)}},T=e=>{let[t,n]=e.split("-"),o=t.toLowerCase(),s=o;return n&&(s=`${o}-${n.toUpperCase()}`),s=R[s]??s,C.has(s)?s:n?T(o):u},Q=(e,t,n,o)=>{let s,c=()=>k(e,t(),o).then(r=>{(s?.lang!==r.lang||s.t9nLocale!==r.t9nLocale||s.t9nStrings!==r.t9nStrings)&&n(r),s=r}).catch(console.error);return queueMicrotask(c),$(e,["lang"],c)},k=async(e,t,n=e.localName.split("-").slice(1).join("-"))=>{let{lang:o,t9nLocale:s}=O(e),c=`${t}/${n}/t9n`,i=n===null?{}:await z(s,c,"messages.");return{lang:o,t9nLocale:s,t9nStrings:i}};var m='"',b="'",v=(e,t)=>new Array(t+1).join(e),D=e=>{let t=m,n=b;e.includes(t)&&!e.includes(n)&&(n=m,t=b);let s=new RegExp(`(^|[^\\\\])((?:\\\\{2})*)((?:\\\\${n})+)`,"gu");e=e.replace(s,(r,i,d,h)=>i+d+v(n,h.length/2));let c=new RegExp(`(^|[^\\\\])((?:\\\\{2})*)(${t}+)`,"gu");return e=e.replace(c,(r,i,d,h)=>i+d+v(`\\${t}`,h.length)),t+e+t},H=e=>{let t=e?e.replaceAll(/[-[\]/{}()*+?.\\^$|]/gu,"\\$&"):"^.*$";return new RegExp(t,"i")},K=(e,t={})=>(e??"").replace(/\{(?<valueName>.*?)\}/gu,(n,o)=>t[o]??n),Z=e=>`\u200E${e??""}\u200E`;var G=e=>e.replace(P,(t,n)=>`${n===0?"":"-"}${t.toLowerCase()}`),P=/[A-Z]+(?![a-z])|[A-Z]/gu;var J=(e,t)=>{let n=t>x?F:t/I,o=0,s=setInterval(()=>{o+=n,o>=t&&(clearInterval(s),e())},n);return s},x=4e3,F=2e3,I=4,W=e=>e!==null,X=e=>e!==void 0;var Y=(e,t=100)=>{let n;return(...o)=>{let s=()=>{clearTimeout(n),e(...o)};clearTimeout(n),n=setTimeout(s,t)}};export{g as a,$ as b,U as c,M as d,V as e,q as f,_ as g,B as h,C as i,z as j,O as k,T as l,Q as m,D as n,H as o,K as p,Z as q,G as r,J as s,W as t,X as u,Y as v};
