This repository was archived by the owner on Feb 18, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
1 lines (1 loc) · 1.79 KB
/
index.js
File metadata and controls
1 lines (1 loc) · 1.79 KB
1
if(!("requestAnimationFrame"in globalThis))globalThis.requestAnimationFrame=(o)=>setTimeout(o,16);var O=new Map,$=[],s,R=()=>{s=null,$.forEach((o)=>o()),$=[],O.clear()},z=()=>{if(s)cancelAnimationFrame(s);s=requestAnimationFrame(R)};queueMicrotask(R);var E=(o,f)=>new Promise((N,g)=>{let U=()=>{try{N(o())}catch(w){g(w)}};if(f){let[w,D]=f;if(!O.has(w))O.set(w,new Map);let B=O.get(w);if(B.has(D)){let C=$.indexOf(o);if(C>-1)$.splice(C,1)}B.set(D,U)}$.push(U),z()}),G=async()=>new Promise(requestAnimationFrame);var S=(o)=>o.nodeType===Node.COMMENT_NODE,J=(o)=>!/^on/i.test(o),K=(o)=>{if(/^(mailto|tel):/i.test(o))return!0;if(o.includes("://"))try{let f=new URL(o,window.location.origin);return!["http:","https:","ftp:"].includes(f.protocol)}catch(f){return!0}return!0},A=(o,f,N)=>{if(!J(f))throw new Error(`Unsafe attribute: ${f}`);if(N=String(N).trim(),!K(N))throw new Error(`Unsafe URL for ${f}: ${N}`);o.setAttribute(f,N)};var Y=(o,f,N={},g)=>E(()=>{let U=document.createElement(f);for(let[w,D]of Object.entries(N))A(U,w,D);if(g)U.textContent=g;return o.append(U),U},[o,"e"]),Z=(o)=>E(()=>{return o.remove(),null},[o,"r"]),i=(o,f)=>E(()=>{return Array.from(o.childNodes).filter((N)=>!S(N)).forEach((N)=>N.remove()),o.append(document.createTextNode(f)),o},[o,"t"]),F=(o,f,N)=>E(()=>{return A(o,f,N),o},[o,`a:${f}`]),L=(o,f)=>E(()=>{return o.removeAttribute(f),o},[o,`a:${f}`]),P=(o,f,N)=>E(()=>{return o.toggleAttribute(f,N),o},[o,`a:${f}`]),j=(o,f,N)=>E(()=>{return o.classList.toggle(f,N),o},[o,`c:${f}`]),_=(o,f,N)=>E(()=>{return o.style.setProperty(f,N),o},[o,`s:${f}`]),h=(o,f)=>E(()=>{return o.style.removeProperty(f),o},[o,`s:${f}`]),H=(o,f)=>E(()=>{return o.innerHTML=f,o},[o,"h"]);export{j as tc,P as ta,i as st,_ as ss,F as sa,h as rs,Z as re,L as ra,E as enqueue,H as dangerouslySetInnerHTML,Y as ce,G as animationFrame};