Files
sigpro/dist/sigpro.min.js
natxocc 99bf97a8d3
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 5s
sin initDX()
2026-04-16 15:35:40 +02:00

2 lines
8.6 KiB
JavaScript

(()=>{var{defineProperty:b,getOwnPropertyNames:c,getOwnPropertyDescriptor:r}=Object,t=Object.prototype.hasOwnProperty;function e(q){return this[q]}var qq=(q)=>{var J=(k??=new WeakMap).get(q),z;if(J)return J;if(J=b({},"__esModule",{value:!0}),q&&typeof q==="object"||typeof q==="function"){for(var X of c(q))if(!t.call(J,X))b(J,X,{get:e.bind(q,X),enumerable:!(z=r(q,X))||z.enumerable})}return k.set(q,J),J},k;var zq=(q)=>q;function Jq(q,J){this[q]=zq.bind(null,J)}var Kq=(q,J)=>{for(var z in J)b(q,z,{get:J[z],enumerable:!0,configurable:!0,set:Jq.bind(J,z)})};var jq={};Kq(jq,{onUnmount:()=>A,onMount:()=>l,Watch:()=>N,Tag:()=>S,Router:()=>V,Render:()=>T,Mount:()=>s,If:()=>f,For:()=>o,Batch:()=>i,Anim:()=>a,$$:()=>g,$:()=>y});var I=(q)=>typeof q==="function",w=(q)=>q&&typeof q==="object",x=Array.isArray,$=typeof document<"u"?document:null,d=(q)=>q?._isRuntime?q.container:q instanceof Node?q:$.createTextNode(q==null?"":String(q)),G=null,W=null,R=!1,F=0,O=new Set,v=new WeakMap,E=Symbol("iter"),m=new WeakMap,D=(q)=>{if(!q||q._disposed)return;q._disposed=!0;let J=[q];while(J.length){let z=J.pop();if(z._cleanups)z._cleanups.forEach((X)=>X()),z._cleanups.clear();if(z._children)z._children.forEach((X)=>J.push(X)),z._children.clear();if(z._deps)z._deps.forEach((X)=>X.delete(z)),z._deps.clear()}},l=(q)=>{if(W)(W._mounts||=[]).push(q)},A=(q)=>{if(W)(W._cleanups||=new Set).add(q)},Xq=(q)=>{let J=G;G=null;try{return q()}finally{G=J}},U=(q,J=!1)=>{let z=()=>{if(z._disposed)return;if(z._deps)z._deps.forEach((L)=>L.delete(z));if(z._cleanups)z._cleanups.forEach((L)=>L()),z._cleanups.clear();let X=G,K=W;G=W=z;try{return z._result=q()}catch(L){console.error("[SigPro]",L)}finally{G=X,W=K}};if(z._deps=z._cleanups=z._children=null,z._disposed=!1,z._isComputed=J,z._depth=G?G._depth+1:0,z._mounts=[],z._parent=W,W)(W._children||=new Set).add(z);return z},u=()=>{if(R)return;R=!0;let q=Array.from(O).sort((J,z)=>J._depth-z._depth);O.clear();for(let J of q)if(!J._disposed)J();R=!1},i=(q)=>{F++;try{return q()}finally{if(F--,F===0&&O.size>0&&!R)u()}},C=(q,J=!1)=>{if(!J&&G&&!G._disposed)q.add(G),(G._deps||=new Set).add(q);else if(J&&q.size>0){let z=!1;for(let X of q){if(X===G||X._disposed)continue;if(X._isComputed){if(X._dirty=!0,X._subs)C(X._subs,!0)}else O.add(X),z=!0}if(z&&!R&&F===0)queueMicrotask(u)}},y=(q,J=null)=>{let z=new Set;if(I(q)){let X,K=()=>{if(K._dirty){let L=G;G=K;try{let j=q();if(!Object.is(X,j))X=j,C(z,!0)}finally{G=L}K._dirty=!1}return C(z),X};if(K._isComputed=!0,K._subs=z,K._dirty=!0,K._deps=null,K._disposed=!1,K.stop=()=>{},W)A(K.stop);return K}if(J)try{q=JSON.parse(localStorage.getItem(J))??q}catch(X){}return(...X)=>{if(X.length){let K=I(X[0])?X[0](q):X[0];if(!Object.is(q,K)){if(q=K,J)localStorage.setItem(J,JSON.stringify(q));C(z,!0)}}return C(z),q}},g=(q)=>{if(!w(q))return q;let J=v.get(q);if(J)return J;let z=new Map,X=(K)=>{let L=z.get(K);if(!L)z.set(K,L=new Set);return L};return J=new Proxy(q,{get(K,L,j){if(typeof L!=="symbol")C(X(L));return g(Reflect.get(K,L,j))},set(K,L,j,Z){let B=!Reflect.has(K,L),H=Reflect.get(K,L,Z),Y=Reflect.set(K,L,j,Z);if(Y&&!Object.is(H,j)){if(C(X(L),!0),B)C(X(E),!0)}return Y},deleteProperty(K,L){let j=Reflect.deleteProperty(K,L);if(j)C(X(L),!0),C(X(E),!0);return j},ownKeys(K){return C(X(E)),Reflect.ownKeys(K)}}),v.set(q,J),J},N=(q,J)=>{if(J===void 0){let X=U(q);return X(),()=>D(X)}let z=U(()=>{let X=Array.isArray(q)?q.map((K)=>K()):q();Xq(()=>J(X))});return z(),()=>D(z)},h=(q)=>{if(q._cleanups)q._cleanups.forEach((J)=>J()),q._cleanups.clear();if(q._ownerEffect)D(q._ownerEffect);if(q.childNodes)q.childNodes.forEach(h)},Zq=/^\s*(javascript|data|vbscript):/i,Lq=(q)=>q==="src"||q==="href"||q.startsWith("on"),p=(q,J)=>{if(J==null||J===!1)return null;if(Lq(q)){let z=String(J);if(Zq.test(z))return console.warn(`[SigPro] Bloqueado protocolo peligroso en ${q}`),"#"}return J},S=(q,J={},z=[])=>{if(J instanceof Node||x(J)||!w(J))z=J,J={};if(I(q)){let j={_mounts:[],_cleanups:new Set},Z=U(()=>{let P=q(J,{children:z,emit:(Q,..._)=>J[`on${Q[0].toUpperCase()}${Q.slice(1)}`]?.(..._)});return Z._result=P,P});Z();let B=Z._result;if(B==null)return null;let H=B instanceof Node||x(B)&&B.every((P)=>P instanceof Node)?B:$.createTextNode(String(B)),Y=(P)=>{if(w(P)&&!P._isRuntime)P._mounts=Z._mounts||[],P._cleanups=Z._cleanups||new Set,P._ownerEffect=Z};return x(H)?H.forEach(Y):Y(H),H}let X=/^(svg|path|circle|rect|line|poly(line|gon)|g|defs|text(path)?|tspan|use|symbol|image|marker|ellipse)$/i.test(q),K=X?$.createElementNS("http://www.w3.org/2000/svg",q):$.createElement(q);K._cleanups=new Set;for(let j in J){if(!J.hasOwnProperty(j))continue;let Z=J[j];if(j==="ref"){I(Z)?Z(K):Z.current=K;continue}if(X&&j.startsWith("xlink:")){val==null?K.removeAttributeNS("http://www.w3.org/1999/xlink",j.slice(6)):K.setAttributeNS("http://www.w3.org/1999/xlink",j.slice(6),val);continue}if(j.startsWith("on")){let B=j.slice(2).toLowerCase();K.addEventListener(B,Z);let H=()=>K.removeEventListener(B,Z);K._cleanups.add(H),A(H)}else if(I(Z)){let B=U(()=>{let H=p(j,Z());if(j==="class")K.className=H||"";else if(H==null)K.removeAttribute(j);else if(j in K&&!X)K[j]=H;else K.setAttribute(j,H===!0?"":H)});if(B(),K._cleanups.add(()=>D(B)),A(()=>D(B)),/^(INPUT|TEXTAREA|SELECT)$/.test(K.tagName)&&(j==="value"||j==="checked")){let H=j==="checked"?"change":"input";K.addEventListener(H,(Y)=>Z(Y.target[j]))}}else{let B=p(j,Z);if(B!=null)if(j in K&&!X)K[j]=B;else K.setAttribute(j,B===!0?"":B)}}let L=(j)=>{if(x(j))return j.forEach(L);if(I(j)){let Z=$.createTextNode("");K.appendChild(Z);let B=[],H=U(()=>{let Y=j(),P=(x(Y)?Y:[Y]).map(d);B.forEach((_)=>{if(_._isRuntime)_.destroy();else h(_);if(_.parentNode)_.remove()});let Q=Z;for(let _=P.length-1;_>=0;_--){let M=P[_];if(M.parentNode!==Q.parentNode)Q.parentNode?.insertBefore(M,Q);if(M._mounts)M._mounts.forEach((n)=>n());Q=M}B=P});H(),K._cleanups.add(()=>D(H)),A(()=>D(H))}else{let Z=d(j);if(K.appendChild(Z),Z._mounts)Z._mounts.forEach((B)=>B())}};return L(z),K},T=(q)=>{let J=new Set,z=[],X=W,K=G,L=$.createElement("div");L.style.display="contents",L.setAttribute("role","presentation"),W={_cleanups:J,_mounts:z},G=null;let j=(Z)=>{if(!Z)return;if(Z._isRuntime)J.add(Z.destroy),L.appendChild(Z.container);else if(x(Z))Z.forEach(j);else L.appendChild(Z instanceof Node?Z:$.createTextNode(String(Z==null?"":Z)))};try{j(q({onCleanup:(Z)=>J.add(Z)}))}finally{W=X,G=K}return z.forEach((Z)=>Z()),{_isRuntime:!0,container:L,destroy:()=>{J.forEach((Z)=>Z()),h(L),L.remove()}}},f=(q,J,z=null)=>{let X=$.createTextNode(""),K=S("div",{style:"display:contents"},[X]),L=null;return N(()=>!!(I(q)?q():q),(j)=>{if(L)L.destroy(),L=null;let Z=j?J:z;if(Z)L=T(()=>I(Z)?Z():Z),K.insertBefore(L.container,X)}),A(()=>L?.destroy()),K},o=(q,J,z)=>{let X=$.createTextNode(""),K=S("div",{style:"display:contents"},[X]),L=new Map;return N(()=>(I(q)?q():q)||[],(j)=>{let Z=new Map,B=[],H=j||[];for(let P=0;P<H.length;P++){let Q=H[P],_=z?z(Q,P):Q?.id??P,M=L.get(_);if(!M)M=T(()=>J(Q,P));else L.delete(_);Z.set(_,M),B.push(M)}L.forEach((P)=>P.destroy());let Y=X;for(let P=B.length-1;P>=0;P--){let _=B[P].container;if(_.nextSibling!==Y)K.insertBefore(_,Y);Y=_}L=Z}),K},V=(q)=>{let J=()=>window.location.hash.slice(1)||"/",z=y(J()),X=()=>z(J());window.addEventListener("hashchange",X),A(()=>window.removeEventListener("hashchange",X));let K=S("div",{class:"router-hook"}),L=null;return N([z],()=>{let j=z(),Z=q.find((B)=>{let H=B.path.split("/").filter(Boolean),Y=j.split("/").filter(Boolean);return H.length===Y.length&&H.every((P,Q)=>P[0]===":"||P===Y[Q])})||q.find((B)=>B.path==="*");if(Z){L?.destroy();let B={};Z.path.split("/").filter(Boolean).forEach((H,Y)=>{if(H[0]===":")B[H.slice(1)]=j.split("/").filter(Boolean)[Y]}),V.params(B),L=T(()=>I(Z.component)?Z.component(B):Z.component),K.replaceChildren(L.container)}}),K};V.params=y({});V.to=(q)=>window.location.hash=q.replace(/^#?\/?/,"#/");V.back=()=>window.history.back();V.path=()=>window.location.hash.replace(/^#/,"")||"/";var a=(q,J,{enter:z,leave:X}={})=>{let K=S("div",{style:"display:contents"}),L=null,j=(Z,B)=>{let H=!1,Y=()=>!H&&(H=!0,B());if(!Z)return Y();"transitionend animationend".split(" ").map((P)=>Z.addEventListener(P,Y,{once:!0})),setTimeout(Y,500)};return N(q,(Z)=>{if(Z&&!L){let B=(L=T(J)).container.firstChild;if(K.appendChild(L.container),z&&B)B.classList.add(z),B.clientTop,B.classList.add(z+"-active"),j(B,()=>B.classList.remove(z,z+"-active"))}else if(!Z&&L){let B=L.container.firstChild,H=()=>(L?.destroy(),L=null);X&&B?(B.classList.add(X),j(B,H)):H()}}),A(()=>L?.destroy()),K},s=(q,J)=>{let z=typeof J==="string"?$.querySelector(J):J;if(!z)return;if(m.has(z))m.get(z).destroy();let X=T(I(q)?q:()=>q);return z.replaceChildren(X.container),m.set(z,X),X},Hq=Object.freeze({$:y,$$:g,Watch:N,Tag:S,Render:T,If:f,For:o,Router:V,Mount:s,onMount:l,onUnmount:A,Anim:a,Batch:i});})();