UNPKG

@arcgis/coding-components

Version:

Contains components for editing code in different languages. The currently supported languages are html, css, json, TypeScript, JavaScript, and Arcade.

7 lines (6 loc) • 32.1 kB
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. v4.33.14 */ import{a as C,f as p,g as M,r as G,s as Tt}from"./SWSGV34B.js";var J=globalThis,Q=J.ShadowRoot&&(J.ShadyCSS===void 0||J.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ht=Symbol(),Pt=new WeakMap,I=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==ht)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(Q&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Pt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Pt.set(e,t))}return t}toString(){return this.cssText}},Nt=o=>new I(typeof o=="string"?o:o+"",void 0,ht),ae=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,n,i)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+o[i+1],o[0]);return new I(e,o,ht)},Rt=(o,t)=>{if(Q)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),n=J.litNonce;n!==void 0&&s.setAttribute("nonce",n),s.textContent=e.cssText,o.appendChild(s)}},dt=Q?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Nt(e)})(o):o;var ut=globalThis,Y=ut.trustedTypes,Dt=Y?Y.createPolicy("lit-html",{createHTML:o=>o}):void 0,ft="$lit$",b=`lit$${Math.random().toFixed(9).slice(2)}$`,mt="?"+b,ce=`<${mt}>`,x=document,H=()=>x.createComment(""),V=o=>o===null||typeof o!="object"&&typeof o!="function",yt=Array.isArray,jt=o=>yt(o)||typeof o?.[Symbol.iterator]=="function",pt=`[ \f\r]`,j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Lt=/-->/g,Ut=/>/g,A=RegExp(`>|${pt}(?:([^\\s"'>=/]+)(${pt}*=${pt}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),kt=/'/g,Mt=/"/g,Ht=/^(?:script|style|textarea|title)$/i,gt=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),es=gt(1),ss=gt(2),os=gt(3),f=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),It=new WeakMap,w=x.createTreeWalker(x,129);function Vt(o,t){if(!yt(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return Dt!==void 0?Dt.createHTML(t):t}var qt=(o,t)=>{let e=o.length-1,s=[],n,i=t===2?"<svg>":t===3?"<math>":"",r=j;for(let a=0;a<e;a++){let c=o[a],l,u,h=-1,m=0;for(;m<c.length&&(r.lastIndex=m,u=r.exec(c),u!==null);)m=r.lastIndex,r===j?u[1]==="!--"?r=Lt:u[1]!==void 0?r=Ut:u[2]!==void 0?(Ht.test(u[2])&&(n=RegExp("</"+u[2],"g")),r=A):u[3]!==void 0&&(r=A):r===A?u[0]===">"?(r=n??j,h=-1):u[1]===void 0?h=-2:(h=r.lastIndex-u[2].length,l=u[1],r=u[3]===void 0?A:u[3]==='"'?Mt:kt):r===Mt||r===kt?r=A:r===Lt||r===Ut?r=j:(r=A,n=void 0);let y=r===A&&o[a+1].startsWith("/>")?" ":"";i+=r===j?c+ce:h>=0?(s.push(l),c.slice(0,h)+ft+c.slice(h)+b+y):c+b+(h===-2?a:y)}return[Vt(o,i+(o[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},q=class o{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,r=0,a=t.length-1,c=this.parts,[l,u]=qt(t,e);if(this.el=o.createElement(l,s),w.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(n=w.nextNode())!==null&&c.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(let h of n.getAttributeNames())if(h.endsWith(ft)){let m=u[r++],y=n.getAttribute(h).split(b),_=/([.?@])?(.*)/.exec(m);c.push({type:1,index:i,name:_[2],strings:y,ctor:_[1]==="."?X:_[1]==="?"?tt:_[1]==="@"?et:S}),n.removeAttribute(h)}else h.startsWith(b)&&(c.push({type:6,index:i}),n.removeAttribute(h));if(Ht.test(n.tagName)){let h=n.textContent.split(b),m=h.length-1;if(m>0){n.textContent=Y?Y.emptyScript:"";for(let y=0;y<m;y++)n.append(h[y],H()),w.nextNode(),c.push({type:2,index:++i});n.append(h[m],H())}}}else if(n.nodeType===8)if(n.data===mt)c.push({type:2,index:i});else{let h=-1;for(;(h=n.data.indexOf(b,h+1))!==-1;)c.push({type:7,index:i}),h+=b.length-1}i++}}static createElement(t,e){let s=x.createElement("template");return s.innerHTML=t,s}};function O(o,t,e=o,s){if(t===f)return t;let n=s!==void 0?e._$Co?.[s]:e._$Cl,i=V(t)?void 0:t._$litDirective$;return n?.constructor!==i&&(n?._$AO?.(!1),i===void 0?n=void 0:(n=new i(o),n._$AT(o,e,s)),s!==void 0?(e._$Co??=[])[s]=n:e._$Cl=n),n!==void 0&&(t=O(o,n._$AS(o,t.values),n,s)),t}var Z=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,n=(t?.creationScope??x).importNode(e,!0);w.currentNode=n;let i=w.nextNode(),r=0,a=0,c=s[0];for(;c!==void 0;){if(r===c.index){let l;c.type===2?l=new D(i,i.nextSibling,this,t):c.type===1?l=new c.ctor(i,c.name,c.strings,this,t):c.type===6&&(l=new st(i,this,t)),this._$AV.push(l),c=s[++a]}r!==c?.index&&(i=w.nextNode(),r++)}return w.currentNode=x,n}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},D=class o{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,n){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=O(this,t,e),V(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==f&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):jt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&V(this._$AH)?this._$AA.nextSibling.data=t:this.T(x.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,n=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=q.createElement(Vt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===n)this._$AH.p(e);else{let i=new Z(n,this),r=i.u(this.options);i.p(e),this.T(r),this._$AH=i}}_$AC(t){let e=It.get(t.strings);return e===void 0&&It.set(t.strings,e=new q(t)),e}k(t){yt(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,n=0;for(let i of t)n===e.length?e.push(s=new o(this.O(H()),this.O(H()),this,this.options)):s=e[n],s._$AI(i),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},S=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,n,i){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=i,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,n){let i=this.strings,r=!1;if(i===void 0)t=O(this,t,e,0),r=!V(t)||t!==this._$AH&&t!==f,r&&(this._$AH=t);else{let a=t,c,l;for(t=i[0],c=0;c<i.length-1;c++)l=O(this,a[s+c],e,c),l===f&&(l=this._$AH[c]),r||=!V(l)||l!==this._$AH[c],l===d?t=d:t!==d&&(t+=(l??"")+i[c+1]),this._$AH[c]=l}r&&!n&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},X=class extends S{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}},tt=class extends S{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}},et=class extends S{constructor(t,e,s,n,i){super(t,e,s,n,i),this.type=5}_$AI(t,e=this){if((t=O(this,t,e,0)??d)===f)return;let s=this._$AH,n=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,i=t!==d&&(s===d||n);n&&this.element.removeEventListener(this.name,this,s),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},st=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){O(this,t)}},zt={M:ft,P:b,A:mt,C:1,L:qt,R:Z,D:jt,V:O,I:D,H:S,N:tt,U:et,B:X,F:st},le=ut.litHtmlPolyfillSupport;le?.(q,D),(ut.litHtmlVersions??=[]).push("3.3.0");var vt=(o,t,e)=>{let s=e?.renderBefore??t,n=s._$litPart$;if(n===void 0){let i=e?.renderBefore??null;s._$litPart$=n=new D(t.insertBefore(H(),i),i,void 0,e??{})}return n._$AI(o),n};var{is:he,defineProperty:de,getOwnPropertyDescriptor:pe,getOwnPropertyNames:ue,getOwnPropertySymbols:fe,getPrototypeOf:me}=Object,nt=globalThis,Bt=nt.trustedTypes,ye=Bt?Bt.emptyScript:"",ge=nt.reactiveElementPolyfillSupport,z=(o,t)=>o,ot={toAttribute(o,t){switch(t){case Boolean:o=o?ye:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},B=(o,t)=>!he(o,t),Wt={attribute:!0,type:String,converter:ot,reflect:!1,useDefault:!1,hasChanged:B};Symbol.metadata??=Symbol("metadata"),nt.litPropertyMetadata??=new WeakMap;var E=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Wt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),n=this.getPropertyDescriptor(t,s,e);n!==void 0&&de(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){let{get:n,set:i}=pe(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get:n,set(r){let a=n?.call(this);i?.call(this,r),this.requestUpdate(t,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Wt}static _$Ei(){if(this.hasOwnProperty(z("elementProperties")))return;let t=me(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(z("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(z("properties"))){let e=this.properties,s=[...ue(e),...fe(e)];for(let n of s)this.createProperty(n,e[n])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,n]of e)this.elementProperties.set(s,n)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let n=this._$Eu(e,s);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let n of s)e.unshift(dt(n))}else t!==void 0&&e.push(dt(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Rt(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){let s=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,s);if(n!==void 0&&s.reflect===!0){let i=(s.converter?.toAttribute!==void 0?s.converter:ot).toAttribute(e,s.type);this._$Em=t,i==null?this.removeAttribute(n):this.setAttribute(n,i),this._$Em=null}}_$AK(t,e){let s=this.constructor,n=s._$Eh.get(t);if(n!==void 0&&this._$Em!==n){let i=s.getPropertyOptions(n),r=typeof i.converter=="function"?{fromAttribute:i.converter}:i.converter?.fromAttribute!==void 0?i.converter:ot;this._$Em=n,this[n]=r.fromAttribute(e,i.type)??this._$Ej?.get(n)??null,this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){let n=this.constructor,i=this[t];if(s??=n.getPropertyOptions(t),!((s.hasChanged??B)(i,e)||s.useDefault&&s.reflect&&i===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:n,wrapped:i},r){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??e??this[t]),i!==!0||r!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),n===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,i]of this._$Ep)this[n]=i;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[n,i]of s){let{wrapped:r}=i,a=this[n];r!==!0||this._$AL.has(n)||a===void 0||this.C(n,void 0,i,a)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[z("elementProperties")]=new Map,E[z("finalized")]=new Map,ge?.({ReactiveElement:E}),(nt.reactiveElementVersions??=[]).push("2.1.0");var bt=globalThis,v=class extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=vt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return f}};v._$litElement$=!0,v.finalized=!0,bt.litElementHydrateSupport?.({LitElement:v});var ve=bt.litElementPolyfillSupport;ve?.({LitElement:v});(bt.litElementVersions??=[]).push("4.2.0");var rt=Symbol.for("controller"),be=o=>typeof o=="object"&&o!==null&&(rt in o||"hostConnected"in o||"hostDisconnected"in o||"hostUpdate"in o||"hostUpdated"in o),Cs=o=>typeof o?.then=="function";var W,L=o=>{W!==o&&(W=o,queueMicrotask(()=>W===o?W=void 0:0))},F=o=>W,T=[],Ee=o=>{if(o===void 0){T=[];return}let t=T.indexOf(o);T=t===-1?[...T,o]:T.slice(0,t+1),queueMicrotask(()=>T=[])},$e=()=>T,U,_s=o=>{U!==o&&(U=o,queueMicrotask(()=>U===o?U=void 0:0))},Ce=()=>{let o=U;return U=void 0,o},_e=async(o,t)=>{let e=$t(o);if(e===void 0)return o;if(await e.ready,typeof t=="function"){let s=e.watchExports(n=>t(n,s))}return e.exports},Ae=async o=>{let t=$t(o);return await t.ready,t},$t=o=>{let e=F().manager.X(o);if(e!==void 0)return e;if(be(o))return o;let s=Ce();if(s!==void 0)return s},it=!1,As=o=>{it=!0;try{return o()}finally{it=!1}};var we=(o,t,e)=>{let s=Object.keys(o),n=s.length;k===void 0&&queueMicrotask(at),k??=new Map;let i=k.get(o);return i===void 0&&(i={callbacks:[],keyCount:n},k.set(o,i)),i.keyCount!==n&&(i.callbacks.forEach(r=>r(s)),i.callbacks=[],i.keyCount=n),i.callbacks.push(r=>{let a=l=>p(t,null,l),c=r[n];c===void 0?a(void 0):o[c]===e?a(c):a(void 0)}),e},k,at=()=>{k?.forEach(({callbacks:o},t)=>{let e=Object.keys(t);o.forEach(s=>s(e))}),k=void 0},xe=(o,t,e)=>{let s=o.manager;return s.V!==d&&s.V!==e&&s.S(void 0,void 0),s.T.length===0&&queueMicrotask(()=>s.S(void 0,void 0)),s.V=e,s.T.push((n,i)=>p(t,void 0,e===i?n:void 0)),e},Oe=(o=[F(),...$e()],t,e)=>{let s=Array.isArray(o)?o:[o],n=s.length+1,i=r=>{n-=1,r!==void 0&&(n=Math.min(n,0)),n===0&&t(r)};s.forEach(r=>we(r,a=>i(a===void 0?void 0:{key:a,host:r,isReactive:!1}),e));for(let r of s)if("manager"in r&&r.manager.component===r){xe(r,a=>i(a===void 0?void 0:{key:a,host:r,isReactive:!0}),e);break}return e},Se=(o="",t={},e=F())=>{let s={emit:n=>{o===""&&at();let i=new CustomEvent(o,{detail:n,cancelable:!0,bubbles:!0,composed:!0,...t});return e.el.dispatchEvent(i),i}};return o===""&&Oe(void 0,n=>o=n.key,s),s},Te=Se.bind(null,""),Gt;Gt=rt;var Et=class{constructor(t){this.#t=[],this.#e=[],this.#s=[],this.#o=[],this.#n=[],this.#c=[],this.#l=[],this.#p=[],this.#h=[],this.#d=!1,this.P=new C,this.connectedCalled=!1,this.loadedCalled=!1,this[Gt]=!0,this.#a=[];let e=this,s=t??F(new.target.name);e.#i=s,e.ready=e.P.promise,e.#r=Kt(e),e.component=s,e.#i.addController(e),e.#i.manager===void 0||(Ee(e),queueMicrotask(()=>e.catchUpLifecycle()))}#t;#e;#s;#o;#n;#c;#l;#p;#h;#d;#i;catchUpLifecycle(){let{manager:t}=this.#i;t.connectedCalled&&!this.connectedCalled&&this.triggerConnected(),t.#d&&this.triggerLoad().then(()=>t.loadedCalled&&this.triggerLoaded()).catch(console.error)}#r;get exports(){return this.#r}set exports(t){let e=this.#r;e!==t&&(this.#r=t,this.#a.forEach(p),this.connectedCalled&&this.O!==!1&&this.#i.requestUpdate(this.O,e)),this.P.resolve(t)}setProvisionalExports(t,e=!0){this.#r=e?Kt(t):t,this.#a.forEach(p)}#a;watchExports(t){let e=()=>t(this.#r);return this.#a.push(e),()=>void this.#a.splice(this.#a.indexOf(e),1)}get use(){return L(this.#i),_e}get useRef(){return L(this.#i),Ae}get useRefSync(){return L(this.#i),$t}controllerRemoved(){this.#i.el.isConnected&&this.triggerDisconnected(),this.triggerDestroy()}onConnected(t){this.#t.push(t)}onDisconnected(t){this.#e.push(t)}onLoad(t){this.#s.push(t)}onLoaded(t){this.#o.push(t)}onUpdate(t){this.#n.push(t)}onUpdated(t){this.#c.push(t)}onDestroy(t){this.#l.push(t)}onLifecycle(t){this.#p.push(t),this.connectedCalled&&this.#i.el.isConnected&&this.#u(t)}triggerConnected(){let t=this;t.hostConnected&&p(t.hostConnected,t),t.#t.forEach(p),t.triggerLifecycle(),t.connectedCalled=!0}triggerDisconnected(){let t=this;t.hostDisconnected&&p(t.hostDisconnected,t),t.#e.forEach(p),t.#h.forEach(p),t.#h=[]}async triggerLoad(){if(this.#d)return;this.#d=!0;let t=this;t.hostLoad&&await M(t.hostLoad,t),this.#s.length>0&&await Promise.allSettled(this.#s.map(M)),this.P.resolve(this.#r)}triggerLoaded(){this.loadedCalled||(this.hostLoaded&&p(this.hostLoaded,this),this.#o.forEach(p),this.loadedCalled=!0)}triggerUpdate(t){this.hostUpdate&&p(this.hostUpdate,this,t),this.#n.forEach(Ft,t)}triggerUpdated(t){this.hostUpdated&&p(this.hostUpdated,this,t),this.#c.forEach(Ft,t)}triggerDestroy(){this.hostDestroy&&p(this.hostDestroy,this),this.#l.forEach(p)}triggerLifecycle(){this.hostLifecycle&&this.#u(()=>this.hostLifecycle()),this.#p.forEach(this.#u,this)}#u(t){L(this.#i);let e=p(t);(Array.isArray(e)?e:[e]).forEach(n=>{typeof n=="function"?this.#h.push(n):typeof n=="object"&&typeof n.remove=="function"&&this.#h.push(n.remove)})}};function Ft(o){p(o,void 0,this)}var Jt=Et,Kt=o=>{if(typeof o!="object"&&typeof o!="function"||o===null)return o;let t={get(s,n,i){if(!((n==="exports"||n==="_exports")&&n in s&&s[n]===e)&&(n in s||n in Promise.prototype||typeof n=="symbol"))return typeof s=="function"?s[n]:Reflect.get(s,n,i)}},e=new Proxy(o,t);return e};var Qt=";",ct=",",Yt=":";var _t=o=>{let t=o;for(;t=t.parentNode??t.host;)if(t?.constructor?.lumina){let e=t;return e.manager?.loadedCalled||(e.J??e._offspring).push(o),(e.I??e._postLoad).promise}return!1},At={};function wt(){}var Pe=(o,t)=>function(s,n){if(!globalThis.customElements)return;let r=(n??s??{}).resourcesUrl;r&&o.setAssetPath(r);for(let[a,[c,l=""]]of Object.entries(t)){if(customElements.get(a))continue;let[u,h,m]=l.split(Qt),y=u?u?.split(ct).map(Ne):void 0,_=y?.map(([R])=>R),N=class extends Ct{static{this.observedAttributes=y?.map(([,R])=>R).filter(R=>R!=="")}static{this.C=_}static{this.E=h?h?.split(ct):void 0}static{this.D=m?.split(ct)}static{this.L=a}static{this.K=o}constructor(){!N.B&&(N.B=c(),N.F()),super()}};customElements.define(a,N)}},lt=Object.defineProperty,Ne=o=>{let t=o.split(Yt);return t.length===1?[t[0],G(t[0])]:t},Re=globalThis.HTMLElement??wt,Ct=class extends Re{constructor(){super(),this.#e={},this.#s=[],this.I=new C,this.H=new C,this.J=[];let t=this,e=t.constructor;t._offspring=t.J,t._postLoad=t.I,e.C?.forEach(s=>{Object.hasOwn(t,s)&&(t.#e[s]=t[s],delete t[s])}),e.A?t.#o({a:e.A}):e.B.then(async s=>{await e.K.p,t.#o(await(s.default?.then(n=>typeof n=="function"?{a:n}:n)??s))}).catch(s=>{t.H.reject(s),setTimeout(()=>{throw s})})}static{this.lumina=!0}static F(){for(let t of this.C??[])lt(this.prototype,t,{configurable:!0,enumerable:!0,get(){return this.#e[t]},set(e){this.#e[t]=e}});for(let t of this.E??[])lt(this.prototype,t,{async value(...e){return this.#t||await this.H.promise,await this.#t[t](...e)},configurable:!0});for(let t of this.D??[])lt(this.prototype,t,{value(...e){return this.#t[t](...e)},configurable:!0})}#t;#e;#s;get manager(){return this.#t?.manager}attributeChangedCallback(t,e,s){this.#t?.attributeChangedCallback(t,e,s),this.#t||this.#s.push(t)}connectedCallback(){this.#t?this.#t.connectedCallback?.():queueMicrotask(()=>this.G=_t(this))}disconnectedCallback(){this.#t?.disconnectedCallback?.()}async componentOnReady(){return await this.H.promise,this}#o(t){let e=this.constructor,s=e.L,n=this.#e,i=Object.values(t).find(h=>h.L===s),r=`${s}--lazy`,a=i;for(;a&&!Object.hasOwn(a,"lumina");)a=Object.getPrototypeOf(a);Le(a),!e.A&&(e.A=i,customElements.define(r,i)),i.N=this;let l=document.createElement(r);i.N=void 0,this.#t=l,this.#e=l,this.#s.forEach(h=>l.attributeChangedCallback(h,null,this.getAttribute(h))),Object.entries(n).forEach(De,l);let u=this.isConnected;(u||this.G)&&(l.connectedCallback?.(),u||l.disconnectedCallback())}addController(){}requestUpdate(){this.#t?.requestUpdate()}};function De([o,t]){this[o]=t}var Le=o=>{let t=o.prototype,e=Element.prototype;Object.hasOwn(t,"isConnected")||(t.setAttribute=function(n,i){e.setAttribute.call(this.el,n,i)},t.removeAttribute=function(n){e.removeAttribute.call(this.el,n)},lt(t,"isConnected",{get(){return Reflect.get(e,"isConnected",this.el)}}))};var g={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},P=o=>(...t)=>({_$litDirective$:o,values:t}),$=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var te=P(class extends ${constructor(o){if(super(o),o.type!==g.ATTRIBUTE||o.name!=="class"||o.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(o){return" "+Object.keys(o).filter(t=>o[t]).join(" ")+" "}update(o,[t]){if(this.st===void 0){this.st=new Set,o.strings!==void 0&&(this.nt=new Set(o.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(let s in t)t[s]&&!this.nt?.has(s)&&this.st.add(s);return this.render(t)}let e=o.element.classList;for(let s of this.st)s in t||(e.remove(s),this.st.delete(s));for(let s in t){let n=!!t[s];n===this.st.has(s)||this.nt?.has(s)||(n?(e.add(s),this.st.add(s)):(e.remove(s),this.st.delete(s)))}return f}});var ee="important",ke=" !"+ee,Me=P(class extends ${constructor(o){if(super(o),o.type!==g.ATTRIBUTE||o.name!=="style"||o.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((t,e)=>{let s=o[e];return s==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(o,[t]){let{style:e}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let s of this.ft)t[s]==null&&(this.ft.delete(s),s.includes("-")?e.removeProperty(s):e[s]=null);for(let s in t){let n=t[s];if(n!=null){this.ft.add(s);let i=typeof n=="string"&&n.endsWith(ke);s.includes("-")||i?e.setProperty(s,i?n.slice(0,-11):n,i?ee:""):e[s]=n}}return f}});var{I:Ie}=zt;var oe=o=>o.strings===void 0,se=()=>document.createComment(""),Co=(o,t,e)=>{let s=o._$AA.parentNode,n=t===void 0?o._$AB:t._$AA;if(e===void 0){let i=s.insertBefore(se(),n),r=s.insertBefore(se(),n);e=new Ie(i,r,o,o.options)}else{let i=e._$AB.nextSibling,r=e._$AM,a=r!==o;if(a){let c;e._$AQ?.(o),e._$AM=o,e._$AP!==void 0&&(c=o._$AU)!==r._$AU&&e._$AP(c)}if(i!==n||a){let c=e._$AA;for(;c!==i;){let l=c.nextSibling;s.insertBefore(c,n),c=l}}}return e},_o=(o,t,e=o)=>(o._$AI(t,e),o),je={},ne=(o,t=je)=>o._$AH=t,Ao=o=>o._$AH,wo=o=>{o._$AP?.(!1,!0);let t=o._$AA,e=o._$AB.nextSibling;for(;t!==e;){let s=t.nextSibling;t.remove(),t=s}};var He=P(class extends ${constructor(o){if(super(o),o.type!==g.PROPERTY&&o.type!==g.ATTRIBUTE&&o.type!==g.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!oe(o))throw Error("`live` bindings can only contain a single expression")}render(o){return o}update(o,[t]){if(t===f||t===d)return t;let e=o.element,s=o.name;if(o.type===g.PROPERTY){if(t===e[s])return f}else if(o.type===g.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(s))return f}else if(o.type===g.ATTRIBUTE&&e.getAttribute(s)===t+"")return f;return ne(o),t}});var Ot=class extends Jt{constructor(t){super(t),this.destroyed=!1,this.R=!1,this.V=d,this.T=[],this.#s=new WeakMap,this.#e=t,this.exports=void 0,this.hasDestroy=St in t&&typeof t.destroy=="function",v.prototype.addController.call(t,{hostConnected:()=>{if(this.destroyed){let e=t.el.localName;throw t.el.remove(),new Error(`The ${e} component has already been destroyed. It cannot be used again. If you meant to disconnect and reconnect a component without automatic destroy, set the ${St} prop.`)}this.#t!==void 0&&clearTimeout(this.#t),at();for(let e of t.M)"triggerConnected"in e?e.triggerConnected():p(e.hostConnected,e)},hostDisconnected:()=>{for(let e of t.M)"triggerDisconnected"in e?e.triggerDisconnected():p(e.hostDisconnected,e);this.hasDestroy&&!this.destroyed&&this.U()},hostUpdate:()=>{for(let e of t.M)"triggerUpdate"in e?e.triggerUpdate(this.Q):p(e.hostUpdate,e,this.Q)},hostUpdated:()=>{for(let e of t.M)"triggerUpdated"in e?e.triggerUpdated(this.Q):p(e.hostUpdated,e,this.Q);this.Q=void 0}}),queueMicrotask(()=>this.R=!0),L(t)}#t;#e;async destroy(){if(!this.destroyed){this.#e.el.isConnected&&(this.hasDestroy=!1,this.#e.el.remove()),this.#t=void 0,this.destroyed=!0;for(let t of this.#e.M)"triggerDestroy"in t?t.triggerDestroy():p(t.hostDestroy,t);this.#e.M.splice(0)}}U(){if(this.#t!==void 0&&clearTimeout(this.#t),!this.#e.el.isConnected&&!this.#e.autoDestroyDisabled){let t=()=>void this.#e.destroy();this.#t=Tt(t,Je)}}S(t,e){let s=this.T;this.V=d,this.T=[],s.forEach(n=>n(t,e))}#s;W(t,e){(typeof e=="object"&&e!==null||typeof e=="function")&&this.#s.set(e,t)}X(t){if(typeof t=="object"&&t!==null||typeof t=="function")return this.#s.get(t)}},Je=1e3,St="autoDestroyDisabled",ie=class o extends v{constructor(){super(),this.M=[],this.manager=new Ot(this);let t=this,e=t.constructor,s=e.N,n=e.K.o,i=o.prototype.shouldUpdate;t.#o=s?.H??new C,t.I=s?.I??new C,t.J=s?.J??[],t._offspring=t.J,t._postLoad=t.I,t.el=s??t,t.#s=t.enableUpdating,t.enableUpdating=wt,t.shouldUpdate!==i&&(t.#e=t.shouldUpdate,t.shouldUpdate=i),n&&(t.#t=new Map,e.elementProperties.forEach((r,a)=>t.#t.set(a,n()))),!1}static finalizeStyles(t){let e=super.finalizeStyles(t),s=this.shadowRootOptions===At;return this.K?.commonStyles===void 0||s?e:[this.K.commonStyles,...e]}static createProperty(t,e){let s=typeof e=="number"?e:Array.isArray(e)?e[0]:0,n=Array.isArray(e)?e[1]:void 0,i=n?.hasChanged??B,r={attribute:s&1&&typeof t=="string"?G(t):!1,reflect:!!(s&2),type:s&4?Boolean:s&8?Number:void 0,state:!!(s&16),readOnly:!!(s&32),noAccessor:!!(s&64),c:!1,...n,hasChanged(a,c){let l=i(a,c);return r.c=l,l}};super.createProperty(t,r)}static getPropertyDescriptor(t,e,s){let n=this.K,i=super.getPropertyDescriptor(t,e,s);return s.d=i,{...i,get(){return n.t?.(this.#t.get(t)),i.get?.call(this)},set(r){let a=this.manager;if(s.readOnly&&!it&&(a.R||a.connectedCalled))throw Error(`Cannot assign to read-only property "${t}" of ${this.el.localName}. Trying to assign "${r}"`);i.set.call(this,r??void 0),s.c&&this.#t?.get(t)?.notify(),a.T.length>0&&a?.S(t,r)}}}static{this.lumina=!0}#t;#e;#s;#o;#n;connectedCallback(){if(this.el.hasAttribute("defer-hydration"))return;let t=this.constructor.K.c?.(()=>this.requestUpdate());this.#n=t;let e=!this.manager.connectedCalled;super.connectedCallback(),e?queueMicrotask(()=>this.#l().catch(s=>{this.#o.reject(s),setTimeout(()=>{throw s})})):t&&this.requestUpdate()}#c(t){try{this.#n.clear(),this.constructor.K.r(this.#n,()=>super.update(t))}catch(e){throw this.#n.clear(),e}}disconnectedCallback(){super.disconnectedCallback(),this.#n?.destroy(),this.#n=void 0}createRenderRoot(){let t=this.el.shadowRoot,e=this.constructor,s=e.shadowRootOptions,i=t??(s===At?this.el:this.el.attachShadow(s));if(t)return v.prototype.createRenderRoot.call(this),t;if(this.isConnected){let r=i.getRootNode();r.adoptedStyleSheets=[...r.adoptedStyleSheets,...e.elementStyles.map(a=>"styleSheet"in a?a.styleSheet:a)]}return i}async#l(){let t=this.el.G??_t(this.el);t&&await t;let e=[];for(let n of this.M)"triggerLoad"in n?e.push(n.triggerLoad()):e.push(M(n.hostLoad,n));await Promise.all(e),await this.load?.(),this.manager.hasDestroy&&this.manager.onUpdate(n=>n.has(St)&&this.manager.U()),this.#s(!0),this.performUpdate(),this.I.resolve(),await Promise.resolve();let s=this.J.filter(n=>!n.manager?.loadedCalled);s.length&&await Promise.allSettled(s.map(async n=>await n.componentOnReady())),this.J.length=0,this.el.setAttribute(this.constructor.K.hydratedAttribute,"");for(let n of this.M)"triggerLoaded"in n?n.triggerLoaded():p(n.hostLoaded,n);this.loaded?.(),this.#o.resolve()}shouldUpdate(t){return this.manager.Q=t,this.#e?.(t)??!0}update(t){this.#n?this.#c(t):super.update(t)}listen(t,e,s){let n=e?.bind(this)??e;this.manager.onLifecycle(()=>(this.el.addEventListener(t,n,s),()=>this.el.removeEventListener(t,n,s)))}listenOn(t,e,s,n){let i=s?.bind(this)??s;this.manager.onLifecycle(()=>(t.addEventListener(e,i,n),()=>t.removeEventListener(e,i,n)))}async componentOnReady(){return await this.#o.promise,this}addController(t){this.M.push(t),!(rt in t)&&this.renderRoot&&this.el.isConnected&&t.hostConnected?.()}removeController(t){this.M.splice(this.M.indexOf(t),1),t.controllerRemoved?.()}},re=o=>{let t,e=n=>{t=new URL(n,globalThis.location?.href||void 0).href},s={...o,getAssetPath(n){let i=new URL(n,t);return i.origin!==globalThis.location?.origin?i.href:i.pathname},setAssetPath:e,customElement(n,i){i.K=s,i.L=n,customElements.get(n)||customElements.define(n,i)}};return e(o.defaultAssetPath),s};var Qo=o=>typeof o=="object"&&o!=null?te(o):o;var Yo=d;var K=re({defaultAssetPath:"https://js.arcgis.com/4.33/coding-components/",hydratedAttribute:"hydrated"}),{customElement:sn,getAssetPath:on,setAssetPath:nn}=K;K.t=void 0;K.o=void 0;K.c=void 0;K.r=void 0;export{ae as a,es as b,f as c,d,Cs as e,L as f,Ee as g,$e as h,_s as i,As as j,Oe as k,Te as l,Et as m,At as n,Pe as o,g as p,P as q,$ as r,oe as s,Co as t,_o as u,ne as v,Ao as w,wo as x,ie as y,Qo as z,Yo as A,K as B,sn as C,on as D};