You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
54 KiB

6 months ago
  1. var e=false;var t=false;var n=[];var r=-1;function scheduler(e){queueJob(e)}function queueJob(e){n.includes(e)||n.push(e);queueFlush()}function dequeueJob(e){let t=n.indexOf(e);t!==-1&&t>r&&n.splice(t,1)}function queueFlush(){if(!t&&!e){e=true;queueMicrotask(flushJobs)}}function flushJobs(){e=false;t=true;for(let e=0;e<n.length;e++){n[e]();r=e}n.length=0;r=-1;t=false}var i;var a;var o;var s;var l=true;function disableEffectScheduling(e){l=false;e();l=true}function setReactivityEngine(e){i=e.reactive;o=e.release;a=t=>e.effect(t,{scheduler:e=>{l?scheduler(e):e()}});s=e.raw}function overrideEffect(e){a=e}function elementBoundEffect(e){let cleanup2=()=>{};let wrappedEffect=t=>{let n=a(t);if(!e._x_effects){e._x_effects=new Set;e._x_runEffects=()=>{e._x_effects.forEach((e=>e()))}}e._x_effects.add(n);cleanup2=()=>{if(n!==void 0){e._x_effects.delete(n);o(n)}};return n};return[wrappedEffect,()=>{cleanup2()}]}function watch(e,t){let n=true;let r;let i=a((()=>{let i=e();JSON.stringify(i);n?r=i:queueMicrotask((()=>{t(i,r);r=i}));n=false}));return()=>o(i)}var c=[];var u=[];var f=[];function onElAdded(e){f.push(e)}function onElRemoved(e,t){if(typeof t==="function"){e._x_cleanups||(e._x_cleanups=[]);e._x_cleanups.push(t)}else{t=e;u.push(t)}}function onAttributesAdded(e){c.push(e)}function onAttributeRemoved(e,t,n){e._x_attributeCleanups||(e._x_attributeCleanups={});e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]);e._x_attributeCleanups[t].push(n)}function cleanupAttributes(e,t){e._x_attributeCleanups&&Object.entries(e._x_attributeCleanups).forEach((([n,r])=>{if(t===void 0||t.includes(n)){r.forEach((e=>e()));delete e._x_attributeCleanups[n]}}))}function cleanupElement(e){if(e._x_cleanups)while(e._x_cleanups.length)e._x_cleanups.pop()()}var d=new MutationObserver(onMutate);var p=false;function startObservingMutations(){d.observe(document,{subtree:true,childList:true,attributes:true,attributeOldValue:true});p=true}function stopObservingMutations(){flushObserver();d.disconnect();p=false}var _=[];function flushObserver(){let e=d.takeRecords();_.push((()=>e.length>0&&onMutate(e)));let t=_.length;queueMicrotask((()=>{if(_.length===t)while(_.length>0)_.shift()()}))}function mutateDom(e){if(!p)return e();stopObservingMutations();let t=e();startObservingMutations();return t}var g=false;var m=[];function deferMutations(){g=true}function flushAndStopDeferringMutations(){g=false;onMutate(m);m=[]}function onMutate(e){if(g){m=m.concat(e);return}let t=new Set;let n=new Set;let r=new Map;let i=new Map;for(let a=0;a<e.length;a++)if(!e[a].target._x_ignoreMutationObserver){if(e[a].type==="childList"){e[a].addedNodes.forEach((e=>e.nodeType===1&&t.add(e)));e[a].removedNodes.forEach((e=>e.nodeType===1&&n.add(e)))}if(e[a].type==="attributes"){let t=e[a].target;let n=e[a].attributeName;let o=e[a].oldValue;let add2=()=>{r.has(t)||r.set(t,[]);r.get(t).push({name:n,value:t.getAttribute(n)})};let remove=()=>{i.has(t)||i.set(t,[]);i.get(t).push(n)};if(t.hasAttribute(n)&&o===null)add2();else if(t.hasAttribute(n)){remove();add2()}else remove()}}i.forEach(((e,t)=>{cleanupAttributes(t,e)}));r.forEach(((e,t)=>{c.forEach((n=>n(t,e)))}));for(let e of n)t.has(e)||u.forEach((t=>t(e)));t.forEach((e=>{e._x_ignoreSelf=true;e._x_ignore=true}));for(let e of t)if(!n.has(e)&&e.isConnected){delete e._x_ignoreSelf;delete e._x_ignore;f.forEach((t=>t(e)));e._x_ignore=true;e._x_ignoreSelf=true}t.forEach((e=>{delete e._x_ignoreSelf;delete e._x_ignore}));t=null;n=null;r=null;i=null}function scope(e){return mergeProxies(closestDataStack(e))}function addScopeToNode(e,t,n){e._x_dataStack=[t,...closestDataStack(n||e)];return()=>{e._x_dataStack=e._x_dataStack.filter((e=>e!==t))}}function closestDataStack(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot==="function"&&e instanceof ShadowRoot?closestDataStack(e.host):e.parentNode?closestDataStack(e.parentNode):[]}function mergeProxies(e){return new Proxy({objects:e},v)}var v={ownKeys({objects:e}){return Array.from(new Set(e.flatMap((e=>Object.keys(e)))))},has({objects:e},t){return t!=Symbol.unscopables&&e.some((e=>Object.proto