twd-js 1.3.3 → 1.4.0

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.
@@ -1,6 +1,11 @@
1
- (function(W,E){typeof exports=="object"&&typeof module<"u"?E(exports):typeof define=="function"&&define.amd?define(["exports"],E):(W=typeof globalThis<"u"?globalThis:W||self,E(W.TWD={}))})(this,(function(W){"use strict";var E,h,le,C,ae,ce,ue,de,Y,G,X,M={},fe=[],Fe=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,D=Array.isArray;function T(t,e){for(var n in e)t[n]=e[n];return t}function J(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function je(t,e,n){var r,s,i,_={};for(i in e)i=="key"?r=e[i]:i=="ref"?s=e[i]:_[i]=e[i];if(arguments.length>2&&(_.children=arguments.length>3?E.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)_[i]===void 0&&(_[i]=t.defaultProps[i]);return P(t,_,r,s,null)}function P(t,e,n,r,s){var i={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:s??++le,__i:-1,__u:0};return s==null&&h.vnode!=null&&h.vnode(i),i}function L(t){return t.children}function B(t,e){this.props=t,this.context=e}function A(t,e){if(e==null)return t.__?A(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?A(t):null}function pe(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return pe(t)}}function he(t){(!t.__d&&(t.__d=!0)&&C.push(t)&&!U.__r++||ae!=h.debounceRendering)&&((ae=h.debounceRendering)||ce)(U)}function U(){for(var t,e,n,r,s,i,_,l=1;C.length;)C.length>l&&C.sort(ue),t=C.shift(),l=C.length,t.__d&&(n=void 0,r=void 0,s=(r=(e=t).__v).__e,i=[],_=[],e.__P&&((n=T({},r)).__v=r.__v+1,h.vnode&&h.vnode(n),Q(e.__P,n,r,e.__n,e.__P.namespaceURI,32&r.__u?[s]:null,i,s??A(r),!!(32&r.__u),_),n.__v=r.__v,n.__.__k[n.__i]=n,be(i,n,_),r.__e=r.__=null,n.__e!=s&&pe(n)));U.__r=0}function ge(t,e,n,r,s,i,_,l,u,a,p){var o,f,d,b,x,k,m,g=r&&r.__k||fe,R=e.length;for(u=ze(n,e,g,u,R),o=0;o<R;o++)(d=n.__k[o])!=null&&(f=d.__i==-1?M:g[d.__i]||M,d.__i=o,k=Q(t,d,f,s,i,_,l,u,a,p),b=d.__e,d.ref&&f.ref!=d.ref&&(f.ref&&ee(f.ref,null,d),p.push(d.ref,d.__c||b,d)),x==null&&b!=null&&(x=b),(m=!!(4&d.__u))||f.__k===d.__k?u=me(d,u,t,m):typeof d.type=="function"&&k!==void 0?u=k:b&&(u=b.nextSibling),d.__u&=-7);return n.__e=x,u}function ze(t,e,n,r,s){var i,_,l,u,a,p=n.length,o=p,f=0;for(t.__k=new Array(s),i=0;i<s;i++)(_=e[i])!=null&&typeof _!="boolean"&&typeof _!="function"?(typeof _=="string"||typeof _=="number"||typeof _=="bigint"||_.constructor==String?_=t.__k[i]=P(null,_,null,null,null):D(_)?_=t.__k[i]=P(L,{children:_},null,null,null):_.constructor==null&&_.__b>0?_=t.__k[i]=P(_.type,_.props,_.key,_.ref?_.ref:null,_.__v):t.__k[i]=_,u=i+f,_.__=t,_.__b=t.__b+1,(a=_.__i=Oe(_,n,u,o))!=-1&&(o--,(l=n[a])&&(l.__u|=2)),l==null||l.__v==null?(a==-1&&(s>p?f--:s<p&&f++),typeof _.type!="function"&&(_.__u|=4)):a!=u&&(a==u-1?f--:a==u+1?f++:(a>u?f--:f++,_.__u|=4))):t.__k[i]=null;if(o)for(i=0;i<p;i++)(l=n[i])!=null&&(2&l.__u)==0&&(l.__e==r&&(r=A(l)),we(l,l));return r}function me(t,e,n,r){var s,i;if(typeof t.type=="function"){for(s=t.__k,i=0;s&&i<s.length;i++)s[i]&&(s[i].__=t,e=me(s[i],e,n,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=A(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Oe(t,e,n,r){var s,i,_,l=t.key,u=t.type,a=e[n],p=a!=null&&(2&a.__u)==0;if(a===null&&l==null||p&&l==a.key&&u==a.type)return n;if(r>(p?1:0)){for(s=n-1,i=n+1;s>=0||i<e.length;)if((a=e[_=s>=0?s--:i++])!=null&&(2&a.__u)==0&&l==a.key&&u==a.type)return _}return-1}function ye(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Fe.test(e)?n:n+"px"}function F(t,e,n,r,s){var i,_;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||ye(t.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||ye(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(de,"$1")),_=e.toLowerCase(),e=_ in t||e=="onFocusOut"||e=="onFocusIn"?_.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?r?n.u=r.u:(n.u=Y,t.addEventListener(e,i?X:G,i)):t.removeEventListener(e,i?X:G,i);else{if(s=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function ve(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=Y++;else if(e.t<n.u)return;return n(h.event?h.event(e):e)}}}function Q(t,e,n,r,s,i,_,l,u,a){var p,o,f,d,b,x,k,m,g,R,$,V,N,Ue,K,I,_e,S=e.type;if(e.constructor!=null)return null;128&n.__u&&(u=!!(32&n.__u),i=[l=e.__e=n.__e]),(p=h.__b)&&p(e);e:if(typeof S=="function")try{if(m=e.props,g="prototype"in S&&S.prototype.render,R=(p=S.contextType)&&r[p.__c],$=p?R?R.props.value:p.__:r,n.__c?k=(o=e.__c=n.__c).__=o.__E:(g?e.__c=o=new S(m,$):(e.__c=o=new B(m,$),o.constructor=S,o.render=Ve),R&&R.sub(o),o.state||(o.state={}),o.__n=r,f=o.__d=!0,o.__h=[],o._sb=[]),g&&o.__s==null&&(o.__s=o.state),g&&S.getDerivedStateFromProps!=null&&(o.__s==o.state&&(o.__s=T({},o.__s)),T(o.__s,S.getDerivedStateFromProps(m,o.__s))),d=o.props,b=o.state,o.__v=e,f)g&&S.getDerivedStateFromProps==null&&o.componentWillMount!=null&&o.componentWillMount(),g&&o.componentDidMount!=null&&o.__h.push(o.componentDidMount);else{if(g&&S.getDerivedStateFromProps==null&&m!==d&&o.componentWillReceiveProps!=null&&o.componentWillReceiveProps(m,$),e.__v==n.__v||!o.__e&&o.shouldComponentUpdate!=null&&o.shouldComponentUpdate(m,o.__s,$)===!1){for(e.__v!=n.__v&&(o.props=m,o.state=o.__s,o.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(H){H&&(H.__=e)}),V=0;V<o._sb.length;V++)o.__h.push(o._sb[V]);o._sb=[],o.__h.length&&_.push(o);break e}o.componentWillUpdate!=null&&o.componentWillUpdate(m,o.__s,$),g&&o.componentDidUpdate!=null&&o.__h.push(function(){o.componentDidUpdate(d,b,x)})}if(o.context=$,o.props=m,o.__P=t,o.__e=!1,N=h.__r,Ue=0,g){for(o.state=o.__s,o.__d=!1,N&&N(e),p=o.render(o.props,o.state,o.context),K=0;K<o._sb.length;K++)o.__h.push(o._sb[K]);o._sb=[]}else do o.__d=!1,N&&N(e),p=o.render(o.props,o.state,o.context),o.state=o.__s;while(o.__d&&++Ue<25);o.state=o.__s,o.getChildContext!=null&&(r=T(T({},r),o.getChildContext())),g&&!f&&o.getSnapshotBeforeUpdate!=null&&(x=o.getSnapshotBeforeUpdate(d,b)),I=p,p!=null&&p.type===L&&p.key==null&&(I=ke(p.props.children)),l=ge(t,D(I)?I:[I],e,n,r,s,i,_,l,u,a),o.base=e.__e,e.__u&=-161,o.__h.length&&_.push(o),k&&(o.__E=o.__=null)}catch(H){if(e.__v=null,u||i!=null)if(H.then){for(e.__u|=u?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;i[i.indexOf(l)]=null,e.__e=l}else{for(_e=i.length;_e--;)J(i[_e]);Z(e)}else e.__e=n.__e,e.__k=n.__k,H.then||Z(e);h.__e(H,e,n)}else i==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):l=e.__e=qe(n.__e,e,n,r,s,i,_,u,a);return(p=h.diffed)&&p(e),128&e.__u?void 0:l}function Z(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(Z)}function be(t,e,n){for(var r=0;r<n.length;r++)ee(n[r],n[++r],n[++r]);h.__c&&h.__c(e,t),t.some(function(s){try{t=s.__h,s.__h=[],t.some(function(i){i.call(s)})}catch(i){h.__e(i,s.__v)}})}function ke(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:D(t)?t.map(ke):T({},t)}function qe(t,e,n,r,s,i,_,l,u){var a,p,o,f,d,b,x,k=n.props||M,m=e.props,g=e.type;if(g=="svg"?s="http://www.w3.org/2000/svg":g=="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),i!=null){for(a=0;a<i.length;a++)if((d=i[a])&&"setAttribute"in d==!!g&&(g?d.localName==g:d.nodeType==3)){t=d,i[a]=null;break}}if(t==null){if(g==null)return document.createTextNode(m);t=document.createElementNS(s,g,m.is&&m),l&&(h.__m&&h.__m(e,i),l=!1),i=null}if(g==null)k===m||l&&t.data==m||(t.data=m);else{if(i=i&&E.call(t.childNodes),!l&&i!=null)for(k={},a=0;a<t.attributes.length;a++)k[(d=t.attributes[a]).name]=d.value;for(a in k)if(d=k[a],a!="children"){if(a=="dangerouslySetInnerHTML")o=d;else if(!(a in m)){if(a=="value"&&"defaultValue"in m||a=="checked"&&"defaultChecked"in m)continue;F(t,a,null,d,s)}}for(a in m)d=m[a],a=="children"?f=d:a=="dangerouslySetInnerHTML"?p=d:a=="value"?b=d:a=="checked"?x=d:l&&typeof d!="function"||k[a]===d||F(t,a,d,k[a],s);if(p)l||o&&(p.__html==o.__html||p.__html==t.innerHTML)||(t.innerHTML=p.__html),e.__k=[];else if(o&&(t.innerHTML=""),ge(e.type=="template"?t.content:t,D(f)?f:[f],e,n,r,g=="foreignObject"?"http://www.w3.org/1999/xhtml":s,i,_,i?i[0]:n.__k&&A(n,0),l,u),i!=null)for(a=i.length;a--;)J(i[a]);l||(a="value",g=="progress"&&b==null?t.removeAttribute("value"):b!=null&&(b!==t[a]||g=="progress"&&!b||g=="option"&&b!=k[a])&&F(t,a,b,k[a],s),a="checked",x!=null&&x!=t[a]&&F(t,a,x,k[a],s))}return t}function ee(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(s){h.__e(s,n)}}function we(t,e,n){var r,s;if(h.unmount&&h.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||ee(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){h.__e(i,e)}r.base=r.__P=null}if(r=t.__k)for(s=0;s<r.length;s++)r[s]&&we(r[s],e,n||typeof t.type!="function");n||J(t.__e),t.__c=t.__=t.__e=void 0}function Ve(t,e,n){return this.constructor(t,n)}function Ke(t,e,n){var r,s,i,_;e==document&&(e=document.documentElement),h.__&&h.__(t,e),s=(r=!1)?null:e.__k,i=[],_=[],Q(e,t=e.__k=je(L,null,[t]),s||M,M,e.namespaceURI,s?null:e.firstChild?E.call(e.childNodes):null,i,s?s.__e:e.firstChild,r,_),be(i,t,_)}E=fe.slice,h={__e:function(t,e,n,r){for(var s,i,_;e=e.__;)if((s=e.__c)&&!s.__)try{if((i=s.constructor)&&i.getDerivedStateFromError!=null&&(s.setState(i.getDerivedStateFromError(t)),_=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(t,r||{}),_=s.__d),_)return s.__E=s}catch(l){t=l}throw t}},le=0,B.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=T({},this.state),typeof t=="function"&&(t=t(T({},n),this.props)),t&&T(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),he(this))},B.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),he(this))},B.prototype.render=L,C=[],ce=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ue=function(t,e){return t.__v.__b-e.__v.__b},U.__r=0,de=/(PointerCapture)$|Capture$/i,Y=0,G=ve(!1),X=ve(!0);var Ye=0;function c(t,e,n,r,s,i){e||(e={});var _,l,u=e;if("ref"in u)for(l in u={},e)l=="ref"?_=e[l]:u[l]=e[l];var a={type:t,props:u,key:n,ref:_,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ye,__i:-1,__u:0,__source:s,__self:i};if(typeof t=="function"&&(_=t.defaultProps))for(l in _)u[l]===void 0&&(u[l]=_[l]);return h.vnode&&h.vnode(a),a}const Ge=t=>{const{Component:e,createRoot:n}=t,r=document.createElement("div");r.setAttribute("id","twd-sidebar-root"),document.body.appendChild(r),n(r).render(e)},Xe=async(t,e,n)=>{for(const r in t)await t[r]();Ge({Component:e,createRoot:n})};var j,y,te,xe,ne=0,Se=[],v=h,Te=v.__b,Ee=v.__r,Re=v.diffed,Ce=v.__c,$e=v.unmount,We=v.__;function Ae(t,e){v.__h&&v.__h(y,t,ne||e),ne=0;var n=y.__H||(y.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function re(t){return ne=1,Je(Me,t)}function Je(t,e,n){var r=Ae(j++,2);if(r.t=t,!r.__c&&(r.__=[Me(void 0,e),function(l){var u=r.__N?r.__N[0]:r.__[0],a=r.t(u,l);u!==a&&(r.__N=[a,r.__[1]],r.__c.setState({}))}],r.__c=y,!y.__f)){var s=function(l,u,a){if(!r.__c.__H)return!0;var p=r.__c.__H.__.filter(function(f){return!!f.__c});if(p.every(function(f){return!f.__N}))return!i||i.call(this,l,u,a);var o=r.__c.props!==l;return p.forEach(function(f){if(f.__N){var d=f.__[0];f.__=f.__N,f.__N=void 0,d!==f.__[0]&&(o=!0)}}),i&&i.call(this,l,u,a)||o};y.__f=!0;var i=y.shouldComponentUpdate,_=y.componentWillUpdate;y.componentWillUpdate=function(l,u,a){if(this.__e){var p=i;i=void 0,s(l,u,a),i=p}_&&_.call(this,l,u,a)},y.shouldComponentUpdate=s}return r.__N||r.__}function Qe(t,e){var n=Ae(j++,3);!v.__s&&tt(n.__H,e)&&(n.__=t,n.u=e,y.__H.__h.push(n))}function Ze(){for(var t;t=Se.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(z),t.__H.__h.forEach(oe),t.__H.__h=[]}catch(e){t.__H.__h=[],v.__e(e,t.__v)}}v.__b=function(t){y=null,Te&&Te(t)},v.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),We&&We(t,e)},v.__r=function(t){Ee&&Ee(t),j=0;var e=(y=t.__c).__H;e&&(te===y?(e.__h=[],y.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(z),e.__h.forEach(oe),e.__h=[],j=0)),te=y},v.diffed=function(t){Re&&Re(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Se.push(e)!==1&&xe===v.requestAnimationFrame||((xe=v.requestAnimationFrame)||et)(Ze)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),te=y=null},v.__c=function(t,e){e.some(function(n){try{n.__h.forEach(z),n.__h=n.__h.filter(function(r){return!r.__||oe(r)})}catch(r){e.some(function(s){s.__h&&(s.__h=[])}),e=[],v.__e(r,n.__v)}}),Ce&&Ce(t,e)},v.unmount=function(t){$e&&$e(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{z(r)}catch(s){e=s}}),n.__H=void 0,e&&v.__e(e,n.__v))};var He=typeof requestAnimationFrame=="function";function et(t){var e,n=function(){clearTimeout(r),He&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,35);He&&(e=requestAnimationFrame(n))}function z(t){var e=y,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),y=e}function oe(t){var e=y;t.__c=t.__(),y=e}function tt(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function Me(t,e){return typeof e=="function"?e(t):e}const nt=t=>{const e=new Map,n=[];for(const r of t)e.set(r.id,{...r,childrenNodes:[]});for(const r of e.values())r.parent?e.get(r.parent)?.childrenNodes?.push(r):n.push(r);return n},rt={animation:"spin 1s linear infinite"},ot=()=>c("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#364153",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-circle-icon lucide-loader-circle",style:rt,"data-testid":"loader-icon",children:c("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),O=document.createElement("style");O&&!document.getElementById("loader-spin-keyframes")&&(O.id="loader-spin-keyframes",O.innerHTML=`
1
+ (function(W,R){typeof exports=="object"&&typeof module<"u"?R(exports):typeof define=="function"&&define.amd?define(["exports"],R):(W=typeof globalThis<"u"?globalThis:W||self,R(W.TWD={}))})(this,(function(W){"use strict";var R,h,de,$,ue,fe,pe,he,G,J,Z,M={},ge=[],Oe=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,D=Array.isArray;function T(t,e){for(var n in e)t[n]=e[n];return t}function Q(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function qe(t,e,n){var r,i,o,l={};for(o in e)o=="key"?r=e[o]:o=="ref"?i=e[o]:l[o]=e[o];if(arguments.length>2&&(l.children=arguments.length>3?R.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)l[o]===void 0&&(l[o]=t.defaultProps[o]);return B(t,l,r,i,null)}function B(t,e,n,r,i){var o={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++de,__i:-1,__u:0};return i==null&&h.vnode!=null&&h.vnode(o),o}function H(t){return t.children}function U(t,e){this.props=t,this.context=e}function I(t,e){if(e==null)return t.__?I(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?I(t):null}function me(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return me(t)}}function ve(t){(!t.__d&&(t.__d=!0)&&$.push(t)&&!j.__r++||ue!=h.debounceRendering)&&((ue=h.debounceRendering)||fe)(j)}function j(){for(var t,e,n,r,i,o,l,_=1;$.length;)$.length>_&&$.sort(pe),t=$.shift(),_=$.length,t.__d&&(n=void 0,r=void 0,i=(r=(e=t).__v).__e,o=[],l=[],e.__P&&((n=T({},r)).__v=r.__v+1,h.vnode&&h.vnode(n),ee(e.__P,n,r,e.__n,e.__P.namespaceURI,32&r.__u?[i]:null,o,i??I(r),!!(32&r.__u),l),n.__v=r.__v,n.__.__k[n.__i]=n,Se(o,n,l),r.__e=r.__=null,n.__e!=i&&me(n)));j.__r=0}function ye(t,e,n,r,i,o,l,_,p,a,d){var s,c,u,g,S,b,v,m=r&&r.__k||ge,C=e.length;for(p=Ve(n,e,m,p,C),s=0;s<C;s++)(u=n.__k[s])!=null&&(c=u.__i==-1?M:m[u.__i]||M,u.__i=s,b=ee(t,u,c,i,o,l,_,p,a,d),g=u.__e,u.ref&&c.ref!=u.ref&&(c.ref&&ne(c.ref,null,u),d.push(u.ref,u.__c||g,u)),S==null&&g!=null&&(S=g),(v=!!(4&u.__u))||c.__k===u.__k?p=we(u,p,t,v):typeof u.type=="function"&&b!==void 0?p=b:g&&(p=g.nextSibling),u.__u&=-7);return n.__e=S,p}function Ve(t,e,n,r,i){var o,l,_,p,a,d=n.length,s=d,c=0;for(t.__k=new Array(i),o=0;o<i;o++)(l=e[o])!=null&&typeof l!="boolean"&&typeof l!="function"?(typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?l=t.__k[o]=B(null,l,null,null,null):D(l)?l=t.__k[o]=B(H,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=t.__k[o]=B(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):t.__k[o]=l,p=o+c,l.__=t,l.__b=t.__b+1,_=null,(a=l.__i=Xe(l,n,p,s))!=-1&&(s--,(_=n[a])&&(_.__u|=2)),_==null||_.__v==null?(a==-1&&(i>d?c--:i<d&&c++),typeof l.type!="function"&&(l.__u|=4)):a!=p&&(a==p-1?c--:a==p+1?c++:(a>p?c--:c++,l.__u|=4))):t.__k[o]=null;if(s)for(o=0;o<d;o++)(_=n[o])!=null&&(2&_.__u)==0&&(_.__e==r&&(r=I(_)),Te(_,_));return r}function we(t,e,n,r){var i,o;if(typeof t.type=="function"){for(i=t.__k,o=0;i&&o<i.length;o++)i[o]&&(i[o].__=t,e=we(i[o],e,n,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=I(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Xe(t,e,n,r){var i,o,l,_=t.key,p=t.type,a=e[n],d=a!=null&&(2&a.__u)==0;if(a===null&&_==null||d&&_==a.key&&p==a.type)return n;if(r>(d?1:0)){for(i=n-1,o=n+1;i>=0||o<e.length;)if((a=e[l=i>=0?i--:o++])!=null&&(2&a.__u)==0&&_==a.key&&p==a.type)return l}return-1}function be(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Oe.test(e)?n:n+"px"}function F(t,e,n,r,i){var o,l;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||be(t.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||be(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(he,"$1")),l=e.toLowerCase(),e=l in t||e=="onFocusOut"||e=="onFocusIn"?l.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?r?n.u=r.u:(n.u=G,t.addEventListener(e,o?Z:J,o)):t.removeEventListener(e,o?Z:J,o);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function ke(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=G++;else if(e.t<n.u)return;return n(h.event?h.event(e):e)}}}function ee(t,e,n,r,i,o,l,_,p,a){var d,s,c,u,g,S,b,v,m,C,E,K,z,Fe,Y,P,ce,x=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(p=!!(32&n.__u),o=[_=e.__e=n.__e]),(d=h.__b)&&d(e);e:if(typeof x=="function")try{if(v=e.props,m="prototype"in x&&x.prototype.render,C=(d=x.contextType)&&r[d.__c],E=d?C?C.props.value:d.__:r,n.__c?b=(s=e.__c=n.__c).__=s.__E:(m?e.__c=s=new x(v,E):(e.__c=s=new U(v,E),s.constructor=x,s.render=Ye),C&&C.sub(s),s.state||(s.state={}),s.__n=r,c=s.__d=!0,s.__h=[],s._sb=[]),m&&s.__s==null&&(s.__s=s.state),m&&x.getDerivedStateFromProps!=null&&(s.__s==s.state&&(s.__s=T({},s.__s)),T(s.__s,x.getDerivedStateFromProps(v,s.__s))),u=s.props,g=s.state,s.__v=e,c)m&&x.getDerivedStateFromProps==null&&s.componentWillMount!=null&&s.componentWillMount(),m&&s.componentDidMount!=null&&s.__h.push(s.componentDidMount);else{if(m&&x.getDerivedStateFromProps==null&&v!==u&&s.componentWillReceiveProps!=null&&s.componentWillReceiveProps(v,E),e.__v==n.__v||!s.__e&&s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(v,s.__s,E)===!1){for(e.__v!=n.__v&&(s.props=v,s.state=s.__s,s.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(L){L&&(L.__=e)}),K=0;K<s._sb.length;K++)s.__h.push(s._sb[K]);s._sb=[],s.__h.length&&l.push(s);break e}s.componentWillUpdate!=null&&s.componentWillUpdate(v,s.__s,E),m&&s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(u,g,S)})}if(s.context=E,s.props=v,s.__P=t,s.__e=!1,z=h.__r,Fe=0,m){for(s.state=s.__s,s.__d=!1,z&&z(e),d=s.render(s.props,s.state,s.context),Y=0;Y<s._sb.length;Y++)s.__h.push(s._sb[Y]);s._sb=[]}else do s.__d=!1,z&&z(e),d=s.render(s.props,s.state,s.context),s.state=s.__s;while(s.__d&&++Fe<25);s.state=s.__s,s.getChildContext!=null&&(r=T(T({},r),s.getChildContext())),m&&!c&&s.getSnapshotBeforeUpdate!=null&&(S=s.getSnapshotBeforeUpdate(u,g)),P=d,d!=null&&d.type===H&&d.key==null&&(P=xe(d.props.children)),_=ye(t,D(P)?P:[P],e,n,r,i,o,l,_,p,a),s.base=e.__e,e.__u&=-161,s.__h.length&&l.push(s),b&&(s.__E=s.__=null)}catch(L){if(e.__v=null,p||o!=null)if(L.then){for(e.__u|=p?160:128;_&&_.nodeType==8&&_.nextSibling;)_=_.nextSibling;o[o.indexOf(_)]=null,e.__e=_}else{for(ce=o.length;ce--;)Q(o[ce]);te(e)}else e.__e=n.__e,e.__k=n.__k,L.then||te(e);h.__e(L,e,n)}else o==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):_=e.__e=Ke(n.__e,e,n,r,i,o,l,p,a);return(d=h.diffed)&&d(e),128&e.__u?void 0:_}function te(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(te)}function Se(t,e,n){for(var r=0;r<n.length;r++)ne(n[r],n[++r],n[++r]);h.__c&&h.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(o){o.call(i)})}catch(o){h.__e(o,i.__v)}})}function xe(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:D(t)?t.map(xe):T({},t)}function Ke(t,e,n,r,i,o,l,_,p){var a,d,s,c,u,g,S,b=n.props||M,v=e.props,m=e.type;if(m=="svg"?i="http://www.w3.org/2000/svg":m=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(a=0;a<o.length;a++)if((u=o[a])&&"setAttribute"in u==!!m&&(m?u.localName==m:u.nodeType==3)){t=u,o[a]=null;break}}if(t==null){if(m==null)return document.createTextNode(v);t=document.createElementNS(i,m,v.is&&v),_&&(h.__m&&h.__m(e,o),_=!1),o=null}if(m==null)b===v||_&&t.data==v||(t.data=v);else{if(o=o&&R.call(t.childNodes),!_&&o!=null)for(b={},a=0;a<t.attributes.length;a++)b[(u=t.attributes[a]).name]=u.value;for(a in b)if(u=b[a],a!="children"){if(a=="dangerouslySetInnerHTML")s=u;else if(!(a in v)){if(a=="value"&&"defaultValue"in v||a=="checked"&&"defaultChecked"in v)continue;F(t,a,null,u,i)}}for(a in v)u=v[a],a=="children"?c=u:a=="dangerouslySetInnerHTML"?d=u:a=="value"?g=u:a=="checked"?S=u:_&&typeof u!="function"||b[a]===u||F(t,a,u,b[a],i);if(d)_||s&&(d.__html==s.__html||d.__html==t.innerHTML)||(t.innerHTML=d.__html),e.__k=[];else if(s&&(t.innerHTML=""),ye(e.type=="template"?t.content:t,D(c)?c:[c],e,n,r,m=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,l,o?o[0]:n.__k&&I(n,0),_,p),o!=null)for(a=o.length;a--;)Q(o[a]);_||(a="value",m=="progress"&&g==null?t.removeAttribute("value"):g!=null&&(g!==t[a]||m=="progress"&&!g||m=="option"&&g!=b[a])&&F(t,a,g,b[a],i),a="checked",S!=null&&S!=t[a]&&F(t,a,S,b[a],i))}return t}function ne(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(i){h.__e(i,n)}}function Te(t,e,n){var r,i;if(h.unmount&&h.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||ne(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){h.__e(o,e)}r.base=r.__P=null}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&Te(r[i],e,n||typeof t.type!="function");n||Q(t.__e),t.__c=t.__=t.__e=void 0}function Ye(t,e,n){return this.constructor(t,n)}function Ge(t,e,n){var r,i,o,l;e==document&&(e=document.documentElement),h.__&&h.__(t,e),i=(r=!1)?null:e.__k,o=[],l=[],ee(e,t=e.__k=qe(H,null,[t]),i||M,M,e.namespaceURI,i?null:e.firstChild?R.call(e.childNodes):null,o,i?i.__e:e.firstChild,r,l),Se(o,t,l)}R=ge.slice,h={__e:function(t,e,n,r){for(var i,o,l;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(t)),l=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,r||{}),l=i.__d),l)return i.__E=i}catch(_){t=_}throw t}},de=0,U.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=T({},this.state),typeof t=="function"&&(t=t(T({},n),this.props)),t&&T(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),ve(this))},U.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),ve(this))},U.prototype.render=H,$=[],fe=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,pe=function(t,e){return t.__v.__b-e.__v.__b},j.__r=0,he=/(PointerCapture)$|Capture$/i,G=0,J=ke(!1),Z=ke(!0);var Je=0;function f(t,e,n,r,i,o){e||(e={});var l,_,p=e;if("ref"in p)for(_ in p={},e)_=="ref"?l=e[_]:p[_]=e[_];var a={type:t,props:p,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Je,__i:-1,__u:0,__source:i,__self:o};if(typeof t=="function"&&(l=t.defaultProps))for(_ in l)p[_]===void 0&&(p[_]=l[_]);return h.vnode&&h.vnode(a),a}const Ze={primary:"#3b82f6",background:"#1e293b",backgroundSecondary:"#334155",border:"#475569",borderLight:"#64748b",text:"#f1f5f9",textSecondary:"#cbd5e1",textMuted:"#94a3b8",success:"#22c55e",successBg:"#14532d",error:"#ef4444",errorBg:"#7f1d1d",warning:"#fbbf24",warningBg:"#78350f",skip:"#475569",skipBg:"#334155",buttonPrimary:"#3b82f6",buttonPrimaryText:"#ffffff",buttonSecondary:"#334155",buttonSecondaryText:"#f1f5f9",buttonBorder:"#475569",spacingXs:"4px",spacingSm:"6px",spacingMd:"8px",spacingLg:"12px",spacingXl:"14px",fontSizeXs:"10px",fontSizeSm:"12px",fontSizeMd:"14px",fontSizeLg:"16px",fontWeightNormal:"400",fontWeightMedium:"500",fontWeightBold:"700",sidebarWidth:"320px",borderRadius:"8px",borderRadiusLg:"6px",shadow:"2px 0 8px rgba(0,0,0,0.3)",shadowSm:"0 2px 4px rgba(0, 0, 0, 0.2)",zIndexSidebar:"1000",zIndexSticky:"1000",animationDuration:"0.2s",iconColor:"#f1f5f9",iconColorSecondary:"#cbd5e1"};function Qe(t={}){const e={...Ze,...t};return Object.entries(e).map(([n,r])=>`${`--twd-${n.replace(/([A-Z])/g,"-$1").toLowerCase()}`}: ${r};`).join(`
2
+ `)}function et(t){const e="twd-theme-variables";let n=document.getElementById(e);n||(n=document.createElement("style"),n.id=e,document.head.appendChild(n));const r=Qe(t);n.textContent=`
3
+ :root {
4
+ ${r}
5
+ }
6
+ `}const tt=t=>{const{Component:e,createRoot:n,theme:r}=t;et(r);const i=document.createElement("div");i.setAttribute("id","twd-sidebar-root"),document.body.appendChild(i),n(i).render(e)},nt=async(t,e,n,r)=>{for(const i in t)await t[i]();tt({Component:e,createRoot:n,theme:r})};var A,y,re,Re,O=0,Ce=[],w=h,$e=w.__b,Ee=w.__r,We=w.diffed,Ie=w.__c,Le=w.unmount,Me=w.__;function oe(t,e){w.__h&&w.__h(y,t,O||e),O=0;var n=y.__H||(y.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function se(t){return O=1,rt(Ne,t)}function rt(t,e,n){var r=oe(A++,2);if(r.t=t,!r.__c&&(r.__=[Ne(void 0,e),function(_){var p=r.__N?r.__N[0]:r.__[0],a=r.t(p,_);p!==a&&(r.__N=[a,r.__[1]],r.__c.setState({}))}],r.__c=y,!y.__f)){var i=function(_,p,a){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(c){return!!c.__c});if(d.every(function(c){return!c.__N}))return!o||o.call(this,_,p,a);var s=r.__c.props!==_;return d.forEach(function(c){if(c.__N){var u=c.__[0];c.__=c.__N,c.__N=void 0,u!==c.__[0]&&(s=!0)}}),o&&o.call(this,_,p,a)||s};y.__f=!0;var o=y.shouldComponentUpdate,l=y.componentWillUpdate;y.componentWillUpdate=function(_,p,a){if(this.__e){var d=o;o=void 0,i(_,p,a),o=d}l&&l.call(this,_,p,a)},y.shouldComponentUpdate=i}return r.__N||r.__}function ie(t,e){var n=oe(A++,3);!w.__s&&Ae(n.__H,e)&&(n.__=t,n.u=e,y.__H.__h.push(n))}function N(t){return O=5,ot(function(){return{current:t}},[])}function ot(t,e){var n=oe(A++,7);return Ae(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function st(){for(var t;t=Ce.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(q),t.__H.__h.forEach(ae),t.__H.__h=[]}catch(e){t.__H.__h=[],w.__e(e,t.__v)}}w.__b=function(t){y=null,$e&&$e(t)},w.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Me&&Me(t,e)},w.__r=function(t){Ee&&Ee(t),A=0;var e=(y=t.__c).__H;e&&(re===y?(e.__h=[],y.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(q),e.__h.forEach(ae),e.__h=[],A=0)),re=y},w.diffed=function(t){We&&We(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Ce.push(e)!==1&&Re===w.requestAnimationFrame||((Re=w.requestAnimationFrame)||it)(st)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),re=y=null},w.__c=function(t,e){e.some(function(n){try{n.__h.forEach(q),n.__h=n.__h.filter(function(r){return!r.__||ae(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],w.__e(r,n.__v)}}),Ie&&Ie(t,e)},w.unmount=function(t){Le&&Le(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{q(r)}catch(i){e=i}}),n.__H=void 0,e&&w.__e(e,n.__v))};var He=typeof requestAnimationFrame=="function";function it(t){var e,n=function(){clearTimeout(r),He&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,35);He&&(e=requestAnimationFrame(n))}function q(t){var e=y,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),y=e}function ae(t){var e=y;t.__c=t.__(),y=e}function Ae(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function Ne(t,e){return typeof e=="function"?e(t):e}const at=t=>{const e=new Map,n=[];for(const r of t)e.set(r.id,{...r,childrenNodes:[]});for(const r of e.values())r.parent?e.get(r.parent)?.childrenNodes?.push(r):n.push(r);return n},lt={animation:"spin 1s linear infinite"},_t=()=>f("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--twd-icon-color-secondary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-circle-icon lucide-loader-circle",style:lt,"data-testid":"loader-icon",children:f("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),V=document.createElement("style");V&&!document.getElementById("loader-spin-keyframes")&&(V.id="loader-spin-keyframes",V.innerHTML=`
2
7
  @keyframes spin {
3
8
  0% { transform: rotate(0deg); }
4
9
  100% { transform: rotate(360deg); }
5
10
  }
6
- `,document.head.appendChild(O));const q=({className:t,children:e,dataTestId:n})=>c("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#000",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`lucide ${t}`,"data-testid":n,children:e}),it=()=>c(q,{className:"lucide-play-icon lucide-play",dataTestId:"play-icon",children:c("path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"})}),Le=({id:t,name:e,skip:n,only:r})=>c(L,{children:[e," ",r&&c("span",{style:{color:"#2563eb"},"data-testid":`only-indicator-${t}`,children:[" ","(only)"]}),n&&c("span",{style:{color:"#6b7280"},"data-testid":`skip-indicator-${t}`,children:[" ","(skipped)"]})]}),st=t=>{switch(t.status){case"pass":return{item:{background:"#dcfce7"},container:{borderLeft:"3px solid #00c951"}};case"fail":return{item:{background:"#fee2e2"},container:{borderLeft:"3px solid #fb2c36"}};case"skip":return{item:{background:"#f3f4f6"}};case"running":return{item:{background:"#fef9c3"}};default:return{item:{background:"transparent"}}}},_t=t=>t.startsWith("Assertion passed")||t.startsWith("Event fired")?{color:"#0d542b",fontWeight:"700"}:t.startsWith("Test failed")?{color:"#fb2c36",fontWeight:"700"}:{},lt=({node:t,depth:e,id:n,runTest:r})=>{const s=st(t);return c("li",{style:{marginBottom:"4px",marginLeft:e*6,...s.container},"data-testid":`test-list-item-${n}`,children:[c("div",{style:{display:"flex",alignItems:"left",justifyContent:"space-between",padding:"4px 6px",borderRadius:"4px",...s.item},children:[c("span",{style:{fontWeight:"500",color:"#374151",maxWidth:"220px"},children:c(Le,{id:n,name:t.name,skip:t.skip,only:t.only})}),c("button",{onClick:()=>r(n),"aria-label":`Run ${t.name} test`,style:{background:"transparent",border:"1px solid #d1d5db",borderRadius:"4px",padding:"0",cursor:"pointer",verticalAlign:"middle",fontSize:"12px",width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"},disabled:t.status==="running","data-testid":`run-test-button-${n}`,children:t.status==="running"?c(ot,{}):c(it,{})})]}),t.logs&&t.logs.length>0&&c("ul",{style:{borderRadius:"4px",maxHeight:"260px",overflowY:"auto",padding:0,background:"#f3f4f6",listStyle:"none",marginTop:"4px",textAlign:"left"},children:t.logs.map((i,_)=>c("li",{style:{fontSize:"12px",padding:"4px 6px",borderBottom:"1px solid #d1d5db",color:"#374151",..._t(i)},children:i},_))})]},t.name)},at=()=>c(q,{className:"lucide-chevron-down-icon lucide-chevron-down",dataTestId:"chevron-down-icon",children:c("path",{d:"m6 9 6 6 6-6"})}),ct=()=>c(q,{className:"lucide-chevron-right-icon lucide-chevron-right",dataTestId:"chevron-right-icon",children:c("path",{d:"m9 18 6-6-6-6"})}),ut=({tests:t,runTest:e})=>{const[n,r]=re({}),s=l=>r(u=>({...u,[l]:!u[l]})),i=(l,u=0)=>{if(l.type==="test")return c(lt,{node:l,depth:u,id:l.id,runTest:()=>e(l.id)},l.id);const a=n[l.id];return c("li",{style:{marginLeft:u*12},children:[c("span",{style:{fontWeight:"bold",cursor:"pointer",color:"#374151",display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"4px",gap:"6px"},"data-testid":`test-group-${l.name}`,tabIndex:0,role:"button","aria-expanded":!a,onClick:()=>s(l.id),children:[c(Le,{id:l.id,name:l.name,skip:l.skip,only:l.only}),a?c(ct,{}):c(at,{})]}),!a&&l.childrenNodes&&l.childrenNodes.length>0&&c("ul",{style:{listStyle:"none",padding:0,margin:0},children:l.childrenNodes.map(p=>i(p,u+1))})]},l.id)},_=nt(t);return c("ul",{style:{listStyle:"none",padding:0,margin:0},children:_.map(l=>i(l))})},dt={left:{left:0,borderTopRightRadius:"6px",borderBottomRightRadius:"6px",borderTopLeftRadius:"0",borderBottomLeftRadius:"0"},right:{right:0,borderTopLeftRadius:"6px",borderBottomLeftRadius:"6px",borderTopRightRadius:"0",borderBottomRightRadius:"0"}},ft=({setOpen:t,position:e})=>c("button",{"aria-label":"Open TWD sidebar",style:{position:"fixed",top:"50%",transform:"translateY(-50%)",background:"#1A6EF4",color:"white",padding:"6px 10px",cursor:"pointer",fontSize:"12px",...dt[e]},onClick:()=>t(!0),children:"TWD"}),pt=({isOpen:t,position:e})=>{Qe(()=>{const n=document.documentElement;return t?e==="left"?n.style.marginLeft="280px":n.style.marginRight="280px":(n.style.marginRight="0",n.style.marginLeft="0"),()=>{n.style.marginRight="0",n.style.marginLeft="0"}},[t,e])},ie=typeof window<"u"?(window.__TWD_STATE__||(window.__TWD_STATE__={handlers:new Map,beforeEachHooks:new Map,afterEachHooks:new Map,stack:[]}),window.__TWD_STATE__):{handlers:new Map,beforeEachHooks:new Map,afterEachHooks:new Map,stack:[]},w=ie.handlers,Ne=ie.beforeEachHooks,Ie=ie.afterEachHooks,ht=t=>{const e=[],n=[];let r=t;for(;r;)Ne.has(r)&&e.unshift(...Ne.get(r)),Ie.has(r)&&n.push(...Ie.get(r)),r=w.get(r)?.parent;return{before:e,after:n}},se=t=>{const e=w.get(t);return e?e.only?!0:e.children?e.children.some(n=>se(n)):!1:!1},gt=t=>{let e=w.get(t);for(;e?.parent;){const n=w.get(e.parent);if(n?.only)return!0;e=n}return!1},De=t=>{let e=w.get(t);for(;e;){if(e.skip)return!0;if(!e.parent)break;e=w.get(e.parent)}return!1};class Pe{events;constructor(e){this.events=e}async runAll(){const e=Array.from(w.values()).filter(r=>!r.parent&&r.type==="suite"),n=Array.from(w.values()).some(r=>r.only);for(const r of e)await this.runSuite(r,n);return w}async runSingle(e){const n=w.get(e);if(!n||n.type!=="test")return;await this.runTest(n,!1)}async runSuite(e,n){if(De(e.id)&&!se(e.id)){this.events.onSkip?.(e);return}if(n&&!se(e.id))return;this.events.onSuiteStart?.(e);const s=(e.children||[]).map(i=>w.get(i));for(const i of s)i.type==="suite"?await this.runSuite(i,n):i.type==="test"&&await this.runTest(i,n);this.events.onSuiteEnd?.(e)}async runTest(e,n){if((De(e.id)||e.skip)&&!e.only){this.events.onSkip(e);return}const s=gt(e.id);if(n&&!e.only&&!s){this.events.onSkip(e);return}this.events.onStart?.(e);const i=ht(e.parent);try{for(const _ of i.before)await _();e.logs=[],await e.handler(),this.events.onPass(e)}catch(_){this.events.onFail(e,_)}finally{for(const _ of i.after)await _()}}}window.__testRunner=Pe;const mt="1.3.3",Be=(typeof window<"u"?(window.__TWD_MOCK_STATE__||(window.__TWD_MOCK_STATE__={rules:[]}),window.__TWD_MOCK_STATE__):{rules:[]}).rules,yt=async t=>{if("serviceWorker"in navigator){const e=t??"/mock-sw.js";await navigator.serviceWorker.register(`${e}?v=${mt}`),navigator.serviceWorker.controller||await new Promise(n=>{navigator.serviceWorker.addEventListener("controllerchange",n,{once:!0})}),navigator.serviceWorker.addEventListener("message",n=>{if(n.data?.type==="EXECUTED"){const{alias:r,request:s}=n.data,i=Be.find(_=>_.alias===r);i&&(i.executed=!0,i.request=s)}})}},vt=()=>Be,bt=()=>c(q,{className:"lucide-wifi-pen-icon lucide-wifi-pen",dataTestId:"wifi-pen-icon",children:[c("path",{d:"M2 8.82a15 15 0 0 1 20 0"}),c("path",{d:"M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z"}),c("path",{d:"M5 12.859a10 10 0 0 1 10.5-2.222"}),c("path",{d:"M8.5 16.429a5 5 0 0 1 3-1.406"})]}),kt=()=>{const t=vt(),e=t.filter(r=>r.executed);return c("button",{onClick:()=>{console.group("🌐 TWD Mock Rules"),console.log("Total rules:",t.length),console.log("Triggered rules:",e.length),console.log("Rules details:"),console.log(t),console.groupEnd()},"aria-label":"View mock rules details in console",style:{background:"#f8fafc",border:"1px solid #cbd5e1",borderRadius:"6px",padding:"8px 12px",cursor:"pointer",fontSize:"12px",color:"#475569",display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px",width:"100%",textAlign:"left",transition:"all 0.2s ease",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.05)"},children:[c(bt,{}),c("span",{style:{flex:1},children:["Rules: ",e.length,"/",t.length," triggered"]}),c("span",{style:{fontSize:"10px",color:"#1E293B",fontWeight:"500"},children:"View rules in console"})]})},wt={left:{left:0,borderRight:"1px solid #e5e7eb"},right:{right:0,borderLeft:"1px solid #e5e7eb"}},xt='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',St=({open:t,position:e="left"})=>{const[n,r]=re(0),[s,i]=re(t);pt({isOpen:s,position:e});const _=new Pe({onStart:o=>{o.status="running",r(f=>f+1)},onPass:o=>{o.status="pass",r(f=>f+1)},onFail:(o,f)=>{o.status="fail",console.error("Test failed:",o.name,f),o.logs.push(`Test failed: ${f.message}`),r(d=>d+1)},onSkip:o=>{o.status="skip",r(f=>f+1)}}),l=async()=>{await _.runAll()},u=async o=>{const f=Array.from(w.values()).filter(d=>d.type==="test").find(d=>d.id===o);f&&await _.runSingle(f.id)},a=Array.from(w.values());if(!s)return c(ft,{position:e,setOpen:i});const p=a.filter(o=>o.type==="test").length;return c("div",{style:{fontFamily:xt,position:"fixed",top:0,bottom:0,width:"280px",background:"#f9fafb",fontSize:"14px",overflowY:"auto",boxShadow:"2px 0 6px rgba(0,0,0,0.1)",textAlign:"left",zIndex:1e3,...wt[e]},"data-testid":"twd-sidebar",children:[c("div",{style:{padding:"8px",background:"#f9fafb",position:"sticky",top:0,zIndex:1e3,borderBottom:"1px solid #e5e7eb"},children:[c("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"14px"},children:[c("button",{onClick:l,style:{background:"#1A6EF4",color:"white",padding:"4px 8px",borderRadius:"4px",border:"none",cursor:"pointer"},children:"Run All"}),c("button",{"aria-label":"Close sidebar",style:{background:"transparent",border:"none",cursor:"pointer",fontSize:"14px",paddingRight:"0",paddingLeft:"0"},onClick:()=>i(!1),children:"✖"})]}),c("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"14px",color:"#6b7280",marginBottom:"10px"},children:[c("span",{style:{color:"#374151"},children:["Total: ",p]}),c("div",{style:{display:"flex",gap:"4px"},children:[c("span",{style:{color:"#00c951"},children:["✓ ",a.filter(o=>o.status==="pass").length]}),c("span",{style:{color:"#fb2c36"},children:["✗ ",a.filter(o=>o.status==="fail").length]})]})]}),c(kt,{})]}),c("div",{style:{padding:"8px"},children:c(ut,{tests:a.map(o=>({name:o.name,depth:o.depth,status:o.status,logs:o.logs,id:o.id,parent:o.parent,type:o.type,only:o.only,skip:o.skip})),runTest:u})})]})},Tt=t=>({render:e=>{Ke(e,t)}}),Et=(t,e)=>{const{open:n=!0,position:r="left",serviceWorker:s=!0,serviceWorkerUrl:i="/mock-sw.js"}=e||{};Xe(t,c(St,{open:n,position:r}),Tt),s&&yt(i).then(()=>{console.log("Request mocking initialized")}).catch(_=>{console.error("Error initializing request mocking:",_)})};W.initTWD=Et,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})}));
11
+ `,document.head.appendChild(V));const X=({className:t,children:e,dataTestId:n})=>f("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--twd-icon-color)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`lucide ${t}`,"data-testid":n,children:e}),ct=()=>f(X,{className:"lucide-play-icon lucide-play",dataTestId:"play-icon",children:f("path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"})}),ze=({id:t,name:e,skip:n,only:r})=>f(H,{children:[e," ",r&&f("span",{style:{color:"var(--twd-primary)"},"data-testid":`only-indicator-${t}`,children:[" ","(only)"]}),n&&f("span",{style:{color:"var(--twd-text-secondary)"},"data-testid":`skip-indicator-${t}`,children:[" ","(skipped)"]})]}),dt=t=>{switch(t.status){case"pass":return{item:{background:"var(--twd-success-bg)"},container:{borderLeft:"3px solid var(--twd-success)"}};case"fail":return{item:{background:"var(--twd-error-bg)"},container:{borderLeft:"3px solid var(--twd-error)"}};case"skip":return{item:{background:"var(--twd-skip-bg)"}};case"running":return{item:{background:"var(--twd-warning-bg)"}};default:return{item:{background:"transparent"}}}},ut=t=>t.startsWith("Assertion passed")||t.startsWith("Event fired")?{color:"var(--twd-success)",fontWeight:"var(--twd-font-weight-bold)"}:t.startsWith("Test failed")?{color:"var(--twd-error)",fontWeight:"var(--twd-font-weight-bold)"}:{},ft=({node:t,depth:e,id:n,runTest:r})=>{const i=dt(t),o=N(null),l=N(t.status),_=N(t.logs?.length||0),p=typeof window<"u"&&sessionStorage.getItem("twd-last-run-test-name")===t.name;ie(()=>{const d=o.current;if(!d||!t.logs||t.logs.length===0)return;const s=l.current==="running"&&(t.status==="pass"||t.status==="fail"),c=t.logs.length>_.current;(s||c)&&setTimeout(()=>{d.scrollTop=d.scrollHeight},0),l.current=t.status,_.current=t.logs.length},[t.status,t.logs]);const a=()=>{switch(t.status){case"pass":return"passed";case"fail":return"failed";case"running":return"running";case"skip":return"skipped";default:return"not run"}};return f("li",{style:{marginBottom:"var(--twd-spacing-xs)",marginLeft:`calc(${e} * var(--twd-spacing-sm))`,...i.container},"data-testid":`test-list-item-${n}`,"data-test-name":t.name,role:"listitem","aria-label":`Test ${t.name}, status: ${a()}`,children:[f("div",{style:{display:"flex",alignItems:"left",justifyContent:"space-between",padding:"var(--twd-spacing-xs) var(--twd-spacing-sm)",borderRadius:"var(--twd-border-radius)",...i.item,...p&&{border:"1px dashed var(--twd-border)"}},children:[f("span",{style:{fontWeight:"var(--twd-font-weight-medium)",color:"var(--twd-text)",maxWidth:"220px"},children:f(ze,{id:n,name:t.name,skip:t.skip,only:t.only})}),f("button",{onClick:()=>r(n),"aria-label":`Run ${t.name} test`,style:{background:"transparent",border:"1px solid var(--twd-border-light)",borderRadius:"var(--twd-border-radius)",padding:"0",cursor:"pointer",verticalAlign:"middle",fontSize:"var(--twd-font-size-sm)",width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"},disabled:t.status==="running","data-testid":`run-test-button-${n}`,children:t.status==="running"?f(_t,{}):f(ct,{})})]}),t.logs&&t.logs.length>0&&f("ul",{ref:o,style:{borderRadius:"var(--twd-border-radius)",maxHeight:"260px",overflowY:"auto",padding:0,background:"var(--twd-background-secondary)",listStyle:"none",marginTop:"var(--twd-spacing-xs)",textAlign:"left"},children:t.logs.map((d,s)=>f("li",{style:{fontSize:"var(--twd-font-size-sm)",padding:"var(--twd-spacing-xs) var(--twd-spacing-sm)",borderBottom:"1px solid var(--twd-border-light)",color:"var(--twd-text)",...ut(d)},children:d},s))})]},t.name)},pt=()=>f(X,{className:"lucide-chevron-down-icon lucide-chevron-down",dataTestId:"chevron-down-icon",children:f("path",{d:"m6 9 6 6 6-6"})}),ht=()=>f(X,{className:"lucide-chevron-right-icon lucide-chevron-right",dataTestId:"chevron-right-icon",children:f("path",{d:"m9 18 6-6-6-6"})}),gt=({tests:t,runTest:e})=>{const[n,r]=se({}),i=N(null),o=N(!1),l=a=>r(d=>({...d,[a]:!d[a]}));ie(()=>{if(o.current)return;const a=sessionStorage.getItem("twd-last-run-test-name");if(!a)return;const d=setTimeout(()=>{const s=document.querySelector(`[data-test-name="${a}"]`);if(s){const c=i.current?.closest('[data-testid="twd-sidebar"]');if(c){const u=s.getBoundingClientRect(),g=c.getBoundingClientRect(),S=c.scrollTop,b=u.top-g.top+S;c.scrollTo({top:b-150,behavior:"smooth"})}o.current=!0}},100);return()=>clearTimeout(d)},[]);const _=(a,d=0)=>{if(a.type==="test")return f(ft,{node:a,depth:d,id:a.id,runTest:()=>e(a.id)},a.id);const s=n[a.id];return f("li",{style:{marginLeft:`calc(${d} * var(--twd-spacing-lg))`},children:[f("span",{style:{fontWeight:"var(--twd-font-weight-bold)",cursor:"pointer",color:"var(--twd-text)",display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"var(--twd-spacing-xs)",gap:"var(--twd-spacing-sm)"},"data-testid":`test-group-${a.name}`,tabIndex:0,role:"button","aria-expanded":!s,"aria-label":`${s?"Expand":"Collapse"} test suite ${a.name}`,onClick:()=>l(a.id),children:[f(ze,{id:a.id,name:a.name,skip:a.skip,only:a.only}),s?f(ht,{}):f(pt,{})]}),!s&&a.childrenNodes&&a.childrenNodes.length>0&&f("ul",{style:{listStyle:"none",padding:0,margin:0},children:a.childrenNodes.map(c=>_(c,d+1))})]},a.id)},p=at(t);return f("ul",{ref:i,style:{listStyle:"none",padding:0,margin:0},role:"list","aria-label":"Test list",children:p.map(a=>_(a))})},mt={left:{left:0,borderTopRightRadius:"var(--twd-border-radius-lg)",borderBottomRightRadius:"var(--twd-border-radius-lg)",borderTopLeftRadius:"0",borderBottomLeftRadius:"0"},right:{right:0,borderTopLeftRadius:"var(--twd-border-radius-lg)",borderBottomLeftRadius:"var(--twd-border-radius-lg)",borderTopRightRadius:"0",borderBottomRightRadius:"0"}},vt=({setOpen:t,position:e})=>f("button",{"aria-label":"Open TWD sidebar",style:{position:"fixed",top:"50%",transform:"translateY(-50%)",background:"var(--twd-button-primary)",color:"var(--twd-button-primary-text)",padding:"var(--twd-spacing-sm) 10px",cursor:"pointer",fontSize:"var(--twd-font-size-sm)",...mt[e]},onClick:()=>t(!0),children:"TWD"}),yt=({isOpen:t,position:e})=>{ie(()=>{const n=document.documentElement,r=getComputedStyle(document.documentElement).getPropertyValue("--twd-sidebar-width")||"280px";return t?e==="left"?n.style.marginLeft=r:n.style.marginRight=r:(n.style.marginRight="0",n.style.marginLeft="0"),()=>{n.style.marginRight="0",n.style.marginLeft="0"}},[t,e])},le=typeof window<"u"?(window.__TWD_STATE__||(window.__TWD_STATE__={handlers:new Map,beforeEachHooks:new Map,afterEachHooks:new Map,stack:[]}),window.__TWD_STATE__):{handlers:new Map,beforeEachHooks:new Map,afterEachHooks:new Map,stack:[]},k=le.handlers,Pe=le.beforeEachHooks,De=le.afterEachHooks,wt=t=>{const e=[],n=[];let r=t;for(;r;)Pe.has(r)&&e.unshift(...Pe.get(r)),De.has(r)&&n.push(...De.get(r)),r=k.get(r)?.parent;return{before:e,after:n}},_e=t=>{const e=k.get(t);return e?e.only?!0:e.children?e.children.some(n=>_e(n)):!1:!1},bt=t=>{let e=k.get(t);for(;e?.parent;){const n=k.get(e.parent);if(n?.only)return!0;e=n}return!1},Be=t=>{let e=k.get(t);for(;e;){if(e.skip)return!0;if(!e.parent)break;e=k.get(e.parent)}return!1};class Ue{events;constructor(e){this.events=e}async runAll(){const e=Array.from(k.values()).filter(r=>!r.parent&&r.type==="suite"),n=Array.from(k.values()).some(r=>r.only);for(const r of e)await this.runSuite(r,n);return k}async runSingle(e){const n=k.get(e);if(!n||n.type!=="test")return;await this.runTest(n,!1)}async runSuite(e,n){if(Be(e.id)&&!_e(e.id)){this.events.onSkip?.(e);return}if(n&&!_e(e.id))return;this.events.onSuiteStart?.(e);const i=(e.children||[]).map(o=>k.get(o));for(const o of i)o.type==="suite"?await this.runSuite(o,n):o.type==="test"&&await this.runTest(o,n);this.events.onSuiteEnd?.(e)}async runTest(e,n){if((Be(e.id)||e.skip)&&!e.only){this.events.onSkip(e);return}const i=bt(e.id);if(n&&!e.only&&!i){this.events.onSkip(e);return}this.events.onStart?.(e);const o=wt(e.parent);try{for(const l of o.before)await l();e.logs=[],await e.handler(),this.events.onPass(e)}catch(l){this.events.onFail(e,l)}finally{for(const l of o.after)await l()}}}window.__testRunner=Ue;const kt="1.4.0",je=(typeof window<"u"?(window.__TWD_MOCK_STATE__||(window.__TWD_MOCK_STATE__={rules:[]}),window.__TWD_MOCK_STATE__):{rules:[]}).rules,St=async t=>{if("serviceWorker"in navigator){const e=t??"/mock-sw.js";await navigator.serviceWorker.register(`${e}?v=${kt}`),navigator.serviceWorker.controller||await new Promise(n=>{navigator.serviceWorker.addEventListener("controllerchange",n,{once:!0})}),navigator.serviceWorker.addEventListener("message",n=>{if(n.data?.type==="EXECUTED"){const{alias:r,request:i}=n.data,o=je.find(l=>l.alias===r);o&&(o.executed=!0,o.request=i)}})}},xt=()=>je,Tt=()=>f(X,{className:"lucide-wifi-pen-icon lucide-wifi-pen",dataTestId:"wifi-pen-icon",children:[f("path",{d:"M2 8.82a15 15 0 0 1 20 0"}),f("path",{d:"M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z"}),f("path",{d:"M5 12.859a10 10 0 0 1 10.5-2.222"}),f("path",{d:"M8.5 16.429a5 5 0 0 1 3-1.406"})]}),Rt=()=>{const t=xt(),e=t.filter(r=>r.executed);return f("button",{onClick:()=>{console.group("🌐 TWD Mock Rules"),console.log("Total rules:",t.length),console.log("Triggered rules:",e.length),console.log("Rules details:"),console.log(t),console.groupEnd()},"aria-label":"View mock rules details in console",style:{background:"var(--twd-button-secondary)",border:"1px solid var(--twd-button-border)",borderRadius:"var(--twd-border-radius-lg)",padding:"var(--twd-spacing-md) var(--twd-spacing-lg)",cursor:"pointer",fontSize:"var(--twd-font-size-sm)",color:"var(--twd-button-secondary-text)",display:"flex",alignItems:"center",gap:"var(--twd-spacing-md)",marginBottom:"10px",width:"100%",textAlign:"left",transition:"all var(--twd-animation-duration) ease",boxShadow:"var(--twd-shadow-sm)"},children:[f(Tt,{}),f("span",{style:{flex:1},children:["Rules: ",e.length,"/",t.length," triggered"]}),f("span",{style:{fontSize:"var(--twd-font-size-xs)",color:"var(--twd-text)",fontWeight:"var(--twd-font-weight-medium)"},children:"View rules in console"})]})},Ct={left:{left:0,borderRight:"1px solid var(--twd-border)"},right:{right:0,borderLeft:"1px solid var(--twd-border)"}},$t='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',Et=t=>sessionStorage.getItem("twd-sidebar-open")?sessionStorage.getItem("twd-sidebar-open")==="true":t,Wt=({open:t,position:e="left"})=>{const[n,r]=se(0),[i,o]=se(Et(t));yt({isOpen:i,position:e});const l=new Ue({onStart:c=>{c.status="running",r(u=>u+1)},onPass:c=>{c.status="pass",r(u=>u+1)},onFail:(c,u)=>{c.status="fail",console.error("Test failed:",c.name,u),c.logs.push(`Test failed: ${u.message}`),r(g=>g+1)},onSkip:c=>{c.status="skip",r(u=>u+1)}}),_=c=>{o(c),sessionStorage.setItem("twd-sidebar-open",c.toString())},p=async()=>{sessionStorage.removeItem("twd-last-run-test-name"),await l.runAll()},a=async c=>{const u=Array.from(k.values()).filter(g=>g.type==="test").find(g=>g.id===c);u&&(sessionStorage.setItem("twd-last-run-test-name",u.name),await l.runSingle(u.id))},d=Array.from(k.values());if(!i)return f(vt,{position:e,setOpen:_});const s=d.filter(c=>c.type==="test").length;return f("div",{style:{fontFamily:$t,position:"fixed",top:0,bottom:0,width:"var(--twd-sidebar-width)",background:"var(--twd-background)",fontSize:"var(--twd-font-size-md)",overflowY:"auto",boxShadow:"var(--twd-shadow)",textAlign:"left",zIndex:"var(--twd-z-index-sidebar)",...Ct[e]},"data-testid":"twd-sidebar",role:"complementary","aria-label":"Test While Developing sidebar",children:[f("div",{style:{padding:"var(--twd-spacing-md)",background:"var(--twd-background)",position:"sticky",top:0,zIndex:"var(--twd-z-index-sticky)",borderBottom:"1px solid var(--twd-border)"},children:[f("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"var(--twd-spacing-xl)"},children:[f("button",{onClick:p,style:{background:"var(--twd-button-primary)",color:"var(--twd-button-primary-text)",padding:"var(--twd-spacing-xs) var(--twd-spacing-md)",borderRadius:"var(--twd-border-radius)",border:"none",cursor:"pointer"},children:"Run All"}),f("button",{"aria-label":"Close sidebar",style:{background:"transparent",border:"none",cursor:"pointer",fontSize:"var(--twd-font-size-md)",paddingRight:"0",paddingLeft:"0"},onClick:()=>_(!1),children:"✖"})]}),f("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"var(--twd-font-size-md)",color:"var(--twd-text-secondary)",marginBottom:"10px"},children:[f("span",{style:{color:"var(--twd-text)"},children:["Total: ",s]}),f("div",{style:{display:"flex",gap:"var(--twd-spacing-xs)"},children:[f("span",{style:{color:"var(--twd-success)"},children:["✓ ",d.filter(c=>c.status==="pass").length]}),f("span",{style:{color:"var(--twd-error)"},children:["✗ ",d.filter(c=>c.status==="fail").length]})]})]}),f(Rt,{})]}),f("div",{style:{padding:"var(--twd-spacing-md)"},children:f(gt,{tests:d.map(c=>({name:c.name,depth:c.depth,status:c.status,logs:c.logs,id:c.id,parent:c.parent,type:c.type,only:c.only,skip:c.skip})),runTest:a})})]})},It=t=>({render:e=>{Ge(e,t)}}),Lt=(t,e)=>{const{open:n=!0,position:r="left",serviceWorker:i=!0,serviceWorkerUrl:o="/mock-sw.js",theme:l}=e||{};nt(t,f(Wt,{open:n,position:r}),It,l),i&&St(o).then(()=>{console.log("Request mocking initialized")}).catch(_=>{console.error("Error initializing request mocking:",_)})};W.initTWD=Lt,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})}));