animated-charts
Version:
Animated chart web components for all frameworks (React, Angular, Vue, HTML)
3 lines • 12.3 kB
JavaScript
const t="animated-charts";const e={hydratedSelectorName:"hydrated",lazyLoad:true,watchCallback:false};var n=Object.defineProperty;var r=(t,e)=>{for(var r in e)n(t,r,{get:e[r],enumerable:true})};var s=(t,e)=>{var n;const r=e.t;const s=Object.entries((n=r.o)!=null?n:{});s.map((([n,[r]])=>{if(r&31||r&32){const r=t[n];const s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),n);Object.defineProperty(t,n,{get(){return s.get.call(this)},set(t){s.set.call(this,t)},configurable:true,enumerable:true});t[n]=e.i.has(n)?e.i.get(n):r}}))};var o=t=>{if(t.__stencil__getHostRef){return t.__stencil__getHostRef()}return void 0};var i=(t,e)=>{t.__stencil__getHostRef=()=>e;e.l=t;{s(t,e)}};var c=(t,e)=>{const n={u:0,$hostElement$:t,t:e,i:new Map};{n.v=new Promise((t=>n.h=t));t["s-p"]=[];t["s-rc"]=[]}const r=n;t.__stencil__getHostRef=()=>r;return r};var a=(t,e)=>(0,console.error)(t,e);var l=new Map;var f=(t,e,n)=>{const r=t.p.replace(/-/g,"_");const s=t.m;if(!s){return void 0}const o=l.get(s);if(o){return o[r]}
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/return import(`./${s}.entry.js${""}`).then((t=>{{l.set(s,t)}return t[r]}),(t=>{a(t,e.$hostElement$)}))};var u=new Map;var v="{visibility:hidden}.hydrated{visibility:inherit}";var d="slot-fb{display:contents}slot-fb[hidden]{display:none}";var h=typeof window!=="undefined"?window:{};var p={u:0,$:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,r)=>t.addEventListener(e,n,r),rel:(t,e,n,r)=>t.removeEventListener(e,n,r),ce:(t,e)=>new CustomEvent(t,e)};var m=t=>Promise.resolve(t);var y=(()=>{try{new CSSStyleSheet;return typeof(new CSSStyleSheet).replaceSync==="function"}catch(t){}return false})();var w=false;var b=[];var $=[];var S=(t,e)=>n=>{t.push(n);if(!w){w=true;if(e&&p.u&4){O(j)}else{p.raf(j)}}};var g=t=>{for(let e=0;e<t.length;e++){try{t[e](performance.now())}catch(t){a(t)}}t.length=0};var j=()=>{g(b);{g($);if(w=b.length>0){p.raf(j)}}};var O=t=>m().then(t);var k=S($,true);var C=t=>{t=typeof t;return t==="object"||t==="function"};function E(t){var e,n,r;return(r=(n=(e=t.head)==null?void 0:e.querySelector('meta[name="csp-nonce"]'))==null?void 0:n.getAttribute("content"))!=null?r:void 0}var M=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");var N={};r(N,{err:()=>P,map:()=>U,ok:()=>x,unwrap:()=>R,unwrapErr:()=>D});var x=t=>({isOk:true,isErr:false,value:t});var P=t=>({isOk:false,isErr:true,value:t});function U(t,e){if(t.isOk){const n=e(t.value);if(n instanceof Promise){return n.then((t=>x(t)))}else{return x(n)}}if(t.isErr){const e=t.value;return P(e)}throw"should never get here"}var R=t=>{if(t.isOk){return t.value}else{throw t.value}};var D=t=>{if(t.isErr){return t.value}else{throw t.value}};function L(t){return void 0}var T;function W(t){var e;const n=this.attachShadow({mode:"open"});if(T===void 0)T=(e=L())!=null?e:null;if(T)n.adoptedStyleSheets.push(T)}var A=(t,e="")=>{{return()=>{}}};var F=(t,e)=>{{return()=>{}}};var H=new WeakMap;var z=(t,e,n)=>{let r=u.get(t);if(y&&n){r=r||new CSSStyleSheet;if(typeof r==="string"){r=e}else{r.replaceSync(e)}}else{r=e}u.set(t,r)};var q=(t,e,n)=>{var r;const s=I(e);const o=u.get(s);if(!h.document){return s}t=t.nodeType===11?t:h.document;if(o){if(typeof o==="string"){t=t.head||t;let n=H.get(t);let i;if(!n){H.set(t,n=new Set)}if(!n.has(s)){{i=h.document.createElement("style");i.innerHTML=o;const n=(r=p.S)!=null?r:E(h.document);if(n!=null){i.setAttribute("nonce",n)}if(!(e.u&1)){if(t.nodeName==="HEAD"){const e=t.querySelectorAll("link[rel=preconnect]");const n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(i,(n==null?void 0:n.parentNode)===t?n:null)}else if("host"in t){if(y){const e=new CSSStyleSheet;e.replaceSync(o);t.adoptedStyleSheets.unshift(e)}else{const e=t.querySelector("style");if(e){e.innerHTML=o+e.innerHTML}else{t.prepend(i)}}}else{t.append(i)}}if(e.u&1){t.insertBefore(i,null)}}if(e.u&4){i.innerHTML+=d}if(n){n.add(s)}}}else if(!t.adoptedStyleSheets.includes(o)){t.adoptedStyleSheets.push(o)}}return s};var G=t=>{const e=t.t;const n=t.$hostElement$;const r=e.u;const s=A("attachStyles",e.p);const o=q(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);if(r&10){n["s-sc"]=o;n.classList.add(o+"-h")}s()};var I=(t,e)=>"sc-"+t.p;var V=t=>{const e=M(t);return new RegExp(`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${e}))(${e}\\b)`,"g")};V("::slotted");V(":host");V(":host-context");var _=(t,e,n)=>{if(t!=null&&!C(t)){if(e&2){return typeof t==="string"?parseFloat(t):typeof t==="number"?t:NaN}if(e&1){return String(t)}return t}return t};var B=t=>o(t).$hostElement$;var J=(t,e,n)=>{const r=p.ce(e,n);t.dispatchEvent(r);return r};var K=(t,e)=>{if(e&&!t.j&&e["s-p"]){const n=e["s-p"].push(new Promise((r=>t.j=()=>{e["s-p"].splice(n-1,1);r()})))}};var Q=(t,e)=>{{t.u|=16}if(t.u&4){t.u|=512;return}K(t,t.O);const n=()=>X(t,e);return k(n)};var X=(t,e)=>{const n=t.$hostElement$;const r=A("scheduleUpdate",t.t.p);const s=t.l;if(!s){throw new Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`)}let o;if(e){o=st(s,"componentWillLoad",void 0,n)}else{o=st(s,"componentWillUpdate",void 0,n)}o=Y(o,(()=>st(s,"componentWillRender",void 0,n)));r();return Y(o,(()=>tt(t,s,e)))};var Y=(t,e)=>Z(t)?t.then(e).catch((t=>{console.error(t);e()})):e();var Z=t=>t instanceof Promise||t&&t.then&&typeof t.then==="function";var tt=async(t,e,n)=>{var r;const s=t.$hostElement$;const o=A("update",t.t.p);const i=s["s-rc"];if(n){G(t)}const c=A("render",t.t.p);{et(t,e,s)}if(i){i.map((t=>t()));s["s-rc"]=void 0}c();o();{const e=(r=s["s-p"])!=null?r:[];const n=()=>nt(t);if(e.length===0){n()}else{Promise.all(e).then(n);t.u|=4;e.length=0}}};var et=(t,e,n,r)=>{try{e=e.render();{t.u&=-17}{t.u|=2}{{const r=n.shadowRoot;if(t.t.u&1){r.textContent=e}else{n.textContent=e}}}}catch(e){a(e,t.$hostElement$)}return null};var nt=t=>{const e=t.t.p;const n=t.$hostElement$;const r=A("postUpdate",e);const s=t.l;const o=t.O;st(s,"componentDidRender",void 0,n);if(!(t.u&64)){t.u|=64;{ot(n)}st(s,"componentDidLoad",void 0,n);r();{t.h(n);if(!o){rt()}}}else{st(s,"componentDidUpdate",void 0,n);r()}{if(t.j){t.j();t.j=void 0}if(t.u&512){O((()=>Q(t,false)))}t.u&=-517}};var rt=e=>{O((()=>J(h,"appload",{detail:{namespace:t}})))};var st=(t,e,n,r)=>{if(t&&t[e]){try{return t[e](n)}catch(t){a(t,r)}}return void 0};var ot=t=>{var n;return t.classList.add((n=e.hydratedSelectorName)!=null?n:"hydrated")};var it=(t,e)=>o(t).i.get(e);var ct=(t,e,n,r)=>{const s=o(t);if(!s){throw new Error(`Couldn't find host element for "${r.p}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`)}const i=s.i.get(e);const c=s.u;const a=s.l;n=_(n,r.o[e][0]);const l=Number.isNaN(i)&&Number.isNaN(n);const f=n!==i&&!l;if((!(c&8)||i===void 0)&&f){s.i.set(e,n);if(a){if((c&(2|16))===2){if(a.componentShouldUpdate){if(a.componentShouldUpdate(n,i,e)===false){return}}Q(s,false)}}}};var at=(t,n,r)=>{var s,i;const c=t.prototype;if(n.o||e.watchCallback){const a=Object.entries((s=n.o)!=null?s:{});a.map((([t,[e]])=>{if(e&31||r&2&&e&32){const{get:s,set:i}=Object.getOwnPropertyDescriptor(c,t)||{};if(s)n.o[t][0]|=2048;if(i)n.o[t][0]|=4096;if(r&1||!s){Object.defineProperty(c,t,{get(){{if((n.o[t][0]&2048)===0){return it(this,t)}const e=o(this);const r=e?e.l:c;if(!r)return;return r[t]}},configurable:true,enumerable:true})}Object.defineProperty(c,t,{set(s){const c=o(this);if(i){const r=e&32?this[t]:c.$hostElement$[t];if(typeof r==="undefined"&&c.i.get(t)){s=c.i.get(t)}else if(!c.i.get(t)&&r){c.i.set(t,r)}i.apply(this,[_(s,e)]);s=e&32?this[t]:c.$hostElement$[t];ct(this,t,s,n);return}{if((r&1)===0||(n.o[t][0]&4096)===0){ct(this,t,s,n);if(r&1&&!c.l){c.v.then((()=>{if(n.o[t][0]&4096&&c.l[t]!==c.i.get(t)){c.l[t]=s}}))}return}const o=()=>{const r=c.l[t];if(!c.i.get(t)&&r){c.i.set(t,r)}c.l[t]=_(s,e);ct(this,t,c.l[t],n)};if(c.l){o()}else{c.v.then((()=>o()))}}}})}}));if(r&1){const r=new Map;c.attributeChangedCallback=function(t,s,i){p.jmp((()=>{var a;const l=r.get(t);if(this.hasOwnProperty(l)&&e.lazyLoad){i=this[l];delete this[l]}else if(c.hasOwnProperty(l)&&typeof this[l]==="number"&&this[l]==i){return}else if(l==null){const e=o(this);const r=e==null?void 0:e.u;if(r&&!(r&8)&&r&128&&i!==s){const r=e.l;const o=(a=n.k)==null?void 0:a[t];o==null?void 0:o.forEach((e=>{if(r[e]!=null){r[e].call(r,i,s,t)}}))}return}const f=Object.getOwnPropertyDescriptor(c,l);i=i===null&&typeof this[l]==="boolean"?false:i;if(i!==this[l]&&(!f.get||!!f.set)){this[l]=i}}))};t.observedAttributes=Array.from(new Set([...Object.keys((i=n.k)!=null?i:{}),...a.filter((([t,e])=>e[0]&15)).map((([t,e])=>{const n=e[1]||t;r.set(n,t);return n}))]))}}return t};var lt=async(t,e,n,r)=>{let s;if((e.u&32)===0){e.u|=32;const r=n.m;if(r){const r=f(n,e);if(r&&"then"in r){const t=F();s=await r;t()}else{s=r}if(!s){throw new Error(`Constructor for "${n.p}#${e.C}" was not found`)}if(!s.isProxied){at(s,n,2);s.isProxied=true}const o=A("createInstance",n.p);{e.u|=8}try{new s(e)}catch(e){a(e,t)}{e.u&=-9}o();ft(e.l,t)}else{s=t.constructor;const n=t.localName;customElements.whenDefined(n).then((()=>e.u|=128))}if(s&&s.style){let t;if(typeof s.style==="string"){t=s.style}const e=I(n);if(!u.has(e)){const r=A("registerStyles",n.p);z(e,t,!!(n.u&1));r()}}}const o=e.O;const i=()=>Q(e,true);if(o&&o["s-rc"]){o["s-rc"].push(i)}else{i()}};var ft=(t,e)=>{{st(t,"connectedCallback",void 0,e)}};var ut=t=>{if((p.u&1)===0){const e=o(t);const n=e.t;const r=A("connectedCallback",n.p);if(!(e.u&1)){e.u|=1;{let n=t;while(n=n.parentNode||n.host){if(n["s-p"]){K(e,e.O=n);break}}}if(n.o){Object.entries(n.o).map((([e,[n]])=>{if(n&31&&t.hasOwnProperty(e)){const n=t[e];delete t[e];t[e]=n}}))}{lt(t,e,n)}}else{if(e==null?void 0:e.l){ft(e.l,t)}else if(e==null?void 0:e.v){e.v.then((()=>ft(e.l,t)))}}r()}};var vt=(t,e)=>{{st(t,"disconnectedCallback",void 0,e||t)}};var dt=async t=>{if((p.u&1)===0){const e=o(t);if(e==null?void 0:e.l){vt(e.l,t)}else if(e==null?void 0:e.v){e.v.then((()=>vt(e.l,t)))}}if(H.has(t)){H.delete(t)}if(t.shadowRoot&&H.has(t.shadowRoot)){H.delete(t.shadowRoot)}};var ht=(t,e={})=>{var n;if(!h.document){console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");return}const r=A();const s=[];const i=e.exclude||[];const a=h.customElements;const l=h.document.head;const f=l.querySelector("meta[charset]");const u=h.document.createElement("style");const m=[];let y;let w=true;Object.assign(p,e);p.$=new URL(e.resourcesUrl||"./",h.document.baseURI).href;let b=false;t.map((t=>{t[1].map((e=>{const n={u:e[0],p:e[1],o:e[2],M:e[3]};if(n.u&4){b=true}{n.o=e[2]}const r=n.p;const l=class extends HTMLElement{constructor(t){super(t);this.hasRegisteredEventListeners=false;t=this;c(t,n);if(n.u&1){{if(!t.shadowRoot){W.call(t,n)}else{if(t.shadowRoot.mode!=="open"){throw new Error(`Unable to re-use existing shadow root for ${n.p}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}}}}}connectedCallback(){o(this);if(!this.hasRegisteredEventListeners){this.hasRegisteredEventListeners=true}if(y){clearTimeout(y);y=null}if(w){m.push(this)}else{p.jmp((()=>ut(this)))}}disconnectedCallback(){p.jmp((()=>dt(this)));p.raf((()=>{var t;const e=o(this);const n=m.findIndex((t=>t===this));if(n>-1){m.splice(n,1)}if(((t=e==null?void 0:e.N)==null?void 0:t.P)instanceof Node&&!e.N.P.isConnected){delete e.N.P}}))}componentOnReady(){return o(this).v}};n.m=t[0];if(!i.includes(r)&&!a.get(r)){s.push(r);a.define(r,at(l,n,1))}}))}));if(s.length>0){if(b){u.textContent+=d}{u.textContent+=s.sort()+v}if(u.innerHTML.length){u.setAttribute("data-styles","");const t=(n=p.S)!=null?n:E(h.document);if(t!=null){u.setAttribute("nonce",t)}l.insertBefore(u,f?f.nextSibling:l.firstChild)}}w=false;if(m.length){m.map((t=>t.connectedCallback()))}else{{p.jmp((()=>y=setTimeout(rt,30)))}}r()};var pt=t=>p.S=t;export{ht as b,B as g,m as p,i as r,pt as s};
//# sourceMappingURL=p-58QfBuzl.js.map