1import{f2 as f,n as l,m as a,x as n,k as p,U as g,s as r,A as v,f3 as k,T as $,f4 as y,f5 as x,f6 as R,f7 as B,f8 as A,f9 as z,fa as C,d as _,au as T,a as M,t as m,e as S}from"./indexhtml-DernGyVj.js";import{C as b}from"./cadmin-base-D1Atg8vc.js";import"./oum-dialog-confirm-BDhyA_P0.js";import"./oum-timer-Dt1owFLu.js";import"./oum-person-select-DSynm1MI.js";import"./oum-hms-editor-B09BOfWj.js";var P=Object.defineProperty,D=Object.getOwnPropertyDescriptor,u=(e,t,i,s)=>{for(var o=s>1?void 0:s?D(t,i):t,d=e.length-1,h;d>=0;d--)(h=e[d])&&(o=(s?h(t,i,o):h(o))||o);return s&&o&&P(t,i,o),o};let c=class extends b{constructor(){super(...arguments),this.rowsByClass=new Map,this.blockedByClass=new Map}loadData(){f(l.shortie).then(e=>{this.data=e,this.recalcRowsByClass()})}recalcRowsByClass(){const e=new Map,t=new Map;this.data.rows.forEach(i=>{const s=i.blockedAt?t:e,o=s.get(i.clazz.id.id)||[];o.push(i),s.set(i.clazz.id.id,o)}),this.rowsByClass=e,this.blockedByClass=t}renderTop(){return n` 2 <flex-r style="padding:var(--space-sm);align-items:center;justify-content:flex-end;width:100%"> 3 <wa-switch id="switch" 4 ?checked="${this.data?.waitlistingEnabled}" 5 @change="${e=>{this.setWaitlistEnabled(e.target.checked)}}"> 6 ${a("Waitlisting enabled")} 7 </wa-switch> 8 </flex-r> 9 `}renderContent(){return p.dataMain?n` 10 <design-centered style="height:100%;width:100%"> 11 <flex-c style="padding:var(--space-ml) 0;gap:var(--space-m);width:100%"> 12 ${p.dataMain.classesSeq.map(e=>{const t=this.blockedByClass.get(e.id.id.id)||[],i=this.rowsByClass.get(e.id.id.id)||[];return n` 13 <oum-panel .mainTitle="${e.id.name}" 14 .subTitle="${i.length>0?a(r`${i.length} waitlisted`):a("Noone waitlisted")}${t.length>0?" · "+a(r`${t.length} inactive`):""}" 15 .closeable=${!0} 16 .closed="${this.addPersonTo!=e}"> 17 <wa-button slot="top-right" 18 @click="${()=>{this.addPersonTo=e}}"> 19 <wa-icon slot="start" name="plus"></wa-icon> 20 ${a("Person")} 21 </wa-button> 22 ${this.renderRows([...i,...t])} 23 </oum-panel> 24 `})} 25 </flex-c> 26 </design-centered> 27 ${this.addPersonTo?this.renderClassAdd(this.addPersonTo):null} 28 ${this.renderRemove()} 29 ${this.renderEditBlockReason()} 30 ${this.renderBlockActive()} 31 `:g.loadingHtmlCentered()}renderClassAdd(e){return n` 32 <wa-dialog open with-header 33 label="${a("Select person")}" 34 @wa-after-hide=${()=>this.addPersonTo=void 0} 35 style="--width: ${v.mobile?"90vw":"600px"}"> 36 <oum-person-select title="${a("Select person")}" 37 style="width:100%;height:${v.mobile?"80vh":"50vh"}" 38 .targetSearcher=${"cadmin"} 39 @change="${t=>{const i=t.detail.value;i&&k(p.compMainId(),e.id.id.id,i.id.id).then(()=>{this.addPersonTo=void 0,this.loadData()})}}"> 40 </oum-person-select> 41 </wa-dialog> 42 `}renderRows(e){return n` 43 <lit-virtualizer slot="content" 44 scroller 45 .items="${e}" 46 .renderItem="${t=>{const i=e.indexOf(t),s=!!t.blockedAt,o=this.rowsByClass.get(t.clazz.id.id)||[],d=s?-1:o.indexOf(t),h=!s&&d>0,w=!s&&d>=0&&d<o.length-1;return n` 47 <flex-r style="justify-content:space-between;margin-bottom:var(--space-l);overflow:visible;padding:var(--space-sl);width:100%;opacity:${s?"0.7":"1"}"> 48 <flex-r style="gap:var(--space-m);align-items:center"> 49 ${s?null:n` 50 <flex-c style="gap:var(--space-xs)"> 51 <wa-button size="small" appearance="plain" 52 ?disabled=${!h} 53 title="${a("Move up")}" 54 @click="${()=>this.move(t,-1)}"> 55 <wa-icon name="chevron-up"></wa-icon> 56 </wa-button>
56 57 <wa-button size="small" appearance="plain" 58 ?disabled=${!w} 59 title="${a("Move down")}" 60 @click="${()=>this.move(t,1)}"> 61 <wa-icon name="chevron-down"></wa-icon> 62 </wa-button> 63 </flex-c> 64 `} 65 <flex-c style="gap:var(--space-sm)"> 66 <h3> 67 ${s?"":i+1+" "}${t.athlete.name.replaceAll(";"," ")}</h3> 68 <span class="s-desc">${t.athlete.shortie}</span> 69 ${s?n` 70 <wa-badge variant="brand" appearance="outlined" pill> 71 ${a("Inactive",{id:"inactive_single"})}${t.blockReason?": "+t.blockReason:""} 72 </wa-badge> 73 `:null} 74 </flex-c> 75 </flex-r> 76 <flex-r> 77 <flex-c> 78 <span>${a(r`Since ${$.toLocalDateTime(t.waitlistedAt,p.dataMain.zone)}`)}</span> 79 ${s?n` 80 <span>${a(r`Inactivated ${$.toLocalDateTime(t.blockedAt,p.dataMain.zone)}`)}</span> 81 `:n` 82 <span>${t.notifiedAt?a(r`Notified ${$.toLocalDateTime(t.notifiedAt,p.dataMain.zone)}`):a("Not notified")}</span> 83 ${t.notifiedAt?n` 84 <oum-timer 85 .startTime=${{epocSeconds:t.notifiedAt.epocSeconds+24*3600}} 86 .running="${!0}" 87 .includeStartStop=${!1} 88 style="font-size:24px;margin-top:var(--space-m)"> 89 </oum-timer> 90 `:null} 91 `} 92 </flex-c> 93 <wa-dropdown> 94 <wa-button appearance="plain" 95 slot="trigger"> 96 <wa-icon name="bars" label="Menu"></wa-icon> 97 </wa-button> 98 <flex-c class="wa-menu" 99 style="display:flex;flex-direction:column;gap:var(--space-l);padding:var(--space-l)"> 100 ${s?n` 101 <wa-button @click="${()=>{this.editBlockReasonFor=t}}"> 102 ${a("Edit inactivation reason")} 103 </wa-button> 104 <wa-button @click="${()=>this.unblock(t)}"> 105 ${a("Activate (return to queue)")} 106 </wa-button>
106 107 <wa-button @click="${()=>{this.toRemove=t}}"> 108 ${a("Delete row permanently")} 109 </wa-button> 110 `:n` 111 ${t.notifiedAt?null:n` 112 <p> 113 ${a("Allow registration will give the athlete a 24h window to register, even if the class is full")} 114 </p> 115 <wa-button @click="${()=>this.allowReg(t)}"> 116 ${a("Allow registration")} 117 </wa-button> 118 `} 119 <wa-button ?disabled=${!h} 120 @click="${()=>this.moveToTop(t)}"> 121 ${a("Move to top")} 122 </wa-button> 123 <wa-button ?disabled=${!w} 124 @click="${()=>this.moveToBottom(t)}"> 125 ${a("Move to bottom")} 126 </wa-button> 127 <wa-button @click="${()=>{this.blockActiveFor=t}}"> 128 ${a("Inactivate")} 129 </wa-button> 130 <wa-button @click="${()=>{this.toRemove=t}}"> 131 ${a("Remove from waitlist")} 132 </wa-button> 133 `} 134 </flex-c> 135 </wa-dropdown> 136 </flex-r> 137 </flex-r> 138 `}}" 139 style="height:${v.mobile?"75vh":"50vh"};width:100%"> 140 </lit-virtualizer> 141 `}renderEditBlockReason(){if(!this.editBlockReasonFor)return null;const e=this.editBlockReasonFor;return n` 142 <wa-dialog open with-header 143 label="${a("Edit inactivation reason")}" 144 @wa-after-hide=${()=>this.editBlockReasonFor=void 0} 145 style="--width: ${v.mobile?"90vw":"500px"}"> 146 <flex-c style="gap:var(--space-m);width:100%"> 147 <wa-input id="blockReasonInput" 148 label="${a("Inactive reason")}" 149 .value="${e.blockReason||""}" 150 placeholder="${a("Reason for inactivation")}" 151 style="width:100%"> 152 </wa-input> 153 <p class="s-desc"> 154 ${a("Leave empty and save to activate")} 155 </p> 156 </flex-c> 157 <flex-r slot="footer" style="justify-content:flex-end;gap:var(--space-m)"> 158 <wa-button @click="${()=>this.editBlockReasonFor=void 0}"> 159 ${a("Cancel")} 160 </wa-button> 161 <wa-button variant="brand" 162 @click="${()=>{const i=(this.renderRoot.querySelector("#blockReasonInput")?.value||"").trim();y(l.shortie,e.clazz.id.id,e.athlete.id.id,i).then(()=>{this.editBlockReasonFor=void 0,this.loadData()})}}"> 163 ${a("Save")} 164 </wa-button>
164 165 </flex-r> 166 </wa-dialog> 167 `}renderBlockActive(){if(!this.blockActiveFor)return null;const e=this.blockActiveFor;return n` 168 <wa-dialog open with-header 169 label="${a(r`Block ${e.athlete.name}`)}" 170 @wa-after-hide=${()=>this.blockActiveFor=void 0} 171 style="--width: ${v.mobile?"90vw":"500px"}"> 172 <flex-c style="gap:var(--space-m);width:100%"> 173 <wa-input id="blockActiveReasonInput" 174 label="${a("Inactive reason")}" 175 placeholder="${a("Reason for Inactivation")}" 176 style="width:100%"> 177 </wa-input> 178 <p class="s-desc"> 179 ${a("The athlete will be removed from the active queue but kept as a historical (inactive) row.")} 180 </p> 181 </flex-c> 182 <flex-r slot="footer" style="justify-content:flex-end;gap:var(--space-m)"> 183 <wa-button @click="${()=>this.blockActiveFor=void 0}"> 184 ${a("Cancel")} 185 </wa-button> 186 <wa-button variant="brand" 187 @click="${()=>{const i=(this.renderRoot.querySelector("#blockActiveReasonInput")?.value||"").trim();x(l.shortie,e.clazz.id.id,e.athlete.id.id,i).then(()=>{this.blockActiveFor=void 0,this.loadData()})}}"> 188 ${a("Inactivate")} 189 </wa-button> 190 </flex-r> 191 </wa-dialog> 192 `}unblock(e){R(l.shortie,e.clazz.id.id,e.athlete.id.id).then(()=>{this.loadData()})}move(e,t){const i=[...this.rowsByClass.get(e.clazz.id.id)||[]],s=i.indexOf(e),o=s+t;s<0||o<0||o>=i.length||(i.splice(s,1),i.splice(o,0,e),this.persistOrder(e.clazz.id.id,i))}moveToTop(e){const t=[...this.rowsByClass.get(e.clazz.id.id)||[]],i=t.indexOf(e);i<=0||(t.splice(i,1),t.unshift(e),this.persistOrder(e.clazz.id.id,t))}moveToBottom(e){const t=[...this.rowsByClass.get(e.clazz.id.id)||[]],i=t.indexOf(e);i<0||i===t.length-1||(t.splice(i,1),t.push(e),this.persistOrder(e.clazz.id.id,t))}persistOrder(e,t){this.rowsByClass.set(e,t),this.requestUpdate();const i=t.map(s=>s.athlete.id.id);B(l.shortie,e,i).then(()=>{this.loadData()})}renderRemove(){return this.toRemove?n` 193 <oum-dialog-confirm 194 .message="${a(r`Really remove ${this.toRemove.athlete.name}?`)}" 195 .okName="${a("Remove")}" 196 @ok=${()=>{A(l.shortie,this.toRemove.clazz.id.id,this.toRemove.athlete.id.id).then(()=>{this.loadData()}),this.toRemove=void 0}} 197 @cancel=${()=>{this.toRemove=void 0}}> 198 </oum-dialog-confirm> 199 `:null}setWaitlistEnabled(e){z(l.shortie,e).then(()=>{this.data.waitlistingEnabled=e})}allowReg(e){C(l.shortie,e.clazz.id.id,e.athlete.id.id).then(t=>{this.loadData()})}};c.styles=[_,T,b.stylesBase,M` 200 201 #cadmin-content { 202 padding: var(--space-m); 203 } 204 205 `];u([m()],c.prototype,"data",2);u([m()],c.prototype,"toRemove",2);u([m()],c.prototype,"editBlockReasonFor",2);u([m()],c.prototype,"blockActiveFor",2);u([m()],c.prototype,"addPersonTo",2);c=u([S("cadmin-people-waitlist")],c);export{c as CAdminPeopleWaitlist};
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.