UNPKG

@esri/calcite-components

Version:

Web Components for Esri's Calcite Design System.

5 lines (4 loc) 2.82 kB
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details. v3.3.0-next.10 */ import{S as L,a as b,b as C,j as P,k as O,l as m,m as u,n as w,o as f,p as g,r as v}from"./MPBE2SPX.js";var _=e=>(...r)=>{let t=u(),o=new e(...r),s=o.exports;m(t.at(-1));let n=o.component.manager;n.W(o,s),o.watchExports(n.W.bind(n,o)),w(o);let i=[o.component,...t].reverse();return g(i,a=>a===void 0?void 0:D(o,a,s),s)},D=(e,{host:r,key:t,isReactive:o},s)=>{let n=r,i=n[t]!==e.exports,a=n[t]!==s,c=s!==e.exports;if(i&&!a&&c&&(n[t]=e.exports),r===e.component){if(o){let p=e.component.manager;a&&p.W(e,n[t]),e.onUpdate(h=>{if(h.has(t)){let E=n[t];E!==e.exports&&p.W(e,E)}})}e.O=o?void 0:t}let d=e.component.constructor.elementProperties.get(t)?.readOnly;e.watchExports(()=>{n[t]!==e.exports&&(d?f(()=>{n[t]=e.exports}):n[t]=e.exports)})};var U=e=>N(void 0,e),ee=e=>r=>N(r,e),x=class extends v{constructor(r,t){super(r);let o=this.exports;try{O(this.component);let s=t(this.component,this),n=this.exports!==o;if(P(s)){n||this.setProvisionalExports(s);let i=s.then(a=>{this.exports=a,super.catchUpLifecycle()}).catch(a=>{this.P.reject(a),console.error(a)});this.onLoad(async()=>await i)}else(!n||s!==void 0)&&(this.exports=s),queueMicrotask(()=>super.catchUpLifecycle())}catch(s){this.P.reject(s),console.error(s)}}catchUpLifecycle(){}},N=_(x),te=(e,r)=>new y(e,r),y=class extends v{#e;#t;#o;constructor(r,t){super(),!!1&&(this.#t=r,this.#o=t,this.#e=new MutationObserver(o=>{o.forEach(s=>{r.includes(s.attributeName)&&t.call(this.component,this.component.el.getAttribute(s.attributeName),s.oldValue,s.attributeName)})}))}hostConnected(){this.#t.forEach(r=>{this.component.el.hasAttribute(r)&&this.#o.call(this.component,null,this.component.el.getAttribute(r),r)}),this.#e.observe(this.component.el,{attributes:!0,attributeOldValue:!0,attributeFilter:this.#t})}hostDisconnected(){this.#e.disconnect()}};var oe=e=>(...r)=>{let t=u(),o=new e(...r);return m(t.at(-1)),o};var A=e=>(r={})=>U((t,o)=>{let s=b(t.el),n={_lang:s.lang,_t9nLocale:s.t9nLocale,_loading:!0},i=t;o.onLifecycle(()=>C(t.el,()=>e("./assets"),({t9nLocale:c,t9nStrings:l,lang:d})=>{let p={...l,_lang:d,_t9nLocale:c,_loading:!1};o.exports=p;let h=l.componentLabel;typeof h=="string"&&"label"in t&&t.label==null&&(t.label??=h),a(i.messageOverrides)},r.name));let a=c=>{let l=o.exports,d=l._original??l,p=V(d,c);c&&(p._original=d),o.exports=p};return"messageOverrides"in i&&o.onUpdate(c=>{c.has("messageOverrides")&&a(i.messageOverrides)}),r.blocking?(o.setProvisionalExports(n,!1),o.ready):n}),V=(e,r)=>{if(!r)return e;let t={...e};return Object.entries(r).forEach(([o,s])=>{typeof s=="object"?t[o]=V(e[o],s):t[o]=s??e[o]}),t};var ae=A(L);export{ee as a,te as b,oe as c,ae as d};