tressi
Version:
Deterministic load testing for API performance validation.
2 lines • 61.2 kB
JavaScript
import{a as j,f as ye}from"./chunk-4NUIGNTM.js";import{a as lt,b as ct,c as W,d as mt,e as Q,f as dt}from"./chunk-DRGB4IB5.js";import{a as rt,b as ve,c as fe,d as ot}from"./chunk-6LEULM43.js";import{a as st}from"./chunk-2ZUXPUVI.js";import{a as We,b as nt}from"./chunk-ELI7JHGH.js";import{a as et}from"./chunk-2NHEPAC5.js";import{a as J}from"./chunk-DLPQUWGS.js";import"./chunk-5PTWAMZ6.js";import{a as it}from"./chunk-UR67FGQG.js";import{b as at}from"./chunk-RQPLME55.js";import{a as tt}from"./chunk-2IBU6HRE.js";import{a as E,b as he}from"./chunk-OVBUA5RI.js";import{c as Ze,g as Xe,h as Ge,x as Qe}from"./chunk-BEQIQLT5.js";import{$ as S,$a as T,Ac as Ye,Bb as b,Db as g,Dc as Je,Gc as Y,Ka as s,Kb as de,Lb as pe,Nb as Ne,Ob as A,Pa as Be,Pb as Ue,Qa as He,Qb as c,R as q,Rb as z,S as ke,Sb as N,W as f,Wb as $e,Xb as G,aa as D,ab as Ve,ba as Fe,bb as me,eb as qe,fc as w,ga as Ae,jc as M,ka as y,kb as x,kc as m,lb as _,lc as ue,ma as O,mb as C,na as Le,ob as Re,pb as k,qa as ne,qb as F,rb as d,sb as o,tb as r,ua as je,ub as p,xb as ze,xc as Ke,yc as ge,zb as L,zc as K}from"./chunk-W6IDPYNF.js";import"./chunk-PTIQXOVT.js";import"./chunk-ZPCMWKEN.js";import{a as V,b as te}from"./chunk-I4MTPUBM.js";var be=class a{_rpcService=f(tt);_logService=f(Y);async exportTest(e,t){try{let n=await this._rpcService.client.tests[":id"].export.$get({param:{id:e},query:{format:t}});if(!n.ok)throw new Error(`Export failed: ${n.statusText}`);let i=await n.blob(),l=`test-${e}.${t}`;this._downloadFile(i,l),this._logService.info("Test exported successfully",{format:t,testId:e})}catch(n){throw this._logService.error("Failed to export test",n),n}}_downloadFile(e,t){let n=URL.createObjectURL(e),i=document.createElement("a");i.href=n,i.download=t,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(n)}static \u0275fac=function(t){return new(t||a)};static \u0275prov=q({token:a,factory:a.\u0275fac,providedIn:"root"})};function pt(a){return a!==null&&typeof a=="object"&&"statusCodeDistribution"in a}var ae=class a{_testService=f(J);_logService=f(Y);_configService=f(nt);_eventService=f(it);_testExportService=f(be);test=y(null);metrics=y(null);config=y(null);testId=y(null);testTimeRange=y(null);selectedEndpoint=y("global");selectedChartType=y(ge);selectedPollingInterval=y(K);hasError=y(!1);errorMessage=y("");configError=y("");isRealTime=w(()=>this.test()?.status==="running");selectedSummary=w(()=>{let e=this.test();if(!e?.summary)return null;if(this.selectedEndpoint()==="global")return e.summary.global;{let n=this.selectedEndpoint();return e.summary.endpoints?.find(i=>i.url===n)||null}});endpointSummary=w(()=>{let e=this.selectedSummary();return pt(e)?e:null});histogram=w(()=>{let e=this.selectedSummary();if(e&&typeof e=="object"&&"histogram"in e)return e.histogram});displayConfigName=w(()=>this.config()?.name||"Unknown Configuration");currentChartData=w(()=>{let e=this.selectedEndpoint(),t=this.selectedChartType(),n=this.metrics();if(!n||n.length===0)return{data:[],labels:[]};let i=n.map(v=>v.epoch);return{data:e==="global"?this._mapMetricsToData(n,t):this._mapEndpointMetricsToData(n,e,t),labels:i}});hasChartData=w(()=>{let e=this.currentChartData().data;return Array.isArray(e)?e.length>0:typeof e=="object"&&e!==null?Object.values(e).some(t=>Array.isArray(t)&&t.length>0):!1});_metricsStreamSubscription=null;_testEventsSubscription=null;_pollingTimerId=null;initialize(e){this.testId.set(e.test.id),this.test.set(e.test),this.metrics.set(e.metrics),e.test.summary?.endpoints?.length===1&&this.selectedEndpoint.set(e.test.summary.endpoints[0].url),e.test.summary?.global&&this.testTimeRange.set({max:e.test.summary.global.epochEndedAt,min:e.test.summary.global.epochStartedAt}),e.test.configId&&this.loadConfig(e.test.configId),this.startRealTimeUpdates(e.test.id)}async loadConfig(e){if(e){this.configError.set("");try{let t=await this._configService.getOne(e);this.config.set(t||null),t||this.configError.set("Configuration not found")}catch(t){this.config.set(null),this.configError.set(t instanceof Error?t.message:"Failed to load configuration"),this._logService.error("Failed to load configuration",t)}}}setupPolling(e){this._pollingTimerId&&(clearInterval(this._pollingTimerId),this._pollingTimerId=null),e>0&&(this._pollingTimerId=setInterval(()=>{this.refreshMetrics()},e))}async refreshMetrics(){let e=this.testId();if(e)try{let t=await this._testService.getTestMetrics(e);this.metrics.set(t)}catch(t){this._logService.error("Failed to refresh metrics",t)}}startRealTimeUpdates(e){e&&(this._cleanupSubscriptions(),this._metricsStreamSubscription=this._eventService.getMetricsStream().subscribe({error:t=>this._logService.error("Realtime metrics error:",t),next:t=>{if(t.testId===e){let n=this.test();n&&this.test.set(te(V({},n),{summary:t.testSummary}))}}}),this._testEventsSubscription=this._eventService.getTestEventsStream().subscribe({error:t=>this._logService.error("Test events error:",t),next:t=>{if(t.testId===e){let n=this.test();n&&this.test.set(te(V({},n),{status:t.status})),(t.status==="completed"||t.status==="failed"||t.status==="cancelled")&&this._cleanupSubscriptions()}}}))}async exportResults(e){let t=this.testId();if(t)try{await this._testExportService.exportTest(t,e)}catch(n){this._logService.error("Export failed",n)}}_mapMetricsToData(e,t){switch(t){case"peak_throughput":return e.map(n=>n.metric?.global?.peakRequestsPerSecond||0);case"average_throughput":return e.map(n=>n.metric?.global?.averageRequestsPerSecond||0);case"latency":return e.map(n=>n.metric?.global?.p50LatencyMs||0);case"latency_p95":return e.map(n=>n.metric?.global?.p95LatencyMs||0);case"latency_p99":return e.map(n=>n.metric?.global?.p99LatencyMs||0);case"error_rate":return e.map(n=>(n.metric?.global?.errorRate||0)*100);case"success_rate":return e.map(n=>(n.metric?.global?.successfulRequests||0)/(n.metric?.global?.totalRequests||1)*100);case"failed_requests":return e.map(n=>n.metric?.global?.failedRequests||0);case"network_throughput":return e.map(n=>n.metric?.global?.networkBytesPerSec||0);case"network_bytes_sent":return e.map(n=>n.metric?.global?.networkBytesSent||0);case"network_bytes_received":return e.map(n=>n.metric?.global?.networkBytesReceived||0);case"target_achieved":return e.map(n=>(n.metric?.global?.targetAchieved||0)*100);default:return[]}}_mapEndpointMetricsToData(e,t,n){let i=l=>l.metric?.endpoints?.find(v=>v.url===t);switch(n){case"peak_throughput":return e.map(l=>i(l)?.peakRequestsPerSecond||0);case"average_throughput":return e.map(l=>i(l)?.averageRequestsPerSecond||0);case"latency":return e.map(l=>i(l)?.p50LatencyMs||0);case"latency_p95":return e.map(l=>i(l)?.p95LatencyMs||0);case"latency_p99":return e.map(l=>i(l)?.p99LatencyMs||0);case"error_rate":return e.map(l=>(i(l)?.errorRate||0)*100);case"success_rate":return e.map(l=>{let v=i(l);return(v?.successfulRequests||0)/(v?.totalRequests||1)*100});case"failed_requests":return e.map(l=>i(l)?.failedRequests||0);case"target_achieved":return e.map(l=>(i(l)?.targetAchieved||0)*100);default:return[]}}_cleanupSubscriptions(){this._pollingTimerId&&(clearInterval(this._pollingTimerId),this._pollingTimerId=null),this._metricsStreamSubscription?.unsubscribe(),this._testEventsSubscription?.unsubscribe(),this._metricsStreamSubscription=null,this._testEventsSubscription=null}ngOnDestroy(){this._cleanupSubscriptions()}static \u0275fac=function(t){return new(t||a)};static \u0275prov=q({token:a,factory:a.\u0275fac})};var _e=class a{_testService=f(J);testData=m(null);selectedSummary=m(null);isRealTime=m(!1);selectedEndpoint=m("global");targetAchievedPercentage=w(()=>{let e=this.selectedSummary();return e?e.targetAchieved:0});getDurationSec(){let e=this.testData();return e?this._testService.getTestDuration(e)/1e3:null}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=T({type:a,selectors:[["app-hero-stats"]],inputs:{testData:[1,"testData"],selectedSummary:[1,"selectedSummary"],isRealTime:[1,"isRealTime"],selectedEndpoint:[1,"selectedEndpoint"]},decls:28,vars:7,consts:[[1,"stats","stats-vertical","md:stats-horizontal","bg-base-300","border-base-content/10","flex","w-full","border","shadow-sm"],[1,"stat","place-items-center"],[1,"stat-title"],[1,"stat-value","text-success",3,"appFormatPercentage"],[1,"stat-value","text-secondary",3,"appFormatRps"],[1,"stat-value","text-primary",3,"appFormatRps"],[1,"stat-value","text-info","flex","items-baseline","gap-1"],[3,"appFormatLatency"],[1,"text-base-content/30","text-sm","font-normal"],[1,"stat-value",3,"appFormatDuration"]],template:function(t,n){if(t&1&&(o(0,"div",0)(1,"div",1)(2,"div",2),c(3,"Target Achieved"),r(),p(4,"div",3),r(),o(5,"div",1)(6,"div",2),c(7,"Peak RPS"),r(),p(8,"div",4),r(),o(9,"div",1)(10,"div",2),c(11,"Average RPS"),r(),p(12,"div",5),r(),o(13,"div",1)(14,"div",2),c(15,"P50 \\ 95 \\ 99 Latency"),r(),o(16,"div",6),p(17,"span",7),o(18,"span",8),c(19,"\\"),r(),p(20,"span",7),o(21,"span",8),c(22,"\\"),r(),p(23,"span",7),r()(),o(24,"div",1)(25,"div",2),c(26,"Duration"),r(),p(27,"div",9),r()()),t&2){let i,l,v,u,h;s(4),d("appFormatPercentage",n.targetAchievedPercentage()),s(4),d("appFormatRps",(i=n.selectedSummary())==null?null:i.peakRequestsPerSecond),s(4),d("appFormatRps",(l=n.selectedSummary())==null?null:l.averageRequestsPerSecond),s(5),d("appFormatLatency",(v=n.selectedSummary())==null?null:v.p50LatencyMs),s(3),d("appFormatLatency",(u=n.selectedSummary())==null?null:u.p95LatencyMs),s(3),d("appFormatLatency",(h=n.selectedSummary())==null?null:h.p99LatencyMs),s(4),d("appFormatDuration",n.getDurationSec())}},dependencies:[rt,Q,fe,W],encapsulation:2})};var yt=(a,e)=>e.lowerBound,bt=(a,e)=>e.percentile;function _t(a,e){if(a&1&&(o(0,"span",21),c(1),r()),a&2){let t=g(2).$implicit;s(),N(" ",t.count.toLocaleString()," ")}}function Ct(a,e){if(a&1&&(o(0,"div",16)(1,"div",17),p(2,"span",18),c(3," - "),p(4,"span",18),r(),o(5,"div",19)(6,"div",20),_(7,_t,2,1,"span",21),r()(),o(8,"div",22),c(9),r()()),a&2){let t=g().$implicit,n=g(2);s(2),d("appFormatLatency",t.lowerBound),s(2),d("appFormatLatency",t.upperBound),s(2),Ne("width",n.getHorizontalBarWidth(t.count))("min-width",t.count>0?"4px":"0"),s(),C(t.count>0?7:-1),s(2),N(" ",(t.count/n.histogram().totalCount*100).toFixed(2),"% ")}}function xt(a,e){if(a&1&&_(0,Ct,10,8,"div",16),a&2){let t=e.$implicit;C(t.count>0?0:-1)}}function St(a,e){if(a&1&&(o(0,"div",15)(1,"div",23),c(2),r(),o(3,"div",19)(4,"div",24),p(5,"div",25),r()(),o(6,"div",26),p(7,"span",18),r()()),a&2){let t=e.$implicit,n=g(2);s(2),N(" ",t.label," "),s(3),Ne("width",n.getPercentileBarWidth(t.value)),s(2),d("appFormatLatency",t.value)}}function Dt(a,e){if(a&1&&(o(0,"div",4)(1,"h4",5),c(2,"Distribution"),r(),o(3,"div",6),k(4,xt,1,1,null,null,yt),r(),o(6,"div",7)(7,"span",8)(8,"span",9),c(9,"Min:"),r(),p(10,"span",10),r(),o(11,"span",11),c(12,"<"),r(),o(13,"span",8)(14,"span",9),c(15,"Total Samples:"),r(),o(16,"span",12),c(17),r()(),o(18,"span",11),c(19,">"),r(),o(20,"span",8)(21,"span",9),c(22,"Max:"),r(),p(23,"span",10),r()()(),o(24,"div",4)(25,"h4",13),c(26,"Percentiles"),r(),o(27,"div",14),k(28,St,8,4,"div",15,bt),r()()),a&2){let t=g();s(4),F(t.getHistogramBuckets()),s(6),d("appFormatLatency",t.histogram().min),s(7),z(t.histogram().totalCount.toLocaleString()),s(6),d("appFormatLatency",t.histogram().max),s(5),F(t.getPercentileData())}}function Tt(a,e){a&1&&(o(0,"div",3),p(1,"app-icon",27),o(2,"p",28),c(3,"No latency histogram data available"),r()())}var Ce=class a{histogram=m();collapsed=m(!1);collapsedChange=M();onCollapsedChange(e){this.collapsedChange.emit(e)}getHistogramBuckets(){let e=this.histogram();return e?.buckets?.length?[...e.buckets].sort((t,n)=>t.lowerBound-n.lowerBound):[]}getHorizontalBarWidth(e){let t=this.histogram();if(!t?.buckets?.length)return"0%";let n=Math.max(...t.buckets.map(l=>l.count));if(n===0)return"0%";let i=e/n*100;return`${Math.max(i,0)}%`}getBucketHeight(e){let t=this.histogram();if(!t?.buckets?.length)return"0%";let n=Math.max(...t.buckets.map(i=>i.count));return n===0?"0%":`${Math.sqrt(e/n)*100}%`}getBucketTooltip(e){let t=this.histogram();if(!t)return"";let n=(e.count/t.totalCount*100).toFixed(1);return`${this.formatLatency(e.lowerBound)} - ${this.formatLatency(e.upperBound)}: ${e.count.toLocaleString()} requests (${n}%)`}getPercentileData(){let e=this.histogram();return e?[{key:1,label:"1st (Fastest)"},{key:5,label:"5th"},{key:10,label:"10th"},{key:25,label:"25th"},{key:50,label:"50th (Median)"},{key:75,label:"75th"},{key:90,label:"90th"},{key:95,label:"95th"},{key:99,label:"99th (Slowest)"}].map(({key:n,label:i})=>({label:i,percentile:n,value:e.percentiles[n]||0})):[]}getMinMax(){let e=this.histogram();return e?{max:e.max,min:e.min}:null}formatLatency(e){return e<1?`${(e*1e3).toFixed(0)}\u03BCs`:e<1e3?`${e.toFixed(1)}ms`:`${(e/1e3).toFixed(2)}s`}getBarWidth(e,t,n){if(n===t)return"100%";let i=(e-t)/(n-t)*100;return`${Math.max(5,i)}%`}getPercentileBarWidth(e){let t=this.getPercentileData();if(t.length===0)return"0%";let n=Math.max(...t.map(l=>l.value));if(n===0)return"0%";let i=e/n*100;return`${Math.max(i,0)}%`}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=T({type:a,selectors:[["app-latency-distribution"]],inputs:{histogram:[1,"histogram"],collapsed:[1,"collapsed"]},outputs:{collapsedChange:"collapsedChange"},decls:5,vars:3,consts:[[1,"px-6"],[3,"collapsedChange","title","collapsed"],[1,"bg-base-100","mt-4","rounded-xl","p-4"],[1,"text-base-content/50","py-8","text-center"],[1,"p-4"],[1,"text-base-content/80","mb-4","text-sm","font-semibold"],[1,"max-h-80","space-y-1","overflow-y-auto","pr-2"],[1,"text-base-content/60","mt-3","flex","items-center","justify-center","gap-4","text-xs"],[1,"flex","items-center","gap-1"],[1,"text-base-content/40"],[1,"font-medium",3,"appFormatLatency"],[1,"text-base-content/30"],[1,"font-medium"],[1,"text-base-content/80","mb-3","text-sm","font-semibold"],[1,"space-y-2"],[1,"group","hover:bg-base-300/30","flex","items-center","gap-3","rounded-xl","px-2","py-1","transition-colors"],[1,"group","flex","items-center","gap-3"],[1,"text-base-content/70","w-28","shrink-0","text-right","text-xs","font-medium"],[3,"appFormatLatency"],[1,"flex-1"],[1,"bg-primary","group-hover:bg-primary-focus","flex","items-center","rounded","transition-all","duration-200"],[1,"text-base-content","ml-2","px-1","py-1","text-xs","font-bold","whitespace-nowrap"],[1,"text-base-content/60","w-14","shrink-0","text-right","text-xs"],[1,"text-base-content/70","w-24","text-right","text-sm","font-medium"],[1,"bg-base-300","h-1.5","overflow-hidden","rounded-full"],[1,"bg-primary","h-full","rounded-full","transition-all","duration-300"],[1,"w-24","text-left","font-mono","text-sm","font-bold"],["name","stat_3",1,"mx-auto","mb-2","block","text-2xl"],[1,"text-sm"]],template:function(t,n){t&1&&(o(0,"section",0)(1,"app-collapsible-card",1),b("collapsedChange",function(l){return n.onCollapsedChange(l)}),o(2,"div",2),_(3,Dt,30,3)(4,Tt,4,0,"div",3),r()()()),t&2&&(s(),d("title","Latency Distribution")("collapsed",n.collapsed()),s(2),C(n.histogram()&&n.histogram().totalCount>0?3:4))},dependencies:[j,E,W],encapsulation:2})};var xe=class a{_toastService=f(We);testData=m(null);configName=m("Unknown Configuration");configSnapshot=m(null);collapsed=m(!0);collapsedChange=M();copied=y(!1);onCollapsedChange(e){this.collapsedChange.emit(e)}async copyConfig(){let e=this.configSnapshot();if(!e){this._toastService.show("No configuration to copy","error");return}try{let t=JSON.stringify(e,null,2);await navigator.clipboard.writeText(t),this._toastService.show("Configuration copied to clipboard","success"),this.copied.set(!0),setTimeout(()=>this.copied.set(!1),2e3)}catch{this._toastService.show("Failed to copy configuration","error")}}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=T({type:a,selectors:[["app-metadata"]],inputs:{testData:[1,"testData"],configName:[1,"configName"],configSnapshot:[1,"configSnapshot"],collapsed:[1,"collapsed"]},outputs:{collapsedChange:"collapsedChange"},decls:21,vars:7,consts:[[1,"bg-base-100","rounded-xl","px-6"],[3,"collapsedChange","title","collapsed"],[1,"mt-4","flex","flex-col","gap-8"],[1,"space-y-4"],[1,"text-base-content/80","flex","items-center","gap-2","text-sm","font-semibold","tracking-wide","uppercase"],["name","schedule",1,"text-base"],[1,"grid","grid-cols-1","gap-4","sm:grid-cols-2"],[1,"bg-base-100","rounded-xl","p-4"],[1,"text-base-content/70","mb-1","text-xs","uppercase"],[1,"text-sm","font-medium",3,"appFormatDate"],["name","tune",1,"text-base"],[1,"mt-2",3,"value","rows","disabled"]],template:function(t,n){if(t&1&&(o(0,"section",0)(1,"app-collapsible-card",1),b("collapsedChange",function(l){return n.onCollapsedChange(l)}),o(2,"div",2)(3,"div",3)(4,"h4",4),p(5,"app-icon",5),c(6," Timing "),r(),o(7,"div",6)(8,"div",7)(9,"div",8),c(10,"Started"),r(),p(11,"div",9),r(),o(12,"div",7)(13,"div",8),c(14,"Ended"),r(),p(15,"div",9),r()()(),o(16,"div",3)(17,"h4",4),p(18,"app-icon",10),c(19," Configuration Snapshot "),r(),p(20,"app-json-textarea",11),r()()()()),t&2){let i,l;s(),d("title","Test Information & Configuration")("collapsed",n.collapsed()),s(10),d("appFormatDate",(i=n.testData())==null||i.summary==null||i.summary.global==null?null:i.summary.global.epochStartedAt),s(4),d("appFormatDate",(l=n.testData())==null||l.summary==null||l.summary.global==null?null:l.summary.global.epochEndedAt),s(5),d("value",n.configSnapshot())("rows",10)("disabled",!0)}},dependencies:[j,E,ye,ct],encapsulation:2})};var Mt=["chart"],ut=(()=>{class a{constructor(){this.chart=m(),this.annotations=m(),this.colors=m(),this.dataLabels=m(),this.series=m(),this.stroke=m(),this.labels=m(),this.legend=m(),this.markers=m(),this.noData=m(),this.parsing=m(),this.fill=m(),this.tooltip=m(),this.plotOptions=m(),this.responsive=m(),this.xaxis=m(),this.yaxis=m(),this.forecastDataPoints=m(),this.grid=m(),this.states=m(),this.title=m(),this.subtitle=m(),this.theme=m(),this.autoUpdateSeries=m(!0),this.chartReady=M(),this.chartInstance=y(null),this.chartElement=ue.required("chart"),this.ngZone=f(Ae),this.isBrowser=Ge(f(je)),this._destroyed=!1,this._injector=f(Fe),this.waitingForConnectedRef=null}ngOnChanges(t){this.isBrowser&&this.hydrate(t)}ngOnDestroy(){this.destroy(),this._destroyed=!0}get isConnected(){return this.chartElement()?.nativeElement.isConnected}hydrate(t){if(this.waitingForConnectedRef)return;if(this.chartInstance()&&this.autoUpdateSeries()&&Object.keys(t).filter(i=>i!=="series").length===0){this.updateSeries(this.series(),!0);return}He({read:()=>this.createElement()},{injector:this._injector})}importApexCharts(){return import("./chunk-JKTLU6L4.js")}async createElement(){let{default:t}=await this.importApexCharts();if(window.ApexCharts||=t,this._destroyed)return;if(!this.isConnected){this.waitForConnected();return}let n={};["annotations","chart","colors","dataLabels","series","stroke","labels","legend","fill","tooltip","plotOptions","responsive","markers","noData","parsing","xaxis","yaxis","forecastDataPoints","grid","states","title","subtitle","theme"].forEach(v=>{let u=this[v]();u&&(n[v]=u)}),this.destroy();let l=this.ngZone.runOutsideAngular(()=>new t(this.chartElement().nativeElement,n));this.chartInstance.set(l),this.render(),this.chartReady.emit({chartObj:l})}render(){if(this.isConnected)return this.ngZone.runOutsideAngular(()=>this.chartInstance()?.render());this.waitForConnected()}updateOptions(t,n,i,l){return this.ngZone.runOutsideAngular(()=>this.chartInstance()?.updateOptions(t,n,i,l))}updateSeries(t,n){return this.ngZone.runOutsideAngular(()=>this.chartInstance()?.updateSeries(t,n))}appendSeries(t,n){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.appendSeries(t,n))}appendData(t){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.appendData(t))}highlightSeries(t){return this.ngZone.runOutsideAngular(()=>this.chartInstance()?.highlightSeries(t))}toggleSeries(t){return this.ngZone.runOutsideAngular(()=>this.chartInstance()?.toggleSeries(t))}showSeries(t){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.showSeries(t))}hideSeries(t){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.hideSeries(t))}resetSeries(){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.resetSeries())}zoomX(t,n){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.zoomX(t,n))}toggleDataPointSelection(t,n){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.toggleDataPointSelection(t,n))}destroy(){this.chartInstance()?.destroy(),this.chartInstance.set(null)}setLocale(t){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.setLocale(t))}paper(){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.paper())}addXaxisAnnotation(t,n,i){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.addXaxisAnnotation(t,n,i))}addYaxisAnnotation(t,n,i){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.addYaxisAnnotation(t,n,i))}addPointAnnotation(t,n,i){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.addPointAnnotation(t,n,i))}removeAnnotation(t,n){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.removeAnnotation(t,n))}clearAnnotations(t){this.ngZone.runOutsideAngular(()=>this.chartInstance()?.clearAnnotations(t))}dataURI(t){return this.chartInstance()?.dataURI(t)}waitForConnected(){this.waitingForConnectedRef||(this.waitingForConnectedRef=Be({read:()=>{this.isConnected&&(this.waitingForConnectedRef.destroy(),this.waitingForConnectedRef=null,this.createElement())}},{injector:this._injector}))}static{this.\u0275fac=function(n){return new(n||a)}}static{this.\u0275cmp=T({type:a,selectors:[["apx-chart"]],viewQuery:function(n,i){n&1&&de(i.chartElement,Mt,5),n&2&&pe()},inputs:{chart:[1,"chart"],annotations:[1,"annotations"],colors:[1,"colors"],dataLabels:[1,"dataLabels"],series:[1,"series"],stroke:[1,"stroke"],labels:[1,"labels"],legend:[1,"legend"],markers:[1,"markers"],noData:[1,"noData"],parsing:[1,"parsing"],fill:[1,"fill"],tooltip:[1,"tooltip"],plotOptions:[1,"plotOptions"],responsive:[1,"responsive"],xaxis:[1,"xaxis"],yaxis:[1,"yaxis"],forecastDataPoints:[1,"forecastDataPoints"],grid:[1,"grid"],states:[1,"states"],title:[1,"title"],subtitle:[1,"subtitle"],theme:[1,"theme"],autoUpdateSeries:[1,"autoUpdateSeries"]},outputs:{chartReady:"chartReady"},features:[Le],decls:2,vars:0,consts:[["chart",""]],template:function(n,i){n&1&&ze(0,"div",null,0)},encapsulation:2,changeDetection:0})}}return a})();var gt=(()=>{class a{static{this.\u0275fac=function(n){return new(n||a)}}static{this.\u0275mod=Ve({type:a})}static{this.\u0275inj=ke({})}}return a})();var Se=class a{_state=y({lastInteractedChartId:null,selectionEnd:null,selectionStart:null,xAxisMax:null,xAxisMin:null});lastInteractedChartId=()=>this._state().lastInteractedChartId;_registeredCharts=new Set;registerChart(e){this._registeredCharts.add(e)}setAsMaster(e){if(!this._registeredCharts.has(e)){console.warn(`Chart ${e} not registered`);return}this._state.update(t=>te(V({},t),{lastInteractedChartId:e}))}_batchMs=16;_lastUpdate=0;broadcastState(e){Date.now()-this._lastUpdate>this._batchMs&&(this._state.update(i=>V(V({},i),e)),this._lastUpdate=Date.now())}getState(){return this._state()}static \u0275fac=function(t){return new(t||a)};static \u0275prov=q({token:a,factory:a.\u0275fac,providedIn:"root"})};var wt=["chart"],De=class a{_themeService=f(et);_syncService=f(Se);chart=ue("chart");title=m("");yAxisLabel=m("");data=m([]);labels=m([]);seriesName=m("Series");height=m(350);enableToolbar=m(!0);smoothCurve=m(!0);chartId=m();testTimeRange=m(null);chartClick=M();chartMouseMove=M();chartOptions=w(()=>this._createChartOptions());isMaster=w(()=>this.chartId()===this._syncService.lastInteractedChartId());_lastDataLength=0;_effectiveInitialState=w(()=>{let e=this.testTimeRange();if(e)return e;let t=this.labels();return t.length>0?{max:Math.max(...t),min:Math.min(...t)}:null});constructor(){O(()=>{let e=this.chartId();e&&this._syncService.registerChart(e)}),O(()=>{let e=this.chartId(),t=this.chart(),n=this._syncService.lastInteractedChartId();e&&t&&e!==n&&this._syncToMasterState()}),O(()=>{this.chart()&&this._setupCustomResetHandler()}),O(()=>{this._themeService.getChartColors(),this._updateChart()})}_createChartOptions(){let e=this._themeService.getChartColors(),t=this.seriesName(),n=this.data(),i=this.labels(),l=this.height(),v=this.enableToolbar(),u=this.smoothCurve(),h=this.title(),$=this.yAxisLabel(),B=this._effectiveInitialState(),ie=B?.min,re=B?.max,Z,X=0;Array.isArray(n)?(Z=[{data:n.map((R,H)=>({x:i[H]||Date.now()-(n.length-1-H)*1e3,y:R})),name:t}],X=n.length):Z=Object.entries(n).map(([I,R])=>{let H=R.map((ft,Oe)=>({x:i[Oe]||Date.now()-(R.length-1-Oe)*1e3,y:ft}));return X=Math.max(X,R.length),{data:H,name:I}});let oe=E.asHtml("zoom_in"),se=E.asHtml("zoom_out"),le=E.asHtml("reset_focus"),ce=E.asHtml("drag_pan"),ee=E.asHtml("select");return{chart:{background:e.background,events:{click:(I,R,H)=>{this._handleChartClick(),this.chartClick.emit({chartContext:R,config:H,event:I})},mouseMove:(I,R,H)=>{this.chartMouseMove.emit({chartContext:R,config:H,event:I})},scrolled:(I,{xaxis:R})=>{this._handleZoomOrPan(R)},selection:(I,{xaxis:R})=>{this._handleSelection(R)},zoomed:(I,{xaxis:R})=>{this._handleZoomOrPan(R)}},foreColor:e.text,height:l,offsetX:4,toolbar:{autoSelected:"zoom",export:{csv:{filename:void 0},png:{filename:void 0},svg:{filename:void 0}},show:v,tools:{customIcons:[],download:!1,pan:ce,reset:le,selection:ee,zoom:ee,zoomin:oe,zoomout:se}},type:"line",zoom:{allowMouseWheelZoom:!0,autoScaleYaxis:!0,enabled:v,type:"x",zoomedArea:{fill:{color:e.primary,opacity:.3108},stroke:{color:e.primary,opacity:.3108,width:1}}}},dataLabels:{enabled:!1},grid:{borderColor:e.border,row:{colors:[e.grid,"transparent"],opacity:.5},strokeDashArray:0},markers:{colors:[e.primary],discrete:[],fillOpacity:1,hover:{size:6,sizeOffset:3},offsetX:0,offsetY:0,onClick:void 0,onDblClick:void 0,shape:"circle",showNullDataPoints:!0,size:this._getDataLength(n)>1?0:4,strokeColors:[e.primary],strokeDashArray:0,strokeOpacity:.9,strokeWidth:2},series:Z,stroke:{colors:[e.primary],curve:u?"monotoneCubic":"linestep",width:2},title:{align:"left",style:{color:e.text,fontFamily:"Open Sans, sans-serif",fontSize:"16px",fontWeight:"bold"},text:h},tooltip:{fillSeriesColor:!1,style:{fontFamily:"Roboto Mono, monospace",fontSize:"12px"},theme:"false"},xaxis:{axisBorder:{color:e.border},axisTicks:{color:e.border},labels:{datetimeFormatter:{day:"dd",hour:"h:mm",minute:"h:mm:ss",month:"MMM",second:"h:mm:ss",year:"yyyy"},formatter:I=>new Date(I).toLocaleTimeString(),hideOverlappingLabels:!0,show:this._getDataLength(n)>1,style:{colors:e.text,fontFamily:"Roboto Mono, monospace",fontSize:"11px"}},max:re,min:ie,tooltip:{enabled:!1},type:"datetime"},yaxis:{axisBorder:{color:e.border},axisTicks:{color:e.border},labels:{formatter:this._getYAxisFormatter(),offsetX:8,style:{colors:e.text,fontFamily:"Roboto Mono, monospace",fontSize:"11px"}},title:{style:{color:e.text,fontFamily:"Open Sans, sans-serif",fontSize:"12px",fontWeight:"normal"},text:$}}}}_handleChartClick(){let e=this.chartId();e&&this._syncService.setAsMaster(e)}_handleZoomOrPan(e){let t=this.chartId();t&&(this._syncService.setAsMaster(t),this._syncService.broadcastState({selectionEnd:null,selectionStart:null,xAxisMax:e.max,xAxisMin:e.min}))}_handleSelection(e){let t=this.chartId();t&&(this._syncService.setAsMaster(t),this._syncService.broadcastState({selectionEnd:e.max,selectionStart:e.min,xAxisMax:null,xAxisMin:null}))}_syncToMasterState(){let e=this.chart();if(!e)return;let t=this._syncService.getState();setTimeout(()=>{t.xAxisMin!==null&&t.xAxisMax!==null?e.zoomX?e.zoomX(t.xAxisMin,t.xAxisMax):e.updateOptions({xaxis:{max:t.xAxisMax,min:t.xAxisMin}},!1,!1):t.selectionStart!==null&&t.selectionEnd!==null&&(e.zoomX?e.zoomX(t.selectionStart,t.selectionEnd):e.updateOptions({xaxis:{max:t.selectionEnd,min:t.selectionStart}},!1,!1))},100)}_updateChart(){let e=this.data(),t=this.labels(),n=this.chart();if(!n)return;let i;Array.isArray(e)?i=e.length:typeof e=="object"&&e!==null?i=Math.max(...Object.values(e).map(l=>l?.length||0)):i=0,!(i===this._lastDataLength&&i>0)&&requestAnimationFrame(()=>{let l=[];Array.isArray(e)?l=[{data:e.map((u,h)=>({x:t[h]||Date.now()-(e.length-1-h)*1e3,y:u})),name:this.seriesName()}]:typeof e=="object"&&e!==null&&(l=Object.entries(e).map(([v,u])=>({data:u.map(($,B)=>({x:t[B]||Date.now()-(u.length-1-B)*1e3,y:$})),name:v}))),n.updateSeries(l),this._lastDataLength=i})}_getYAxisFormatter(){return e=>at(Math.round(e))}_setupCustomResetHandler(){let e=this.chart();if(!e)return;let t=e.resetSeries.bind(e);e.resetSeries=()=>{if(!this.chartId()){t();return}let i=this._effectiveInitialState();i&&(this._syncService.broadcastState({selectionEnd:null,selectionStart:null,xAxisMax:i.max,xAxisMin:i.min}),e.zoomX?e.zoomX(i.min,i.max):e.updateOptions({xaxis:{max:i.max,min:i.min}},!0,!0))}}_getDataLength(e){return Array.isArray(e)?e.length:Object.values(e)[0]?.length||0}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=T({type:a,selectors:[["app-line-chart"]],viewQuery:function(t,n){t&1&&de(n.chart,wt,5),t&2&&pe()},inputs:{title:[1,"title"],yAxisLabel:[1,"yAxisLabel"],data:[1,"data"],labels:[1,"labels"],seriesName:[1,"seriesName"],height:[1,"height"],enableToolbar:[1,"enableToolbar"],smoothCurve:[1,"smoothCurve"],chartId:[1,"chartId"],testTimeRange:[1,"testTimeRange"]},outputs:{chartClick:"chartClick",chartMouseMove:"chartMouseMove"},decls:2,vars:11,consts:[["chart",""],[3,"series","chart","xaxis","stroke","dataLabels","grid","title","yaxis","markers"]],template:function(t,n){t&1&&p(0,"apx-chart",1,0),t&2&&(A("chart-master",n.isMaster()),d("series",n.chartOptions().series)("chart",n.chartOptions().chart)("xaxis",n.chartOptions().xaxis)("stroke",n.chartOptions().stroke)("dataLabels",n.chartOptions().dataLabels)("grid",n.chartOptions().grid)("title",n.chartOptions().title)("yaxis",n.chartOptions().yaxis)("markers",n.chartOptions().markers))},dependencies:[gt,ut],styles:['[_nghost-%COMP%] .apexcharts-tooltip{color:var(--color-base-content)!important;background:var(--color-base-100)!important;border:1px solid var(--color-neutral)!important;border-radius:6px!important;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f!important}[_nghost-%COMP%] .apexcharts-tooltip-title{font-weight:600!important;color:var(--color-base-content)!important;background:var(--color-base-200)!important;border-bottom:1px solid var(--color-neutral)!important}[_nghost-%COMP%] .apexcharts-tooltip-series-group{background:transparent!important}[_nghost-%COMP%] .apexcharts-tooltip-text{color:var(--color-base-content)!important}[_nghost-%COMP%] .apexcharts-tooltip-text-value, [_nghost-%COMP%] .apexcharts-tooltip-text-label{color:var(--color-base-content)!important}[_nghost-%COMP%] .apexcharts-tooltip-marker{display:none!important}[_nghost-%COMP%] .apexcharts-xcrosshairs, [_nghost-%COMP%] .apexcharts-ycrosshairs{stroke:var(--color-primary)!important;stroke-width:1!important}[_nghost-%COMP%] .apexcharts-gridline{stroke:var(--color-neutral)!important}[_nghost-%COMP%] .apexcharts-toolbar{top:-8px!important;right:8px!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:0!important;background:var(--color-base-200)!important;border:1px solid var(--color-neutral)!important;border-radius:4px!important}[_nghost-%COMP%] .apexcharts-toolbar div{display:flex!important;align-items:center!important;justify-content:center!important;width:auto!important;height:auto!important;margin:0!important}[_nghost-%COMP%] .apexcharts-toolbar .apexcharts-selected span{vertical-align:middle!important;color:var(--color-primary)!important}[_nghost-%COMP%] .material-symbols-outlined:hover{color:var(--color-primary)}[_nghost-%COMP%] .material-symbols-outlined{font-size:2em;color:var(--color-base-content);transition:all .2s ease!important}[_nghost-%COMP%] .chart-master{position:relative}[_nghost-%COMP%] .chart-master:before{position:absolute;top:0;bottom:0;left:-6px;z-index:1;width:4px;content:"";background:var(--color-neutral);border-radius:0 2px 2px 0;opacity:.3}[_nghost-%COMP%] .chart-master .apexcharts-title-text{position:relative}[_nghost-%COMP%] .chart-master .apexcharts-title-text:after{position:absolute;top:-2px;right:-60px;padding:2px 6px;font-size:10px;font-weight:600;color:var(--color-primary);content:"Master";background:var(--color-base-200);border-radius:3px}'],changeDetection:0})};var ht=(a,e)=>e.value;function It(a,e){if(a&1&&(o(0,"option",8),c(1),r()),a&2){let t=e.$implicit,n=g(4);d("value",t.value)("selected",n.pollingInterval()===t.value),s(),N(" ",t.label," ")}}function Rt(a,e){if(a&1){let t=L();o(0,"app-button",6),b("click",function(i){S(t);let l=g(3);return D(l.onRefresh(i))})("onKeyDown",function(i){S(t);let l=g(3);return D(l.onRefresh(i))}),r(),o(1,"select",7),b("change",function(i){S(t);let l=g(3);return D(l.onPollingIntervalChange(i))})("click",function(i){return i.stopPropagation()}),k(2,It,2,3,"option",8,ht),r(),p(4,"div",9)}if(a&2){let t=g(3);d("icon","autorenew")("ghost",!0),s(),d("value",t.pollingInterval()),s(),F(t.pollingOptions())}}function Nt(a,e){if(a&1&&(o(0,"option",8),c(1),r()),a&2){let t=e.$implicit,n=g(4);d("value",t.value)("selected",n.selectedChartType()===t.value),s(),N(" ",t.label," ")}}function Pt(a,e){if(a&1){let t=L();o(0,"select",10),b("change",function(i){S(t);let l=g(3);return D(l.onChartTypeChange(i))})("click",function(i){return i.stopPropagation()}),k(1,Nt,2,3,"option",8,ht),r()}if(a&2){let t=g(3);d("value",t.selectedChartType()),s(),F(t.chartOptions())}}function Ot(a,e){if(a&1&&(_(0,Rt,5,3),_(1,Pt,3,1,"select",5)),a&2){let t=g(2);C(t.isRunning()?0:-1),s(),C(t.hasChartData()?1:-1)}}function kt(a,e){if(a&1&&(o(0,"div",4),_(1,Ot,2,2),r()),a&2){let t=g();s(),C(t.collapsed()?-1:1)}}function Ft(a,e){if(a&1&&(o(0,"div",2),p(1,"app-line-chart",11),r()),a&2){let t=g();s(),d("data",t.chartData().data)("labels",t.chartData().labels)("height",400)("yAxisLabel",t.yAxisLabel())("chartId",t.chartId())("testTimeRange",t.testTimeRange())}}function At(a,e){a&1&&(o(0,"div",3),p(1,"app-icon",12),o(2,"p",13),c(3,"No data available"),r()())}var Te=class a{isRunning=m(!1);selectedChartType=m(ge);pollingInterval=m(K);pollingOptions=m([]);selectedEndpoint=m("global");chartOptions=m([]);testTimeRange=m(null);hasChartData=m(!1);yAxisLabel=m("Value");chartId=m("chart");chartData=m({data:[],labels:[]});collapsed=m(!1);chartTypeChange=M();pollingIntervalChange=M();refresh=M();collapsedChange=M();onChartTypeChange(e){e.stopPropagation();let n=e.target.value;this.chartTypeChange.emit(n)}onPollingIntervalChange(e){e.stopPropagation();let t=e.target,n=Number.parseInt(t.value,10);this.pollingIntervalChange.emit(n)}onRefresh(e){e.stopPropagation(),this.refresh.emit()}onCollapsedChange(e){this.collapsedChange.emit(e)}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=T({type:a,selectors:[["app-performance-over-time"]],inputs:{isRunning:[1,"isRunning"],selectedChartType:[1,"selectedChartType"],pollingInterval:[1,"pollingInterval"],pollingOptions:[1,"pollingOptions"],selectedEndpoint:[1,"selectedEndpoint"],chartOptions:[1,"chartOptions"],testTimeRange:[1,"testTimeRange"],hasChartData:[1,"hasChartData"],yAxisLabel:[1,"yAxisLabel"],chartId:[1,"chartId"],chartData:[1,"chartData"],collapsed:[1,"collapsed"]},outputs:{chartTypeChange:"chartTypeChange",pollingIntervalChange:"pollingIntervalChange",refresh:"refresh",collapsedChange:"collapsedChange"},decls:6,vars:2,consts:[[1,"bg-base-100","mt-2","rounded-xl","px-6"],["data-e2e","performance-chart","title","Performance Over Time",3,"collapsedChange","collapsed"],[1,"mt-6"],[1,"text-base-content/50","py-12","text-center"],[1,"flex","items-center","gap-2"],["id","chart-type-select","title","Chart Type",1,"select","select-neutral","w-auto",3,"value"],["title","Refresh Data",1,"mr-2",3,"click","onKeyDown","icon","ghost"],["id","polling-interval-select","title","Polling Interval",1,"select","select-neutral","w-auto",3,"change","click","value"],[3,"value","selected"],[1,"divider","divider-horizontal","mx-0"],["id","chart-type-select","title","Chart Type",1,"select","select-neutral","w-auto",3,"change","click","value"],[3,"data","labels","height","yAxisLabel","chartId","testTimeRange"],["name","warning",1,"text-warning"],[1,"mb-2"]],template:function(t,n){t&1&&(o(0,"section",0)(1,"app-collapsible-card",1),b("collapsedChange",function(l){return n.onCollapsedChange(l)}),qe(2,kt,2,1,"ng-template"),o(3,"div"),_(4,Ft,2,6,"div",2)(5,At,4,0,"div",3),r()()()),t&2&&(s(),d("collapsed",n.collapsed()),s(3),C(n.hasChartData()?4:5))},dependencies:[j,E,De,he],encapsulation:2})};var Me=class a{_el=f(ne);value=m(void 0,{alias:"appFormatCpu"});constructor(){O(()=>{let e=this.value();if(e==null){this._el.nativeElement.textContent="0.0%";return}this._el.nativeElement.textContent=`${e.toFixed(1)}%`})}static \u0275fac=function(t){return new(t||a)};static \u0275dir=me({type:a,selectors:[["","appFormatCpu",""]],inputs:{value:[1,"appFormatCpu","value"]}})};var Ee=class a{_el=f(ne);value=m(void 0,{alias:"appFormatMemory"});constructor(){O(()=>{let e=this.value();if(e==null){this._el.nativeElement.textContent="0 MB";return}Math.abs(e)<1024?this._el.nativeElement.textContent=`${Math.round(e)} MB`:this._el.nativeElement.textContent=`${(e/1024).toFixed(2)} GB`})}static \u0275fac=function(t){return new(t||a)};static \u0275dir=me({type:a,selectors:[["","appFormatMemory",""]],inputs:{value:[1,"appFormatMemory","value"]}})};function Lt(a,e){if(a&1&&(o(0,"div",7)(1,"div",8),c(2," Target Achieved "),r(),p(3,"div",19),o(4,"div",10),c(5,"of target RPS"),r()()),a&2){let t,n=g();s(),x("title",n.tooltips.targetAchieved),s(2),d("appFormatPercentage",(t=n.selectedSummary())==null?null:t.targetAchieved)}}function jt(a,e){if(a&1&&(o(0,"div",7)(1,"div",8),c(2," Max Throughput "),r(),p(3,"div",9),o(4,"div",10),c(5,"theoretical"),r()()),a&2){let t,n=g();s(),x("title",n.tooltips.maxThroughput),s(2),d("appFormatRps",(t=n.endpointSummary())==null?null:t.theoreticalMaxRps)}}function Bt(a,e){if(a&1&&(o(0,"section")(1,"h3",3)(2,"span",24),p(3,"app-icon",25),r(),c(4," System Resources "),r(),o(5,"div",18)(6,"div",7)(7,"div",8),c(8," CPU Usage "),r(),o(9,"div",26),p(10,"div",27),o(11,"div",28),c(12),r()(),o(13,"div",10),c(14,"avg utilization"),r()(),o(15,"div",7)(16,"div",8),c(17," Memory Usage "),r(),o(18,"div",26),p(19,"div",29),o(20,"div",28),c(21),r()(),o(22,"div",10),c(23,"avg consumption"),r()()()()),a&2){let t,n,i,l,v,u,h=g();s(),x("title","System resource utilization"),s(6),x("title",h.tooltips.cpuUsage),s(3),d("appFormatCpu",(t=h.globalSummary())==null?null:t.avgSystemCpuUsagePercent),s(),d("ngClass",h.getStateClasses(h.getCpuState((n=h.globalSummary())==null?null:n.avgSystemCpuUsagePercent)).bg+" "+h.getStateClasses(h.getCpuState((n=h.globalSummary())==null?null:n.avgSystemCpuUsagePercent)).text),s(),N(" ",h.getCpuState((i=h.globalSummary())==null?null:i.avgSystemCpuUsagePercent)," "),s(4),x("title",h.tooltips.memoryUsage),s(3),d("appFormatMemory",(l=h.globalSummary())==null?null:l.avgProcessMemoryUsageMB),s(),d("ngClass",h.getStateClasses(h.getMemoryState((v=h.globalSummary())==null?null:v.avgProcessMemoryUsageMB)).bg+" "+h.getStateClasses(h.getMemoryState((v=h.globalSummary())==null?null:v.avgProcessMemoryUsageMB)).text),s(),N(" ",h.getMemoryState((u=h.globalSummary())==null?null:u.avgProcessMemoryUsageMB)," ")}}var we=class a{selectedSummary=m(null);testData=m(null);collapsed=m(!1);collapsedChange=M();tooltips=Je;endpointSummary=w(()=>{let e=this.selectedSummary();return e&&"statusCodeDistribution"in e?e:null});globalSummary=w(()=>{let e=this.selectedSummary();return e&&!("statusCodeDistribution"in e)?e:null});onCollapsedChange(e){this.collapsedChange.emit(e)}getCpuState(e){return e==null?"good":e>85?"error":e>70?"warning":"good"}getMemoryState(e){return e==null?"good":e>1e3?"error":e>500?"warning":"good"}getStateClasses(e){switch(e){case"error":return{bg:"bg-error/20",text:"text-error"};case"warning":return{bg:"bg-warning/20",text:"text-warning"};default:return{bg:"bg-success/20",text:"text-success"}}}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=T({type:a,selectors:[["app-performance-summary"]],inputs:{selectedSummary:[1,"selectedSummary"],testData:[1,"testData"],collapsed:[1,"collapsed"]},outputs:{collapsedChange:"collapsedChange"},decls:103,vars:36,consts:[[1,"bg-base-100","mt-2","rounded-xl","px-6"],["title","Performance Summary",3,"collapsedChange","collapsed"],[1,"mt-6","space-y-6"],[1,"text-base-content/80","mb-3","flex","items-center","gap-2","text-sm","font-semibold","tracking-wide","uppercase"],[1,"bg-secondary/10","rounded-full","p-1.5"],["name","speed",1,"text-secondary"],[1,"grid","grid-cols-2","gap-4","sm:grid-cols-3","md:grid-cols-5"],[1,"bg-base-100","rounded-xl","p-4"],[1,"text-base-content/70","mb-1","text-sm"],[1,"text-2xl","font-bold",3,"appFormatRps"],[1,"text-base-content/60","mt-1","text-xs"],[1,"text-2xl","font-bold",3,"appFormatNumber"],[1,"bg-primary/10","rounded-full","p-1"],["name","timer",1,"text-primary"],[1,"text-2xl","font-bold",3,"appFormatLatency"],[1,"grid","grid-cols-1","gap-6","md:grid-cols-2"],[1,"bg-success/10","rounded-full","p-1"],["name","health_and_safety",1,"text-success"],[1,"grid","grid-cols-2","gap-4"],[1,"text-2xl","font-bold",3,"appFormatPercentage"],[1,"bg-info/10","rounded-full","p-1"],["name","lan",1,"text-info"],[1,"text-2xl","font-bold",3,"appFormatNetwork"],[1,"text-2xl","font-bold",3,"appFormatBytes"],[1,"bg-warning/10","rounded-full","p-1"],["name","memory",1,"text-warning"],[1,"flex","items-baseline","gap-2"],[1,"text-2xl","font-bold",3,"appFormatCpu"],[1,"badge","badge-sm","border-none","font-medium",3,"ngClass"],[1,"text-2xl","font-bold",3,"appFormatMemory"]],template:function(t,n){if(t&1&&(o(0,"section",0)(1,"app-collapsible-card",1),b("collapsedChange",function(l){return n.onCollapsedChange(l)}),o(2,"div",2)(3,"section")(4,"h3",3)(5,"span",4),p(6,"app-icon",5),r(),c(7," Throughput "),r(),o(8,"div",6),_(9,Lt,6,2,"div",7),o(10,"div",7)(11,"div",8),c(12," Peak RPS "),r(),p(13,"div",9),o(14,"div",10),c(15,"highest window"),r()(),o(16,"div",7)(17,"div",8),c(18," Average RPS "),r(),p(19,"div",9),o(20,"div",10),c(21,"requests per sec"),r()(),_(22,jt,6,2,"div",7),o(23,"div",7)(24,"div",8),c(25," Total Requests "),r(),p(26,"div",11),o(27,"div",10),c(28,"completed"),r()()()(),o(29,"section")(30,"h3",3)(31,"span",12),p(32,"app-icon",13),r(),c(33," Latency "),r(),o(34,"div",6)(35,"div",7)(36,"div",8),c(37," Min "),r(),p(38,"div",14),o(39,"div",10),c(40,"fastest"),r()(),o(41,"div",7)(42,"div",8),c(43," P50 (Median) "),r(),p(44,"div",14),o(45,"div",10),c(46,"median"),r()(),o(47,"div",7)(48,"div",8),c(49," P95 "),r(),p(50,"div",14),o(51,"div",10),c(52,"95th percentile"),r()(),o(53,"div",7)(54,"div",8),c(55," P99 "),r(),p(56,"div",14),o(57,"div",10),c(58,"99th percentile"),r()(),o(59,"div",7)(60,"div",8),c(61," Max "),r(),p(62,"div",14),o(63,"div",10),c(64,"slowest"),r()()()(),o(65,"div",15)(66,"section")(67,"h3",3)(68,"span",16),p(69,"app-icon",17),r(),c(70," Reliability "),r(),o(71,"div",18)(72,"div",7)(73,"div",8),c(74,"Success Rate"),r(),p(75,"div",19),o(76,"div",10),c(77,"of total"),r()(),o(78,"div",7)(79,"div",8),c(80," Error Rate "),r(),p(81,"div",19),o(82,"div",10),c(83,"of total"),r()()()(),o(84,"section")(85,"h3",3)(86,"span",20),p(87,"app-icon",21),r(),c(88," Network "),r(),o(89,"div",18)(90,"div",7)(91,"div",8),c(92," Throughput "),r(),p(93,"div",22),o(94,"div",10),c(95,"avg transfer"),r()(),o(96,"div",7)(97,"div",8),c(98,"Total Data"),r(),p(99,"div",23),o(100,"div",10),c(101,"sent + recvd"),r()()()()(),_(102,Bt,24,9,"section"),r()()()),t&2){let i,l,v,u,h,$,B,ie,re,Z,X,oe,se,le,ce,ee,I;s(),d("collapsed",n.collapsed()),s(3),x("title","Request throughput metrics"),s(5),C((i=n.selectedSummary())!=null&&i.targetAchieved?9:-1),s(),A("bg-base-300",!((l=n.selectedSummary())!=null&&l.peakRequestsPerSecond)),s(),x("title",n.tooltips.peakRps),s(2),d("appFormatRps",(v=n.selectedSummary())==null?null:v.peakRequestsPerSecond),s(4),x("title",n.tooltips.avgRps),s(2),d("appFormatRps",(u=n.selectedSummary())==null?null:u.averageRequestsPerSecond),s(3),C((h=n.endpointSummary())!=null&&h.theoreticalMaxRps?22:-1),s(2),x("title",n.tooltips.totalRequests),s(2),d("appFormatNumber",($=n.selectedSummary())==null?null:$.totalRequests),s(4),x("title","Response time percentiles"),s(6),x("title",n.tooltips.minLatency),s(2),d("appFormatLatency",(B=n.selectedSummary())==null?null:B.minLatencyMs),s(4),x("title",n.tooltips.p50Latency),s(2),d("appFormatLatency",(ie=n.selectedSummary())==null?null:ie.p50LatencyMs),s(4),x("title",n.tooltips.p95Latency),s(2),d("appFormatLatency",(re=n.selectedSummary())==null?null:re.p95LatencyMs),s(4),x("title",n.tooltips.p99Latency),s(2),d("appFormatLatency",(Z=n.selectedSummary())==null?null:Z.p99LatencyMs),s(4),x("title",n.tooltips.maxLatency),s(2),d("appFormatLatency",(X=n.selectedSummary())==null?null:X.maxLatencyMs),s(5),x("title","Success and error metrics"),s(8),A("text-success",(((oe=n.selectedSummary())==null?null:oe.errorRate)||0)===0),d("appFormatPercentage",1-(((se=n.selectedSummary())==null?null:se.errorRate)||0)),s(4),x("title",n.tooltips.errorRate),s(2),A("text-error",(((le=n.selectedSummary())==null?null:le.errorRate)||0)>0),d("appFormatPercentage",(ce=n.selectedSummary())==null?null:ce.errorRate),s(4),x("title","Data transfer metrics"),s(6),x("title",n.tooltips.networkThroughput),s(2),d("appFormatNetwork",(ee=n.globalSummary())==null?null:ee.networkBytesPerSec),s(6),d("appFormatBytes",(((I=n.globalSummary())==null?null:I.networkBytesSent)||0)+(((I=n.globalSummary())==null?null:I.networkBytesReceived)||0)),s(3),C(n.globalSummary()?102:-1)}},dependencies:[Xe,Ze,j,E,Q,fe,ve,lt,mt,Me,Ee,W],encapsulation:2})};var Pe=()=>[];function Ht(a,e){if(a&1&&(o(0,"span",13),c(1,"("),p(2,"span",14),c(3,")"),r(),p(4,"span",15)),a&2){let t=g().$implicit,n=g(2);s(2),d("appFormatNumber",n.getCount(t)),s(2),d("appFormatPercentage",n.getPercentage(t)/100)}}function Vt(a,e){if(a&1){let t=L();o(0,"button",10),b("click",function(){let i=S(t).$implicit,l=g(2);return D(l.selectedStatusCode.set(i))}),p(1,"app-icon",11),o(2,"span",12),c(3),r(),_(4,Ht,5,2),r()}if(a&2){let t=e.$implicit,n=g(2);A("btn-primary",n.selectedStatusCode()===t)("btn-ghost",n.selectedStatusCode()!==t),s(),d("name",n.getCategoryIcon(t)),s(2),z(t==="all"?"All":t),s(),C(t!=="all"?4:-1)}}function qt(a,e){if(a&1&&(o(0,"div",20)(1,"h4",21),c(2," Response Headers "),r(),p(3,"app-json-textarea",22),r()),a&2){let t=g().$implicit,n=g(2);s(3),d("value",n.formatHeaders(t.headers))("rows",6)("disabled",!0)}}function zt(a,e){if(a&1&&(o(0,"div")(1,"h4",21),c(2,"Response Body"),r(),p(3,"app-json-textarea",22),r()),a&2){let t=g().$implicit,n=g(2);s(3),d("value",n.formatBody(t.body))("rows",10)("disabled",!0)}}function Ut(a,e){if(a&1&&(o(0,"div",8)(1,"div",16)(2,"div",17)(3,"span",18),c(4),r(),o(5,"span",19),c(6," Status Code "),r()()(),_(7,qt,4,3,"div",20),_(8,zt,4,3,"div"),r()),a&2){let t=e.$implicit,n=g(2);s(3),Ue(n.getStatusCodeClasses(t.statusCode)),s(),N(" ",t.statusCode," "),s(3),C(n.hasHeaders(t.headers)?7:-1),s(),C(t.body?8:-1)}}function $t(a,e){if(a&1&&(o(0,"div",9),c(1," Showing "),p(2,"span",14),c(3," of "),p(4,"span",14),c(5," samples "),r()),a&2){let t=g(2);s(2),d("appFormatNumber",t.maxSamplesPerCode*5),s(2),d("appFormatNumber",(t.responseSamples()||G(2,Pe)).length)}}function Zt(a,e){if(a&1&&(o(0,"div",5),k(1,Vt,5,7,"button",6,Re),r(),o(3,"div",7),k(4,Ut,9,5,"div",8,Re),r(),_(6,$t,6,3,"div",9)),a&2){let t=g();s(),F(t.getAvailableStatusCodes()),s(3),F(t.getFilteredSamples()),s(2),C((t.responseSamples()||G(1,Pe)).length>t.maxSamplesPerCode*5?6:-1)}}function Xt(a,e){a&1&&(o(0,"div",4),p(1,"app-icon",23),o(2,"p",24),c(3,"No response samples available"),r()())}var Ie=class a{responseSamples=m();statusCodeDistribution=m();totalRequests=m();collapsed=m(!1);collapsedChange=M();selectedStatusCode=y("all");maxSamplesPerCode=3;onCollapsedChange(e){this.collapsedChange.emit(e)}getAvailableStatusCodes(){let e=this.statusCodeDistribution();return e?["all",...Object.keys(e).map(n=>Number.parseInt(n,10)).sort((n,i)=>n-i).map(n=>n.toString())]:["all"]}getFilteredSamples(){let e=this.responseSamples();if(!e)return[];let t=e.slice(0,this.maxSamplesPerCode*5);return this.selectedStatusCode()==="all"?t:t.filter(n=>n.statusCode.toString()===this.selectedStatusCode())}formatHeaders(e){try{return JSON.stringify(e,null,2)}catch{return"Unable to format headers"}}formatBody(e){try{let t=JSON.parse(e);return JSON.stringify(t,null,2)}catch{return e}}getStatusCodeClasses(e){return e>=200&&e<300?"bg-success/20 text-success":e>=300&&e<400?"bg-info/20 text-info":e>=400&&e<500?"bg-warning/20 text-warning":"bg-error/20 text-error"}hasHeaders(e){return e&&Object.keys(e).length>0}getCount(e){return e==="all"?this.responseSamples()?.length||0:this.statusCodeDistribution()?.[e]||0}getPercentage(e){if(e==="all")return 100;let t=this.totalRequests();return!t||t===0?0:(this.statusCodeDistribution()?.[e]||0)/t*100}_getCategory(e){return e>=200&&e<300?"success":e>=300&&e<400?"redirect":e>=400&&e<500?"client-error":"server-error"}getCategoryIcon(e){if(e==="all")return"list_alt";switch(this._getCategory(Number.parseInt(e,10))){case"success":return"check";case"redirect":return"info";case"client-error":return"warning";case"server-error":return"error"}}getCategoryClasses(e){if(e==="all")return"bg-base-300 text-base-content";switch(this._getCategory(Number.parseInt(e,10))){case"success":return"bg-success/20 text-success";case"redirect":return"bg-info/20 text-info";case"client-error":return"bg-warning/20 text-warning";case"server-error":return"bg-error/20 text-error"}}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=T({type:a,selectors:[["app-response-samples"]],inputs:{responseSamples:[1,"responseSamples"],statusCodeDistribution:[1,"statusCodeDistribution"],totalRequests:[1,"totalRequests"],collapsed:[1,"collapsed"]},outputs:{collapsedChange:"collapsedChange"},decls:6,vars:4,consts:[[1,"bg-base-100","rounded-xl","px-6"],[3,"collapsedChange","title","collapsed"],[1,"mt-4"],[1,"space-y-4"],[1,"text-base-content/50","py-8","text-center"],[1,"mb-4","flex","flex-wrap","gap-2"],["type","button",1,"btn","btn-sm","flex","items-center","gap-2",3,"btn-primary","btn-ghost"],[1,"max-h-96","space-y-4","overflow-y-auto"],[1,"bg-base-300","rounded-xl","p-4"],[1,"text-base-content/60","mt-2","text-center","text-sm"],["type","button",1,"btn","btn-sm","flex","items-center","gap-2",3,"click"],[1,"text-sm",3,"name"],[1,"font-mono","font-bold"],[1,"text-xs"],[3,"appFormatNumber"],[1,"text-xs","opacity-70",3,"appFormatPercentage"],[1,"mb-3","flex","items-center","justify-between"],[1,"flex","items-center","gap-2"],[1,"badge"],[1,"text-base-content/70","text-sm"],[1,"mb-3"],[1,"text-base-content/80","mb-2","text-sm","font-semibold"],[1,"text-xs",3,"value","rows","disabled"],["name","text_snippet",1,"mx-auto","mb-2","block","text-2xl"],[1,"text-sm"]],template:function(t,n){t&1&&(o(0,"section",0)(1,"app-collapsible-card",1),b("collapsedChange",function(l){return n.onCollapsedChange(l)}),o(2,"div",2)(3,"div",3),_(4,Zt,7,2)(5,Xt,4,0,"div",4),r()()()()),t&2&&(s(),d("title","Response Samples")("collapsed",n.collapsed()),s(3),C((n.responseSamples()||G(3,Pe)).length>0?4:5))},dependencies:[j,E,ye,ve,Q],encapsulation:2})};var Gt=()=>[],Kt=(a,e)=>e.url;function Yt(a,e){if(a&1&&(o(0,"div",8)(1,"div",11),p(2,"app-icon",12),o(3,"h2",13),c(4,"Failed to Load Test Details"),r(),o(5,"p",14),c(6),r()()()),a&2){let t=g();s(6),z(t.service.errorMessage())}}function Jt(a,e){a&1&&p(0,"app-icon",17)}function Wt(a,e){if(a&1){let t=L();o(0,"li")(1,"button",33),b("click",function(){let i=S(t).$implicit,l=g(2);return D(l.onEndpointChangeValue(i.url))}),p(2,"app-icon",34),o(3,"span",35),c(4),r()()()}if(a&2){let t=e.$implicit,n=g(2);s(),A("active",n.service.selectedEndpoint()===t.url),s(3),z(t.url)}}function Qt(a,e){if(a&1){let t=L();o(0,"app-latency-distribution",36),b("collapsedChange",function(i){S(t);let l=g(2);return D(l.latencyDistributionCollapsed.set(i))}),r()}if(a&2){let t=g(2);d("histogram",t.service.histogram())("collapsed",t.latencyDistributionCollapsed())}}function en(a,e){if(a&1){let t=L();o(0,"app-response-samples",37),b("collapsedChange",function(i){S(t);let l=g(2);return D(l.responseSamplesCollapsed.set(i))}),r()}if(a&2){let t,n,i,l=g(2);d("responseSamples",(t=l.service.endpointSummary())==null?null:t.responseSamples)("statusCodeDistribution",(n=l.service.endpointSummary())==null?null:n.statusCodeDistribution)("totalRequests",(i=l.service.endpointSummary())==null?null:i.totalRequests)("collapsed",l.responseSamplesCollapsed())}}function tn(a,e){if(a&1){let t=L();o(0,"div",9)(1,"div",15),p(2,"app-status-badge",16),_(3,Jt,1,0,"app-icon",17),o(4,"div",18)(5,"div",19)(6,"button",20)(7,"span"),c(8),r(),p(9,"app-icon",21),r(),o(10,"ul",22)(11,"li")(12,"button",23),b("click",function(){S(t);let i=g();return D(i.onEndpointChangeValue("global"))}),p(13,"app-icon",24),o(14,"span"),c(15,"Global Metrics"),r()()(),p(16,"div",25),k(17,Wt,5,3,"li",null,Kt),r()()()(),o(19,"div",26),p(20,"app-hero-stats",27),r(),o(21,"app-performance-over-time",28),b("chartTypeChange",function(i){S(t);let l=g();return D(l.service.selectedChartType.set(i))})("collapsedChange",function(i){S(t);let l=g();return D(l.performanceOverTimeCollapsed.set(i))})("pollingIntervalChange",function(i){S(t);let l=g();return D(l.service.selectedPollingInterval.set(i))})("refresh",function(){S(t);let i=g();return D(i.service.refreshMetrics())}),r(),o(22,"app-performance-summary",29),b("collapsedChange",function(i){S(t);let l=g();return D(l.performanceSummaryCollapsed.set(i))}),r(),_(23,Qt,1,2,"app-latency-distribution",30),_(24,en,1,4,"app-response-samples",31),o(25,"app-metadata",32),b("collapsedChange",function(i){S(t);let l=g();return D(l.configCollapsed.set(i))}),r()()}if(a&2){let t,n,i,l,v,u=g();s(2),d("status",((t=u.service.test())==null?null:t.status)??null)("showPulse",u.service.isRealTime()),s(),C((n=u.service.selectedSummary())!=null&&n.earlyExitTriggered?3:-1),s(5),N(" ",u.service.selectedEndpoint()==="global"?"Global Metrics":u.service.selectedEndpoint()," "),s(4),A("active",u.service.selectedEndpoint()==="global"),s(5),F(((i=u.service.test())==null||i.summary==null?null:i.summary.endpoints)||G(31,Gt)),s(3),d("testData",u.service.test())("selectedSummary",u.service.selectedSummary())("isRealTime",u.service.isRealTime())("selectedEndpoint",u.service.selectedEndpoint()),s(),d("selectedChartType",u.service.selectedChartType())("selectedEndpoint",u.service.selectedEndpoint())("chartOptions",u.chartOptions)("testTimeRange",u.service.testTimeRange())("hasChartData",u.service.hasChartData())("yAxisLabel",u.getYAxisLabel())("chartId",u.getChartId())("chartData",u.service.currentChartData())("isRunning",u.service.isRealTime())("collapsed",u.performanceOverTimeCollapsed())("pollingInterval",u.service.selectedPollingInterval())("pollingOptions",u.pollingOptions),s(),d("selectedSummary",u.service.selectedSummary())("testData",u.service.test())("collapsed",u.performanceSummaryCollapsed()),s(),C(u.service.histogram()?23:-1),s(),C((l=u.service.endpointSummary())!=null&&l.responseSamples?24:-1),s(),d("testData",u.service.test())("configName",u.service.displayConfigName())("configSnapshot",(v=u.service.test())==null||v.summary==null?null:v.summary.configSnapshot)("collapsed",u.configCollapsed())}}var vt=class a{appRouter=f(Qe);service=f(ae);data=m();testId=m();_testService=f(J);_logService=f(Y);isDeleting=y(!1);showDeleteModal=y(!1);chartOptions=Ke;pollingOptions=Ye;configCollapsed=y(!0);performanceSummaryCollapsed=y(!1);performanceOverTimeCollapsed=y(!1);latencyDistributionCollapsed=y(!1);responseSamplesCollapsed=y(!1);constructor(){O(()=>{let e=this.data();e&&this.service.initialize(e)}),O(()=>{let e=this.service.selectedPollingInterval(),t=this.service.isRealTime();if(!t&&e!==0){this.service.selectedPollingInterval.set(0);return}if(t&&e===0){this.service.selectedPollingInterval.set(K);return}this.service.setupPolling(e)})}sanitizeForChartId(e){return e.replaceAll(/[^a-zA-Z0-9]/g,"_")}onEndpointChangeValue(e){this.service.selectedEndpoint.set(e),document.activeElement instanceof HTMLElement&&document.activeElement.blur()}deleteTest(){this.showDeleteModal.set(!0)}async handleDeleteConfirm(){let e=this.service.testId();if(e){this.isDeleting.set(!0);try{await this._testService.deleteTest(e),this._logService.info("Test deleted successfully",{testId:e}),this.appRouter.toHome()}catch(t){this._logService.error("Failed to delete test",t)}finally{this.isDeleting.set(!1),this.showDeleteModal.set(!1)}}}handleDeleteCancel(){this.showDeleteModal.set(!1)}getYAxisLabel(){let e=this.service.selectedChartType();return e==="network_throughput"?"Bytes/sec":e==="peak_throughput"||e==="average_throughput"?"Req/sec":e==="latency"||e==="latency_p95"||e==="latency_p99"?"ms":e==="error_rate"||e==="success_rate"||e==="target_achieved"?"%":e==="network_bytes_sent"||e==="network_bytes_received"?"Bytes":e==="failed_requests"?"requests":"Value"}getChartId(){let e=this.service.selectedEndpoint(),t=this.service.selectedChartType();return e==="global"?`global-${t}`:`endpoint-${this.sanitizeForChartId(e)}-${t}`}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=T({type:a,selectors:[["app-test-detail"]],inputs:{data:[1,"data"],testId:[1,"testId"]},features:[$e([ae])],decls:20,vars:16,consts:[[1,"p-12"],[3,"click","onKeyDown","color","icon","disabled","title"],[1,"dropdown","dropdown-center"],[3,"title","color","tabindex","icon"],[1,"dropdown-content","bg-base-100","rounded-box","ring-base-content/10","z-50","mt-4","w-34","p-2","shadow-lg","ring-1"],["type","button",1,"btn","btn-ghost","w-full","justify-center",3,"click"],[3,"click","onKeyDown","color","title","icon"],[1,"px-8"],[1,"flex","min-h-100","items-center","justify-center","p-8"],[1,"flex","flex-col","gap-4"],[3,"confirmed","closed","isOpen","id","itemLabel"],[1,"max-w-md","text-center"],["name","warning",1,"text-warning","mb-4"],[1,"text-base-content","mb-2","text-xl","font-semibold"],[1,"text-base-content/70","mb-4"],[1,"flex","items-center","justify-between","px-8"],["data-e2e","status-badge",3,"status","showPulse"],["name","warning",1,"text-warning"],[1,"flex","items-center","gap-4"],[1,"dropdown","dropdown-bottom","dropdown-end"],["tabindex","0",1,"btn","btn-ghost","btn-sm","flex","items-center","gap-2","py-4","pr-0","pl-2","text-lg","font-bold","normal-case"],["name","keyboard_arrow_down",1,"text-base-content/30"],[1,"dropdown-content","menu","bg-base-100","rounded-box","ring-base-content/10","z-50","mt-2","max-w-2xl","p-2","shadow-xl","ring-1"],["type","button",1,"flex","items-center","gap-2",3,"click"],["name","analytics"],[1,"divider","my-1"],[1,"px-6"],[3,"testData","selectedSummary","isRealTime","selectedEndpoint"],[3,"chartTypeChange","collapsedChange","pollingIntervalChange","refresh","selectedChartType","selectedEndpoint","chartOptions","testTimeRange","hasChartData","yAxisLabel","chartId","chartData","isRunning","collapsed","pollingInterval","pollingOptions"],[3,"collapsedChange","selectedSummary","testData","collapsed"],[3,"histogram","collapsed"],[3,"responseSamples","statusCodeDistribution","totalRequests","collapsed"],[3,"collapsedChange","testData","configName","configSnapshot","collapsed"],["type","button",1,"flex","max-w-2xl","items-center","gap-2",3,"click"],["name","lan"],[1,"min-w-0","truncate"],[3,"collapsedChange","histogram","collapsed"],[3,"collapsedChange","responseSamples","statusCodeDistribution","totalRequests","collapsed"]],template:function(t,n){if(t&1&&(o(0,"div",0)(1,"app-header")(2,"app-button",1),b("click",function(){return n.deleteTest()})("onKeyDown",function(){return n.deleteTest()}),r(),o(3,"div",2),p(4,"app-button",3),o(5,"menu",4)(6,"li")(7,"button",5),b("click",function(){return n.service.exportResults("json")}),c(8," JSON "),r()(),o(9,"li")(10,"button",5),b("click",function(){return n.service.exportResults("xlsx")}),c(11," XLSX "),r()(),o(12,"li")(13,"button",5),b("click",function(){return n.service.exportResults("md")}),c(14," Markdown "),r()()()(),o(15,"app-button",6),b("click",function(){return n.appRouter.toHome()})("onKeyDown",function(){return n.appRouter.toHome()}),r()(),o(16,"div",7),_(17,Yt,7,1,"div",8),_(18,tn,26,32,"div",9),r(),o(19,"app-delete-confirmation-modal",10),b("confirmed",function(){return n.handleDeleteConfirm()})("closed",function(){return n.handleDeleteCancel()}),r()()),t&2){let i,l;s(2),d("color","error")("icon","delete")("disabled",((i=n.service.test())==null?null:i.status)==="running")("title","Delete"),s(2),d("title","Export")("color","primary")("tabindex",0)("icon","save_as"),s(11),d("color","info")("title","Dashboard")("icon","browse_activity"),s(2),C(n.service.hasError()?17:-1),s(),C(!n.service.hasError()&&n.service.test()?18:-1),s(),d("isOpen",n.showDeleteModal())("id",((l=n.service.test())==null?null:l.id)||"")("itemLabel","Test")}},dependencies:[st,E,ot,he,we,Te,_e,xe,Ce,Ie,dt],encapsulation:2})};export{vt as TestDetailComponent};