fastevent 2.4.0 → 2.5.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.
@@ -0,0 +1,1369 @@
1
+ var FasteventViewer=(function(J){Object.defineProperty(J,Symbol.toStringTag,{value:"Module"});var ye=Object.defineProperty,ut=(r,e,t)=>e in r?ye(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,p=(r,e)=>ye(r,"name",{value:e,configurable:!0}),g=(r,e,t)=>ut(r,typeof e!="symbol"?e+"":e,t),Zt=Symbol.for("__FastEvent__"),Yt=Symbol.for("__FastEventScope__"),$e=class extends Error{constructor(e){super(e)}};p($e,"FastEventError");var F=$e,ke=class extends F{};p(ke,"TimeoutError");var Qt=ke,Ee=class extends F{};p(Ee,"UnboundError");var gt=Ee,Le=class extends F{};p(Le,"AbortError");var ne=Le,Se=class extends F{};p(Se,"CancelError");var Ae=Se,mt=class extends F{};p(mt,"QueueOverflowError");var K=(function(r){return r[r.Transformed=1]="Transformed",r})({});function oe(r,e,t,s){let i,n={},o={};return typeof r[0]=="object"?(Object.assign(o,r[0]),n=typeof r[1]=="boolean"?{retain:r[1]}:r[1]||{},i=r[0].meta):(o.type=r[0],o.payload=r[1],n=typeof r[2]=="boolean"?{retain:r[2]}:r[2]||{}),i=Object.assign({},e,t,n.meta,i),Object.keys(i).length===0?(i=void 0,delete o.meta):o.meta=i,n.executor===void 0&&(n.executor=s),[o,n]}p(oe,"parseEmitArgs");function Ce(r){return r?typeof r=="object"&&"__FastEventScope__"in r:!1}p(Ce,"isFastEventScope");function ae(r,e,t){let s=r[0],i=Ce(r[1])?r[1]:void 0,n=(i?r[2]:r[1])||{};return n.meta=Object.assign({},e,n?.meta),n.context=n.context!==void 0?n.context:t,[s,i,n]}p(ae,"parseScopeArgs");function X(r,e){return Object.defineProperty(r,"name",{value:e||"anonymous",configurable:!0}),r}p(X,"renameFn");function y(r){return r&&typeof r=="function"}p(y,"isFunction");var Ve=class ht{constructor(e){g(this,"__FastEventScope__",!0),g(this,"__events__"),g(this,"__meta__"),g(this,"__context__"),g(this,"_options",{}),g(this,"prefix",""),g(this,"emitter"),this._options=Object.assign({},this._initOptions(e))}get context(){return this.options.context||this}get options(){return this._options}get listeners(){return this.emitter.getListeners(this.prefix)}bind(e,t,s){this.emitter=e,this._options=Object.assign(this._options,{scope:t},s),t.length>0&&!t.endsWith(e.options.delimiter)&&(this.prefix=t+e.options.delimiter)}_initOptions(e){return e}_getScopeListener(e){let t=this.prefix;if(t.length===0)return e;if(!e)throw new Error;let s=this;return X(function(i,n){let o=n.rawEventType||i.type;if(o.startsWith(t)){let a=((n.flags||0)&K.Transformed)>0?i:Object.assign({},i,{type:o.substring(t.length)});return e.call(s.context,a,n)}},e.name)}_getScopeType(e){return e===void 0?void 0:this.prefix+e}_fixScopeType(e){return e.startsWith(this.prefix)?e.substring(this.prefix.length):e}on(){if(!this.emitter)throw new gt;let e=[...arguments];return e[0]=this._getScopeType(e[0]),e[1]=this._getScopeListener(e[1]),this.emitter.on(...e)}once(){return this.on(arguments[0],arguments[1],Object.assign({},arguments[2],{count:1}))}onAny(){return this.on("**",...arguments)}off(){let e=arguments;typeof e[0]=="string"&&(e[0]=this._getScopeType(e[0])),this.emitter.off(...e)}offAll(){this.emitter.offAll(this.prefix.substring(0,this.prefix.length-1))}clear(){this.emitter.clear(this.prefix.substring(0,this.prefix.length-1))}emit(){let[e,t]=oe(arguments,this.emitter.options.meta,this.options.meta,this.options.executor);return this._transformMessage(e,t),e.type=this._getScopeType(e.type),this.emitter.emit(e,t)}_transformMessage(e,t){y(this._options.transform)&&(t.rawEventType=this._getScopeType(e.type),t.flags=(t.flags||0)|K.Transformed,e.payload=this._options.transform.call(this,e))}async emitAsync(){return(await Promise.allSettled(this.emit.apply(this,arguments))).map(e=>e.status==="fulfilled"?e.value:e.reason)}async waitFor(){let e=arguments[0],t=arguments[1],s=await this.emitter.waitFor(this._getScopeType(e),t);return Object.assign({},s,{type:this._fixScopeType(s.type)})}scope(){let[e,t,s]=ae(arguments,this.options.meta,this.options.context),i;return t?i=t:i=new ht,i.bind(this.emitter,this.prefix+e,s),i}};p(Ve,"FastEventScope");var vt=Ve;function Z(r,e){let t=r.length,s=e.length;if(t!==s&&(s===0||e[s-1]!=="**"))return!1;if(s>0&&e[s-1]==="**"){for(let i=0;i<s-1;i++)if(e[i]!=="*"&&e[i]!==r[i])return!1;return!0}for(let i=0;i<t;i++)if(e[i]!=="*"&&e[i]!==r[i])return!1;return!0}p(Z,"isPathMatched");function Me(r,e){let t=[];for(let s=r.length-1;s>=0;s--)e(r[s])&&(t.push(s),r.splice(s,1));return t.reverse()}p(Me,"removeItem");function bt(r){return r?typeof r=="object"&&"type"in r:!1}p(bt,"isFastEventMessage");function _t(r){return r&&typeof r=="string"}p(_t,"isString");var Te=Symbol.for("__expandable__");function xt(r){return r[Te]=!0,r}p(xt,"expandable");function Re(r){return r&&r[Te]}p(Re,"isExpandable");function Pe(r){return r&&typeof r=="object"&&"off"in r&&"listener"in r}p(Pe,"isSubsctiber");function wt(r){return typeof r=="function"&&(r.toString().startsWith("class ")||r.prototype?.constructor===r)}p(wt,"isClass");function yt(r){return r?typeof r=="object"&&"__FastEvent__"in r:!1}p(yt,"isFastEvent");function ze(r){if(r===null||typeof r!="object")return!1;let e=r;return typeof e[Symbol.asyncIterator]=="function"||typeof e["@@asyncIterator"]=="function"}p(ze,"isAsyncIterable");var $t=p(()=>(r,e,t,s)=>r.map((i,n)=>s.call(r[n],i,e,t,!0)),"parallel");function Ne(r){for(let e=0;e<r.length;e++){let t=r[e];Array.isArray(t)&&Re(t)&&(r.splice(e,1,...t),e+=t.length-1)}return r}p(Ne,"expandEmitResults");function je(r,e){return r.catch(t=>(e&&e(t),Promise.resolve(t)))}p(je,"tryReturnError");var Oe=class{constructor(e,t,s={}){g(this,"eventEmitter"),g(this,"eventName"),g(this,"buffer",[]),g(this,"resolvers",[]),g(this,"errorResolvers",[]),g(this,"isStopped",!1),g(this,"error",null),g(this,"options"),g(this,"currentSize"),g(this,"hasNewMessage",!1),g(this,"_listener"),g(this,"_ready",!1),g(this,"_listenOptions"),g(this,"_cleanups",[]),this.eventEmitter=e,this.eventName=t,this.options={size:s.size??20,maxExpandSize:s.maxExpandSize??100,expandOverflow:s.expandOverflow??"slide",overflow:s.overflow??"slide",lifetime:s.lifetime??0,onPush:s.onPush,onPop:s.onPop,onDrop:s.onDrop,onError:s.onError??(()=>!0),signal:s.signal},this.currentSize=this.options.size,this._listener=this.onMessage.bind(this)}get listener(){return this._listener}get ready(){return this._ready}create(e){if(!this._ready){this._listenOptions=e;try{let t=this.eventEmitter.on(this.eventName,this._listener,e);if(this._cleanups.push(()=>t.off()),this.options.signal&&!this.options.signal.aborted){let s=p(()=>{this.off(!0)},"offFn");this.options.signal.addEventListener("abort",s),this._cleanups.push(()=>{this.options.signal.removeEventListener("abort",s)})}}finally{this._ready=!0}}}push(e){this.options.onPush?this.options.onPush(e,this.buffer):this.buffer.push(this.options.lifetime>0?[e,Date.now()]:[e,0])}handleOverflow(e){switch(this.buffer.length>=this.options.maxExpandSize&&this.options.overflow==="expand"?this.options.expandOverflow:this.options.overflow){case"drop":return this.options.onDrop&&this.options.onDrop(e),!1;case"expand":return this.currentSize=Math.min(this.currentSize+this.options.size,this.options.maxExpandSize),this.push(e),!0;case"slide":let t=this.buffer.shift();return this.options.onDrop&&t&&this.options.onDrop(t[0]),this.push(e),!0;case"throw":throw this.options.onDrop&&this.options.onDrop(e),new Error(`EventIterator queue overflow: buffer size (${this.currentSize}) exceeded`);default:return!1}}onMessage(e,t){if(this.isStopped)return;let s=e;if(this.resolvers.length>0){this.resolvers.shift()({value:s,done:!1});return}this.hasNewMessage=!0,this.buffer.length<this.currentSize?this.push(s):this.handleOverflow(s)}off(e){this._ready&&(this.isStopped||(this.isStopped=!0,this._cleanups.forEach(t=>t()),this._cleanups=[],this.buffer=[],this._ready=!1,e?(this.errorResolvers.forEach(t=>{t(new ne)}),this.errorResolvers=[]):(this.resolvers.forEach(t=>{t({value:void 0,done:!0})}),this.resolvers=[]),this._ready=!1))}async next(){if(this.error)return Promise.reject(this.error);if(this.isStopped&&this.buffer.length===0)return{value:void 0,done:!0};if(this.buffer.length>0){let e,t;if(this.options.onPop){let s=this.options.onPop(this.buffer,this.hasNewMessage);s?[e,t]=s:[e,t]=this.buffer.shift()||[void 0,0]}else[e,t]=this.buffer.shift()||[void 0,0];if(this.hasNewMessage=!1,e!==void 0)return this.options.lifetime>0&&Date.now()-t>this.options.lifetime?(this.options.onDrop&&this.options.onDrop(e),this.next()):{value:e,done:!1}}return new Promise((e,t)=>{this.resolvers.push(e),this.errorResolvers.push(t)})}[Symbol.asyncIterator](){return this}async done(){return this.off(),{value:void 0,done:!0}}async throw(e){return this.error=e,this.off(),Promise.reject(e)}async return(){return this.off(),{value:void 0,done:!0}}[Symbol.dispose](){this.off()}on(){this.create(this._listenOptions),this.isStopped=!1}};p(Oe,"FastEventIterator");var kt=Oe;function Fe(r,e,t={}){return new kt(r,e,t)}p(Fe,"createAsyncEventIterator");function He(r,e){return Array.isArray(e)&&e.forEach(t=>{r=X(t(r),r.name)}),r}p(He,"wrapPipeListener");function Y(r){return r!==null&&(typeof r=="object"||typeof r=="function")?new WeakRef(r):r}p(Y,"getWeakRef");function le(r){return r.map(e=>e.status==="fulfilled"?e.value:e.reason)}p(le,"getPromiseResults");function Ue(r){if(r==null)return!1;let e=typeof r;return e!=="object"&&e!=="function"?!1:typeof r.then=="function"}p(Ue,"isPromise");async function De(r){try{return r instanceof Promise?await r:r}catch(e){return e instanceof Error?e:new Error(String(e))}}p(De,"resolveValue");var Et=class{constructor(e){g(this,"__FastEvent__",!0),g(this,"listeners",{__listeners:[]}),g(this,"_options"),g(this,"_delimiter","/"),g(this,"_context"),g(this,"_hooks"),g(this,"retainedMessages",new Map),g(this,"listenerCount",0),g(this,"types",null),this._options=Object.assign({debug:!1,id:Math.random().toString(36).substring(2),delimiter:"/",context:null,ignoreErrors:!0,meta:void 0,expandEmitResults:!0,executor:$t()},this._initOptions(e)),this._delimiter=this._options.delimiter,this._context=this._options.context}get options(){return this._options}get context(){return this.options.context||this}get meta(){return this.options.meta}get id(){return this._options.id}get title(){return this._options.title||this.id||"FastEvent"}get hooks(){return this._hooks||(this._hooks={AddBeforeListener:[],AddAfterListener:[],RemoveListener:[],ClearListeners:[],ListenerError:[],BeforeExecuteListener:[],AfterExecuteListener:[]}),this._hooks}_execAfterExecuteListener(e,t){Promise.allSettled(t[1]).then(s=>{t[1]=le(s),e.apply(this,t)})}_executeHooks(e,t,s=!1){if(setTimeout(()=>{if(!this._hooks)return;let i=this.hooks[e];Array.isArray(i)&&i.length>0&&Promise.allSettled(i.map(n=>{if(e==="AfterExecuteListener")this._execAfterExecuteListener(n,t);else return n.apply(this,t)}))}),!s){let i=this.options[`on${e}`];if(y(i))if(e==="AfterExecuteListener")this._execAfterExecuteListener(i,t);else return i.apply(this,t)}}_initOptions(e){return e}_addListener(e,t,s){let{count:i,prepend:n}=s,o=0;return[this._forEachNodes(e,a=>{let l=[t,i,0,s.tag,s.flags];n?(a.__listeners.splice(0,0,l),o=0):(a.__listeners.push(l),o=a.__listeners.length-1),this.listenerCount++}),o]}_forEachNodes(e,t){if(e.length===0)return;let s=this.listeners;for(let i=0;i<e.length;i++){let n=e[i];if(n in s||(s[n]={__listeners:[]}),i===e.length-1){let o=s[n];return t(o,s),o}else s=s[n]}}_removeListener(e,t,s){s&&Me(e.__listeners,i=>{i=Array.isArray(i)?i[0]:i;let n=i===s;return n&&(this.listenerCount--,this._executeHooks("RemoveListener",[t.join(this._delimiter),s,e])),n})}on(){let e=arguments[0],t=null,s,i=!y(arguments[1]);i?s=arguments[1]||{}:(t=arguments[1],s=arguments[2]||{});let n=Object.assign({count:0,flags:0,prepend:!1},s);if(e.length===0)throw new Error("event type cannot be empty");if(i||t===null){let h=Object.assign({overflow:"expand",size:10,maxExpandSize:100},n.iterable),w=Fe(this,e,h);w.create(n);let _=this._executeHooks("AddBeforeListener",[e,w.listener,n]);if(_===!1)throw new Ae;return ze(_)?_:w}let o=this._executeHooks("AddBeforeListener",[e,t,n]);if(o===!1)throw new Ae;if(Pe(o))return o;let a=e.split(this._delimiter);if(n.pipes&&n.pipes.length>0&&(t=He(t,n.pipes)),y(n.filter)||y(n.off)){let h=t,w=p(()=>l&&this._removeListener(l,a,t),"off");t=X(function(_,S){if(y(n.off)&&n.off.call(this,_,S)){w();return}if(y(n.filter)){if(n.filter.call(this,_,S))return h.call(this,_,S)}else return h.call(this,_,S)},t.name)}let[l,m]=this._addListener(a,t,n),u=p(()=>l&&this._removeListener(l,a,t),"off");return this._executeHooks("AddAfterListener",[e,l]),this._emitRetainMessage(e,l,m),{off:u,listener:t,[Symbol.dispose](){u()}}}once(){return y(arguments[1])?this.on(arguments[0],arguments[1],Object.assign({},arguments[2],{count:1})):this.on(arguments[0],Object.assign({},arguments[2],{count:1}))}onAny(){return this.on("**",...arguments)}off(){let e=arguments,t=y(e[0])?void 0:e[0],s=y(e[0])?e[0]:e[1],i=t?t.split(this._delimiter):[],n=t?t.includes("*"):!1;if(t&&!n)this._traverseToPath(this.listeners,i,o=>{s?this._removeListener(o,i,s):t&&(o.__listeners=[])});else{let o=n?[]:i;this._traverseListeners(this.listeners,o,(a,l)=>{(s!==void 0||n&&Z(a,i))&&(s?this._removeListener(l,i,s):l.__listeners=[])})}}offAll(e){if(e){let t=e.split(this._delimiter),s=0;this._traverseListeners(this.listeners,t,(i,n)=>{s+=n.__listeners.length;try{n.__listeners.forEach(o=>{this._executeHooks("RemoveListener",[i.join(this.options.delimiter),o[0],n])})}finally{n.__listeners=[]}}),this.listenerCount-=s,this._removeRetainedEvents(e)}else try{let t=0;this._traverseListeners(this.listeners,[],(s,i)=>{t+=i.__listeners.length}),this.listenerCount-=t,this.retainedMessages.clear(),this.listeners={__listeners:[]}}finally{this._executeHooks("ClearListeners",[])}}_removeRetainedEvents(e){e||this.retainedMessages.clear(),e?.endsWith(this._delimiter)&&(e+=this._delimiter),this.retainedMessages.delete(e);for(let t of this.retainedMessages.keys())t.startsWith(e)&&this.retainedMessages.delete(t)}clear(e){this.offAll(e),this._removeRetainedEvents(e)}_emitRetainMessage(e,t,s){let i=[];if(e.includes("*")){let n=e.split(this._delimiter);this.retainedMessages.forEach((o,a)=>{Z(a.split(this._delimiter),n)&&i.push(o)})}else this.retainedMessages.has(e)&&i.push(this.retainedMessages.get(e));t&&i.forEach(n=>{this._executeListeners([t],n,{},o=>o[0]===t.__listeners[s][0])})}_traverseToPath(e,t,s,i=0,n){if(i>=t.length){s(e);return}let o=t[i];if(n===!0){this._traverseToPath(e,t,s,i+1,!0);return}"*"in e&&this._traverseToPath(e["*"],t,s,i+1),"**"in e&&this._traverseToPath(e["**"],t,s,i+1,!0),o in e&&this._traverseToPath(e[o],t,s,i+1)}_traverseListeners(e,t,s){let i=e;t&&t.length>0&&this._traverseToPath(e,t,o=>{i=o});let n=p((o,a,l)=>{a(l,o);for(let[m,u]of Object.entries(o))m.startsWith("__")||u&&n(u,a,[...l,m])},"traverseNodes");n(i,s,[])}_onListenerError(e,t,s,i){if(i instanceof Error&&(i._emitter=`${e.name||"anonymous"}:${t.type}`),this._executeHooks("ListenerError",[i,e,t,s]),this._options.ignoreErrors)return i;throw i}_executeListener(e,t,s,i=!1){let n=e[0];try{if(this.options.debug&&(e.length=5),s&&s.abortSignal&&s.abortSignal.aborted)return this._onListenerError(n,t,s,new ne(e[0].name));let o=((s?.flags||0)&K.Transformed)>0,a=n.call(this.context,o?t.payload:t,s);return i&&a&&a instanceof Promise&&(a=je(a,l=>this._onListenerError(n,t,s,l))),this.options.debug&&(Promise.resolve(a),Ue(a)?De(a).then(l=>{e[5]=Y(l)}):e[5]=Y(a)),a}catch(o){let a=this._onListenerError(n,t,s,o);return a instanceof Error&&(e[5]=Y(a)),a}}_getListenerExecutor(e){if(!e)return;let t=e.executor||this._options.executor;if(y(t))return t}_executeListeners(e,t,s,i){if(!e||e.length===0)return[];let n=[];for(let a of e){let l=0;for(let m of a.__listeners)(!i||i(m,a))&&n.push([m,l++,a.__listeners])}this._decListenerExecCount(n);let o=this._getListenerExecutor(s);if(o){let a=o(n.map(l=>l[0]),t,s,this._executeListener.bind(this));return Array.isArray(a)?a:[a]}else return n.map(a=>this._executeListener(a[0],t,s,!0))}_decListenerExecCount(e){for(let t=e.length-1;t>=0;t--){let s=e[t][0];s[2]++,s[1]>0&&s[1]<=s[2]&&e[t][2].splice(t,1)}}getListeners(e){let t=[],s=e.split(this._delimiter);this._traverseToPath(this.listeners,s,n=>{t.push(n)});let i=[];return t.map(n=>{i.push(...n.__listeners)}),i}clearRetainMessages(e){e?this.retainedMessages.delete(e):this.retainedMessages.clear()}emit(){let[e,t]=oe(arguments,this.options.meta);y(t.parseArgs)&&t.parseArgs(e,t);let s=e.type.split(this._delimiter);t.retain&&this.retainedMessages.set(e.type,e);let i=[],n=[];this._traverseToPath(this.listeners,s,a=>{n.push(a)});let o=this._executeHooks("BeforeExecuteListener",[e,t]);if(Array.isArray(o))return o;if(o===!1)throw new ne(e.type);if(y(this._options.transform)){let a=this._options.transform.call(this,e);a!==e&&(e.payload=a,t.rawEventType=e.type,t.flags=(t.flags||0)|K.Transformed)}return i.push(...this._executeListeners(n,e,t)),this._options.expandEmitResults&&Ne(i),this._executeHooks("AfterExecuteListener",[e,i,n]),i}async emitAsync(){return le(await Promise.allSettled(this.emit.apply(this,arguments)))}waitFor(){let e=arguments[0],t=arguments[1];return new Promise((s,i)=>{let n,o,a=p(l=>{clearTimeout(n),o?.off(),s(l)},"listener");t&&t>0&&(n=setTimeout(()=>{o?.off(),i(new Error("wait for event<"+e+"> is timeout"))},t)),o=this.on(e,a)})}scope(){let[e,t,s]=ae(arguments,this.options.meta,this.options.context),i;return t?i=t:i=new vt,i.bind(this,e,s),i}};p(Et,"FastEvent");var Q=globalThis,de=Q.ShadowRoot&&(Q.ShadyCSS===void 0||Q.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ce=Symbol(),Ie=new WeakMap,Be=class{constructor(r,e,t){if(this._$cssResult$=!0,t!==ce)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=r,this.t=e}get styleSheet(){let r=this.o;const e=this.t;if(de&&r===void 0){const t=e!==void 0&&e.length===1;t&&(r=Ie.get(e)),r===void 0&&((this.o=r=new CSSStyleSheet).replaceSync(this.cssText),t&&Ie.set(e,r))}return r}toString(){return this.cssText}},Lt=r=>new Be(typeof r=="string"?r:r+"",void 0,ce),G=(r,...e)=>new Be(r.length===1?r[0]:e.reduce((t,s,i)=>t+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+r[i+1],r[0]),r,ce),St=(r,e)=>{if(de)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const s=document.createElement("style"),i=Q.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=t.cssText,r.appendChild(s)}},We=de?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(const s of e.cssRules)t+=s.cssText;return Lt(t)})(r):r,{is:At,defineProperty:Ct,getOwnPropertyDescriptor:Vt,getOwnPropertyNames:Mt,getOwnPropertySymbols:Tt,getPrototypeOf:Rt}=Object,ee=globalThis,qe=ee.trustedTypes,Pt=qe?qe.emptyScript:"",zt=ee.reactiveElementPolyfillSupport,H=(r,e)=>r,te={toAttribute(r,e){switch(e){case Boolean:r=r?Pt:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},he=(r,e)=>!At(r,e),Je={attribute:!0,type:String,converter:te,reflect:!1,useDefault:!1,hasChanged:he};Symbol.metadata??=Symbol("metadata"),ee.litPropertyMetadata??=new WeakMap;var N=class extends HTMLElement{static addInitializer(r){this._$Ei(),(this.l??=[]).push(r)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(r,e=Je){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(r)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(r,e),!e.noAccessor){const t=Symbol(),s=this.getPropertyDescriptor(r,t,e);s!==void 0&&Ct(this.prototype,r,s)}}static getPropertyDescriptor(r,e,t){const{get:s,set:i}=Vt(this.prototype,r)??{get(){return this[e]},set(n){this[e]=n}};return{get:s,set(n){const o=s?.call(this);i?.call(this,n),this.requestUpdate(r,o,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(r){return this.elementProperties.get(r)??Je}static _$Ei(){if(this.hasOwnProperty(H("elementProperties")))return;const r=Rt(this);r.finalize(),r.l!==void 0&&(this.l=[...r.l]),this.elementProperties=new Map(r.elementProperties)}static finalize(){if(this.hasOwnProperty(H("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(H("properties"))){const e=this.properties,t=[...Mt(e),...Tt(e)];for(const s of t)this.createProperty(s,e[s])}const r=this[Symbol.metadata];if(r!==null){const e=litPropertyMetadata.get(r);if(e!==void 0)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const s=this._$Eu(e,t);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(r){const e=[];if(Array.isArray(r)){const t=new Set(r.flat(1/0).reverse());for(const s of t)e.unshift(We(s))}else r!==void 0&&e.push(We(r));return e}static _$Eu(r,e){const t=e.attribute;return t===!1?void 0:typeof t=="string"?t:typeof r=="string"?r.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(r=>r(this))}addController(r){(this._$EO??=new Set).add(r),this.renderRoot!==void 0&&this.isConnected&&r.hostConnected?.()}removeController(r){this._$EO?.delete(r)}_$E_(){const r=new Map,e=this.constructor.elementProperties;for(const t of e.keys())this.hasOwnProperty(t)&&(r.set(t,this[t]),delete this[t]);r.size>0&&(this._$Ep=r)}createRenderRoot(){const r=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return St(r,this.constructor.elementStyles),r}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(r=>r.hostConnected?.())}enableUpdating(r){}disconnectedCallback(){this._$EO?.forEach(r=>r.hostDisconnected?.())}attributeChangedCallback(r,e,t){this._$AK(r,t)}_$ET(r,e){const t=this.constructor.elementProperties.get(r),s=this.constructor._$Eu(r,t);if(s!==void 0&&t.reflect===!0){const i=(t.converter?.toAttribute!==void 0?t.converter:te).toAttribute(e,t.type);this._$Em=r,i==null?this.removeAttribute(s):this.setAttribute(s,i),this._$Em=null}}_$AK(r,e){const t=this.constructor,s=t._$Eh.get(r);if(s!==void 0&&this._$Em!==s){const i=t.getPropertyOptions(s),n=typeof i.converter=="function"?{fromAttribute:i.converter}:i.converter?.fromAttribute!==void 0?i.converter:te;this._$Em=s;const o=n.fromAttribute(e,i.type);this[s]=o??this._$Ej?.get(s)??o,this._$Em=null}}requestUpdate(r,e,t,s=!1,i){if(r!==void 0){const n=this.constructor;if(s===!1&&(i=this[r]),t??=n.getPropertyOptions(r),!((t.hasChanged??he)(i,e)||t.useDefault&&t.reflect&&i===this._$Ej?.get(r)&&!this.hasAttribute(n._$Eu(r,t))))return;this.C(r,e,t)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(r,e,{useDefault:t,reflect:s,wrapped:i},n){t&&!(this._$Ej??=new Map).has(r)&&(this._$Ej.set(r,n??e??this[r]),i!==!0||n!==void 0)||(this._$AL.has(r)||(this.hasUpdated||t||(e=void 0),this._$AL.set(r,e)),s===!0&&this._$Em!==r&&(this._$Eq??=new Set).add(r))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const r=this.scheduleUpdate();return r!=null&&await r,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[s,i]of this._$Ep)this[s]=i;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:n}=i,o=this[s];n!==!0||this._$AL.has(s)||o===void 0||this.C(s,void 0,i,o)}}let r=!1;const e=this._$AL;try{r=this.shouldUpdate(e),r?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(t){throw r=!1,this._$EM(),t}r&&this._$AE(e)}willUpdate(r){}_$AE(r){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(r)),this.updated(r)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(r){return!0}update(r){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(r){}firstUpdated(r){}};N.elementStyles=[],N.shadowRootOptions={mode:"open"},N[H("elementProperties")]=new Map,N[H("finalized")]=new Map,zt?.({ReactiveElement:N}),(ee.reactiveElementVersions??=[]).push("2.1.2");var pe=globalThis,Ke=r=>r,re=pe.trustedTypes,Xe=re?re.createPolicy("lit-html",{createHTML:r=>r}):void 0,fe="$lit$",E=`lit$${Math.random().toFixed(9).slice(2)}$`,ue="?"+E,Nt=`<${ue}>`,M=document,U=()=>M.createComment(""),D=r=>r===null||typeof r!="object"&&typeof r!="function",ge=Array.isArray,Ze=r=>ge(r)||typeof r?.[Symbol.iterator]=="function",me=`[
2
+ \f\r]`,I=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ye=/-->/g,Qe=/>/g,T=RegExp(`>|${me}(?:([^\\s"'>=/]+)(${me}*=${me}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Ge=/'/g,et=/"/g,tt=/^(?:script|style|textarea|title)$/i,ve=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),c=ve(1),Gt=ve(2),er=ve(3),j=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),rt=new WeakMap,R=M.createTreeWalker(M,129);function st(r,e){if(!ge(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Xe!==void 0?Xe.createHTML(e):e}var it=(r,e)=>{const t=r.length-1,s=[];let i,n=e===2?"<svg>":e===3?"<math>":"",o=I;for(let a=0;a<t;a++){const l=r[a];let m,u,h=-1,w=0;for(;w<l.length&&(o.lastIndex=w,u=o.exec(l),u!==null);)w=o.lastIndex,o===I?u[1]==="!--"?o=Ye:u[1]!==void 0?o=Qe:u[2]!==void 0?(tt.test(u[2])&&(i=RegExp("</"+u[2],"g")),o=T):u[3]!==void 0&&(o=T):o===T?u[0]===">"?(o=i??I,h=-1):u[1]===void 0?h=-2:(h=o.lastIndex-u[2].length,m=u[1],o=u[3]===void 0?T:u[3]==='"'?et:Ge):o===et||o===Ge?o=T:o===Ye||o===Qe?o=I:(o=T,i=void 0);const _=o===T&&r[a+1].startsWith("/>")?" ":"";n+=o===I?l+Nt:h>=0?(s.push(m),l.slice(0,h)+fe+l.slice(h)+E+_):l+E+(h===-2?a:_)}return[st(r,n+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]},be=class pt{constructor({strings:e,_$litType$:t},s){let i;this.parts=[];let n=0,o=0;const a=e.length-1,l=this.parts,[m,u]=it(e,t);if(this.el=pt.createElement(m,s),R.currentNode=this.el.content,t===2||t===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=R.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const h of i.getAttributeNames())if(h.endsWith(fe)){const w=u[o++],_=i.getAttribute(h).split(E),S=/([.?@])?(.*)/.exec(w);l.push({type:1,index:n,name:S[2],strings:_,ctor:S[1]==="."?ot:S[1]==="?"?at:S[1]==="@"?lt:B}),i.removeAttribute(h)}else h.startsWith(E)&&(l.push({type:6,index:n}),i.removeAttribute(h));if(tt.test(i.tagName)){const h=i.textContent.split(E),w=h.length-1;if(w>0){i.textContent=re?re.emptyScript:"";for(let _=0;_<w;_++)i.append(h[_],U()),R.nextNode(),l.push({type:2,index:++n});i.append(h[w],U())}}}else if(i.nodeType===8)if(i.data===ue)l.push({type:2,index:n});else{let h=-1;for(;(h=i.data.indexOf(E,h+1))!==-1;)l.push({type:7,index:n}),h+=E.length-1}n++}}static createElement(e,t){const s=M.createElement("template");return s.innerHTML=e,s}};function P(r,e,t=r,s){if(e===j)return e;let i=s!==void 0?t._$Co?.[s]:t._$Cl;const n=D(e)?void 0:e._$litDirective$;return i?.constructor!==n&&(i?._$AO?.(!1),n===void 0?i=void 0:(i=new n(r),i._$AT(r,t,s)),s!==void 0?(t._$Co??=[])[s]=i:t._$Cl=i),i!==void 0&&(e=P(r,i._$AS(r,e.values),i,s)),e}var nt=class{constructor(r,e){this._$AV=[],this._$AN=void 0,this._$AD=r,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(r){const{el:{content:e},parts:t}=this._$AD,s=(r?.creationScope??M).importNode(e,!0);R.currentNode=s;let i=R.nextNode(),n=0,o=0,a=t[0];for(;a!==void 0;){if(n===a.index){let l;a.type===2?l=new se(i,i.nextSibling,this,r):a.type===1?l=new a.ctor(i,a.name,a.strings,this,r):a.type===6&&(l=new dt(i,this,r)),this._$AV.push(l),a=t[++o]}n!==a?.index&&(i=R.nextNode(),n++)}return R.currentNode=M,s}p(r){let e=0;for(const t of this._$AV)t!==void 0&&(t.strings!==void 0?(t._$AI(r,t,e),e+=t.strings.length-2):t._$AI(r[e])),e++}},se=class ft{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,s,i){this.type=2,this._$AH=b,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=P(this,e,t),D(e)?e===b||e==null||e===""?(this._$AH!==b&&this._$AR(),this._$AH=b):e!==this._$AH&&e!==j&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ze(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==b&&D(this._$AH)?this._$AA.nextSibling.data=e:this.T(M.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:s}=e,i=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=be.createElement(st(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(t);else{const n=new nt(i,this),o=n.u(this.options);n.p(t),this.T(o),this._$AH=n}}_$AC(e){let t=rt.get(e.strings);return t===void 0&&rt.set(e.strings,t=new be(e)),t}k(e){ge(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let s,i=0;for(const n of e)i===t.length?t.push(s=new ft(this.O(U()),this.O(U()),this,this.options)):s=t[i],s._$AI(n),i++;i<t.length&&(this._$AR(s&&s._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const s=Ke(e).nextSibling;Ke(e).remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},B=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(r,e,t,s,i){this.type=1,this._$AH=b,this._$AN=void 0,this.element=r,this.name=e,this._$AM=s,this.options=i,t.length>2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=b}_$AI(r,e=this,t,s){const i=this.strings;let n=!1;if(i===void 0)r=P(this,r,e,0),n=!D(r)||r!==this._$AH&&r!==j,n&&(this._$AH=r);else{const o=r;let a,l;for(r=i[0],a=0;a<i.length-1;a++)l=P(this,o[t+a],e,a),l===j&&(l=this._$AH[a]),n||=!D(l)||l!==this._$AH[a],l===b?r=b:r!==b&&(r+=(l??"")+i[a+1]),this._$AH[a]=l}n&&!s&&this.j(r)}j(r){r===b?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,r??"")}},ot=class extends B{constructor(){super(...arguments),this.type=3}j(r){this.element[this.name]=r===b?void 0:r}},at=class extends B{constructor(){super(...arguments),this.type=4}j(r){this.element.toggleAttribute(this.name,!!r&&r!==b)}},lt=class extends B{constructor(r,e,t,s,i){super(r,e,t,s,i),this.type=5}_$AI(r,e=this){if((r=P(this,r,e,0)??b)===j)return;const t=this._$AH,s=r===b&&t!==b||r.capture!==t.capture||r.once!==t.once||r.passive!==t.passive,i=r!==b&&(t===b||s);s&&this.element.removeEventListener(this.name,this,t),i&&this.element.addEventListener(this.name,this,r),this._$AH=r}handleEvent(r){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,r):this._$AH.handleEvent(r)}},dt=class{constructor(r,e,t){this.element=r,this.type=6,this._$AN=void 0,this._$AM=e,this.options=t}get _$AU(){return this._$AM._$AU}_$AI(r){P(this,r)}},tr={M:fe,P:E,A:ue,C:1,L:it,R:nt,D:Ze,V:P,I:se,H:B,N:at,U:lt,B:ot,F:dt},jt=pe.litHtmlPolyfillSupport;jt?.(be,se),(pe.litHtmlVersions??=[]).push("3.3.2");var Ot=(r,e,t)=>{const s=t?.renderBefore??e;let i=s._$litPart$;if(i===void 0){const n=t?.renderBefore??null;s._$litPart$=i=new se(e.insertBefore(U(),n),n,void 0,t??{})}return i._$AI(r),i},_e=globalThis,A=class extends N{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const r=super.createRenderRoot();return this.renderOptions.renderBefore??=r.firstChild,r}update(r){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(r),this._$Do=Ot(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return j}};A._$litElement$=!0,A.finalized=!0,_e.litElementHydrateSupport?.({LitElement:A});var Ft=_e.litElementPolyfillSupport;Ft?.({LitElement:A}),(_e.litElementVersions??=[]).push("4.2.2");var ie=r=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(r,e)}):customElements.define(r,e)},Ht={attribute:!0,type:String,converter:te,reflect:!1,hasChanged:he},Ut=(r=Ht,e,t)=>{const{kind:s,metadata:i}=t;let n=globalThis.litPropertyMetadata.get(i);if(n===void 0&&globalThis.litPropertyMetadata.set(i,n=new Map),s==="setter"&&((r=Object.create(r)).wrapped=!0),n.set(t.name,r),s==="accessor"){const{name:o}=t;return{set(a){const l=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,l,r,!0,a)},init(a){return a!==void 0&&this.C(o,void 0,r,a),a}}}if(s==="setter"){const{name:o}=t;return function(a){const l=this[o];e.call(this,a),this.requestUpdate(o,l,r,!0,a)}}throw Error("Unsupported decorator location: "+s)};function v(r){return(e,t)=>typeof t=="object"?Ut(r,e,t):((s,i,n)=>{const o=i.hasOwnProperty(n);return i.constructor.createProperty(n,s),o?Object.getOwnPropertyDescriptor(i,n):void 0})(r,e,t)}function k(r){return v({...r,state:!0,attribute:!1})}var ct=G`
4
+ :host,
5
+ :root {
6
+ --icon-size: 16px;
7
+ --icon-tags: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><path d="M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"/><circle cx="7.5" cy="7.5" r=".5"/></svg>');
8
+ --icon-yes: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5" /></svg>');
9
+ --icon-file: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><path fill="currentColor" d="m213.66 82.34l-56-56A8 8 0 0 0 152 24H56a16 16 0 0 0-16 16v176a16 16 0 0 0 16 16h144a16 16 0 0 0 16-16V88a8 8 0 0 0-2.34-5.66M160 51.31L188.69 80H160ZM200 216H56V40h88v48a8 8 0 0 0 8 8h48z"/></svg>');
10
+ --icon-loading: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32" fill="currentColor"><path opacity=".25" d="M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4" /><path d="M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"><animateTransform attributeName="transform" type="rotate" from="0 16 16" to="360 16 16" dur="0.8s" repeatCount="indefinite" /></path></svg>');
11
+ --icon-arrow: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="m9 18 6-6-6-6" /></svg>');
12
+ --icon-error: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10" /><path d="m15 9-6 6" /><path d="m9 9 6 6" /></svg>');
13
+ --icon-success: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M21.801 10A10 10 0 1 1 17 3.335" /><path d="m9 11 3 3L22 4" /></svg>');
14
+ --icon-refresh: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" /><path d="M3 3v5h5" /></svg>');
15
+ --icon-clear: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" /><path d="M3 6h18" /><path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" /></svg>');
16
+ --icon-copy: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" ><rect width="14" height="14" x="8" y="8" rx="2" ry="2" /><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" /></svg>');
17
+ --icon-listeners: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" ><path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="M10 12.5 8 15l2 2.5"/><path d="m14 12.5 2 2.5-2 2.5"/></svg>');
18
+ --icon-listener: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" ><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><path d="M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3"/><path d="M9 11.2h5.7"/></svg>');
19
+ --icon-count: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M16 8.9V7H8l4 5-4 5h8v-1.9"/></svg>');
20
+ --icon-flags: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><path d="M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528"/></svg>');
21
+ --icon-transform: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m16 14 4 4-4 4"/><path d="M20 10a8 8 0 1 0-8 8h8"/></svg>');
22
+ --icon-dark: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><path d="M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"/></svg>');
23
+ --icon-delete: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>');
24
+ --icon-inspect: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="2" x2="5" y1="12" y2="12"/><line x1="19" x2="22" y1="12" y2="12"/><line x1="12" x2="12" y1="2" y2="5"/><line x1="12" x2="12" y1="19" y2="22"/><circle cx="12" cy="12" r="7"/><circle cx="12" cy="12" r="3"/></svg>');
25
+ }
26
+ .icon {
27
+ display: inline-block;
28
+ background-color: currentColor !important;
29
+ mask-size: cover;
30
+ -webkit-mask-size: cover;
31
+ vertical-align: text-bottom;
32
+ position: relative;
33
+ stroke-width: 1;
34
+ width: var(--icon-size);
35
+ height: var(--icon-size);
36
+ box-sizing: border-box;
37
+ }
38
+
39
+ /** 图标 */
40
+ .icon.close {
41
+ mask-image: var(--icon-close);
42
+ }
43
+ .icon.tags {
44
+ mask-image: var(--icon-tags);
45
+ }
46
+
47
+ .icon.yes {
48
+ mask-image: var(--icon-yes);
49
+ }
50
+
51
+ .icon.file {
52
+ mask-image: var(--icon-file);
53
+ }
54
+
55
+ .icon.loading {
56
+ mask-image: var(--icon-loading);
57
+ }
58
+
59
+ .icon.arrow {
60
+ mask-image: var(--icon-arrow);
61
+ }
62
+
63
+ .icon.error {
64
+ mask-image: var(--icon-error);
65
+ }
66
+
67
+ .icon.refresh {
68
+ mask-image: var(--icon-refresh);
69
+ }
70
+
71
+ .icon.clear {
72
+ mask-image: var(--icon-clear);
73
+ }
74
+
75
+ .icon.copy {
76
+ mask-image: var(--icon-copy);
77
+ }
78
+ .icon.listeners {
79
+ mask-image: var(--icon-listeners);
80
+ }
81
+ .icon.listener {
82
+ mask-image: var(--icon-listener);
83
+ }
84
+ .icon.count {
85
+ mask-image: var(--icon-count);
86
+ }
87
+ .icon.flags {
88
+ mask-image: var(--icon-flags);
89
+ }
90
+ .icon.transform {
91
+ mask-image: var(--icon-transform);
92
+ }
93
+ .icon.dark {
94
+ mask-image: var(--icon-dark);
95
+ }
96
+ .icon.delete {
97
+ mask-image: var(--icon-delete);
98
+ }
99
+ .icon.inspect {
100
+ mask-image: var(--icon-inspect);
101
+ }
102
+ `,Dt=G`
103
+ ${ct}
104
+ :host {
105
+ display: flex;
106
+ flex-direction: column;
107
+ font-family:
108
+ -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
109
+ sans-serif;
110
+ font-size: 14px;
111
+ line-height: 1.5;
112
+ color: var(--fe-color-text, #333);
113
+ background: var(--fe-color-bg, #fff);
114
+ border: 1px solid var(--fe-color-border, #e8e8e8);
115
+ border-radius: 6px;
116
+ overflow: hidden;
117
+ }
118
+
119
+ :host([dark]) {
120
+ --fe-color-text: rgba(255, 255, 255, 0.85);
121
+ --fe-color-bg: #1f1f1f;
122
+ --fe-color-border: #303030;
123
+ --fe-color-header-bg: #141414;
124
+ --fe-color-hover: rgba(255, 255, 255, 0.08);
125
+ --fe-color-text-secondary: rgba(255, 255, 255, 0.45);
126
+ --fe-color-input-bg: rgba(255, 255, 255, 0.08);
127
+ --fe-color-tag-bg: rgba(255, 255, 255, 0.08);
128
+ --fe-color-tag-text: rgba(255, 255, 255, 0.85);
129
+ --fe-color-listener-bg: rgba(255, 255, 255, 0.04);
130
+ --fe-color-listener-border: rgba(255, 255, 255, 0.12);
131
+ --fe-color-listener-hover: rgba(255, 255, 255, 0.08);
132
+ }
133
+
134
+ .header {
135
+ display: flex;
136
+ align-items: center;
137
+ padding: 1em;
138
+ background: var(--fe-color-header-bg, #fafafa);
139
+ border-bottom: 1px solid var(--fe-color-border, #e8e8e8);
140
+ gap: 8px;
141
+ }
142
+
143
+ .header-title {
144
+ flex: 1;
145
+ font-size: 16px;
146
+ font-weight: 600;
147
+ color: var(--fe-color-text, #333);
148
+ }
149
+
150
+ .toolbar {
151
+ display: flex;
152
+ align-items: center;
153
+ padding: 0.75em 1em;
154
+ border-bottom: 1px solid var(--fe-color-border, #e8e8e8);
155
+ gap: 12px;
156
+ }
157
+
158
+ .filter-input {
159
+ width: 20%;
160
+ min-width: 150px;
161
+ padding: 0.4em 0.8em;
162
+ border: 1px solid var(--fe-color-border, #d9d9d9);
163
+ border-radius: 6px;
164
+ background: var(--fe-color-input-bg, #fff);
165
+ color: var(--fe-color-text, #333);
166
+ font-size: 13px;
167
+ transition: all 0.3s;
168
+ }
169
+
170
+ .filter-input:focus {
171
+ outline: none;
172
+ border-color: #1890ff;
173
+ box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
174
+ }
175
+
176
+ .filter-input::placeholder {
177
+ color: var(--fe-color-text-secondary, #bfbfbf);
178
+ }
179
+
180
+ .toolbar-spacer {
181
+ flex: 1;
182
+ color: var(--fe-color-text-secondary, #999);
183
+ font-size: 12px;
184
+ }
185
+
186
+ .btn {
187
+ display: inline-flex;
188
+ align-items: center;
189
+ justify-content: center;
190
+ gap: 6px;
191
+ padding: 0.4em 0.8em;
192
+ border: none;
193
+ border-radius: 4px;
194
+ background: transparent;
195
+ color: var(--fe-color-text, #555);
196
+ font-size: 13px;
197
+ cursor: pointer;
198
+ transition: all 0.3s;
199
+ user-select: none;
200
+ }
201
+
202
+ .btn:hover {
203
+ color: #1890ff;
204
+ background: rgba(24, 144, 255, 0.06);
205
+ }
206
+
207
+ .btn-pressed {
208
+ color: #1890ff;
209
+ background: rgba(24, 144, 255, 0.1);
210
+ }
211
+
212
+ .btn-icon {
213
+ padding: 0.2em;
214
+ width: 24px;
215
+ height: 24px;
216
+ }
217
+
218
+ .btn-pressed {
219
+ color: #1890ff;
220
+ background: rgba(24, 144, 255, 0.1);
221
+ }
222
+
223
+ .logs {
224
+ flex: 1;
225
+ display: flex;
226
+ flex-direction: column;
227
+ overflow-y: auto;
228
+ overflow-x: hidden;
229
+ padding: 0;
230
+ }
231
+
232
+ .log-item {
233
+ display: flex;
234
+ align-items: flex-start;
235
+ padding: 0.5em;
236
+ border-radius: 4px;
237
+ transition: background 0.2s;
238
+ border-bottom: 1px solid var(--fe-color-border, #fafafa);
239
+ }
240
+
241
+ .log-item:hover {
242
+ background: var(--fe-color-hover, #fcfcfc);
243
+ }
244
+
245
+ .log-content {
246
+ flex: 1;
247
+ display: flex;
248
+ flex-direction: column;
249
+ gap: 4px;
250
+ min-width: 0;
251
+ }
252
+
253
+ .log-header {
254
+ display: flex;
255
+ align-items: center;
256
+ gap: 4px;
257
+ flex-wrap: wrap;
258
+ padding: 0;
259
+ }
260
+
261
+ .log-header .icon {
262
+ --icon-size: 16px;
263
+ color: #818181;
264
+ flex-shrink: 0;
265
+ }
266
+
267
+ .log-type {
268
+ flex: 1;
269
+ font-weight: 500;
270
+ color: var(--fe-color-text, #333);
271
+ font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
272
+ }
273
+
274
+ .log-time {
275
+ font-size: 12px;
276
+ color: var(--fe-color-text-secondary, #999);
277
+ }
278
+
279
+ .tag {
280
+ display: inline-flex;
281
+ align-items: center;
282
+ padding: 0.1em 0.4em;
283
+ border-radius: 5px;
284
+ font-size: 11px;
285
+ white-space: nowrap;
286
+ background: var(--fe-color-tag-bg, #f0f0f0);
287
+ color: var(--fe-color-tag-text, #666);
288
+ }
289
+
290
+ .tag-blue {
291
+ background: #e6f7ff;
292
+ color: #1890ff;
293
+ border: 1px solid #91d5ff;
294
+ }
295
+
296
+ .tag-green {
297
+ background: #f6ffed;
298
+ color: #52c41a;
299
+ border: 1px solid #b7eb8f;
300
+ }
301
+
302
+ .tag-orange {
303
+ background: #fff7e6;
304
+ color: #fa8c16;
305
+ border: 1px solid #ffd591;
306
+ }
307
+
308
+ .tag-red {
309
+ background: #fff1f0;
310
+ color: #ff4d4f;
311
+ border: 1px solid #ffa39e;
312
+ }
313
+
314
+ .tag-purple {
315
+ background: #f9f0ff;
316
+ color: #722ed1;
317
+ border: 1px solid #d3adf7;
318
+ }
319
+
320
+ .tag-gray {
321
+ background: #f5f5f5;
322
+ color: #8c8c8c;
323
+ border: 1px solid #d9d9d9;
324
+ }
325
+
326
+ /* 暗黑模式下的 tag 颜色样式 */
327
+ :host([dark]) .tag-blue {
328
+ background: rgba(24, 144, 255, 0.15);
329
+ color: #40a9ff;
330
+ border: 1px solid rgba(24, 144, 255, 0.3);
331
+ }
332
+
333
+ :host([dark]) .tag-green {
334
+ background: rgba(82, 196, 26, 0.15);
335
+ color: #73d13d;
336
+ border: 1px solid rgba(82, 196, 26, 0.3);
337
+ }
338
+
339
+ :host([dark]) .tag-orange {
340
+ background: rgba(250, 140, 22, 0.15);
341
+ color: #ffa940;
342
+ border: 1px solid rgba(250, 140, 22, 0.3);
343
+ }
344
+
345
+ :host([dark]) .tag-red {
346
+ background: rgba(255, 77, 79, 0.15);
347
+ color: #ff7875;
348
+ border: 1px solid rgba(255, 77, 79, 0.3);
349
+ }
350
+
351
+ :host([dark]) .tag-purple {
352
+ background: rgba(114, 46, 209, 0.15);
353
+ color: #b37feb;
354
+ border: 1px solid rgba(114, 46, 209, 0.3);
355
+ }
356
+
357
+ :host([dark]) .tag-gray {
358
+ background: rgba(140, 140, 140, 0.15);
359
+ color: #bfbfbf;
360
+ border: 1px solid rgba(140, 140, 140, 0.3);
361
+ }
362
+
363
+ .log-payload {
364
+ font-size: 12px;
365
+ color: var(--fe-color-text-secondary, #999);
366
+ overflow: hidden;
367
+ text-overflow: ellipsis;
368
+ display: -webkit-box;
369
+ -webkit-line-clamp: 2;
370
+ -webkit-box-orient: vertical;
371
+ line-height: 1.4;
372
+ padding: 0em 20px;
373
+ padding-top: 0px;
374
+ }
375
+
376
+ .log-listeners {
377
+ padding: 0em 20px;
378
+ display: flex;
379
+ flex-wrap: wrap;
380
+ gap: 4px;
381
+ }
382
+
383
+ .log-listeners-visible {
384
+ display: flex;
385
+ }
386
+
387
+ .log-listeners-hidden {
388
+ display: none;
389
+ }
390
+
391
+ .listener {
392
+ display: inline-flex;
393
+ align-items: center;
394
+ gap: 4px;
395
+ padding: 0.25em 0.5em;
396
+ border-radius: 8px;
397
+ font-size: 12px;
398
+ background: rgba(0, 0, 0, 0.03);
399
+ border: 1px solid rgba(0, 0, 0, 0.06);
400
+ transition: all 0.2s;
401
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
402
+ cursor: pointer;
403
+ }
404
+
405
+ .listener:hover {
406
+ background: rgba(0, 0, 0, 0.05);
407
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
408
+ }
409
+
410
+ /* 暗黑模式下的 listener 样式 */
411
+ :host([dark]) .listener {
412
+ background: var(--fe-color-listener-bg, rgba(255, 255, 255, 0.04));
413
+ border: 1px solid var(--fe-color-listener-border, rgba(255, 255, 255, 0.12));
414
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
415
+ }
416
+
417
+ :host([dark]) .listener:hover {
418
+ background: var(--fe-color-listener-hover, rgba(255, 255, 255, 0.08));
419
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
420
+ }
421
+
422
+ .listener-status {
423
+ width: 14px;
424
+ height: 14px;
425
+ display: inline-flex;
426
+ align-items: center;
427
+ justify-content: center;
428
+ flex-shrink: 0;
429
+ }
430
+
431
+ .listener-status .icon {
432
+ --icon-size: 12px;
433
+ }
434
+
435
+ .listener-status.running .icon {
436
+ color: #1890ff;
437
+ }
438
+
439
+ .listener-status.yes .icon {
440
+ color: #52c41a;
441
+ }
442
+
443
+ .listener-status.error .icon {
444
+ color: #ff4d4f;
445
+ }
446
+
447
+ .listener-name {
448
+ font-weight: 500;
449
+ color: var(--fe-color-text, #333);
450
+ font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
451
+ font-size: 11px;
452
+ }
453
+
454
+ .empty-state {
455
+ display: flex;
456
+ flex-direction: column;
457
+ align-items: center;
458
+ justify-content: center;
459
+ padding: 2em;
460
+ color: var(--fe-color-text-secondary, #999);
461
+ text-align: center;
462
+ }
463
+
464
+ .empty-state .icon {
465
+ --icon-size: 48px;
466
+ opacity: 0.3;
467
+ }
468
+
469
+ /* Emitter 下拉容器 */
470
+ .emitter-dropdown-container {
471
+ position: relative;
472
+ flex-shrink: 0;
473
+ }
474
+
475
+ /* Emitter 下拉占位符 */
476
+ .emitter-dropdown-spacer {
477
+ flex: 1;
478
+ }
479
+
480
+ /* 下拉触发按钮 */
481
+ .emitter-dropdown-trigger {
482
+ display: flex;
483
+ align-items: center;
484
+ gap: 6px;
485
+ width: 100%;
486
+ padding: 0;
487
+ border: none;
488
+ background: transparent;
489
+ cursor: pointer;
490
+ transition: all 0.3s;
491
+ }
492
+
493
+ .emitter-dropdown-trigger:hover .header-title {
494
+ color: #1890ff;
495
+ }
496
+
497
+ /* 下拉箭头 */
498
+ .dropdown-arrow {
499
+ display: inline-block;
500
+ width: 0;
501
+ height: 0;
502
+ border-left: 4px solid transparent;
503
+ border-right: 4px solid transparent;
504
+ border-top: 5px solid var(--fe-color-text, #333);
505
+ transition: transform 0.3s;
506
+ opacity: 0.6;
507
+ }
508
+
509
+ .dropdown-arrow.open {
510
+ transform: rotate(180deg);
511
+ }
512
+
513
+ /* 暗黑模式下的下拉箭头 */
514
+ :host([dark]) .dropdown-arrow {
515
+ border-top-color: rgba(255, 255, 255, 0.85);
516
+ }
517
+
518
+ /* 下拉菜单容器 */
519
+ .emitter-dropdown-menu {
520
+ position: absolute;
521
+ top: 100%;
522
+ left: 0;
523
+ margin-top: 4px;
524
+ min-width: 180px;
525
+ background: #ffffff;
526
+ border: 1px solid #e8e8e8;
527
+ border-radius: 6px;
528
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
529
+ z-index: 1000;
530
+ overflow: hidden;
531
+ animation: dropdownFadeIn 0.2s ease-out;
532
+ }
533
+
534
+ @keyframes dropdownFadeIn {
535
+ from {
536
+ opacity: 0;
537
+ transform: translateY(-8px);
538
+ }
539
+ to {
540
+ opacity: 1;
541
+ transform: translateY(0);
542
+ }
543
+ }
544
+
545
+ /* 菜单项 */
546
+ .emitter-menu-item {
547
+ display: flex;
548
+ align-items: center;
549
+ gap: 8px;
550
+ padding: 10px 16px;
551
+ cursor: pointer;
552
+ transition: background 0.2s;
553
+ font-size: 14px;
554
+ color: #333;
555
+ text-align: left;
556
+ }
557
+
558
+ .emitter-menu-item:hover {
559
+ background: #f5f5f5;
560
+ }
561
+
562
+ .emitter-menu-item.active {
563
+ background: #e6f7ff;
564
+ color: #1890ff;
565
+ font-weight: 500;
566
+ }
567
+
568
+ /* 菜单项图标占位区域 */
569
+ .menu-item-icon {
570
+ width: 16px;
571
+ height: 16px;
572
+ flex-shrink: 0;
573
+ display: inline-flex;
574
+ align-items: center;
575
+ justify-content: center;
576
+ }
577
+
578
+ .menu-item-icon .icon {
579
+ --icon-size: 14px;
580
+ color: #52c41a;
581
+ }
582
+
583
+ /* 菜单项标签 */
584
+ .menu-item-label {
585
+ flex: 1;
586
+ text-align: left;
587
+ }
588
+
589
+ /* 通用下拉菜单样式(供 renderMenu 使用) */
590
+ .dropdown-menu {
591
+ padding: 4px 0;
592
+ min-width: 150px;
593
+ background: var(--fe-color-bg, #fff);
594
+ border: 1px solid var(--fe-color-border, #e8e8e8);
595
+ border-radius: 6px;
596
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
597
+ }
598
+
599
+ .dropdown-menu-item {
600
+ display: flex;
601
+ align-items: center;
602
+ gap: 8px;
603
+ padding: 8px 16px;
604
+ cursor: pointer;
605
+ transition: background 0.2s;
606
+ font-size: 14px;
607
+ color: var(--fe-color-text, #333);
608
+ }
609
+
610
+ .dropdown-menu-item:hover {
611
+ background: var(--fe-color-hover, #f5f5f5);
612
+ }
613
+
614
+ .dropdown-menu-item.active {
615
+ background: #e6f7ff;
616
+ color: #1890ff;
617
+ }
618
+
619
+ :host([dark]) .emitter-dropdown-menu {
620
+ background: #2a2a2a;
621
+ border-color: #404040;
622
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
623
+ }
624
+
625
+ :host([dark]) .emitter-menu-item {
626
+ color: rgba(255, 255, 255, 0.85);
627
+ }
628
+
629
+ :host([dark]) .emitter-menu-item:hover {
630
+ background: rgba(255, 255, 255, 0.06);
631
+ }
632
+
633
+ :host([dark]) .emitter-menu-item.active {
634
+ background: rgba(24, 144, 255, 0.15);
635
+ color: #40a9ff;
636
+ }
637
+
638
+ :host([dark]) .dropdown-menu {
639
+ background: var(--fe-color-bg, #2a2a2a);
640
+ border-color: var(--fe-color-border, #404040);
641
+ }
642
+
643
+ :host([dark]) .dropdown-menu-item.active {
644
+ background: rgba(24, 144, 255, 0.15);
645
+ color: #40a9ff;
646
+ }
647
+ `,It=G`
648
+ ${ct}
649
+ :host {
650
+ display: flex;
651
+ flex-direction: column;
652
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
653
+ font-size: 14px;
654
+ line-height: 1.5;
655
+ color: var(--fe-color-text, #333);
656
+ background: var(--fe-color-bg, #fff);
657
+ overflow: hidden;
658
+ position: relative;
659
+ }
660
+
661
+ :host([dark]) {
662
+ --fe-color-text: rgba(255, 255, 255, 0.85);
663
+ --fe-color-bg: #1f1f1f;
664
+ --fe-color-border: #303030;
665
+ --fe-color-header-bg: #141414;
666
+ --fe-color-hover: rgba(255, 255, 255, 0.08);
667
+ --fe-color-text-secondary: rgba(255, 255, 255, 0.45);
668
+ --fe-color-bg-secondary: rgba(255, 255, 255, 0.05);
669
+ --fe-color-tag-bg: rgba(255, 255, 255, 0.08);
670
+ --fe-color-tag-text: rgba(255, 255, 255, 0.85);
671
+ --fe-left-width: 33.33%;
672
+ }
673
+
674
+ :host {
675
+ --fe-left-width: 30%;
676
+ }
677
+
678
+ .toolbar {
679
+ display: flex;
680
+ align-items: center;
681
+ justify-content: space-between;
682
+ padding: 0.75em 1em;
683
+ border-bottom: 1px solid var(--fe-color-border, #e8e8e8);
684
+ background: var(--fe-color-header-bg, #fff);
685
+ }
686
+
687
+ .toolbar-title {
688
+ font-size: 14px;
689
+ /* font-weight: 600;
690
+ color: var(--fe-color-text, #333); */
691
+ }
692
+
693
+ .main-container {
694
+ display: flex;
695
+ flex: 1;
696
+ overflow: hidden;
697
+ position: relative;
698
+ }
699
+
700
+ .tree-panel {
701
+ flex: 0 0 var(--fe-left-width, 33.33%);
702
+ overflow-y: auto;
703
+ overflow-x: hidden;
704
+ border-right: 1px solid var(--fe-color-border, #e8e8e8);
705
+ padding: 8px;
706
+ }
707
+
708
+ .tree-panel::-webkit-scrollbar {
709
+ width: 2px;
710
+ }
711
+ .tree-panel::-webkit-scrollbar-thumb {
712
+ background: transparent;
713
+ }
714
+ .tree-panel:hover::-webkit-scrollbar-thumb {
715
+ background: rgba(0, 0, 0, 0.2);
716
+ }
717
+
718
+ .listeners-panel {
719
+ flex: 1;
720
+ overflow-y: auto;
721
+ overflow-x: hidden;
722
+ padding: 8px;
723
+ padding-left: 0px;
724
+ }
725
+
726
+ .listeners-panel::-webkit-scrollbar {
727
+ width: 2px;
728
+ }
729
+ .listeners-panel::-webkit-scrollbar-thumb {
730
+ background: transparent;
731
+ }
732
+ .listeners-panel:hover::-webkit-scrollbar-thumb {
733
+ background: rgba(0, 0, 0, 0.2);
734
+ }
735
+
736
+ .resizer {
737
+ width: 8px;
738
+ cursor: col-resize;
739
+ background: transparent;
740
+ position: relative;
741
+ z-index: 10;
742
+ flex-shrink: 0;
743
+ user-select: none;
744
+ }
745
+
746
+ .resizer::after {
747
+ content: "";
748
+ position: absolute;
749
+ left: 50%;
750
+ top: 50%;
751
+ transform: translate(-50%, -50%);
752
+ width: 4px;
753
+ height: 40px;
754
+ background: var(--fe-color-border, #e8e8e8);
755
+ border-radius: 2px;
756
+ opacity: 0;
757
+ transition:
758
+ opacity 0.2s,
759
+ height 0.2s;
760
+ }
761
+
762
+ .resizer:hover::after {
763
+ opacity: 1;
764
+ background: #1890ff;
765
+ }
766
+
767
+ .resizer.dragging::after {
768
+ opacity: 1;
769
+ background: #1890ff;
770
+ height: 60px;
771
+ }
772
+
773
+ .empty-state {
774
+ display: flex;
775
+ flex-direction: column;
776
+ align-items: center;
777
+ justify-content: center;
778
+ padding: 3em;
779
+ padding-left: 0;
780
+ color: var(--fe-color-text-secondary, #999);
781
+ text-align: center;
782
+ }
783
+
784
+ .btn {
785
+ display: inline-flex;
786
+ align-items: center;
787
+ justify-content: center;
788
+ gap: 6px;
789
+ padding: 0.4em 0.8em;
790
+ border: none;
791
+ border-radius: 4px;
792
+ background: transparent;
793
+ color: var(--fe-color-text, #333);
794
+ font-size: 13px;
795
+ cursor: pointer;
796
+ transition: all 0.3s;
797
+ user-select: none;
798
+ }
799
+
800
+ .btn:hover {
801
+ color: #1890ff;
802
+ background: rgba(24, 144, 255, 0.06);
803
+ }
804
+
805
+ .btn-icon {
806
+ padding: 0.2em;
807
+ width: 24px;
808
+ height: 24px;
809
+ }
810
+
811
+ .tag {
812
+ display: inline-flex;
813
+ align-items: center;
814
+ padding: 0.1em 0.4em;
815
+ border-radius: 5px;
816
+ font-size: 11px;
817
+ white-space: nowrap;
818
+ background: var(--fe-color-tag-bg, #f0f0f0);
819
+ color: var(--fe-color-tag-text, #666);
820
+ }
821
+
822
+ .tree-node {
823
+ display: flex;
824
+ align-items: center;
825
+ padding: 4px 8px;
826
+ cursor: pointer;
827
+ border-radius: 4px;
828
+ transition: background 0.2s;
829
+ user-select: none;
830
+ }
831
+
832
+ .tree-node:hover {
833
+ background: var(--fe-color-hover, #fafafa);
834
+ }
835
+
836
+ .tree-node.selected {
837
+ background: rgba(24, 144, 255, 0.1);
838
+ }
839
+
840
+ .tree-node-toggle {
841
+ width: 16px;
842
+ height: 16px;
843
+ margin-right: 4px;
844
+ cursor: pointer;
845
+ display: inline-flex;
846
+ align-items: center;
847
+ justify-content: center;
848
+ transition: transform 0.2s;
849
+ }
850
+
851
+ .tree-node-toggle.expanded {
852
+ transform: rotate(90deg);
853
+ }
854
+
855
+ .tree-node-toggle.hidden {
856
+ visibility: hidden;
857
+ }
858
+
859
+ .tree-node-content {
860
+ display: flex;
861
+ align-items: center;
862
+ gap: 6px;
863
+ flex: 1;
864
+ }
865
+
866
+ .tree-node-label {
867
+ font-family: "SFMono-Regular", Consolas, monospace;
868
+ font-size: 13px;
869
+ flex-grow: 1;
870
+ }
871
+
872
+ .tree-node-badge {
873
+ background: var(--fe-color-tag-bg, #f0f0f0);
874
+ color: var(--fe-color-tag-text, #666);
875
+ padding: 2px 6px;
876
+ border-radius: 8px;
877
+ font-size: 11px;
878
+ }
879
+
880
+ .tree-children {
881
+ padding-left: 16px;
882
+ }
883
+
884
+ .tag {
885
+ display: inline-flex;
886
+ align-items: center;
887
+ padding: 0.1em 0.4em;
888
+ border-radius: 5px;
889
+ font-size: 11px;
890
+ white-space: nowrap;
891
+ background: var(--fe-color-tag-bg, #f0f0f0);
892
+ color: var(--fe-color-tag-text, #666);
893
+ }
894
+
895
+ /* 保留消息卡片样式 */
896
+ .retained-message-card {
897
+ margin-bottom: 12px;
898
+ border-radius: 6px;
899
+ border: 1px solid #ffa39e;
900
+ background: #fff1f0;
901
+ overflow: hidden;
902
+ transition: all 0.2s;
903
+ }
904
+
905
+ .retained-message-card:hover {
906
+ box-shadow: 0 2px 8px rgba(255, 77, 79, 0.15);
907
+ }
908
+
909
+ .retained-message-header {
910
+ display: flex;
911
+ align-items: center;
912
+ justify-content: space-between;
913
+ padding: 8px 12px;
914
+ background: rgba(255, 77, 79, 0.1);
915
+ border-bottom: 1px solid #ffa39e;
916
+ }
917
+
918
+ .retained-message-title {
919
+ flex: 1;
920
+ font-size: 13px;
921
+ font-weight: 500;
922
+ color: #ff4d4f;
923
+ }
924
+
925
+ .retained-message-actions {
926
+ display: flex;
927
+ gap: 4px;
928
+ }
929
+
930
+ .retained-message-content {
931
+ padding: 4px;
932
+ }
933
+
934
+ .retained-message-text {
935
+ margin: 0;
936
+ padding: 8px;
937
+ background: rgba(255, 255, 255, 0.6);
938
+ border-radius: 4px;
939
+ font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
940
+ font-size: 12px;
941
+ line-height: 1.5;
942
+ color: #262626;
943
+ overflow-x: auto;
944
+ white-space: pre-wrap;
945
+ word-break: break-all;
946
+ }
947
+
948
+ /* 暗黑模式下的保留消息卡片 */
949
+ .retained-message-card.dark,
950
+ :host([dark]) .retained-message-card {
951
+ border: 1px solid rgba(255, 77, 79, 0.4);
952
+ background: rgba(255, 77, 79, 0.08);
953
+ }
954
+
955
+ .retained-message-card.dark:hover,
956
+ :host([dark]) .retained-message-card:hover {
957
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
958
+ }
959
+
960
+ .retained-message-card.dark .retained-message-header,
961
+ :host([dark]) .retained-message-header {
962
+ background: rgba(255, 77, 79, 0.15);
963
+ border-bottom: 1px solid rgba(255, 77, 79, 0.3);
964
+ }
965
+
966
+ .retained-message-card.dark .retained-message-title,
967
+ :host([dark]) .retained-message-title {
968
+ color: #ff7875;
969
+ }
970
+
971
+ .retained-message-card.dark .retained-message-text,
972
+ :host([dark]) .retained-message-text {
973
+ background: rgba(0, 0, 0, 0.2);
974
+ color: rgba(255, 255, 255, 0.85);
975
+ }
976
+
977
+ @media (max-width: 568px) {
978
+ .main-container {
979
+ flex-direction: column;
980
+ }
981
+
982
+ .tree-panel {
983
+ flex: 0 0 40%;
984
+ border-right: none;
985
+ border-bottom: 1px solid var(--fe-color-border, #e8e8e8);
986
+ }
987
+
988
+ .resizer {
989
+ display: none;
990
+ }
991
+ }
992
+ `,Bt=G`
993
+ :host {
994
+ display: block;
995
+ }
996
+
997
+ :host([dark]) {
998
+ --fe-color-card-bg: rgba(255, 255, 255, 0.04);
999
+ --fe-color-card-border: rgba(255, 255, 255, 0.12);
1000
+ --fe-color-card-hover: rgba(255, 255, 255, 0.08);
1001
+ }
1002
+
1003
+ .listener-card {
1004
+ display: table;
1005
+ width: 100%;
1006
+ padding: 0px;
1007
+ margin-bottom: 8px;
1008
+ border-radius: 6px;
1009
+ border: 1px solid var(--fe-color-border, #e8e8e8);
1010
+ transition: all 0.2s;
1011
+ box-sizing: border-box;
1012
+ background-color: #f9f9f9;
1013
+ }
1014
+
1015
+ .listener-card:hover {
1016
+ /* border-color: #1890ff; */
1017
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
1018
+ }
1019
+
1020
+ :host([dark]) .listener-card {
1021
+ background-color: var(--fe-color-card-bg, rgba(255, 255, 255, 0.04));
1022
+ border: 1px solid var(--fe-color-card-border, rgba(255, 255, 255, 0.12));
1023
+ }
1024
+
1025
+ :host([dark]) .listener-card:hover {
1026
+ background-color: var(--fe-color-card-hover, rgba(255, 255, 255, 0.08));
1027
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
1028
+ }
1029
+
1030
+ .listener-row {
1031
+ display: table-row;
1032
+ border-bottom: 1px solid var(--fe-color-border, #e8e8e8);
1033
+ }
1034
+
1035
+ .listener-row:last-child {
1036
+ border-bottom: none;
1037
+ }
1038
+
1039
+ .listener-cell {
1040
+ display: table-cell;
1041
+ padding: 4px 8px;
1042
+ vertical-align: middle;
1043
+ border-right: 1px solid var(--fe-color-border, #e8e8e8);
1044
+ }
1045
+
1046
+ .listener-cell:first-child {
1047
+ width: 80px;
1048
+ min-width: 80px;
1049
+ }
1050
+
1051
+ .listener-cell:last-child {
1052
+ border-right: none;
1053
+ }
1054
+
1055
+ .listener-label {
1056
+ color: var(--fe-color-text-secondary, #999);
1057
+ font-size: 12px;
1058
+ font-weight: 500;
1059
+ }
1060
+
1061
+ .listener-value {
1062
+ color: var(--fe-color-text, #333);
1063
+ font-size: 13px;
1064
+ }
1065
+
1066
+ .listener-function {
1067
+ font-family: "SFMono-Regular", Consolas, monospace;
1068
+ color: #1890ff;
1069
+ cursor: pointer;
1070
+ text-decoration: underline;
1071
+ }
1072
+
1073
+ .listener-function:hover {
1074
+ color: #40a9ff;
1075
+ }
1076
+
1077
+ :host([dark]) .listener-function {
1078
+ color: #40a9ff;
1079
+ }
1080
+
1081
+ :host([dark]) .listener-function:hover {
1082
+ color: #69c0ff;
1083
+ }
1084
+
1085
+ .tag {
1086
+ display: inline-flex;
1087
+ align-items: center;
1088
+ padding: 0.1em 0.4em;
1089
+ border-radius: 5px;
1090
+ font-size: 11px;
1091
+ white-space: nowrap;
1092
+ background: var(--fe-color-tag-bg, #f0f0f0);
1093
+ color: var(--fe-color-tag-text, #666);
1094
+ }
1095
+
1096
+ .empty-state {
1097
+ display: flex;
1098
+ align-items: center;
1099
+ justify-content: center;
1100
+ padding: 1em;
1101
+ color: var(--fe-color-text-secondary, #999);
1102
+ text-align: center;
1103
+ }
1104
+ `;function O(r,e){for(let t=r.length-1;t>=0;t--)r[t]===e&&r.splice(t,1)}var Wt={bg:"#f0f0f0",color:"#666",border:"#d9d9d9"},qt={blue:{bg:"#e6f7ff",color:"#1890ff",border:"#91d5ff"},green:{bg:"#f6ffed",color:"#52c41a",border:"#b7eb8f"},orange:{bg:"#fff7e6",color:"#fa8c16",border:"#ffd591"},red:{bg:"#fff1f0",color:"#ff4d4f",border:"#ffa39e"},purple:{bg:"#f9f0ff",color:"#722ed1",border:"#d3adf7"},gray:{bg:"#f5f5f5",color:"#8c8c8c",border:"#d9d9d9"}},Jt={blue:{bg:"rgba(24, 144, 255, 0.15)",color:"#40a9ff",border:"rgba(24, 144, 255, 0.3)"},green:{bg:"rgba(82, 196, 26, 0.15)",color:"#73d13d",border:"rgba(82, 196, 26, 0.3)"},orange:{bg:"rgba(250, 140, 22, 0.15)",color:"#ffa940",border:"rgba(250, 140, 22, 0.3)"},red:{bg:"rgba(255, 77, 79, 0.15)",color:"#ff7875",border:"rgba(255, 77, 79, 0.3)"},purple:{bg:"rgba(114, 46, 209, 0.15)",color:"#b37feb",border:"rgba(114, 46, 209, 0.3)"},gray:{bg:"rgba(140, 140, 140, 0.15)",color:"#bfbfbf",border:"rgba(140, 140, 140, 0.3)"}};function Kt(r){const e=["blue","green","orange","red","purple"];let t=0;for(let s=0;s<r.length;s++)t=r.charCodeAt(s)+((t<<5)-t);return e[Math.abs(t)%e.length]}function $(r,e,t,s,i){if(typeof e=="object"&&e!==null&&"styles"in e){const n=e;return c`<span
1105
+ class="${["tag",n.dark??i??!1?"dark":"",n.className].filter(Boolean).join(" ")}"
1106
+ title="${n.tooltip||r}"
1107
+ style="${n.styles}"
1108
+ @click="${n.onClick}"
1109
+ >
1110
+ ${r}
1111
+ </span>`}else{const n=e||Kt(r),o=(i??!1?Jt:qt)[n]||Wt;return c`<span
1112
+ class="${["tag",s].filter(Boolean).join(" ")}"
1113
+ title="${t||r}"
1114
+ style="display: inline-flex; align-items: center; padding: 0.1em 0.4em; border-radius: 5px; font-size: 11px; white-space: nowrap; background: ${o.bg}; color: ${o.color}; ${o.border?`border: 1px solid ${o.border};`:""}"
1115
+ >
1116
+ ${r}
1117
+ </span>`}}function C(r,e,t={}){const{icon:s,pressed:i,className:n="",title:o}=t,a=["btn",n];return i&&a.push("btn-pressed"),s&&a.push("btn-icon"),c`<button
1118
+ class="${a.join(" ")}"
1119
+ title="${o||""}"
1120
+ @click="${e}"
1121
+ style="display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0.4em 0.8em; border: none; border-radius: 4px; background: transparent; cursor: pointer; transition: all 0.3s; user-select: none; ${s?"padding: 0.2em; width: 24px; height: 24px;":""}"
1122
+ >
1123
+ ${s?c`<span class="icon ${s}"></span>`:""}
1124
+ ${r}
1125
+ </button>`}function W(r,e){return e?c`<span class="icon ${r}" title="${e}"></span>`:c`<span class="icon ${r}"></span>`}function Xt(r){const{message:e,pathKey:t,dark:s=!1,onDelete:i,onPrint:n,onCopy:o}=r,a=JSON.stringify(e,null,2),l=a.split(`
1126
+ `).length>15?a.split(`
1127
+ `).slice(0,5).join(`
1128
+ `)+`
1129
+ ...`:a;return c`
1130
+ <div class="retained-message-card${s?" dark":""}">
1131
+ <div class="retained-message-header">
1132
+ <span class="retained-message-title">保留消息</span>
1133
+ <div class="retained-message-actions">
1134
+ ${C("",()=>i?.(t),{icon:"delete",className:"btn-icon",title:"删除保留消息"})}
1135
+ ${C("",()=>n?.(e),{icon:"listeners",className:"btn-icon",title:"打印到控制台"})}
1136
+ ${C("",()=>o?.(e),{icon:"copy",className:"btn-icon",title:"复制消息内容"})}
1137
+ </div>
1138
+ </div>
1139
+ <div class="retained-message-content">
1140
+ <pre class="retained-message-text">${l}</pre>
1141
+ </div>
1142
+ </div>
1143
+ `}var xe={cn:{"eventViewer.filterPlaceholder":"事件类型过滤","eventViewer.normalMode":"正常模式","eventViewer.darkMode":"暗黑模式","eventViewer.showEvent":"显示事件","eventViewer.showListeners":"显示注册的监听器","eventViewer.totalLogs":"共{0}条","eventViewer.hideListenerDetails":"隐藏监听器详情","eventViewer.showListenerDetails":"显示监听器详情","eventViewer.clear":"清空","eventViewer.extendedFlags":"扩展标识","eventViewer.transformed":"经过转换","eventViewer.serialNumber":"序号","eventViewer.totalListeners":"共{0}个监听器","eventViewer.retainLastEvent":"保留最后一次事件数据","eventViewer.rawEventType":"原始事件类型: {0}","eventViewer.executionTime":"执行耗时","eventViewer.copyMessage":"复制事件消息","eventViewer.triggerTime":"触发时间","eventViewer.eventType":"事件类型","eventViewer.listenerTag":"监听器标签: {0}","eventViewer.executionCount":"执行次数计数(当前/总数)","eventViewer.listenerFlags":"监听器标识flags","eventViewer.executing":"执行中...","eventViewer.error":"错误: {0}","eventViewer.noEventLogs":"暂无事件日志","eventViewer.listener":"监听器: {0}","eventViewer.executionResult":"执行结果:","eventViewer.switchEmitter":"切换 Emitter","eventViewer.inspect":"注册实例到控制台:{}","listenerViewer.registeredListeners":"已注册监听器","listenerViewer.refresh":"刷新","listenerViewer.noRegisteredListeners":"暂无注册的监听器","listenerViewer.nodeHasNoListeners":"该节点暂无监听器","listenerViewer.listener":"监听器: {0}","listenerViewer.executionCount":"执行次数: {0}/{1}","listenerViewer.tag":"标签: {0}","listenerViewer.flags":"标识: {0}","listenerViewer.retainedMessage":"保留消息","listenerCard.invalidData":"监听器数据无效","listenerCard.listenerFunction":"监听函数","listenerCard.executionCount":"执行次数","listenerCard.tag":"标签","listenerCard.flags":"标识","listenerCard.returnValue":"返回值","listenerCard.clickToConsole":"点击在控制台输出监听器信息","listenerCard.clickToConsoleResult":"单击显示在控制台","listenerCard.anonymous":"anonymous"},en:{"eventViewer.filterPlaceholder":"Filter by event type","eventViewer.normalMode":"Normal mode","eventViewer.darkMode":"Dark mode","eventViewer.showEvent":"Show events","eventViewer.showListeners":"Show registered listeners","eventViewer.totalLogs":"Total {0}","eventViewer.hideListenerDetails":"Hide listener details","eventViewer.showListenerDetails":"Show listener details","eventViewer.clear":"Clear","eventViewer.extendedFlags":"Extended flags","eventViewer.transformed":"Transformed","eventViewer.serialNumber":"Serial number","eventViewer.totalListeners":"{0} listeners","eventViewer.retainLastEvent":"Retain last event data","eventViewer.rawEventType":"Raw event type: {0}","eventViewer.executionTime":"Execution time","eventViewer.copyMessage":"Copy event message","eventViewer.triggerTime":"Trigger time","eventViewer.eventType":"Event type","eventViewer.listenerTag":"Listener tag: {0}","eventViewer.executionCount":"Execution count (current/total)","eventViewer.listenerFlags":"Listener flags","eventViewer.executing":"Executing...","eventViewer.error":"Error: {0}","eventViewer.noEventLogs":"No event logs","eventViewer.listener":"Listener: {0}","eventViewer.executionResult":"Execution result:","eventViewer.switchEmitter":"Switch Emitter","eventViewer.inspect":"Inject to console: {}","listenerViewer.registeredListeners":"Registered Listeners","listenerViewer.refresh":"Refresh","listenerViewer.noRegisteredListeners":"No registered listeners","listenerViewer.nodeHasNoListeners":"This node has no listeners","listenerViewer.listener":"Listener: {0}","listenerViewer.executionCount":"Execution count: {0}/{1}","listenerViewer.tag":"Tag: {0}","listenerViewer.flags":"Flags: {0}","listenerViewer.retainedMessage":"Retained Message","listenerCard.invalidData":"Invalid listener data","listenerCard.listenerFunction":"Listener function","listenerCard.executionCount":"Execution count","listenerCard.tag":"Tag","listenerCard.flags":"Flags","listenerCard.returnValue":"Return value","listenerCard.clickToConsole":"Click to output listener info to console","listenerCard.clickToConsoleResult":"Click to show in console","listenerCard.anonymous":"anonymous"}},we="cn";function q(r=we){r in xe&&(we=r)}function d(r,...e){const t=xe[we]||xe.cn,s=r in t?t[r]:r,i=/\{[^}]*\}/g;let n=0;return s.replace(i,()=>n<e.length?String(e[n++]):i.exec(s)?.[0]||"")}function f(r,e,t,s){var i=arguments.length,n=i<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,s);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(n=(i<3?o(n):i>3?o(e,t,n):o(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n}var z=class extends A{constructor(...e){super(...e),this.dark=!1,this.lang="cn",this._onAfterExecuteListener=(t,s,i)=>{Z(t.type.split("/"),this.type.split("/"))&&this.requestUpdate()}}static{this.styles=Bt}connectedCallback(){super.connectedCallback(),this._addListenerHook(),q(this.lang)}disconnectedCallback(){super.disconnectedCallback(),this._removeListenerHook()}willUpdate(e){super.willUpdate(e),e.has("lang")&&q(this.lang)}_addListenerHook(){this.emitter&&this.emitter.hooks.AfterExecuteListener.push(this._onAfterExecuteListener)}_removeListenerHook(){this.emitter&&O(this.emitter.hooks.AfterExecuteListener,this._onAfterExecuteListener)}_formatListenerCount(e){const[,t,s]=e;return t===0?`${s}/∞`:`${s}/${t}`}getFunctionPosition(e){const t=e.toString(),s=new Error().stack;console.group("函数定位"),console.log("函数代码:",t.substring(0,200)),console.log("当前调用栈:",s),console.groupEnd(),console.log(e)}_printListenerToConsole(e){const[t]=e;if(typeof t!="function"){console.warn(d("listenerCard.invalidData")),console.log("元数据:",{executed:`${e[2]}/${e[1]}`,tag:e[3],flags:e[4]});return}console.group("FastEvent Listener"),console.log(d("listenerViewer.listener",t.name||d("listenerCard.anonymous"))),console.log(t),console.log(d("listenerViewer.executionCount",e[2],e[1])),console.log(d("listenerViewer.tag",e[3])),e[4]!==void 0&&console.log(d("listenerViewer.flags",e[4])),console.groupEnd()}_printListenerResultToConsole(e){if(e.length===6){console.group("FastEvent Listener returns");const t=e[5]instanceof WeakRef?e[5].deref():e[5];console.log(t),console.groupEnd()}}_renderReturns(e){if(e.length===6&&e[5]){const t=e[5]instanceof WeakRef?e[5].deref():e[5];return c`
1144
+ <div class="listener-row">
1145
+ <div class="listener-cell listener-label">${d("listenerCard.returnValue")}</div>
1146
+ <div class="listener-cell listener-value" title="${d("listenerCard.clickToConsoleResult")}" style="cursor:pointer"
1147
+ @click="${()=>this._printListenerResultToConsole(this.listener)}"
1148
+ >${t instanceof Error?t.stack:JSON.stringify(t)}</div>
1149
+ </div>
1150
+ `}}render(){if(!this.listener)return c`
1151
+ <div class="empty-state">${d("listenerCard.invalidData")}</div>
1152
+ `;const[e,,,t,s]=this.listener,i=e.name||d("listenerCard.anonymous");return c`
1153
+ <div class="listener-card">
1154
+ <div class="listener-row">
1155
+ <div class="listener-cell listener-label">${d("listenerCard.listenerFunction")}</div>
1156
+ <div class="listener-cell">
1157
+ <span
1158
+ class="listener-function"
1159
+ @click="${()=>this._printListenerToConsole(this.listener)}"
1160
+ title="${d("listenerCard.clickToConsole")}"
1161
+ >
1162
+ ${i}
1163
+ </span>
1164
+ </div>
1165
+ </div>
1166
+ <div class="listener-row">
1167
+ <div class="listener-cell listener-label">${d("listenerCard.executionCount")}</div>
1168
+ <div class="listener-cell listener-value">${this._formatListenerCount(this.listener)}</div>
1169
+ </div>
1170
+ ${t?c`
1171
+ <div class="listener-row">
1172
+ <div class="listener-cell listener-label">${d("listenerCard.tag")}</div>
1173
+ <div class="listener-cell">${$(t)}</div>
1174
+ </div>
1175
+ `:""}
1176
+ ${s!==void 0?c`
1177
+ <div class="listener-row">
1178
+ <div class="listener-cell listener-label">${d("listenerCard.flags")}</div>
1179
+ <div class="listener-cell listener-value">${s}</div>
1180
+ </div>
1181
+ `:""}
1182
+ ${this._renderReturns(this.listener)}
1183
+ </div>
1184
+ `}};f([v({attribute:!1})],z.prototype,"emitter",void 0),f([v({attribute:!1})],z.prototype,"listener",void 0),f([v({type:Boolean,reflect:!0})],z.prototype,"dark",void 0),f([v({type:String})],z.prototype,"type",void 0),f([v({type:String,reflect:!0})],z.prototype,"lang",void 0),z=f([ie("fastevent-listener-card")],z);var L=class extends A{constructor(...e){super(...e),this.dark=!1,this._selectedPath=[],this._listeners=[],this._expandedNodes=new Set,this.lang="cn",this._leftWidth="30%",this._isResizing=!1,this._resizeStartX=0,this._resizeStartWidth=0,this._onAddAfterListener=(t,s)=>{this.requestUpdate()},this._onRemoveListener=(t,s,i)=>{this.requestUpdate()},this._onClearListeners=()=>{this._handleRefresh()},this._handleResizeMove=t=>{if(!this._isResizing)return;const s=t.clientX-this._resizeStartX,i=this.shadowRoot?.querySelector(".main-container")?.offsetWidth||0,n=(this._resizeStartWidth+s)/i*100;this._leftWidth=`${Math.max(20,Math.min(80,n))}%`,this.style.setProperty("--fe-left-width",this._leftWidth)},this._handleResizeEnd=()=>{this._isResizing=!1,document.removeEventListener("mousemove",this._handleResizeMove),document.removeEventListener("mouseup",this._handleResizeEnd),this.shadowRoot?.querySelector(".resizer")?.classList.remove("dragging")}}static{this.styles=It}_getListenerNode(e){if(!this.emitter?.listeners||e.length===0)return null;let t=this.emitter.listeners;for(const s of e)if(t[s])t=t[s];else return null;return t}_findFirstNodeWithListeners(){if(!this.emitter?.listeners)return null;const e=(t,s)=>{if(t.__listeners&&t.__listeners.length>0)return s;for(const i in t){if(i==="__listeners")continue;const n=e(t[i],[...s,i]);if(n)return n}return null};return e(this.emitter.listeners,[])}_initializeExpandedNodes(){if(!this.emitter?.listeners)return;this._expandedNodes=new Set;const e=(t,s)=>{this._expandedNodes.add(s.join("/"));for(const i in t)i!=="__listeners"&&e(t[i],[...s,i])};e(this.emitter.listeners,[])}_refreshData(){if(this.emitter&&this._expandedNodes.size===0){this._initializeExpandedNodes();const e=this._findFirstNodeWithListeners();e&&(this._selectedPath=e,this._listeners=this._getListenerNode(e)?.__listeners||[])}else this._selectedPath.length>0&&(this._listeners=this._getListenerNode(this._selectedPath)?.__listeners||[])}_handleNodeSelect(e){const t=e.currentTarget.dataset.path;if(!t)return;const s=t.split("/");this._selectedPath=s,this._listeners=this._getListenerNode(s)?.__listeners||[],this.requestUpdate()}_setupHooks(){this.emitter&&(this.emitter.hooks.AddAfterListener.push(this._onAddAfterListener),this.emitter.hooks.RemoveListener.push(this._onRemoveListener),this.emitter.hooks.ClearListeners.push(this._onClearListeners))}_clearHooks(){this.emitter&&(O(this.emitter.hooks.AddAfterListener,this._onAddAfterListener),O(this.emitter.hooks.RemoveListener,this._onRemoveListener),O(this.emitter.hooks.ClearListeners,this._onClearListeners))}_handleNodeToggle(e){const t=e.currentTarget.closest("[data-path]")?.dataset.path;if(!t)return;const s=t;this._expandedNodes.has(s)?this._expandedNodes.delete(s):this._expandedNodes.add(s),this.requestUpdate()}_handleRefresh(){this._refreshData(),this.requestUpdate()}_handleResizeStart(e){this._isResizing=!0,this._resizeStartX=e.clientX,this._resizeStartWidth=this.shadowRoot?.querySelector(".tree-panel")?.offsetWidth||0,document.addEventListener("mousemove",this._handleResizeMove),document.addEventListener("mouseup",this._handleResizeEnd),this.shadowRoot?.querySelector(".resizer")?.classList.add("dragging")}_handleKeyDown(e){const t=e.currentTarget.dataset.path;if(!t)return;const s=t;switch(e.key){case"Enter":case" ":e.preventDefault(),this._handleNodeSelect(e);break;case"ArrowRight":e.preventDefault(),this._expandedNodes.has(s)||this._handleNodeToggle(e);break;case"ArrowLeft":e.preventDefault(),this._expandedNodes.has(s)&&this._handleNodeToggle(e);break}}_isEmptyNode(e){return Object.keys(e).length===1&&e.__listeners&&e.__listeners.length===0}renderTreeNode(e,t,s){const i=t.join("/"),n=this._expandedNodes.has(i),o=JSON.stringify(this._selectedPath)===JSON.stringify(t),a=Object.keys(e).filter(u=>u!=="__listeners"),l=a.length>0,m=e.__listeners?.length||0;return c`
1185
+ <div>
1186
+ <div
1187
+ class="tree-node ${o?"selected":""}"
1188
+ style="padding-left: ${s*8+8}px"
1189
+ role="treeitem"
1190
+ data-path="${i}"
1191
+ aria-expanded="${l?n:!1}"
1192
+ aria-selected="${o}"
1193
+ tabindex="${o?"0":"-1"}"
1194
+ @keydown="${this._handleKeyDown}"
1195
+ >
1196
+ <span
1197
+ class="tree-node-toggle ${n?"expanded":""} ${l?"":"hidden"}"
1198
+ data-path="${i}"
1199
+ @click="${this._handleNodeToggle}"
1200
+ >
1201
+ <span class="icon arrow"></span>
1202
+ </span>
1203
+ <span class="tree-node-content" data-path="${i}" @click="${this._handleNodeSelect}">
1204
+ <span class="icon listeners"></span>
1205
+ <span class="tree-node-label">${t[t.length-1]}</span>
1206
+ ${this.emitter?.retainedMessages.has(i)?$("retain","red",d("listenerViewer.retainedMessage")):""}
1207
+ ${m>0?c`
1208
+ <span class="tree-node-badge">${m}</span>
1209
+ `:""}
1210
+ </span>
1211
+ </div>
1212
+ ${l&&n?c`
1213
+ <div class="tree-children">
1214
+ ${a.map(u=>{const h=[...t,u];return this.renderTreeNode(e[u],h,s+1)})}
1215
+ </div>
1216
+ `:""}
1217
+ </div>
1218
+ `}renderTree(){const e=this.emitter?.listeners;return!e||this._isEmptyNode(e)?c`
1219
+ <div class="empty-state">
1220
+ <span class="icon listeners"></span>
1221
+ <p>${d("listenerViewer.noRegisteredListeners")}</p>
1222
+ </div>
1223
+ `:c`
1224
+ <div>
1225
+ ${Object.keys(e).filter(t=>t!=="__listeners").map(t=>this.renderTreeNode(e[t],[t],0))}
1226
+ </div>
1227
+ `}renderListener(e,t){return c`<fastevent-listener-card .listener="${e}" .emitter="${this.emitter}" .type="${t}" .dark="${this.dark}" .lang="${this.lang}"></fastevent-listener-card>`}renderListeners(){const e=this._selectedPath.join("/"),t=this.emitter?.retainedMessages.get(e);return c`
1228
+ <div>
1229
+ ${t?Xt({message:t,pathKey:e,dark:this.dark,onDelete:s=>{this.emitter?.retainedMessages.delete(s),this.requestUpdate()},onPrint:s=>{console.group(d("listenerViewer.retainedMessage")),console.log(s),console.groupEnd()},onCopy:s=>{const i=JSON.stringify(s,null,2);navigator.clipboard.writeText(i)}}):""}
1230
+ ${this._listeners.length===0?c`
1231
+ <div class="empty-state">
1232
+ <span class="icon listeners" style="--icon-size: 3em"></span>
1233
+ <p>${d("listenerViewer.nodeHasNoListeners")}</p>
1234
+ </div>
1235
+ `:c`
1236
+ <div class="listeners-list">
1237
+ ${this._listeners.map(s=>this.renderListener(s,e))}
1238
+ </div>
1239
+ `}
1240
+ </div>
1241
+ `}willUpdate(e){super.willUpdate(e),e.has("emitter")&&(this.emitter?this._refreshData():(this._listeners=[],this._selectedPath=[],this._expandedNodes=new Set)),e.has("lang")&&q(this.lang)}connectedCallback(){super.connectedCallback(),this.emitter&&(this._refreshData(),this._setupHooks())}disconnectedCallback(){super.disconnectedCallback(),this._isResizing&&(document.removeEventListener("mousemove",this._handleResizeMove),document.removeEventListener("mouseup",this._handleResizeEnd)),this._clearHooks()}render(){return c`
1242
+ <div class="toolbar">
1243
+ <span class="toolbar-title">${d("listenerViewer.registeredListeners")}</span>
1244
+ <button class="btn btn-icon" title="${d("listenerViewer.refresh")}" @click="${this._handleRefresh}">
1245
+ <span class="icon refresh"></span>
1246
+ </button>
1247
+ </div>
1248
+ <div class="main-container">
1249
+ <div class="tree-panel" role="tree">
1250
+ ${this.renderTree()}
1251
+ </div>
1252
+ <div class="resizer" @mousedown="${this._handleResizeStart}"></div>
1253
+ <div class="listeners-panel">
1254
+ ${this.renderListeners()}
1255
+ </div>
1256
+ </div>
1257
+ `}};f([v({type:Object})],L.prototype,"emitter",void 0),f([v({type:Boolean,reflect:!0})],L.prototype,"dark",void 0),f([k()],L.prototype,"_selectedPath",void 0),f([k()],L.prototype,"_listeners",void 0),f([k()],L.prototype,"_expandedNodes",void 0),f([v({type:String,reflect:!0})],L.prototype,"lang",void 0),L=f([ie("fastevent-listeners")],L);var V=class extends A{constructor(...e){super(...e),this.dark=!1,this.showListeners=!1,this._localShowListeners=!1}createRenderRoot(){return this}_toggleListeners(){this._localShowListeners=!this._localShowListeners}_formatTime(e){const t=new Date(e);return`${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}:${t.getSeconds().toString().padStart(2,"0")}.${t.getMilliseconds().toString().padStart(3,"0")}`}_renderLogFlags(e){if(e&&(e.flags||0)>0){const t=e.flags||0;return t>1?$(`${e.flags}`,"orange",d("eventViewer.extendedFlags"),void 0,this.dark):c`${(t|1)==0?"":$("T","orange",d("eventViewer.transformed"),void 0,this.dark)}`}}_formatResult(e){if(e===void 0)return d("eventViewer.executing");if(e===null)return"null";if(e instanceof Error)return d("eventViewer.error",e.message);if(typeof e=="object")try{const t=JSON.stringify(e);return t.length>100?t.substring(0,100)+"...":t}catch{return e.toString()}return String(e)}_renderListener(e){const t=e.status==="ok"?"yes":e.status,s=this._formatResult(e.result);return c`
1258
+ <div class="listener">
1259
+ ${W("listener",d("eventViewer.listener"))}
1260
+ <span class="listener-name" title="${d("eventViewer.listener")}" @click="${()=>this.onPrintListener?.(e)}">${e.name}</span>
1261
+ ${e.tag?$(e.tag,void 0,d("eventViewer.listenerTag",e.tag),void 0,this.dark):""}
1262
+ ${$(e.count,void 0,d("eventViewer.executionCount"),void 0,this.dark)}
1263
+ ${e.flags!==void 0?$(`${e.flags}`,"orange",d("eventViewer.listenerFlags"),void 0,this.dark):""}
1264
+ <span class="listener-status ${t}" title="${s}">
1265
+ ${W(e.status==="running"?"loading":e.status==="ok"?"yes":e.status)}
1266
+ </span>
1267
+ </div>
1268
+ `}_renderListeners(e){return c`${e.map(t=>this._renderListener(t))}`}render(){const e=this.log.message.deref(),t=this.log.args.deref();if(!e)return c``;const s=JSON.stringify(e.payload??""),i=this._formatTime(this.log.triggerTime);return c`
1269
+ <div class="log-item">
1270
+ <div class="log-content">
1271
+ <div class="log-header">
1272
+ ${this.log.done?"✨":W("loading")}
1273
+ <span class="log-type" title="${d("eventViewer.eventType")}">${e.type}</span>
1274
+ <span class="log-time" title="${d("eventViewer.triggerTime")}">${i}</span>
1275
+ ${$(`#${this.log.id}`,"gray",d("eventViewer.serialNumber"),void 0,this.dark)}
1276
+ ${this.showListeners?"":c`<span
1277
+ class="tag-clickable"
1278
+ style="cursor: pointer;"
1279
+ @click="${()=>this._toggleListeners()}">${$(`ƒ(${this.log.listeners.length})`,"purple",d("eventViewer.totalListeners",this.log.listeners.length),void 0,this.dark)}</span>`}
1280
+ ${t?.retain?$("retain","red",d("eventViewer.retainLastEvent"),void 0,this.dark):""}
1281
+ ${this._renderLogFlags(t)}
1282
+ ${t?.rawEventType&&t?.rawEventType!==e.type?$(t.rawEventType,"blue",d("eventViewer.rawEventType",t.rawEventType),void 0,this.dark):""}
1283
+ ${this.log.duration[1]>0?$(`${Number((this.log.duration[1]-this.log.duration[0]).toFixed(3))}ms`,"green",d("eventViewer.executionTime"),void 0,this.dark):""}
1284
+ ${C("",()=>{const n=JSON.stringify(e,null,2);navigator.clipboard.writeText(n)},{icon:"copy",className:"btn-icon",title:d("eventViewer.copyMessage")})}
1285
+ </div>
1286
+ ${s?c`<div class="log-payload">${s}</div>`:""}
1287
+ ${this.log.listeners.length>0?c`
1288
+ <div class="log-listeners ${this.showListeners||this._localShowListeners?"log-listeners-visible":"log-listeners-hidden"}">
1289
+ ${this._renderListeners(this.log.listeners)}
1290
+ </div>
1291
+ `:""}
1292
+ </div>
1293
+ </div>
1294
+ `}};f([v({type:Object})],V.prototype,"log",void 0),f([v({type:Boolean})],V.prototype,"dark",void 0),f([v({type:Boolean})],V.prototype,"showListeners",void 0),f([v({type:Number,attribute:!1})],V.prototype,"updateVersion",void 0),f([v({attribute:!1})],V.prototype,"onPrintListener",void 0),f([k()],V.prototype,"_localShowListeners",void 0),V=f([ie("fastevent-event-log")],V);var x=class extends A{constructor(...e){super(...e),this._emitters=[],this._currentEmitterIndex=0,this._isDropdownOpen=!1,this._emitterLogs=new Map,this._emitterLogIndexes=new Map,this.dark=!1,this.enable=!0,this.maxSize=500,this.title="",this.lang="cn",this.showListeners=!0,this._filterText="",this._showListeners=!1,this._isShowListeners=!1,this.messages=[],this.logs=[],this._logIndexs=[],this._handleDocumentClick=t=>{const s=t.target,i=this.renderRoot?.querySelector(".emitter-dropdown-container");i&&!i.contains(s)&&(this._isDropdownOpen=!1,this.requestUpdate())},this._onBeforeExecuteListener=(t,s)=>{const i=this._getCurrentEmitter();if(!i||!this.enable)return;const n=(i.getListeners(t.type)||[]).map(a=>this._getListenerMeta(a,"running")),o={message:new WeakRef(t),done:!1,args:new WeakRef(s),triggerTime:Date.now(),duration:[performance.now(),0],listeners:n,updateVersion:0};o.id=this.logs.length+1,t.__index=o.id-1,this.logs.push(o),this._logIndexs.unshift(this.logs.length-1),this.maxSize>0&&this.logs.length>this.maxSize&&(this.logs.shift(),this._updateFilteredLogs()),this.requestUpdate()},this._onAfterExecuteListener=(t,s,i)=>{if(!this.enable)return;const n=t.__index;if(typeof n=="number"){const o=this.logs[n];o&&(o.done=!0,o.duration[1]=performance.now());const a=i.reduce((m,u)=>(u.__listeners.forEach(h=>{m.push(this._getListenerMeta(h))}),m),[]),l=n;l!==-1&&(this.logs[l].listeners=a,this.logs[l].updateVersion++,s.map((m,u)=>{const h=this.logs[l].listeners[u];if(h){try{h.result=structuredClone(m)}catch{h.result=m}m instanceof Error?h.status="error":h.status="ok"}})),delete t.__index}this.requestUpdate()}}static{this.styles=Dt}get emitter(){return this._emitters.length===1?this._emitters[0]:this._emitters}set emitter(e){const t=Array.isArray(e)?e:e?[e]:[],s=this._emitters;this._emitters=t,this._currentEmitterIndex>=this._emitters.length&&(this._currentEmitterIndex=0),(s.length!==t.length||s.some((i,n)=>i!==t[n]))&&this._reattach(),this.requestUpdate("emitter",s.length===1?s[0]:s)}connectedCallback(){super.connectedCallback(),q(this.lang),this._attach(),document.addEventListener("click",this._handleDocumentClick)}disconnectedCallback(){this._detach(),document.removeEventListener("click",this._handleDocumentClick)}willUpdate(e){e.has("_filterText")&&this._updateFilteredLogs(),e.has("showListenersInLog")&&(this._isShowListeners=this.showListeners),e.has("lang")&&q(this.lang)}_getCurrentEmitter(){return this._emitters[this._currentEmitterIndex]}_switchEmitter(e){e!==this._currentEmitterIndex&&(this._emitterLogs.set(this._currentEmitterIndex,[...this.logs]),this._emitterLogIndexes.set(this._currentEmitterIndex,[...this._logIndexs]),this._currentEmitterIndex=e,this.logs=this._emitterLogs.get(e)||[],this._logIndexs=this._emitterLogIndexes.get(e)||[],this._reattach(),this._isDropdownOpen=!1,this.requestUpdate())}_reattach(){this._detach(),this.clear(),this._attach()}_updateFilteredLogs(){const e=this._filterText.toLowerCase().trim();if(!e){this._logIndexs=this.logs.map((t,s)=>s).reverse();return}this._logIndexs=this.logs.map((t,s)=>({log:t,index:s})).filter(({log:t})=>{const s=t.message.deref();return s?s.type.toLowerCase().includes(e):!1}).map(({index:t})=>t).reverse()}_getListenerMeta(e,t){if(t===void 0)if(e.length===6){let s;const i=e[5];i instanceof WeakRef?s=i.deref():s=i,s instanceof Error?t="error":t="ok"}else t="ok";return{status:t,fn:new WeakRef(e[0]),name:e[0].name||"anonymous",count:`${e[2]}/${e[1]===0?"∞":e[1]}`,tag:e[3],flags:e[4],result:e[5]}}_attach(){const e=this._getCurrentEmitter();if(e){const t=e.options;e.hooks.BeforeExecuteListener.push(this._onBeforeExecuteListener),e.hooks.AfterExecuteListener.push(this._onAfterExecuteListener),t.debug=!0}}_detach(){const e=this._getCurrentEmitter();if(e){O(e.hooks.BeforeExecuteListener,this._onBeforeExecuteListener),O(e.hooks.AfterExecuteListener,this._onAfterExecuteListener);const t=e.options;t.debug=!1}}clear(){this.logs=[],this._logIndexs=[],this.messages=[],this.requestUpdate()}_printListenerInfo(e){const t=e.fn.deref();typeof t=="function"&&(console.group("FastEvent Listener"),console.log(d("eventViewer.listener",t.name||"anonymous")),console.log(t),console.log(d("eventViewer.executionResult"),e.result),console.groupEnd())}renderFilter(){return c`<input
1295
+ type="text"
1296
+ class="filter-input"
1297
+ placeholder="${d("eventViewer.filterPlaceholder")}"
1298
+ .value="${this._filterText}"
1299
+ @input="${e=>{this._filterText=e.target.value}}"
1300
+ />`}_renderEmitterMenu(){return c`
1301
+ <div class="emitter-dropdown-menu">
1302
+ ${this._emitters.map((e,t)=>{const s=t===this._currentEmitterIndex,i=this.title.length>0?this.title:e?.title||`Emitter ${t+1}`;return c`
1303
+ <div
1304
+ class="emitter-menu-item ${s?"active":""}"
1305
+ @click="${()=>this._switchEmitter(t)}"
1306
+ >
1307
+ <span class="menu-item-icon">${s?W("yes"):""}</span>
1308
+ <span class="menu-item-label">${i}</span>
1309
+ </div>
1310
+ `})}
1311
+ </div>
1312
+ `}_getEmitterVarName(){return"$emitter"}_injectEmitterToConsole(){const e=this._getEmitterVarName(),t=this._getCurrentEmitter();t&&(window[e]=t,console.log("FastEvent instance: ",`${e}=`,t))}renderHeader(){const e=this._emitters.length>1,t=this._getCurrentEmitter(),s=this.title.length>0?this.title:t?.title||"";return c`
1313
+ <div class="header">
1314
+ ${e?c`
1315
+ <div class="emitter-dropdown-container">
1316
+ <button
1317
+ class="emitter-dropdown-trigger"
1318
+ @click="${i=>{this._isDropdownOpen=!this._isDropdownOpen,i.stopPropagation(),this.requestUpdate()}}"
1319
+ title="${d("eventViewer.switchEmitter")}"
1320
+ >
1321
+ <span class="header-title">${s}
1322
+ </span>
1323
+ <span class="dropdown-arrow ${this._isDropdownOpen?"open":""}"></span>
1324
+ </button>
1325
+ ${this._isDropdownOpen?this._renderEmitterMenu():""}
1326
+ </div>
1327
+ <span class="emitter-dropdown-spacer"></span>
1328
+ `:c`<span class="header-title">${s}</span>`}
1329
+ ${C("",()=>this._injectEmitterToConsole(),{icon:"inspect",className:"btn-icon",title:d("eventViewer.inspect",this._getEmitterVarName())})}
1330
+ ${C("",()=>{this.dark=!this.dark},{icon:"dark",className:"btn-icon"+(this._showListeners?" btn-pressed":""),title:this.dark?d("eventViewer.normalMode"):d("eventViewer.darkMode")})}
1331
+ ${C("",()=>{this._showListeners=!this._showListeners},{icon:"listeners",className:"btn-icon"+(this._showListeners?" btn-pressed":""),title:this._showListeners?d("eventViewer.showEvent"):d("eventViewer.showListeners")})}
1332
+ </div>
1333
+ `}renderToolbar(){return c`
1334
+ <div class="toolbar">
1335
+ ${this.renderFilter()}
1336
+ <span class="toolbar-spacer">${d("eventViewer.totalLogs",this._logIndexs.length)}</span>
1337
+ ${C("",()=>{this._isShowListeners=!this._isShowListeners,this.requestUpdate()},{icon:"listener",className:"btn-icon"+(this._isShowListeners?" btn-pressed":""),title:this._isShowListeners?d("eventViewer.hideListenerDetails"):d("eventViewer.showListenerDetails")})}
1338
+ <button class="btn btn-icon" title="${d("eventViewer.clear")}" @click="${()=>this.clear()}">
1339
+ <span class="icon clear"></span>
1340
+ </button>
1341
+ </div>
1342
+ `}renderLogs(){return this._logIndexs.length===0?c`
1343
+ <div class="empty-state">
1344
+ ${W("file")}
1345
+ <p>${d("eventViewer.noEventLogs")}</p>
1346
+ </div>
1347
+ `:c`
1348
+ <div class="logs">
1349
+ ${this._logIndexs.map(e=>{const t=this.logs[e];return c`
1350
+ <fastevent-event-log
1351
+ .log="${t}"
1352
+ .dark="${this.dark}"
1353
+ .showListeners="${this._isShowListeners}"
1354
+ .updateVersion="${t.updateVersion}"
1355
+ .onPrintListener="${this._printListenerInfo}">
1356
+ </fastevent-event-log>
1357
+ `})}
1358
+ </div>
1359
+ `}render(){return c`
1360
+ ${this.renderHeader()}
1361
+ ${this._showListeners?c`<fastevent-listeners
1362
+ .emitter="${this._getCurrentEmitter()}"
1363
+ .dark="${this.dark}"
1364
+ .lang="${this.lang}"
1365
+ style="flex-grow:1">
1366
+ </fastevent-listeners>`:c`${this.renderToolbar()}${this.renderLogs()}`}
1367
+ `}};return f([k()],x.prototype,"_emitters",void 0),f([k()],x.prototype,"_currentEmitterIndex",void 0),f([k()],x.prototype,"_isDropdownOpen",void 0),f([v({type:Object})],x.prototype,"emitter",null),f([v({type:Boolean,reflect:!0})],x.prototype,"dark",void 0),f([v({type:Boolean,reflect:!0})],x.prototype,"enable",void 0),f([v({type:Number})],x.prototype,"maxSize",void 0),f([v({type:String})],x.prototype,"title",void 0),f([v({type:String,reflect:!0})],x.prototype,"lang",void 0),f([v({type:Boolean})],x.prototype,"showListeners",void 0),f([k()],x.prototype,"_filterText",void 0),f([k()],x.prototype,"_showListeners",void 0),f([k()],x.prototype,"_isShowListeners",void 0),x=f([ie("fastevent-viewer")],x),Object.defineProperty(J,"FastEventListeners",{enumerable:!0,get:function(){return L}}),Object.defineProperty(J,"FastEventViewer",{enumerable:!0,get:function(){return x}}),J})({});
1368
+
1369
+ //# sourceMappingURL=index.js.map