sigpro 2.0.7 → 2.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/sigpro.js CHANGED
@@ -1 +1 @@
1
- function X({update:e,notify:n,unwatched:t}){return{link:i,unlink:s,propagate:r,checkDirty:u,shallowPropagate:l};function i(f,a,p){let c=a.depsTail;if(c!==void 0&&c.dep===f)return;let o=c!==void 0?c.nextDep:a.deps;if(o!==void 0&&o.dep===f){o.version=p,a.depsTail=o;return}let h=f.subsTail;if(h!==void 0&&h.version===p&&h.sub===a)return;let b=a.depsTail=f.subsTail={version:p,dep:f,sub:a,prevDep:c,nextDep:o,prevSub:h,nextSub:void 0};if(o!==void 0)o.prevDep=b;if(c!==void 0)c.nextDep=b;else a.deps=b;if(h!==void 0)h.nextSub=b;else f.subs=b}function s(f,a=f.sub){let{dep:p,prevDep:c,nextDep:o,nextSub:h,prevSub:b}=f;if(o!==void 0)o.prevDep=c;else a.depsTail=c;if(c!==void 0)c.nextDep=o;else a.deps=o;if(h!==void 0)h.prevSub=b;else p.subsTail=b;if(b!==void 0)b.nextSub=h;else if((p.subs=h)===void 0)t(p);return o}function r(f,a){let p=f.nextSub,c;e:do{let o=f.sub,h=o.flags;if(!(h&60)){if(o.flags=h|32,a)o.flags|=8}else if(!(h&12))h=0;else if(!(h&4))o.flags=h&-9|32;else if(!(h&48)&&d(f,o))o.flags=h|8|32,h&=1;else h=0;if(h&2)n(o);if(h&1){let b=o.subs;if(b!==void 0){let y=(f=b).nextSub;if(y!==void 0)c={value:p,prev:c},p=y;continue}}if((f=p)!==void 0){p=f.nextSub;continue}while(c!==void 0)if(f=c.value,c=c.prev,f!==void 0){p=f.nextSub;continue e}break}while(!0)}function u(f,a){let p,c=0,o=!1;e:do{let h=f.dep,b=h.flags;if(a.flags&16)o=!0;else if((b&17)===17){let y=h.subs;if(e(h)){if(y.nextSub!==void 0)l(y);o=!0}}else if((b&33)===33){p={value:f,prev:p},f=h.deps,a=h,++c;continue}if(!o){let y=f.nextDep;if(y!==void 0){f=y;continue}}while(c--){if(f=p.value,p=p.prev,o){let k=a.subs;if(e(a)){if(k.nextSub!==void 0)l(k);a=f.sub;continue}o=!1}else a.flags&=-33;a=f.sub;let y=f.nextDep;if(y!==void 0){f=y;continue e}}return o&&!!a.flags}while(!0)}function l(f){do{let a=f.sub,p=a.flags;if((p&48)===32){if(a.flags=p|16,(p&6)===2)n(a)}}while((f=f.nextSub)!==void 0)}function d(f,a){let p=a.depsTail;while(p!==void 0){if(p===f)return!0;p=p.prevDep}return!1}}var _=0,D=0,O=0,v=0,x=0,g,m=[],{link:M,unlink:C,propagate:Y,checkDirty:F,shallowPropagate:I}=X({update(e){if("getter"in e)return G(e);if("currentValue"in e)return H(e);return e.flags=1,!0},notify(e){let n=x,t=n;do if(m[n++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);x=n;while(t<--n){let i=m[t];m[t++]=m[n],m[n]=i}},unwatched(e){if("getter"in e){if(e.depsTail!==void 0)e.flags=17,U(e)}else if("currentValue"in e);else if("fn"in e)J.call(e);else j.call(e)}});function T(e){return te.bind({currentValue:e,pendingValue:e,subs:void 0,subsTail:void 0,flags:1})}function re(e){return ee.bind({value:void 0,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:0,getter:e})}function S(e){let n={fn:e,cleanup:void 0,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:6},t=g;if(g=n,t!==void 0)M(n,t,0),t.flags|=64;try{++D;let i=n.fn();n.cleanup=typeof i==="function"?i:void 0}finally{--D,g=t,n.flags&=-5}return J.bind(n)}function V(e){let n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:1},t=g;if(g=n,t!==void 0)M(n,t,0),t.flags|=64;try{e()}finally{g=t}return j.bind(n)}function ue(e){++O;try{return e()}finally{if(!--O)q()}}function G(e){if(e.flags&64){let t=e.depsTail;while(t!==void 0){let{prevDep:i,dep:s}=t;if(!("getter"in s)&&!("currentValue"in s))C(t,e);t=i}}e.depsTail=void 0,e.flags=5;let n=g;g=e;try{++_;let t=e.value;return!Object.is(t,e.value=e.getter(t))}finally{g=n,e.flags&=-5,z(e)}}function H(e){return e.flags=1,!Object.is(e.currentValue,e.currentValue=e.pendingValue)}function Z(e){let n=e.flags;if(n&16||n&32&&F(e.deps,e)){if(n&64){let i=e.depsTail;while(i!==void 0){let{prevDep:s,dep:r}=i;if(!("getter"in r)&&!("currentValue"in r))C(i,e);i=s}}if(e.cleanup){if($(e),!e.flags)return}e.depsTail=void 0,e.flags=6;let t=g;g=e;try{++_,++D;let i=e.fn();e.cleanup=typeof i==="function"?i:void 0}finally{--D,g=t,e.flags&=-5,z(e)}}else if(e.deps!==void 0)e.flags=2|n&64}function q(){try{while(v<x){let e=m[v];m[v++]=void 0,Z(e)}}finally{while(v<x){let e=m[v];m[v++]=void 0,e.flags|=10}if(v=0,x=0,m.length>64)m.length=64}}function ee(){let e=this.flags;if(e&16||e&32&&(F(this.deps,this)||(this.flags=e&-33,!1))){if(G(this)){let t=this.subs;if(t!==void 0)I(t)}}else if(!e){this.flags=5;let t=g;g=this;try{this.value=this.getter()}finally{g=t,this.flags&=-5}}let n=g;if(n!==void 0)M(this,n,_);return this.value}function te(...e){if(e.length){if(!Object.is(this.pendingValue,this.pendingValue=e[0])){this.flags=17;let n=this.subs;if(n!==void 0){if(Y(n,!!D),!O)q()}}}else{if(this.flags&16){if(H(this)){let t=this.subs;if(t!==void 0)I(t)}}let n=g;if(n!==void 0)M(this,n,_);return this.currentValue}}function $(e){let n=e.cleanup;e.cleanup=void 0;let t=g;g=void 0;try{n()}finally{g=t}}function J(){if(j.call(this),this.cleanup)$(this)}function j(){this.flags=0,U(this);let e=this.subs;if(e!==void 0)C(e)}function U(e){let n=e.depsTail;while(n!==void 0){let t=n.prevDep;C(n,e),n=t}}function z(e){let n=e.depsTail,t=n!==void 0?n.nextDep:e.deps;while(t!==void 0)t=C(t,e)}function B(e){let n=g;g=void 0;try{return e()}finally{g=n}}function le(e,n,{immediate:t=!1}={}){let i,s=!0;return S(()=>{let r=e();if(s){if(s=!1,i=r,t)B(()=>n(r,void 0));return}if(Object.is(i,r))return;let u=i;i=r,B(()=>n(r,u))})}function ae(e,n){let t=n,i;try{let r=localStorage.getItem(e);if(r!==null)t=JSON.parse(r),i=r}catch{}let s=T(t);return S(()=>{try{let r=JSON.stringify(s());if(i!==r)localStorage.setItem(e,r),i=r}catch{}}),s}var w=typeof document<"u"?document:null,ne="http://www.w3.org/2000/svg",ie=new Set("svg path circle rect line polyline polygon g defs text textPath tspan use symbol image marker ellipse foreignObject clipPath mask linearGradient radialGradient pattern filter stop animate animateMotion animateTransform view desc metadata title switch feGaussianBlur feOffset feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feFlood feFuncA feFuncB feFuncG feFuncR feImage feMerge feMergeNode feMorphology fePointLight feSpecularLighting feSpotLight feTile feTurbulence".split(" ")),se=new Set(["allowFullscreen","async","autofocus","autoplay","checked","controls","defer","disabled","formNoValidate","hidden","inert","loop","multiple","muted","noValidate","open","playsInline","readOnly","required","reversed","selected"]);function P(e,n,t,i){let s=n.toLowerCase();if(s==="innerhtml"||s==="outerhtml"||s==="srcdoc")return;if(s.startsWith("on")&&t!=null&&t!==!1)return;if(/^(href|src|action|formaction|poster|data|xlink:href)$/i.test(n)&&t!=null&&t!==!1){if(typeof t!=="string")return;try{let r=new URL(t,"https://placeholder.invalid/").protocol,u=r==="data:"&&s==="src"&&/^(img|source|video|audio|track|input)$/i.test(e.tagName)&&/^data:image\/(png|jpe?g|gif|webp|avif|bmp);/i.test(t.trim());if(!/^(https?|mailto|tel|blob):$/.test(r)&&!u)return}catch{return}}if(n==="class"||n==="className"){if(i)if(t==null||t===!1)e.removeAttribute("class");else e.setAttribute("class",t===!0?"":t);else e.className=t??"";return}if(se.has(n)&&!i&&n in e){let r=t!=null&&t!==!1;if(e[n]=r,r)e.setAttribute(n,"");else e.removeAttribute(n);return}if(t==null||t===!1){if(n==="style")e._lastStyle=void 0;e.removeAttribute(n);return}if(n==="style"){let r=e._lastStyle;if(typeof t==="string"){if(r!==void 0)e.removeAttribute("style"),e._lastStyle=void 0;e.setAttribute("style",t);return}if(typeof t==="object"){if(r){for(let u in r)if(!(u in t))if(u.startsWith("--"))e.style.removeProperty(u);else e.style[u]=""}for(let u in t){let l=t[u];if(u.startsWith("--"))if(l==null||l===!1)e.style.removeProperty(u);else e.style.setProperty(u,String(l));else e.style[u]=l==null||l===!1?"":String(l)}e._lastStyle=t;return}}if(i){e.setAttribute(n,t===!0?"":t);return}if(n in e&&typeof e[n]!=="function")e[n]=t;else e.setAttribute(n,t===!0?"":t)}function N(e){let n=[e];while(n.length){let t=n.pop();if(t._stopScope)t._stopScope(),t._stopScope=null;if(t._cln){for(let s of t._cln)s();t._cln=null}let i=t.childNodes;for(let s=0,r=i.length;s<r;s++)n.push(i[s])}}function R(e,n={},...t){if(typeof e==="function"){let l,d=V(()=>{l=e(n,t)}),f=(a)=>{if(a instanceof Node)a._stopScope=d;else if(Array.isArray(a))a.forEach(f)};return f(l),l}if(n instanceof Node||Array.isArray(n)||n!==null&&typeof n!=="object")t=[n,...t],n={};let i=ie.has(e),s=i?w.createElementNS(ne,e):w.createElement(e),r;for(let l of Object.keys(n||{})){let d=n[l];if(l==="ref"){if(typeof d==="function")d(s);else if(d!=null&&typeof d==="object")d.current=s;continue}if(e==="select"&&l==="value"){r=d;continue}if(l.startsWith("on")&&typeof d==="function"){let f=l.slice(2).toLowerCase();s.addEventListener(f,d),(s._cln||(s._cln=[])).push(()=>s.removeEventListener(f,d))}else if(typeof d==="function")S(()=>P(s,l,d(),i));else P(s,l,d,i)}let u=(l)=>{if(Array.isArray(l)){for(let d of l)u(d);return}if(l==null||l===!1||l===!0)return;if(typeof l==="function"){let d=w.createComment("");s.appendChild(d);let f=S(()=>{let a=l(),p=Array.isArray(a)?a:[a],c=[];for(let o of p){if(o==null||o===!1||o===!0)continue;c.push(o instanceof Node?o:w.createTextNode(String(o)))}for(let o of c)s.insertBefore(o,d);return()=>{for(let o of c)N(o),o.remove()}});(s._cln||(s._cln=[])).push(f);return}s.appendChild(l instanceof Node?l:w.createTextNode(String(l)))};if(u(t),r!==void 0)if(typeof r==="function")S(()=>P(s,"value",r(),i));else P(s,"value",r,i);return s}function ce(e,n){let t=typeof n==="string"?w.querySelector(n):n;if(!t)return()=>{};let i,s=V(()=>{i=R(e,{})}),r=(Array.isArray(i)?i:[i]).filter((u)=>u!=null&&u!==!1&&u!==!0).map((u)=>u instanceof Node?u:w.createTextNode(String(u)));while(t.firstChild)N(t.firstChild),t.removeChild(t.firstChild);for(let u of r)t.appendChild(u);return()=>{s();for(let u of r)N(u);t.replaceChildren()}}function de(e){if(!(e instanceof Node))return;if(N(e),e.parentNode)e.parentNode.removeChild(e)}var fe="a abbr article aside audio b blockquote br button canvas caption cite code col colgroup datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 header hr i iframe img input ins kbd label legend li main mark meter nav object ol optgroup option output p picture pre progress section select slot small source span strong sub summary sup table tbody td template textarea tfoot th thead time tr u ul video",pe=(e=typeof window<"u"?window:null)=>{if(!e)return;for(let n of fe.split(" "))e[n]=(t,...i)=>R(n,t,...i)},E=T(typeof window<"u"?window.location.hash.slice(1)||"/":"/"),oe=T({});if(typeof window<"u")window.addEventListener("hashchange",()=>{E(window.location.hash.slice(1)||"/")});var K=new Map,L=T(0);if(typeof window<"u")window.__sigpro_hmr_page__=(e,n)=>{K.set(e,n),L(L()+1)};var W=(e)=>()=>{e=[...e].sort((u,l)=>(u.path==="*")-(l.path==="*")||u.path.split("/").filter((d)=>d[0]===":").length-l.path.split("/").filter((d)=>d[0]===":").length);let n=R("div",{class:"router-hook"}),t,i,s,r=S(()=>{L();let u=E(),d=u.split(/[?#]/)[0].split("/").filter(Boolean),f=e.find((c)=>{let o=c.path.split("/").filter(Boolean);return o.length===d.length&&o.every((h,b)=>h[0]===":"||h===d[b])})||e.find((c)=>c.path==="*");if(!f){if(t)t(),t=void 0;n.replaceChildren(),i=s=void 0;return}let a={};f.path.split("/").filter(Boolean).forEach((c,o)=>{if(c[0]===":")a[c.slice(1)]=d[o]});let p=K.get(f.path)??f.component;if(u===i&&p===s)return;if(i=u,s=p,t)t();oe(a),t=V(()=>{let c=typeof p==="function"?R(p,a):p,o=c==null?[]:Array.isArray(c)?c:[c];n.replaceChildren(...o)})});return n._stopScope=()=>{if(t)t();r()},n};W.to=(e)=>{if(typeof window<"u")window.location.hash=e.replace(/^#?\/?/,"#/")};W.back=()=>{if(typeof window<"u")window.history.back()};W.path=()=>E();var Q=T("en"),A={},he=(e)=>{for(let n of Object.keys(e))A[n]||={},Object.assign(A[n],e[n])},ge=(e)=>{if(e&&A[e])Q(e)},be=(e)=>()=>A[Q()]?.[e]??e,ye=async(e,n=null,t=null,i=null)=>{if(t)t(!0);try{let s=typeof FormData<"u"&&n instanceof FormData,r=typeof Blob<"u"&&n instanceof Blob,u=typeof URLSearchParams<"u"&&n instanceof URLSearchParams,l=s||r||u,d=await fetch(e,{method:n!==null&&n!==void 0?"POST":"GET",headers:l?void 0:{"Content-Type":"application/json"},body:n==null?void 0:l?n:JSON.stringify(n),credentials:"include",signal:i});if(!d.ok)throw Object.assign(Error(`HTTP ${d.status}`),{status:d.status,statusText:d.statusText});if(d.status===204)return null;return await d.json()}finally{if(t)t(!1)}};export{le as watch,B as untrack,de as unmount,be as t,T as signal,ge as setLocale,oe as routerParams,W as router,ce as mount,ae as local,L as hmrTick,R as h,pe as exposeTags,S as effect,ye as db,E as currentPath,Q as currentLocale,re as computed,ue as batch,he as addLang};
1
+ var L;function ae(e){L=e}function k(e,t){if(L)try{L(e,t)}catch{}else console.error("[sigpro] error in",t,e)}function ee({update:e,notify:t,unwatched:n}){return{link:i,unlink:r,propagate:l,checkDirty:d,shallowPropagate:f};function i(o,u,p){let h=u.depsTail;if(h!==void 0&&h.dep===o)return;let s=h!==void 0?h.nextDep:u.deps;if(s!==void 0&&s.dep===o){s.version=p,u.depsTail=s;return}let a=o.subsTail;if(a!==void 0&&a.version===p&&a.sub===u)return;let b=u.depsTail=o.subsTail={version:p,dep:o,sub:u,prevDep:h,nextDep:s,prevSub:a,nextSub:void 0};if(s!==void 0)s.prevDep=b;if(h!==void 0)h.nextDep=b;else u.deps=b;if(a!==void 0)a.nextSub=b;else o.subs=b}function r(o,u=o.sub){let{dep:p,prevDep:h,nextDep:s,nextSub:a,prevSub:b}=o;if(s!==void 0)s.prevDep=h;else u.depsTail=h;if(h!==void 0)h.nextDep=s;else u.deps=s;if(a!==void 0)a.prevSub=b;else p.subsTail=b;if(b!==void 0)b.nextSub=a;else if((p.subs=a)===void 0)n(p);return s}function l(o,u){let p=o.nextSub,h;e:do{let s=o.sub,a=s.flags;if(!(a&60)){if(s.flags=a|32,u)s.flags|=8}else if(!(a&12))a=0;else if(!(a&4))s.flags=a&-9|32;else if(!(a&48)&&c(o,s))s.flags=a|8|32,a&=1;else a=0;if(a&2)t(s);if(a&1){let b=s.subs;if(b!==void 0){let y=(o=b).nextSub;if(y!==void 0)h={value:p,prev:h},p=y;continue}}if((o=p)!==void 0){p=o.nextSub;continue}while(h!==void 0)if(o=h.value,h=h.prev,o!==void 0){p=o.nextSub;continue e}break}while(!0)}function d(o,u){let p,h=0,s=!1;e:do{let a=o.dep,b=a.flags;if(u.flags&16)s=!0;else if((b&17)===17){let y=a.subs;if(e(a)){if(y.nextSub!==void 0)f(y);s=!0}}else if((b&33)===33){p={value:o,prev:p},o=a.deps,u=a,++h;continue}if(!s){let y=o.nextDep;if(y!==void 0){o=y;continue}}while(h--){if(o=p.value,p=p.prev,s){let H=u.subs;if(e(u)){if(H.nextSub!==void 0)f(H);u=o.sub;continue}s=!1}else u.flags&=-33;u=o.sub;let y=o.nextDep;if(y!==void 0){o=y;continue e}}return s&&!!u.flags}while(!0)}function f(o){do{let u=o.sub,p=u.flags;if((p&48)===32){if(u.flags=p|16,(p&6)===2)t(u)}}while((o=o.nextSub)!==void 0)}function c(o,u){let p=u.depsTail;while(p!==void 0){if(p===o)return!0;p=p.prevDep}return!1}}var _=0,C=0,E=0,w=0,S=0,g,m=[],{link:M,unlink:T,propagate:te,checkDirty:G,shallowPropagate:q}=ee({update(e){if("getter"in e)return U(e);if("currentValue"in e)return J(e);return e.flags=1,!0},notify(e){let t=S,n=t;do if(m[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);S=t;while(n<--t){let i=m[n];m[n++]=m[t],m[t]=i}},unwatched(e){if("getter"in e){if(e.depsTail!==void 0)e.flags=17,O(e)}else if("currentValue"in e);else if("fn"in e)Q.call(e);else B.call(e)}});function N(e){return se.bind({currentValue:e,pendingValue:e,subs:void 0,subsTail:void 0,flags:1})}function ce(e){return ie.bind({value:void 0,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:0,getter:e})}function x(e){if(typeof e!=="function")return console.error("[sigpro] effect() expects a function, got",typeof e),()=>{};let t={fn:e,cleanup:void 0,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:6},n=g;if(g=t,n!==void 0)M(t,n,0),n.flags|=64;try{++C;let i=t.fn();t.cleanup=typeof i==="function"?i:void 0}catch(i){t.flags=0,O(t),k(i,t.fn)}finally{--C,g=n,t.flags&=-5}return Q.bind(t)}function W(e){let t={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:1},n=g;if(g=t,n!==void 0)M(t,n,0),n.flags|=64;try{e()}finally{g=n}return B.bind(t)}function de(e){++E;try{return e()}finally{if(!--E)z()}}function U(e){if(e.flags&64){let n=e.depsTail;while(n!==void 0){let i=n.prevDep,r=n.dep;if(!("getter"in r)&&!("currentValue"in r))T(n,e);n=i}}e.depsTail=void 0,e.flags=5;let t=g;g=e;try{++_;let n=e.value;return!Object.is(n,e.value=e.getter(n))}finally{g=t,e.flags&=-5,X(e)}}function J(e){return e.flags=1,!Object.is(e.currentValue,e.currentValue=e.pendingValue)}function ne(e){let t=e.flags;if(t&16||t&32&&G(e.deps,e)){if(t&64){let i=e.depsTail;while(i!==void 0){let r=i.prevDep,l=i.dep;if(!("getter"in l)&&!("currentValue"in l))T(i,e);i=r}}if(e.cleanup){if(K(e),!e.flags)return}e.depsTail=void 0,e.flags=6;let n=g;g=e;try{++_,++C;let i=e.fn();e.cleanup=typeof i==="function"?i:void 0}catch(i){e.flags=0,O(e),k(i,e.fn)}finally{--C,g=n,e.flags&=-5,X(e)}}else if(e.deps!==void 0)e.flags=2|t&64}function z(){try{while(w<S){let e=m[w];m[w++]=void 0,ne(e)}}finally{while(w<S){let e=m[w];m[w++]=void 0,e.flags|=10}if(w=0,S=0,m.length>64)m.length=64}}function ie(){let e=this.flags;if(e&16||e&32&&(G(this.deps,this)||(this.flags=e&-33,!1))){if(U(this)){let n=this.subs;if(n!==void 0)q(n)}}else if(!e){this.flags=5;let n=g;g=this;try{this.value=this.getter()}finally{g=n,this.flags&=-5}}let t=g;if(t!==void 0)M(this,t,_);return this.value}function se(...e){if(e.length){if(!Object.is(this.pendingValue,this.pendingValue=e[0])){this.flags=17;let t=this.subs;if(t!==void 0){if(te(t,!!C),!E)z()}}}else{if(this.flags&16){if(J(this)){let n=this.subs;if(n!==void 0)q(n)}}let t=g;if(t!==void 0)M(this,t,_);return this.currentValue}}function K(e){let t=e.cleanup;e.cleanup=void 0;let n=g;g=void 0;try{t()}finally{g=n}}function Q(){if(B.call(this),this.cleanup)K(this)}function B(){this.flags=0,O(this);let e=this.subs;if(e!==void 0)T(e)}function O(e){let t=e.depsTail;while(t!==void 0){let n=t.prevDep;T(t,e),t=n}}function X(e){let t=e.depsTail,n=t!==void 0?t.nextDep:e.deps;while(n!==void 0)n=T(n,e)}function V(e){let t=g;g=void 0;try{return e()}finally{g=t}}function pe(e){return x(()=>{let t=V(e);return typeof t==="function"?t:void 0})}function he(e,t,{immediate:n=!1}={}){let i,r=!0;return x(()=>{let l=e();if(r){if(r=!1,i=l,n)V(()=>t(l,void 0));return}if(Object.is(i,l))return;let d=i;i=l,V(()=>t(l,d))})}function ge(e,t){let n=t,i;try{let l=localStorage.getItem(e);if(l!==null)n=JSON.parse(l),i=l}catch{}let r=N(n);return x(()=>{try{let l=JSON.stringify(r());if(i!==l)localStorage.setItem(e,l),i=l}catch{}}),r}var v=typeof document<"u"?document:null,oe="http://www.w3.org/2000/svg",re=new Set("svg path circle rect line polyline polygon g defs text textPath tspan use symbol image marker ellipse foreignObject clipPath mask linearGradient radialGradient pattern filter stop animate animateMotion animateTransform view desc metadata title switch feGaussianBlur feOffset feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feFlood feFuncA feFuncB feFuncG feFuncR feImage feMerge feMergeNode feMorphology fePointLight feSpecularLighting feSpotLight feTile feTurbulence".split(" ")),fe=new Set(["allowFullscreen","async","autofocus","autoplay","checked","controls","defer","disabled","formNoValidate","hidden","inert","loop","multiple","muted","noValidate","open","playsInline","readOnly","required","reversed","selected"]);function P(e,t,n,i){let r=t.toLowerCase();if(r==="innerhtml"||r==="outerhtml"||r==="srcdoc")return;if(r.startsWith("on")&&n!=null&&n!==!1)return;if(/^(href|src|action|formaction|poster|data|xlink:href)$/i.test(t)&&n!=null&&n!==!1){if(typeof n!=="string")return;try{let l=new URL(n,"https://placeholder.invalid/").protocol,d=l==="data:"&&r==="src"&&/^(img|source|video|audio|track|input)$/i.test(e.tagName)&&/^data:image\/(png|jpe?g|gif|webp|avif|bmp);/i.test(n.trim());if(!/^(https?|mailto|tel|blob):$/.test(l)&&!d)return}catch{return}}if(t==="class"||t==="className"){if(i)if(n==null||n===!1)e.removeAttribute("class");else e.setAttribute("class",n===!0?"":n);else e.className=n??"";return}if(fe.has(t)&&!i&&t in e){let l=n!=null&&n!==!1;if(e[t]=l,l)e.setAttribute(t,"");else e.removeAttribute(t);return}if(n==null||n===!1){if(t==="style")e._lastStyle=void 0;e.removeAttribute(t);return}if(t==="style"){let l=e._lastStyle;if(typeof n==="string"){if(l!==void 0)e.removeAttribute("style"),e._lastStyle=void 0;e.setAttribute("style",n);return}if(typeof n==="object"){if(l){for(let d in l)if(!(d in n))if(d.startsWith("--"))e.style.removeProperty(d);else e.style[d]=""}for(let d in n){let f=n[d];if(d.startsWith("--"))if(f==null||f===!1)e.style.removeProperty(d);else e.style.setProperty(d,String(f));else e.style[d]=f==null||f===!1?"":String(f)}e._lastStyle=n;return}}if(i){e.setAttribute(t,n===!0?"":n);return}if(t in e&&typeof e[t]!=="function")e[t]=n;else e.setAttribute(t,n===!0?"":n)}function D(e){let t=[e];while(t.length){let n=t.pop();if(n._stopScope)n._stopScope(),n._stopScope=null;if(n._cln){for(let r of n._cln)r();n._cln=null}let i=n.childNodes;for(let r=0,l=i.length;r<l;r++)t.push(i[r])}}function R(e,t={},...n){if(e==null)return console.error("[sigpro] h() called with no tag"),v.createComment("invalid tag");if(typeof e==="function"){let f,c=W(()=>{try{f=e(t,n)}catch(u){k(u,e),f=v.createComment("error")}}),o=(u)=>{if(u instanceof Node)u._stopScope=c;else if(Array.isArray(u))u.forEach(o)};return o(f),f}if(typeof e!=="string")return console.error("[sigpro] h() tag must be string or function, got",typeof e),v.createComment("invalid tag");if(t instanceof Node||Array.isArray(t)||t!==null&&typeof t!=="object")n=[t,...n],t={};let i=re.has(e),r=i?v.createElementNS(oe,e):v.createElement(e),l;for(let f of Object.keys(t||{})){let c=t[f];if(f==="ref"){if(typeof c==="function")c(r);else if(c!=null&&typeof c==="object")c.current=r;continue}if(e==="select"&&f==="value"){l=c;continue}if(f.startsWith("on")&&typeof c==="function"){let o=f.slice(2).toLowerCase();r.addEventListener(o,c),(r._cln||(r._cln=[])).push(()=>r.removeEventListener(o,c))}else if(f.startsWith("on")&&c!=null&&c!==!1)console.error(`[sigpro] "${f}" expects a function, got ${typeof c}`);else if(typeof c==="function")x(()=>P(r,f,c(),i));else P(r,f,c,i)}if(e==="a"&&r.target==="_blank"&&!r.rel)r.rel="noopener noreferrer";let d=(f)=>{if(Array.isArray(f)){for(let c of f)d(c);return}if(f==null||f===!1||f===!0)return;if(typeof f==="function"){let c=v.createComment("");r.appendChild(c);let o=x(()=>{let u=f(),p=Array.isArray(u)?u:[u],h=[];for(let s of p){if(s==null||s===!1||s===!0)continue;h.push(s instanceof Node?s:v.createTextNode(String(s)))}for(let s of h)r.insertBefore(s,c);return()=>{for(let s of h)D(s),s.remove()}});(r._cln||(r._cln=[])).push(o);return}r.appendChild(f instanceof Node?f:v.createTextNode(String(f)))};if(d(n),l!==void 0)if(typeof l==="function")x(()=>P(r,"value",l(),i));else P(r,"value",l,i);return r}function be(e,t){let n=typeof t==="string"?v.querySelector(t):t;if(!n)return()=>{};let i,r=W(()=>{i=R(e,{})}),l=(Array.isArray(i)?i:[i]).filter((d)=>d!=null&&d!==!1&&d!==!0).map((d)=>d instanceof Node?d:v.createTextNode(String(d)));while(n.firstChild)D(n.firstChild),n.removeChild(n.firstChild);for(let d of l)n.appendChild(d);return()=>{r();for(let d of l)D(d);n.replaceChildren()}}function ye(e){if(!(e instanceof Node))return;if(D(e),e.parentNode)e.parentNode.removeChild(e)}var le="a abbr article aside audio b blockquote br button canvas caption cite code col colgroup datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 header hr i iframe img input ins kbd label legend li main mark meter nav object ol optgroup option output p picture pre progress section select slot small source span strong sub summary sup table tbody td template textarea tfoot th thead time tr u ul video",me=(e=typeof window<"u"?window:null)=>{if(!e)return;for(let t of le.split(" "))e[t]=(n,...i)=>R(t,n,...i)},I=N(typeof window<"u"?window.location.hash.slice(1)||"/":"/"),ue=N({});if(typeof window<"u")window.addEventListener("hashchange",()=>{I(window.location.hash.slice(1)||"/")});var Y=new Map,j=N(0);if(typeof window<"u")window.__sigpro_hmr_page__=(e,t)=>{Y.set(e,t),j(j()+1)};var F=(e)=>()=>{e=[...e].sort((f,c)=>(f.path==="*")-(c.path==="*")||f.path.split("/").filter((o)=>o[0]===":").length-c.path.split("/").filter((o)=>o[0]===":").length);let t=R("div",{class:"router-hook"}),n,i,r,l=()=>{for(let f of t.childNodes)D(f);t.replaceChildren()},d=x(()=>{j();let f=I(),o=f.split(/[?#]/)[0].split("/").filter(Boolean),u=e.find((s)=>{let a=s.path.split("/").filter(Boolean);return a.length===o.length&&a.every((b,y)=>b[0]===":"||b===o[y])})||e.find((s)=>s.path==="*");if(!u){if(n)n(),n=void 0;l(),i=r=void 0;return}let p={};u.path.split("/").filter(Boolean).forEach((s,a)=>{if(s[0]===":")try{p[s.slice(1)]=decodeURIComponent(o[a])}catch{p[s.slice(1)]=o[a]}});let h=Y.get(u.path)??u.component;if(f===i&&h===r)return;if(i=f,r=h,n)n(),n=void 0;l(),ue(p),n=W(()=>{let s=typeof h==="function"?R(h,p):h,a=s==null?[]:Array.isArray(s)?s:[s];t.replaceChildren(...a)})});return t._stopScope=()=>{if(n)n(),n=void 0;d()},t};F.to=(e)=>{if(typeof window<"u")window.location.hash=e.replace(/^#?\/?/,"#/")};F.back=()=>{if(typeof window<"u")window.history.back()};F.path=()=>I();var Z=N("en"),A={},ve=(e)=>{for(let t of Object.keys(e))A[t]||={},Object.assign(A[t],e[t])},we=(e)=>{if(e&&A[e])Z(e)},xe=(e)=>()=>A[Z()]?.[e]??e,Se=async(e,t=null,n=null,i=null)=>{if(n)n(!0);try{let r=typeof FormData<"u"&&t instanceof FormData,l=typeof Blob<"u"&&t instanceof Blob,d=typeof URLSearchParams<"u"&&t instanceof URLSearchParams,f=r||l||d,c=await fetch(e,{method:t!==null&&t!==void 0?"POST":"GET",headers:f?void 0:{"Content-Type":"application/json"},body:t==null?void 0:f?t:JSON.stringify(t),credentials:"include",signal:i});if(!c.ok)throw Object.assign(Error(`HTTP ${c.status}`),{status:c.status,statusText:c.statusText});if(c.status===204||c.status===205)return null;return await c.json()}finally{if(n)n(!1)}};export{ve as addLang,de as batch,D as cleanupNode,ce as computed,Z as currentLocale,I as currentPath,Se as db,x as effect,me as exposeTags,R as h,j as hmrTick,ge as local,be as mount,ae as onError,pe as onMount,F as router,ue as routerParams,we as setLocale,N as signal,xe as t,ye as unmount,V as untrack,he as watch};