1import{a as A}from"./chunk-CFBBQL7K.js";import{a as Pe}from"./chunk-WZYNORWH.js";import{a as Ee}from"./chunk-TVP2JV4D.js";import"./chunk-2C6LKFWM.js";import{a as we}from"./chunk-PJLIWTQI.js";import"./chunk-TEL3HTCV.js";import{b as Se}from"./chunk-RND7IQSZ.js";import{a as T,d as Q}from"./chunk-KKLQBNPD.js";import{D as Ce,E as ye,c as he,f as V,j as $,k as fe,p as ve}from"./chunk-GHIFMYC2.js";import"./chunk-VNJB24XO.js";import{a as ge}from"./chunk-G3JXQVD2.js";import"./chunk-Y5ISLRKX.js";import"./chunk-KRTOWJHS.js";import{Wa as be,r as _e}from"./chunk-Q4ADUVSE.js";import{a as xe}from"./chunk-OJIK2GGX.js";import"./chunk-D3MGAOCE.js";import{n as pe}from"./chunk-MSIUAZXA.js";import{$b as a,A as Y,Ac as D,C as ee,Cc as I,D as te,Da as _,Dc as r,Ec as N,F as ne,Fb as se,Fc as d,Gc as F,J as ie,Tb as z,Tc as Z,Ub as p,Uc as j,Vb as x,Xb as k,Yb as f,Z as ae,Zb as v,_ as re,_b as u,ac as n,bc as w,eb as le,fd as ce,hc as K,ic as S,j as X,jb as l,la as R,mc as b,md as E,oc as m,r as O,ra as g,sa as h,ud as ue,wc as de,xa as oe,xc as me,yc as U,z as J,zb as L}from"./chunk-NCV6CZXT.js";import"./chunk-QXIBXHVB.js";var Fe=/\s*(?:-+>+|\s-\s|â|â|\bto\b)\s*|(?<=\d{10})-(?=\+?\d{10})/i;function G(i){let t=i.replace(/\D/g,"");return t.length===10&&t.startsWith("0")&&(t="27"+t.slice(1)),/^27\d{9}$/.test(t)?t:null}function Ne(i){let t=new Set,e=[],o=i.split(/[\n,;]+/).map(s=>s.trim()).filter(Boolean);for(let s of o){let c=s.split(Fe).filter(Boolean);if(c.length===1){let M=G(c[0]);M?t.add(M):e.push(s);continue}let y=c.length===2?G(c[0]):null,C=c.length===2?G(c[1]):null,P=y?Number(y):NaN,q=C?Number(C):NaN;if(!y||!C||q<P||q-P>=1e3){e.push(s);continue}for(let M=P;M<=q;M++)t.add(String(M))}return{numbers:[...t],invalid:e}}var Qe=["addCard"],ke=i=>({$implicit:i}),Te=(i,t)=>t.code,Ve=(i,t)=>t.number,$e=(i,t)=>t.input;function Ae(i,t){if(i&1&&(a(0,"span",6),r(1),n()),i&2){let e=m();l(),N(e.progress())}}function Be(i,t){i&1&&(a(0,"p",13),r(1,"Owner ID must be a number."),n())}function qe(i,t){if(i&1&&(a(0,"bc-badge",16),r(1),n()),i&2){let e=m();u("title",e.parsed().invalid.join(` 2`)),l(),d(" ",e.parsed().invalid.length," not readable ")}}function Oe(i,t){if(i&1){let e=S();a(0,"button",25),b("click",function(){g(e);let s=m();return h(s.runLoad())}),r(1),n()}if(i&2){let e=m();u("disabled",e.busy()!==null),l(),d(" ",e.busy()==="load"?"Loading\u2026":"Load "+e.loadable()+" number"+(e.loadable()===1?"":"s")," ")}}function ze(i,t){if(i&1){let e=S();a(0,"button",25),b("click",function(){g(e);let s=m();return h(s.runPreview())}),r(1),n()}if(i&2){let e=m();u("disabled",e.busy()!==null||!e.parsed().numbers.length||e.ownerInvalid()),l(),d(" ",e.busy()==="preview"?"Checking\u2026":"Preview"," ")}}function Ke(i,t){if(i&1){let e=S();a(0,"button",26),b("click",function(){g(e);let s=m();return h(s.clearAdd())}),r(1," Clear "),n()}if(i&2){let e=m();u("disabled",e.busy()!==null)}}function Ue(i,t){if(i&1&&(r(0," These will be reserved for "),a(1,"strong"),r(2),n(),r(3,". ")),i&2){let e=m(2),o=m();l(2),N(e.ownerName??"owner "+o.ownerId())}}function je(i,t){i&1&&r(0," These will go into the open pool. ")}function Ge(i,t){if(i&1&&(a(0,"div",27),r(1," Nothing has changed yet. "),p(2,Ue,4,1)(3,je,1,0),n(),K(4,20)),i&2){let e=m(),o=m(),s=U(42);l(2),x(o.ownerId()?2:3),l(2),u("ngTemplateOutlet",s)("ngTemplateOutletContext",j(3,ke,e.results))}}function We(i,t){i&1&&(a(0,"p",6),r(1," The list or owner changed \u2014 preview again. "),n())}function He(i,t){if(i&1&&p(0,Ge,5,5)(1,We,2,0,"p",6),i&2){let e=m();x(e.previewCurrent()?0:1)}}function Xe(i,t){if(i&1&&K(0,20),i&2){m();let e=U(42);u("ngTemplateOutlet",e)("ngTemplateOutletContext",j(2,ke,t))}}function Je(i,t){i&1&&r(0),i&2&&d(" Last checked ",t.checked_at.slice(11,16)," UTC. ")}function Ye(i,t){i&1&&w(0,"app-loader")}function et(i,t){if(i&1&&(a(0,"div",28),r(1),n()),i&2){let e=t.$implicit;l(),d(" ",e," ")}}function tt(i,t){}function nt(i,t){if(i&1&&(a(0,"span",30),w(1,"fa-icon",24),r(2),n()),i&2){let e=m(),o=m();l(),u("icon",o.faOk),l(),d(" All ",e.summary.total," numbers line up. ")}}function it(i,t){if(i&1&&(a(0,"span",31)(1,"strong"),r(2),n(),r(3),n()),i&2){let e=m(),o=m();l(2),N(o.problemCount()),l(),d(" of ",e.summary.total," numbers need attention. ")}}function at(i,t){if(i&1){let e=S();a(0,"button",33),b("click",function(){let s=g(e).$implicit,c=m(2);return h(c.setFilter(s.code))}),r(1),n()}if(i&2){let e=t.$implicit,o=m(2);D("active",o.filter()===e.code)("accent",o.filter()===e.code),l(),F(" ",e.name," (",e.count,") ")}}function rt(i,t){}function ot(i,t){if(i&1){let e=S();a(0,"span",46),r(1),n(),a(2,"button",47),b("click",function(){g(e);let s=m(2);return h(s.loadSelected())}),r(3," Load into pool "),n(),a(4,"button",48),b("click",function(){g(e);let s=m(2);return h(s.repairSelected())}),r(5),n(),a(6,"button",49),b("click",function(){g(e);let s=m(2);return h(s.toggleAllShown(!1))}),r(7," Clear selection "),n()}if(i&2){let e=m(2);l(),d("",e.selectedCount()," selected"),l(),u("disabled",e.busy()!==null),l(2),u("disabled",e.busy()!==null),l(),d(" ",e.busy()==="repair"?"Fixing\u2026":"Fix in Porta"," ")}}function lt(i,t){if(i&1){let e=S();a(0,"span",15),r(1,"Quick select:"),n(),a(2,"button",50),b("click",function(){g(e);let s=m(2);return h(s.selectFixable("load"))}),r(3),n(),a(4,"button",50),b("click",function(){g(e);let s=m(2);return h(s.selectFixable("repair"))}),r(5),n()}if(i&2){let e=m(2);l(2),u("disabled",!e.fixableCount("load")),l(),d(" Needs loading (",e.fixableCount("load"),") "),l(),u("disabled",!e.fixableCount("repair")),l(),d(" Needs Porta fix (",e.fixableCount("repair"),") ")}}function st(i,t){i&1&&r(0," \xB7 blocked ")}function dt(i,t){if(i&1&&(a(0,"div",31),r(1),n(),a(2,"div",15),r(3),p(4,st,1,0),n()),i&2){let e=t;l(),d(" ",e.customer_name||"Customer "+e.customer_id," "),l(2),d(" IP ",e.has_ip===!0?"set":e.has_ip===!1?"missing":"unknown"," "),l(),x(e.blocked?4:-1)}}function mt(i,t){i&1&&(a(0,"div",15),r(1," Granted, no account "),n())}function ct(i,t){i&1&&(a(0,"span",54),r(1,"\u2014"),n())}function ut(i,t){if(i&1&&r(0),i&2){let e=m();d(" \xB7 ",e.provider??"no provider"," ")}}function pt(i,t){if(i&1&&(a(0,"div",31),r(1),n(),a(2,"div",15),r(3),p(4,ut,1,1),n()),i&2){let e=t,o=m().$implicit,s=m(2);l(),d(" ",e.owner_name||(e.owner_id?"Owner "+e.owner_id:"No owner")," "),l(2),d(" ",s.dbLabel(o)," "),l(),x(e.provider!=="sessiontelecoms"?4:-1)}}function xt(i,t){i&1&&(a(0,"span",54),r(1,"\u2014"),n())}function _t(i,t){if(i&1&&(a(0,"bc-badge",56),r(1),n()),i&2){let e=t.$implicit,o=m(3);u("variant",o.problemVariant(e.fix))("title",e.fix==="load"?"Fix: Load into pool":e.fix==="repair"?"Fix: Fix in Porta":"Needs a manual fix"),l(),d(" ",e.label," ")}}function bt(i,t){i&1&&(a(0,"bc-badge",57),r(1,"OK"),n())}function gt(i,t){if(i&1){let e=S();a(0,"tr",43)(1,"td",51)(2,"bc-checkbox-input",40),b("valueChange",function(s){let c=g(e).$implicit,y=m(2);return h(y.toggleRow(c.number,s))}),n()(),a(3,"td",52),r(4),n(),a(5,"td",53),p(6,dt,5,3)(7,mt,2,0,"div",15)(8,ct,2,0,"span",54),n(),a(9,"td",53),p(10,pt,5,3)(11,xt,2,0,"span",54),n(),a(12,"td",51)(13,"div",55),f(14,_t,2,3,"bc-badge",56,Te,!1,bt,2,0,"bc-badge",57),n()()()}if(i&2){let e,o,s=t.$implicit,c=m(2);l(2),u("value",c.selected().has(s.number)),l(2),d(" ",s.number," "),l(2),x((e=s.porta)?6:s.did?7:8,e),l(4),x((o=s.db)?10:11,o),l(4),v(s.problems)}}function ht(i,t){i&1&&(a(0,"tr")(1,"td",58),r(2," Nothing to show. "),n()())}function ft(i,t){if(i&1){let e=S();f(0,et,2,1,"div",28,k,!1,tt,0,0),a(3,"div",29),p(4,nt,3,2,"span",30)(5,it,4,2,"span",31),n(),a(6,"div",17)(7,"div",32)(8,"button",33),b("click",function(){g(e);let s=m();return h(s.setFilter("problems"))}),r(9),n(),f(10,at,2,6,"button",34,Te,!1,rt,0,0),a(13,"button",33),b("click",function(){g(e);let s=m();return h(s.setFilter("all"))}),r(14),n()(),w(15,"bc-text-input",35),n(),a(16,"div",14),p(17,ot,8,4)(18,lt,6,4),n(),a(19,"div",36)(20,"table",37)(21,"thead",38)(22,"tr")(23,"th",39)(24,"bc-checkbox-input",40),b("valueChange",function(s){g(e);let c=m();return h(c.toggleAllShown(s))}),n()(),a(25,"th",41),r(26,"Number"),n(),a(27,"th",41),r(28,"Porta"),n(),a(29,"th",41),r(30," Our database "),n(),a(31,"th",41),r(32,"Problems"),n()()(),a(33,"tbody",42),f(34,gt,17,5,"tr",43,Ve,!1,ht,3,0,"tr"),n()()(),a(37,"p",6)(38,"bc-badge",44),r(39,"Amber"),n(),r(40," problems are fixed from here. "),a(41,"bc-badge",45),r(42,"Red"),n(),r(43," ones need a person \u2014 usually in Porta. "),n()}if(i&2){let e=t,o=m();v(e.warnings),l(4),x(o.problemCount()===0?4:5),l(4),D("active",o.filter()==="problems")("accent",o.filter()==="problems"),l(),d(" Problems (",o.problemCount(),") "),l(),v(o.problemFilters()),l(3),D("active",o.filter()==="all")("accent",o.filter()==="all"),l(),d(" All (",e.
2summary.total,") "),l(),u("formControl",o.searchCtrl)("showErrorMessage",!1),l(2),x(o.selectedCount()?17:18),l(7),u("value",o.allShownSelected()),l(10),v(o.rows())}}function vt(i,t){if(i&1&&(a(0,"span",64),r(1),n()),i&2){let e=m().$implicit;l(),N(e.error)}}function Ct(i,t){if(i&1&&(a(0,"li",60)(1,"span",62),r(2),n(),a(3,"bc-badge",63),r(4),n(),p(5,vt,2,1,"span",64),n()),i&2){let e=t.$implicit,o=m(2);l(2),N(e.number??e.input),l(),u("variant",o.outcomeVariant(e.outcome)),l(),N(o.outcomeLabel(e.outcome)),l(),x(e.error?5:-1)}}function yt(i,t){i&1&&(a(0,"li",61),r(1,"No numbers."),n())}function wt(i,t){if(i&1&&(a(0,"ul",59),f(1,Ct,6,4,"li",60,$e,!1,yt,2,0,"li",61),n()),i&2){let e=t.$implicit;l(),v(e)}}var W=50,Ie={not_set_up:"Not set up",not_in_db:"Missing from DB",not_in_porta:"Missing from Porta",wrong_client:"Wrong Porta client",no_ip:"No IP",ip_unknown:"IP unreadable",blocked:"Blocked",wrong_provider:"Wrong provider",duplicate_db:"Duplicate rows"},B=class i{admin=R(A);toast=R(ge);faRefresh=_e;faOk=be;addCard=ue("addCard");numbersCtrl=new $("",{nonNullable:!0});ownerCtrl=new $("",{nonNullable:!0});numbersText=Q(this.numbersCtrl.valueChanges,{initialValue:""});ownerText=Q(this.ownerCtrl.valueChanges,{initialValue:""});parsed=E(()=>Ne(this.numbersText()));ownerId=E(()=>{let t=Number(this.ownerText().trim());return Number.isInteger(t)&&t>0?t:null});ownerInvalid=E(()=>this.ownerText().trim()!==""&&this.ownerId()===null);busy=_(null);progress=_("");preview=_(null);loaded=_(null);requestKey=E(()=>`${this.parsed().numbers.join(",")}|${this.ownerId()??""}`);previewCurrent=E(()=>this.preview()?.key===this.requestKey());loadable=E(()=>this.preview()?.results.filter(t=>t.outcome!=="failed").length??0);async runPreview(){let t=this.parsed().numbers;if(!t.length||this.ownerInvalid())return;let e=this.requestKey();this.loaded.set(null);let o=await this.inChunks("preview",t,s=>this.admin.loadZaNumbers(s,this.ownerId(),!0));o&&this.preview.set({key:e,ownerName:o.ownerName,results:o.results})}async runLoad(){let t=this.preview();if(!t||!this.previewCurrent())return;let e=t.results.filter(c=>c.outcome!=="failed").map(c=>c.number??c.input),o=await this.inChunks("load",e,c=>this.admin.loadZaNumbers(c,this.ownerId(),!1));if(!o)return;this.preview.set(null),this.loaded.set(o.results);let s=o.results.filter(c=>c.outcome==="failed").length;this.toast.add(s?`Loaded ${o.results.length-s}, ${s} failed`:`Loaded ${o.results.length} numbers`,4e3,s?"error":"success"),this.audit()&&this.runAudit()}clearAdd(){this.numbersCtrl.setValue(""),this.ownerCtrl.setValue(""),this.preview.set(null),this.loaded.set(null)}audit=_(null);filter=_("problems");searchCtrl=new $("",{nonNullable:!0});search=Q(this.searchCtrl.valueChanges,{initialValue:""});selected=_(new Set);problemFilters=E(()=>{let t=this.audit()?.summary??{};return Object.keys(Ie).filter(e=>t[e]).map(e=>({code:e,name:Ie[e],count:t[e]}))});problemCount=E(()=>(this.audit()?.summary.total??0)-(this.audit()?.summary.ok??0));rows=E(()=>{let t=this.filter(),e=this.search().replace(/\D/g,""),o=this.search().trim().toLowerCase();return(this.audit()?.rows??[]).filter(s=>t==="problems"&&!s.problems.length||t!=="all"&&t!=="problems"&&!s.problems.some(c=>c.code===t)?!1:o?e&&s.number.includes(e)||(s.db?.owner_name??"").toLowerCase().includes(o)||String(s.db?.owner_id??"")===o:!0)});selectedCount=E(()=>this.selected().size);allShownSelected=E(()=>this.rows().length>0&&this.rows().every(t=>this.selected().has(t.number)));async runAudit(){this.busy.set("audit"),this.progress.set("Reading Porta and our database\u2026");try{let t=await O(this.admin.auditZaNumbers());this.audit.set(t),this.selected.set(new Set)}catch(t){this.toast.add(t?.message??"Could not check the numbers",4e3,"error")}finally{this.busy.set(null),this.progress.set("")}}setFilter(t){this.filter.set(t),this.selected.set(new Set)}toggleRow(t,e){this.selected.update(o=>{let s=new Set(o);return e?s.add(t):s.delete(t),s})}toggleAllShown(t){this.selected.set(t?new Set(this.rows().map(e=>e.number)):new Set)}selectFixable(t){this.selected.set(new Set(this.rows().filter(e=>e.problems.some(o=>o.fix===t)).map(e=>e.number)))}fixableCount(t){return this.rows().filter(e=>e.problems.some(o=>o.fix===t)).length}loadSelected(){this.numbersCtrl.setValue([...this.selected()].join(` 3`)),this.addCard()?.nativeElement.scrollIntoView({behavior:"smooth",block:"start"}),this.runPreview()}async repairSelected(){let t=[...this.selected()],e=await this.inChunks("repair",t,c=>this.admin.repairZaNumbers(c));if(!e)return;let o=e.results.filter(c=>c.outcome==="failed"),s=e.results.filter(c=>c.outcome==="fixed").length;this.toast.add(o.length?`Fixed ${s} in Porta, ${o.length} failed: ${o[0].error}`:`Fixed ${s} in Porta`,o.length?6e3:4e3,o.length?"error":"success"),this.runAudit(
3)}problemVariant(t){return t?"warning":"danger"}outcomeVariant(t){return t==="failed"?"danger":t.startsWith("would")?"info":"success"}outcomeLabel(t){return{would_add:"New",would_update:"Update",added:"Added",updated:"Updated",failed:"Cannot load",fixed:"Fixed",ok:"Already fine"}[t]??t}dbLabel(t){let e=t.db;return e?e.status==="available"?e.owner_id?"In pool, reserved":"In pool, open":e.usage_type?`${e.status} \xB7 ${e.usage_type}`:e.status:""}async inChunks(t,e,o){let s={preview:"Checking",load:"Loading",repair:"Fixing",audit:""}[t],c=[],y=null;this.busy.set(t);try{for(let C=0;C<e.length;C+=W){this.progress.set(`${s} ${Math.min(C+W,e.length)} of ${e.length}\u2026`);let P=await O(o(e.slice(C,C+W)));c.push(...P.results),y=P.owner_name??y}return{results:c,ownerName:y}}catch(C){let P=c.length?` (${c.length} done before it stopped)`:"";return this.toast.add((C?.message??"Request failed")+P,6e3,"error"),null}finally{this.busy.set(null),this.progress.set("")}}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=L({type:i,selectors:[["app-za-numbers-panel"]],viewQuery:function(e,o){e&1&&de(o.addCard,Qe,5),e&2&&me()},hostAttrs:[1,"block","@container"],decls:43,vars:21,consts:[["addCard",""],["resultList",""],[1,"space-y-4"],[1,"flex","flex-wrap","items-baseline","justify-between","gap-2"],[1,"text-base","font-semibold","text-theme-primary"],[1,"text-xs","font-normal","text-theme-secondary","ml-2"],[1,"text-xs","text-theme-secondary"],[1,"grid","gap-4","@4xl:grid-cols-[minmax(0,26rem)_minmax(0,1fr)]"],[1,"rounded-lg","border","border-theme-default","bg-surface-component","p-4","space-y-3","self-start","scroll-mt-4"],[1,"text-sm","font-semibold","text-theme-primary"],[1,"text-xs","text-theme-secondary","mt-0.5"],["inputType","textarea","rounded","lg","size","sm","placeholder","27100570250 -->> 27100570269",3,"formControl","showErrorMessage"],["inputType","number","rounded","lg","size","sm","label","For an owner (optional)","placeholder","Owner ID \u2014 leave empty for the open pool",3,"formControl","showErrorMessage"],[1,"text-xs","text-danger"],[1,"flex","flex-wrap","items-center","gap-2","text-xs"],[1,"text-theme-secondary"],["variant","danger","size","xs",3,"title"],[1,"flex","flex-wrap","gap-2"],["type","button",1,"btn","btn-solid","btn-small",3,"disabled"],["type","button",1,"btn","btn-ghost","btn-small",3,"disabled"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"rounded-lg","border","border-theme-default","bg-surface-component","p-4","space-y-3","min-w-0"],[1,"flex","flex-wrap","items-start","justify-between","gap-2"],["type","button",1,"btn","btn-outline","btn-small",3,"click","disabled"],[3,"icon"],["type","button",1,"btn","btn-solid","btn-small",3,"click","disabled"],["type","button",1,"btn","btn-ghost","btn-small",3,"click","disabled"],[1,"rounded-lg","bg-accent-500/10","border","border-accent-500/25","px-3","py-2","text-xs","text-theme-primary"],[1,"rounded-lg","bg-warning-500/10","border","border-warning-500/25","px-3","py-2","text-xs","text-theme-primary"],[1,"flex","flex-wrap","items-center","gap-2","text-sm"],[1,"text-accent","flex","items-center","gap-1"],[1,"text-theme-primary"],[1,"pill-group","flex-wrap"],["type","button",1,"pill-btn",3,"click"],["type","button",1,"pill-btn",3,"active","accent"],["inputType","search","rounded","lg","size","sm","placeholder","Number or owner",1,"w-56",3,"formControl","showErrorMessage"],[1,"rounded-lg","border","border-theme-default","overflow-auto","max-h-[32rem]"],[1,"w-full","text-sm"],[1,"bg-surface-hover","text-theme-secondary","uppercase","text-xs","sticky","top-0","z-10"],[1,"px-3","py-2","w-8"],["size","sm",3,"valueChange","value"],[1,"px-3","py-2","text-left"],[1,"divide-y","divide-theme-default"],[1,"hover:bg-surface-hover","align-top"],["size","xs","variant","warning"],["size","xs","variant","danger"],[1,"text-theme-primary","font-medium"],["type","button",1,"btn","btn-solid","btn-extra-small",3,"click","disabled"],["type","button",1,"btn","btn-outline","btn-extra-small",3,"click","disabled"],["type","button",1,"btn","btn-ghost","btn-extra-small",3,"click"],["type","button",1,"btn","btn-ghost","btn-extra-small",3,"click","disabled"],[1,"px-3","py-2"],[1,"px-3","py-2","font-mono","text-xs","text-theme-primary","whitespace-nowrap"],[1,"px-3","py-2","text-xs"],[1,"text-theme-disabled"],[1,"flex","flex-wrap","gap-1"],["size","xs",3,"variant","title"],["size","xs","variant","success"],["colspan","5",1,"px-4","py-6","text-center","text-theme-secondary","text-sm"],[1,"rounded-lg","border","border-theme-default","divide-y","divide-theme-default","max-h-72","overflow-y-auto","text-xs"],[1,"px-3","py-1.5","flex","items-start","gap-2"],[1,"px-3","py-2","text-theme-secondary"],[1,"font-mono","text-theme-primary","whitespace-nowrap"],["size","xs",3,"variant"],[1,"text-danger"]],template:function(e,o){if(e&1&&(a(0,"div",2)(1,"div",3)(2,"h2",4),r(3," ZA Numbers "),a(4,"span",5),r(5,"\xB7 Session Telecoms (Porta)"),n()(),p(6,Ae,2,1,"span",6),n(),a(7,"div",7)(8,"div",8,0)(10,"div")(11,"h3",9),r(12," Add numbers "),n(),a(13,"p",10),r(14," Paste numbers or ranges, one per line. Sets them up in Porta and adds them to the number pool. "),n()(),w(15,"bc-text-input",11)(16,"bc-text-input",12),p(17,Be,2,0,"p",13),a(18,"div",14)(19,"span",15),r(20),n(),p(21,qe,2,2,"bc-badge",16),n(),a(22,"div",17),p(23,Oe,2,2,"button",18)(24,ze,2,2,"button",18),p(25,Ke,2,1,"button",19),n(),p(26,He,2,1),p(27,Xe,1,4,"ng-container",20),n(),a(28,"div",21)(29,"div",22)(30,"div")(31,"h3",9),r(32," Check all numbers "),n(),a(33,"p",10),r(34," Compares every number in Porta with our database. "),p(35,Je,1,1),n()(),a(36,"button",23),b("click",function(){return o.runAudit(
3)}),w(37,"fa-icon",24),r(38),n()(),p(39,Ye,1,0,"app-loader"),p(40,ft,44,18),n()()(),se(41,wt,4,1,"ng-template",null,1,ce)),e&2){let s,c,y,C;l(6),x(o.busy()&&o.progress()?6:-1),l(9),u("formControl",o.numbersCtrl)("showErrorMessage",!1),l(),u("formControl",o.ownerCtrl)("showErrorMessage",!1),l(),x(o.ownerInvalid()?17:-1),l(3),F(" ",o.parsed().numbers.length," number",o.parsed().numbers.length===1?"":"s"," "),l(),x(o.parsed().invalid.length?21:-1),l(2),x(o.previewCurrent()&&o.loadable()?23:24),l(2),x(o.numbersCtrl.value||o.preview()||o.loaded()?25:-1),l(),x((s=o.preview())?26:-1,s),l(),x((c=o.loaded())?27:-1,c),l(8),x((y=o.audit())?35:-1,y),l(),u("disabled",o.busy()!==null),l(),D("animate-spin",o.busy()==="audit"),u("icon",o.faRefresh),l(),d(" ",o.audit()?"Check again":"Run check"," "),l(),x(o.busy()==="audit"&&!o.audit()?39:-1),l(),x((C=o.audit())?40:-1,C)}},dependencies:[pe,ye,V,ve,xe,Se,Pe,Ee,we],encapsulation:2,changeDetection:0})};var H=()=>[1,2,3],St=()=>[1,2],Et=(i,t)=>t.uuid,Pt=(i,t)=>t.token;function Nt(i,t){i&1&&w(0,"div",34)}function It(i,t){i&1&&(a(0,"div",8),f(1,Nt,1,0,"div",34,k),n()),i&2&&(l(),v(Z(0,H)))}function kt(i,t){if(i&1&&(a(0,"tr",30)(1,"td",35)(2,"span",36),r(3),n()(),a(4,"td",37),r(5),n(),a(6,"td",38),r(7),n(),a(8,"td",38),r(9),n(),a(10,"td",39),r(11),n(),a(12,"td",40)(13,"span",36),r(14),n()(),a(15,"td",41),r(16),n(),a(17,"td",42),r(18),n(),a(19,"td",43),r(20),n()()),i&2){let e=t.$implicit,o=m(2);l(2),I(e.callstate==="ACTIVE"?"badge-accent":e.callstate==="RINGING"?"badge-warning":"badge-info"),l(),d(" ",e.callstate," "),l(2),d(" ",e.direction," "),l(2),d(" ",e.cid_num||"\u2014"," "),l(2),d(" ",e.dest||"\u2014"," "),l(2),d(" ",o.ownerFromChannel(e)," "),l(2),I(e.context==="public"?"badge-warning":"badge-info"),l(),d(" ",e.context||"\u2014"," "),l(),u("title",e.application_data||""),l(),d(" ",e.application||"\u2014"," "),l(2),d(" ",o.channelDuration(e.created_epoch)," "),l(),u("title",e.uuid),l(),d(" ",e.uuid," ")}}function Tt(i,t){i&1&&(a(0,"tr")(1,"td",44),r(2," No active calls. "),n()())}function Mt(i,t){if(i&1&&(a(0,"div",9)(1,"table",23)(2,"thead",24)(3,"tr")(4,"th",28),r(5,"State"),n(),a(6,"th",28),r(7,"Dir"),n(),a(8,"th",28),r(9,"From"),n(),a(10,"th",28),r(11,"To"),n(),a(12,"th",28),r(13,"Owner"),n(),a(14,"th",28),r(15,"Context"),n(),a(16,"th",28),r(17,"Application"),n(),a(18,"th",33),r(19,"Duration"),n(),a(20,"th",28),r(21,"UUID"),n()()(),a(22,"tbody",29),f(23,kt,21,15,"tr",30,Et,!1,Tt,3,0,"tr"),n()()()),i&2){let e=m();l(23),v(e.activeChannels())}}function Rt(i,t){if(i&1&&(a(0,"div",45),r(1),n()),i&2){let e=m();I(e.ringResult().startsWith("+OK")?"bg-accent-50 text-accent-700 border border-accent-200":"bg-danger-50 text-danger-700 border border-danger-200"),l(),d(" ",e.ringResult()," ")}}function Ft(i,t){i&1&&w(0,"div",34)}function Dt(i,t){i&1&&(a(0,"div",8),f(1,Ft,1,0,"div",34,k),n()),i&2&&(l(),v(Z(0,H)))}function Zt(i,t){if(i&1&&(a(0,"span",50),r(1),n()),i&2){let e=m().$implicit;l(),d("(",e.reg_user,")")}}function Lt(i,t){if(i&1&&(a(0,"span",51),r(1),n()),i&2){let e=m().$implicit;l(),N(e.full_name)}}function Qt(i,t){i&1&&(a(0,"span",52),r(1,"\u2014"),n())}function Vt(i,t){if(i&1&&(a(0,"span",51),r(1),n(),a(2,"span",58),r(3),n()),i&2){let e=m().$implicit,o=m(2);l(),N(e.owner_name),l(2),d("#",o.ownerFromRealm(e.realm))}}function $t(i,t){if(i&1&&(a(0,"span",52),r(1),n()),i&2){let e=m().$implicit,o=m(2);l(),d("#",o.ownerFromRealm(e.realm))}}function At(i,t){if(i&1){let e=S();a(0,"tr",30)(1,"td",35)(2,"span",36),r(3),n()(),a(4,"td",38),r(5),p(6,Zt,2,1,"span",50),n(),a(7,"td",40),p(8,Lt,2,1,"span",51)(9,Qt,2,0,"span",52),n(),a(10,"td",40),p(11,Vt,4,2)(12,$t,2,1,"span",52),n(),a(13,"td",53),r(14),n(),a(15,"td",54),r(16),n(),a(17,"td",55)(18,"span",36),r(19),n()(),a(20,"td",56),r(21),n(),a(22,"td",32)(23,"button",57),b("click",function(){let s=g(e).$implicit,c=m(2);return h(c.testRing(s))}),r(24),n()()()}if(i&2){let e=t.$implicit,o=m(2);l(2),I(o.sipRegTypeBadge(e)),l(),d(" ",o.sipRegTypeLabel(e)," "),l(2),d(" ",e.extension??e.reg_user," "),l(),x(e.extension&&e.extension!==e.reg_user?6:-1),l(2),x(e.full_name?8:9),l(3),x(e.owner_name?11:12),l(2),u("title",e.user_agent??""),l(),d(" ",e.user_agent||o.sipRegTypeLabel(e)," "),l(2),F(" ",e.network_ip,":",e.network_port," "),l(2),I(e.network_proto==="tls"||e.network_proto==="wss"?"badge-accent":"badge-info"),l(),d(" ",e.network_proto," "),l(),I(o.sipRegExpiresIn(e)<60?"text-danger-500":"text-theme-secondary"),l(),d(" ",o.sipReg
3ExpiresLabel(e)," "),l(2),u("disabled",o.isRinging(e)),l(),d(" ",o.isRinging(e)?"Ringing...":"Ring"," ")}}function Bt(i,t){i&1&&(a(0,"tr")(1,"td",44),r(2," No SIP registrations. "),n()())}function qt(i,t){if(i&1&&(a(0,"div",13)(1,"div",46)(2,"table",23)(3,"thead",47)(4,"tr")(5,"th",28),r(6,"Type"),n(),a(7,"th",48),r(8," SIP User "),n(),a(9,"th",28),r(10,"User"),n(),a(11,"th",28),r(12,"Owner"),n(),a(13,"th",28),r(14," Device / UA "),n(),a(15,"th",28),r(16,"IP"),n(),a(17,"th",28),r(18,"Proto"),n(),a(19,"th",33),r(20," Expires "),n(),a(21,"th",49),r(22," Test "),n()()(),a(23,"tbody",29),f(24,At,25,19,"tr",30,Pt,!1,Bt,3,0,"tr"),n()()()()),i&2){let e=m();l(24),v(e.sipRegsFiltered())}}function Ot(i,t){i&1&&w(0,"div",34)}function zt(i,t){i&1&&(a(0,"div",8),f(1,Ot,1,0,"div",34,k),n()),i&2&&(l(),v(Z(0,H)))}function Kt(i,t){if(i&1&&(a(0,"a",64),r(1,"Link"),n()),i&2){let e=m().$implicit;u("href",e.endpoint,le)}}function Ut(i,t){if(i&1){let e=S();a(0,"tr",30)(1,"td",60),r(2),n(),a(3,"td",32)(4,"label",61)(5,"input",62),b("change",function(){let s=g(e).$implicit,c=m(2);return h(c.toggleQueue(s))}),n(),w(6,"div",63),n()(),a(7,"td",32),p(8,Kt,2,1,"a",64),n()()}if(i&2){let e=t.$implicit;l(2),d(" ",e.queue_name," "),l(3),u("checked",e.status===1),l(3),x(e.endpoint?8:-1)}}function jt(i,t){i&1&&(a(0,"tr")(1,"td",65),r(2," No queues found. "),n()())}function Gt(i,t){if(i&1&&(a(0,"div",13)(1,"div",59)(2,"table",23)(3,"thead",47)(4,"tr")(5,"th",28),r(6," Queue "),n(),a(7,"th",32),r(8," Status "),n(),a(9,"th",32),r(10," Endpoint "),n()()(),a(11,"tbody",29),f(12,Ut,9,3,"tr",30,z().trackByQueueId,!0,jt,3,0,"tr"),n()()()()),i&2){let e=m();l(12),v(e.queues())}}function Wt(i,t){i&1&&w(0,"div",34)}function Ht(i,t){i&1&&(a(0,"div",8),f(1,Wt,1,0,"div",34,k),n()),i&2&&(l(),v(Z(0,St)))}function Xt(i,t){if(i&1){let e=S();a(0,"tr",30)(1,"td",67),r(2),n(),a(3,"td",68),r(4),n(),a(5,"td",32)(6,"button",69),b("click",function(){let s=g(e).$implicit,c=m(2);return h(c.killSlowQuery(s.ID))}),r(7),n()()()}if(i&2){let e=t.$implicit,o=m(2);l(),u("title",e.INFO),l(),d(" ",e.INFO," "),l(2),d(" ",e.TIME,"s "),l(2),u("disabled",o.killingQueryId()===e.ID),l(),d(" ",o.killingQueryId()===e.ID?"...":"Kill"," ")}}function Jt(i,t){i&1&&(a(0,"tr")(1,"td",65),r(2," No slow queries. "),n()())}function Yt(i,t){if(i&1&&(a(0,"div",13)(1,"table",23)(2,"thead",24)(3,"tr")(4,"th",28),r(5,"Query"),n(),a(6,"th",33),r(7,"Time"),n(),a(8,"th",66),r(9," Kill "),n()()(),a(10,"tbody",29),f(11,Xt,8,5,"tr",30,z().trackBySlowQuery,!0,Jt,3,0,"tr"),n()()()),i&2){let e=m();l(11),v(e.slowQueries())}}function en(i,t){if(i&1&&(a(0,"tr",30)(1,"td",70),r(2),n(),a(3,"td",39),r(4),n(),a(5,"td",54),r(6),n(),a(7,"td",71),r(8),n()()),i&2){let e=t.$implicit;l(2),d(" ",e.id," "),l(2),d(" ",e.date_created," "),l(2),d(" ",e.info," "),l(2),d(" ",e.error," ")}}function tn(i,t){if(i&1&&(a(0,"tr")(1,"td",72),r(2),n()()),i&2){let e=m();l(2),d(" ",e.loading()?"Loading...":"Click Refresh to load error log."," ")}}function nn(i,t){if(i&1&&(a(0,"tr",30)(1,"td",70),r(2),n(),a(3,"td",39),r(4),n(),a(5,"td",39),r(6),n(),a(7,"td",73),r(8),n(),a(9,"td",74),r(10),n(),a(11,"td",39),r(12),n(),a(13,"td",39),r(14),n(),a(15,"td",75)(16,"span",36),r(17),n()()()),i&2){let e=t.$implicit;l(2),d(" ",e.id," "),l(2),d(" ",e.from_email," "),l(2),d(" ",e.to_list," "),l(2),d(" ",e.subject," "),l(),u("title",e.textbody),l(),d(" ",e.textbody," "),l(2),d(" ",e.date_created," "),l(2),d(" ",e.date_sent??"\u2014"," "),l(2),I(e.status==="sent"?"badge-accent":"badge-warning"),l(),d(" ",e.status," ")}}function an(i,t){if(i&1&&(a(0,"tr")(1,"td",76),r(2),n()()),i&2){let e=m();l(2),d(" ",e.loading()?"Loading...":"Click Refresh to load email queue."," ")}}function rn(i,t){if(i&1&&(a(0,"tr",30)(1,"td",70),r(2),n(),a(3,"td",73),r(4),n(),a(5,"td",39),r(6),n(),a(7,"td",39),r(8),n(),a(9,"td",39),r(10),n(),a(11,"td",77),r(12),n(),a(13,"td",74),r(14),n(),a(15,"td",32)(16,"span",36),r(17),n()()()),i&2){let e=t.$implicit;l(2),d(" ",e.id," "),l(2),d(" ",e.client_name," "),l(2),d(" ",e.channel_name," "),l(2),d(" ",e.task_name," "),l(2),d(" ",e.date_created," "),l(2),d(" ",e.execution_time!=null?e.execution_time+"ms":"\u2014"," "),l(),u("title",e.output??""),l(),d(" ",e.output??"\u2014"," "),l(2),I(e.status==="completed"?"badge-accent":e.status==="failed"?"badge-danger":"badge-info"),l(),d(" ",e.status," ")}}function on(i,t){if(i&1&&(a(0,"tr")(1,"td",76),r(2),n()()),i&2){let e=m();l(2),d(" ",e.loading()?"Loading...":"Click Refresh to load task queue."," ")}}function Me(i){return i.toISOString().split("T")[0]}var Re=class i{adminService=R(A);destroyRef=R(oe);queuesLoading=_(!0);queues=_([]);slowQueriesLoading=_(!0);slowQueries=_([]);activeChannelsLoading=_(!0);activeChannels=_([]);sipRegsLoading=_(!0);sipRegs=_([]);sipRegSearch=_("");sipRegsFiltered(){let t=this.sipRegSearch().trim().toLowerCase();return(t?this.sipRegs().filter(o=>o.reg_user.toLowerCase().includes(t)||o.realm.toLowerCase().includes(t)||o.network_ip.toLowerCase().includes(t)||o.network_proto.toLowerCase().includes(t)||(o.full_name??"").toLowerCase().includes(t)||(o.extension??"").toLowerCase().includes(t)||(o.owner_name??"").toLowerCase().includes(t)):this.sipRegs().slice()).sort((o,s)=>{let c=parseInt(o.realm)||0,y=parseInt(s.realm)||0;if(c!==y)return c-y;
3let C=parseInt(o.reg_user)||o.reg_user,P=parseInt(s.reg_user)||s.reg_user;return C<P?-1:C>P?1:0})}sipRegType(t){let e=t.url??"";return e.includes(".invalid")?"browser":e.match(/sip:[^@]+@\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/)?"hardware":"unknown"}sipRegTypeLabel(t){return{browser:"Browser",hardware:"Hardware",unknown:"Unknown"}[this.sipRegType(t)]}sipRegTypeBadge(t){return{browser:"badge-info",hardware:"badge-accent",unknown:"badge-warning"}[this.sipRegType(t)]}sipRegExpiresIn(t){return parseInt(t.expires,10)-Math.floor(Date.now()/1e3)}sipRegExpiresLabel(t){let e=this.sipRegExpiresIn(t);if(e<=0)return"Expired";let o=Math.floor(e/60),s=e%60;return`${o}m ${s}s`}ownerFromRealm(t){let e=t?.match(/^(\d+)\./);return e?e[1]:t}ringingTokens=_(new Set);ringResult=_(null);testRing(t){let e=t.token;this.ringingTokens.update(o=>new Set([...o,e])),this.ringResult.set(null),this.adminService.testRingDevice(t.reg_user,t.realm).pipe(T(this.destroyRef)).subscribe({next:o=>{this.ringingTokens.update(s=>{let c=new Set(s);return c.delete(e),c}),this.ringResult.set(o.result??"+OK")},error:()=>{this.ringingTokens.update(o=>{let s=new Set(o);return s.delete(e),s}),this.ringResult.set("-ERR request failed")}})}isRinging(t){return this.ringingTokens().has(t.token)}channelDuration(t){let e=Math.max(0,Math.floor(Date.now()/1e3)-parseInt(t,10)),o=Math.floor(e/60).toString().padStart(2,"0"),s=(e%60).toString().padStart(2,"0");return`${o}:${s}`}ownerFromChannel(t){return t.owner_name??"\u2014"}today=Me(new Date);sevenDaysAgo=Me(new Date(Date.now()-10080*60*1e3));dateStart=_(this.sevenDaysAgo);dateEnd=_(this.today);keyword=_("");loading=_(!1);errorLog=_([]);emailQueue=_([]);taskQueue=_([]);ngOnInit(){this.loadQueues(),this.loadLogs(),this.poll(()=>this.adminService.getActiveChannels(),t=>{this.activeChannels.set(t.channels??[]),this.activeChannelsLoading.set(!1)},()=>this.activeChannelsLoading.set(!1)),this.poll(()=>this.adminService.getSipRegistrations(),t=>{this.sipRegs.set(t.registrations??[]),this.sipRegsLoading.set(!1)},()=>this.sipRegsLoading.set(!1),1e4),this.poll(()=>this.adminService.getSlowQueries(),t=>{this.slowQueries.set(t.slow_queries??[]),this.slowQueriesLoading.set(!1)},()=>this.slowQueriesLoading.set(!1))}
3poll(t,e,o,s=5e3){te(ee(s).pipe(ae(0)),Y(document,"visibilitychange")).pipe(ne(()=>!document.hidden),re(()=>t().pipe(ie(()=>(o(),X)))),T(this.destroyRef)).subscribe({next:e})}loadQueues(){this.queuesLoading.set(!0),this.adminService.getQueues().pipe(T(this.destroyRef)).subscribe({next:t=>{this.queues.set(t.queues??[]),this.queuesLoading.set(!1)},error:()=>this.queuesLoading.set(!1)})}loadLogs(){let t={date_start:this.dateStart(),date_end:this.dateEnd(),keyword_search:this.keyword()||void 0};this.loading.set(!0),J([this.adminService.getErrorLog(t),this.adminService.getEmailQueue(t),this.adminService.getTaskQueue(t)]).pipe(T(this.destroyRef)).subscribe({next:([e,o,s])=>{this.errorLog.set(e.error_logs??[]),this.emailQueue.set(o.email_logs??[]),this.taskQueue.set(s.task_logs??[]),this.loading.set(!1)},error:()=>this.loading.set(!1)})}refresh(){this.loadQueues(),this.loadLogs()}toggleQueue(t){let e=t.status===1?0:1;this.adminService.toggleQueue(t.id,e).pipe(T(this.destroyRef)).subscribe({next:()=>this.loadQueues(),error:()=>this.loadQueues()})}trackById(t,e){return e.id}trackByQueueId(t,e){return e.id}trackBySlowQuery(t,e){return e.ID}killingQueryId=_(null);killSlowQuery(t){this.killingQueryId.set(t),this.adminService.killSlowQuery(t).pipe(T(this.destroyRef)).subscribe({next:()=>this.killingQueryId.set(null),error:()=>this.killingQueryId.set(null)})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=L({type:i,selectors:[["app-process-monitors-page"]],hostAttrs:[1,"block","h-full"],decls:140,vars:24,consts:[[1,"relative","h-full","flex","flex-col"],[1,"px-3","md:px-8","py-4","bg-surface-page","border-b","border-theme-default","flex-shrink-0"],[1,"font-headline","font-bold","text-4xl","text-theme-accent","mb-1"],[1,"text-theme-secondary","text-base"],[1,"flex-1","overflow-y-auto","min-h-0","px-3","md:px-8","py-6","space-y-8"],[1,"text-base","font-semibold","text-theme-primary","mb-3"],[1,"text-sm","font-normal","text-theme-secondary","ml-1"],[1,"text-xs","font-normal","text-theme-secondary","ml-2"],[1,"space-y-2"],[1,"rounded-lg","border","border-theme-default","overflow-hidden","overflow-x-auto"],[1,"mb-3","px-3","py-2","rounded","text-xs","font-mono",3,"class"],[1,"mb-3"],["type","text","placeholder","Filter by SIP user, name, IP, realm, or protocol...",1,"form-input","rounded-lg","w-full","text-sm",3,"ngModelChange","ngModel"],[1,"rounded-lg","border","border-theme-default","overflow-hidden"],[1,"grid","grid-cols-1","md:grid-cols-2","gap-6"],[1,"flex","flex-wrap","gap-3","items-end","p-4","bg-surface-elevated","rounded-lg","border","border-theme-default"],[1,"flex","flex-col","gap-1"],[1,"input-label"],["type","date",1,"input-sm","form-input","rounded-lg",3,"ngModelChange","ngModel","max"],[1,"flex","flex-col","gap-1","flex-1","min-w-40"],["type","text","placeholder","Search...",1,"form-input","rounded-lg",3,"ngModelChange","ngModel"],[1,"btn","btn-solid","btn-small",3,"click","disabled"],[1,"overflow-x-auto","rounded-lg","border","border-theme-default"],[1,"w-full","text-sm"],[1,"bg-surface-hover","text-theme-secondary","uppercase","text-xs"],[1,"px-4","py-2","text-left","w-16"],[1,"px-4","py-2","text-left","w-40"],[1,"px-4","py-2","text-left","w-48"],[1,"px-4","py-2","text-left"],[1,"divide-y","divide-theme-default"],[1,"hover:bg-surface-hover"],[1,"px-4","py-2","text-left","w-12"],[1,"px-4","py-2","text-center"],[1,"px-4","py-2","text-right"],[1,"h-10","bg-surface-hover","rounded","animate-pulse"],[1,"px-4","py-2"],[1,"badge"],[1,"px-4","py-2","text-theme-secondary","text-xs","uppercase"],[1,"px-4","py-2","text-theme-primary","text-xs","font-mono"],[1,"px-4","py-2","text-theme-secondary","text-xs"],[1,"px-4","py-2","text-xs"],[1,"px-4","py-2","text-theme-secondary","text-xs","font-mono",3,"title"],[1,"px-4","py-2","text-right","text-theme-primary","text-xs","font-mono","tabular-nums"],[1,"px-4","py-2","text-theme-secondary","text-xs","font-mono","truncate","max-w-[10rem]",3,"title"],["colspan","9",1,"px-4","py-6","text-center","text-theme-secondary","text-sm"],[1,"mb-3","px-3","py-2","rounded","text-xs","font-mono"],[1,"overflow-x-auto","overflow-y-auto","max-h-[28rem]"],[1,"bg-surface-hover","text-theme-secondary","uppercase","text-xs","
3sticky","top-0","z-10"],["title","SIP username used to register \u2014 may be an extension or a user ID",1,"px-4","py-2","text-left"],[1,"px-4","py-2","text-center","w-20"],[1,"text-theme-muted","ml-1"],[1,"text-theme-primary"],[1,"text-theme-muted"],[1,"px-4","py-2","text-theme-secondary","text-xs","truncate","max-w-[14rem]",3,"title"],[1,"px-4","py-2","text-theme-secondary","text-xs","font-mono"],[1,"px-4","py-2","text-xs","uppercase"],[1,"px-4","py-2","text-right","text-xs","font-mono","tabular-nums"],["title","Ring this device \u2014 answer to hear echo",1,"btn","btn-solid","btn-small","text-xs","px-2","py-0.5",3,"click","disabled"],[1,"text-theme-muted","text-[10px]","ml-1"],[1,"max-h-60","overflow-y-auto"],[1,"px-4","py-2","text-theme-primary"],[1,"relative","inline-flex","items-center","cursor-pointer"],["type","checkbox",1,"sr-only","peer",3,"change","checked"],[1,"w-9","h-5","bg-gray-300","rounded-full","peer","peer-checked:bg-accent-500","after:content-['']","after:absolute","after:top-0.5","after:left-0.5","after:bg-white","after:rounded-full","after:h-4","after:w-4","after:transition-all","peer-checked:after:translate-x-4"],["target","_blank","rel","noopener noreferrer",1,"text-accent","hover:underline","text-xs",3,"href"],["colspan","3",1,"px-4","py-6","text-center","text-theme-secondary","text-sm"],[1,"px-4","py-2","text-center","w-16"],[1,"px-4","py-2","text-theme-secondary","text-xs","font-mono","truncate","max-w-xs",3,"title"],[1,"px-4","py-2","text-right","text-theme-primary","font-medium"],["title","Kill this query",1,"btn","btn-danger","btn-small","text-xs","px-2","py-0.5",3,"click","disabled"],[1,"px-4","py-2","text-theme-secondary"],[1,"px-4","py-2","text-danger-600","text-xs"],["colspan","4",1,"px-4","py-6","text-center","text-theme-secondary"],[1,"px-4","py-2","text-theme-primary","text-xs"],[1,"px-4","py-2","text-theme-secondary","text-xs","max-w-xs","truncate",3,"title"],[1,"px-4","py-2","text-center","text-xs"],["colspan","8",1,"px-4","py-6","text-center","text-theme-secondary"],[1,"px-4","py-2","text-right","text-theme-secondary","text-xs"]],template:function(e,o){e&1&&(a(0,"div",0)(1,"div",1)(2,"h1",2),r(3," Process Monitors "),n(),a(4,"p",3),r(5," Queue status, slow queries, and system logs. "),n()(),a(6,"div",4),w(7,"app-za-numbers-panel"),a(8,"div")(9,"h2",5),r(10," Active Calls "),a(11,"span",6),r(12),n(),a(13,"span",7),r(14,"\xB7 auto-refreshes every 5s"),n()(),p(15,It,3,1,"div",8)(16,Mt,26,1,"div",9),n(),a(17,"div")(18,"h2",5),r(19," SIP Registrations "),a(20,"span",6),r(21),n(),a(22,"span",7),r(23,"\xB7 auto-refreshes every 10s"),n()(),p(24,Rt,2,3,"div",10),a(25,"div",11)(26,"input",12),b("ngModelChange",function(c){return o.sipRegSearch.set(c)}),n()(),p(27,Dt,3,1,"div",8)(28,qt,27,1,"div",13),n(),a(29,"div",14)(30,"div")(31,"h2",5),r(32," Queues "),a(33,"span",6),r(34),n()(),p(35,zt,3,1,"div",8)(36,Gt,15,1,"div",13),n(),a(37,"div")(38,"h2",5),r(39," Slow Queries "),a(40,"span",6),r(41),n(),a(42,"span",7),r(43,"\xB7 auto-refreshes every 5s"),n()(),p(44,Ht,3,1,"div",8)(45,Yt,14,1,"div",13),n()(),a(46,"div",15)(47,"div",16)(48,"label",17),r(49,"Start Date"),n(),a(50,"input",18),b("ngModelChange",function(c){return o.dateStart.set(c)}),n()(),a(51,"div",16)(52,"label",17),r(53,"End Date"),n(),a(54,"input",18),b("ngModelChange",function(c){return o.dateEnd.set(c)}),n()(),a(55,"div",19)(56,"label",17),r(57,"Keyword Search"),n(),a(58,"input",20),b("ngModelChange",function(c){return o.keyword.set(c)}),n()(),a(59,"button",21),b("click",function(){return o.refresh()}),r(60),n()(),a(61,"div")(62,"h2",5),r(63," Error Log "),a(64,"span",6),r(65),n()(),a(66,"div",22)(67,"table",23)(68,"thead",24)(69,"tr")(70,"th",25),r(71,"ID"),n(),a(72,"th",26),r(73," Date Logged "),n(),a(74,"th",27),r(75,"Function"),n(),a(76,"th",28),r(77,"Error"),n()()(),a(78,"tbody",29),f(79,en,9,4,"tr",30,o.trackById,!0,tn,3,1,"tr"),n()()()(),a(82,"div")(83,"h2",5),r(84," Email Out Queue "),a(85,"span",6),r(86),n()(),a(87,"div",22)(88,"table",23)(89,"thead",24)(90,"tr")(91,"th",31),r(92,"ID"),n(),a(93,"th",28),r(94,"Sender"),n(),a(95,"th",28),r(96,"To"),n(),a(97,"th",28),r(98,"Subject"),n(),a(99,"th",28),r(100,"Body Preview"),n(),a(101,"th",28),r(102,"Created"),n(),a(103,"th",28),r(104,"Sent"),n(),a(105,"th",32),r(106,"Status"),n()()(),a(107,"tbody",29),f(108,nn,18,11,"tr",30,o.trackById,!0,an,3,1,"tr"),n()()()(),a(111,"div")(112,"h2",5),r(113," Task Queue "),a(114,"span",6),r(115),n()(),a(116,"div",22)(117,"table",23)(118,"thead",24)(119,"tr")(120,"th",31),r(121,"ID"),n(),a(122,"th",28),r(123,"Client"),n(),a(124,"th",28),r(125,"Channel"),n(),a(126,"th",28),r(127,"Task"),n(),a(128,"th",28),r(129,"Created"),n(),a(130,"th",33),r(131,"Exec Time"),n(),a(132,"th",28),r(133,"Output"),n(),a(134,"th",32),r(135,"Status"),n()()(),a(136,"tbody",29),f(137,rn,18,11,"tr",30,o.trackById,!0,on,3,1,"tr"),n()()()()()()),e&2&&(l(12),d(" (",o.activeChannels().length,") "),l(3),x(o.activeChannelsLoading()?15:16),l(6),F(" (",o.sipRegsFiltered().length,"/",o.sipRegs().length,") "),l(3),x(o.ringResult()?24:-1),l(2),u("ngModel",o.sipRegSearch()),l(),x(o.sipRegsLoading()?27:28),l(7),d(" (",o.queues().length,") "),l(),x(o.queuesLoading()?35:36),l(6),d(" (",o.slowQueries().length,") "),l(3),x(o.slowQueriesLoading()?44:45),l(6),u("ngModel",o.dateStart())("max",o.today),l(4),u("ngModel",o.dateEnd())("max",o.today),l(4),u("ngModel",o.keyword()),l(),u("disabled",o.loading()),l(),d(" ",o.loading()?"Loading...":"Refresh"," "),l(5),d("(",o.errorLog().length,")"),l(14),v(o.errorLog()),l(7),d("(",o.emailQueue().length,")"),l(22),v(o.emailQueue()),l(7),d("(",o.taskQueue().length,")"),l(22),v(o.taskQueue()))},dependencies:[Ce,he,V,fe,B],encapsulation:2,changeDetection:0})};export{Re as ProcessMonitorsPageComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.