tressi
Version:
Deterministic load testing for API performance validation.
2 lines (1 loc) • 4.07 kB
JavaScript
import{b as L}from"./chunk-RQPLME55.js";import{a as S,b as B}from"./chunk-OVBUA5RI.js";import{e as T}from"./chunk-BEQIQLT5.js";import{$a as k,$b as D,Bb as v,Db as b,Ka as d,Ob as N,Qb as r,Rb as y,Sb as _,W as u,ac as h,bb as f,fc as F,jc as x,kc as i,lb as M,ma as s,mb as w,qa as c,rb as C,sb as a,tb as p,ub as E}from"./chunk-W6IDPYNF.js";function $(n,e){if(n&1&&(r(0," Are you sure you want to delete these "),a(1,"span",11),r(2),p(),r(3),D(4,"lowercase")),n&2){let t=b();d(2),y(t.bulkCount()),d(),_(" ",h(4,2,t.itemLabel()),"? ")}}function q(n,e){if(n&1&&(r(0," Are you sure you want to delete this "),a(1,"span",11),r(2),D(3,"lowercase"),p(),r(4,"? ")),n&2){let t=b();d(2),y(h(3,1,t.itemLabel()))}}var j=class n{isOpen=i.required();id=i.required();bulkCount=i(null);itemLabel=i.required();confirmed=x();closed=x();isBulkDelete=F(()=>(this.bulkCount()??0)>0);onConfirm(){this.confirmed.emit()}onCancel(){this.closed.emit()}handleBackdropClick(e){e.target===e.currentTarget&&this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=k({type:n,selectors:[["app-delete-confirmation-modal"]],inputs:{isOpen:[1,"isOpen"],id:[1,"id"],bulkCount:[1,"bulkCount"],itemLabel:[1,"itemLabel"]},outputs:{confirmed:"confirmed",closed:"closed"},decls:16,vars:10,consts:[[1,"modal",3,"click","onKeyDown"],[1,"modal-box","max-w-md","rounded-2xl","p-2"],[1,"p-4"],[1,"text-xl","font-semibold","tracking-tight"],[1,"text-base-content/80","px-4"],[1,"leading-relaxed"],[1,"bg-error/10","text-error","mt-4","flex","items-center","gap-3","rounded-xl","p-4","text-sm"],["name","warning",1,"opacity-80"],[1,"border-base-200","flex","justify-end","gap-3","border-t","p-4"],[3,"click","keydown","ghost","title","icon"],[3,"click","keydown","title","color","icon"],[1,"font-semibold"]],template:function(t,o){t&1&&(a(0,"div",0),v("click",function(l){return o.handleBackdropClick(l)})("onKeyDown",function(l){return o.handleBackdropClick(l)}),a(1,"div",1)(2,"div",2)(3,"h3",3),r(4),p()(),a(5,"div",4)(6,"p",5),M(7,$,5,4)(8,q,5,3),p(),a(9,"div",6),E(10,"app-icon",7),a(11,"span"),r(12,"This action cannot be undone."),p()()(),a(13,"div",8)(14,"app-button",9),v("click",function(){return o.onCancel()})("keydown",function(){return o.onCancel()}),p(),a(15,"app-button",10),v("click",function(){return o.onConfirm()})("keydown",function(){return o.onConfirm()}),p()()()()),t&2&&(N("modal-open",o.isOpen()),d(4),_("Delete ",o.itemLabel()),d(3),w(o.isBulkDelete()?7:8),d(7),C("ghost",!0)("title","Cancel")("icon","close"),d(),C("title","Delete")("color","error")("icon","delete"))},dependencies:[S,B,T],encapsulation:2})};var I=class n{_el=u(c);value=i(void 0,{alias:"appFormatDuration"});constructor(){s(()=>{let e=this.value();if(e==null||e===0){this._el.nativeElement.textContent="0s";return}let t=Math.floor(e/3600),o=Math.floor(e%3600/60),m=Math.floor(e%60),l=[];t>0&&l.push(`${t}h`),o>0&&l.push(`${o}m`),(m>0||l.length===0)&&l.push(`${m}s`),this._el.nativeElement.textContent=l.join(" ")})}static \u0275fac=function(t){return new(t||n)};static \u0275dir=f({type:n,selectors:[["","appFormatDuration",""]],inputs:{value:[1,"appFormatDuration","value"]}})};var R=class n{_el=u(c);value=i(void 0,{alias:"appFormatNumber"});constructor(){s(()=>{let e=this.value();if(e==null){this._el.nativeElement.textContent="0";return}let t=Number(e);if(t===0){this._el.nativeElement.textContent="0";return}let o=Math.abs(t);this._el.nativeElement.textContent=L(o)})}static \u0275fac=function(t){return new(t||n)};static \u0275dir=f({type:n,selectors:[["","appFormatNumber",""]],inputs:{value:[1,"appFormatNumber","value"]}})};var O=class n{_el=u(c);value=i(void 0,{alias:"appFormatRps"});constructor(){s(()=>{let e=this.value();if(!e){this._el.nativeElement.textContent="0/s";return}let t=e<1&&e>0?Math.floor(e*10)/10:Math.trunc(e).toLocaleString();this._el.nativeElement.textContent=`${t}/s`})}static \u0275fac=function(t){return new(t||n)};static \u0275dir=f({type:n,selectors:[["","appFormatRps",""]],inputs:{value:[1,"appFormatRps","value"]}})};export{I as a,R as b,O as c,j as d};