Files
quiz-test/chunk-TDFJQLRV.js
2025-12-29 22:23:30 +02:00

2 lines
30 KiB
JavaScript

import{a as K,b as X,c as Y}from"./chunk-N73CTY2C.js";import{a as E,b as D,d as k,e as R,f as U,g as z}from"./chunk-YWCH6MM5.js";import{a as H,b as J}from"./chunk-N6VRXIQE.js";import{f as W,k as G,y as Q}from"./chunk-GWD5A44H.js";import{Aa as S,j as h,wa as b,ya as w,za as y}from"./chunk-COFYR5MX.js";import{Db as s,Eb as m,Gb as V,Hb as N,Ib as L,Jb as p,Kb as e,Lb as t,Mb as O,Tb as v,Xa as q,Xb as C,Za as a,Zb as c,ia as u,ib as M,ja as x,jc as I,kc as f,lc as n,mc as d,nc as _,ob as P,qc as j,rc as B,sc as F,ta as T}from"./chunk-2MUIW2M6.js";function at(i,l){i&1&&(e(0,"div",19)(1,"mat-icon"),n(2,"warning"),t(),e(3,"div",24)(4,"h4"),n(5,"Warning: Demoting Administrator"),t(),e(6,"p"),n(7,"This user will lose access to:"),t(),e(8,"ul")(9,"li"),n(10,"Admin dashboard and analytics"),t(),e(11,"li"),n(12,"User management capabilities"),t(),e(13,"li"),n(14,"System settings and configuration"),t(),e(15,"li"),n(16,"Question and category management"),t()()()())}function rt(i,l){i&1&&(e(0,"div",20)(1,"mat-icon"),n(2,"info"),t(),e(3,"div",25)(4,"h4"),n(5,"Promoting to Administrator"),t(),e(6,"p"),n(7,"This user will gain access to:"),t(),e(8,"ul")(9,"li"),n(10,"Full admin dashboard and analytics"),t(),e(11,"li"),n(12,"Manage all users and their roles"),t(),e(13,"li"),n(14,"Configure system settings"),t(),e(15,"li"),n(16,"Create and manage questions/categories"),t()()()())}function lt(i,l){if(i&1){let o=v();e(0,"div",1)(1,"div",2)(2,"mat-icon",3),n(3,"admin_panel_settings"),t(),e(4,"h2",4),n(5,"Update User Role"),t()(),e(6,"mat-dialog-content")(7,"div",5)(8,"div",6)(9,"mat-icon"),n(10,"account_circle"),t()(),e(11,"div",7)(12,"h3"),n(13),t(),e(14,"p"),n(15),t(),e(16,"div",8)(17,"span",9),n(18,"Current Role:"),t(),e(19,"span"),n(20),t()()()(),e(21,"div",10)(22,"h3",11),n(23,"Select New Role"),t(),e(24,"mat-radio-group",12),F("ngModelChange",function(g){u(o);let A=c();return B(A.selectedRole,g)||(A.selectedRole=g),x(g)}),e(25,"mat-radio-button",13)(26,"div",14)(27,"div",15)(28,"mat-icon"),n(29,"person"),t(),e(30,"span",16),n(31,"Regular User"),t()(),e(32,"p",17),n(33),t()()(),e(34,"mat-radio-button",18)(35,"div",14)(36,"div",15)(37,"mat-icon"),n(38,"admin_panel_settings"),t(),e(39,"span",16),n(40,"Administrator"),t()(),e(41,"p",17),n(42),t()()()()(),s(43,at,17,0,"div",19),s(44,rt,17,0,"div",20),t(),e(45,"mat-dialog-actions",21)(46,"button",22),C("click",function(){u(o);let g=c();return x(g.onCancel())}),n(47," Cancel "),t(),e(48,"button",23),C("click",function(){u(o);let g=c();return x(g.onNext())}),n(49," Next "),e(50,"mat-icon"),n(51,"arrow_forward"),t()()()()}if(i&2){let o=c();a(13),d(o.data.user.username),a(2),d(o.data.user.email),a(4),f("role-badge role-"+o.data.user.role),a(),_(" ",o.getRoleLabel(o.data.user.role)," "),a(4),j("ngModel",o.selectedRole),a(9),d(o.getRoleDescription("user")),a(9),d(o.getRoleDescription("admin")),a(),m(o.isDemotingAdmin?43:-1),a(),m(o.isPromotingToAdmin?44:-1),a(2),p("disabled",o.isLoading()),a(2),p("disabled",!o.hasRoleChanged||o.isLoading())}}function ct(i,l){i&1&&(e(0,"div",33)(1,"mat-icon"),n(2,"error"),t(),e(3,"p")(4,"strong"),n(5,"Important:"),t(),n(6," This action will immediately revoke all administrative privileges. The user will be logged out if currently in an admin session."),t()())}function dt(i,l){if(i&1&&(e(0,"button",35),O(1,"mat-spinner",37),n(2," Updating... "),t()),i&2){let o=c(2);p("color",o.isDemotingAdmin?"warn":"primary")("disabled",!0)}}function gt(i,l){if(i&1){let o=v();e(0,"button",38),C("click",function(){u(o);let g=c(2);return x(g.onConfirm())}),e(1,"mat-icon"),n(2,"check"),t(),n(3," Confirm Change "),t()}if(i&2){let o=c(2);p("color",o.isDemotingAdmin?"warn":"primary")}}function st(i,l){if(i&1){let o=v();e(0,"div",1)(1,"div",2)(2,"mat-icon",26),n(3,"check_circle"),t(),e(4,"h2",4),n(5,"Confirm Role Change"),t()(),e(6,"mat-dialog-content")(7,"div",27)(8,"div",28)(9,"div",29)(10,"span",30),n(11,"User:"),t(),e(12,"span",31),n(13),t()(),e(14,"div",32)(15,"mat-icon"),n(16,"arrow_downward"),t()(),e(17,"div",29)(18,"span",30),n(19,"Current Role:"),t(),e(20,"span"),n(21),t()(),e(22,"div",32)(23,"mat-icon"),n(24,"arrow_downward"),t()(),e(25,"div",29)(26,"span",30),n(27,"New Role:"),t(),e(28,"span"),n(29),t()()(),s(30,ct,7,0,"div",33),e(31,"p",34),n(32," Are you sure you want to change this user's role? "),t()()(),e(33,"mat-dialog-actions",21)(34,"button",22),C("click",function(){u(o);let g=c();return x(g.onBack())}),e(35,"mat-icon"),n(36,"arrow_back"),t(),n(37," Back "),t(),s(38,dt,3,2,"button",35)(39,gt,4,1,"button",36),t()()}if(i&2){let o=c();a(13),d(o.data.user.username),a(7),f("role-badge role-"+o.data.user.role),a(),_(" ",o.getRoleLabel(o.data.user.role)," "),a(7),f("role-badge role-"+o.selectedRole),a(),_(" ",o.getRoleLabel(o.selectedRole)," "),a(),m(o.isDemotingAdmin?30:-1),a(4),p("disabled",o.isLoading()),a(4),m(o.isLoading()?38:39)}}var Z=class i{constructor(l,o){this.dialogRef=l;this.data=o;this.selectedRole=o.user.role}selectedRole;isLoading=T(!1);showConfirmation=T(!1);get hasRoleChanged(){return this.selectedRole!==this.data.user.role}get isDemotingAdmin(){return this.data.user.role==="admin"&&this.selectedRole==="user"}get isPromotingToAdmin(){return this.data.user.role==="user"&&this.selectedRole==="admin"}getRoleLabel(l){return l==="admin"?"Administrator":"Regular User"}getRoleDescription(l){return l==="admin"?"Full access to admin panel, user management, and system settings":"Standard user access with quiz and profile management"}onNext(){if(!this.hasRoleChanged){this.dialogRef.close(null);return}this.showConfirmation.set(!0)}onBack(){this.showConfirmation.set(!1)}onConfirm(){this.dialogRef.close(this.selectedRole)}onCancel(){this.dialogRef.close(null)}static \u0275fac=function(o){return new(o||i)(M(E),M(D))};static \u0275cmp=P({type:i,selectors:[["app-role-update-dialog"]],decls:3,vars:2,consts:[[1,"role-update-dialog"],[1,"dialog-content"],[1,"dialog-header"],[1,"header-icon"],["mat-dialog-title",""],[1,"user-info"],[1,"user-avatar"],[1,"user-details"],[1,"current-role"],[1,"label"],[1,"role-selector"],[1,"selector-title"],[1,"role-options",3,"ngModelChange","ngModel"],["value","user",1,"role-option"],[1,"role-option-content"],[1,"role-option-header"],[1,"role-name"],[1,"role-description"],["value","admin",1,"role-option"],[1,"warning-box"],[1,"info-box"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],[1,"warning-content"],[1,"info-content"],[1,"header-icon","confirm"],[1,"confirmation-message"],[1,"change-summary"],[1,"change-item"],[1,"change-label"],[1,"change-value"],[1,"change-arrow"],[1,"final-warning"],[1,"confirmation-question"],["mat-raised-button","",3,"color","disabled"],["mat-raised-button","",3,"color"],["diameter","20"],["mat-raised-button","",3,"click","color"]],template:function(o,r){o&1&&(e(0,"div",0),s(1,lt,52,12,"div",1),s(2,st,40,10,"div",1),t()),o&2&&(a(),m(r.showConfirmation()?-1:1),a(),m(r.showConfirmation()?2:-1))},dependencies:[h,z,k,U,R,w,b,S,y,Y,K,X,Q,W,G,J,H],styles:[".role-update-dialog[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%]{min-width:500px;max-width:600px}.role-update-dialog[_ngcontent-%COMP%] .dialog-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;margin-bottom:16px}.role-update-dialog[_ngcontent-%COMP%] .dialog-header[_ngcontent-%COMP%] .header-icon[_ngcontent-%COMP%]{font-size:32px;width:32px;height:32px;color:var(--primary-color)}.role-update-dialog[_ngcontent-%COMP%] .dialog-header[_ngcontent-%COMP%] .header-icon.confirm[_ngcontent-%COMP%]{color:var(--success-color)}.role-update-dialog[_ngcontent-%COMP%] .dialog-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:24px;font-weight:600}.role-update-dialog[_ngcontent-%COMP%] .user-info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px;background-color:var(--bg-secondary);border-radius:8px;margin-bottom:24px}.role-update-dialog[_ngcontent-%COMP%] .user-info[_ngcontent-%COMP%] .user-avatar[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:56px;width:56px;height:56px;color:var(--primary-color)}.role-update-dialog[_ngcontent-%COMP%] .user-info[_ngcontent-%COMP%] .user-details[_ngcontent-%COMP%]{flex:1}.role-update-dialog[_ngcontent-%COMP%] .user-info[_ngcontent-%COMP%] .user-details[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 4px;font-size:18px;font-weight:600;color:var(--text-primary)}.role-update-dialog[_ngcontent-%COMP%] .user-info[_ngcontent-%COMP%] .user-details[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 8px;font-size:14px;color:var(--text-secondary)}.role-update-dialog[_ngcontent-%COMP%] .user-info[_ngcontent-%COMP%] .user-details[_ngcontent-%COMP%] .current-role[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;font-size:14px}.role-update-dialog[_ngcontent-%COMP%] .user-info[_ngcontent-%COMP%] .user-details[_ngcontent-%COMP%] .current-role[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{color:var(--text-secondary);font-weight:500}.role-update-dialog[_ngcontent-%COMP%] .role-selector[_ngcontent-%COMP%]{margin-bottom:24px}.role-update-dialog[_ngcontent-%COMP%] .role-selector[_ngcontent-%COMP%] .selector-title[_ngcontent-%COMP%]{margin:0 0 16px;font-size:16px;font-weight:600;color:var(--text-primary)}.role-update-dialog[_ngcontent-%COMP%] .role-selector[_ngcontent-%COMP%] .role-options[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px}.role-update-dialog[_ngcontent-%COMP%] .role-selector[_ngcontent-%COMP%] .role-options[_ngcontent-%COMP%] .role-option[_ngcontent-%COMP%]{padding:16px;border:2px solid var(--divider-color);border-radius:8px;transition:all .2s;width:100%}.role-update-dialog[_ngcontent-%COMP%] .role-selector[_ngcontent-%COMP%] .role-options[_ngcontent-%COMP%] .role-option[_ngcontent-%COMP%]:hover{border-color:var(--primary-color);background-color:var(--bg-secondary)}.role-update-dialog[_ngcontent-%COMP%] .role-selector[_ngcontent-%COMP%] .role-options[_ngcontent-%COMP%] .role-option.mat-radio-checked[_ngcontent-%COMP%]{border-color:var(--primary-color);background-color:var(--primary-light)}.role-update-dialog[_ngcontent-%COMP%] .role-selector[_ngcontent-%COMP%] .role-options[_ngcontent-%COMP%] .role-option[_ngcontent-%COMP%] .role-option-content[_ngcontent-%COMP%]{width:100%;margin-left:8px}.role-update-dialog[_ngcontent-%COMP%] .role-selector[_ngcontent-%COMP%] .role-options[_ngcontent-%COMP%] .role-option[_ngcontent-%COMP%] .role-option-content[_ngcontent-%COMP%] .role-option-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-bottom:8px}.role-update-dialog[_ngcontent-%COMP%] .role-selector[_ngcontent-%COMP%] .role-options[_ngcontent-%COMP%] .role-option[_ngcontent-%COMP%] .role-option-content[_ngcontent-%COMP%] .role-option-header[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--primary-color)}.role-update-dialog[_ngcontent-%COMP%] .role-selector[_ngcontent-%COMP%] .role-options[_ngcontent-%COMP%] .role-option[_ngcontent-%COMP%] .role-option-content[_ngcontent-%COMP%] .role-option-header[_ngcontent-%COMP%] .role-name[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:var(--text-primary)}.role-update-dialog[_ngcontent-%COMP%] .role-selector[_ngcontent-%COMP%] .role-options[_ngcontent-%COMP%] .role-option[_ngcontent-%COMP%] .role-option-content[_ngcontent-%COMP%] .role-description[_ngcontent-%COMP%]{margin:0;font-size:14px;color:var(--text-secondary);line-height:1.5}.role-update-dialog[_ngcontent-%COMP%] .role-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:4px 12px;border-radius:12px;font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.5px}.role-update-dialog[_ngcontent-%COMP%] .role-badge.role-user[_ngcontent-%COMP%]{background-color:var(--primary-light);color:var(--primary-color)}.role-update-dialog[_ngcontent-%COMP%] .role-badge.role-admin[_ngcontent-%COMP%]{background-color:var(--warn-light);color:var(--warn-color)}.role-update-dialog[_ngcontent-%COMP%] .warning-box[_ngcontent-%COMP%]{display:flex;gap:12px;padding:16px;background-color:var(--warn-light);border-left:4px solid var(--warn-color);border-radius:4px;margin-top:16px}.role-update-dialog[_ngcontent-%COMP%] .warning-box[_ngcontent-%COMP%] > mat-icon[_ngcontent-%COMP%]{color:var(--warn-color);flex-shrink:0}.role-update-dialog[_ngcontent-%COMP%] .warning-box[_ngcontent-%COMP%] .warning-content[_ngcontent-%COMP%]{flex:1}.role-update-dialog[_ngcontent-%COMP%] .warning-box[_ngcontent-%COMP%] .warning-content[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0 0 8px;font-size:14px;font-weight:600;color:var(--warn-dark)}.role-update-dialog[_ngcontent-%COMP%] .warning-box[_ngcontent-%COMP%] .warning-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 8px;font-size:14px;color:var(--text-primary)}.role-update-dialog[_ngcontent-%COMP%] .warning-box[_ngcontent-%COMP%] .warning-content[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{margin:0;padding-left:20px;font-size:13px;color:var(--text-secondary)}.role-update-dialog[_ngcontent-%COMP%] .warning-box[_ngcontent-%COMP%] .warning-content[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{margin-bottom:4px}.role-update-dialog[_ngcontent-%COMP%] .info-box[_ngcontent-%COMP%]{display:flex;gap:12px;padding:16px;background-color:var(--info-light);border-left:4px solid var(--info-color);border-radius:4px;margin-top:16px}.role-update-dialog[_ngcontent-%COMP%] .info-box[_ngcontent-%COMP%] > mat-icon[_ngcontent-%COMP%]{color:var(--info-color);flex-shrink:0}.role-update-dialog[_ngcontent-%COMP%] .info-box[_ngcontent-%COMP%] .info-content[_ngcontent-%COMP%]{flex:1}.role-update-dialog[_ngcontent-%COMP%] .info-box[_ngcontent-%COMP%] .info-content[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0 0 8px;font-size:14px;font-weight:600;color:var(--info-dark)}.role-update-dialog[_ngcontent-%COMP%] .info-box[_ngcontent-%COMP%] .info-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 8px;font-size:14px;color:var(--text-primary)}.role-update-dialog[_ngcontent-%COMP%] .info-box[_ngcontent-%COMP%] .info-content[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{margin:0;padding-left:20px;font-size:13px;color:var(--text-secondary)}.role-update-dialog[_ngcontent-%COMP%] .info-box[_ngcontent-%COMP%] .info-content[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{margin-bottom:4px}.role-update-dialog[_ngcontent-%COMP%] .confirmation-message[_ngcontent-%COMP%] .change-summary[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:16px;padding:24px;background-color:var(--bg-secondary);border-radius:8px;margin-bottom:24px}.role-update-dialog[_ngcontent-%COMP%] .confirmation-message[_ngcontent-%COMP%] .change-summary[_ngcontent-%COMP%] .change-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center}.role-update-dialog[_ngcontent-%COMP%] .confirmation-message[_ngcontent-%COMP%] .change-summary[_ngcontent-%COMP%] .change-item[_ngcontent-%COMP%] .change-label[_ngcontent-%COMP%]{font-size:12px;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.5px}.role-update-dialog[_ngcontent-%COMP%] .confirmation-message[_ngcontent-%COMP%] .change-summary[_ngcontent-%COMP%] .change-item[_ngcontent-%COMP%] .change-value[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:var(--text-primary)}.role-update-dialog[_ngcontent-%COMP%] .confirmation-message[_ngcontent-%COMP%] .change-summary[_ngcontent-%COMP%] .change-arrow[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--primary-color);font-size:32px;width:32px;height:32px}.role-update-dialog[_ngcontent-%COMP%] .confirmation-message[_ngcontent-%COMP%] .final-warning[_ngcontent-%COMP%]{display:flex;gap:12px;padding:16px;background-color:var(--error-light);border:2px solid var(--error-color);border-radius:8px;margin-bottom:16px}.role-update-dialog[_ngcontent-%COMP%] .confirmation-message[_ngcontent-%COMP%] .final-warning[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--error-color);flex-shrink:0}.role-update-dialog[_ngcontent-%COMP%] .confirmation-message[_ngcontent-%COMP%] .final-warning[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:14px;color:var(--text-primary);line-height:1.5}.role-update-dialog[_ngcontent-%COMP%] .confirmation-message[_ngcontent-%COMP%] .final-warning[_ngcontent-%COMP%] p[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--error-dark)}.role-update-dialog[_ngcontent-%COMP%] .confirmation-message[_ngcontent-%COMP%] .confirmation-question[_ngcontent-%COMP%]{text-align:center;font-size:16px;font-weight:600;color:var(--text-primary);margin:16px 0 0}.role-update-dialog[_ngcontent-%COMP%] mat-dialog-actions[_ngcontent-%COMP%]{padding:16px 0 0;margin:0;border-top:1px solid var(--divider-color)}.role-update-dialog[_ngcontent-%COMP%] mat-dialog-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{margin-right:4px}.role-update-dialog[_ngcontent-%COMP%] mat-dialog-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%] mat-spinner[_ngcontent-%COMP%]{display:inline-block;margin-right:8px}@media (max-width: 767px){.role-update-dialog[_ngcontent-%COMP%] .dialog-content[_ngcontent-%COMP%]{min-width:unset;max-width:unset;width:100%}.role-update-dialog[_ngcontent-%COMP%] .user-info[_ngcontent-%COMP%]{flex-direction:column;text-align:center}.role-update-dialog[_ngcontent-%COMP%] .user-info[_ngcontent-%COMP%] .user-details[_ngcontent-%COMP%]{width:100%}.role-update-dialog[_ngcontent-%COMP%] .user-info[_ngcontent-%COMP%] .user-details[_ngcontent-%COMP%] .current-role[_ngcontent-%COMP%]{justify-content:center}.role-update-dialog[_ngcontent-%COMP%] mat-dialog-actions[_ngcontent-%COMP%]{flex-direction:column;gap:8px}.role-update-dialog[_ngcontent-%COMP%] mat-dialog-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:100%}}@media (prefers-color-scheme: dark){.role-update-dialog[_ngcontent-%COMP%]{--text-primary: #e0e0e0;--text-secondary: #a0a0a0;--bg-primary: #1e1e1e;--bg-secondary: #2a2a2a;--divider-color: #404040}}"]})};function mt(i,l){if(i&1&&O(0,"img",6),i&2){let o=c();p("src",o.data.user.profilePicture,q)("alt",o.data.user.username)}}function pt(i,l){if(i&1&&(e(0,"div",7),n(1),t()),i&2){let o=c();a(),_(" ",o.data.user.username.charAt(0).toUpperCase()," ")}}function _t(i,l){i&1&&(e(0,"span"),n(1,"Reactivate Account"),t())}function Ct(i,l){i&1&&(e(0,"span"),n(1,"Deactivate Account"),t())}function ut(i,l){if(i&1&&(e(0,"span"),n(1,"Are you sure you want to activate "),e(2,"strong"),n(3),t(),n(4,"'s account?"),t()),i&2){let o=c();a(3),d(o.data.user.username)}}function xt(i,l){if(i&1&&(e(0,"span"),n(1,"Are you sure you want to deactivate "),e(2,"strong"),n(3),t(),n(4,"'s account?"),t()),i&2){let o=c();a(3),d(o.data.user.username)}}function Mt(i,l){if(i&1&&(e(0,"li"),n(1),t()),i&2){let o=l.$implicit;a(),d(o)}}function ft(i,l){i&1&&(e(0,"div",19)(1,"mat-icon"),n(2,"info"),t(),e(3,"div",23)(4,"strong"),n(5,"Note:"),t(),n(6," This is a soft delete. User data is preserved and the account can be reactivated at any time. "),t()())}function Pt(i,l){i&1&&(e(0,"div",19)(1,"mat-icon"),n(2,"check_circle"),t(),e(3,"div",23)(4,"strong"),n(5,"Note:"),t(),n(6," The user will be able to access their account immediately after activation. "),t()())}var $=class i{constructor(l,o){this.dialogRef=l;this.data=o}get actionVerb(){return this.data.action==="activate"?"Activate":"Deactivate"}get actionVerbPast(){return this.data.action==="activate"?"activated":"deactivated"}get dialogIcon(){return this.data.action==="activate"?"check_circle":"block"}get buttonColor(){return this.data.action==="activate"?"accent":"warn"}get consequences(){return this.data.action==="activate"?["User will regain access to their account","Can login and use the platform normally","All previous data will be restored","Quiz history and bookmarks remain intact"]:["User will lose access to their account immediately","Cannot login until account is reactivated","All sessions will be terminated","Data is preserved but inaccessible to user","User will not receive any notifications"]}onConfirm(){this.dialogRef.close(!0)}onCancel(){this.dialogRef.close(!1)}static \u0275fac=function(o){return new(o||i)(M(E),M(D))};static \u0275cmp=P({type:i,selectors:[["app-status-update-dialog"]],decls:47,vars:23,consts:[[1,"status-dialog"],[1,"dialog-header"],[1,"dialog-icon"],["mat-dialog-title",""],[1,"user-info"],[1,"user-avatar"],[3,"src","alt"],[1,"avatar-placeholder"],[1,"user-details"],[1,"username"],[1,"email"],[1,"role-badge"],[1,"warning-box"],[1,"warning-content"],[1,"warning-title"],[1,"warning-message"],[1,"consequences"],[1,"consequences-title"],[1,"consequences-list"],[1,"info-box"],["align","end"],["mat-button","",3,"click"],["mat-raised-button","",3,"click","color"],[1,"info-content"]],template:function(o,r){o&1&&(e(0,"div",0)(1,"div",1)(2,"mat-icon",2),n(3),t(),e(4,"h2",3),n(5),t()(),e(6,"mat-dialog-content")(7,"div",4)(8,"div",5),s(9,mt,1,2,"img",6)(10,pt,2,1,"div",7),t(),e(11,"div",8)(12,"div",9),n(13),t(),e(14,"div",10),n(15),t(),e(16,"div",11),n(17),t()()(),e(18,"div",12)(19,"mat-icon"),n(20),t(),e(21,"div",13)(22,"div",14),s(23,_t,2,0,"span")(24,Ct,2,0,"span"),t(),e(25,"div",15),s(26,ut,5,1,"span")(27,xt,5,1,"span"),t()()(),e(28,"div",16)(29,"div",17),n(30,"This action will:"),t(),e(31,"ul",18),N(32,Mt,2,1,"li",null,V),t()(),s(34,ft,7,0,"div",19)(35,Pt,7,0,"div",19),t(),e(36,"mat-dialog-actions",20)(37,"button",21),C("click",function(){return r.onCancel()}),e(38,"mat-icon"),n(39,"close"),t(),e(40,"span"),n(41,"Cancel"),t()(),e(42,"button",22),C("click",function(){return r.onConfirm()}),e(43,"mat-icon"),n(44),t(),e(45,"span"),n(46),t()()()()),o&2&&(a(),I("activate-header",r.data.action==="activate")("deactivate-header",r.data.action==="deactivate"),a(2),d(r.dialogIcon),a(2),_("",r.actionVerb," User Account"),a(4),m(r.data.user.profilePicture?9:10),a(4),d(r.data.user.username),a(2),d(r.data.user.email),a(),f("role-"+r.data.user.role.toLowerCase()),a(),_(" ",r.data.user.role," "),a(),I("activate-warning",r.data.action==="activate")("deactivate-warning",r.data.action==="deactivate"),a(2),d(r.data.action==="activate"?"info":"warning"),a(3),m(r.data.action==="activate"?23:24),a(3),m(r.data.action==="activate"?26:27),a(6),L(r.consequences),a(2),m(r.data.action==="deactivate"?34:35),a(8),p("color",r.buttonColor),a(2),d(r.dialogIcon),a(2),_("",r.actionVerb," User"))},dependencies:[h,z,k,U,R,w,b,S,y],styles:[".status-dialog[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:0;min-width:400px;max-width:550px}@media (max-width: 768px){.status-dialog[_ngcontent-%COMP%]{min-width:280px;max-width:100%}}.dialog-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;padding:24px 24px 16px;border-bottom:2px solid;margin:0 0 20px}.dialog-header[_ngcontent-%COMP%] .dialog-icon[_ngcontent-%COMP%]{font-size:32px;width:32px;height:32px}.dialog-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:24px;font-weight:600}.dialog-header.activate-header[_ngcontent-%COMP%]{border-bottom-color:var(--mat-accent-main, #00bcd4)}.dialog-header.activate-header[_ngcontent-%COMP%] .dialog-icon[_ngcontent-%COMP%], .dialog-header.activate-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{color:var(--mat-accent-main, #00bcd4)}.dialog-header.deactivate-header[_ngcontent-%COMP%]{border-bottom-color:var(--mat-warn-main, #f44336)}.dialog-header.deactivate-header[_ngcontent-%COMP%] .dialog-icon[_ngcontent-%COMP%], .dialog-header.deactivate-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{color:var(--mat-warn-main, #f44336)}mat-dialog-content[_ngcontent-%COMP%]{padding:0 24px 20px;display:flex;flex-direction:column;gap:20px;overflow-y:auto;max-height:60vh}.user-info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:16px;background-color:var(--mat-app-surface-variant, #f5f5f5);border-radius:8px}.user-info[_ngcontent-%COMP%] .user-avatar[_ngcontent-%COMP%]{flex-shrink:0}.user-info[_ngcontent-%COMP%] .user-avatar[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:56px;height:56px;border-radius:50%;object-fit:cover;border:2px solid var(--mat-app-primary, #1976d2)}.user-info[_ngcontent-%COMP%] .user-avatar[_ngcontent-%COMP%] .avatar-placeholder[_ngcontent-%COMP%]{width:56px;height:56px;border-radius:50%;background:linear-gradient(135deg,var(--mat-app-primary, #1976d2),var(--mat-app-accent, #00bcd4));color:#fff;display:flex;align-items:center;justify-content:center;font-size:24px;font-weight:600;border:2px solid var(--mat-app-primary, #1976d2)}.user-info[_ngcontent-%COMP%] .user-details[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:4px}.user-info[_ngcontent-%COMP%] .user-details[_ngcontent-%COMP%] .username[_ngcontent-%COMP%]{font-size:18px;font-weight:600;color:var(--mat-app-on-surface, #212121)}.user-info[_ngcontent-%COMP%] .user-details[_ngcontent-%COMP%] .email[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-app-on-surface-variant, #757575)}.user-info[_ngcontent-%COMP%] .user-details[_ngcontent-%COMP%] .role-badge[_ngcontent-%COMP%]{display:inline-block;padding:4px 12px;border-radius:12px;font-size:12px;font-weight:500;width:fit-content;margin-top:4px}.user-info[_ngcontent-%COMP%] .user-details[_ngcontent-%COMP%] .role-badge.role-admin[_ngcontent-%COMP%]{background-color:#ff98001a;color:#ff9800;border:1px solid rgba(255,152,0,.3)}.user-info[_ngcontent-%COMP%] .user-details[_ngcontent-%COMP%] .role-badge.role-user[_ngcontent-%COMP%]{background-color:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}@media (max-width: 768px){.user-info[_ngcontent-%COMP%]{flex-direction:column;text-align:center;gap:12px}.user-info[_ngcontent-%COMP%] .user-avatar[_ngcontent-%COMP%] img[_ngcontent-%COMP%], .user-info[_ngcontent-%COMP%] .user-avatar[_ngcontent-%COMP%] .avatar-placeholder[_ngcontent-%COMP%]{width:48px;height:48px}.user-info[_ngcontent-%COMP%] .user-avatar[_ngcontent-%COMP%] .avatar-placeholder[_ngcontent-%COMP%]{font-size:20px}.user-info[_ngcontent-%COMP%] .user-details[_ngcontent-%COMP%]{align-items:center}.user-info[_ngcontent-%COMP%] .user-details[_ngcontent-%COMP%] .username[_ngcontent-%COMP%]{font-size:16px}.user-info[_ngcontent-%COMP%] .user-details[_ngcontent-%COMP%] .email[_ngcontent-%COMP%]{font-size:13px}}.warning-box[_ngcontent-%COMP%]{display:flex;gap:12px;padding:16px;border-radius:8px;border-left:4px solid}.warning-box[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{flex-shrink:0;font-size:24px;width:24px;height:24px}.warning-box[_ngcontent-%COMP%] .warning-content[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:8px}.warning-box[_ngcontent-%COMP%] .warning-content[_ngcontent-%COMP%] .warning-title[_ngcontent-%COMP%]{font-size:16px;font-weight:600}.warning-box[_ngcontent-%COMP%] .warning-content[_ngcontent-%COMP%] .warning-message[_ngcontent-%COMP%]{font-size:14px;line-height:1.5}.warning-box[_ngcontent-%COMP%] .warning-content[_ngcontent-%COMP%] .warning-message[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:600}.warning-box.activate-warning[_ngcontent-%COMP%]{background-color:#00bcd41a;border-left-color:var(--mat-accent-main, #00bcd4)}.warning-box.activate-warning[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--mat-accent-main, #00bcd4)}.warning-box.activate-warning[_ngcontent-%COMP%] .warning-title[_ngcontent-%COMP%]{color:var(--mat-accent-dark, #0097a7)}.warning-box.activate-warning[_ngcontent-%COMP%] .warning-message[_ngcontent-%COMP%]{color:var(--mat-app-on-surface, #212121)}.warning-box.deactivate-warning[_ngcontent-%COMP%]{background-color:#f443361a;border-left-color:var(--mat-warn-main, #f44336)}.warning-box.deactivate-warning[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--mat-warn-main, #f44336)}.warning-box.deactivate-warning[_ngcontent-%COMP%] .warning-title[_ngcontent-%COMP%]{color:var(--mat-warn-dark, #d32f2f)}.warning-box.deactivate-warning[_ngcontent-%COMP%] .warning-message[_ngcontent-%COMP%]{color:var(--mat-app-on-surface, #212121)}@media (max-width: 768px){.warning-box[_ngcontent-%COMP%]{flex-direction:column;align-items:center;text-align:center}}.consequences[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px}.consequences[_ngcontent-%COMP%] .consequences-title[_ngcontent-%COMP%]{font-size:15px;font-weight:600;color:var(--mat-app-on-surface, #212121)}.consequences[_ngcontent-%COMP%] .consequences-list[_ngcontent-%COMP%]{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:8px}.consequences[_ngcontent-%COMP%] .consequences-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{font-size:14px;line-height:1.5;color:var(--mat-app-on-surface-variant, #757575)}.info-box[_ngcontent-%COMP%]{display:flex;gap:12px;padding:12px 16px;background-color:#2196f31a;border-left:4px solid var(--mat-app-primary, #1976d2);border-radius:8px}.info-box[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{flex-shrink:0;font-size:20px;width:20px;height:20px;color:var(--mat-app-primary, #1976d2)}.info-box[_ngcontent-%COMP%] .info-content[_ngcontent-%COMP%]{flex:1;font-size:13px;line-height:1.5;color:var(--mat-app-on-surface-variant, #757575)}.info-box[_ngcontent-%COMP%] .info-content[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:600;color:var(--mat-app-on-surface, #212121)}@media (max-width: 768px){.info-box[_ngcontent-%COMP%]{flex-direction:column;align-items:center;text-align:center}}mat-dialog-actions[_ngcontent-%COMP%]{padding:16px 24px;border-top:1px solid var(--mat-app-outline-variant, #e0e0e0);margin:0;gap:12px}mat-dialog-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:0 16px}mat-dialog-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}mat-dialog-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px;font-weight:500}@media (max-width: 768px){mat-dialog-actions[_ngcontent-%COMP%]{flex-direction:column-reverse;gap:8px}mat-dialog-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:100%;justify-content:center}}@media (prefers-color-scheme: dark){.user-info[_ngcontent-%COMP%]{background-color:#ffffff0d}.warning-box.activate-warning[_ngcontent-%COMP%]{background-color:#00bcd426}.warning-box.deactivate-warning[_ngcontent-%COMP%]{background-color:#f4433626}.info-box[_ngcontent-%COMP%]{background-color:#2196f326}}"]})};export{Z as a,$ as b};