@preact/signals-devtools-ui 0.3.0 → 0.4.1
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/CHANGELOG.md +17 -0
- package/dist/devtools-ui.js +1 -1
- package/dist/devtools-ui.js.map +1 -1
- package/dist/devtools-ui.min.js +1 -1
- package/dist/devtools-ui.min.js.map +1 -1
- package/dist/devtools-ui.mjs +1 -1
- package/dist/devtools-ui.mjs.map +1 -1
- package/dist/devtools-ui.module.js +1 -1
- package/dist/devtools-ui.module.js.map +1 -1
- package/dist/styles.css +445 -113
- package/package.json +3 -3
- package/src/components/Graph.tsx +13 -14
- package/src/components/Header.tsx +21 -1
- package/src/components/UpdateItem.tsx +5 -2
- package/src/context.ts +75 -3
- package/src/styles.css +445 -113
- package/src/types.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @preact/signals-devtools-ui
|
|
2
2
|
|
|
3
|
+
## 0.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#872](https://github.com/preactjs/signals/pull/872) [`8848feb`](https://github.com/preactjs/signals/commit/8848feba51ec578cadc33c558ccee3f6a4310893) Thanks [@JoviDeCroock](https://github.com/JoviDeCroock)! - Dark mode in devtools
|
|
8
|
+
|
|
9
|
+
## 0.4.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#866](https://github.com/preactjs/signals/pull/866) [`00ba858`](https://github.com/preactjs/signals/commit/00ba858365c135049400607d2f3f380756c96c5d) Thanks [@JoviDeCroock](https://github.com/JoviDeCroock)! - Add special case in devtools-ui for component updates
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [[`00ba858`](https://github.com/preactjs/signals/commit/00ba858365c135049400607d2f3f380756c96c5d)]:
|
|
18
|
+
- @preact/signals-devtools-adapter@0.4.0
|
|
19
|
+
|
|
3
20
|
## 0.3.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
package/dist/devtools-ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function n(n,t){(null==t||t>n.length)&&(t=n.length);for(var i=0,e=Array(t);i<t;i++)e[i]=n[i];return e}function t(t,i){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(e)return(e=e.call(t)).next.bind(e);if(Array.isArray(t)||(e=function(t,i){if(t){if("string"==typeof t)return n(t,i);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?n(t,i):void 0}}(t))||i&&t&&"number"==typeof t.length){e&&(t=e);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(){return i=Object.assign?Object.assign.bind():function(n){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var e in i)({}).hasOwnProperty.call(i,e)&&(n[e]=i[e])}return n},i.apply(null,arguments)}var e,r,o,u,a,l,c,f,s,d,v,h,p={},g=[],m=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function b(n,t){for(var i in t)n[i]=t[i];return n}function w(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function N(n,t,i,e,u){var a={type:n,props:t,key:i,ref:e,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==u?++o:u,__i:-1,__u:0};return null==u&&null!=r.vnode&&r.vnode(a),a}function x(n){return n.children}function k(n,t){this.props=n,this.context=t}function _(n,t){if(null==t)return n.__?_(n.__,n.__i+1):null;for(var i;t<n.__k.length;t++)if(null!=(i=n.__k[t])&&null!=i.__e)return i.__e;return"function"==typeof n.type?_(n):null}function C(n){var t,i;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,t=0;t<n.__k.length;t++)if(null!=(i=n.__k[t])&&null!=i.__e){n.__e=n.__c.base=i.__e;break}return C(n)}}function M(n){(!n.__d&&(n.__d=!0)&&a.push(n)&&!S.__r++||l!=r.debounceRendering)&&((l=r.debounceRendering)||c)(S)}function S(){for(var n,t,i,e,o,u,l,c=1;a.length;)a.length>c&&a.sort(f),n=a.shift(),c=a.length,n.__d&&(i=void 0,e=void 0,o=(e=(t=n).__v).__e,u=[],l=[],t.__P&&((i=b({},e)).__v=e.__v+1,r.vnode&&r.vnode(i),I(t.__P,i,e,t.__n,t.__P.namespaceURI,32&e.__u?[o]:null,u,null==o?_(e):o,!!(32&e.__u),l),i.__v=e.__v,i.__.__k[i.__i]=i,j(u,i,l),e.__e=e.__=null,i.__e!=o&&C(i)));S.__r=0}function A(n,t,i,e,r,o,u,a,l,c,f){var s,d,v,h,m,b,w,k=e&&e.__k||g,C=t.length;for(l=function(n,t,i,e,r){var o,u,a,l,c,f=i.length,s=f,d=0;for(n.__k=new Array(r),o=0;o<r;o++)null!=(u=t[o])&&"boolean"!=typeof u&&"function"!=typeof u?(l=o+d,(u=n.__k[o]="string"==typeof u||"number"==typeof u||"bigint"==typeof u||u.constructor==String?N(null,u,null,null,null):y(u)?N(x,{children:u},null,null,null):null==u.constructor&&u.__b>0?N(u.type,u.props,u.key,u.ref?u.ref:null,u.__v):u).__=n,u.__b=n.__b+1,a=null,-1!=(c=u.__i=U(u,i,l,s))&&(s--,(a=i[c])&&(a.__u|=2)),null==a||null==a.__v?(-1==c&&(r>f?d--:r<f&&d++),"function"!=typeof u.type&&(u.__u|=4)):c!=l&&(c==l-1?d--:c==l+1?d++:(c>l?d--:d++,u.__u|=4))):n.__k[o]=null;if(s)for(o=0;o<f;o++)null!=(a=i[o])&&0==(2&a.__u)&&(a.__e==e&&(e=_(a)),$(a,a));return e}(i,t,k,l,C),s=0;s<C;s++)null!=(v=i.__k[s])&&(d=-1==v.__i?p:k[v.__i]||p,v.__i=s,b=I(n,v,d,r,o,u,a,l,c,f),h=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&R(d.ref,null,v),f.push(v.ref,v.__c||h,v)),null==m&&null!=h&&(m=h),(w=!!(4&v.__u))||d.__k===v.__k?l=P(v,l,n,w):"function"==typeof v.type&&void 0!==b?l=b:h&&(l=h.nextSibling),v.__u&=-7);return i.__e=m,l}function P(n,t,i,e){var r,o;if("function"==typeof n.type){for(r=n.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=n,t=P(r[o],t,i,e));return t}n.__e!=t&&(e&&(t&&n.type&&!t.parentNode&&(t=_(n)),i.insertBefore(n.__e,t||null)),t=n.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function U(n,t,i,e){var r,o,u,a=n.key,l=n.type,c=t[i],f=null!=c&&0==(2&c.__u);if(null===c&&null==n.key||f&&a==c.key&&l==c.type)return i;if(e>(f?1:0))for(r=i-1,o=i+1;r>=0||o<t.length;)if(null!=(c=t[u=r>=0?r--:o++])&&0==(2&c.__u)&&a==c.key&&l==c.type)return u;return-1}function T(n,t,i){"-"==t[0]?n.setProperty(t,null==i?"":i):n[t]=null==i?"":"number"!=typeof i||m.test(t)?i:i+"px"}function D(n,t,i,e,r){var o,u;n:if("style"==t)if("string"==typeof i)n.style.cssText=i;else{if("string"==typeof e&&(n.style.cssText=e=""),e)for(t in e)i&&t in i||T(n.style,t,"");if(i)for(t in i)e&&i[t]==e[t]||T(n.style,t,i[t])}else if("o"==t[0]&&"n"==t[1])o=t!=(t=t.replace(s,"$1")),u=t.toLowerCase(),t=u in n||"onFocusOut"==t||"onFocusIn"==t?u.slice(2):t.slice(2),n.l||(n.l={}),n.l[t+o]=i,i?e?i.u=e.u:(i.u=d,n.addEventListener(t,o?h:v,o)):n.removeEventListener(t,o?h:v,o);else{if("http://www.w3.org/2000/svg"==r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in n)try{n[t]=null==i?"":i;break n}catch(n){}"function"==typeof i||(null==i||!1===i&&"-"!=t[4]?n.removeAttribute(t):n.setAttribute(t,"popover"==t&&1==i?"":i))}}function E(n){return function(t){if(this.l){var i=this.l[t.type+n];if(null==t.t)t.t=d++;else if(t.t<i.u)return;return i(r.event?r.event(t):t)}}}function I(n,t,i,e,o,u,a,l,c,f){var s,d,v,h,p,g,m,N,_,C,M,S,P,U,T,D,E,I=t.type;if(null!=t.constructor)return null;128&i.__u&&(c=!!(32&i.__u),u=[l=t.__e=i.__e]),(s=r.__b)&&s(t);n:if("function"==typeof I)try{if(N=t.props,_="prototype"in I&&I.prototype.render,C=(s=I.contextType)&&e[s.__c],M=s?C?C.props.value:s.__:e,i.__c?m=(d=t.__c=i.__c).__=d.__E:(_?t.__c=d=new I(N,M):(t.__c=d=new k(N,M),d.constructor=I,d.render=q),C&&C.sub(d),d.props=N,d.state||(d.state={}),d.context=M,d.__n=e,v=d.__d=!0,d.__h=[],d.m=[]),_&&null==d.__s&&(d.__s=d.state),_&&null!=I.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=b({},d.__s)),b(d.__s,I.getDerivedStateFromProps(N,d.__s))),h=d.props,p=d.state,d.__v=t,v)_&&null==I.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),_&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(_&&null==I.getDerivedStateFromProps&&N!==h&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(N,M),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(N,d.__s,M)||t.__v==i.__v){for(t.__v!=i.__v&&(d.props=N,d.state=d.__s,d.__d=!1),t.__e=i.__e,t.__k=i.__k,t.__k.some(function(n){n&&(n.__=t)}),S=0;S<d.m.length;S++)d.__h.push(d.m[S]);d.m=[],d.__h.length&&a.push(d);break n}null!=d.componentWillUpdate&&d.componentWillUpdate(N,d.__s,M),_&&null!=d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(h,p,g)})}if(d.context=M,d.props=N,d.__P=n,d.__e=!1,P=r.__r,U=0,_){for(d.state=d.__s,d.__d=!1,P&&P(t),s=d.render(d.props,d.state,d.context),T=0;T<d.m.length;T++)d.__h.push(d.m[T]);d.m=[]}else do{d.__d=!1,P&&P(t),s=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++U<25);d.state=d.__s,null!=d.getChildContext&&(e=b(b({},e),d.getChildContext())),_&&!v&&null!=d.getSnapshotBeforeUpdate&&(g=d.getSnapshotBeforeUpdate(h,p)),D=s,null!=s&&s.type===x&&null==s.key&&(D=F(s.props.children)),l=A(n,y(D)?D:[D],t,i,e,o,u,a,l,c,f),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),m&&(d.__E=d.__=null)}catch(n){if(t.__v=null,c||null!=u)if(n.then){for(t.__u|=c?160:128;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;u[u.indexOf(l)]=null,t.__e=l}else{for(E=u.length;E--;)w(u[E]);O(t)}else t.__e=i.__e,t.__k=i.__k,n.then||O(t);r.__e(n,t,i)}else null==u&&t.__v==i.__v?(t.__k=i.__k,t.__e=i.__e):l=t.__e=L(i.__e,t,i,e,o,u,a,c,f);return(s=r.diffed)&&s(t),128&t.__u?void 0:l}function O(n){n&&n.__c&&(n.__c.__e=!0),n&&n.__k&&n.__k.forEach(O)}function j(n,t,i){for(var e=0;e<i.length;e++)R(i[e],i[++e],i[++e]);r.__c&&r.__c(t,n),n.some(function(t){try{n=t.__h,t.__h=[],n.some(function(n){n.call(t)})}catch(n){r.__e(n,t.__v)}})}function F(n){return"object"!=typeof n||null==n||n.__b&&n.__b>0?n:y(n)?n.map(F):b({},n)}function L(n,t,i,o,u,a,l,c,f){var s,d,v,h,g,m,b,N=i.props,x=t.props,k=t.type;if("svg"==k?u="http://www.w3.org/2000/svg":"math"==k?u="http://www.w3.org/1998/Math/MathML":u||(u="http://www.w3.org/1999/xhtml"),null!=a)for(s=0;s<a.length;s++)if((g=a[s])&&"setAttribute"in g==!!k&&(k?g.localName==k:3==g.nodeType)){n=g,a[s]=null;break}if(null==n){if(null==k)return document.createTextNode(x);n=document.createElementNS(u,k,x.is&&x),c&&(r.__m&&r.__m(t,a),c=!1),a=null}if(null==k)N===x||c&&n.data==x||(n.data=x);else{if(a=a&&e.call(n.childNodes),N=i.props||p,!c&&null!=a)for(N={},s=0;s<n.attributes.length;s++)N[(g=n.attributes[s]).name]=g.value;for(s in N)if(g=N[s],"children"==s);else if("dangerouslySetInnerHTML"==s)v=g;else if(!(s in x)){if("value"==s&&"defaultValue"in x||"checked"==s&&"defaultChecked"in x)continue;D(n,s,null,g,u)}for(s in x)g=x[s],"children"==s?h=g:"dangerouslySetInnerHTML"==s?d=g:"value"==s?m=g:"checked"==s?b=g:c&&"function"!=typeof g||N[s]===g||D(n,s,g,N[s],u);if(d)c||v&&(d.__html==v.__html||d.__html==n.innerHTML)||(n.innerHTML=d.__html),t.__k=[];else if(v&&(n.innerHTML=""),A("template"==t.type?n.content:n,y(h)?h:[h],t,i,o,"foreignObject"==k?"http://www.w3.org/1999/xhtml":u,a,l,a?a[0]:i.__k&&_(i,0),c,f),null!=a)for(s=a.length;s--;)w(a[s]);c||(s="value","progress"==k&&null==m?n.removeAttribute("value"):null!=m&&(m!==n[s]||"progress"==k&&!m||"option"==k&&m!=N[s])&&D(n,s,m,N[s],u),s="checked",null!=b&&b!=n[s]&&D(n,s,b,N[s],u))}return n}function R(n,t,i){try{if("function"==typeof n){var e="function"==typeof n.__u;e&&n.__u(),e&&null==t||(n.__u=n(t))}else n.current=t}catch(n){r.__e(n,i)}}function $(n,t,i){var e,o;if(r.unmount&&r.unmount(n),(e=n.ref)&&(e.current&&e.current!=n.__e||R(e,null,t)),null!=(e=n.__c)){if(e.componentWillUnmount)try{e.componentWillUnmount()}catch(n){r.__e(n,t)}e.base=e.__P=null}if(e=n.__k)for(o=0;o<e.length;o++)e[o]&&$(e[o],t,i||"function"!=typeof n.type);i||w(n.__e),n.__c=n.__=n.__e=void 0}function q(n,t,i){return this.constructor(n,i)}function z(n,t,i){var o,u,a,l;t==document&&(t=document.documentElement),r.__&&r.__(n,t),u=(o="function"==typeof i)?null:i&&i.__k||t.__k,a=[],l=[],I(t,n=(!o&&i||t).__k=function(n,t,i){var r,o,u,a={};for(u in t)"key"==u?r=t[u]:"ref"==u?o=t[u]:a[u]=t[u];if(arguments.length>2&&(a.children=arguments.length>3?e.call(arguments,2):i),"function"==typeof n&&null!=n.defaultProps)for(u in n.defaultProps)void 0===a[u]&&(a[u]=n.defaultProps[u]);return N(n,a,r,o,null)}(x,null,[n]),u||p,p,t.namespaceURI,!o&&i?[i]:u?null:t.firstChild?e.call(t.childNodes):null,a,!o&&i?i:u?u.__e:t.firstChild,o,l),j(a,n,l)}e=g.slice,r={__e:function(n,t,i,e){for(var r,o,u;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(n)),u=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(n,e||{}),u=r.__d),u)return r.__E=r}catch(t){n=t}throw n}},o=0,u=function(n){return null!=n&&null==n.constructor},k.prototype.setState=function(n,t){var i;i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=b({},this.state),"function"==typeof n&&(n=n(b({},i),this.props)),n&&b(i,n),null!=n&&this.__v&&(t&&this.m.push(t),M(this))},k.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M(this))},k.prototype.render=x,a=[],c="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f=function(n,t){return n.__v.__b-t.__v.__b},S.__r=0,s=/(PointerCapture)$|Capture$/i,d=0,v=E(!1),h=E(!0);var H=0;function W(n,t,i,e,o,u){t||(t={});var a,l,c=t;if("ref"in c)for(l in c={},t)"ref"==l?a=t[l]:c[l]=t[l];var f={type:n,props:c,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--H,__i:-1,__u:0,__source:o,__self:u};if("function"==typeof n&&(a=n.defaultProps))for(l in a)void 0===c[l]&&(c[l]=a[l]);return r.vnode&&r.vnode(f),f}var G,J,B,V,Z=0,X=[],Y=r,K=Y.__b,Q=Y.__r,nn=Y.diffed,tn=Y.__c,en=Y.unmount,rn=Y.__;function on(n,t){Y.__h&&Y.__h(J,n,Z||t),Z=0;var i=J.__H||(J.__H={__:[],__h:[]});return n>=i.__.length&&i.__.push({}),i.__[n]}function un(n,t){var i=on(G++,3);!Y.__s&&hn(i.__H,t)&&(i.__=n,i.u=t,J.__H.__h.push(i))}function an(n){return Z=5,ln(function(){return{current:n}},[])}function ln(n,t){var i=on(G++,7);return hn(i.__H,t)&&(i.__=n(),i.__H=t,i.__h=n),i.__}function cn(){for(var n;n=X.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(dn),n.__H.__h.forEach(vn),n.__H.__h=[]}catch(t){n.__H.__h=[],Y.__e(t,n.__v)}}Y.__b=function(n){J=null,K&&K(n)},Y.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),rn&&rn(n,t)},Y.__r=function(n){Q&&Q(n),G=0;var t=(J=n.__c).__H;t&&(B===J?(t.__h=[],J.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(dn),t.__h.forEach(vn),t.__h=[],G=0)),B=J},Y.diffed=function(n){nn&&nn(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==X.push(t)&&V===Y.requestAnimationFrame||((V=Y.requestAnimationFrame)||sn)(cn)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),B=J=null},Y.__c=function(n,t){t.some(function(n){try{n.__h.forEach(dn),n.__h=n.__h.filter(function(n){return!n.__||vn(n)})}catch(i){t.some(function(n){n.__h&&(n.__h=[])}),t=[],Y.__e(i,n.__v)}}),tn&&tn(n,t)},Y.unmount=function(n){en&&en(n);var t,i=n.__c;i&&i.__H&&(i.__H.__.forEach(function(n){try{dn(n)}catch(n){t=n}}),i.__H=void 0,t&&Y.__e(t,i.__v))};var fn="function"==typeof requestAnimationFrame;function sn(n){var t,i=function(){clearTimeout(e),fn&&cancelAnimationFrame(t),setTimeout(n)},e=setTimeout(i,35);fn&&(t=requestAnimationFrame(i))}function dn(n){var t=J,i=n.__c;"function"==typeof i&&(n.__c=void 0,i()),J=t}function vn(n){var t=J;n.__c=n.__(),J=t}function hn(n,t){return!n||n.length!==t.length||t.some(function(t,i){return t!==n[i]})}function pn(n,t){return"function"==typeof t?t(n):t}var gn=Symbol.for("preact-signals");function mn(){if(!(xn>1)){var n,t=!1;while(void 0!==Nn){var i=Nn;Nn=void 0;kn++;while(void 0!==i){var e=i.o;i.o=void 0;i.f&=-3;if(!(8&i.f)&&An(i))try{i.c()}catch(i){if(!t){n=i;t=!0}}i=e}}kn=0;xn--;if(t)throw n}else xn--}function yn(n){if(xn>0)return n();xn++;try{return n()}finally{mn()}}var bn=void 0;function wn(n){var t=bn;bn=void 0;try{return n()}finally{bn=t}}var Nn=void 0,xn=0,kn=0,_n=0;function Cn(n){if(void 0!==bn){var t=n.n;if(void 0===t||t.t!==bn){t={i:0,S:n,p:bn.s,n:void 0,t:bn,e:void 0,x:void 0,r:t};if(void 0!==bn.s)bn.s.n=t;bn.s=t;n.n=t;if(32&bn.f)n.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=bn.s;t.n=void 0;bn.s.n=t;bn.s=t}return t}}}function Mn(n,t){this.v=n;this.i=0;this.n=void 0;this.t=void 0;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched;this.name=null==t?void 0:t.name}Mn.prototype.brand=gn;Mn.prototype.h=function(){return!0};Mn.prototype.S=function(n){var t=this,i=this.t;if(i!==n&&void 0===n.e){n.x=i;this.t=n;if(void 0!==i)i.e=n;else wn(function(){var n;null==(n=t.W)||n.call(t)})}};Mn.prototype.U=function(n){var t=this;if(void 0!==this.t){var i=n.e,e=n.x;if(void 0!==i){i.x=e;n.e=void 0}if(void 0!==e){e.e=i;n.x=void 0}if(n===this.t){this.t=e;if(void 0===e)wn(function(){var n;null==(n=t.Z)||n.call(t)})}}};Mn.prototype.subscribe=function(n){var t=this;return Fn(function(){var i=t.value,e=bn;bn=void 0;try{n(i)}finally{bn=e}},{name:"sub"})};Mn.prototype.valueOf=function(){return this.value};Mn.prototype.toString=function(){return this.value+""};Mn.prototype.toJSON=function(){return this.value};Mn.prototype.peek=function(){var n=bn;bn=void 0;try{return this.value}finally{bn=n}};Object.defineProperty(Mn.prototype,"value",{get:function(){var n=Cn(this);if(void 0!==n)n.i=this.i;return this.v},set:function(n){if(n!==this.v){if(kn>100)throw new Error("Cycle detected");this.v=n;this.i++;_n++;xn++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{mn()}}}});function Sn(n,t){return new Mn(n,t)}function An(n){for(var t=n.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Pn(n){for(var t=n.s;void 0!==t;t=t.n){var i=t.S.n;if(void 0!==i)t.r=i;t.S.n=t;t.i=-1;if(void 0===t.n){n.s=t;break}}}function Un(n){var t=n.s,i=void 0;while(void 0!==t){var e=t.p;if(-1===t.i){t.S.U(t);if(void 0!==e)e.n=t.n;if(void 0!==t.n)t.n.p=e}else i=t;t.S.n=t.r;if(void 0!==t.r)t.r=void 0;t=e}n.s=i}function Tn(n,t){Mn.call(this,void 0);this.x=n;this.s=void 0;this.g=_n-1;this.f=4;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched;this.name=null==t?void 0:t.name}Tn.prototype=new Mn;Tn.prototype.h=function(){this.f&=-3;if(1&this.f)return!1;if(32==(36&this.f))return!0;this.f&=-5;if(this.g===_n)return!0;this.g=_n;this.f|=1;if(this.i>0&&!An(this)){this.f&=-2;return!0}var n=bn;try{Pn(this);bn=this;var t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++}}catch(n){this.v=n;this.f|=16;this.i++}bn=n;Un(this);this.f&=-2;return!0};Tn.prototype.S=function(n){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}Mn.prototype.S.call(this,n)};Tn.prototype.U=function(n){if(void 0!==this.t){Mn.prototype.U.call(this,n);if(void 0===this.t){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}}};Tn.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var n=this.t;void 0!==n;n=n.x)n.t.N()}};Object.defineProperty(Tn.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var n=Cn(this);this.h();if(void 0!==n)n.i=this.i;if(16&this.f)throw this.v;return this.v}});function Dn(n,t){return new Tn(n,t)}function En(n){var t=n.u;n.u=void 0;if("function"==typeof t){xn++;var i=bn;bn=void 0;try{t()}catch(t){n.f&=-2;n.f|=8;In(n);throw t}finally{bn=i;mn()}}}function In(n){for(var t=n.s;void 0!==t;t=t.n)t.S.U(t);n.x=void 0;n.s=void 0;En(n)}function On(n){if(bn!==this)throw new Error("Out-of-order effect");Un(this);bn=n;this.f&=-2;if(8&this.f)In(this);mn()}function jn(n,t){this.x=n;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32;this.name=null==t?void 0:t.name}jn.prototype.c=function(){var n=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();if("function"==typeof t)this.u=t}finally{n()}};jn.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1;this.f&=-9;En(this);Pn(this);xn++;var n=bn;bn=this;return On.bind(this,n)};jn.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=Nn;Nn=this}};jn.prototype.d=function(){this.f|=8;if(!(1&this.f))In(this)};jn.prototype.dispose=function(){this.d()};function Fn(n,t){var i=new jn(n,t);try{i.c()}catch(n){i.d();throw n}var e=i.d.bind(i);e[Symbol.dispose]=e;return e}var Ln,Rn,$n,qn="undefined"!=typeof window&&!!window.__PREACT_SIGNALS_DEVTOOLS__,zn=[],Hn=[];Fn(function(){Ln=this.N})();function Wn(n,t){r[n]=t.bind(null,r[n]||function(){})}function Gn(n){if($n)$n();$n=n&&n.S()}function Jn(n){var t=this,i=n.data,e=useSignal(i);e.value=i;var r=ln(function(){var n=t,i=t.__v;while(i=i.__)if(i.__c){i.__c.__$f|=4;break}var r=Dn(function(){var n=e.value.value;return 0===n?0:!0===n?"":n||""}),o=Dn(function(){return!Array.isArray(r.value)&&!u(r.value)}),a=Fn(function(){this.N=Qn;if(o.value){var t=r.value;if(n.__v&&n.__v.__e&&3===n.__v.__e.nodeType)n.__v.__e.data=t}}),l=t.__$u.d;t.__$u.d=function(){a();l.call(this)};return[o,r]},[]),o=r[0],a=r[1];return o.value?a.peek():a.value}Jn.displayName="ReactiveTextNode";Object.defineProperties(Mn.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Jn},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Wn("__b",function(n,t){if("string"==typeof t.type){var i,e=t.props;for(var r in e)if("children"!==r){var o=e[r];if(o instanceof Mn){if(!i)t.__np=i={};i[r]=o;e[r]=o.peek()}}}n(t)});Wn("__r",function(n,t){if(t.type!==x){Gn();var i,e=t.__c;if(e){e.__$f&=-2;if(void 0===(i=e.__$u))e.__$u=i=function(n,t){var i;Fn(function(){i=this},{name:t});i.c=n;return i}(function(){var n;if(qn)null==(n=i.y)||n.call(i);e.__$f|=1;e.setState({})},"function"==typeof t.type?t.type.displayName||t.type.name:"")}Rn=e;Gn(i)}n(t)});Wn("__e",function(n,t,i,e){Gn();Rn=void 0;n(t,i,e)});Wn("diffed",function(n,t){Gn();Rn=void 0;var i;if("string"==typeof t.type&&(i=t.__e)){var e=t.__np,r=t.props;if(e){var o=i.U;if(o)for(var u in o){var a=o[u];if(void 0!==a&&!(u in e)){a.d();o[u]=void 0}}else{o={};i.U=o}for(var l in e){var c=o[l],f=e[l];if(void 0===c){c=Bn(i,l,f,r);o[l]=c}else c.o(f,r)}}}n(t)});function Bn(n,t,i,e){var r=t in n&&void 0===n.ownerSVGElement,o=Sn(i);return{o:function(n,t){o.value=n;e=t},d:Fn(function(){this.N=Qn;var i=o.value.value;if(e[t]!==i){e[t]=i;if(r)n[t]=i;else if(null!=i&&(!1!==i||"-"===t[4]))n.setAttribute(t,i);else n.removeAttribute(t)}})}}Wn("unmount",function(n,t){if("string"==typeof t.type){var i=t.__e;if(i){var e=i.U;if(e){i.U=void 0;for(var r in e){var o=e[r];if(o)o.d()}}}}else{var u=t.__c;if(u){var a=u.__$u;if(a){u.__$u=void 0;a.d()}}}n(t)});Wn("__h",function(n,t,i,e){if(e<3||9===e)t.__$f|=2;n(t,i,e)});k.prototype.shouldComponentUpdate=function(n,t){var i=this.__$u,e=i&&void 0!==i.s;for(var r in t)return!0;if(this.__f||"boolean"==typeof this.u&&!0===this.u){var o=2&this.__$f;if(!(e||o||4&this.__$f))return!0;if(1&this.__$f)return!0}else{if(!(e||4&this.__$f))return!0;if(3&this.__$f)return!0}for(var u in n)if("__source"!==u&&n[u]!==this.props[u])return!0;for(var a in this.props)if(!(a in n))return!0;return!1};function useSignal(n,t){return function(n){return Z=1,function(n,t,i){var e=on(G++,2);if(e.t=n,!e.__c&&(e.__=[i?i(t):pn(void 0,t),function(n){var t=e.__N?e.__N[0]:e.__[0],i=e.t(t,n);t!==i&&(e.__N=[i,e.__[1]],e.__c.setState({}))}],e.__c=J,!J.__f)){var r=function(n,t,i){if(!e.__c.__H)return!0;var r=e.__c.__H.__.filter(function(n){return!!n.__c});if(r.every(function(n){return!n.__N}))return!o||o.call(this,n,t,i);var u=e.__c.props!==n;return r.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(u=!0)}}),o&&o.call(this,n,t,i)||u};J.__f=!0;var o=J.shouldComponentUpdate,u=J.componentWillUpdate;J.componentWillUpdate=function(n,t,i){if(this.__e){var e=o;o=void 0,r(n,t,i),o=e}u&&u.call(this,n,t,i)},J.shouldComponentUpdate=r}return e.__N||e.__}(pn,n)}(function(){return Sn(n,t)})[0]}var Vn="undefined"==typeof requestAnimationFrame?setTimeout:function(n){var t=function(){clearTimeout(i);cancelAnimationFrame(e);n()},i=setTimeout(t,35),e=requestAnimationFrame(t)},Zn=function(n){queueMicrotask(function(){queueMicrotask(n)})};function Xn(){yn(function(){var n;while(n=zn.shift())Ln.call(n)})}function Yn(){if(1===zn.push(this))(r.requestAnimationFrame||Vn)(Xn)}function Kn(){yn(function(){var n;while(n=Hn.shift())Ln.call(n)})}function Qn(){if(1===Hn.push(this))(r.requestAnimationFrame||Zn)(Kn)}function useSignalEffect(n,t){var i=an(n);i.current=n;un(function(){return Fn(function(){this.N=Yn;return i.current()},t)},[])}function nt(n){var t=n.onClick,i=n.className,e=void 0===i?"":i,r=n.disabled,o=void 0===r?!1:r,u=n.children,a=n.variant,l=void 0===a?"secondary":a,c=n.popovertarget,f=n.active;return W("button",{popovertarget:c,onClick:t,className:("btn "+("primary"===l?"btn-primary":"btn-secondary")+" "+((void 0===f?0:f)?"active":"")+" "+e).trim(),disabled:o,children:u})}function tt(n){var t=n.onRefresh,i=n.title,e=void 0===i?"No Signals Detected":i,r=n.description,o=void 0===r?"Make sure your application is using @preact/signals-debug package.":r,u=n.buttonText,a=void 0===u?"Refresh Detection":u;return W("div",{className:"empty-state",children:W("div",{className:"empty-state-content",children:[W("h2",{children:e}),W("p",{children:o}),W("div",{className:"empty-state-actions",children:W(nt,{onClick:t,variant:"primary",children:a})})]})})}function it(n){var t=n.status,i=n.message,e=n.showIndicator,r=void 0===e?!0:e,o=n.className;return W("div",{className:"connection-status "+t+" "+(void 0===o?"":o),children:[r&&W("span",{className:"status-indicator "+t}),W("span",{className:"status-text",children:i})]})}var et=null;function rt(){if(!et)throw new Error("DevTools context not initialized. Call initDevTools() first.");return et}function ot(n){var t=Sn("connecting"),i=Sn("Connecting..."),e=Sn(!1);n.on("connectionStatusChanged",function(n){t.value=n.status;i.value=n.message});n.on("signalsAvailable",function(n){e.value=n});return{get status(){return t.value},get message(){return i.value},get isConnected(){return e.value},refreshConnection:function(){t.value="connecting";i.value="Connecting...";n.requestState()}}}var ut=function(n,t){return n.update.signalId===t.update.signalId&&n.children.length===t.children.length&&n.children.every(function(n,i){return ut(n,t.children[i])})};function at(n,e){var r=Sn([]),o=Sn(!1),u=Sn(new Set),a=function(n){if(Array.isArray(n))n.forEach(function(n){if("divider"!==n.type)n.receivedAt=Date.now()});else if("update"===n.type)n.receivedAt=Date.now();r.value=[].concat(r.value,Array.isArray(n)?n:[n])},l=Dn(function(){return r.value.length>0}),c=Dn(function(){var n=new Map;r.value.forEach(function(t){if("divider"!==t.type){var i=t.signalName||"Unknown";n.set(i,(n.get(i)||0)+1)}});return n}),f=Dn(function(){return function(n){for(var t=[],i=[],e=n.slice(-100).reverse(),r=0;r<e.length;r++){var o=e[r];if("divider"!==o.type){var u=o,a=u.depth||0,l={type:"single",id:u.signalName+"-"+u.receivedAt+"-"+r,update:u,children:[],depth:a,hasChildren:!1};while(i.length>0&&i[i.length-1].depth>=a)i.pop();if(0===i.length)t.push(l);else{var c=i[i.length-1];c.children.push(l);c.hasChildren=!0}i.push(l)}}return t}(r.value)});n.on("signalUpdate",function(n){if(!o.value){var t=[].concat(n).reverse();t.push({type:"divider"});a(t)}});n.on("signalDisposed",function(n){if(!o.value)!function(n){for(var i,e=Array.isArray(n)?n:[n],r=new Set(u.value),o=t(e);!(i=o()).done;){var a=i.value;if(a.signalId)r.add(a.signalId)}u.value=r}(n)});var s=Dn(function(){var n=f.value;if(e.settings.grouped)return function(n){for(var e,r,o=[],u=t(n);!(r=u()).done;){var a=r.value;if(!e||!ut(e,a)){o.push(a);e=a}else if("group"!==e.type){o.pop();e=i({},e,{type:"group",count:2,firstUpdate:a.update,firstChildren:a.children});o.push(e)}else{e.count++;e.firstUpdate=a.update;e.firstChildren=a.children}}return o}(n);else return n});return{updates:r,updateTree:f,collapsedUpdateTree:s,totalUpdates:Dn(function(){return Object.keys(f.value).length}),signalCounts:c,disposedSignalIds:u,addUpdate:a,clearUpdates:function(){r.value=[];u.value=new Set},hasUpdates:l,isPaused:o}}function lt(n){var t=Sn({enabled:!0,grouped:!0,consoleLogging:!0,maxUpdatesPerSecond:60,filterPatterns:[]}),i=Sn(!1);n.on("configReceived",function(n){if(n.settings)t.value=n.settings});return{get settings(){return t.value},get showDisposedSignals(){return i.value},set settings(n){t.value=n},applySettings:function(i){t.value=i;n.sendConfig(i)},toggleShowDisposedSignals:function(){i.value=!i.value}}}function ct(n){var t=lt(n),i=at(n,t),e=ot(n);return et={adapter:n,connectionStore:e,updatesStore:i,settingsStore:t}}function ft(){if(et){et.adapter.disconnect();et=null}}function st(){var n=rt(),t=n.connectionStore,i=n.updatesStore,e=function(){i.isPaused.value=!i.isPaused.value},r=function(){i.clearUpdates()};return W("header",{className:"header",children:[W("div",{className:"header-title",children:[W("h1",{children:"Signals"}),W(it,{status:t.status,message:t.message})]}),W("div",{className:"header-controls",children:[r&&W(nt,{onClick:r,children:"Clear"}),e&&W(nt,{onClick:e,active:i.isPaused.value,children:i.isPaused.value?"Resume":"Pause"}),W(nt,{popovertarget:"settings-panel-popover",children:"Settings"})]})]})}function dt(){var n=rt().settingsStore,t=an(null),e=n.applySettings,r=useSignal(n.settings);useSignalEffect(function(){r.value=n.settings});return W("div",{ref:t,popover:"auto",id:"settings-panel-popover",className:"settings-panel",children:W("div",{className:"settings-content",children:[W("h3",{children:"Debug Configuration"}),W("div",{className:"setting-group",children:W("label",{children:[W("input",{type:"checkbox",checked:r.value.enabled,onChange:function(n){return r.value=i({},r.value,{enabled:n.target.checked})}}),"Enable debug updates"]})}),W("div",{className:"setting-group",children:W("label",{children:[W("input",{type:"checkbox",checked:r.value.grouped,onChange:function(n){return r.value=i({},r.value,{grouped:n.target.checked})}}),"Group related updates"]})}),W("div",{className:"setting-group",children:[W("label",{children:[W("input",{type:"checkbox",checked:r.value.consoleLogging,onChange:function(n){return r.value=i({},r.value,{consoleLogging:n.target.checked})}}),"Enable console logging"]}),W("p",{className:"setting-description",children:"When disabled, signal updates will not be logged to the browser console."})]}),W("div",{className:"setting-group",children:[W("label",{htmlFor:"maxUpdatesInput",children:"Max updates per second:"}),W("input",{type:"number",id:"maxUpdatesInput",value:r.value.maxUpdatesPerSecond,min:"1",max:"1000",onChange:function(n){return r.value=i({},r.value,{maxUpdatesPerSecond:parseInt(n.target.value)||60})}})]}),W("div",{className:"setting-group",children:[W("label",{htmlFor:"filterPatternsInput",children:"Filter patterns (one per line):"}),W("textarea",{id:"filterPatternsInput",placeholder:"user.*\n.*State$\nglobal",value:r.value.filterPatterns.join("\n"),onChange:function(n){return r.value=i({},r.value,{filterPatterns:n.target.value.split("\n").map(function(n){return n.trim()}).filter(function(n){return n.length>0})})}})]}),W("h3",{children:"Graph Settings"}),W("div",{className:"setting-group",children:[W("label",{children:[W("input",{type:"checkbox",checked:n.showDisposedSignals,onChange:function(){return n.toggleShowDisposedSignals()}}),"Show disposed signals in graph"]}),W("p",{className:"setting-description",children:"When enabled, signals and effects that have been disposed will still be shown in the graph view."})]}),W("div",{className:"settings-actions",children:[W(nt,{onClick:function(){e(r.value)},variant:"primary",children:"Apply"}),W(nt,{onClick:function(){var n;null==(n=t.current)||n.hide()},children:"Cancel"})]})]})})}var vt=function(n){var t=document.createElement("textarea");try{t.value=n;document.body.append(t);t.select();document.execCommand("copy")}finally{t.remove()}};function ht(){var n=rt(),i=n.updatesStore,e=n.settingsStore,r=i.updates,o=i.disposedSignalIds,u=an(null),a=an(null),l=an(null),c=useSignal({x:0,y:0}),f=useSignal(1),s=useSignal(!1),d=useSignal({x:0,y:0}),v=useSignal(!1),h=useSignal(),p=useSignal(null),g=useSignal({x:0,y:0});un(function(){var n=function(n){if(v.value&&l.current&&!l.current.contains(n.target))v.value=!1};document.addEventListener("mousedown",n);return function(){document.removeEventListener("mousedown",n)}},[]);var m=function(n,t){var i=an(n);i.current=n;Rn.__$f|=4;return ln(function(){return Dn(function(){return i.current()},void 0)},[])}(function(){var n=r.value,i=o.value,u=e.showDisposedSignals;if(!n||0===n.length)return{nodes:[],links:[]};for(var a,l=new Map,c=new Map,f=n.filter(function(n){return"divider"!==n.type}),s=t(f);!(a=s()).done;){var d=a.value;if(d.signalId)if(u||!i.has(d.signalId)){var v=d.signalType;if(!l.has(d.signalId))l.set(d.signalId,{id:d.signalId,name:d.signalName,type:v,x:0,y:0,depth:0});if(d.allDependencies&&d.allDependencies.length>0)for(var h,p=t(d.allDependencies);!(h=p()).done;){var g=h.value;if(u||!i.has(g.id)){if(!l.has(g.id))l.set(g.id,{id:g.id,name:g.name,type:g.type,x:0,y:0,depth:0});var m=g.id+"->"+d.signalId;if(!c.has(m))c.set(m,{source:g.id,target:d.signalId})}}else if(d.subscribedTo){if(!u&&i.has(d.subscribedTo))continue;var y=d.subscribedTo+"->"+d.signalId;if(!c.has(y))c.set(y,{source:d.subscribedTo,target:d.signalId})}}}var b=Array.from(c.values()),w=function(n,t){var i=new Map,e=new Map,r=new Map;n.forEach(function(n,t){e.set(t,new Set);r.set(t,0)});t.forEach(function(n){var t;null==(t=e.get(n.source))||t.add(n.target);r.set(n.target,(r.get(n.target)||0)+1)});var o=[];n.forEach(function(n,t){if(0===r.get(t)){o.push(t);i.set(t,0)}});var u=function(){var n,t=o.shift(),u=i.get(t);null==(n=e.get(t))||n.forEach(function(n){var t,e=null!=(t=i.get(n))?t:0;i.set(n,Math.max(e,u+1));var a=(r.get(n)||0)-1;r.set(n,a);if(0===a)o.push(n)})};while(o.length>0)u();return i}(l,b);l.forEach(function(n,t){var i;n.depth=null!=(i=w.get(t))?i:0});var N=new Map;l.forEach(function(n){if(!N.has(n.depth))N.set(n.depth,[]);N.get(n.depth).push(n)});!function(n,t){var i=Array.from(n.keys()).sort(function(n,t){return n-t}),e=new Map,r=new Map;t.forEach(function(n){if(!e.has(n.source))e.set(n.source,[]);if(!r.has(n.target))r.set(n.target,[]);e.get(n.source).push(n.target);r.get(n.target).push(n.source)});for(var o=new Map,u=0;u<4;u++){for(var a=function(){var t=i[l],e=n.get(t);e.forEach(function(n,t){o.set(n.id,t)});if(0===l)return 1;var u=e.map(function(n){var t=r.get(n.id)||[];if(0===t.length)return 0;else return t.reduce(function(n,t){var i;return n+(null!=(i=o.get(t))?i:0)},0)/t.length}),a=e.map(function(n,t){return{node:n,barycenter:u[t]}}).sort(function(n,t){return n.barycenter-t.barycenter}).map(function(n){return n.node});n.set(t,a)},l=0;l<i.length;l++)if(!a());for(var c=function(){var t=i[f],r=n.get(t);r.forEach(function(n,t){o.set(n.id,t)});if(f===i.length-1)return 1;var u=r.map(function(n){var t=e.get(n.id)||[];if(0===t.length)return 0;else return t.reduce(function(n,t){var i;return n+(null!=(i=o.get(t))?i:0)},0)/t.length}),a=r.map(function(n,t){return{node:n,barycenter:u[t]}}).sort(function(n,t){return n.barycenter-t.barycenter}).map(function(n){return n.node});n.set(t,a)},f=i.length-1;f>=0;f--)if(!c());}}(N,b);N.forEach(function(n,t){var i=80-120*(n.length-1)/2;n.forEach(function(n,e){n.x=100+250*t;n.y=i+120*e+50*N.size})});return{nodes:Array.from(l.values()),links:b}}),y=function(){s.value=!1},b=/[^a-zA-Z0-9]/g,w=function(n){return n.replace(b,"_")},N=function(n){var t=6.5*n.name.length+16;return Math.max(30,Math.min(t/2,70))},x=function(n){var t=a.current;if(t&&p.value){var i=t.getBoundingClientRect();g.value={x:n.clientX-i.left,y:n.clientY-i.top}}},k=function(){p.value=null},_=function(n){h.value=n;setTimeout(function(){h.value=void 0},2e3)};if(0===m.value.nodes.length)return W("div",{className:"graph-empty",children:W("div",{children:[W("h3",{children:"No Signal Dependencies"}),W("p",{children:"Create some signals with dependencies to see the graph visualization."})]})});var C=Math.max.apply(Math,[800].concat(m.value.nodes.map(function(n){return n.x+100}))),M=Math.max.apply(Math,[600].concat(m.value.nodes.map(function(n){return n.y+100})));return W("div",{className:"graph-container",children:W("div",{ref:a,className:"graph-content",onMouseDown:function(n){if(0===n.button){s.value=!0;d.value={x:n.clientX-c.value.x,y:n.clientY-c.value.y}}},onMouseMove:function(n){if(s.value)c.value={x:n.clientX-d.value.x,y:n.clientY-d.value.y}},onMouseUp:y,onMouseLeave:y,onWheel:function(n){n.preventDefault();var t=a.current;if(t){var i=t.getBoundingClientRect(),e=n.clientX-i.left,r=n.clientY-i.top,o=n.deltaY>0?.96:1.04,u=Math.min(Math.max(.1,f.value*o),5),l=u/f.value;c.value={x:e-(e-c.value.x)*l,y:r-(r-c.value.y)*l};f.value=u}},style:{cursor:s.value?"grabbing":"grab"},children:[W("svg",{ref:u,className:"graph-svg",width:C,height:M,viewBox:"0 0 "+C+" "+M,children:[W("defs",{children:W("marker",{id:"arrowhead",markerWidth:"8",markerHeight:"6",refX:"7",refY:"3",orient:"auto",children:W("polygon",{points:"0 0, 8 3, 0 6",fill:"#94a3b8"})})}),W("g",{transform:"translate("+c.value.x+", "+c.value.y+") scale("+f.value+")",children:[W("g",{className:"links",children:m.value.links.map(function(n,t){var i=m.value.nodes.find(function(t){return t.id===n.source}),e=m.value.nodes.find(function(t){return t.id===n.target});if(!i||!e)return null;var r=N(i),o=N(e),u=i.x+r,a=i.y,l=e.x-o-8,c=e.y,f=u+.5*(l-u);return W("path",{className:"graph-link",d:"M "+u+" "+a+" C "+f+" "+a+", "+f+" "+c+", "+l+" "+c,fill:"none",markerEnd:"url(#arrowhead)"},"link-"+t)})}),W("g",{className:"nodes",children:m.value.nodes.map(function(n){var t,i=N(n),e=Math.floor((2*i-16)/6.5),r=n.name.length>e?n.name.slice(0,e-1)+"…":n.name;return W("g",{className:"graph-node-group "+((null==(t=p.value)?void 0:t.id)===n.id?"hovered":""),onMouseEnter:function(t){return function(n,t){p.value=n;var i=a.current;if(i){var e=i.getBoundingClientRect();g.value={x:t.clientX-e.left,y:t.clientY-e.top}}}(n,t)},onMouseMove:x,onMouseLeave:k,children:[W("circle",{className:"graph-node "+n.type,cx:n.x,cy:n.y,r:i}),W("text",{className:"graph-text",x:n.x,y:n.y,textAnchor:"middle",dominantBaseline:"central",children:r})]},n.id)})})]})]}),W("div",{className:"graph-controls",children:[W("button",{className:"graph-reset-button",onClick:function(){c.value={x:0,y:0};f.value=1},title:"Reset view",children:"⟲ Reset View"}),W("div",{ref:l,className:"graph-export-container",children:[W("button",{className:"graph-export-button",onClick:function(){v.value=!v.value},title:"Export graph",children:"↓ Export"}),v.value&&W("div",{className:"graph-export-menu",children:[W("button",{className:"graph-export-menu-item",onClick:function(){try{v.value=!1;var n=["graph LR"];m.value.nodes.forEach(function(t){var i=w(t.id),e=t.name;switch(t.type){case"signal":n.push(" "+i+"(("+e+"))");break;case"computed":n.push(" "+i+"("+e+")");break;case"effect":n.push(" "+i+"(["+e+"])")}});for(var i,e=t(m.value.links);!(i=e()).done;){var r=i.value,o=w(r.source),u=w(r.target);n.push(" "+o+" --\x3e "+u)}vt(n.join("\n"));_("Copied to clipboard!");return Promise.resolve()}catch(n){return Promise.reject(n)}},children:"Mermaid"}),W("button",{className:"graph-export-menu-item",onClick:function(){try{v.value=!1;var n=JSON.stringify(m.value,null,2);vt(n);_("Copied to clipboard!");return Promise.resolve()}catch(n){return Promise.reject(n)}},children:"JSON"})]})]}),W("div",{className:"graph-zoom-indicator",title:"Zoom level",children:[Math.round(100*f.value),"%"]})]}),h.value&&W("div",{className:"graph-toast",children:h.value}),p.value&&W("div",{className:"graph-tooltip",style:{left:g.value.x+12,top:g.value.y-8},children:[W("div",{className:"tooltip-header",children:W("span",{className:"tooltip-type "+p.value.type,children:p.value.type})}),W("div",{className:"tooltip-name",children:p.value.name}),W("div",{className:"tooltip-id",children:["ID: ",p.value.id]})]}),W("div",{className:"graph-legend",children:[W("div",{className:"legend-item",children:[W("div",{className:"legend-color",style:{backgroundColor:"#2196f3"}}),W("span",{children:"Signal"})]}),W("div",{className:"legend-item",children:[W("div",{className:"legend-color",style:{backgroundColor:"#ff9800"}}),W("span",{children:"Computed"})]}),W("div",{className:"legend-item",children:[W("div",{className:"legend-color",style:{backgroundColor:"#4caf50"}}),W("span",{children:"Effect"})]})]})]})})}function pt(n){var t=n.update,i=n.count,e=n.firstUpdate,r=new Date(t.timestamp||t.receivedAt).toLocaleTimeString(),o=function(n){if(null===n)return"null";if(void 0===n)return"undefined";if("string"==typeof n)return'"'+n+'"';if("function"==typeof n)return"function()";if("object"==typeof n)try{return JSON.stringify(n,null,0)}catch(n){return"[Object]"}return String(n)},u=i&&W("span",{class:"update-count",title:"Number of grouped identical updates",children:["x",i]});if("effect"===t.type)return W("div",{className:"update-item "+t.type,children:W("div",{className:"update-header",children:[W("span",{className:"signal-name",children:["↪️ ",t.signalName,u]}),W("span",{className:"update-time",children:r})]})});var a=o(t.prevValue),l=o(t.newValue),c=void 0!==e?o(e.prevValue):void 0;return W("div",{class:"update-item "+t.type,children:[W("div",{class:"update-header",children:[W("span",{class:"signal-name",children:[0===t.depth?"🎯":"↪️"," ",t.signalName,u]}),W("span",{class:"update-time",children:r})]}),W("div",{class:"value-change",children:[c&&c!==a&&W(x,{children:[W("span",{class:"value-prev",children:c}),W("span",{class:"value-arrow",children:"..."})]}),W("span",{class:"value-prev",children:a}),W("span",{class:"value-arrow",children:"→"}),W("span",{class:"value-new",children:l})]})]})}function gt(n){var t,e=n.node,r=useSignal(!1),o=e.children.length>0,u="group"===e.type?e.count:void 0,a="group"===e.type?e.firstUpdate:void 0;if("group"===e.type&&e.firstChildren)t=e.children.map(function(n,t){var r=e.firstChildren[t];return i({},n,{type:"group",firstUpdate:r.update,firstChildren:r.children,count:e.count})});else t=e.children;return W("div",{className:"tree-node",children:[W("div",{className:"tree-node-content",children:[o&&W("button",{className:"collapse-button",onClick:function(){r.value=!r.value},"aria-label":r.value?"Expand":"Collapse",children:r.value?"▶":"▼"}),!o&&W("div",{className:"collapse-spacer"}),W("div",{className:"update-content",children:W(pt,{update:e.update,count:u,firstUpdate:a})})]}),o&&!r.value&&W("div",{className:"tree-children",children:t.map(function(n){return W(gt,{node:n},n.id)})})]})}function mt(){var n=rt().updatesStore,t=an(null),i=n.collapsedUpdateTree.value;useSignalEffect(function(){if(t.current)t.current.scrollTop=0});return W("div",{className:"updates-container",children:[W("div",{className:"updates-header",children:W("div",{className:"updates-stats",children:[W("span",{children:["Updates: ",W("strong",{children:n.totalUpdates.value})]}),W("span",{children:["Signals: ",W("strong",{children:n.signalCounts.value.size})]})]})}),W("div",{className:"updates-list",ref:t,children:i.map(function(n){return W(gt,{node:n},n.id)})})]})}var yt=["adapter","container"];function bt(n){var t=void 0===n?{}:n,i=t.hideHeader,e=void 0===i?!1:i,r=t.initialTab,o=void 0===r?"updates":r,u=rt().connectionStore,a=useSignal(o);return W("div",{className:"signals-devtools",children:[!e&&W(st,{}),W(dt,{}),W("main",{className:"main-content",children:[W("div",{className:"tabs",children:[W("button",{className:"tab "+("updates"===a.value?"active":""),onClick:function(){return a.value="updates"},children:"Updates"}),W("button",{className:"tab "+("graph"===a.value?"active":""),onClick:function(){return a.value="graph"},children:"Dependency Graph"})]}),W("div",{className:"tab-content",children:!u.isConnected?W(tt,{onRefresh:u.refreshConnection}):W(x,{children:["updates"===a.value&&W(mt,{}),"graph"===a.value&&W(ht,{})]})})]})]})}exports.Button=nt;exports.DevToolsPanel=bt;exports.EmptyState=tt;exports.GraphVisualization=ht;exports.Header=st;exports.SettingsPanel=dt;exports.StatusIndicator=it;exports.UpdateItem=pt;exports.UpdateTreeNodeComponent=gt;exports.UpdatesContainer=mt;exports.createConnectionStore=ot;exports.createSettingsStore=lt;exports.createUpdatesStore=at;exports.destroyDevTools=ft;exports.getContext=rt;exports.initDevTools=ct;exports.mount=function(n){try{var t=n.adapter,e=n.container,r=function(n,t){if(null==n)return{};var i={};for(var e in n)if({}.hasOwnProperty.call(n,e)){if(-1!==t.indexOf(e))continue;i[e]=n[e]}return i}(n,yt);ct(t);return Promise.resolve(t.connect()).then(function(){e.innerHTML="";z(W(bt,i({},r)),e);return function(){z(null,e);ft()}})}catch(n){return Promise.reject(n)}};//# sourceMappingURL=devtools-ui.js.map
|
|
1
|
+
function n(n,t){(null==t||t>n.length)&&(t=n.length);for(var e=0,i=Array(t);e<t;e++)i[e]=n[e];return i}function t(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return n(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function e(){return e=Object.assign?Object.assign.bind():function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var i in e)({}).hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},e.apply(null,arguments)}var i,r,o,a,u,l,c,s,f,d,h,v,p={},m=[],g=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function w(n,t){for(var e in t)n[e]=t[e];return n}function b(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function N(n,t,e,i,a){var u={type:n,props:t,key:e,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==a?++o:a,__i:-1,__u:0};return null==a&&null!=r.vnode&&r.vnode(u),u}function x(n){return n.children}function k(n,t){this.props=n,this.context=t}function _(n,t){if(null==t)return n.__?_(n.__,n.__i+1):null;for(var e;t<n.__k.length;t++)if(null!=(e=n.__k[t])&&null!=e.__e)return e.__e;return"function"==typeof n.type?_(n):null}function C(n){var t,e;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,t=0;t<n.__k.length;t++)if(null!=(e=n.__k[t])&&null!=e.__e){n.__e=n.__c.base=e.__e;break}return C(n)}}function M(n){(!n.__d&&(n.__d=!0)&&u.push(n)&&!S.__r++||l!=r.debounceRendering)&&((l=r.debounceRendering)||c)(S)}function S(){for(var n,t,e,i,o,a,l,c=1;u.length;)u.length>c&&u.sort(s),n=u.shift(),c=u.length,n.__d&&(e=void 0,i=void 0,o=(i=(t=n).__v).__e,a=[],l=[],t.__P&&((e=w({},i)).__v=i.__v+1,r.vnode&&r.vnode(e),I(t.__P,e,i,t.__n,t.__P.namespaceURI,32&i.__u?[o]:null,a,null==o?_(i):o,!!(32&i.__u),l),e.__v=i.__v,e.__.__k[e.__i]=e,j(a,e,l),i.__e=i.__=null,e.__e!=o&&C(e)));S.__r=0}function A(n,t,e,i,r,o,a,u,l,c,s){var f,d,h,v,g,w,b,k=i&&i.__k||m,C=t.length;for(l=function(n,t,e,i,r){var o,a,u,l,c,s=e.length,f=s,d=0;for(n.__k=new Array(r),o=0;o<r;o++)null!=(a=t[o])&&"boolean"!=typeof a&&"function"!=typeof a?(l=o+d,(a=n.__k[o]="string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?N(null,a,null,null,null):y(a)?N(x,{children:a},null,null,null):null==a.constructor&&a.__b>0?N(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=n,a.__b=n.__b+1,u=null,-1!=(c=a.__i=P(a,e,l,f))&&(f--,(u=e[c])&&(u.__u|=2)),null==u||null==u.__v?(-1==c&&(r>s?d--:r<s&&d++),"function"!=typeof a.type&&(a.__u|=4)):c!=l&&(c==l-1?d--:c==l+1?d++:(c>l?d--:d++,a.__u|=4))):n.__k[o]=null;if(f)for(o=0;o<s;o++)null!=(u=e[o])&&0==(2&u.__u)&&(u.__e==i&&(i=_(u)),R(u,u));return i}(e,t,k,l,C),f=0;f<C;f++)null!=(h=e.__k[f])&&(d=-1==h.__i?p:k[h.__i]||p,h.__i=f,w=I(n,h,d,r,o,a,u,l,c,s),v=h.__e,h.ref&&d.ref!=h.ref&&(d.ref&&L(d.ref,null,h),s.push(h.ref,h.__c||v,h)),null==g&&null!=v&&(g=v),(b=!!(4&h.__u))||d.__k===h.__k?l=T(h,l,n,b):"function"==typeof h.type&&void 0!==w?l=w:v&&(l=v.nextSibling),h.__u&=-7);return e.__e=g,l}function T(n,t,e,i){var r,o;if("function"==typeof n.type){for(r=n.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=n,t=T(r[o],t,e,i));return t}n.__e!=t&&(i&&(t&&n.type&&!t.parentNode&&(t=_(n)),e.insertBefore(n.__e,t||null)),t=n.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function P(n,t,e,i){var r,o,a,u=n.key,l=n.type,c=t[e],s=null!=c&&0==(2&c.__u);if(null===c&&null==n.key||s&&u==c.key&&l==c.type)return e;if(i>(s?1:0))for(r=e-1,o=e+1;r>=0||o<t.length;)if(null!=(c=t[a=r>=0?r--:o++])&&0==(2&c.__u)&&u==c.key&&l==c.type)return a;return-1}function U(n,t,e){"-"==t[0]?n.setProperty(t,null==e?"":e):n[t]=null==e?"":"number"!=typeof e||g.test(t)?e:e+"px"}function D(n,t,e,i,r){var o,a;n:if("style"==t)if("string"==typeof e)n.style.cssText=e;else{if("string"==typeof i&&(n.style.cssText=i=""),i)for(t in i)e&&t in e||U(n.style,t,"");if(e)for(t in e)i&&e[t]==i[t]||U(n.style,t,e[t])}else if("o"==t[0]&&"n"==t[1])o=t!=(t=t.replace(f,"$1")),a=t.toLowerCase(),t=a in n||"onFocusOut"==t||"onFocusIn"==t?a.slice(2):t.slice(2),n.l||(n.l={}),n.l[t+o]=e,e?i?e.u=i.u:(e.u=d,n.addEventListener(t,o?v:h,o)):n.removeEventListener(t,o?v:h,o);else{if("http://www.w3.org/2000/svg"==r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in n)try{n[t]=null==e?"":e;break n}catch(n){}"function"==typeof e||(null==e||!1===e&&"-"!=t[4]?n.removeAttribute(t):n.setAttribute(t,"popover"==t&&1==e?"":e))}}function E(n){return function(t){if(this.l){var e=this.l[t.type+n];if(null==t.t)t.t=d++;else if(t.t<e.u)return;return e(r.event?r.event(t):t)}}}function I(n,t,e,o,a,u,l,c,s,f){var d,h,v,m,g,N,C,M,S,T,P,U,E,I,j,L,R,q=t.type;if(null!=t.constructor)return null;128&e.__u&&(s=!!(32&e.__u),u=[c=t.__e=e.__e]),(d=r.__b)&&d(t);n:if("function"==typeof q)try{if(M=t.props,S="prototype"in q&&q.prototype.render,T=(d=q.contextType)&&o[d.__c],P=d?T?T.props.value:d.__:o,e.__c?C=(h=t.__c=e.__c).__=h.__E:(S?t.__c=h=new q(M,P):(t.__c=h=new k(M,P),h.constructor=q,h.render=$),T&&T.sub(h),h.props=M,h.state||(h.state={}),h.context=P,h.__n=o,v=h.__d=!0,h.__h=[],h.m=[]),S&&null==h.__s&&(h.__s=h.state),S&&null!=q.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=w({},h.__s)),w(h.__s,q.getDerivedStateFromProps(M,h.__s))),m=h.props,g=h.state,h.__v=t,v)S&&null==q.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),S&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(S&&null==q.getDerivedStateFromProps&&M!==m&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(M,P),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(M,h.__s,P)||t.__v==e.__v){for(t.__v!=e.__v&&(h.props=M,h.state=h.__s,h.__d=!1),t.__e=e.__e,t.__k=e.__k,t.__k.some(function(n){n&&(n.__=t)}),U=0;U<h.m.length;U++)h.__h.push(h.m[U]);h.m=[],h.__h.length&&l.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(M,h.__s,P),S&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(m,g,N)})}if(h.context=P,h.props=M,h.__P=n,h.__e=!1,E=r.__r,I=0,S){for(h.state=h.__s,h.__d=!1,E&&E(t),d=h.render(h.props,h.state,h.context),j=0;j<h.m.length;j++)h.__h.push(h.m[j]);h.m=[]}else do{h.__d=!1,E&&E(t),d=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++I<25);h.state=h.__s,null!=h.getChildContext&&(o=w(w({},o),h.getChildContext())),S&&!v&&null!=h.getSnapshotBeforeUpdate&&(N=h.getSnapshotBeforeUpdate(m,g)),L=d,null!=d&&d.type===x&&null==d.key&&(L=F(d.props.children)),c=A(n,y(L)?L:[L],t,e,o,a,u,l,c,s,f),h.base=t.__e,t.__u&=-161,h.__h.length&&l.push(h),C&&(h.__E=h.__=null)}catch(n){if(t.__v=null,s||null!=u)if(n.then){for(t.__u|=s?160:128;c&&8==c.nodeType&&c.nextSibling;)c=c.nextSibling;u[u.indexOf(c)]=null,t.__e=c}else{for(R=u.length;R--;)b(u[R]);O(t)}else t.__e=e.__e,t.__k=e.__k,n.then||O(t);r.__e(n,t,e)}else null==u&&t.__v==e.__v?(t.__k=e.__k,t.__e=e.__e):c=t.__e=function(n,t,e,o,a,u,l,c,s){var f,d,h,v,m,g,w,N=e.props,x=t.props,k=t.type;if("svg"==k?a="http://www.w3.org/2000/svg":"math"==k?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),null!=u)for(f=0;f<u.length;f++)if((m=u[f])&&"setAttribute"in m==!!k&&(k?m.localName==k:3==m.nodeType)){n=m,u[f]=null;break}if(null==n){if(null==k)return document.createTextNode(x);n=document.createElementNS(a,k,x.is&&x),c&&(r.__m&&r.__m(t,u),c=!1),u=null}if(null==k)N===x||c&&n.data==x||(n.data=x);else{if(u=u&&i.call(n.childNodes),N=e.props||p,!c&&null!=u)for(N={},f=0;f<n.attributes.length;f++)N[(m=n.attributes[f]).name]=m.value;for(f in N)if(m=N[f],"children"==f);else if("dangerouslySetInnerHTML"==f)h=m;else if(!(f in x)){if("value"==f&&"defaultValue"in x||"checked"==f&&"defaultChecked"in x)continue;D(n,f,null,m,a)}for(f in x)m=x[f],"children"==f?v=m:"dangerouslySetInnerHTML"==f?d=m:"value"==f?g=m:"checked"==f?w=m:c&&"function"!=typeof m||N[f]===m||D(n,f,m,N[f],a);if(d)c||h&&(d.__html==h.__html||d.__html==n.innerHTML)||(n.innerHTML=d.__html),t.__k=[];else if(h&&(n.innerHTML=""),A("template"==t.type?n.content:n,y(v)?v:[v],t,e,o,"foreignObject"==k?"http://www.w3.org/1999/xhtml":a,u,l,u?u[0]:e.__k&&_(e,0),c,s),null!=u)for(f=u.length;f--;)b(u[f]);c||(f="value","progress"==k&&null==g?n.removeAttribute("value"):null!=g&&(g!==n[f]||"progress"==k&&!g||"option"==k&&g!=N[f])&&D(n,f,g,N[f],a),f="checked",null!=w&&w!=n[f]&&D(n,f,w,N[f],a))}return n}(e.__e,t,e,o,a,u,l,s,f);return(d=r.diffed)&&d(t),128&t.__u?void 0:c}function O(n){n&&n.__c&&(n.__c.__e=!0),n&&n.__k&&n.__k.forEach(O)}function j(n,t,e){for(var i=0;i<e.length;i++)L(e[i],e[++i],e[++i]);r.__c&&r.__c(t,n),n.some(function(t){try{n=t.__h,t.__h=[],n.some(function(n){n.call(t)})}catch(n){r.__e(n,t.__v)}})}function F(n){return"object"!=typeof n||null==n||n.__b&&n.__b>0?n:y(n)?n.map(F):w({},n)}function L(n,t,e){try{if("function"==typeof n){var i="function"==typeof n.__u;i&&n.__u(),i&&null==t||(n.__u=n(t))}else n.current=t}catch(n){r.__e(n,e)}}function R(n,t,e){var i,o;if(r.unmount&&r.unmount(n),(i=n.ref)&&(i.current&&i.current!=n.__e||L(i,null,t)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){r.__e(n,t)}i.base=i.__P=null}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&R(i[o],t,e||"function"!=typeof n.type);e||b(n.__e),n.__c=n.__=n.__e=void 0}function $(n,t,e){return this.constructor(n,e)}function q(n,t,e){var o,a,u,l;t==document&&(t=document.documentElement),r.__&&r.__(n,t),a=(o="function"==typeof e)?null:e&&e.__k||t.__k,u=[],l=[],I(t,n=(!o&&e||t).__k=function(n,t,e){var r,o,a,u={};for(a in t)"key"==a?r=t[a]:"ref"==a?o=t[a]:u[a]=t[a];if(arguments.length>2&&(u.children=arguments.length>3?i.call(arguments,2):e),"function"==typeof n&&null!=n.defaultProps)for(a in n.defaultProps)void 0===u[a]&&(u[a]=n.defaultProps[a]);return N(n,u,r,o,null)}(x,null,[n]),a||p,p,t.namespaceURI,!o&&e?[e]:a?null:t.firstChild?i.call(t.childNodes):null,u,!o&&e?e:a?a.__e:t.firstChild,o,l),j(u,n,l)}i=m.slice,r={__e:function(n,t,e,i){for(var r,o,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(n)),a=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(n,i||{}),a=r.__d),a)return r.__E=r}catch(t){n=t}throw n}},o=0,a=function(n){return null!=n&&null==n.constructor},k.prototype.setState=function(n,t){var e;e=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=w({},this.state),"function"==typeof n&&(n=n(w({},e),this.props)),n&&w(e,n),null!=n&&this.__v&&(t&&this.m.push(t),M(this))},k.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M(this))},k.prototype.render=x,u=[],c="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,s=function(n,t){return n.__v.__b-t.__v.__b},S.__r=0,f=/(PointerCapture)$|Capture$/i,d=0,h=E(!1),v=E(!0);var z=0;function H(n,t,e,i,o,a){t||(t={});var u,l,c=t;if("ref"in c)for(l in c={},t)"ref"==l?u=t[l]:c[l]=t[l];var s={type:n,props:c,key:e,ref:u,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--z,__i:-1,__u:0,__source:o,__self:a};if("function"==typeof n&&(u=n.defaultProps))for(l in u)void 0===c[l]&&(c[l]=u[l]);return r.vnode&&r.vnode(s),s}var W,G,J,B,V=0,Z=[],X=r,Y=X.__b,K=X.__r,Q=X.diffed,nn=X.__c,tn=X.unmount,en=X.__;function rn(n,t){X.__h&&X.__h(G,n,V||t),V=0;var e=G.__H||(G.__H={__:[],__h:[]});return n>=e.__.length&&e.__.push({}),e.__[n]}function on(n,t){var e=rn(W++,3);!X.__s&&hn(e.__H,t)&&(e.__=n,e.u=t,G.__H.__h.push(e))}function an(n){return V=5,un(function(){return{current:n}},[])}function un(n,t){var e=rn(W++,7);return hn(e.__H,t)&&(e.__=n(),e.__H=t,e.__h=n),e.__}function ln(){for(var n;n=Z.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(fn),n.__H.__h.forEach(dn),n.__H.__h=[]}catch(t){n.__H.__h=[],X.__e(t,n.__v)}}X.__b=function(n){G=null,Y&&Y(n)},X.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),en&&en(n,t)},X.__r=function(n){K&&K(n),W=0;var t=(G=n.__c).__H;t&&(J===G?(t.__h=[],G.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(fn),t.__h.forEach(dn),t.__h=[],W=0)),J=G},X.diffed=function(n){Q&&Q(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Z.push(t)&&B===X.requestAnimationFrame||((B=X.requestAnimationFrame)||sn)(ln)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),J=G=null},X.__c=function(n,t){t.some(function(n){try{n.__h.forEach(fn),n.__h=n.__h.filter(function(n){return!n.__||dn(n)})}catch(e){t.some(function(n){n.__h&&(n.__h=[])}),t=[],X.__e(e,n.__v)}}),nn&&nn(n,t)},X.unmount=function(n){tn&&tn(n);var t,e=n.__c;e&&e.__H&&(e.__H.__.forEach(function(n){try{fn(n)}catch(n){t=n}}),e.__H=void 0,t&&X.__e(t,e.__v))};var cn="function"==typeof requestAnimationFrame;function sn(n){var t,e=function(){clearTimeout(i),cn&&cancelAnimationFrame(t),setTimeout(n)},i=setTimeout(e,35);cn&&(t=requestAnimationFrame(e))}function fn(n){var t=G,e=n.__c;"function"==typeof e&&(n.__c=void 0,e()),G=t}function dn(n){var t=G;n.__c=n.__(),G=t}function hn(n,t){return!n||n.length!==t.length||t.some(function(t,e){return t!==n[e]})}var vn=Symbol.for("preact-signals");function pn(){if(!(Nn>1)){var n,t=!1;while(void 0!==bn){var e=bn;bn=void 0;xn++;while(void 0!==e){var i=e.o;e.o=void 0;e.f&=-3;if(!(8&e.f)&&Sn(e))try{e.c()}catch(e){if(!t){n=e;t=!0}}e=i}}xn=0;Nn--;if(t)throw n}else Nn--}function mn(n){if(Nn>0)return n();Nn++;try{return n()}finally{pn()}}var gn=void 0;function yn(n){var t=gn;gn=void 0;try{return n()}finally{gn=t}}var wn,bn=void 0,Nn=0,xn=0,kn=0;function _n(n){if(void 0!==gn){var t=n.n;if(void 0===t||t.t!==gn){t={i:0,S:n,p:gn.s,n:void 0,t:gn,e:void 0,x:void 0,r:t};if(void 0!==gn.s)gn.s.n=t;gn.s=t;n.n=t;if(32&gn.f)n.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=gn.s;t.n=void 0;gn.s.n=t;gn.s=t}return t}}}function Cn(n,t){this.v=n;this.i=0;this.n=void 0;this.t=void 0;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched;this.name=null==t?void 0:t.name}Cn.prototype.brand=vn;Cn.prototype.h=function(){return!0};Cn.prototype.S=function(n){var t=this,e=this.t;if(e!==n&&void 0===n.e){n.x=e;this.t=n;if(void 0!==e)e.e=n;else yn(function(){var n;null==(n=t.W)||n.call(t)})}};Cn.prototype.U=function(n){var t=this;if(void 0!==this.t){var e=n.e,i=n.x;if(void 0!==e){e.x=i;n.e=void 0}if(void 0!==i){i.e=e;n.x=void 0}if(n===this.t){this.t=i;if(void 0===i)yn(function(){var n;null==(n=t.Z)||n.call(t)})}}};Cn.prototype.subscribe=function(n){var t=this;return jn(function(){var e=t.value,i=gn;gn=void 0;try{n(e)}finally{gn=i}},{name:"sub"})};Cn.prototype.valueOf=function(){return this.value};Cn.prototype.toString=function(){return this.value+""};Cn.prototype.toJSON=function(){return this.value};Cn.prototype.peek=function(){var n=gn;gn=void 0;try{return this.value}finally{gn=n}};Object.defineProperty(Cn.prototype,"value",{get:function(){var n=_n(this);if(void 0!==n)n.i=this.i;return this.v},set:function(n){if(n!==this.v){if(xn>100)throw new Error("Cycle detected");this.v=n;this.i++;kn++;Nn++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{pn()}}}});function Mn(n,t){return new Cn(n,t)}function Sn(n){for(var t=n.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function An(n){for(var t=n.s;void 0!==t;t=t.n){var e=t.S.n;if(void 0!==e)t.r=e;t.S.n=t;t.i=-1;if(void 0===t.n){n.s=t;break}}}function Tn(n){var t=n.s,e=void 0;while(void 0!==t){var i=t.p;if(-1===t.i){t.S.U(t);if(void 0!==i)i.n=t.n;if(void 0!==t.n)t.n.p=i}else e=t;t.S.n=t.r;if(void 0!==t.r)t.r=void 0;t=i}n.s=e}function Pn(n,t){Cn.call(this,void 0);this.x=n;this.s=void 0;this.g=kn-1;this.f=4;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched;this.name=null==t?void 0:t.name}Pn.prototype=new Cn;Pn.prototype.h=function(){this.f&=-3;if(1&this.f)return!1;if(32==(36&this.f))return!0;this.f&=-5;if(this.g===kn)return!0;this.g=kn;this.f|=1;if(this.i>0&&!Sn(this)){this.f&=-2;return!0}var n=gn;try{An(this);gn=this;var t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++}}catch(n){this.v=n;this.f|=16;this.i++}gn=n;Tn(this);this.f&=-2;return!0};Pn.prototype.S=function(n){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}Cn.prototype.S.call(this,n)};Pn.prototype.U=function(n){if(void 0!==this.t){Cn.prototype.U.call(this,n);if(void 0===this.t){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}}};Pn.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var n=this.t;void 0!==n;n=n.x)n.t.N()}};Object.defineProperty(Pn.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var n=_n(this);this.h();if(void 0!==n)n.i=this.i;if(16&this.f)throw this.v;return this.v}});function Un(n,t){return new Pn(n,t)}function Dn(n){var t=n.u;n.u=void 0;if("function"==typeof t){Nn++;var e=gn;gn=void 0;try{t()}catch(t){n.f&=-2;n.f|=8;En(n);throw t}finally{gn=e;pn()}}}function En(n){for(var t=n.s;void 0!==t;t=t.n)t.S.U(t);n.x=void 0;n.s=void 0;Dn(n)}function In(n){if(gn!==this)throw new Error("Out-of-order effect");Tn(this);gn=n;this.f&=-2;if(8&this.f)En(this);pn()}function On(n,t){this.x=n;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32;this.name=null==t?void 0:t.name;if(wn)wn.push(this)}On.prototype.c=function(){var n=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();if("function"==typeof t)this.u=t}finally{n()}};On.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1;this.f&=-9;Dn(this);An(this);Nn++;var n=gn;gn=this;return In.bind(this,n)};On.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=bn;bn=this}};On.prototype.d=function(){this.f|=8;if(!(1&this.f))En(this)};On.prototype.dispose=function(){this.d()};function jn(n,t){var e=new On(n,t);try{e.c()}catch(n){e.d();throw n}var i=e.d.bind(e);i[Symbol.dispose]=i;return i}var Fn,Ln,Rn,$n="undefined"!=typeof window&&!!window.__PREACT_SIGNALS_DEVTOOLS__,qn=[],zn=[];jn(function(){Fn=this.N})();function Hn(n,t){r[n]=t.bind(null,r[n]||function(){})}function Wn(n){if(Rn){var t=Rn;Rn=void 0;t()}Rn=n&&n.S()}function Gn(n){var t=this,e=n.data,i=useSignal(e);i.value=e;var r=un(function(){var n=t,e=t.__v;while(e=e.__)if(e.__c){e.__c.__$f|=4;break}var r=Un(function(){var n=i.value.value;return 0===n?0:!0===n?"":n||""}),o=Un(function(){return!Array.isArray(r.value)&&!a(r.value)}),u=jn(function(){this.N=Kn;if(o.value){var t=r.value;if(n.__v&&n.__v.__e&&3===n.__v.__e.nodeType)n.__v.__e.data=t}}),l=t.__$u.d;t.__$u.d=function(){u();l.call(this)};return[o,r]},[]),o=r[0],u=r[1];return o.value?u.peek():u.value}Gn.displayName="ReactiveTextNode";Object.defineProperties(Cn.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Gn},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Hn("__b",function(n,t){if("string"==typeof t.type){var e,i=t.props;for(var r in i)if("children"!==r){var o=i[r];if(o instanceof Cn){if(!e)t.__np=e={};e[r]=o;i[r]=o.peek()}}}n(t)});Hn("__r",function(n,t){n(t);if(t.type!==x){Wn();var e,i=t.__c;if(i){i.__$f&=-2;if(void 0===(e=i.__$u))i.__$u=e=function(n,t){var e;jn(function(){e=this},{name:t});e.c=n;return e}(function(){var n;if($n)null==(n=e.y)||n.call(e);i.__$f|=1;i.setState({})},"function"==typeof t.type?t.type.displayName||t.type.name:"")}Ln=i;Wn(e)}});Hn("__e",function(n,t,e,i){Wn();Ln=void 0;n(t,e,i)});Hn("diffed",function(n,t){Wn();Ln=void 0;var e;if("string"==typeof t.type&&(e=t.__e)){var i=t.__np,r=t.props;if(i){var o=e.U;if(o)for(var a in o){var u=o[a];if(void 0!==u&&!(a in i)){u.d();o[a]=void 0}}else{o={};e.U=o}for(var l in i){var c=o[l],s=i[l];if(void 0===c){c=Jn(e,l,s,r);o[l]=c}else c.o(s,r)}}}n(t)});function Jn(n,t,e,i){var r=t in n&&void 0===n.ownerSVGElement,o=Mn(e);return{o:function(n,t){o.value=n;i=t},d:jn(function(){this.N=Kn;var e=o.value.value;if(i[t]!==e){i[t]=e;if(r)n[t]=e;else if(null!=e&&(!1!==e||"-"===t[4]))n.setAttribute(t,e);else n.removeAttribute(t)}})}}Hn("unmount",function(n,t){if("string"==typeof t.type){var e=t.__e;if(e){var i=e.U;if(i){e.U=void 0;for(var r in i){var o=i[r];if(o)o.d()}}}}else{var a=t.__c;if(a){var u=a.__$u;if(u){a.__$u=void 0;u.d()}}}n(t)});Hn("__h",function(n,t,e,i){if(i<3||9===i)t.__$f|=2;n(t,e,i)});k.prototype.shouldComponentUpdate=function(n,t){if(this.__R)return!0;var e=this.__$u,i=e&&void 0!==e.s;for(var r in t)return!0;if(this.__f||"boolean"==typeof this.u&&!0===this.u){var o=2&this.__$f;if(!(i||o||4&this.__$f))return!0;if(1&this.__$f)return!0}else{if(!(i||4&this.__$f))return!0;if(3&this.__$f)return!0}for(var a in n)if("__source"!==a&&n[a]!==this.props[a])return!0;for(var u in this.props)if(!(u in n))return!0;return!1};function useSignal(n,t){return un(function(){return Mn(n,t)},[])}var Bn="undefined"==typeof requestAnimationFrame?setTimeout:function(n){var t=function(){clearTimeout(e);cancelAnimationFrame(i);n()},e=setTimeout(t,35),i=requestAnimationFrame(t)},Vn=function(n){queueMicrotask(function(){queueMicrotask(n)})};function Zn(){mn(function(){var n;while(n=qn.shift())Fn.call(n)})}function Xn(){if(1===qn.push(this))(r.requestAnimationFrame||Bn)(Zn)}function Yn(){mn(function(){var n;while(n=zn.shift())Fn.call(n)})}function Kn(){if(1===zn.push(this))(r.requestAnimationFrame||Vn)(Yn)}function useSignalEffect(n,t){var e=an(n);e.current=n;on(function(){return jn(function(){this.N=Xn;return e.current()},t)},[])}function Qn(n){var t=n.onClick,e=n.className,i=void 0===e?"":e,r=n.disabled,o=void 0===r?!1:r,a=n.children,u=n.variant,l=void 0===u?"secondary":u,c=n.popovertarget,s=n.active;return H("button",{popovertarget:c,onClick:t,className:("btn "+("primary"===l?"btn-primary":"btn-secondary")+" "+((void 0===s?0:s)?"active":"")+" "+i).trim(),disabled:o,children:a})}function nt(n){var t=n.onRefresh,e=n.title,i=void 0===e?"No Signals Detected":e,r=n.description,o=void 0===r?"Make sure your application is using @preact/signals-debug package.":r,a=n.buttonText,u=void 0===a?"Refresh Detection":a;return H("div",{className:"empty-state",children:H("div",{className:"empty-state-content",children:[H("h2",{children:i}),H("p",{children:o}),H("div",{className:"empty-state-actions",children:H(Qn,{onClick:t,variant:"primary",children:u})})]})})}function tt(n){var t=n.status,e=n.message,i=n.showIndicator,r=void 0===i?!0:i,o=n.className;return H("div",{className:"connection-status "+t+" "+(void 0===o?"":o),children:[r&&H("span",{className:"status-indicator "+t}),H("span",{className:"status-text",children:e})]})}var et=null;function it(){if(!et)throw new Error("DevTools context not initialized. Call initDevTools() first.");return et}function rt(n){var t=Mn("connecting"),e=Mn("Connecting..."),i=Mn(!1);n.on("connectionStatusChanged",function(n){t.value=n.status;e.value=n.message});n.on("signalsAvailable",function(n){i.value=n});return{get status(){return t.value},get message(){return e.value},get isConnected(){return i.value},refreshConnection:function(){t.value="connecting";e.value="Connecting...";n.requestState()}}}var ot=function(n,t){return n.update.signalId===t.update.signalId&&n.children.length===t.children.length&&n.children.every(function(n,e){return ot(n,t.children[e])})};function at(n,i){var r=Mn([]),o=Mn(!1),a=Mn(new Set),u=function(n){if(Array.isArray(n))n.forEach(function(n){if("divider"!==n.type)n.receivedAt=Date.now()});else if("update"===n.type)n.receivedAt=Date.now();r.value=[].concat(r.value,Array.isArray(n)?n:[n])},l=Un(function(){return r.value.length>0}),c=Un(function(){var n=new Map;r.value.forEach(function(t){if("divider"!==t.type){var e=t.signalName||"Unknown";n.set(e,(n.get(e)||0)+1)}});return n}),s=Un(function(){return function(n){for(var t=[],e=[],i=n.slice(-100).reverse(),r=0;r<i.length;r++){var o=i[r];if("divider"!==o.type){var a=o,u=a.depth||0,l={type:"single",id:a.signalName+"-"+a.receivedAt+"-"+r,update:a,children:[],depth:u,hasChildren:!1};while(e.length>0&&e[e.length-1].depth>=u)e.pop();if(0===e.length)t.push(l);else{var c=e[e.length-1];c.children.push(l);c.hasChildren=!0}e.push(l)}}return t}(r.value)});n.on("signalUpdate",function(n){if(!o.value){var t=[].concat(n).reverse();t.push({type:"divider"});u(t)}});n.on("signalDisposed",function(n){if(!o.value)!function(n){for(var e,i=Array.isArray(n)?n:[n],r=new Set(a.value),o=t(i);!(e=o()).done;){var u=e.value;if(u.signalId)r.add(u.signalId)}a.value=r}(n)});var f=Un(function(){var n=s.value;if(i.settings.grouped)return function(n){for(var i,r,o=[],a=t(n);!(r=a()).done;){var u=r.value;if(!i||!ot(i,u)){o.push(u);i=u}else if("group"!==i.type){o.pop();i=e({},i,{type:"group",count:2,firstUpdate:u.update,firstChildren:u.children});o.push(i)}else{i.count++;i.firstUpdate=u.update;i.firstChildren=u.children}}return o}(n);else return n});return{updates:r,updateTree:s,collapsedUpdateTree:f,totalUpdates:Un(function(){return Object.keys(s.value).length}),signalCounts:c,disposedSignalIds:a,addUpdate:u,clearUpdates:function(){r.value=[];a.value=new Set},hasUpdates:l,isPaused:o}}function ut(n){var t=Mn({enabled:!0,grouped:!0,consoleLogging:!0,maxUpdatesPerSecond:60,filterPatterns:[]}),e=Mn(!1);n.on("configReceived",function(n){if(n.settings)t.value=n.settings});return{get settings(){return t.value},get showDisposedSignals(){return e.value},set settings(n){t.value=n},applySettings:function(e){t.value=e;n.sendConfig(e)},toggleShowDisposedSignals:function(){e.value=!e.value}}}function lt(n){var t=ut(n),e=at(n,t),i=rt(n),r=function(){var n,t=Mn(function(){try{var n=localStorage.getItem("signals-devtools-theme");if("light"===n||"dark"===n||"auto"===n)return n}catch(n){}return"auto"}()),e="undefined"!=typeof window?window.matchMedia("(prefers-color-scheme: dark)"):null,i=Mn(null!=(n=null==e?void 0:e.matches)?n:!1);if(e)e.addEventListener("change",function(n){i.value=n.matches});var r=Un(function(){return"auto"===t.value?i.value?"dark":"light":t.value});jn(function(){var n=r.value,t=document.querySelector(".signals-devtools");if(t instanceof HTMLElement)t.dataset.theme=n});return{get theme(){return t.value},get resolvedTheme(){return r.value},toggleTheme:function(){var n=["auto","light","dark"],e=n.indexOf(t.value);t.value=n[(e+1)%n.length];try{localStorage.setItem("signals-devtools-theme",t.value)}catch(n){}}}}();return et={adapter:n,connectionStore:i,updatesStore:e,settingsStore:t,themeStore:r}}function ct(){if(et){et.adapter.disconnect();et=null}}var st={auto:"Auto",light:"Light",dark:"Dark"},ft={auto:"◑",light:"☀",dark:"☾"};function dt(){var n=it(),t=n.connectionStore,e=n.updatesStore,i=n.themeStore,r=function(){e.isPaused.value=!e.isPaused.value},o=function(){e.clearUpdates()};return H("header",{className:"header",children:[H("div",{className:"header-title",children:[H("h1",{children:"Signals"}),H(tt,{status:t.status,message:t.message})]}),H("div",{className:"header-controls",children:[H("button",{className:"theme-toggle",onClick:i.toggleTheme,title:"Theme: "+st[i.theme],children:[ft[i.theme]," ",st[i.theme]]}),o&&H(Qn,{onClick:o,children:"Clear"}),r&&H(Qn,{onClick:r,active:e.isPaused.value,children:e.isPaused.value?"Resume":"Pause"}),H(Qn,{popovertarget:"settings-panel-popover",children:"Settings"})]})]})}function ht(){var n=it().settingsStore,t=an(null),i=n.applySettings,r=useSignal(n.settings);useSignalEffect(function(){r.value=n.settings});return H("div",{ref:t,popover:"auto",id:"settings-panel-popover",className:"settings-panel",children:H("div",{className:"settings-content",children:[H("h3",{children:"Debug Configuration"}),H("div",{className:"setting-group",children:H("label",{children:[H("input",{type:"checkbox",checked:r.value.enabled,onChange:function(n){return r.value=e({},r.value,{enabled:n.target.checked})}}),"Enable debug updates"]})}),H("div",{className:"setting-group",children:H("label",{children:[H("input",{type:"checkbox",checked:r.value.grouped,onChange:function(n){return r.value=e({},r.value,{grouped:n.target.checked})}}),"Group related updates"]})}),H("div",{className:"setting-group",children:[H("label",{children:[H("input",{type:"checkbox",checked:r.value.consoleLogging,onChange:function(n){return r.value=e({},r.value,{consoleLogging:n.target.checked})}}),"Enable console logging"]}),H("p",{className:"setting-description",children:"When disabled, signal updates will not be logged to the browser console."})]}),H("div",{className:"setting-group",children:[H("label",{htmlFor:"maxUpdatesInput",children:"Max updates per second:"}),H("input",{type:"number",id:"maxUpdatesInput",value:r.value.maxUpdatesPerSecond,min:"1",max:"1000",onChange:function(n){return r.value=e({},r.value,{maxUpdatesPerSecond:parseInt(n.target.value)||60})}})]}),H("div",{className:"setting-group",children:[H("label",{htmlFor:"filterPatternsInput",children:"Filter patterns (one per line):"}),H("textarea",{id:"filterPatternsInput",placeholder:"user.*\n.*State$\nglobal",value:r.value.filterPatterns.join("\n"),onChange:function(n){return r.value=e({},r.value,{filterPatterns:n.target.value.split("\n").map(function(n){return n.trim()}).filter(function(n){return n.length>0})})}})]}),H("h3",{children:"Graph Settings"}),H("div",{className:"setting-group",children:[H("label",{children:[H("input",{type:"checkbox",checked:n.showDisposedSignals,onChange:function(){return n.toggleShowDisposedSignals()}}),"Show disposed signals in graph"]}),H("p",{className:"setting-description",children:"When enabled, signals and effects that have been disposed will still be shown in the graph view."})]}),H("div",{className:"settings-actions",children:[H(Qn,{onClick:function(){i(r.value)},variant:"primary",children:"Apply"}),H(Qn,{onClick:function(){var n;null==(n=t.current)||n.hide()},children:"Cancel"})]})]})})}var vt=function(n){var t=document.createElement("textarea");try{t.value=n;document.body.append(t);t.select();document.execCommand("copy")}finally{t.remove()}};function pt(){var n=it(),e=n.updatesStore,i=n.settingsStore,r=e.updates,o=e.disposedSignalIds,a=an(null),u=an(null),l=an(null),c=useSignal({x:0,y:0}),s=useSignal(1),f=useSignal(!1),d=useSignal({x:0,y:0}),h=useSignal(!1),v=useSignal(),p=useSignal(null),m=useSignal({x:0,y:0});on(function(){var n=function(n){if(h.value&&l.current&&!l.current.contains(n.target))h.value=!1};document.addEventListener("mousedown",n);return function(){document.removeEventListener("mousedown",n)}},[]);var g=function(n,t){var e=an(n);e.current=n;Ln.__$f|=4;return un(function(){return Un(function(){return e.current()},void 0)},[])}(function(){var n=r.value,e=o.value,a=i.showDisposedSignals;if(!n||0===n.length)return{nodes:[],links:[]};for(var u,l=new Map,c=new Map,s=n.filter(function(n){return"divider"!==n.type}),f=t(s);!(u=f()).done;){var d=u.value;if(d.signalId)if(a||!e.has(d.signalId)){var h=d.signalType;if(!l.has(d.signalId))l.set(d.signalId,{id:d.signalId,name:d.signalName,type:h,x:0,y:0,depth:0});if(d.allDependencies&&d.allDependencies.length>0)for(var v,p=t(d.allDependencies);!(v=p()).done;){var m=v.value;if(a||!e.has(m.id)){if(!l.has(m.id))l.set(m.id,{id:m.id,name:m.name,type:m.type,x:0,y:0,depth:0});var g=m.id+"->"+d.signalId;if(!c.has(g))c.set(g,{source:m.id,target:d.signalId})}}else if(d.subscribedTo){if(!a&&e.has(d.subscribedTo))continue;var y=d.subscribedTo+"->"+d.signalId;if(!c.has(y))c.set(y,{source:d.subscribedTo,target:d.signalId})}}}var w=Array.from(c.values()),b=function(n,t){var e=new Map,i=new Map,r=new Map;n.forEach(function(n,t){i.set(t,new Set);r.set(t,0)});t.forEach(function(n){var t;null==(t=i.get(n.source))||t.add(n.target);r.set(n.target,(r.get(n.target)||0)+1)});var o=[];n.forEach(function(n,t){if(0===r.get(t)){o.push(t);e.set(t,0)}});var a=function(){var n,t=o.shift(),a=e.get(t);null==(n=i.get(t))||n.forEach(function(n){var t,i=null!=(t=e.get(n))?t:0;e.set(n,Math.max(i,a+1));var u=(r.get(n)||0)-1;r.set(n,u);if(0===u)o.push(n)})};while(o.length>0)a();return e}(l,w);l.forEach(function(n,t){var e;n.depth=null!=(e=b.get(t))?e:0});var N=new Map;l.forEach(function(n){if(!N.has(n.depth))N.set(n.depth,[]);N.get(n.depth).push(n)});!function(n,t){var e=Array.from(n.keys()).sort(function(n,t){return n-t}),i=new Map,r=new Map;t.forEach(function(n){if(!i.has(n.source))i.set(n.source,[]);if(!r.has(n.target))r.set(n.target,[]);i.get(n.source).push(n.target);r.get(n.target).push(n.source)});for(var o=new Map,a=0;a<4;a++){for(var u=function(){var t=e[l],i=n.get(t);i.forEach(function(n,t){o.set(n.id,t)});if(0===l)return 1;var a=i.map(function(n){var t=r.get(n.id)||[];if(0===t.length)return 0;else return t.reduce(function(n,t){var e;return n+(null!=(e=o.get(t))?e:0)},0)/t.length}),u=i.map(function(n,t){return{node:n,barycenter:a[t]}}).sort(function(n,t){return n.barycenter-t.barycenter}).map(function(n){return n.node});n.set(t,u)},l=0;l<e.length;l++)if(!u());for(var c=function(){var t=e[s],r=n.get(t);r.forEach(function(n,t){o.set(n.id,t)});if(s===e.length-1)return 1;var a=r.map(function(n){var t=i.get(n.id)||[];if(0===t.length)return 0;else return t.reduce(function(n,t){var e;return n+(null!=(e=o.get(t))?e:0)},0)/t.length}),u=r.map(function(n,t){return{node:n,barycenter:a[t]}}).sort(function(n,t){return n.barycenter-t.barycenter}).map(function(n){return n.node});n.set(t,u)},s=e.length-1;s>=0;s--)if(!c());}}(N,w);N.forEach(function(n,t){var e=80-120*(n.length-1)/2;n.forEach(function(n,i){n.x=100+250*t;n.y=e+120*i+50*N.size})});return{nodes:Array.from(l.values()),links:w}}),y=function(){f.value=!1},w=/[^a-zA-Z0-9]/g,b=function(n){return n.replace(w,"_")},N=function(n){var t=6.5*n.name.length+16;return Math.max(30,Math.min(t/2,70))},x=function(n){var t=u.current;if(t&&p.value){var e=t.getBoundingClientRect();m.value={x:n.clientX-e.left,y:n.clientY-e.top}}},k=function(){p.value=null},_=function(n){v.value=n;setTimeout(function(){v.value=void 0},2e3)};if(0===g.value.nodes.length)return H("div",{className:"graph-empty",children:H("div",{children:[H("h3",{children:"No Signal Dependencies"}),H("p",{children:"Create some signals with dependencies to see the graph visualization."})]})});var C=Math.max.apply(Math,[800].concat(g.value.nodes.map(function(n){return n.x+100}))),M=Math.max.apply(Math,[600].concat(g.value.nodes.map(function(n){return n.y+100})));return H("div",{className:"graph-container",children:H("div",{ref:u,className:"graph-content",onMouseDown:function(n){if(0===n.button){f.value=!0;d.value={x:n.clientX-c.value.x,y:n.clientY-c.value.y}}},onMouseMove:function(n){if(f.value)c.value={x:n.clientX-d.value.x,y:n.clientY-d.value.y}},onMouseUp:y,onMouseLeave:y,onWheel:function(n){n.preventDefault();var t=u.current;if(t){var e=t.getBoundingClientRect(),i=n.clientX-e.left,r=n.clientY-e.top,o=n.deltaY>0?.96:1.04,a=Math.min(Math.max(.1,s.value*o),5),l=a/s.value;c.value={x:i-(i-c.value.x)*l,y:r-(r-c.value.y)*l};s.value=a}},style:{cursor:f.value?"grabbing":"grab"},children:[H("svg",{ref:a,className:"graph-svg",width:C,height:M,viewBox:"0 0 "+C+" "+M,children:[H("defs",{children:H("marker",{id:"arrowhead",markerWidth:"8",markerHeight:"6",refX:"7",refY:"3",orient:"auto",children:H("polygon",{points:"0 0, 8 3, 0 6",className:"graph-arrowhead"})})}),H("g",{transform:"translate("+c.value.x+", "+c.value.y+") scale("+s.value+")",children:[H("g",{className:"links",children:g.value.links.map(function(n,t){var e=g.value.nodes.find(function(t){return t.id===n.source}),i=g.value.nodes.find(function(t){return t.id===n.target});if(!e||!i)return null;var r=N(e),o=N(i),a=e.x+r,u=e.y,l=i.x-o-8,c=i.y,s=a+.5*(l-a);return H("path",{className:"graph-link",d:"M "+a+" "+u+" C "+s+" "+u+", "+s+" "+c+", "+l+" "+c,fill:"none",markerEnd:"url(#arrowhead)"},"link-"+t)})}),H("g",{className:"nodes",children:g.value.nodes.map(function(n){var t,e=N(n),i=Math.floor((2*e-16)/6.5),r=n.name.length>i?n.name.slice(0,i-1)+"…":n.name;return H("g",{className:"graph-node-group "+((null==(t=p.value)?void 0:t.id)===n.id?"hovered":""),onMouseEnter:function(t){return function(n,t){p.value=n;var e=u.current;if(e){var i=e.getBoundingClientRect();m.value={x:t.clientX-i.left,y:t.clientY-i.top}}}(n,t)},onMouseMove:x,onMouseLeave:k,children:[H("circle",{className:"graph-node "+n.type,cx:n.x,cy:n.y,r:e}),H("text",{className:"graph-text",x:n.x,y:n.y,textAnchor:"middle",dominantBaseline:"central",children:r})]},n.id)})})]})]}),H("div",{className:"graph-controls",children:[H("button",{className:"graph-reset-button",onClick:function(){c.value={x:0,y:0};s.value=1},title:"Reset view",children:"⟲ Reset View"}),H("div",{ref:l,className:"graph-export-container",children:[H("button",{className:"graph-export-button",onClick:function(){h.value=!h.value},title:"Export graph",children:"↓ Export"}),h.value&&H("div",{className:"graph-export-menu",children:[H("button",{className:"graph-export-menu-item",onClick:function(){try{h.value=!1;var n=["graph LR"];g.value.nodes.forEach(function(t){var e=b(t.id),i=t.name;switch(t.type){case"signal":n.push(" "+e+"(("+i+"))");break;case"computed":n.push(" "+e+"("+i+")");break;case"effect":n.push(" "+e+"(["+i+"])");break;case"component":n.push(" "+e+"{{"+i+"}}")}});for(var e,i=t(g.value.links);!(e=i()).done;){var r=e.value,o=b(r.source),a=b(r.target);n.push(" "+o+" --\x3e "+a)}vt(n.join("\n"));_("Copied to clipboard!");return Promise.resolve()}catch(n){return Promise.reject(n)}},children:"Mermaid"}),H("button",{className:"graph-export-menu-item",onClick:function(){try{h.value=!1;var n=JSON.stringify(g.value,null,2);vt(n);_("Copied to clipboard!");return Promise.resolve()}catch(n){return Promise.reject(n)}},children:"JSON"})]})]}),H("div",{className:"graph-zoom-indicator",title:"Zoom level",children:[Math.round(100*s.value),"%"]})]}),v.value&&H("div",{className:"graph-toast",children:v.value}),p.value&&H("div",{className:"graph-tooltip",style:{left:m.value.x+12,top:m.value.y-8},children:[H("div",{className:"tooltip-header",children:H("span",{className:"tooltip-type "+p.value.type,children:p.value.type})}),H("div",{className:"tooltip-name",children:p.value.name}),H("div",{className:"tooltip-id",children:["ID: ",p.value.id]})]}),H("div",{className:"graph-legend",children:[H("div",{className:"legend-item",children:[H("div",{className:"legend-color signal"}),H("span",{children:"Signal"})]}),H("div",{className:"legend-item",children:[H("div",{className:"legend-color computed"}),H("span",{children:"Computed"})]}),H("div",{className:"legend-item",children:[H("div",{className:"legend-color effect"}),H("span",{children:"Effect"})]}),H("div",{className:"legend-item",children:[H("div",{className:"legend-color component"}),H("span",{children:"Component"})]})]})]})})}function mt(n){var t=n.update,e=n.count,i=n.firstUpdate,r=new Date(t.timestamp||t.receivedAt).toLocaleTimeString(),o=function(n){if(null===n)return"null";if(void 0===n)return"undefined";if("string"==typeof n)return'"'+n+'"';if("function"==typeof n)return"function()";if("object"==typeof n)try{return JSON.stringify(n,null,0)}catch(n){return"[Object]"}return String(n)},a=e&&H("span",{class:"update-count",title:"Number of grouped identical updates",children:["x",e]});if("effect"===t.type||"component"===t.type){var u="component"===t.type?"🔄":"↪️",l="component"===t.type?"Component render":"Effect";return H("div",{className:"update-item "+t.type,children:H("div",{className:"update-header",children:[H("span",{className:"signal-name",children:[u," ",t.signalName,a]}),H("span",{className:"update-type-badge",children:l}),H("span",{className:"update-time",children:r})]})})}var c=o(t.prevValue),s=o(t.newValue),f=void 0!==i?o(i.prevValue):void 0;return H("div",{class:"update-item "+t.type,children:[H("div",{class:"update-header",children:[H("span",{class:"signal-name",children:[0===t.depth?"🎯":"↪️"," ",t.signalName,a]}),H("span",{class:"update-time",children:r})]}),H("div",{class:"value-change",children:[f&&f!==c&&H(x,{children:[H("span",{class:"value-prev",children:f}),H("span",{class:"value-arrow",children:"..."})]}),H("span",{class:"value-prev",children:c}),H("span",{class:"value-arrow",children:"→"}),H("span",{class:"value-new",children:s})]})]})}function gt(n){var t,i=n.node,r=useSignal(!1),o=i.children.length>0,a="group"===i.type?i.count:void 0,u="group"===i.type?i.firstUpdate:void 0;if("group"===i.type&&i.firstChildren)t=i.children.map(function(n,t){var r=i.firstChildren[t];return e({},n,{type:"group",firstUpdate:r.update,firstChildren:r.children,count:i.count})});else t=i.children;return H("div",{className:"tree-node",children:[H("div",{className:"tree-node-content",children:[o&&H("button",{className:"collapse-button",onClick:function(){r.value=!r.value},"aria-label":r.value?"Expand":"Collapse",children:r.value?"▶":"▼"}),!o&&H("div",{className:"collapse-spacer"}),H("div",{className:"update-content",children:H(mt,{update:i.update,count:a,firstUpdate:u})})]}),o&&!r.value&&H("div",{className:"tree-children",children:t.map(function(n){return H(gt,{node:n},n.id)})})]})}function yt(){var n=it().updatesStore,t=an(null),e=n.collapsedUpdateTree.value;useSignalEffect(function(){if(t.current)t.current.scrollTop=0});return H("div",{className:"updates-container",children:[H("div",{className:"updates-header",children:H("div",{className:"updates-stats",children:[H("span",{children:["Updates: ",H("strong",{children:n.totalUpdates.value})]}),H("span",{children:["Signals: ",H("strong",{children:n.signalCounts.value.size})]})]})}),H("div",{className:"updates-list",ref:t,children:e.map(function(n){return H(gt,{node:n},n.id)})})]})}var wt=["adapter","container"];function bt(n){var t=void 0===n?{}:n,e=t.hideHeader,i=void 0===e?!1:e,r=t.initialTab,o=void 0===r?"updates":r,a=it().connectionStore,u=useSignal(o);return H("div",{className:"signals-devtools",children:[!i&&H(dt,{}),H(ht,{}),H("main",{className:"main-content",children:[H("div",{className:"tabs",children:[H("button",{className:"tab "+("updates"===u.value?"active":""),onClick:function(){return u.value="updates"},children:"Updates"}),H("button",{className:"tab "+("graph"===u.value?"active":""),onClick:function(){return u.value="graph"},children:"Dependency Graph"})]}),H("div",{className:"tab-content",children:!a.isConnected?H(nt,{onRefresh:a.refreshConnection}):H(x,{children:["updates"===u.value&&H(yt,{}),"graph"===u.value&&H(pt,{})]})})]})]})}exports.Button=Qn;exports.DevToolsPanel=bt;exports.EmptyState=nt;exports.GraphVisualization=pt;exports.Header=dt;exports.SettingsPanel=ht;exports.StatusIndicator=tt;exports.UpdateItem=mt;exports.UpdateTreeNodeComponent=gt;exports.UpdatesContainer=yt;exports.createConnectionStore=rt;exports.createSettingsStore=ut;exports.createUpdatesStore=at;exports.destroyDevTools=ct;exports.getContext=it;exports.initDevTools=lt;exports.mount=function(n){try{var t=n.adapter,i=n.container,r=function(n,t){if(null==n)return{};var e={};for(var i in n)if({}.hasOwnProperty.call(n,i)){if(-1!==t.indexOf(i))continue;e[i]=n[i]}return e}(n,wt);lt(t);return Promise.resolve(t.connect()).then(function(){i.innerHTML="";q(H(bt,e({},r)),i);return function(){q(null,i);ct()}})}catch(n){return Promise.reject(n)}};//# sourceMappingURL=devtools-ui.js.map
|