1import{a as jt,b as Pt,c as Dt}from"./chunk-QU2M6EGH.js";import{D as Bt,E as Rt,a as St,b as vt,c as At,d as q,e as wt,f as $,g as Tt,h as Lt,i as kt,l as Et,m as It,n as xt,r as B,x as Mt,y as $t}from"./chunk-QZEMLVY6.js";import"./chunk-JUDGEAWM.js";import"./chunk-UBK5EF7W.js";import"./chunk-CZTBVQUJ.js";import"./chunk-MVI4HLSY.js";import"./chunk-PU4BAJCF.js";import"./chunk-MX45D7L5.js";import"./chunk-BENDDUCM.js";import"./chunk-D7TP2RB2.js";import{c as yt}from"./chunk-QSR4XSOW.js";import{c as A,d as st}from"./chunk-ZGH3XX3D.js";import"./chunk-EYV3GWVO.js";import"./chunk-F2XU6FO6.js";import"./chunk-QRJZTPS2.js";import"./chunk-MYCFWLKL.js";import"./chunk-V7ASBT5W.js";import"./chunk-MZRJWZOV.js";import"./chunk-MWH5Q7LD.js";import"./chunk-FYEJJVAJ.js";import"./chunk-ETPYH4DV.js";import"./chunk-L6HRYWNR.js";import"./chunk-6E33DBBC.js";import"./chunk-VJX6N2HB.js";import"./chunk-H4EPMV5Z.js";import{d as x,k as h,l as nt,q as at}from"./chunk-3KNWRENG.js";import"./chunk-6PXU6RTR.js";import"./chunk-6DH3EJIN.js";import"./chunk-UZY2R5Q5.js";import"./chunk-5GAGQHFR.js";import"./chunk-RXRKGCUL.js";import"./chunk-LW7CZM4G.js";import"./chunk-EW2NZJHY.js";import"./chunk-ZIK5QK3P.js";import"./chunk-GAHMBGQ7.js";import"./chunk-UAWJ3VGL.js";import"./chunk-VT7CJSCD.js";import{a as Ct}from"./chunk-R2ER225G.js";import{C as mt,I as dt,N as ut,Q as ht,R as bt,T as ft,Y as gt,j as M,l as j,m as ct,ma as _t,n as lt,v as pt}from"./chunk-TU3JUKDL.js";import"./chunk-6JETGMQG.js";import"./chunk-VRQFSSVW.js";import"./chunk-RGZN3DMZ.js";import"./chunk-Y4544WYO.js";import"./chunk-73R64QIM.js";import"./chunk-KOEZPSOA.js";import{r as rt,t as ot}from"./chunk-ZEL44FAF.js";import"./chunk-RT33Z4W3.js";import"./chunk-CTTXKPH2.js";import"./chunk-EURTYAWN.js";import"./chunk-CT5YU3F2.js";import{i as it,j as H}from"./chunk-B5NVKW3K.js";import"./chunk-MRC2PHN7.js";import{$ as J,Cd as X,Dd as U,Ea as g,Ec as p,Fa as w,Fc as a,Gc as c,Hc as C,Ia as _,Id as tt,Jb as l,Kd as et,Qc as W,Sa as K,T as Z,Ta as V,Wb as d,Xc as u,Zc as b,bc as T,cc as L,g as S,gc as Q,ld as m,md as v,nd as I,va as f,xc as k,z as Y,zc as E}from"./chunk-77LCFR2D.js";import{a as z,b as N,l as O}from"./chunk-6G35VSEK.js";var P=(()=>{class e{constructor(t,i,r){this.activeModal=t,this.store=i,this.actionsSubj=r,this.isLoading=!1,this.destroy$=new S}ngOnInit(){this.subscribeToActions()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}subscribeToActions(){this.actionsSubj.pipe(A(It),f(this.destroy$)).subscribe(()=>{this.isLoading=!1,this.activeModal.close(!0)}),this.actionsSubj.pipe(A(xt),f(this.destroy$)).subscribe(()=>{this.isLoading=!1})}save(t){this.isLoading=!0,this.store.dispatch(Et({request:t}))}close(){this.activeModal.dismiss()}static{this.\u0275fac=function(i){return new(i||e)(d(rt),d(h),d(x))}}static{this.\u0275cmp=T({type:e,selectors:[["app-abstract-create"]],decls:6,vars:3,consts:[[1,"modal-header"],[1,"modal-title"],["variant","ghost","size","sm","ariaLabel","Close",1,"dialog-close",3,"click","iconOnly"],["name","close"],[3,"save","closeModal","isLoading","isUpdate"]],template:function(i,r){i&1&&(a(0,"div",0)(1,"h4",1),m(2,"Create abstract"),c(),a(3,"cnp-button",2),u("click",function(){return r.close()}),C(4,"cnp-icon",3),c()(),a(5,"app-abstract-form",4),u("save",function(s){return r.s
1ave(s)})("closeModal",function(){return r.close()}),c()),i&2&&(l(3),p("iconOnly",!0),l(2),p("isLoading",r.isLoading)("isUpdate",!1))},dependencies:[j,M,jt],encapsulation:2})}}return e})();var Ut=()=>["settings"],Ht=e=>["view",e],qt=e=>["../attendees",e];function Gt(e,n){if(e&1){let t=W();a(0,"cnp-bulk-bar",19),u("clear",function(){K(t);let r=b();return V(r.clearSelection())}),a(1,"cnp-button",20),u("click",function(){K(t);let r=b();return V(r.bulkDelete())}),C(2,"cnp-icon",21),m(3," Delete "),c()()}if(e&2){let t=b();p("count",t.selectedCount),l(),p("disabled",t.actionLoading)("loading",t.actionLoading)}}function Yt(e,n){if(e&1&&(a(0,"a",22),m(1),c()),e&2){let t=n.$implicit;p("routerLink",U(2,Ht,t.PK)),l(),v(t.title)}}function Zt(e,n){if(e&1&&m(0),e&2){let t=b().$implicit;I(" ",t.categoryNames," ")}}function Jt(e,n){e&1&&(a(0,"span",23),m(1,"\u2014"),c())}function Qt(e,n){if(e&1&&k(0,Zt,1,1)(1,Jt,2,0,"span",23),e&2){let t=n.$implicit;E(t.categoryNames?0:1)}}function Wt(e,n){if(e&1&&(a(0,"a",22),m(1),c()),e&2){let t=b().$implicit;p("routerLink",U(2,qt,t.submittedByPK)),l(),v(t.submittedBy)}}function Xt(e,n){if(e&1&&m(0),e&2){let t=b().$implicit;I(" ",t.submittedBy," ")}}function te(e,n){e&1&&(a(0,"span",23),m(1,"\u2014"),c())}function ee(e,n){if(e&1&&k(0,Wt,2,4,"a",22)(1,Xt,1,1)(2,te,2,0,"span",23),e&2){let t=n.$implicit;E(t.submittedByPK?0:t.submittedBy?1:2)}}function ie(e,n){if(e&1&&(m(0),tt(1,"dateFormat")),e&2){let t=n.$implicit;I(" ",et(1,1,t.dateCreated,!0)," ")}}function re(e,n){if(e&1&&(a(0,"cnp-status-pill",24),m(1),c()),e&2){let t=n.$implicit,i=b();p("tone",i.statusTones[t.status]),l(),v(i.statusLabels[t.status])}}var oe=200,G="dateCreated",ne=["title","submittedBy","status"],D=(()=>{class e{constructor(t,i,r,o,s,Kt){this.modalService=t,this.confirmService=i,this.store=r,this.actionsSubj=o,this.toastService=s,this.abstractsService=Kt,this.columns=[{key:"title",header:"Title",sortable:!0,truncate:!0},{key:"categories",header:"Categories",sortable:!0},{key:"createdBy",header:"Submitted by",sortable:!0},{key:G,header:"Submission date",sortable:!0},{key:"status",header:"Status",sortable:!0}],this.pageSizeOptions=q,this.statusLabels=vt,this.statusTones=At,this.rowKey=F=>F.PK,this.selectLabel=F=>F.title,this.isLoading=!0,this.actionLoading=!1,this.search="",this.searchTerm="",this.sort={key:G,direction:"desc"},this.page=1,this.pageSize=q[0],this.selected=new Set,this.matchedRows=[],this.rows=[],this.allRows=[],this.searchInput$=new S,this.destroy$=new S}ngOnInit(){this.actionsSubj.pipe(A(Tt,Lt),f(this.destroy$)).subscribe(()=>this.isLoading=!1),this.store.pipe(nt($t),f(this.destroy$)).subscribe(t=>this.onData(t??[])),this.searchInput$.pipe(Z(oe),Y(t=>t.trim().toLowerCase()),J(),f(this.destroy$)).subscribe(t=>this.onSearchTerm(t))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get resultCount(){let t=this.matchedRows.length;return`${t} ${t===1?"abstract":"abstracts"}`}get emptyHeading(){return this.searchTerm?"No abstracts match your search":"No abstracts yet"}get emptyDescription(){return this.searchTerm?"Try a different term, or clear the search to see every abstract.":"Abstracts your attendees submit will appear here."}get emptyActionLabel(){return this.searchTerm?"Clear search":"Create abstract"}get selectedCount(){return this.selected.size}onSearch(t){this.search=t,this.searchInput$.next(t)}onSort(t){this.sort=t,this.page=1,this.applyPage()}onPage(t){this.page=t,this.applyPage()}onPageSize(t){this.pageSize=t,this.page=1,this.applyPage()}clearSelection(){this.selected=new Set}clearSearch(){this.onSearch("")}onEmptyAction(){this.searchTerm?this.clearSearch():this.createAbstract()}createAbstract(){return O(this,null,function*(){let t=this.modalService.open(P,N(z({},wt),{backdrop:"static",size:"lg"}));try{yield t.result}catch{}})}bulkDelete(){return O(this,null,function*(){let t=this.allRows.filter(o=>this.selected.has(o.PK));if(!t.length)return;this.actionLoading=!0;let i=t.length>1?"abstracts":"abstract";if(!(yield this.confirmService.ask({heading:`Delete ${t.length} ${i}?`,consequence:"This action cannot be undone.",confirmLabel:`Delete ${i}`}))){this.actionLoading=!1;return}try{let o=yield this.abstractsService.deleteAbstracts(t.map(s=>s.source));if(o.success)this.toastService.showSuccess("Success",`Successfully deleted ${o.success} ${i}.`),this.store.dispatch($());else if(o.error)throw new Error(o.error)}catch(o){this.toastService.showDanger("Failed",`Failed to delete ${i}. ${St(o)}`)}finally{this.actionLoading=!1,this.clearSelection()}})}onSearchTerm(t){this.searchTerm=t,this.page=1,this.clearSelection(),this.applySearch()}onData(t){this.allRows=t.map(i=>this.toRow(i)),this.clearSelection(),this.applySearch()}toRow(t){let i=typeof t.createdBy=="object"?t.createdBy:null;return N(z({},t),{source:t,submittedBy:`${i?.firstName??""} ${i?.lastName??""}`.trim(),submittedByPK:i?.PK??"",categoryNames:(t.categories??[]).map(r=>r.name).join(", "),submittedAt:new Date(t.dateCreated).getTime()})}applySearch(){let t=this.searchTerm;this.matchedRows=t?this.allRows.filter(i=>ne.some(r=>(i[r]??"").toLowerCase().includes(t))):this.allRows,this.applyPage()}applyPage(){let t=this.sortRows(this.matchedRows);this.page=Math.min(this.page,Math.max(1,Math.ceil(t.length/this.pageSize)));let i=(this.page-1)*this.pageSize;this.rows=t.slice(i,i+this.pageSize)}sortRows(t){let i=this.sort;if(!i)return t;let r=i.direction==="asc"?1:-1;return[...t].sort((o,s)=>ae(this.sortValue(o,i.key),this.sortValue(s,i.key))*r)}sortValue(t,i){switch(i){case G:return t.submittedAt;case"createdBy":return t.submittedBy.toLowerCase();case"categories":return t.categoryNames.toLowerCase();default:return(t[i]??"").toString().toLowerCase()}}static{this.\u0275fac=function(i){return new(i||e)(d(ot),d(_t),d(h),d(x),d(Ct),d(Mt))}}static{this.\u0275cmp=T({type:e,selectors:[["app-abstracts"]],decls:22,vars:22,consts:[[1,"abstracts-page"],["heading","Abstracts","de
1scription","Review the abstracts your attendees have submitted."],["cnpButton","","variant","secondary",3,"routerLink"],["name","settings"],[3,"click"],["name","create"],["noun","abstract","pluralNoun","abstracts",3,"count"],[1,"abstracts-card"],["ariaLabel","Abstract filters",3,"count"],["label","Search abstracts by title, submitter or status","placeholder","Search abstracts",3,"valueChange","value"],["ariaLabel","Abstracts",3,"selectedChange","sortChange","columns","rows","rowKey","selectable","selectionBar","selectLabel","selected","sort","loading"],["cnpTableEmpty","",3,"icon","heading","description"],["cnpEmptyStatePrimary","",3,"click"],["cnpCell","title"],["cnpCell","categories"],["cnpCell","createdBy"],["cnpCell","dateCreated"],["cnpCell","status"],["noun","abstracts",3,"pageChange","pageSizeChange","total","page","pageSize","pageSizeOptions"],["noun","abstract","pluralNoun","abstracts",3,"clear","count"],["variant","danger","size","sm",3,"click","disabled","loading"],["name","delete"],[3,"routerLink"],[1,"cell-empty"],[3,"tone"]],template:function(i,r){i&1&&(a(0,"div",0)(1,"cnp-page-header",1)(2,"a",2),C(3,"cnp-icon",3),m(4," Settings "),c(),a(5,"cnp-button",4),u("click",function(){return r.createAbstract()}),C(6,"cnp-icon",5),m(7," Create abstract "),c()(),k(8,Gt,4,3,"cnp-bulk-bar",6),a(9,"div",7)(10,"cnp-toolbar",8)(11,"cnp-search-field",9),u("valueChange",function(s){return r.onSearch(s)}),c()(),a(12,"cnp-table",10),u("selectedChange",function(s){return r.selected=s})("sortChange",function(s){return r.onSort(s)}),a(13,"cnp-empty-state",11)(14,"cnp-button",12),u("click",function(){return r.onEmptyAction()}),m(15),c()(),Q(16,Yt,2,4,"ng-template",13)(17,Qt,2,1,"ng-template",14)(18,ee,3,1,"ng-template",15)(19,ie,2,4,"ng-template",16)(20,re,2,2,"ng-template",17),c(),a(21,"cnp-paginator",18),u("pageChange",function(s){return r.onPage(s)})("pageSizeChange",function(s){return r.onPageSize(s)}),c()()()),i&2&&(l(2),p("routerLink",X(21,Ut)),l(6),E(r.selectedCount?8:-1),l(2),p("count",r.resultCount),l(),p("value",r.search),l(),p("columns",r.columns)("rows",r.rows)("rowKey",r.rowKey)("selectable",!0)("selectionBar",!1)("selectLabel",r.selectLabel)("selected",r.selected)("sort",r.sort)("loading",r.isLoading),l(),p("icon",r.searchTerm?"no-results":"inbox")("heading",r.emptyHeading)("description",r.emptyDescription),l(2),v(r.emptyActionLabel),l(6),p("total",r.matchedRows.length)("page",r.page)("pageSize",r.pageSize)("pageSizeOptions",r.pageSizeOptions))},dependencies:[it,ut,j,ct,ht,gt,M,mt,ft,pt,lt,bt,dt,yt],styles:[".abstracts-page[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--cnp-space-card-gap);padding:var(--cnp-space-page-gutter-y) var(--cnp-space-page-gutter-x);background:var(--cnp-color-bg-body)}.abstracts-card[_ngcontent-%COMP%]{background:var(--cnp-color-bg-card);border-radius:var(--cnp-radius-container);box-shadow:var(--cnp-shadow-low);overflow:hidden}.cell-empty[_ngcontent-%COMP%]{color:var(--cnp-color-text-muted)}"]})}}return e})();function ae(e,n){return e<n?-1:e>n?1:0}var Ft=(()=>{class e{constructor(t){this.store=t}resolve(t,i){this.store.dispatch($()),this.store.dispatch(B())}static{this.\u0275fac=function(i){return new(i||e)(_(h))}}static{this.\u0275prov=g({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var zt=(()=>{class e{constructor(t){this.store=t}resolve(t,i){this.store.dispatch(B())}static{this.\u0275fac=function(i){return new(i||e)(_(h))}}static{this.\u0275prov=g({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var Nt=(()=>{class e{constructor(t){this.store=t}resolve(t,i){this.store.dispatch(kt({id:t.params.id}))}static{this.\u0275fac=function(i){return new(i||e)(_(h))}}static{this.\u0275prov=g({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var se=[{path:"",component:D,resolve:{abstracts:Ft}},{path:"view/:id",loadChildren:()=>import("./chunk-HQIOJ4OC.js").then(e=>e.ViewModule),resolve:{abstract:Nt}},{path:"settings",loadChildren:()=>import("./chunk-EXMRHPTV.js").then(e=>e.SettingsModule),resolve:{abstract:zt}}],Ot=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=L({type:e})}static{this.\u0275inj=w({imports:[H.forChild(se),H]})}}return e})();var We=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=L({type:e})}
1static{this.\u0275inj=w({imports:[Ot,at.forFeature("abstracts",Rt),st.forFeature([Bt]),D,Pt,P,Dt]})}}return e})();export{We as AbstractsModule};
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.