diff --git a/README.md b/README.md index 64962c5..ef0564c 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ I used [monaco-editor](https://github.com/microsoft/monaco-editor) for the code- This project was greatly influenced by hardfists [neo-tools](https://github.com/hardfist/neo-tools) and mizchi's [uniroll](https://github.com/mizchi/uniroll) project. -**bundle** is a quick and easy way to bundle your projects and see the gzip size, it's similar to [bundlephobia](https://bundlephobia.com) but does all the work locally on you computer and can treeshake and bundle multiple packages (both commonjs and esm) together, it currently doesn't support JSX, but packages without JSX are good. +**bundle** is a quick and easy way to bundle your projects, minify and see it's gzip size, it's similar to [bundlephobia](https://bundlephobia.com) but does all the work locally on you computer and can treeshake and bundle multiple packages (both commonjs and esm) together, it currently doesn't support JSX, but packages without JSX are good. The project isn't perfect, and I am still working on an autocomplete, hover intellisence, better mobile support and the high memory usage of ~~**esbuild** and~~ **monaco** as well as some edge case packages, e.g. **fastify**. diff --git a/docs/404.html b/docs/404.html index 6bd5d21..8ff96d3 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1,5 +1 @@ -<<<<<<< HEAD -404 Page

404 Page

You might be lost, wanna go back home?

-======= -404 Page

404 Page

You might be lost, wanna go back home?

->>>>>>> dc72fa72945ea239858cda624198603f0a773de2 +404 Page

404 Page

You might be lost, wanna go back home?

\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index e8664d9..57e30ba 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,7 +1,2 @@ -<<<<<<< HEAD bundle - a quick npm package size checker

bundle

a quick npm package size checker (Visit Counter)

...

* Check the console for error messages and bundled code.

* Every 10 results the console will be cleared.


* Note: Treeshaking is available, but since esbuild and rollup doesn't have access to each packages package.json, it assumes that there are sideEffects.


* If an error occurs try using a different CDN, by default bundle uses esm.sh but you can use others, here is a list of CDN's that I know of:

about

* All text with cross through lines, are no longer true

I used monaco-editor for the code-editor, esbuild rollup as a bundler, pako as a js port of the zlib and gzip libraries, pretty-bytes to convert the gzip size to human readable values, and countapi-js to keep track of the number of page visits, in a private and secure way.

This project was greatly influenced by - hardfists neo-tools and mizchi's uniroll project.

bundle is a quick and easy way to bundle your projects and see the minified and gzip size, it's similar to bundlephobia but does all the work locally on you computer and can treeshake multiple packages (both commonjs and esm) into a bundle, it currently doesn't support JSX, but packages without JSX are good.

The project isn't perfect, I am still working on an autocomplete, hover intellisence, better mobile support and the high memory usage of esbuild and monaco as well as some edge case packages, e.g. fastify.

If there is something I missed, a mistake, or a feature you would like added please create an issue or a pull request and I'll try to get to it. You can contribute to this project at okikio/bundle.

bundle uses Conventional Commits as the style of commit, and the Commitizen CLI to make commits easier.

You can join the discussion on github discussions.

-======= -bundle - a quick npm package size checker

bundle

a quick npm package size checker (Visit Counter)

...

* Check the console for error messages and bundled code.

* Every 10 results the console will be cleared.


* Note: Treeshaking is available, but since esbuild and rollup doesn't have access to each packages package.json, it assumes that there are sideEffects.


* If an error occurs try using a different CDN, by default bundle uses esm.sh but you can use others, here is a list of CDN's that I know of:

about

* All text with cross through lines, are no longer true

I used monaco-editor for the code-editor, esbuild rollup as a bundler, pako as a js port of the zlib and gzip libraries, pretty-bytes to convert the gzip size to human readable values, and countapi-js to keep track of the number of page visits, in a private and secure way.

This project was greatly influenced by - hardfists neo-tools and mizchi's uniroll project.

bundle is a quick and easy way to bundle your projects and see the minified and gzip size, it's similar to bundlephobia but does all the work locally on you computer and can treeshake multiple packages (both commonjs and esm) into a bundle, it currently doesn't support JSX, but packages without JSX are good.

The project isn't perfect, I am still working on an autocomplete, hover intellisence, better mobile support and the high memory usage of esbuild and monaco as well as some edge case packages, e.g. fastify.

If there is something I missed, a mistake, or a feature you would like added please create an issue or a pull request and I'll try to get to it. You can contribute to this project at okikio/bundle.

bundle uses Conventional Commits as the style of commit, and the Commitizen CLI to make commits easier.

You can join the discussion on github discussions.

->>>>>>> dc72fa72945ea239858cda624198603f0a773de2 + hardfists neo-tools and mizchi's uniroll project.

bundle is a quick and easy way to bundle your projects and see the minified and gzip size, it's similar to bundlephobia but does all the work locally on you computer and can treeshake multiple packages (both commonjs and esm) into a bundle, it currently doesn't support JSX, but packages without JSX are good.

The project isn't perfect, I am still working on an autocomplete, hover intellisence, better mobile support and the high memory usage of esbuild and monaco as well as some edge case packages, e.g. fastify.

If there is something I missed, a mistake, or a feature you would like added please create an issue or a pull request and I'll try to get to it. You can contribute to this project at okikio/bundle.

bundle uses Conventional Commits as the style of commit, and the Commitizen CLI to make commits easier.

You can join the discussion on github discussions.

\ No newline at end of file diff --git a/docs/js/main.min.js b/docs/js/main.min.js index df7b837..c1709eb 100644 --- a/docs/js/main.min.js +++ b/docs/js/main.min.js @@ -1,5 +1 @@ -function Et(t){let e=document.createElement("a");return e.setAttribute("href",t),e.cloneNode(!1).href}function St(t){return new Promise((e,i)=>{let s="$importModule$"+Math.random().toString(32).slice(2),r=document.createElement("script"),n=()=>{delete window[s],r.onerror=null,r.onload=null,r.remove(),URL.revokeObjectURL(r.src),r.src=""};r.defer="defer",r.type="module",r.onerror=()=>{i(new Error(`Failed to import: ${t}`)),n()},r.onload=()=>{e(window[s]),n()};let l=`import * as m from "${Et(t)}"; window.${s} = m;`,o=new Blob([l],{type:"text/javascript"});r.src=URL.createObjectURL(o),document.head.appendChild(r)})}var it=St;var At={},st=!1;try{let t=At;st=!0}catch(t){}var rt=async t=>await(st?import(t):it(t));var vt=new Event("theme-change",{bubbles:!0,cancelable:!0,composed:!1}),nt=()=>{let t=window.localStorage.getItem("theme");return typeof t=="string"?t:null},Ot=t=>{typeof t=="string"&&window.localStorage.setItem("theme",t)},Pt=()=>{let t=window.matchMedia("(prefers-color-scheme: dark)");return typeof t.matches=="boolean"?t.matches?"dark":"light":null},V=document.querySelector("html"),at=()=>{let t=V.getAttribute("data-theme");return typeof t=="string"&&t.length?t:nt()},M=t=>{V.setAttribute("data-theme",t),V.classList.toggle("dark",t=="dark"),Ot(t),document.dispatchEvent(vt)},xt=()=>{try{let t=nt();t===null&&(t=Pt()),t&&M(t),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{M(e.matches?"dark":"light")}),window.matchMedia("(prefers-color-scheme: light)").addEventListener("change",e=>{M(e.matches?"light":"dark")})}catch(t){console.warn("Theming isn't available on this browser.",t)}};xt();var ot=()=>{try{let i=Array.from(document.querySelectorAll(".theme-toggle"));if(i[0])for(let s of i)s.addEventListener("click",()=>{M(at()==="dark"?"light":"dark")})}catch(i){console.warn("Theming seems to break on this browser.",i)}let t=document.querySelector(".navbar"),e=!0;window.addEventListener("scroll",()=>{if(e){let i;e=!1,i=requestAnimationFrame(()=>{t.classList.toggle("shadow",window.scrollY>=5),e=!0,i=window.cancelAnimationFrame(i)})}},{passive:!0})};var Y=class{constructor(t){this.map=new Map(t)}getMap(){return this.map}get(t){return this.map.get(t)}keys(){return Array.from(this.map.keys())}values(){return Array.from(this.map.values())}set(t,e){return this.map.set(t,e),this}add(t){let e=this.size;return this.set(e,t),this}get size(){return this.map.size}get length(){return this.map.size}last(t=1){let e=this.keys()[this.size-t];return this.get(e)}delete(t){return this.map.delete(t)}remove(t){return this.map.delete(t),this}clear(){return this.map.clear(),this}has(t){return this.map.has(t)}entries(){return this.map.entries()}forEach(t,e){return this.map.forEach(t,e),this}[Symbol.iterator](){return this.entries()}},Tt=(t,e,...i)=>{t.forEach(s=>{s[e](...i)})},lt=({callback:t=()=>{},scope:e=null,name:i="event"})=>({callback:t,scope:e,name:i}),q=class extends Y{constructor(t="event"){super();this.name=t}},Dt=class extends Y{constructor(){super()}getEvent(t){let e=this.get(t);return e instanceof q?e:(this.set(t,new q(t)),this.get(t))}newListener(t,e,i){let s=this.getEvent(t);return s.add(lt({name:t,callback:e,scope:i})),s}on(t,e,i){if(typeof t=="undefined"||t==null)return this;typeof t=="string"&&(t=t.trim().split(/\s/g));let s,r,n=typeof t=="object"&&!Array.isArray(t),a=n?e:i;return n||(r=e),Object.keys(t).forEach(l=>{s=n?l:t[l],n&&(r=t[l]),this.newListener(s,r,a)},this),this}removeListener(t,e,i){let s=this.get(t);if(s instanceof q&&e){let r=lt({name:t,callback:e,scope:i});s.forEach((n,a)=>{if(n.callback===r.callback&&n.scope===r.scope)return s.remove(a)})}return s}off(t,e,i){if(typeof t=="undefined"||t==null)return this;typeof t=="string"&&(t=t.trim().split(/\s/g));let s,r,n=typeof t=="object"&&!Array.isArray(t),a=n?e:i;return n||(r=e),Object.keys(t).forEach(l=>{s=n?l:t[l],n&&(r=t[l]),typeof r=="function"?this.removeListener(s,r,a):this.remove(s)},this),this}once(t,e,i){if(typeof t=="undefined"||t==null)return this;typeof t=="string"&&(t=t.trim().split(/\s/g));let s=typeof t=="object"&&!Array.isArray(t);return Object.keys(t).forEach(r=>{let n=s?r:t[r],a=s?t[r]:e,l=s?e:i,o=(...h)=>{a.apply(l,h),this.removeListener(n,o,l)};this.newListener(n,o,l)},this),this}emit(t,...e){return typeof t=="undefined"||t==null?this:(typeof t=="string"&&(t=t.trim().split(/\s/g)),t.forEach(i=>{let s=this.get(i);s instanceof q&&s.forEach(r=>{let{callback:n,scope:a}=r;n.apply(a,e)})},this),this)}clear(){return Tt(this,"clear"),super.clear(),this}},Z=t=>typeof t=="string"?t.includes("%")?parseFloat(t)/100:t=="from"?0:t=="to"?1:parseFloat(t):t,zt=t=>{let e=new Set,i=Object.keys(t),s=i.length;for(let r=0;rr.offset-n.offset)};var G=(t="")=>e=>typeof e=="string"?e:`${e}${t}`,N=G(),W=G("px"),B=G("deg"),H=t=>Array.isArray(t)||typeof t=="string"?(typeof t=="string"&&(t=t.split(",")),t):[t],z=t=>Array.isArray(t)||typeof t=="string"?Boolean(t.length):t!=null&&t!=null,R=t=>e=>z(e)?H(e).map(i=>{if(typeof i!="number"&&typeof i!="string")return i;let s=Number(i),r=Number.isNaN(s)?typeof i=="string"?i.trim():i:s;return t(r)}):[],Lt=(...t)=>{let e=0;t=t.map(r=>{let n=H(r),a=n.length;return a>e&&(e=a),n});let i=[],s=t.length;for(let r=0;rH(t).map(R(e)),ht=["translate","translate3d","translateX","translateY","translateZ","rotate","rotate3d","rotateX","rotateY","rotateZ","scale","scale3d","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective"],ct=t=>{let e="",i=ht.length;for(let s=0;st.includes("--")?t:`${t}`.replace(/-([a-z])/g,(e,i)=>i.toUpperCase()),mt=t=>{let e=Object.keys(t),i,s,r={};for(let n=0,a=e.length;n""+t,ut=["margin","padding","size","width","height","left","right","top","bottom","radius","gap","basis","inset","outline-offset","perspective","thickness","position","distance","spacing"].join("|"),jt=t=>{let{perspective:e,rotate:i,rotate3d:s,rotateX:r,rotateY:n,rotateZ:a,translate:l,translate3d:o,translateX:h,translateY:d,translateZ:w,scale:y,scale3d:p,scaleX:u,scaleY:b,scaleZ:g,skew:c,skewX:k,skewY:E,...f}=mt(t);l=C(l,W),o=C(o,W),h=v(h),d=v(d),w=v(w),i=C(i,B),s=C(s,N),r=S(r),n=S(n),a=S(a),y=C(y,N),p=C(p,N),u=T(u),b=T(b),g=T(g),c=C(c,B),k=S(k),E=S(E),e=v(e);let m=Lt(l,o,h,d,w,i,s,r,n,a,y,p,u,b,g,c,k,E,e).filter(z).map(ct);return f=F(f,(O,L)=>{let P;if(!/color/gi.test(L)){let D=/rotate/gi.test(L),x=new RegExp(ut,"gi").test(L);if(D||x)return D?P=S:x&&(P=v),P(O).map(A=>{let j=A.trim().split(" ");return P(j).join(" ")})}return[].concat(O).map(Q)}),Object.assign({},z(m)?{transform:m}:null,f)},Mt=t=>t.map(e=>{let{translate:i,translate3d:s,translateX:r,translateY:n,translateZ:a,rotate:l,rotate3d:o,rotateX:h,rotateY:d,rotateZ:w,scale:y,scale3d:p,scaleX:u,scaleY:b,scaleZ:g,skew:c,skewX:k,skewY:E,perspective:f,easing:m,iterations:O,offset:L,...P}=mt(e);return i=v(i),s=v(s),r=v(r)[0],n=v(n)[0],a=v(a)[0],l=S(l),o=T(o),h=S(h)[0],d=S(d)[0],w=S(w)[0],y=T(y),p=T(p),u=T(u)[0],b=T(b)[0],g=T(g)[0],c=S(c),k=S(k)[0],E=S(E)[0],f=v(f)[0],[P,i,s,r,n,a,l,o,h,d,w,y,p,u,b,g,c,k,E,f]}).map(([e,...i])=>{let s=ct(i);return e=F(e,(r,n)=>{let a;if(!/color/gi.test(n)){let l=/rotate/gi.test(n),o=new RegExp(ut,"gi").test(n);if(l||o){l?a=S:o&&(a=v);let h=Q(r).trim().split(" ");return a(h).join(" ")}}return Q(r)}),Object.assign({},z(s)?{transform:s}:null,e)}),It=t=>typeof t=="string"?Array.from(document.querySelectorAll(t)):[t],qt=t=>[].concat(...t),J=t=>Array.isArray(t)?qt(t.map(J)):typeof t=="string"||t instanceof Node?It(t):t instanceof NodeList||t instanceof HTMLCollection?Array.from(t):[],Nt=(t,e,i)=>typeof t=="function"?t.apply(i,e):t,F=(t,e)=>{let i=Object.keys(t),s,r,n={};for(let a=0,l=i.length;aF(t,s=>Nt(s,e,i)),ft={in:"ease-in",out:"ease-out","in-out":"ease-in-out","in-sine":"cubic-bezier(0.47, 0, 0.745, 0.715)","out-sine":"cubic-bezier(0.39, 0.575, 0.565, 1)","in-out-sine":"cubic-bezier(0.445, 0.05, 0.55, 0.95)","in-quad":"cubic-bezier(0.55, 0.085, 0.68, 0.53)","out-quad":"cubic-bezier(0.25, 0.46, 0.45, 0.94)","in-out-quad":"cubic-bezier(0.455, 0.03, 0.515, 0.955)","in-cubic":"cubic-bezier(0.55, 0.055, 0.675, 0.19)","out-cubic":"cubic-bezier(0.215, 0.61, 0.355, 1)","in-out-cubic":"cubic-bezier(0.645, 0.045, 0.355, 1)","in-quart":"cubic-bezier(0.895, 0.03, 0.685, 0.22)","out-quart":"cubic-bezier(0.165, 0.84, 0.44, 1)","in-out-quart":"cubic-bezier(0.77, 0, 0.175, 1)","in-quint":"cubic-bezier(0.755, 0.05, 0.855, 0.06)","out-quint":"cubic-bezier(0.23, 1, 0.32, 1)","in-out-quint":"cubic-bezier(0.86, 0, 0.07, 1)","in-expo":"cubic-bezier(0.95, 0.05, 0.795, 0.035)","out-expo":"cubic-bezier(0.19, 1, 0.22, 1)","in-out-expo":"cubic-bezier(1, 0, 0, 1)","in-circ":"cubic-bezier(0.6, 0.04, 0.98, 0.335)","out-circ":"cubic-bezier(0.075, 0.82, 0.165, 1)","in-out-circ":"cubic-bezier(0.785, 0.135, 0.15, 0.86)","in-back":"cubic-bezier(0.6, -0.28, 0.735, 0.045)","out-back":"cubic-bezier(0.175, 0.885, 0.32, 1.275)","in-out-back":"cubic-bezier(0.68, -0.55, 0.265, 1.55)"},Rt=Object.keys(ft),dt=t=>{let e=t.replace(/^ease-/,"");return Rt.includes(e)?ft[e]:t},Ft={keyframes:[],offset:[],loop:1,delay:0,speed:1,endDelay:0,easing:"ease",timelineOffset:0,autoplay:!0,duration:1e3,fillMode:"none",direction:"normal",padEndDelay:!1,timeline:document.timeline,extend:{}},Ut=t=>{var r;let{options:e,...i}=t,s=e instanceof _?e.options:Array.isArray(e)?(r=e==null?void 0:e[0])==null?void 0:r.options:e;return Object.assign({},s,i)},U=(t,e)=>{let i={...e};for(;t.length;){let{[t.pop()]:s,...r}=i;i=r}return i},gt=class{constructor(t){this.options={},this.properties={},this.totalDuration=-Infinity,this.minDelay=Infinity,this.maxSpeed=Infinity,this.emitter=new Dt,this.targets=new Y,this.targetIndexes=new WeakMap,this.keyframeEffects=new WeakMap,this.computedOptions=new WeakMap,this.animations=new WeakMap,this.computedKeyframes=new WeakMap,this.loop=this.loop.bind(this),this.onVisibilityChange=this.onVisibilityChange.bind(this),this.on("error",console.error),this.updateOptions(t),this.mainAnimation&&(this.visibilityPlayState=this.getPlayState(),gt.pauseOnPageHidden&&document.addEventListener("visibilitychange",this.onVisibilityChange,!1)),this.newPromise()}onVisibilityChange(){document.hidden?(this.visibilityPlayState=this.getPlayState(),this.is("running")&&(this.loop(),this.pause())):this.visibilityPlayState=="running"&&this.is("paused")&&this.play()}newPromise(){return this.promise=new Promise((t,e)=>{var i,s,r,n;(s=(i=this==null?void 0:this.emitter)==null?void 0:i.once)==null||s.call(i,"finish",()=>t([this])),(n=(r=this==null?void 0:this.emitter)==null?void 0:r.once)==null||n.call(r,"error",a=>e(a))}),this.promise}then(t,e){var i,s;return t=t==null?void 0:t.bind(this),e=e==null?void 0:e.bind(this),(s=(i=this==null?void 0:this.promise)==null?void 0:i.then)==null||s.call(i,t,e),this}catch(t){var e,i;return t=t==null?void 0:t.bind(this),(i=(e=this.promise)==null?void 0:e.catch)==null||i.call(e,t),this}finally(t){var e,i;return t=t==null?void 0:t.bind(this),(i=(e=this.promise)==null?void 0:e.finally)==null||i.call(e,t),this}loop(){this.stopLoop(),this.animationFrame=window.requestAnimationFrame(this.loop),this.emit("update",this.getProgress(),this)}stopLoop(){window.cancelAnimationFrame(this.animationFrame)}allAnimations(t){return this.targets.forEach(e=>{let i=this.keyframeEffects.get(e),s=this.animations.get(i);return t(s,e)}),this}all(t){return this.mainAnimation&&t(this.mainAnimation,this.mainElement),this.allAnimations(t),this}beginEvent(){this.getProgress()==0&&this.emit("begin",this)}play(){let t=this.getPlayState();return this.beginEvent(),this.all(e=>e.play()),this.emit("play",t,this),this.is(t)||this.emit("playstate-change",t,this),this.loop(),this}pause(){let t=this.getPlayState();return this.all(e=>e.pause()),this.emit("pause",t,this),this.is(t)||this.emit("playstate-change",t,this),this.stopLoop(),this}reverse(){return this.all(t=>t.reverse()),this}reset(){return this.setProgress(0),this.options.autoplay?this.play():this.pause(),this}cancel(){return this.all(t=>t.cancel()),this}finish(){return this.all(t=>t.finish()),this}stop(){this.cancel(),this.stopLoop(),document.removeEventListener("visibilitychange",this.onVisibilityChange,!1),this.targets.forEach(t=>this.removeTarget(t)),this.emit("stop"),this.emitter.clear(),this.mainkeyframeEffect=null,this.mainAnimation=null,this.mainElement=null,this.promise=null,this.computedOptions=null,this.animations=null,this.keyframeEffects=null,this.emitter=null,this.targets=null,this.options=null,this.properties=null}getAnimation(t){let e=this.keyframeEffects.get(t);return this.animations.get(e)}getTiming(t){var s,r,n,a;let e=(s=this.computedOptions.get(t))!=null?s:{},i=(a=(n=(r=this.keyframeEffects.get(t)).getTiming)==null?void 0:n.call(r))!=null?a:{};return{...e,...i}}getCurrentTime(){return this.mainAnimation.currentTime}getProgress(){return this.getCurrentTime()/this.totalDuration*100}getSpeed(){return this.mainAnimation.playbackRate}getPlayState(){return this.mainAnimation.playState}is(t){return this.getPlayState()==t}setCurrentTime(t){return this.all(e=>e.currentTime=t),this.emit("update",this.getProgress()),this}setProgress(t){let e=t/100*this.totalDuration;return this.setCurrentTime(e),this}setSpeed(t=1){return this.maxSpeed=t,this.all(e=>{e.updatePlaybackRate?e.updatePlaybackRate(t):e.playbackRate=t}),this}createArrayOfComputedOptions(t,e){let i=[];return this.targets.forEach((s,r)=>{var c,k;let n=(c=this.computedOptions.get(s))!=null?c:{},a=E=>{var m,O;let f=E;return E=="loop"&&(f="iterations"),E=="fillMode"&&(f="fill"),(O=(m=t[E])!=null?m:n[f])!=null?O:this.options[E]},l=Object.assign({easing:a("easing"),iterations:a("loop"),direction:a("direction"),endDelay:a("endDelay"),duration:a("duration"),speed:a("speed"),delay:a("delay"),timelineOffset:a("timelineOffset"),keyframes:a("keyframes")},(k=a("extend"))!=null?k:{}),o=pt(l,[r,e,s],this);typeof o.easing=="string"&&(o.easing=dt(o.easing)),o.iterations===!0&&(o.iterations=Infinity),o.fill=a("fillMode");let{timelineOffset:h,speed:d,endDelay:w,delay:y,duration:p,iterations:u,...b}=o;u=Number(u),p=Number(p),w=Number(w),d=Number(d),y=Number(y)+Number(h);let g=y+p*u+w;this.totalDurationy&&(this.minDelay=y),this.maxSpeed>d&&(this.maxSpeed=d)}),i}createAnimations(t,e){let{arrOfComputedOptions:i,padEndDelay:s,oldCSSProperties:r,onfinish:n,oncancel:a,timeline:l}=t;this.targets.forEach((o,h)=>{var O,L,P;let{speed:d,keyframes:w,tempDurations:y,...p}=i[h];s&&p.endDelay==0&&Math.abs(p.iterations)!=Math.abs(Infinity)&&(p.endDelay=this.totalDuration-y);let u,b,g=w;typeof g=="object"&&(g=zt(g));let c=(O=this.computedKeyframes.get(o))!=null?O:{},k=Object.assign({},r,c),E=F(k,(D,x)=>{var A;return(A=this.properties[x])!=null?A:D});if(b=z(g)?g:E,Array.isArray(b))u=b.map(D=>{let{easing:x,offset:A,...j}=U(["speed","loop"],D);return Object.assign({},j,typeof x=="string"?{easing:dt(x)}:null,typeof A=="string"||typeof A=="number"?{offset:Z(A)}:null)}),u=Mt(u);else{let D=U(["keyframes"],b),{offset:x,...A}=pt(D,[h,e,o],this);A=jt(A);let j=x;u=Object.assign({},A,z(j)?{offset:j.map(Z)}:null)}let f,m;this.keyframeEffects.has(o)?(m=this.keyframeEffects.get(o),f=this.animations.get(m),(L=m==null?void 0:m.setKeyframes)==null||L.call(m,u),(P=m==null?void 0:m.updateTiming)==null||P.call(m,p)):(m=new KeyframeEffect(o,u,p),f=new Animation(m,l),this.keyframeEffects.set(o,m),this.animations.set(m,f)),f.playbackRate=d,f.onfinish=()=>{typeof n=="function"&&n.call(this,o,h,e,f)},f.oncancel=()=>{typeof a=="function"&&a.call(this,o,h,e,f)},this.computedOptions.set(o,p),this.computedKeyframes.set(o,u)})}updateOptions(t={}){var e,i;try{let s=Ut(t);this.options=Object.assign({},Ft,this.options,s);let r=["easing","loop","endDelay","duration","speed","delay","timelineOffset","direction","extend","fillMode","offset"],{padEndDelay:n,autoplay:a,target:l,targets:o,timeline:h,onfinish:d,oncancel:w,...y}=U(r,this.options);this.properties=U([...r,"keyframes","padEndDelay","onfinish","oncancel","autoplay","target","targets","timeline"],s);let p=this.targets.values(),u=[...new Set([...p,...J(o),...J(l)])];this.targets.clear(),u.forEach((c,k)=>{this.targets.set(k,c),this.targetIndexes.set(c,k)});let b=this.targets.size,g=this.createArrayOfComputedOptions(s,b);if(this.createAnimations({arrOfComputedOptions:g,padEndDelay:n,oldCSSProperties:y,onfinish:d,oncancel:w,timeline:h},b),b<=0&&(this.maxSpeed==Infinity&&(this.maxSpeed=Number(this.options.speed)),this.minDelay==Infinity&&(this.minDelay=Number(this.options.delay)+Number(this.options.timelineOffset)),this.totalDuration==-Infinity&&(this.totalDuration=Number(this.options.duration))),this.mainAnimation?((i=(e=this.mainkeyframeEffect)==null?void 0:e.updateTiming)==null||i.call(e,{duration:this.totalDuration}),(!this.mainkeyframeEffect.setKeyframes||!this.mainkeyframeEffect.updateTiming)&&console.warn("@okikio/animate - `KeyframeEffect.setKeyframes` and/or `KeyframeEffect.updateTiming` are not supported in this browser.")):(this.mainkeyframeEffect=new KeyframeEffect(this.mainElement,null,{duration:this.totalDuration}),this.mainAnimation=new Animation(this.mainkeyframeEffect,h)),this.mainAnimation.playbackRate=this.maxSpeed,this.mainAnimation.onfinish=()=>{if(this.mainAnimation){let c=this.getPlayState();this.is(c)||this.emit("playstate-change",c,this),this.loop(),this.stopLoop()}this.emit("finish",this)},this.mainAnimation.oncancel=()=>{if(this.mainAnimation){let c=this.getPlayState();this.is(c)||this.emit("playstate-change",c,this),this.loop(),this.stopLoop()}this.emit("cancel",this)},a){let c=window.setTimeout(()=>{this.emit("begin",this),c=window.clearTimeout(c)},0);this.play()}else this.pause()}catch(s){this.emit("error",s)}}add(t){let e=this.getProgress(),i=this.is("running"),s=this.is("paused");this.updateOptions({target:t}),this.setProgress(e),i?this.play():s&&this.pause()}removeTarget(t){let e=this.keyframeEffects.get(t);this.animations.delete(e),e=null,this.computedKeyframes.delete(t),this.computedOptions.delete(t),this.keyframeEffects.delete(t);let i=this.targetIndexes.get(t);this.targets.delete(i),this.targetIndexes.delete(t)}remove(t){this.removeTarget(t);let e=new Set([].concat(this.targets.values()));this.options.target=[...e],this.options.targets=[],e.clear(),e=null;let i=this.getProgress(),s=this.is("running"),r=this.is("paused");this.updateOptions(),s?this.play():r&&this.pause(),this.setProgress(i)}on(t,e,i){var s;return(s=this==null?void 0:this.emitter)==null||s.on(t,e,i!=null?i:this),this}off(t,e,i){var s;return(s=this==null?void 0:this.emitter)==null||s.off(t,e,i!=null?i:this),this}emit(t,...e){var i;return(i=this==null?void 0:this.emitter)==null||i.emit(t,...e),this}toJSON(){return this.options}get[Symbol.toStringTag](){return"Animate"}},_=gt;_.pauseOnPageHidden=!0;var yt=(t={})=>new _(t);(async()=>{try{}catch(t){console.warn("Visit Counter Error (please create a new issue in the repo)",t)}})();ot();var I=document.querySelector(".center-container"),tt=document.querySelector(".file-size"),Xt=document.querySelector("#run"),bt=document.querySelector("#bundle-time"),X=yt({target:I,opacity:[1,0],delay:1e3,easing:"ease-in",duration:500,autoplay:!1}),K;(async()=>{K=(await rt("./monaco.min.js")).build(),X.play(),await X,I==null||I.remove(),X.stop(),I=null,X=null})();var Kt=new Intl.RelativeTimeFormat("en",{style:"narrow",numeric:"auto"}),wt=new Worker("./js/rollup.min.js"),et=0,$="",kt=Date.now();Xt.addEventListener("click",()=>{$=""+(K==null?void 0:K.getValue()),tt.innerHTML='
',bt.textContent="",kt=Date.now(),wt.postMessage($)});wt.onmessage=({data:t})=>{if(t.error){console.warn(t.type+` (please create a new issue in the repo) -`,t.error),tt.textContent="Error";return}let{size:e,content:i}=t.value;et>10&&(console.clear(),et=0);let s=$.split(` -`);console.groupCollapsed(`${e} =>`,`${s[0]}${s.length>1?` -...`:""}`),console.groupCollapsed("Input Code: "),console.log($),console.groupEnd(),console.groupCollapsed("Bundled Code: "),console.log(i),console.groupEnd(),console.groupEnd(),et++,bt.textContent=`Bundled ${Kt.format((Date.now()-kt)/1e3,"seconds")}`,tt.textContent=""+e}; -//# sourceMappingURL=main.min.js.map +function Et(t){let e=document.createElement("a");return e.setAttribute("href",t),e.cloneNode(!1).href}function St(t){return new Promise(((e,i)=>{let s="$importModule$"+Math.random().toString(32).slice(2),n=document.createElement("script"),r=()=>{delete window[s],n.onerror=null,n.onload=null,n.remove(),URL.revokeObjectURL(n.src),n.src=""};n.defer="defer",n.type="module",n.onerror=()=>{i(new Error(`Failed to import: ${t}`)),r()},n.onload=()=>{e(window[s]),r()};let a=`import * as m from "${Et(t)}"; window.${s} = m;`,o=new Blob([a],{type:"text/javascript"});n.src=URL.createObjectURL(o),document.head.appendChild(n)}))}var it=St,At={},st=!1;try{st=!0}catch(t){}var rt=async t=>await(st?import(t):it(t)),vt=new Event("theme-change",{bubbles:!0,cancelable:!0,composed:!1}),nt=()=>{let t=window.localStorage.getItem("theme");return"string"==typeof t?t:null},Ot=t=>{"string"==typeof t&&window.localStorage.setItem("theme",t)},Pt=()=>{let t=window.matchMedia("(prefers-color-scheme: dark)");return"boolean"==typeof t.matches?t.matches?"dark":"light":null},V=document.querySelector("html"),at=()=>{let t=V.getAttribute("data-theme");return"string"==typeof t&&t.length?t:nt()},M=t=>{V.setAttribute("data-theme",t),V.classList.toggle("dark","dark"==t),Ot(t),document.dispatchEvent(vt)},xt=()=>{try{let t=nt();null===t&&(t=Pt()),t&&M(t),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(t=>{M(t.matches?"dark":"light")})),window.matchMedia("(prefers-color-scheme: light)").addEventListener("change",(t=>{M(t.matches?"light":"dark")}))}catch(t){console.warn("Theming isn't available on this browser.",t)}};xt();var ot=()=>{try{let t=Array.from(document.querySelectorAll(".theme-toggle"));if(t[0])for(let e of t)e.addEventListener("click",(()=>{M("dark"===at()?"light":"dark")}))}catch(t){console.warn("Theming seems to break on this browser.",t)}let t=document.querySelector(".navbar"),e=!0;window.addEventListener("scroll",(()=>{if(e){let i;e=!1,i=requestAnimationFrame((()=>{t.classList.toggle("shadow",window.scrollY>=5),e=!0,i=window.cancelAnimationFrame(i)}))}}),{passive:!0})},Y=class{constructor(t){this.map=new Map(t)}getMap(){return this.map}get(t){return this.map.get(t)}keys(){return Array.from(this.map.keys())}values(){return Array.from(this.map.values())}set(t,e){return this.map.set(t,e),this}add(t){let e=this.size;return this.set(e,t),this}get size(){return this.map.size}get length(){return this.map.size}last(t=1){let e=this.keys()[this.size-t];return this.get(e)}delete(t){return this.map.delete(t)}remove(t){return this.map.delete(t),this}clear(){return this.map.clear(),this}has(t){return this.map.has(t)}entries(){return this.map.entries()}forEach(t,e){return this.map.forEach(t,e),this}[Symbol.iterator](){return this.entries()}},Tt=(t,e,...i)=>{t.forEach((t=>{t[e](...i)}))},lt=({callback:t=(()=>{}),scope:e=null,name:i="event"})=>({callback:t,scope:e,name:i}),q=class extends Y{constructor(t="event"){super(),this.name=t}},Dt=class extends Y{constructor(){super()}getEvent(t){let e=this.get(t);return e instanceof q?e:(this.set(t,new q(t)),this.get(t))}newListener(t,e,i){let s=this.getEvent(t);return s.add(lt({name:t,callback:e,scope:i})),s}on(t,e,i){if(void 0===t||null==t)return this;"string"==typeof t&&(t=t.trim().split(/\s/g));let s,n,r="object"==typeof t&&!Array.isArray(t),a=r?e:i;return r||(n=e),Object.keys(t).forEach((e=>{s=r?e:t[e],r&&(n=t[e]),this.newListener(s,n,a)}),this),this}removeListener(t,e,i){let s=this.get(t);if(s instanceof q&&e){let n=lt({name:t,callback:e,scope:i});s.forEach(((t,e)=>{if(t.callback===n.callback&&t.scope===n.scope)return s.remove(e)}))}return s}off(t,e,i){if(void 0===t||null==t)return this;"string"==typeof t&&(t=t.trim().split(/\s/g));let s,n,r="object"==typeof t&&!Array.isArray(t),a=r?e:i;return r||(n=e),Object.keys(t).forEach((e=>{s=r?e:t[e],r&&(n=t[e]),"function"==typeof n?this.removeListener(s,n,a):this.remove(s)}),this),this}once(t,e,i){if(void 0===t||null==t)return this;"string"==typeof t&&(t=t.trim().split(/\s/g));let s="object"==typeof t&&!Array.isArray(t);return Object.keys(t).forEach((n=>{let r=s?n:t[n],a=s?t[n]:e,o=s?e:i,l=(...t)=>{a.apply(o,t),this.removeListener(r,l,o)};this.newListener(r,l,o)}),this),this}emit(t,...e){return void 0===t||null==t||("string"==typeof t&&(t=t.trim().split(/\s/g)),t.forEach((t=>{let i=this.get(t);i instanceof q&&i.forEach((t=>{let{callback:i,scope:s}=t;i.apply(s,e)}))}),this)),this}clear(){return Tt(this,"clear"),super.clear(),this}},Z=t=>"string"==typeof t?t.includes("%")?parseFloat(t)/100:"from"==t?0:"to"==t?1:parseFloat(t):t,zt=t=>{let e=new Set,i=Object.keys(t),s=i.length;for(let n=0;nt.offset-e.offset))},G=(t="")=>e=>"string"==typeof e?e:`${e}${t}`,N=G(),W=G("px"),B=G("deg"),H=t=>Array.isArray(t)||"string"==typeof t?("string"==typeof t&&(t=t.split(",")),t):[t],z=t=>Array.isArray(t)||"string"==typeof t?Boolean(t.length):null!=t&&null!=t,R=t=>e=>z(e)?H(e).map((e=>{if("number"!=typeof e&&"string"!=typeof e)return e;let i=Number(e),s=Number.isNaN(i)?"string"==typeof e?e.trim():e:i;return t(s)})):[],Lt=(...t)=>{let e=0,i=[],s=(t=t.map((t=>{let i=H(t),s=i.length;return s>e&&(e=s),i}))).length;for(let n=0;nH(t).map(R(e)),ht=["translate","translate3d","translateX","translateY","translateZ","rotate","rotate3d","rotateX","rotateY","rotateZ","scale","scale3d","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective"],ct=t=>{let e="",i=ht.length;for(let s=0;st.includes("--")?t:`${t}`.replace(/-([a-z])/g,((t,e)=>e.toUpperCase())),mt=t=>{let e,i,s=Object.keys(t),n={};for(let r=0,a=s.length;r""+t,ut=["margin","padding","size","width","height","left","right","top","bottom","radius","gap","basis","inset","outline-offset","perspective","thickness","position","distance","spacing"].join("|"),jt=t=>{let{perspective:e,rotate:i,rotate3d:s,rotateX:n,rotateY:r,rotateZ:a,translate:o,translate3d:l,translateX:h,translateY:u,translateZ:c,scale:m,scale3d:p,scaleX:d,scaleY:f,scaleZ:g,skew:y,skewX:b,skewY:w,...k}=mt(t);o=C(o,W),l=C(l,W),h=v(h),u=v(u),c=v(c),i=C(i,B),s=C(s,N),n=S(n),r=S(r),a=S(a),m=C(m,N),p=C(p,N),d=T(d),f=T(f),g=T(g),y=C(y,B),b=S(b),w=S(w),e=v(e);let E=Lt(o,l,h,u,c,i,s,n,r,a,m,p,d,f,g,y,b,w,e).filter(z).map(ct);return k=F(k,((t,e)=>{let i;if(!/color/gi.test(e)){let s=/rotate/gi.test(e),n=new RegExp(ut,"gi").test(e);if(s||n)return s?i=S:n&&(i=v),i(t).map((t=>{let e=t.trim().split(" ");return i(e).join(" ")}))}return[].concat(t).map(Q)})),Object.assign({},z(E)?{transform:E}:null,k)},Mt=t=>t.map((t=>{let{translate:e,translate3d:i,translateX:s,translateY:n,translateZ:r,rotate:a,rotate3d:o,rotateX:l,rotateY:h,rotateZ:u,scale:c,scale3d:m,scaleX:p,scaleY:d,scaleZ:f,skew:g,skewX:y,skewY:b,perspective:w,easing:k,iterations:E,offset:A,...O}=mt(t);return e=v(e),i=v(i),s=v(s)[0],n=v(n)[0],r=v(r)[0],a=S(a),o=T(o),l=S(l)[0],h=S(h)[0],u=S(u)[0],c=T(c),m=T(m),p=T(p)[0],d=T(d)[0],f=T(f)[0],g=S(g),y=S(y)[0],b=S(b)[0],w=v(w)[0],[O,e,i,s,n,r,a,o,l,h,u,c,m,p,d,f,g,y,b,w]})).map((([t,...e])=>{let i=ct(e);return t=F(t,((t,e)=>{let i;if(!/color/gi.test(e)){let s=/rotate/gi.test(e),n=new RegExp(ut,"gi").test(e);if(s||n){return s?i=S:n&&(i=v),i(Q(t).trim().split(" ")).join(" ")}}return Q(t)})),Object.assign({},z(i)?{transform:i}:null,t)})),It=t=>"string"==typeof t?Array.from(document.querySelectorAll(t)):[t],qt=t=>[].concat(...t),J=t=>Array.isArray(t)?qt(t.map(J)):"string"==typeof t||t instanceof Node?It(t):t instanceof NodeList||t instanceof HTMLCollection?Array.from(t):[],Nt=(t,e,i)=>"function"==typeof t?t.apply(i,e):t,F=(t,e)=>{let i,s,n=Object.keys(t),r={};for(let a=0,o=n.length;aF(t,(t=>Nt(t,e,i))),ft={in:"ease-in",out:"ease-out","in-out":"ease-in-out","in-sine":"cubic-bezier(0.47, 0, 0.745, 0.715)","out-sine":"cubic-bezier(0.39, 0.575, 0.565, 1)","in-out-sine":"cubic-bezier(0.445, 0.05, 0.55, 0.95)","in-quad":"cubic-bezier(0.55, 0.085, 0.68, 0.53)","out-quad":"cubic-bezier(0.25, 0.46, 0.45, 0.94)","in-out-quad":"cubic-bezier(0.455, 0.03, 0.515, 0.955)","in-cubic":"cubic-bezier(0.55, 0.055, 0.675, 0.19)","out-cubic":"cubic-bezier(0.215, 0.61, 0.355, 1)","in-out-cubic":"cubic-bezier(0.645, 0.045, 0.355, 1)","in-quart":"cubic-bezier(0.895, 0.03, 0.685, 0.22)","out-quart":"cubic-bezier(0.165, 0.84, 0.44, 1)","in-out-quart":"cubic-bezier(0.77, 0, 0.175, 1)","in-quint":"cubic-bezier(0.755, 0.05, 0.855, 0.06)","out-quint":"cubic-bezier(0.23, 1, 0.32, 1)","in-out-quint":"cubic-bezier(0.86, 0, 0.07, 1)","in-expo":"cubic-bezier(0.95, 0.05, 0.795, 0.035)","out-expo":"cubic-bezier(0.19, 1, 0.22, 1)","in-out-expo":"cubic-bezier(1, 0, 0, 1)","in-circ":"cubic-bezier(0.6, 0.04, 0.98, 0.335)","out-circ":"cubic-bezier(0.075, 0.82, 0.165, 1)","in-out-circ":"cubic-bezier(0.785, 0.135, 0.15, 0.86)","in-back":"cubic-bezier(0.6, -0.28, 0.735, 0.045)","out-back":"cubic-bezier(0.175, 0.885, 0.32, 1.275)","in-out-back":"cubic-bezier(0.68, -0.55, 0.265, 1.55)"},Rt=Object.keys(ft),dt=t=>{let e=t.replace(/^ease-/,"");return Rt.includes(e)?ft[e]:t},Ft={keyframes:[],offset:[],loop:1,delay:0,speed:1,endDelay:0,easing:"ease",timelineOffset:0,autoplay:!0,duration:1e3,fillMode:"none",direction:"normal",padEndDelay:!1,timeline:document.timeline,extend:{}},Ut=t=>{var e;let{options:i,...s}=t,n=i instanceof _?i.options:Array.isArray(i)?null==(e=null==i?void 0:i[0])?void 0:e.options:i;return Object.assign({},n,s)},U=(t,e)=>{let i={...e};for(;t.length;){let{[t.pop()]:e,...s}=i;i=s}return i},gt=class{constructor(t){this.options={},this.properties={},this.totalDuration=-1/0,this.minDelay=1/0,this.maxSpeed=1/0,this.emitter=new Dt,this.targets=new Y,this.targetIndexes=new WeakMap,this.keyframeEffects=new WeakMap,this.computedOptions=new WeakMap,this.animations=new WeakMap,this.computedKeyframes=new WeakMap,this.loop=this.loop.bind(this),this.onVisibilityChange=this.onVisibilityChange.bind(this),this.on("error",console.error),this.updateOptions(t),this.mainAnimation&&(this.visibilityPlayState=this.getPlayState(),gt.pauseOnPageHidden&&document.addEventListener("visibilitychange",this.onVisibilityChange,!1)),this.newPromise()}onVisibilityChange(){document.hidden?(this.visibilityPlayState=this.getPlayState(),this.is("running")&&(this.loop(),this.pause())):"running"==this.visibilityPlayState&&this.is("paused")&&this.play()}newPromise(){return this.promise=new Promise(((t,e)=>{var i,s,n,r;null==(s=null==(i=null==this?void 0:this.emitter)?void 0:i.once)||s.call(i,"finish",(()=>t([this]))),null==(r=null==(n=null==this?void 0:this.emitter)?void 0:n.once)||r.call(n,"error",(t=>e(t)))})),this.promise}then(t,e){var i,s;return t=null==t?void 0:t.bind(this),e=null==e?void 0:e.bind(this),null==(s=null==(i=null==this?void 0:this.promise)?void 0:i.then)||s.call(i,t,e),this}catch(t){var e,i;return t=null==t?void 0:t.bind(this),null==(i=null==(e=this.promise)?void 0:e.catch)||i.call(e,t),this}finally(t){var e,i;return t=null==t?void 0:t.bind(this),null==(i=null==(e=this.promise)?void 0:e.finally)||i.call(e,t),this}loop(){this.stopLoop(),this.animationFrame=window.requestAnimationFrame(this.loop),this.emit("update",this.getProgress(),this)}stopLoop(){window.cancelAnimationFrame(this.animationFrame)}allAnimations(t){return this.targets.forEach((e=>{let i=this.keyframeEffects.get(e),s=this.animations.get(i);return t(s,e)})),this}all(t){return this.mainAnimation&&t(this.mainAnimation,this.mainElement),this.allAnimations(t),this}beginEvent(){0==this.getProgress()&&this.emit("begin",this)}play(){let t=this.getPlayState();return this.beginEvent(),this.all((t=>t.play())),this.emit("play",t,this),this.is(t)||this.emit("playstate-change",t,this),this.loop(),this}pause(){let t=this.getPlayState();return this.all((t=>t.pause())),this.emit("pause",t,this),this.is(t)||this.emit("playstate-change",t,this),this.stopLoop(),this}reverse(){return this.all((t=>t.reverse())),this}reset(){return this.setProgress(0),this.options.autoplay?this.play():this.pause(),this}cancel(){return this.all((t=>t.cancel())),this}finish(){return this.all((t=>t.finish())),this}stop(){this.cancel(),this.stopLoop(),document.removeEventListener("visibilitychange",this.onVisibilityChange,!1),this.targets.forEach((t=>this.removeTarget(t))),this.emit("stop"),this.emitter.clear(),this.mainkeyframeEffect=null,this.mainAnimation=null,this.mainElement=null,this.promise=null,this.computedOptions=null,this.animations=null,this.keyframeEffects=null,this.emitter=null,this.targets=null,this.options=null,this.properties=null}getAnimation(t){let e=this.keyframeEffects.get(t);return this.animations.get(e)}getTiming(t){var e,i,s,n;return{...null!=(e=this.computedOptions.get(t))?e:{},...null!=(n=null==(s=(i=this.keyframeEffects.get(t)).getTiming)?void 0:s.call(i))?n:{}}}getCurrentTime(){return this.mainAnimation.currentTime}getProgress(){return this.getCurrentTime()/this.totalDuration*100}getSpeed(){return this.mainAnimation.playbackRate}getPlayState(){return this.mainAnimation.playState}is(t){return this.getPlayState()==t}setCurrentTime(t){return this.all((e=>e.currentTime=t)),this.emit("update",this.getProgress()),this}setProgress(t){let e=t/100*this.totalDuration;return this.setCurrentTime(e),this}setSpeed(t=1){return this.maxSpeed=t,this.all((e=>{e.updatePlaybackRate?e.updatePlaybackRate(t):e.playbackRate=t})),this}createArrayOfComputedOptions(t,e){let i=[];return this.targets.forEach(((s,n)=>{var r,a;let o=null!=(r=this.computedOptions.get(s))?r:{},l=e=>{var i,s;let n=e;return"loop"==e&&(n="iterations"),"fillMode"==e&&(n="fill"),null!=(s=null!=(i=t[e])?i:o[n])?s:this.options[e]},h=Object.assign({easing:l("easing"),iterations:l("loop"),direction:l("direction"),endDelay:l("endDelay"),duration:l("duration"),speed:l("speed"),delay:l("delay"),timelineOffset:l("timelineOffset"),keyframes:l("keyframes")},null!=(a=l("extend"))?a:{}),u=pt(h,[n,e,s],this);"string"==typeof u.easing&&(u.easing=dt(u.easing)),!0===u.iterations&&(u.iterations=1/0),u.fill=l("fillMode");let{timelineOffset:c,speed:m,endDelay:p,delay:d,duration:f,iterations:g,...y}=u;g=Number(g),f=Number(f),p=Number(p),m=Number(m),d=Number(d)+Number(c);let b=d+f*g+p;this.totalDurationd&&(this.minDelay=d),this.maxSpeed>m&&(this.maxSpeed=m)})),i}createAnimations(t,e){let{arrOfComputedOptions:i,padEndDelay:s,oldCSSProperties:n,onfinish:r,oncancel:a,timeline:o}=t;this.targets.forEach(((t,l)=>{var h,u,c;let{speed:m,keyframes:p,tempDurations:d,...f}=i[l];s&&0==f.endDelay&&Math.abs(f.iterations)!=Math.abs(1/0)&&(f.endDelay=this.totalDuration-d);let g,y,b=p;"object"==typeof b&&(b=zt(b));let v,w,k=null!=(h=this.computedKeyframes.get(t))?h:{},E=Object.assign({},n,k),S=F(E,((t,e)=>{var i;return null!=(i=this.properties[e])?i:t}));if(y=z(b)?b:S,Array.isArray(y))g=y.map((t=>{let{easing:e,offset:i,...s}=U(["speed","loop"],t);return Object.assign({},s,"string"==typeof e?{easing:dt(e)}:null,"string"==typeof i||"number"==typeof i?{offset:Z(i)}:null)})),g=Mt(g);else{let i=U(["keyframes"],y),{offset:s,...n}=pt(i,[l,e,t],this);n=jt(n);let r=s;g=Object.assign({},n,z(r)?{offset:r.map(Z)}:null)}this.keyframeEffects.has(t)?(w=this.keyframeEffects.get(t),v=this.animations.get(w),null==(u=null==w?void 0:w.setKeyframes)||u.call(w,g),null==(c=null==w?void 0:w.updateTiming)||c.call(w,f)):(w=new KeyframeEffect(t,g,f),v=new Animation(w,o),this.keyframeEffects.set(t,w),this.animations.set(w,v)),v.playbackRate=m,v.onfinish=()=>{"function"==typeof r&&r.call(this,t,l,e,v)},v.oncancel=()=>{"function"==typeof a&&a.call(this,t,l,e,v)},this.computedOptions.set(t,f),this.computedKeyframes.set(t,g)}))}updateOptions(t={}){var e,i;try{let s=Ut(t);this.options=Object.assign({},Ft,this.options,s);let n=["easing","loop","endDelay","duration","speed","delay","timelineOffset","direction","extend","fillMode","offset"],{padEndDelay:r,autoplay:a,target:o,targets:l,timeline:h,onfinish:u,oncancel:c,...m}=U(n,this.options);this.properties=U([...n,"keyframes","padEndDelay","onfinish","oncancel","autoplay","target","targets","timeline"],s);let p=this.targets.values(),d=[...new Set([...p,...J(l),...J(o)])];this.targets.clear(),d.forEach(((t,e)=>{this.targets.set(e,t),this.targetIndexes.set(t,e)}));let f=this.targets.size,g=this.createArrayOfComputedOptions(s,f);if(this.createAnimations({arrOfComputedOptions:g,padEndDelay:r,oldCSSProperties:m,onfinish:u,oncancel:c,timeline:h},f),f<=0&&(this.maxSpeed==1/0&&(this.maxSpeed=Number(this.options.speed)),this.minDelay==1/0&&(this.minDelay=Number(this.options.delay)+Number(this.options.timelineOffset)),this.totalDuration==-1/0&&(this.totalDuration=Number(this.options.duration))),this.mainAnimation?(null==(i=null==(e=this.mainkeyframeEffect)?void 0:e.updateTiming)||i.call(e,{duration:this.totalDuration}),(!this.mainkeyframeEffect.setKeyframes||!this.mainkeyframeEffect.updateTiming)&&console.warn("@okikio/animate - `KeyframeEffect.setKeyframes` and/or `KeyframeEffect.updateTiming` are not supported in this browser.")):(this.mainkeyframeEffect=new KeyframeEffect(this.mainElement,null,{duration:this.totalDuration}),this.mainAnimation=new Animation(this.mainkeyframeEffect,h)),this.mainAnimation.playbackRate=this.maxSpeed,this.mainAnimation.onfinish=()=>{if(this.mainAnimation){let t=this.getPlayState();this.is(t)||this.emit("playstate-change",t,this),this.loop(),this.stopLoop()}this.emit("finish",this)},this.mainAnimation.oncancel=()=>{if(this.mainAnimation){let t=this.getPlayState();this.is(t)||this.emit("playstate-change",t,this),this.loop(),this.stopLoop()}this.emit("cancel",this)},a){let t=window.setTimeout((()=>{this.emit("begin",this),t=window.clearTimeout(t)}),0);this.play()}else this.pause()}catch(t){this.emit("error",t)}}add(t){let e=this.getProgress(),i=this.is("running"),s=this.is("paused");this.updateOptions({target:t}),this.setProgress(e),i?this.play():s&&this.pause()}removeTarget(t){let e=this.keyframeEffects.get(t);this.animations.delete(e),e=null,this.computedKeyframes.delete(t),this.computedOptions.delete(t),this.keyframeEffects.delete(t);let i=this.targetIndexes.get(t);this.targets.delete(i),this.targetIndexes.delete(t)}remove(t){this.removeTarget(t);let e=new Set([].concat(this.targets.values()));this.options.target=[...e],this.options.targets=[],e.clear(),e=null;let i=this.getProgress(),s=this.is("running"),n=this.is("paused");this.updateOptions(),s?this.play():n&&this.pause(),this.setProgress(i)}on(t,e,i){var s;return null==(s=null==this?void 0:this.emitter)||s.on(t,e,null!=i?i:this),this}off(t,e,i){var s;return null==(s=null==this?void 0:this.emitter)||s.off(t,e,null!=i?i:this),this}emit(t,...e){var i;return null==(i=null==this?void 0:this.emitter)||i.emit(t,...e),this}toJSON(){return this.options}get[Symbol.toStringTag](){return"Animate"}},_=gt;_.pauseOnPageHidden=!0;var yt=(t={})=>new _(t);(async()=>{})(),ot();var K,I=document.querySelector(".center-container"),tt=document.querySelector(".file-size"),Xt=document.querySelector("#run"),bt=document.querySelector("#bundle-time"),X=yt({target:I,opacity:[1,0],delay:1e3,easing:"ease-in",duration:500,autoplay:!1});(async()=>{K=(await rt("./monaco.min.js")).build(),X.play(),await X,null==I||I.remove(),X.stop(),I=null,X=null})();var Kt=new Intl.RelativeTimeFormat("en",{style:"narrow",numeric:"auto"}),wt=new Worker("./js/rollup.min.js"),et=0,$="",kt=Date.now();Xt.addEventListener("click",(()=>{$=""+(null==K?void 0:K.getValue()),tt.innerHTML='
',bt.textContent="",kt=Date.now(),wt.postMessage($)})),wt.onmessage=({data:t})=>{if(t.error)return console.warn(t.type+" (please create a new issue in the repo)\n",t.error),void(tt.textContent="Error");let{size:e,content:i}=t.value;et>10&&(console.clear(),et=0);let s=$.split("\n");console.groupCollapsed(`${e} =>`,`${s[0]}${s.length>1?"\n...":""}`),console.groupCollapsed("Input Code: "),console.log($),console.groupEnd(),console.groupCollapsed("Bundled Code: "),console.log(i),console.groupEnd(),console.groupEnd(),et++,bt.textContent=`Bundled ${Kt.format((Date.now()-kt)/1e3,"seconds")}`,tt.textContent=""+e}; \ No newline at end of file diff --git a/docs/js/theme.min.js b/docs/js/theme.min.js index 82b3dcd..51a9721 100644 --- a/docs/js/theme.min.js +++ b/docs/js/theme.min.js @@ -1,2 +1 @@ -var a=new Event("theme-change",{bubbles:!0,cancelable:!0,composed:!1}),n=()=>{let e=window.localStorage.getItem("theme");return typeof e=="string"?e:null},o=e=>{typeof e=="string"&&window.localStorage.setItem("theme",e)},h=()=>{let e=window.matchMedia("(prefers-color-scheme: dark)");return typeof e.matches=="boolean"?e.matches?"dark":"light":null},r=document.querySelector("html"),s=()=>{let e=r.getAttribute("data-theme");return typeof e=="string"&&e.length?e:n()},l=e=>{r.setAttribute("data-theme",e),r.classList.toggle("dark",e=="dark"),o(e),document.dispatchEvent(a)},i=()=>{try{let e=n();e===null&&(e=h()),e&&l(e),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{l(t.matches?"dark":"light")}),window.matchMedia("(prefers-color-scheme: light)").addEventListener("change",t=>{l(t.matches?"light":"dark")})}catch(e){console.warn("Theming isn't available on this browser.",e)}};i();export{a as ThemeChange,n as getTheme,h as mediaTheme,i as runTheme,o as setTheme,s as themeGet,l as themeSet}; -//# sourceMappingURL=theme.min.js.map +var a=new Event("theme-change",{bubbles:!0,cancelable:!0,composed:!1}),n=()=>{let e=window.localStorage.getItem("theme");return"string"==typeof e?e:null},o=e=>{"string"==typeof e&&window.localStorage.setItem("theme",e)},h=()=>{let e=window.matchMedia("(prefers-color-scheme: dark)");return"boolean"==typeof e.matches?e.matches?"dark":"light":null},r=document.querySelector("html"),s=()=>{let e=r.getAttribute("data-theme");return"string"==typeof e&&e.length?e:n()},l=e=>{r.setAttribute("data-theme",e),r.classList.toggle("dark","dark"==e),o(e),document.dispatchEvent(a)},i=()=>{try{let e=n();null===e&&(e=h()),e&&l(e),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(e=>{l(e.matches?"dark":"light")})),window.matchMedia("(prefers-color-scheme: light)").addEventListener("change",(e=>{l(e.matches?"light":"dark")}))}catch(e){console.warn("Theming isn't available on this browser.",e)}};i();export{a as ThemeChange,n as getTheme,h as mediaTheme,i as runTheme,o as setTheme,s as themeGet,l as themeSet}; \ No newline at end of file diff --git a/docs/js/webanimation-polyfill.min.js b/docs/js/webanimation-polyfill.min.js index 9e5bc70..a520356 100644 --- a/docs/js/webanimation-polyfill.min.js +++ b/docs/js/webanimation-polyfill.min.js @@ -1,2 +1 @@ -if(!window.KeyframeEffect){let e=document.createElement("script");e.src="./js/webanimation.min.js",document.head.appendChild(e)} -//# sourceMappingURL=webanimation-polyfill.min.js.map +if(!window.KeyframeEffect){let e=document.createElement("script");e.src="./js/webanimation.min.js",document.head.appendChild(e)} \ No newline at end of file diff --git a/docs/js/webanimation.min.js b/docs/js/webanimation.min.js index 0a98712..83a7b59 100644 --- a/docs/js/webanimation.min.js +++ b/docs/js/webanimation.min.js @@ -1,2 +1 @@ -(function(){var U={},I={},$={};(function(E,A){function n(y){if(typeof y=="number")return y;var R={};for(var k in y)R[k]=y[k];return R}function m(){this._delay=0,this._endDelay=0,this._fill="none",this._iterationStart=0,this._iterations=1,this._duration=0,this._playbackRate=1,this._direction="normal",this._easing="linear",this._easingFunction=x}function h(){return E.isDeprecated("Invalid timing inputs","2016-03-02","TypeError exceptions will be thrown instead.",!0)}function l(y,R,k){var F=new m;return R&&(F.fill="both",F.duration="auto"),typeof y!="number"||isNaN(y)?y!==void 0&&Object.getOwnPropertyNames(y).forEach(function(D){if(y[D]!="auto"){if((typeof F[D]=="number"||D=="duration")&&(typeof y[D]!="number"||isNaN(y[D]))||D=="fill"&&v.indexOf(y[D])==-1||D=="direction"&&P.indexOf(y[D])==-1||D=="playbackRate"&&y[D]!==1&&E.isDeprecated("AnimationEffectTiming.playbackRate","2014-11-28","Use Animation.playbackRate instead."))return;F[D]=y[D]}}):F.duration=y,F}function s(y){return typeof y=="number"&&(y=isNaN(y)?{duration:0}:{duration:y}),y}function u(y,R){return y=E.numericTimingToObject(y),l(y,R)}function d(y,R,k,F){return y<0||y>1||k<0||k>1?x:function(D){function z(Z,tt,b){return 3*Z*(1-b)*(1-b)*b+3*tt*(1-b)*b*b+b*b*b}if(D<=0){var H=0;return y>0?H=R/y:!R&&k>0&&(H=F/k),H*D}if(D>=1){var j=0;return k<1?j=(F-1)/(k-1):k==1&&y<1&&(j=(R-1)/(y-1)),1+j*(D-1)}for(var V=0,X=1;V=1)return 1;var F=1/y;return(k+=R*F)-k%F}}function a(y){C||(C=document.createElement("div").style),C.animationTimingFunction="",C.animationTimingFunction=y;var R=C.animationTimingFunction;if(R==""&&h())throw new TypeError(y+" is not a valid value for easing");return R}function t(y){if(y=="linear")return x;var R=q.exec(y);if(R)return d.apply(this,R.slice(1).map(Number));var k=O.exec(y);if(k)return p(Number(k[1]),S);var F=W.exec(y);return F?p(Number(F[1]),{start:N,middle:M,end:S}[F[2]]):T[y]||x}function e(y){return Math.abs(o(y)/y.playbackRate)}function o(y){return y.duration===0||y.iterations===0?0:y.duration*y.iterations}function i(y,R,k){if(R==null)return K;var F=k.delay+y+k.endDelay;return R=Math.min(k.delay+y,F)?B:J}function r(y,R,k,F,D){switch(F){case G:return R=="backwards"||R=="both"?0:null;case J:return k-D;case B:return R=="forwards"||R=="both"?y:null;case K:return null}}function c(y,R,k,F,D){var z=D;return y===0?R!==G&&(z+=k):z+=F/y,z}function g(y,R,k,F,D,z){var H=y===1/0?R%1:y%1;return H!==0||k!==B||F===0||D===0&&z!==0||(H=1),H}function w(y,R,k,F){return y===B&&R===1/0?1/0:k===1?Math.floor(F)-1:Math.floor(F)}function _(y,R,k){var F=y;if(y!=="normal"&&y!=="reverse"){var D=R;y==="alternate-reverse"&&(D+=1),F="normal",D!==1/0&&D%2!=0&&(F="reverse")}return F==="normal"?k:1-k}function f(y,R,k){var F=i(y,R,k),D=r(y,k.fill,R,F,k.delay);if(D===null)return null;var z=c(k.duration,F,k.iterations,D,k.iterationStart),H=g(z,k.iterationStart,F,k.iterations,D,k.duration),j=w(F,k.iterations,H,z),V=_(k.direction,j,H);return k._easingFunction(V)}var v="backwards|forwards|both|none".split("|"),P="reverse|alternate|alternate-reverse".split("|"),x=function(y){return y};m.prototype={_setMember:function(y,R){this["_"+y]=R,this._effect&&(this._effect._timingInput[y]=R,this._effect._timing=E.normalizeTimingInput(this._effect._timingInput),this._effect.activeDuration=E.calculateActiveDuration(this._effect._timing),this._effect._animation&&this._effect._animation._rebuildUnderlyingAnimation())},get playbackRate(){return this._playbackRate},set delay(y){this._setMember("delay",y)},get delay(){return this._delay},set endDelay(y){this._setMember("endDelay",y)},get endDelay(){return this._endDelay},set fill(y){this._setMember("fill",y)},get fill(){return this._fill},set iterationStart(y){if((isNaN(y)||y<0)&&h())throw new TypeError("iterationStart must be a non-negative number, received: "+y);this._setMember("iterationStart",y)},get iterationStart(){return this._iterationStart},set duration(y){if(y!="auto"&&(isNaN(y)||y<0)&&h())throw new TypeError("duration must be non-negative or auto, received: "+y);this._setMember("duration",y)},get duration(){return this._duration},set direction(y){this._setMember("direction",y)},get direction(){return this._direction},set easing(y){this._easingFunction=t(a(y)),this._setMember("easing",y)},get easing(){return this._easing},set iterations(y){if((isNaN(y)||y<0)&&h())throw new TypeError("iterations must be non-negative, received: "+y);this._setMember("iterations",y)},get iterations(){return this._iterations}};var N=1,M=.5,S=0,T={ease:d(.25,.1,.25,1),"ease-in":d(.42,0,1,1),"ease-out":d(0,0,.58,1),"ease-in-out":d(.42,0,.58,1),"step-start":p(1,N),"step-middle":p(1,M),"step-end":p(1,S)},C=null,L="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",q=new RegExp("cubic-bezier\\("+L+","+L+","+L+","+L+"\\)"),O=/steps\(\s*(\d+)\s*\)/,W=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/,K=0,G=1,B=2,J=3;E.cloneTimingInput=n,E.makeTiming=l,E.numericTimingToObject=s,E.normalizeTimingInput=u,E.calculateActiveDuration=e,E.calculateIterationProgress=f,E.calculatePhase=i,E.normalizeEasing=a,E.parseEasingFunction=t})(U),function(E,A){function n(t,e){return t in a&&a[t][e]||e}function m(t){return t==="display"||t.lastIndexOf("animation",0)===0||t.lastIndexOf("transition",0)===0}function h(t,e,o){if(!m(t)){var i=u[t];if(i){d.style[t]=e;for(var r in i){var c=i[r],g=d.style[c];o[c]=n(c,g)}}else o[t]=n(t,e)}}function l(t){var e=[];for(var o in t)if(!(o in["easing","offset","composite"])){var i=t[o];Array.isArray(i)||(i=[i]);for(var r,c=i.length,g=0;g1&&o[0].offset==null&&(o[0].offset=0);for(var _=0,f=o[0].offset,v=1;v1)throw new TypeError("Keyframe offsets must be between 0 and 1.")}}else if(f=="composite"){if(v=="add"||v=="accumulate")throw{type:DOMException.NOT_SUPPORTED_ERR,name:"NotSupportedError",message:"add compositing is not supported"};if(v!="replace")throw new TypeError("Invalid composite mode "+v+".")}else v=f=="easing"?E.normalizeEasing(v):""+v;h(f,v,_)}return _.offset==null&&(_.offset=null),_.easing==null&&(_.easing="linear"),_}),i=!0,r=-1/0,c=0;c=0&&w.offset<=1}),i||e(),o}var u={background:["backgroundImage","backgroundPosition","backgroundSize","backgroundRepeat","backgroundAttachment","backgroundOrigin","backgroundClip","backgroundColor"],border:["borderTopColor","borderTopStyle","borderTopWidth","borderRightColor","borderRightStyle","borderRightWidth","borderBottomColor","borderBottomStyle","borderBottomWidth","borderLeftColor","borderLeftStyle","borderLeftWidth"],borderBottom:["borderBottomWidth","borderBottomStyle","borderBottomColor"],borderColor:["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"],borderLeft:["borderLeftWidth","borderLeftStyle","borderLeftColor"],borderRadius:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],borderRight:["borderRightWidth","borderRightStyle","borderRightColor"],borderTop:["borderTopWidth","borderTopStyle","borderTopColor"],borderWidth:["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],flex:["flexGrow","flexShrink","flexBasis"],font:["fontFamily","fontSize","fontStyle","fontVariant","fontWeight","lineHeight"],margin:["marginTop","marginRight","marginBottom","marginLeft"],outline:["outlineColor","outlineStyle","outlineWidth"],padding:["paddingTop","paddingRight","paddingBottom","paddingLeft"]},d=document.createElementNS("http://www.w3.org/1999/xhtml","div"),p={thin:"1px",medium:"3px",thick:"5px"},a={borderBottomWidth:p,borderLeftWidth:p,borderRightWidth:p,borderTopWidth:p,fontSize:{"xx-small":"60%","x-small":"75%",small:"89%",medium:"100%",large:"120%","x-large":"150%","xx-large":"200%"},fontWeight:{normal:"400",bold:"700"},outlineWidth:p,textShadow:{none:"0px 0px 0px transparent"},boxShadow:{none:"0px 0px 0px 0px transparent"}};E.convertToArrayForm=l,E.normalizeKeyframes=s}(U),function(E){var A={};E.isDeprecated=function(n,m,h,l){var s=l?"are":"is",u=new Date,d=new Date(m);return d.setMonth(d.getMonth()+3),!(u=i.applyFrom&&ethis._surrogateStyle.length;)this._length--,Object.defineProperty(this,this._length,{configurable:!0,enumerable:!1,value:void 0})},_set:function(i,r){this._style[i]=r,this._isAnimatedProperty[i]=!0,this._updateSvgTransformAttr&&n.unprefixedPropertyName(i)=="transform"&&(this._savedTransformAttr==null&&(this._savedTransformAttr=this._element.getAttribute("transform")),this._element.setAttribute("transform",n.transformToSvgMatrix(r)))},_clear:function(i){this._style[i]=this._surrogateStyle[i],this._updateSvgTransformAttr&&n.unprefixedPropertyName(i)=="transform"&&(this._savedTransformAttr?this._element.setAttribute("transform",this._savedTransformAttr):this._element.removeAttribute("transform"),this._savedTransformAttr=null),delete this._isAnimatedProperty[i]}};for(var e in a)s.prototype[e]=function(i,r){return function(){var c=this._surrogateStyle[i].apply(this._surrogateStyle,arguments);return r&&(this._isAnimatedProperty[arguments[0]]||this._style[i].apply(this._style,arguments),this._updateIndices()),c}}(e,e in t);for(var o in document.documentElement.style)o in p||o in a||function(i){l(s.prototype,i,{get:function(){return this._surrogateStyle[i]},set:function(r){this._surrogateStyle[i]=r,this._updateIndices(),this._isAnimatedProperty[i]||(this._style[i]=r)}})}(o);n.apply=function(i,r,c){u(i),i.style._set(n.propertyName(r),c)},n.clear=function(i,r){i._webAnimationsPatchedStyle&&i.style._clear(n.propertyName(r))}}(I),function(n){window.Element.prototype.animate=function(m,h){var l="";return h&&h.id&&(l=h.id),n.timeline._play(n.KeyframeEffect(this,m,h,l))}}(I),function(n,m){function h(l,s,u){if(typeof l=="number"&&typeof s=="number")return l*(1-u)+s*u;if(typeof l=="boolean"&&typeof s=="boolean")return u<.5?l:s;if(l.length==s.length){for(var d=[],p=0;p0?this._totalDuration:0),this._ensureAlive())},get currentTime(){return this._idle||this._currentTimePending?null:this._currentTime},set currentTime(s){s=+s,isNaN(s)||(m.restart(),this._paused||this._startTime==null||(this._startTime=this._timeline.currentTime-s/this._playbackRate),this._currentTimePending=!1,this._currentTime!=s&&(this._idle&&(this._idle=!1,this._paused=!0),this._tickCurrentTime(s,!0),m.applyDirtiedAnimation(this)))},get startTime(){return this._startTime},set startTime(s){s=+s,isNaN(s)||this._paused||this._idle||(this._startTime=s,this._tickCurrentTime((this._timeline.currentTime-this._startTime)*this.playbackRate),m.applyDirtiedAnimation(this))},get playbackRate(){return this._playbackRate},set playbackRate(s){if(s!=this._playbackRate){var u=this.currentTime;this._playbackRate=s,this._startTime=null,this.playState!="paused"&&this.playState!="idle"&&(this._finishedFlag=!1,this._idle=!1,this._ensureAlive(),m.applyDirtiedAnimation(this)),u!=null&&(this.currentTime=u)}},get _isFinished(){return!this._idle&&(this._playbackRate>0&&this._currentTime>=this._totalDuration||this._playbackRate<0&&this._currentTime<=0)},get _totalDuration(){return this._effect._totalDuration},get playState(){return this._idle?"idle":this._startTime==null&&!this._paused&&this.playbackRate!=0||this._currentTimePending?"pending":this._paused?"paused":this._isFinished?"finished":"running"},_rewind:function(){if(this._playbackRate>=0)this._currentTime=0;else{if(!(this._totalDuration<1/0))throw new DOMException("Unable to rewind negative playback rate animation with infinite duration","InvalidStateError");this._currentTime=this._totalDuration}},play:function(){this._paused=!1,(this._isFinished||this._idle)&&(this._rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this._ensureAlive(),m.applyDirtiedAnimation(this)},pause:function(){this._isFinished||this._paused||this._idle?this._idle&&(this._rewind(),this._idle=!1):this._currentTimePending=!0,this._startTime=null,this._paused=!0},finish:function(){this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this._currentTimePending=!1,m.applyDirtiedAnimation(this))},cancel:function(){this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this._effect._update(null),m.applyDirtiedAnimation(this))},reverse:function(){this.playbackRate*=-1,this.play()},addEventListener:function(s,u){typeof u=="function"&&s=="finish"&&this._finishHandlers.push(u)},removeEventListener:function(s,u){if(s=="finish"){var d=this._finishHandlers.indexOf(u);d>=0&&this._finishHandlers.splice(d,1)}},_fireEvents:function(s){if(this._isFinished){if(!this._finishedFlag){var u=new l(this,this._currentTime,s),d=this._finishHandlers.concat(this.onfinish?[this.onfinish]:[]);setTimeout(function(){d.forEach(function(p){p.call(u.target,u)})},0),this._finishedFlag=!0}}else this._finishedFlag=!1},_tick:function(s,u){this._idle||this._paused||(this._startTime==null?u&&(this.startTime=s-this._currentTime/this.playbackRate):this._isFinished||this._tickCurrentTime((s-this._startTime)*this.playbackRate)),u&&(this._currentTimePending=!1,this._fireEvents(s))},get _needsTick(){return this.playState in{pending:1,running:1}||!this._finishedFlag},_targetAnimations:function(){var s=this._effect._target;return s._activeAnimations||(s._activeAnimations=[]),s._activeAnimations},_markTarget:function(){var s=this._targetAnimations();s.indexOf(this)===-1&&s.push(this)},_unmarkTarget:function(){var s=this._targetAnimations(),u=s.indexOf(this);u!==-1&&s.splice(u,1)}}}(U,I),function(n,m,h){function l(_){var f=t;t=[],_1e-4?(O=.5/Math.sqrt(K),W=[(T[2][1]-T[1][2])*O,(T[0][2]-T[2][0])*O,(T[1][0]-T[0][1])*O,.25/O]):T[0][0]>T[1][1]&&T[0][0]>T[2][2]?(O=2*Math.sqrt(1+T[0][0]-T[1][1]-T[2][2]),W=[.25*O,(T[0][1]+T[1][0])/O,(T[0][2]+T[2][0])/O,(T[2][1]-T[1][2])/O]):T[1][1]>T[2][2]?(O=2*Math.sqrt(1+T[1][1]-T[0][0]-T[2][2]),W=[(T[0][1]+T[1][0])/O,.25*O,(T[1][2]+T[2][1])/O,(T[0][2]-T[2][0])/O]):(O=2*Math.sqrt(1+T[2][2]-T[0][0]-T[1][1]),W=[(T[0][2]+T[2][0])/O,(T[1][2]+T[2][1])/O,.25*O,(T[1][0]-T[0][1])/O]),[S,C,L,W,N]}return _}();n.dot=h,n.makeMatrixDecomposition=p,n.transformListToMatrix=d}(I),function(n){function m(o,i){var r=o.exec(i);if(r)return r=o.ignoreCase?r[0].toLowerCase():r[0],[r,i.substr(r.length)]}function h(o,i){i=i.replace(/^\s*/,"");var r=o(i);if(r)return[r[0],r[1].replace(/^\s*/,"")]}function l(o,i,r){o=h.bind(null,o);for(var c=[];;){var g=o(r);if(!g)return[c,r];if(c.push(g[0]),r=g[1],!(g=m(i,r))||g[1]=="")return[c,r];r=g[1]}}function s(o,i){for(var r=0,c=0;cc?r%=c:c%=r;return r=o*i/(r+c)}function d(o){return function(i){var r=o(i);return r&&(r[0]=void 0),r}}function p(o,i){return function(r){return o(r)||[i,r]}}function a(o,i){for(var r=[],c=0;c=1?s:"visible"}]}n.addPropertiesHandler(String,h,["visibility"])}(I),function(n,m){function h(d){d=d.trim(),u.fillStyle="#000",u.fillStyle=d;var p=u.fillStyle;if(u.fillStyle="#fff",u.fillStyle=d,p==u.fillStyle){u.fillRect(0,0,1,1);var a=u.getImageData(0,0,1,1).data;u.clearRect(0,0,1,1);var t=a[3]/255;return[a[0]*t,a[1]*t,a[2]*t,t]}}function l(d,p){return[d,p,function(a){function t(o){return Math.max(0,Math.min(255,o))}if(a[3])for(var e=0;e<3;e++)a[e]=Math.round(t(a[e]/a[3]));return a[3]=n.numberToString(n.clamp(0,1,a[3])),"rgba("+a.join(",")+")"}]}var s=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");s.width=s.height=1;var u=s.getContext("2d");n.addPropertiesHandler(h,l,["background-color","border-bottom-color","border-left-color","border-right-color","border-top-color","color","fill","flood-color","lighting-color","outline-color","stop-color","stroke","text-decoration-color"]),n.consumeColor=n.consumeParenthesised.bind(null,h),n.mergeColors=l}(I),function(n,m){function h(w){function _(){var S=M.exec(w);N=S?S[0]:void 0}function f(){var S=Number(N);return _(),S}function v(){if(N!=="(")return f();_();var S=x();return N!==")"?NaN:(_(),S)}function P(){for(var S=v();N==="*"||N==="/";){var T=N;_();var C=v();T==="*"?S*=C:S/=C}return S}function x(){for(var S=P();N==="+"||N==="-";){var T=N;_();var C=P();T==="+"?S+=C:S-=C}return S}var N,M=/([\+\-\w\.]+|[\(\)\*\/])/g;return _(),x()}function l(w,_){if((_=_.trim().toLowerCase())=="0"&&"px".search(w)>=0)return{px:0};if(/^[^(]*$|^calc/.test(_)){_=_.replace(/calc\(/g,"(");var f={};_=_.replace(w,function(T){return f[T]=null,"U"+T});for(var v="U("+w.source+")",P=_.replace(/[-+]?(\d*\.)?\d+([Ee][-+]?\d+)?/g,"N").replace(new RegExp("N"+v,"g"),"D").replace(/\s[+-]\s/g,"O").replace(/\s/g,""),x=[/N\*(D)/g,/(N|D)[*\/]N/g,/(N|D)O\1/g,/\((N|D)\)/g],N=0;N1?"calc("+N+")":N}]}var d="px|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc",p=l.bind(null,new RegExp(d,"g")),a=l.bind(null,new RegExp(d+"|%","g")),t=l.bind(null,/deg|rad|grad|turn/g);n.parseLength=p,n.parseLengthOrPercent=a,n.consumeLengthOrPercent=n.consumeParenthesised.bind(null,a),n.parseAngle=t,n.mergeDimensions=u;var e=n.consumeParenthesised.bind(null,p),o=n.consumeRepeated.bind(void 0,e,/^/),i=n.consumeRepeated.bind(void 0,o,/^,/);n.consumeSizePairList=i;var r=function(w){var _=i(w);if(_&&_[1]=="")return _[0]},c=n.mergeNestedRepeated.bind(void 0,s," "),g=n.mergeNestedRepeated.bind(void 0,c,",");n.mergeNonNegativeSizePair=c,n.addPropertiesHandler(r,g,["background-size"]),n.addPropertiesHandler(a,s,["border-bottom-width","border-image-width","border-left-width","border-right-width","border-top-width","flex-basis","font-size","height","line-height","max-height","max-width","outline-width","width"]),n.addPropertiesHandler(a,u,["border-bottom-left-radius","border-bottom-right-radius","border-top-left-radius","border-top-right-radius","bottom","left","letter-spacing","margin-bottom","margin-left","margin-right","margin-top","min-height","min-width","outline-offset","padding-bottom","padding-left","padding-right","padding-top","perspective","right","shape-margin","stroke-dashoffset","text-indent","top","vertical-align","word-spacing"])}(I),function(n,m){function h(p){return n.consumeLengthOrPercent(p)||n.consumeToken(/^auto/,p)}function l(p){var a=n.consumeList([n.ignore(n.consumeToken.bind(null,/^rect/)),n.ignore(n.consumeToken.bind(null,/^\(/)),n.consumeRepeated.bind(null,h,/^,/),n.ignore(n.consumeToken.bind(null,/^\)/))],p);if(a&&a[0].length==4)return a[0]}function s(p,a){return p=="auto"||a=="auto"?[!0,!1,function(t){var e=t?p:a;if(e=="auto")return"auto";var o=n.mergeDimensions(e,e);return o[2](o[0])}]:n.mergeDimensions(p,a)}function u(p){return"rect("+p+")"}var d=n.mergeWrappedNestedRepeated.bind(null,u,s,", ");n.parseBox=l,n.mergeBoxes=d,n.addPropertiesHandler(l,d,["clip"])}(I),function(n,m){function h(c){return function(g){var w=0;return c.map(function(_){return _===e?g[w++]:_})}}function l(c){return c}function s(c){if((c=c.toLowerCase().trim())=="none")return[];for(var g,w=/\s*(\w+)\(([^)]*)\)/g,_=[],f=0;g=w.exec(c);){if(g.index!=f)return;f=g.index+g[0].length;var v=g[1],P=r[v];if(!P)return;var x=g[2].split(","),N=P[0];if(N.length900||u%100!=0))return u}function h(s){return s=100*Math.round(s/100),s=n.clamp(100,900,s),s===400?"normal":s===700?"bold":String(s)}function l(s,u){return[s,u,h]}n.addPropertiesHandler(m,l,["font-weight"])}(I),function(n){function m(t){var e={};for(var o in t)e[o]=-t[o];return e}function h(t){return n.consumeToken(/^(left|center|right|top|bottom)\b/i,t)||n.consumeLengthOrPercent(t)}function l(t,e){var o=n.consumeRepeated(h,/^/,e);if(o&&o[1]==""){var i=o[0];if(i[0]=i[0]||"center",i[1]=i[1]||"center",t==3&&(i[2]=i[2]||{px:0}),i.length==t){if(/top|bottom/.test(i[0])||/left|right/.test(i[1])){var r=i[0];i[0]=i[1],i[1]=r}if(/left|right|center|Object/.test(i[0])&&/top|bottom|center|Object/.test(i[1]))return i.map(function(c){return typeof c=="object"?c:d[c]})}}}function s(t){var e=n.consumeRepeated(h,/^/,t);if(e){for(var o=e[0],i=[{"%":50},{"%":50}],r=0,c=!1,g=0;g=0&&this._cancelHandlers.splice(t,1)}else d.call(this,p,a)},l}}}(),function(E){var A=document.documentElement,n=null,m=!1;try{var h=getComputedStyle(A).getPropertyValue("opacity"),l=h=="0"?"1":"0";n=A.animate({opacity:[l,l]},{duration:1}),n.currentTime=0,m=getComputedStyle(A).getPropertyValue("opacity")==l}catch(u){}finally{n&&n.cancel()}if(!m){var s=window.Element.prototype.animate;window.Element.prototype.animate=function(u,d){return window.Symbol&&Symbol.iterator&&Array.prototype.from&&u[Symbol.iterator]&&(u=Array.from(u)),Array.isArray(u)||u===null||(u=E.convertToArrayForm(u)),s.call(this,u,d)}}}(U),function(E,A,n){function m(u){var d=A.timeline;d.currentTime=u,d._discardAnimations(),d._animations.length==0?l=!1:requestAnimationFrame(m)}var h=window.requestAnimationFrame;window.requestAnimationFrame=function(u){return h(function(d){A.timeline._updateAnimationsPromises(),u(d),A.timeline._updateAnimationsPromises()})},A.AnimationTimeline=function(){this._animations=[],this.currentTime=void 0},A.AnimationTimeline.prototype={getAnimations:function(){return this._discardAnimations(),this._animations.slice()},_updateAnimationsPromises:function(){A.animationsWithPromises=A.animationsWithPromises.filter(function(u){return u._updatePromises()})},_discardAnimations:function(){this._updateAnimationsPromises(),this._animations=this._animations.filter(function(u){return u.playState!="finished"&&u.playState!="idle"})},_play:function(u){var d=new A.Animation(u,this);return this._animations.push(d),A.restartWebAnimationsNextTick(),d._updatePromises(),d._animation.play(),d._updatePromises(),d},play:function(u){return u&&u.remove(),this._play(u)}};var l=!1;A.restartWebAnimationsNextTick=function(){l||(l=!0,requestAnimationFrame(m))};var s=new A.AnimationTimeline;A.timeline=s;try{Object.defineProperty(window.document,"timeline",{configurable:!0,get:function(){return s}})}catch(u){}try{window.document.timeline=s}catch(u){}}(0,$),function(E,A,n){A.animationsWithPromises=[],A.Animation=function(m,h){if(this.id="",m&&m._id&&(this.id=m._id),this.effect=m,m&&(m._animation=this),!h)throw new Error("Animation with null timeline is not supported");this._timeline=h,this._sequenceNumber=E.sequenceNumber++,this._holdTime=0,this._paused=!1,this._isGroup=!1,this._animation=null,this._childAnimations=[],this._callback=null,this._oldPlayState="idle",this._rebuildUnderlyingAnimation(),this._animation.cancel(),this._updatePromises()},A.Animation.prototype={_updatePromises:function(){var m=this._oldPlayState,h=this.playState;return this._readyPromise&&h!==m&&(h=="idle"?(this._rejectReadyPromise(),this._readyPromise=void 0):m=="pending"?this._resolveReadyPromise():h=="pending"&&(this._readyPromise=void 0)),this._finishedPromise&&h!==m&&(h=="idle"?(this._rejectFinishedPromise(),this._finishedPromise=void 0):h=="finished"?this._resolveFinishedPromise():m=="finished"&&(this._finishedPromise=void 0)),this._oldPlayState=this.playState,this._readyPromise||this._finishedPromise},_rebuildUnderlyingAnimation:function(){this._updatePromises();var m,h,l,s,u=!!this._animation;u&&(m=this.playbackRate,h=this._paused,l=this.startTime,s=this.currentTime,this._animation.cancel(),this._animation._wrapper=null,this._animation=null),(!this.effect||this.effect instanceof window.KeyframeEffect)&&(this._animation=A.newUnderlyingAnimationForKeyframeEffect(this.effect),A.bindAnimationForKeyframeEffect(this)),(this.effect instanceof window.SequenceEffect||this.effect instanceof window.GroupEffect)&&(this._animation=A.newUnderlyingAnimationForGroup(this.effect),A.bindAnimationForGroup(this)),this.effect&&this.effect._onsample&&A.bindAnimationForCustomEffect(this),u&&(m!=1&&(this.playbackRate=m),l!==null?this.startTime=l:s!==null?this.currentTime=s:this._holdTime!==null&&(this.currentTime=this._holdTime),h&&this.pause()),this._updatePromises()},_updateChildren:function(){if(this.effect&&this.playState!="idle"){var m=this.effect._timing.delay;this._childAnimations.forEach(function(h){this._arrangeChildren(h,m),this.effect instanceof window.SequenceEffect&&(m+=A.groupChildDuration(h.effect))}.bind(this))}},_setExternalAnimation:function(m){if(this.effect&&this._isGroup)for(var h=0;h1||i<0||i>1?h:function(r){function o(t,e,i){return 3*t*(1-i)*(1-i)*i+3*e*(1-i)*i*i+i*i*i}if(r<=0){var a=0;return t>0?a=e/t:!e&&i>0&&(a=n/i),a*r}if(r>=1){var s=0;return i<1?s=(n-1)/(i-1):1==i&&t<1&&(s=(e-1)/(t-1)),1+s*(r-1)}for(var u=0,c=1;u=1)return 1;var n=1/t;return(i+=e*n)-i%n}}function s(t){_||(_=document.createElement("div").style),_.animationTimingFunction="",_.animationTimingFunction=t;var e=_.animationTimingFunction;if(""==e&&n())throw new TypeError(t+" is not a valid value for easing");return e}function u(t){if("linear"==t)return h;var e=y.exec(t);if(e)return o.apply(this,e.slice(1).map(Number));var i=b.exec(t);if(i)return a(Number(i[1]),p);var n=T.exec(t);return n?a(Number(n[1]),{start:m,middle:d,end:p}[n[2]]):g[t]||h}function c(t,e,i){if(null==e)return w;var n=i.delay+t+i.endDelay;return e=Math.min(i.delay+t,n)?P:A}var l="backwards|forwards|both|none".split("|"),f="reverse|alternate|alternate-reverse".split("|"),h=function(t){return t};i.prototype={_setMember:function(e,i){this["_"+e]=i,this._effect&&(this._effect._timingInput[e]=i,this._effect._timing=t.normalizeTimingInput(this._effect._timingInput),this._effect.activeDuration=t.calculateActiveDuration(this._effect._timing),this._effect._animation&&this._effect._animation._rebuildUnderlyingAnimation())},get playbackRate(){return this._playbackRate},set delay(t){this._setMember("delay",t)},get delay(){return this._delay},set endDelay(t){this._setMember("endDelay",t)},get endDelay(){return this._endDelay},set fill(t){this._setMember("fill",t)},get fill(){return this._fill},set iterationStart(t){if((isNaN(t)||t<0)&&n())throw new TypeError("iterationStart must be a non-negative number, received: "+t);this._setMember("iterationStart",t)},get iterationStart(){return this._iterationStart},set duration(t){if("auto"!=t&&(isNaN(t)||t<0)&&n())throw new TypeError("duration must be non-negative or auto, received: "+t);this._setMember("duration",t)},get duration(){return this._duration},set direction(t){this._setMember("direction",t)},get direction(){return this._direction},set easing(t){this._easingFunction=u(s(t)),this._setMember("easing",t)},get easing(){return this._easing},set iterations(t){if((isNaN(t)||t<0)&&n())throw new TypeError("iterations must be non-negative, received: "+t);this._setMember("iterations",t)},get iterations(){return this._iterations}};var m=1,d=.5,p=0,g={ease:o(.25,.1,.25,1),"ease-in":o(.42,0,1,1),"ease-out":o(0,0,.58,1),"ease-in-out":o(.42,0,.58,1),"step-start":a(1,m),"step-middle":a(1,d),"step-end":a(1,p)},_=null,v="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",y=new RegExp("cubic-bezier\\("+v+","+v+","+v+","+v+"\\)"),b=/steps\(\s*(\d+)\s*\)/,T=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/,w=0,x=1,P=2,A=3;t.cloneTimingInput=function(t){if("number"==typeof t)return t;var e={};for(var i in t)e[i]=t[i];return e},t.makeTiming=r,t.numericTimingToObject=function(t){return"number"==typeof t&&(t=isNaN(t)?{duration:0}:{duration:t}),t},t.normalizeTimingInput=function(e,i){return r(e=t.numericTimingToObject(e),i)},t.calculateActiveDuration=function(t){return Math.abs(function(t){return 0===t.duration||0===t.iterations?0:t.duration*t.iterations}(t)/t.playbackRate)},t.calculateIterationProgress=function(t,e,i){var n=c(t,e,i),r=function(t,e,i,n,r){switch(n){case x:return"backwards"==e||"both"==e?0:null;case A:return i-r;case P:return"forwards"==e||"both"==e?t:null;case w:return null}}(t,i.fill,e,n,i.delay);if(null===r)return null;var o=function(t,e,i,n,r){var o=r;return 0===t?e!==x&&(o+=i):o+=n/t,o}(i.duration,n,i.iterations,r,i.iterationStart),a=function(t,e,i,n,r,o){var a=t===1/0?e%1:t%1;return 0!==a||i!==P||0===n||0===r&&0!==o||(a=1),a}(o,i.iterationStart,n,i.iterations,r,i.duration),s=function(t,e,i,n){return t===P&&e===1/0?1/0:1===i?Math.floor(n)-1:Math.floor(n)}(n,i.iterations,a,o),u=function(t,e,i){var n=t;if("normal"!==t&&"reverse"!==t){var r=e;"alternate-reverse"===t&&(r+=1),n="normal",r!==1/0&&r%2!=0&&(n="reverse")}return"normal"===n?i:1-i}(i.direction,s,a);return i._easingFunction(u)},t.calculatePhase=c,t.normalizeEasing=s,t.parseEasingFunction=u})(i),function(t,e){function i(t,e){return t in u&&u[t][e]||e}function n(t,e,n){if(!function(t){return"display"===t||0===t.lastIndexOf("animation",0)||0===t.lastIndexOf("transition",0)}(t)){var r=o[t];if(r)for(var s in a.style[t]=e,r){var u=r[s],c=a.style[u];n[u]=i(u,c)}else n[t]=i(t,e)}}function r(t){var e=[];for(var i in t)if(!(i in["easing","offset","composite"])){var n=t[i];Array.isArray(n)||(n=[n]);for(var r,o=n.length,a=0;a1)throw new TypeError("Keyframe offsets must be between 0 and 1.")}}else if("composite"==r){if("add"==o||"accumulate"==o)throw{type:DOMException.NOT_SUPPORTED_ERR,name:"NotSupportedError",message:"add compositing is not supported"};if("replace"!=o)throw new TypeError("Invalid composite mode "+o+".")}else o="easing"==r?t.normalizeEasing(o):""+o;n(r,o,i)}return null==i.offset&&(i.offset=null),null==i.easing&&(i.easing="linear"),i})),o=!0,a=-1/0,s=0;s=0&&t.offset<=1})),o||function(){var t=i.length;null==i[t-1].offset&&(i[t-1].offset=1),t>1&&null==i[0].offset&&(i[0].offset=0);for(var e=0,n=i[0].offset,r=1;r=t.applyFrom&&nthis._surrogateStyle.length;)this._length--,Object.defineProperty(this,this._length,{configurable:!0,enumerable:!1,value:void 0})},_set:function(e,i){this._style[e]=i,this._isAnimatedProperty[e]=!0,this._updateSvgTransformAttr&&"transform"==t.unprefixedPropertyName(e)&&(null==this._savedTransformAttr&&(this._savedTransformAttr=this._element.getAttribute("transform")),this._element.setAttribute("transform",t.transformToSvgMatrix(i)))},_clear:function(e){this._style[e]=this._surrogateStyle[e],this._updateSvgTransformAttr&&"transform"==t.unprefixedPropertyName(e)&&(this._savedTransformAttr?this._element.setAttribute("transform",this._savedTransformAttr):this._element.removeAttribute("transform"),this._savedTransformAttr=null),delete this._isAnimatedProperty[e]}},a)n.prototype[u]=function(t,e){return function(){var i=this._surrogateStyle[t].apply(this._surrogateStyle,arguments);return e&&(this._isAnimatedProperty[arguments[0]]||this._style[t].apply(this._style,arguments),this._updateIndices()),i}}(u,u in s);for(var c in document.documentElement.style)c in o||c in a||function(t){i(n.prototype,t,{get:function(){return this._surrogateStyle[t]},set:function(e){this._surrogateStyle[t]=e,this._updateIndices(),this._isAnimatedProperty[t]||(this._style[t]=e)}})}(c);t.apply=function(e,r,o){(function(t){if(!t._webAnimationsPatchedStyle){var e=new n(t);try{i(t,"style",{get:function(){return e}})}catch(e){t.style._set=function(e,i){t.style[e]=i},t.style._clear=function(e){t.style[e]=""}}t._webAnimationsPatchedStyle=t.style}})(e),e.style._set(t.propertyName(r),o)},t.clear=function(e,i){e._webAnimationsPatchedStyle&&e.style._clear(t.propertyName(i))}}(n),function(t){window.Element.prototype.animate=function(e,i){var n="";return i&&i.id&&(n=i.id),t.timeline._play(t.KeyframeEffect(this,e,i,n))}}(n),function(t,e){function i(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e)return n<.5?t:e;if(t.length==e.length){for(var r=[],o=0;o0?this._totalDuration:0),this._ensureAlive())},get currentTime(){return this._idle||this._currentTimePending?null:this._currentTime},set currentTime(t){t=+t,isNaN(t)||(e.restart(),this._paused||null==this._startTime||(this._startTime=this._timeline.currentTime-t/this._playbackRate),this._currentTimePending=!1,this._currentTime!=t&&(this._idle&&(this._idle=!1,this._paused=!0),this._tickCurrentTime(t,!0),e.applyDirtiedAnimation(this)))},get startTime(){return this._startTime},set startTime(t){t=+t,isNaN(t)||this._paused||this._idle||(this._startTime=t,this._tickCurrentTime((this._timeline.currentTime-this._startTime)*this.playbackRate),e.applyDirtiedAnimation(this))},get playbackRate(){return this._playbackRate},set playbackRate(t){if(t!=this._playbackRate){var i=this.currentTime;this._playbackRate=t,this._startTime=null,"paused"!=this.playState&&"idle"!=this.playState&&(this._finishedFlag=!1,this._idle=!1,this._ensureAlive(),e.applyDirtiedAnimation(this)),null!=i&&(this.currentTime=i)}},get _isFinished(){return!this._idle&&(this._playbackRate>0&&this._currentTime>=this._totalDuration||this._playbackRate<0&&this._currentTime<=0)},get _totalDuration(){return this._effect._totalDuration},get playState(){return this._idle?"idle":null==this._startTime&&!this._paused&&0!=this.playbackRate||this._currentTimePending?"pending":this._paused?"paused":this._isFinished?"finished":"running"},_rewind:function(){if(this._playbackRate>=0)this._currentTime=0;else{if(!(this._totalDuration<1/0))throw new DOMException("Unable to rewind negative playback rate animation with infinite duration","InvalidStateError");this._currentTime=this._totalDuration}},play:function(){this._paused=!1,(this._isFinished||this._idle)&&(this._rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this._ensureAlive(),e.applyDirtiedAnimation(this)},pause:function(){this._isFinished||this._paused||this._idle?this._idle&&(this._rewind(),this._idle=!1):this._currentTimePending=!0,this._startTime=null,this._paused=!0},finish:function(){this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this._currentTimePending=!1,e.applyDirtiedAnimation(this))},cancel:function(){this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this._effect._update(null),e.applyDirtiedAnimation(this))},reverse:function(){this.playbackRate*=-1,this.play()},addEventListener:function(t,e){"function"==typeof e&&"finish"==t&&this._finishHandlers.push(e)},removeEventListener:function(t,e){if("finish"==t){var i=this._finishHandlers.indexOf(e);i>=0&&this._finishHandlers.splice(i,1)}},_fireEvents:function(t){if(this._isFinished){if(!this._finishedFlag){var e=new n(this,this._currentTime,t),i=this._finishHandlers.concat(this.onfinish?[this.onfinish]:[]);setTimeout((function(){i.forEach((function(t){t.call(e.target,e)}))}),0),this._finishedFlag=!0}}else this._finishedFlag=!1},_tick:function(t,e){this._idle||this._paused||(null==this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this._tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this._currentTimePending=!1,this._fireEvents(t))},get _needsTick(){return this.playState in{pending:1,running:1}||!this._finishedFlag},_targetAnimations:function(){var t=this._effect._target;return t._activeAnimations||(t._activeAnimations=[]),t._activeAnimations},_markTarget:function(){var t=this._targetAnimations();-1===t.indexOf(this)&&t.push(this)},_unmarkTarget:function(){var t=this._targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)}}}(i,n),function(t,e,i){function n(t){var e=c;c=[],t1e-4?(g=.5/Math.sqrt(v),_=[(h[2][1]-h[1][2])*g,(h[0][2]-h[2][0])*g,(h[1][0]-h[0][1])*g,.25/g]):h[0][0]>h[1][1]&&h[0][0]>h[2][2]?_=[.25*(g=2*Math.sqrt(1+h[0][0]-h[1][1]-h[2][2])),(h[0][1]+h[1][0])/g,(h[0][2]+h[2][0])/g,(h[2][1]-h[1][2])/g]:h[1][1]>h[2][2]?(g=2*Math.sqrt(1+h[1][1]-h[0][0]-h[2][2]),_=[(h[0][1]+h[1][0])/g,.25*g,(h[1][2]+h[2][1])/g,(h[0][2]-h[2][0])/g]):(g=2*Math.sqrt(1+h[2][2]-h[0][0]-h[1][1]),_=[(h[0][2]+h[2][0])/g,(h[1][2]+h[2][1])/g,.25*g,(h[1][0]-h[0][1])/g]),[f,m,d,_,c]}}();t.dot=i,t.makeMatrixDecomposition=function(t){return[s(a(t))]},t.transformListToMatrix=a}(n),function(t){function e(t,e){var i=t.exec(e);if(i)return[i=t.ignoreCase?i[0].toLowerCase():i[0],e.substr(i.length)]}function i(t,e){var i=t(e=e.replace(/^\s*/,""));if(i)return[i[0],i[1].replace(/^\s*/,"")]}function n(t,e,i,n,r){for(var o=[],a=[],s=[],u=function(t,e){for(var i=t,n=e;i&&n;)i>n?i%=n:n%=i;return t*e/(i+n)}(n.length,r.length),c=0;c=1?e:"visible"}]}),["visibility"])}(n),function(t,e){function i(t){t=t.trim(),o.fillStyle="#000",o.fillStyle=t;var e=o.fillStyle;if(o.fillStyle="#fff",o.fillStyle=t,e==o.fillStyle){o.fillRect(0,0,1,1);var i=o.getImageData(0,0,1,1).data;o.clearRect(0,0,1,1);var n=i[3]/255;return[i[0]*n,i[1]*n,i[2]*n,n]}}function n(e,i){return[e,i,function(e){if(e[3])for(var i=0;i<3;i++)e[i]=Math.round((n=e[i]/e[3],Math.max(0,Math.min(255,n))));var n;return e[3]=t.numberToString(t.clamp(0,1,e[3])),"rgba("+e.join(",")+")"}]}var r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");r.width=r.height=1;var o=r.getContext("2d");t.addPropertiesHandler(i,n,["background-color","border-bottom-color","border-left-color","border-right-color","border-top-color","color","fill","flood-color","lighting-color","outline-color","stop-color","stroke","text-decoration-color"]),t.consumeColor=t.consumeParenthesised.bind(null,i),t.mergeColors=n}(n),function(t,e){function i(t){function e(){var e=a.exec(t);o=e?e[0]:void 0}function i(){if("("!==o)return function(){var t=Number(o);return e(),t}();e();var t=r();return")"!==o?NaN:(e(),t)}function n(){for(var t=i();"*"===o||"/"===o;){var n=o;e();var r=i();"*"===n?t*=r:t/=r}return t}function r(){for(var t=n();"+"===o||"-"===o;){var i=o;e();var r=n();"+"===i?t+=r:t-=r}return t}var o,a=/([\+\-\w\.]+|[\(\)\*\/])/g;return e(),r()}function n(t,e){if("0"==(e=e.trim().toLowerCase())&&"px".search(t)>=0)return{px:0};if(/^[^(]*$|^calc/.test(e)){e=e.replace(/calc\(/g,"(");var n={};e=e.replace(t,(function(t){return n[t]=null,"U"+t}));for(var r="U("+t.source+")",o=e.replace(/[-+]?(\d*\.)?\d+([Ee][-+]?\d+)?/g,"N").replace(new RegExp("N"+r,"g"),"D").replace(/\s[+-]\s/g,"O").replace(/\s/g,""),a=[/N\*(D)/g,/(N|D)[*\/]N/g,/(N|D)O\1/g,/\((N|D)\)/g],s=0;s1?"calc("+i+")":i}]}var a="px|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc",s=n.bind(null,new RegExp(a,"g")),u=n.bind(null,new RegExp(a+"|%","g")),c=n.bind(null,/deg|rad|grad|turn/g);t.parseLength=s,t.parseLengthOrPercent=u,t.consumeLengthOrPercent=t.consumeParenthesised.bind(null,u),t.parseAngle=c,t.mergeDimensions=o;var l=t.consumeParenthesised.bind(null,s),f=t.consumeRepeated.bind(void 0,l,/^/),h=t.consumeRepeated.bind(void 0,f,/^,/);t.consumeSizePairList=h;var m=t.mergeNestedRepeated.bind(void 0,r," "),d=t.mergeNestedRepeated.bind(void 0,m,",");t.mergeNonNegativeSizePair=m,t.addPropertiesHandler((function(t){var e=h(t);if(e&&""==e[1])return e[0]}),d,["background-size"]),t.addPropertiesHandler(u,r,["border-bottom-width","border-image-width","border-left-width","border-right-width","border-top-width","flex-basis","font-size","height","line-height","max-height","max-width","outline-width","width"]),t.addPropertiesHandler(u,o,["border-bottom-left-radius","border-bottom-right-radius","border-top-left-radius","border-top-right-radius","bottom","left","letter-spacing","margin-bottom","margin-left","margin-right","margin-top","min-height","min-width","outline-offset","padding-bottom","padding-left","padding-right","padding-top","perspective","right","shape-margin","stroke-dashoffset","text-indent","top","vertical-align","word-spacing"])}(n),function(t,e){function i(e){return t.consumeLengthOrPercent(e)||t.consumeToken(/^auto/,e)}function n(e){var n=t.consumeList([t.ignore(t.consumeToken.bind(null,/^rect/)),t.ignore(t.consumeToken.bind(null,/^\(/)),t.consumeRepeated.bind(null,i,/^,/),t.ignore(t.consumeToken.bind(null,/^\)/))],e);if(n&&4==n[0].length)return n[0]}var r=t.mergeWrappedNestedRepeated.bind(null,(function(t){return"rect("+t+")"}),(function(e,i){return"auto"==e||"auto"==i?[!0,!1,function(n){var r=n?e:i;if("auto"==r)return"auto";var o=t.mergeDimensions(r,r);return o[2](o[0])}]:t.mergeDimensions(e,i)}),", ");t.parseBox=n,t.mergeBoxes=r,t.addPropertiesHandler(n,r,["clip"])}(n),function(t,e){function i(t){return function(e){var i=0;return t.map((function(t){return t===c?e[i++]:t}))}}function n(t){return t}function r(e){if("none"==(e=e.toLowerCase().trim()))return[];for(var i,n=/\s*(\w+)\(([^)]*)\)/g,r=[],o=0;i=n.exec(e);){if(i.index!=o)return;o=i.index+i[0].length;var a=i[1],s=h[a];if(!s)return;var u=i[2].split(","),c=s[0];if(c.length900||e%100!=0))return e}),(function(t,i){return[t,i,e]}),["font-weight"])}(n),function(t){function e(t){var e={};for(var i in t)e[i]=-t[i];return e}function i(e){return t.consumeToken(/^(left|center|right|top|bottom)\b/i,e)||t.consumeLengthOrPercent(e)}function n(e,n){var r=t.consumeRepeated(i,/^/,n);if(r&&""==r[1]){var a=r[0];if(a[0]=a[0]||"center",a[1]=a[1]||"center",3==e&&(a[2]=a[2]||{px:0}),a.length==e){if(/top|bottom/.test(a[0])||/left|right/.test(a[1])){var s=a[0];a[0]=a[1],a[1]=s}if(/left|right|center|Object/.test(a[0])&&/top|bottom|center|Object/.test(a[1]))return a.map((function(t){return"object"==typeof t?t:o[t]}))}}}function r(n){var r=t.consumeRepeated(i,/^/,n);if(r){for(var a=r[0],s=[{"%":50},{"%":50}],u=0,c=!1,l=0;l=0&&this._cancelHandlers.splice(i,1)}else u.call(this,t,e)},o}}}(),function(t){var e=document.documentElement,i=null,n=!1;try{var r="0"==getComputedStyle(e).getPropertyValue("opacity")?"1":"0";(i=e.animate({opacity:[r,r]},{duration:1})).currentTime=0,n=getComputedStyle(e).getPropertyValue("opacity")==r}catch(t){}finally{i&&i.cancel()}if(!n){var o=window.Element.prototype.animate;window.Element.prototype.animate=function(e,i){return window.Symbol&&Symbol.iterator&&Array.prototype.from&&e[Symbol.iterator]&&(e=Array.from(e)),Array.isArray(e)||null===e||(e=t.convertToArrayForm(e)),o.call(this,e,i)}}}(i),function(t,e,i){function n(t){var i=e.timeline;i.currentTime=t,i._discardAnimations(),0==i._animations.length?o=!1:requestAnimationFrame(n)}var r=window.requestAnimationFrame;window.requestAnimationFrame=function(t){return r((function(i){e.timeline._updateAnimationsPromises(),t(i),e.timeline._updateAnimationsPromises()}))},e.AnimationTimeline=function(){this._animations=[],this.currentTime=void 0},e.AnimationTimeline.prototype={getAnimations:function(){return this._discardAnimations(),this._animations.slice()},_updateAnimationsPromises:function(){e.animationsWithPromises=e.animationsWithPromises.filter((function(t){return t._updatePromises()}))},_discardAnimations:function(){this._updateAnimationsPromises(),this._animations=this._animations.filter((function(t){return"finished"!=t.playState&&"idle"!=t.playState}))},_play:function(t){var i=new e.Animation(t,this);return this._animations.push(i),e.restartWebAnimationsNextTick(),i._updatePromises(),i._animation.play(),i._updatePromises(),i},play:function(t){return t&&t.remove(),this._play(t)}};var o=!1;e.restartWebAnimationsNextTick=function(){o||(o=!0,requestAnimationFrame(n))};var a=new e.AnimationTimeline;e.timeline=a;try{Object.defineProperty(window.document,"timeline",{configurable:!0,get:function(){return a}})}catch(t){}try{window.document.timeline=a}catch(t){}}(0,r),function(t,e,i){e.animationsWithPromises=[],e.Animation=function(e,i){if(this.id="",e&&e._id&&(this.id=e._id),this.effect=e,e&&(e._animation=this),!i)throw new Error("Animation with null timeline is not supported");this._timeline=i,this._sequenceNumber=t.sequenceNumber++,this._holdTime=0,this._paused=!1,this._isGroup=!1,this._animation=null,this._childAnimations=[],this._callback=null,this._oldPlayState="idle",this._rebuildUnderlyingAnimation(),this._animation.cancel(),this._updatePromises()},e.Animation.prototype={_updatePromises:function(){var t=this._oldPlayState,e=this.playState;return this._readyPromise&&e!==t&&("idle"==e?(this._rejectReadyPromise(),this._readyPromise=void 0):"pending"==t?this._resolveReadyPromise():"pending"==e&&(this._readyPromise=void 0)),this._finishedPromise&&e!==t&&("idle"==e?(this._rejectFinishedPromise(),this._finishedPromise=void 0):"finished"==e?this._resolveFinishedPromise():"finished"==t&&(this._finishedPromise=void 0)),this._oldPlayState=this.playState,this._readyPromise||this._finishedPromise},_rebuildUnderlyingAnimation:function(){this._updatePromises();var t,i,n,r,o=!!this._animation;o&&(t=this.playbackRate,i=this._paused,n=this.startTime,r=this.currentTime,this._animation.cancel(),this._animation._wrapper=null,this._animation=null),(!this.effect||this.effect instanceof window.KeyframeEffect)&&(this._animation=e.newUnderlyingAnimationForKeyframeEffect(this.effect),e.bindAnimationForKeyframeEffect(this)),(this.effect instanceof window.SequenceEffect||this.effect instanceof window.GroupEffect)&&(this._animation=e.newUnderlyingAnimationForGroup(this.effect),e.bindAnimationForGroup(this)),this.effect&&this.effect._onsample&&e.bindAnimationForCustomEffect(this),o&&(1!=t&&(this.playbackRate=t),null!==n?this.startTime=n:null!==r?this.currentTime=r:null!==this._holdTime&&(this.currentTime=this._holdTime),i&&this.pause()),this._updatePromises()},_updateChildren:function(){if(this.effect&&"idle"!=this.playState){var t=this.effect._timing.delay;this._childAnimations.forEach(function(i){this._arrangeChildren(i,t),this.effect instanceof window.SequenceEffect&&(t+=e.groupChildDuration(i.effect))}.bind(this))}},_setExternalAnimation:function(t){if(this.effect&&this._isGroup)for(var e=0;e !/\.map$/.test(file.path), + terser() + ), + + gulpif( + (file) => !/\.map$/.test(file.path), + size(sizeConfig) + ), ], dest: jsFolder, // Output }); @@ -157,12 +169,14 @@ tasks({ { default: gulpEsBuild, createGulpEsbuild }, { default: size }, { default: path }, - { NODE } + { NODE }, + { default: terser } ] = await Promise.all([ import("gulp-esbuild"), import("gulp-size"), import("path"), - import("./plugins/builtins.js") + import("./plugins/builtins.js"), + import("gulp-terser") ]); const __dirname = path.resolve(); @@ -182,6 +196,7 @@ tasks({ inject: [path.join(__dirname, './shims/node-shim.js')], format: "iife", }), + // terser(), size(sizeConfig), ], dest: jsFolder, // Output @@ -206,9 +221,11 @@ tasks({ const [ { default: gulpEsBuild, createGulpEsbuild }, { default: size }, + { default: terser }, ] = await Promise.all([ import("gulp-esbuild"), import("gulp-size"), + import("gulp-terser") ]); const esbuild = mode == "watch" ? createGulpEsbuild() : gulpEsBuild; @@ -221,7 +238,7 @@ tasks({ ...monacoConfig, format: "iife", }), - + // terser(), size({ gzip: true, title: "workers.min.js" @@ -234,9 +251,13 @@ tasks({ const [ { default: gulpEsBuild, createGulpEsbuild }, { default: size }, + { default: terser }, + { default: gulpif } ] = await Promise.all([ import("gulp-esbuild"), import("gulp-size"), + import("gulp-terser"), + import("gulp-if") ]); const esbuild = mode == "watch" ? createGulpEsbuild() : gulpEsBuild; @@ -250,6 +271,11 @@ tasks({ format: "esm", }), + // Filter out the .css, and .ttf files + // gulpif( + // (file) => /\.js$/.test(file.path), + // terser() + // ), size(sizeConfig), ], dest: jsFolder, // Output diff --git a/package.json b/package.json index a009a08..6bad715 100644 --- a/package.json +++ b/package.json @@ -67,11 +67,13 @@ "gulp": "^4.0.2", "gulp-changed": "^4.0.2", "gulp-esbuild": "^0.8.1", + "gulp-if": "^3.0.0", "gulp-plumber": "^1.2.1", "gulp-postcss": "^9.0.0", "gulp-pug": "^5.0.0", "gulp-rename": "^2.0.0", "gulp-size": "^4.0.1", + "gulp-terser": "^2.0.1", "husky": "^6.0.0", "lodash-es": "^4.17.21", "pnpm": "^6.7.6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6b4cc40..d476175 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,11 +24,13 @@ specifiers: gulp: ^4.0.2 gulp-changed: ^4.0.2 gulp-esbuild: ^0.8.1 + gulp-if: ^3.0.0 gulp-plumber: ^1.2.1 gulp-postcss: ^9.0.0 gulp-pug: ^5.0.0 gulp-rename: ^2.0.0 gulp-size: ^4.0.1 + gulp-terser: ^2.0.1 husky: ^6.0.0 lodash-es: ^4.17.21 memfs: ^3.2.2 @@ -95,11 +97,13 @@ devDependencies: gulp: 4.0.2 gulp-changed: 4.0.2_gulp@4.0.2 gulp-esbuild: 0.8.1 + gulp-if: 3.0.0 gulp-plumber: 1.2.1 gulp-postcss: 9.0.0_postcss@8.3.2 gulp-pug: 5.0.0 gulp-rename: 2.0.0 gulp-size: 4.0.1_gulp@4.0.2 + gulp-terser: 2.0.1 husky: 6.0.0 lodash-es: 4.17.21 pnpm: 6.7.6 @@ -2127,6 +2131,15 @@ packages: stream-shift: 1.0.1 dev: true + /duplexify/4.1.1: + resolution: {integrity: sha512-DY3xVEmVHTv1wSzKNbwoU6nVjzI369Y6sPoqfYr0/xlx3IdX2n94xIszTcjPO8W8ZIv0Wb0PXNcjuZyT4wiICA==} + dependencies: + end-of-stream: 1.4.4 + inherits: 2.0.4 + readable-stream: 3.6.0 + stream-shift: 1.0.1 + dev: true + /each-props/1.3.2: resolution: {integrity: sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA==} dependencies: @@ -2652,6 +2665,10 @@ packages: resolution: {integrity: sha1-C+4AUBiusmDQo6865ljdATbsG5k=} dev: false + /fork-stream/0.0.4: + resolution: {integrity: sha1-24Sfznf2cIpfjzhq5TOgkHtUrnA=} + dev: true + /fraction.js/4.1.1: resolution: {integrity: sha512-MHOhvvxHTfRFpF1geTK9czMIZ6xclsEor2wkIGYYq+PxcQqT7vStJqjhe6S1TenZrMZzo+wlqOufBDVepUEgPg==} dev: true @@ -3009,6 +3026,20 @@ packages: vinyl: 2.2.1 dev: true + /gulp-if/3.0.0: + resolution: {integrity: sha512-fCUEngzNiEZEK2YuPm+sdMpO6ukb8+/qzbGfJBXyNOXz85bCG7yBI+pPSl+N90d7gnLvMsarthsAImx0qy7BAw==} + dependencies: + gulp-match: 1.1.0 + ternary-stream: 3.0.0 + through2: 3.0.2 + dev: true + + /gulp-match/1.1.0: + resolution: {integrity: sha512-DlyVxa1Gj24DitY2OjEsS+X6tDpretuxD6wTfhXE/Rw2hweqc1f6D/XtsJmoiCwLWfXgR87W9ozEityPCVzGtQ==} + dependencies: + minimatch: 3.0.4 + dev: true + /gulp-plumber/1.2.1: resolution: {integrity: sha512-mctAi9msEAG7XzW5ytDVZ9PxWMzzi1pS2rBH7lA095DhMa6KEXjm+St0GOCc567pJKJ/oCvosVAZEpAey0q2eQ==} engines: {node: '>=0.10', npm: '>=1.2.10'} @@ -3069,6 +3100,16 @@ packages: through2: 4.0.2 dev: true + /gulp-terser/2.0.1: + resolution: {integrity: sha512-XCrnCXP8ovNpgLK9McJIXlgm0j3W2TsiWu7K9y3m+Sn5XZgUzi6U8MPHtS3NdLMic9poCj695N0ARJ2B6atypw==} + engines: {node: '>=10'} + dependencies: + plugin-error: 1.0.1 + terser: 5.4.0 + through2: 4.0.2 + vinyl-sourcemaps-apply: 0.2.1 + dev: true + /gulp/4.0.2: resolution: {integrity: sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA==} engines: {node: '>= 0.10'} @@ -4180,6 +4221,10 @@ packages: yargs-parser: 20.2.7 dev: true + /merge-stream/2.0.0: + resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + dev: true + /merge/2.1.1: resolution: {integrity: sha512-jz+Cfrg9GWOZbQAnDQ4hlVnQky+341Yk5ru8bZSe6sIDTCIg8n9i/u7hSQGSVOF3C7lH6mGtqjkiT9G4wFLL0w==} dev: true @@ -5894,7 +5939,6 @@ packages: dependencies: buffer-from: 1.1.1 source-map: 0.6.1 - dev: false /source-map-url/0.4.1: resolution: {integrity: sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==} @@ -6252,6 +6296,25 @@ packages: jsonify: 0.0.0 dev: false + /ternary-stream/3.0.0: + resolution: {integrity: sha512-oIzdi+UL/JdktkT+7KU5tSIQjj8pbShj3OASuvDEhm0NT5lppsm7aXWAmAq4/QMaBIyfuEcNLbAQA+HpaISobQ==} + dependencies: + duplexify: 4.1.1 + fork-stream: 0.0.4 + merge-stream: 2.0.0 + through2: 3.0.2 + dev: true + + /terser/5.4.0: + resolution: {integrity: sha512-3dZunFLbCJis9TAF2VnX+VrQLctRUmt1p3W2kCsJuZE4ZgWqh//+1MZ62EanewrqKoUf4zIaDGZAvml4UDc0OQ==} + engines: {node: '>=10'} + hasBin: true + dependencies: + commander: 2.20.3 + source-map: 0.7.3 + source-map-support: 0.5.19 + dev: true + /terser/5.7.0: resolution: {integrity: sha512-HP5/9hp2UaZt5fYkuhNBR8YyRcT8juw8+uFbAme53iN9hblvKnLUTKkmwJG6ocWpIKf8UK4DoeWG4ty0J6S6/g==} engines: {node: '>=10'} diff --git a/src/pug/layouts/layout.pug b/src/pug/layouts/layout.pug index 2d67410..1ca225f 100644 --- a/src/pug/layouts/layout.pug +++ b/src/pug/layouts/layout.pug @@ -8,7 +8,7 @@ html.dark meta(http-equiv='X-UA-Compatible' content='IE=edge') block title title bundle - a quick npm package size checker - meta(name='description' content='') + meta(name='description' content='bundle is a quick and easy way to bundle your projects, minify and see it's gzip size, it's similar to bundlephobia but does all the work locally on you computer and can treeshake and bundle multiple packages (both commonjs and esm) together, it currently doesn't support JSX, but packages without JSX are good.') meta(name="color-scheme" content="dark light") meta(name='viewport' content='width=device-width, initial-scale=1') @@ -17,7 +17,6 @@ html.dark link(rel='preconnect' href='https://fonts.gstatic.com') link(rel='stylesheet' href='./css/app.css') - //- link(href='https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&display=swap' rel='stylesheet' async) //- link(href='https://fonts.googleapis.com/css2?family=Material+Icons&family=Material+Icons+Round&display=block' rel='stylesheet' async) script(src='./js/theme.min.js' type='module' async) @@ -39,13 +38,12 @@ html.dark script(src="https://cdn.polyfill.io/v3/polyfill.min.js?features=default,es2015,es2018,Array.prototype.includes,Map,Set,Promise,Intl" async) link(rel="preload" href="./js/webanimation.min.js" as="script") - script(src="./js/webanimation-polyfill.min.js" type='module') + script(src="./js/webanimation-polyfill.min.js" type='module' async) link(rel='modulepreload' href='./js/monaco.min.js') - link(rel='modulepreload' href='./js/rollup.min.js') - - link(rel='modulepreload' href='./js/editor.min.js') - link(rel='modulepreload' href='./js/typescript.min.js') + //- link(rel='modulepreload' href='./js/rollup.min.js') + //- link(rel='modulepreload' href='./js/editor.min.js') + //- link(rel='modulepreload' href='./js/typescript.min.js') script(src='./js/main.min.js' type='module' defer) diff --git a/src/ts/main.ts b/src/ts/main.ts index 7623885..41bbb03 100644 --- a/src/ts/main.ts +++ b/src/ts/main.ts @@ -6,9 +6,9 @@ import { hit } from "countapi-js"; (async () => { try { - let { value } = await hit('bundle.js.org', 'visits'); - let visitCounterEl = document.querySelector("#visit-counter"); - if (visitCounterEl) visitCounterEl.textContent = `${value} Page Visits`; + // let { value } = await hit('bundle.js.org', 'visits'); + // let visitCounterEl = document.querySelector("#visit-counter"); + // if (visitCounterEl) visitCounterEl.textContent = `${value} Page Visits`; } catch (err) { console.warn("Visit Counter Error (please create a new issue in the repo)", err); }