simple-circular-progress
Version:
Simple circular progress bar to be use in ionic, Angular and React
1 lines • 6.88 kB
JavaScript
let e,n,t=!1;const l="undefined"!=typeof window?window:{},s=l.document||{head:{}},o={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,n,t,l)=>e.addEventListener(n,t,l),rel:(e,n,t,l)=>e.removeEventListener(n,t,l),ce:(e,n)=>new CustomEvent(e,n)},r=e=>Promise.resolve(e),c=(()=>{try{return new CSSStyleSheet,!0}catch(e){}return!1})(),i=new WeakMap,u=e=>"sc-"+e.o,a={},f=e=>"object"==(e=typeof e)||"function"===e,$=(e,n,...t)=>{let l=null,s=!1,o=!1,r=[];const c=n=>{for(let t=0;t<n.length;t++)l=n[t],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!f(l))&&(l+=""),s&&o?r[r.length-1].i+=l:r.push(s?d(null,l):l),o=s)};c(t);const i=d(e,null);return i.u=n,r.length>0&&(i.$=r),i},d=(e,n)=>({t:0,p:e,i:n,m:null,$:null,u:null}),p={},y=(e,n,t,l,s,o)=>{if(t!==l){let r=q(e,n);if(n.toLowerCase(),"style"===n){for(const n in t)l&&null!=l[n]||(n.includes("-")?e.style.removeProperty(n):e.style[n]="");for(const n in l)t&&l[n]===t[n]||(n.includes("-")?e.style.setProperty(n,l[n]):e.style[n]=l[n])}else{const c=f(l);if((r||c&&null!==l)&&!s)try{if(e.tagName.includes("-"))e[n]=l;else{let s=null==l?"":l;"list"===n?r=!1:null!=t&&e[n]==s||(e[n]=s)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(n)||e.removeAttribute(n):(!r||4&o||s)&&!c&&e.setAttribute(n,l=!0===l?"":l)}}},m=(e,n,t,l)=>{const s=11===n.m.nodeType&&n.m.host?n.m.host:n.m,o=e&&e.u||a,r=n.u||a;for(l in o)l in r||y(s,l,o[l],void 0,t,n.t);for(l in r)y(s,l,o[l],r[l],t,n.t)},h=(n,t,l)=>{let o,r,c=t.$[l],i=0;if(null!==c.i)o=c.m=s.createTextNode(c.i);else if(o=c.m=s.createElement(c.p),m(null,c,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),c.$)for(i=0;i<c.$.length;++i)r=h(n,c,i),r&&o.appendChild(r);return o},w=(e,t,l,s,o,r)=>{let c,i=e;for(i.shadowRoot&&i.tagName===n&&(i=i.shadowRoot);o<=r;++o)s[o]&&(c=h(null,l,o),c&&(s[o].m=c,i.insertBefore(c,t)))},b=(e,n,t,l)=>{for(;n<=t;++n)(l=e[n])&&l.m.remove()},g=(e,n)=>e.p===n.p,S=(e,n)=>{const t=n.m=e.m,l=e.$,s=n.$,o=n.i;null===o?(m(e,n,!1),null!==l&&null!==s?((e,n,t,l)=>{let s,o=0,r=0,c=n.length-1,i=n[0],u=n[c],a=l.length-1,f=l[0],$=l[a];for(;o<=c&&r<=a;)null==i?i=n[++o]:null==u?u=n[--c]:null==f?f=l[++r]:null==$?$=l[--a]:g(i,f)?(S(i,f),i=n[++o],f=l[++r]):g(u,$)?(S(u,$),u=n[--c],$=l[--a]):g(i,$)?(S(i,$),e.insertBefore(i.m,u.m.nextSibling),i=n[++o],$=l[--a]):g(u,f)?(S(u,f),e.insertBefore(u.m,i.m),u=n[--c],f=l[++r]):(s=h(n&&n[r],t,r),f=l[++r],s&&i.m.parentNode.insertBefore(s,i.m));o>c?w(e,null==l[a+1]?null:l[a+1].m,t,l,r,a):r>a&&b(n,o,c)})(t,l,n,s):null!==s?(null!==e.i&&(t.textContent=""),w(t,null,n,s,0,s.length-1)):null!==l&&b(l,0,l.length-1)):e.i!==o&&(t.data=o)},v=(e,n)=>{n&&!e.h&&n["s-p"]&&n["s-p"].push(new Promise((n=>e.h=n)))},M=(e,n)=>{if(e.t|=16,!(4&e.t))return v(e,e.g),J((()=>j(e,n)));e.t|=512},j=(e,n)=>{const t=e.S;return x(void 0,(()=>k(e,t,n)))},k=async(t,l,o)=>{const r=t.v,c=r["s-rc"];o&&(e=>{const n=e.M,t=e.v,l=n.t,o=((e,n)=>{let t=u(n),l=V.get(t);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let n,o=i.get(e=e.head||e);o||i.set(e,o=new Set),o.has(t)||(n=s.createElement("style"),n.innerHTML=l,e.insertBefore(n,e.querySelector("link")),o&&o.add(t))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return t})(t.shadowRoot?t.shadowRoot:t.getRootNode(),n);10&l&&(t["s-sc"]=o,t.classList.add(o+"-h"))})(t);((t,l)=>{const s=t.v,o=t.j||d(null,null),r=(e=>e&&e.p===p)(l)?l:$(null,null,l);n=s.tagName,r.p=null,r.t|=4,t.j=r,r.m=o.m=s.shadowRoot||s,e=s["s-sc"],S(o,r)})(t,C(t,l)),c&&(c.map((e=>e())),r["s-rc"]=void 0);{const e=r["s-p"],n=()=>O(t);0===e.length?n():(Promise.all(e).then(n),t.t|=4,e.length=0)}},C=(e,n)=>{try{n=n.render(),e.t&=-17,e.t|=2}catch(n){F(n,e.v)}return n},O=e=>{const n=e.v,t=e.g;64&e.t||(e.t|=64,E(n),e.k(n),t||P()),e.h&&(e.h(),e.h=void 0),512&e.t&&I((()=>M(e,!1))),e.t&=-517},P=()=>{E(s.documentElement),I((()=>(e=>{const n=o.ce("appload",{detail:{namespace:"simple-circular-progress"}});return e.dispatchEvent(n),n})(l)))},x=(e,n)=>e&&e.then?e.then(n):n(),E=e=>e.classList.add("hydrated"),T=(e,n,t)=>{if(n.C){const l=Object.entries(n.C),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&t&&32&l)&&Object.defineProperty(s,e,{get(){return((e,n)=>R(this).O.get(n))(0,e)},set(t){((e,n,t,l)=>{const s=R(e),o=s.O.get(n),r=s.t,c=s.S;t=((e,n)=>null==e||f(e)?e:4&n?"false"!==e&&(""===e||!!e):1&n?e+"":e)(t,l.C[n][0]),8&r&&void 0!==o||t===o||(s.O.set(n,t),c&&2==(18&r)&&M(s,!1))})(this,e,t,n)},configurable:!0,enumerable:!0})})),1&t){const n=new Map;s.attributeChangedCallback=function(e,t,l){o.jmp((()=>{const t=n.get(e);this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,n])=>15&n[0])).map((([e,t])=>{const l=t[1]||e;return n.set(l,e),l}))}}return e},A=(e,n={})=>{const t=[],r=n.exclude||[],i=l.customElements,a=s.head,f=a.querySelector("meta[charset]"),$=s.createElement("style"),d=[];let p,y=!0;Object.assign(o,n),o.l=new URL(n.resourcesUrl||"./",s.baseURI).href,e.map((e=>e[1].map((n=>{const l={t:n[0],o:n[1],C:n[2],P:n[3]};l.C=n[2];const s=l.o,a=class extends HTMLElement{constructor(e){super(e),W(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){p&&(clearTimeout(p),p=null),y?d.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const n=R(e),t=n.M,l=()=>{};if(!(1&n.t)){n.t|=1;{let t=e;for(;t=t.parentNode||t.host;)if(t["s-p"]){v(n,n.g=t);break}}t.C&&Object.entries(t.C).map((([n,[t]])=>{if(31&t&&e.hasOwnProperty(n)){const t=e[n];delete e[n],e[n]=t}})),(async(e,n,t,l,s)=>{if(0==(32&n.t)){{if(n.t|=32,(s=N(t)).then){const e=()=>{};s=await s,e()}s.isProxied||(T(s,t,2),s.isProxied=!0);const e=()=>{};n.t|=8;try{new s(n)}catch(e){F(e)}n.t&=-9,e()}if(s.style){let e=s.style;const n=u(t);if(!V.has(n)){const l=()=>{};((e,n,t)=>{let l=V.get(e);c&&t?(l=l||new CSSStyleSheet,l.replace(n)):l=n,V.set(e,l)})(n,e,!!(1&t.t)),l()}}}const o=n.g,r=()=>M(n,!0);o&&o["s-rc"]?o["s-rc"].push(r):r()})(0,n,t)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>{}))}componentOnReady(){return R(this).T}};l.A=e[0],r.includes(s)||i.get(s)||(t.push(s),i.define(s,T(a,l,1)))})))),$.innerHTML=t+"{visibility:hidden}.hydrated{visibility:inherit}",$.setAttribute("data-styles",""),a.insertBefore($,f?f.nextSibling:a.firstChild),y=!1,d.length?d.map((e=>e.connectedCallback())):o.jmp((()=>p=setTimeout(P,30)))},L=new WeakMap,R=e=>L.get(e),U=(e,n)=>L.set(n.S=e,n),W=(e,n)=>{const t={t:0,v:e,M:n,O:new Map};return t.T=new Promise((e=>t.k=e)),e["s-p"]=[],e["s-rc"]=[],L.set(e,t)},q=(e,n)=>n in e,F=(e,n)=>(0,console.error)(e,n),H=new Map,N=e=>{const n=e.o.replace(/-/g,"_"),t=e.A,l=H.get(t);return l?l[n]:import(`./${t}.entry.js`).then((e=>(H.set(t,e),e[n])),F)},V=new Map,_=[],z=[],B=(e,n)=>l=>{e.push(l),t||(t=!0,n&&4&o.t?I(G):o.raf(G))},D=e=>{for(let n=0;n<e.length;n++)try{e[n](performance.now())}catch(e){F(e)}e.length=0},G=()=>{D(_),D(z),(t=_.length>0)&&o.raf(G)},I=e=>r().then(e),J=B(z,!0);export{A as b,$ as h,r as p,U as r}