Viewing File: /usr/local/cpanel/base/frontend/jupiter/manage-calendar-access/main.js

"use strict";(self.webpackChunkmanage_calendar_access=self.webpackChunkmanage_calendar_access||[]).push([[179],{8819:(m,v,i)=>{var b=i(1481),e=i(3071),M=i(5793),w=i(269),d=i(3063),Z=i(4850),x=i(2910),p=i(7709),O=i(8638);let T=(()=>{class n{constructor(t){this._uapi=t,this.delegateAdded=new e.vpe,this.getUsersRequest=new x.j({namespace:"CCS",method:"list_users",arguments:[new p.x("readonly",!0)]}),this.getDelegatesRequest=new x.j({namespace:"CCS",method:"list_delegates"})}submitUapiRequest(t){return this._uapi.post(t).pipe((0,Z.U)(a=>{if(a.success)return a.data;throw a.errors}))}getUserList(){return this.submitUapiRequest(this.getUsersRequest)}getDelegateList(){return this.submitUapiRequest(this.getDelegatesRequest)}buildAddDelegateRequest(t,a,o){return new x.j({namespace:"CCS",method:"add_delegate",arguments:[new p.h("delegator",t),new p.x("readonly",o),new p.h("delegatee",a)]})}addDelegate(t,a,o){return this.submitUapiRequest(this.buildAddDelegateRequest(t,a,o))}buildRemoveDelegateRequest(t,a){return new x.j({namespace:"CCS",method:"remove_delegate",arguments:[new p.h("delegator",t),new p.h("delegatee",a)]})}removeDelegate(t,a){return this.submitUapiRequest(this.buildRemoveDelegateRequest(t,a))}buildUpdateDelegateRequest(t,a,o){return new x.j({namespace:"CCS",method:"update_delegate",arguments:[new p.h("delegator",t),new p.h("delegatee",a),new p.x("readonly",o)]})}updateDelegate(t,a,o){return this.submitUapiRequest(this.buildUpdateDelegateRequest(t,a,o))}broadcastDelegateAdded(t){this.delegateAdded.emit(t)}}return n.\u0275fac=function(t){return new(t||n)(e.LFG(O.Tr))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function D(n,s){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(t.locale.maketext("Loading delegates \u2026"))}}function P(n,s){if(1&n&&(e.ynx(0),e.YNc(1,D,2,1,"ng-template",null,2,e.W1O),e._UZ(3,"cp-loading-spinner",3),e.BQk()),2&n){const t=e.MAs(2);e.xp6(3),e.Q6J("loadingTemplate",t)}}function A(n,s){if(1&n){const t=e.EpF();e.TgZ(0,"span",10),e.NdJ("click",function(){return e.CHM(t).sortFn()}),e._uU(1),e.qZA(),e.TgZ(2,"span",11),e.NdJ("click",function(){return e.CHM(t).sortFn()}),e._uU(3),e.qZA()}if(2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(t.locale.maketext("Calendar Owner")),e.xp6(2),e.Oqu(t.locale.maketext("Owner"))}}function J(n,s){1&n&&(e._UZ(0,"div",12),e.ALo(1,"breakEmail")),2&n&&e.Q6J("innerHTML",e.lcZ(1,1,s.row.delegator),e.oJD)}function L(n,s){1&n&&(e._UZ(0,"div",12),e.ALo(1,"breakEmail")),2&n&&e.Q6J("innerHTML",e.lcZ(1,1,s.row.delegatee),e.oJD)}function E(n,s){if(1&n&&(e.TgZ(0,"span",13),e._uU(1),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(t.locale.maketext("Permissions"))}}function q(n,s){if(1&n&&(e.TgZ(0,"span",19),e._UZ(1,"i",16)(2,"i",20),e.qZA()),2&n){const t=e.oxw(3);e.s9C("tooltip",t.locale.maketext("Create and Edit Calendar Entries")),e.Q6J("adaptivePosition",!1)}}function N(n,s){if(1&n&&(e.TgZ(0,"div",14)(1,"span",15),e._UZ(2,"i",16)(3,"i",17),e.qZA(),e.YNc(4,q,3,2,"span",18),e.qZA()),2&n){const t=s.row,a=e.oxw(2);e.xp6(1),e.s9C("tooltip",a.locale.maketext("View Calendar Entries")),e.Q6J("adaptivePosition",!1),e.xp6(3),e.Q6J("ngIf",!t.readonly)}}function Q(n,s){if(1&n&&(e.TgZ(0,"span",21),e._uU(1),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(t.locale.maketext("Actions"))}}function Y(n,s){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&n){const t=e.oxw(4);e.xp6(1),e.Oqu(t.locale.maketext("Confirm Delete"))}}function I(n,s){1&n&&e._UZ(0,"span",28)}function H(n,s){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&n){const t=e.oxw(4);e.xp6(1),e.Oqu(t.locale.maketext("Confirm"))}}function F(n,s){1&n&&e._UZ(0,"span",28)}function R(n,s){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",22)(2,"button",23),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().row;return e.oxw(2).removeDelegate(o)}),e.YNc(3,Y,2,1,"span",0),e.YNc(4,I,1,0,"span",24),e.qZA(),e.TgZ(5,"button",25,26),e.NdJ("click",function(){e.CHM(t);const o=e.MAs(6),l=e.oxw().row;return e.oxw(2).removeDelegate(l,o)}),e.YNc(7,H,2,1,"span",0),e.YNc(8,F,1,0,"span",24),e.qZA(),e.TgZ(9,"button",27),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().row;return e.oxw(2).cancelDelete(o)}),e._uU(10),e.qZA()(),e.BQk()}if(2&n){const t=e.oxw().row,a=e.oxw(2);e.xp6(2),e.Q6J("disabled",t.deleteStatus===a.deleteStatusType.inProgress),e.xp6(1),e.Q6J("ngIf",t.deleteStatus===a.deleteStatusType.confirmation),e.xp6(1),e.Q6J("ngIf",t.deleteStatus===a.deleteStatusType.inProgress),e.xp6(1),e.s9C("tooltip",a.locale.maketext("Confirm Delete")),e.Q6J("disabled",t.deleteStatus===a.deleteStatusType.inProgress)("adaptivePosition",!1),e.xp6(2),e.Q6J("ngIf",t.deleteStatus===a.deleteStatusType.confirmation),e.xp6(1),e.Q6J("ngIf",t.deleteStatus===a.deleteStatusType.inProgress),e.xp6(1),e.Q6J("disabled",t.deleteStatus===a.deleteStatusType.inProgress),e.xp6(1),e.hij(" ",a.locale.maketext("Cancel")," ")}}function j(n,s){1&n&&e._UZ(0,"span",39)}function B(n,s){1&n&&e._UZ(0,"span",40)}function z(n,s){1&n&&e._UZ(0,"span",28)}function W(n,s){1&n&&e._UZ(0,"span",39)}function K(n,s){1&n&&e._UZ(0,"span",40)}function V(n,s){1&n&&e._UZ(0,"span",28)}function X(n,s){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",29)(2,"a",30),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().row;return e.oxw(2).confirmDelete(o)}),e._UZ(3,"span",31),e.TgZ(4,"span"),e._uU(5),e.qZA()(),e.TgZ(6,"a",32,33),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().row;return e.oxw(2).confirmDelete(o)}),e._UZ(8,"span",31),e.qZA(),e.TgZ(9,"a",34),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().row;return e.oxw(2).updateDelegate(o)}),e.YNc(10,j,1,0,"span",35),e.YNc(11,B,1,0,"span",36),e.YNc(12,z,1,0,"span",24),e.TgZ(13,"span"),e._uU(14),e.qZA()(),e.TgZ(15,"a",37,38),e.NdJ("click",function(){e.CHM(t);const o=e.MAs(16),l=e.oxw().row;return e.oxw(2).updateDelegate(l,o)}),e.YNc(17,W,1,0,"span",35),e.YNc(18,K,1,0,"span",36),e.YNc(19,V,1,0,"span",24),e.qZA()(),e.BQk()}if(2&n){const t=e.oxw().row,a=e.oxw(2);e.xp6(5),e.hij("\xa0",a.locale.maketext("Delete"),""),e.xp6(1),e.s9C("tooltip",a.locale.maketext("Delete Delegate")),e.Q6J("adaptivePosition",!1),e.xp6(3),e.Q6J("disabled",!t.delegatee||t.updateStatus===a.updateStatusType.inProgress),e.xp6(1),e.Q6J("ngIf",t.readonly&&t.updateStatus===a.updateStatusType.none),e.xp6(1),e.Q6J("ngIf",!t.readonly&&t.updateStatus===a.updateStatusType.none),e.xp6(1),e.Q6J("ngIf",t.updateStatus===a.updateStatusType.inProgress),e.xp6(2),e.hij("\xa0",a.locale.maketext(t.readonly?"Allow Editing":"Disallow Editing"),""),e.xp6(1),e.s9C("tooltip",a.locale.maketext("Toggle Editing Permission")),e.Q6J("disabled",!t.delegatee||t.updateStatus===a.updateStatusType.inProgress)("adaptivePosition",!1),e.xp6(2),e.Q6J("ngIf",t.readonly&&t.updateStatus===a.updateStatusType.none),e.xp6(1),e.Q6J("ngIf",!t.readonly&&t.updateStatus===a.updateStatusType.none),e.xp6(1),e.Q6J("ngIf",t.updateStatus===a.updateStatusType.inProgress)}}function G(n,s){if(1&n&&(e.YNc(0,R,11,10,"ng-container",0),e.YNc(1,X,20,14,"ng-container",0)),2&n){const t=s.row,a=e.oxw(2);e.Q6J("ngIf",t.deleteStatus>0),e.xp6(1),e.Q6J("ngIf",t.deleteStatus===a.deleteStatusType.none)}}const $=function(){return{prop:"delegator",dir:"asc"}},ee=function(n){return[n]},te=function(n){return{emptyMessage:n}};function ne(n,s){if(1&n&&(e.TgZ(0,"ngx-datatable",4)(1,"ngx-datatable-column",5),e.YNc(2,A,4,2,"ng-template",6),e.YNc(3,J,2,3,"ng-template",7),e.qZA(),e.TgZ(4,"ngx-datatable-column",8),e.YNc(5,L,2,3,"ng-template",7),e.qZA(),e.TgZ(6,"ngx-datatable-column",9),e.YNc(7,E,2,1,"ng-template",6),e.YNc(8,N,5,3,"ng-template",7),e.qZA(),e.TgZ(9,"ngx-datatable-column"),e.YNc(10,Q,2,1,"ng-template",6),e.YNc(11,G,2,2,"ng-template",7),e.qZA()()),2&n){const t=e.oxw();e.Q6J("rows",t.delegates)("headerHeight",10)("columnMode","force")("reorderable",!1)("rowHeight","auto")("sortType","single")("sorts",e.VKq(14,ee,e.DdM(13,$)))("messages",e.VKq(16,te,t.locale.maketext("No delegates exist."))),e.xp6(1),e.Q6J("sortable",!0),e.xp6(3),e.s9C("name",t.locale.maketext("Delegate")),e.xp6(2),e.Q6J("max-width",130)("min-width",110)("width",110)}}var c=(()=>{return(n=c||(c={}))[n.none=0]="none",n[n.confirmation=1]="confirmation",n[n.inProgress=2]="inProgress",c;var n})(),_=(()=>{return(n=_||(_={}))[n.none=0]="none",n[n.inProgress=1]="inProgress",_;var n})(),g=(()=>{return(n=g||(g={}))[n.completelyNew=0]="completelyNew",n[n.updated=1]="updated",n[n.notAdded=2]="notAdded",g;var n})();let ae=(()=>{class n{transform(t){return t?t.replace(/\@/g,"@<wbr>").replace(/\./g,"<wbr>."):""}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275pipe=e.Yjl({name:"breakEmail",type:n,pure:!0}),n})(),k=(()=>{class n{constructor(t,a,o){this._calendarService=t,this.locale=a,this._alertService=o,this.subscriptions=[],this.delegates=[],this.usersForDisplay=[],this.deleteStatusType=c,this.updateStatusType=_,this.loadingDelegates=!0}ngOnInit(){this.subscriptions.push(this._calendarService.getDelegateList().subscribe(t=>{this.setDelegateList(t)})),this.subscriptions.push(this._calendarService.delegateAdded.subscribe(t=>{const a=this.addDelegate(t);if(a===g.completelyNew){const o=this.locale.maketext("Successfully added user \u201c[_1]\u201d as a calendar delegate of user \u201c[_2]\u201d.",t.delegatee,t.delegator);this._alertService.success(o)}else if(a!==g.updated||t.readonly)if(a===g.updated&&t.readonly){const o=this.locale.maketext("Successfully removed user \u201c[_1]\u201d as a calendar editor of user \u201c[_2]\u201d.",t.delegatee,t.delegator);this._alertService.success(o)}else{const o=this.locale.maketext("User \u201c[_1]\u201d is already a calendar delegate for user \u201c[_2]\u201d.",t.delegatee,t.delegator);this._alertService.info(o)}else{const o=this.locale.maketext("Successfully added user \u201c[_1]\u201d as a calendar editor of user \u201c[_2]\u201d.",t.delegatee,t.delegator);this._alertService.success(o)}}))}ngOnDestroy(){for(const t in this.subscriptions)this.subscriptions[t]&&this.subscriptions[t].unsubscribe();this.subscriptions=[]}addDelegate(t){const a=this.delegates.findIndex(o=>o.delegator===t.delegator&&o.delegatee===t.delegatee);return-1===a?(this.delegates.push(t),this.delegates=this.delegates.slice(),g.completelyNew):this.delegates[a].readonly!==t.readonly?(this.delegates[a].readonly=t.readonly,g.updated):g.notAdded}setDelegateList(t){this.delegates=t;for(const a of this.delegates)a.deleteStatus=c.none,a.updateStatus=_.none;this.loadingDelegates=!1}reportSuccessfulRemoval(t){const a=this.locale.maketext("Successfully removed user \u201c[_1]\u201d as a calendar delegate for \u201c[_2]\u201d.",t.delegatee,t.delegator);this._alertService.success(a)}removeDelegate(t,a){t.deleteStatus=c.inProgress;const o=this._calendarService.removeDelegate(t.delegator,t.delegatee);let l=null;l=o.subscribe(r=>{},r=>{this.reportFailure(r[0].message),t.deleteStatus=c.none,a&&setTimeout(()=>{a.hide()},400),l&&l.unsubscribe()},()=>{const r=this.delegates.indexOf(t);this.delegates.splice(r,1),this.delegates=this.delegates.slice(),this.reportSuccessfulRemoval(t),t.deleteStatus=c.none,a&&setTimeout(()=>{a.hide()},400),l&&l.unsubscribe()})}reportSuccessfulUpdate(t){const a=this.locale.maketext("Successfully updated edit privileges for delegate \u201c[_1]\u201d to \u201c[_2]\u201c.",t.delegatee,t.readonly?"disallowed":"allowed");this._alertService.success(a)}reportFailure(t){this._alertService.error(t)}updateDelegate(t,a){const o=t.readonly;t.updateStatus=_.inProgress;const l=this._calendarService.updateDelegate(t.delegator,t.delegatee,!t.readonly);let r=null;r=l.subscribe(S=>{},S=>{this.reportFailure(S[0].message),t.updateStatus=_.none,a&&setTimeout(()=>{a.hide()},400),r&&r.unsubscribe()},()=>{t.readonly=!o,this.reportSuccessfulUpdate(t),t.updateStatus=_.none,a&&setTimeout(()=>{a.hide()},400),r&&r.unsubscribe()})}cancelDelete(t){t.deleteStatus=c.none}confirmDelete(t){t.deleteStatus=c.confirmation}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(T),e.Y36(w.g),e.Y36(d.c9))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cp-ccs-delegates-list"]],decls:6,vars:3,consts:[[4,"ngIf"],["class","bootstrap",3,"rows","headerHeight","columnMode","reorderable","rowHeight","sortType","sorts","messages",4,"ngIf"],["delegatesLoadingMsg",""],["id","delegatesLoadingMsg",3,"loadingTemplate"],[1,"bootstrap",3,"rows","headerHeight","columnMode","reorderable","rowHeight","sortType","sorts","messages"],["prop","delegator",3,"sortable"],["ngx-datatable-header-template",""],["ngx-datatable-cell-template",""],["prop","delegatee",3,"name"],["prop","readonly",3,"max-width","min-width","width"],["id","ownerLabel",1,"datatable-header-cell-label","draggable",3,"click"],["id","ownerLabelShort",1,"datatable-header-cell-label","draggable",3,"click"],[1,"allowWrap",3,"innerHTML"],["id","permissionsLabel"],[1,"modifyProperty"],["placement","top","container","body",1,"fa-stack","fa-1x","pencil-stack",3,"tooltip","adaptivePosition"],[1,"far","fa-calendar","fa-stack-2x"],[1,"fas","fa-eye","fa-stack-1x","eye"],["class","fa-stack fa-1x pencil-stack","placement","top","container","body",3,"adaptivePosition","tooltip",4,"ngIf"],["placement","top","container","body",1,"fa-stack","fa-1x","pencil-stack",3,"adaptivePosition","tooltip"],[1,"fas","fa-pencil-alt","fa-stack-1x","pencil"],["id","actionsLabel"],[1,"actionsContainerCell"],["id","deleteDelBtn",1,"btn","btn-danger","btn-delete-big",3,"disabled","click"],["class","fas fa-sync fa-spin",4,"ngIf"],["id","deleteDelBtnSmall","triggers","click","placement","left","container","body",1,"btn","btn-danger","btn-delete-small",3,"disabled","tooltip","adaptivePosition","click"],["confirmTT","bs-tooltip"],["id","cancelDelButton",1,"btn","btn-link",3,"disabled","click"],[1,"fas","fa-sync","fa-spin"],[1,"actionsContainerCellDefault"],[1,"btn","btn-outline-primary","btn-sm","btn-delete-big",3,"click"],[1,"far","fa-trash-alt"],["triggers","click","placement","left","container","body",1,"btn","btn-outline-primary","btn-sm","btn-delete-small",3,"tooltip","adaptivePosition","click"],["deleteTT","bs-tooltip"],[1,"btn","btn-outline-primary","btn-sm","btn-allow-disallow-big",3,"disabled","click"],["class","far fa-calendar",4,"ngIf"],["class","far fa-calendar-alt",4,"ngIf"],["triggers","click","placement","left","container","body","delay","5",1,"btn","btn-outline-primary","btn-sm","btn-allow-disallow-small",3,"disabled","tooltip","adaptivePosition","click"],["permsTT","bs-tooltip"],[1,"far","fa-calendar"],[1,"far","fa-calendar-alt"]],template:function(t,a){1&t&&(e.TgZ(0,"div"),e._UZ(1,"cp-ccs-delegation-editor"),e.TgZ(2,"h4"),e._uU(3),e.qZA(),e.YNc(4,P,4,1,"ng-container",0),e.YNc(5,ne,12,18,"ngx-datatable",1),e.qZA()),2&t&&(e.xp6(3),e.Oqu(a.locale.maketext("Calendar Delegates")),e.xp6(1),e.Q6J("ngIf",a.loadingDelegates),e.xp6(1),e.Q6J("ngIf",!a.loadingDelegates))},styles:["#actionsLabel[_ngcontent-%COMP%]{display:inline-block;margin-left:15px}[_nghost-%COMP%]     .datatable-header-cell{font-size:14px!important;font-weight:700}.actionsContainerCell[_ngcontent-%COMP%]{padding-left:15px}.actionsContainerCellDefault[_ngcontent-%COMP%]{padding-left:10px}#deleteDelBtn[_ngcontent-%COMP%]{min-width:131px;text-align:center}#deleteDelBtnSmall[_ngcontent-%COMP%]{min-width:88px}.btn-delete-big[_ngcontent-%COMP%]{display:inline-block}.btn-delete-small[_ngcontent-%COMP%]{display:none;font-size:14px}.btn-allow-disallow-big[_ngcontent-%COMP%]{min-width:145px;text-align:left;display:inline-block}.btn-allow-disallow-small[_ngcontent-%COMP%]{min-width:0;width:auto;text-align:left;display:none;font-size:14px}h4[_ngcontent-%COMP%]{font-weight:600}.permissions[_ngcontent-%COMP%]{max-width:120px}.allowWrap[_ngcontent-%COMP%]{overflow-wrap:break-word}.actionButtonLabel[_ngcontent-%COMP%]{display:inline}.buttonInfo[_ngcontent-%COMP%]{display:none}@media (max-width: 675px){.btn-delete-small[_ngcontent-%COMP%]{display:inline-block}.btn-delete-big[_ngcontent-%COMP%], .btn-allow-disallow-big[_ngcontent-%COMP%]{display:none}.btn-allow-disallow-small[_ngcontent-%COMP%]{display:inline-block}}#ownerLabelShort[_ngcontent-%COMP%]{display:none}#permissionLabel[_ngcontent-%COMP%]{display:block}@media (max-width: 420px){#ownerLabel[_ngcontent-%COMP%]{display:none}#ownerLabelShort[_ngcontent-%COMP%]{display:inline-block;width:auto}.modifyProperty[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{margin-bottom:4px}#deleteDelBtnSmall[_ngcontent-%COMP%]{min-width:64px;font-size:12px;padding-left:5px;padding-right:5px}#cancelDelButton[_ngcontent-%COMP%]{font-size:12px}}@media (max-width: 300px){#deleteDelBtnSmall[_ngcontent-%COMP%]{min-width:40px;font-size:10px;padding-left:3px;padding-right:3px}#cancelDelButton[_ngcontent-%COMP%]{font-size:10px}}@media (max-width: 510px){#permissionsLabel[_ngcontent-%COMP%]{display:none}}"]}),n})(),oe=(()=>{class n{constructor(t){this.locale=t,this.title="Calendar Delegation"}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(w.g))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cp-ccs-root"]],decls:9,vars:2,consts:[["id","page-intro"],[3,"innerHTML"],["href","https://go.cpanel.net/calendar-delegation","target","_blank","aria-hidden","true",1,"no-decoration"],[1,"fas","fa-external-link-alt"],["position","top-right"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0)(1,"p"),e._uU(2),e._UZ(3,"span",1),e.TgZ(4,"a",2),e._uU(5,"\xa0"),e._UZ(6,"span",3),e.qZA()()(),e._UZ(7,"cp-alert-list",4)(8,"cp-ccs-delegates-list")),2&t&&(e.xp6(2),e.hij(" ",a.locale.maketext("This interface allows you to delegate access rights for a user\u2019s calendar to other users. This is useful for people needing to manage other people\u2019s calendars or manage resources such as conference rooms.")," "),e.xp6(1),e.Q6J("innerHTML",a.locale.maketext("Want to learn more? Read our [output,url,_1,documentation,class,externalLink,target,_2,id,_3].","//go.cpanel.net/calendar-delegation","_blank","lnkCalendarDelegationDocumentation"),e.oJD))},directives:[d.hF,k],styles:["#page-intro[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{font-size:16px;margin-bottom:20px}.no-decoration[_ngcontent-%COMP%]{text-decoration:none}"]}),n})();var se=i(348),f=i(3647),U=i(976),y=i(7322),h=i(6895),C=i(4719);function le(n,s){if(1&n){const t=e.EpF();e.TgZ(0,"cp-callout",2)(1,"span",3),e._uU(2),e.qZA(),e.TgZ(3,"p"),e._uU(4),e.qZA(),e.TgZ(5,"button",4),e.NdJ("click",function(){return e.CHM(t),e.oxw().gotoAccounts()}),e._uU(6),e.qZA()()}if(2&n){const t=e.oxw();e.xp6(2),e.Oqu(t.locale.maketext("No Additional Email Account Exists")),e.xp6(2),e.hij(" ",t.locale.maketext("To create calendar delegates, you must create an additional email account.")," "),e.xp6(2),e.hij(" ",t.locale.maketext("Create Email Account")," ")}}function ie(n,s){if(1&n&&(e.TgZ(0,"ng-option",21),e._uU(1),e.qZA()),2&n){const t=s.$implicit,a=e.oxw(2);e.Q6J("value",t)("disabled",a.delegatee&&t===a.delegatee),e.xp6(1),e.hij(" ",t," ")}}function re(n,s){if(1&n&&(e.TgZ(0,"ng-option",21),e._uU(1),e.qZA()),2&n){const t=s.$implicit,a=e.oxw(3);e.Q6J("value",t)("disabled",a.delegator&&t===a.delegator),e.xp6(1),e.hij(" ",t," ")}}function ce(n,s){if(1&n){const t=e.EpF();e.TgZ(0,"ng-select",11),e.NdJ("ngModelChange",function(o){return e.CHM(t),e.oxw(2).delegatee=o}),e.YNc(1,re,2,3,"ng-option",12),e.qZA()}if(2&n){const t=e.oxw(2);e.s9C("placeholder",t.locale.maketext("Select Delegate")),e.Q6J("ngModel",t.delegatee),e.xp6(1),e.Q6J("ngForOf",t.availableUsers)}}function de(n,s){1&n&&e._UZ(0,"span",22)}function pe(n,s){1&n&&e._UZ(0,"span",23)}function _e(n,s){if(1&n){const t=e.EpF();e.TgZ(0,"div",5)(1,"div",6)(2,"h3",7),e._uU(3),e.qZA()(),e.TgZ(4,"div",8)(5,"div",9)(6,"div",10)(7,"ng-select",11),e.NdJ("ngModelChange",function(o){return e.CHM(t),e.oxw().delegator=o}),e.YNc(8,ie,2,3,"ng-option",12),e.qZA()(),e.TgZ(9,"div",10),e.YNc(10,ce,2,3,"ng-select",13),e.qZA(),e.TgZ(11,"div",14)(12,"label",15)(13,"input",16),e.NdJ("ngModelChange",function(o){return e.CHM(t),e.oxw().allowEditing=o}),e.qZA(),e.TgZ(14,"span"),e._uU(15),e.qZA()()(),e.TgZ(16,"div",10)(17,"button",17),e.NdJ("click",function(){return e.CHM(t),e.oxw().addDelegate()}),e.YNc(18,de,1,0,"span",18),e.YNc(19,pe,1,0,"span",19),e._uU(20),e.qZA(),e.TgZ(21,"button",20),e.NdJ("click",function(){return e.CHM(t),e.oxw().resetData()}),e._uU(22),e.qZA()()()()()}if(2&n){const t=e.oxw();e.xp6(3),e.Oqu(t.locale.maketext("Create Delegate")),e.xp6(4),e.s9C("placeholder",t.locale.maketext("Select Calendar Owner")),e.Q6J("ngModel",t.delegator),e.xp6(1),e.Q6J("ngForOf",t.availableUsers),e.xp6(2),e.Q6J("ngIf",t.availableUsers.length>1),e.xp6(3),e.Q6J("ngModel",t.allowEditing),e.xp6(2),e.hij(" ",t.locale.maketext("Allow Editing"),""),e.xp6(2),e.Q6J("disabled",t.addStatus!==t.addStatusType.none||!t.delegator||!t.delegatee||1===t.availableUsers.length),e.xp6(1),e.Q6J("ngIf",t.addStatus===t.addStatusType.none),e.xp6(1),e.Q6J("ngIf",t.addStatus===t.addStatusType.inProgress),e.xp6(1),e.hij(" ",t.locale.maketext("Create")," "),e.xp6(1),e.Q6J("disabled",t.addStatus!==t.addStatusType.none),e.xp6(1),e.hij(" ",t.locale.maketext("Reset")," ")}}var u=(()=>{return(n=u||(u={}))[n.none=0]="none",n[n.inProgress=1]="inProgress",u;var n})();let ge=(()=>{class n{constructor(t,a,o,l){this._alertService=t,this._calendarService=a,this.locale=o,this._document=l,this.allowEditing=!1,this.loadingUsers=!0,this.subscriptions=[],this.availableUsers=[],this.addStatus=u.none,this.addStatusType=u}ngOnInit(){this.subscriptions.push(this._calendarService.getUserList().subscribe(t=>{this.availableUsers=Object.keys(t).sort((a,o)=>a.localeCompare(o)),this.loadingUsers=!1}))}ngOnDestroy(){for(const t in this.subscriptions)this.subscriptions[t]&&this.subscriptions[t].unsubscribe();this.subscriptions=[]}reportSuccessfulAdd(){this._calendarService.broadcastDelegateAdded(this.buildDelegate())}reportFailure(t){this._alertService.error(t)}addDelegate(){this.addStatus=u.inProgress;const t=this._calendarService.addDelegate(this.delegator,this.delegatee,!this.allowEditing);let a=null;a=t.subscribe(o=>{},o=>{this.reportFailure(o[0].message),this.addStatus=u.none,a&&a.unsubscribe()},()=>{this.reportSuccessfulAdd(),this.addStatus=u.none,this.resetData(),a&&a.unsubscribe()})}buildDelegate(){return{delegatee:this.delegatee,delegator:this.delegator,readonly:!this.allowEditing,deleteStatus:c.none,updateStatus:_.none}}resetData(){this.delegator=null,this.delegatee=null,this.allowEditing=!1}gotoAccounts(){this._document.location.href="../email_accounts/index.html#/create"}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(d.c9),e.Y36(T),e.Y36(w.g),e.Y36(h.K0))},n.\u0275cmp=e.Xpm({type:n,selectors:[["cp-ccs-delegation-editor"]],decls:2,vars:2,consts:[["id","notEnoughUsersInfo",4,"ngIf"],["class","panel panel-primary",4,"ngIf"],["id","notEnoughUsersInfo"],["callout-heading",""],[1,"btn","btn-primary",3,"click"],[1,"panel","panel-primary"],[1,"panel-heading"],[1,"panel-title"],[1,"panel-body"],["id","delegateEditor",1,"row"],[1,"col-md-3"],[3,"placeholder","ngModel","ngModelChange"],[3,"value","disabled",4,"ngFor","ngForOf"],[3,"placeholder","ngModel","ngModelChange",4,"ngIf"],["id","allowEditingCell",1,"col-md-3"],["id","labelOfHate"],["type","checkbox","id","checkboxOfEvil",3,"ngModel","ngModelChange"],["type","button","id","createDelButton",1,"btn","btn-primary",3,"disabled","click"],["class","fas fa-plus",4,"ngIf"],["class","fas fa-sync fa-spin",4,"ngIf"],["type","button",1,"btn","btn-link",3,"disabled","click"],[3,"value","disabled"],[1,"fas","fa-plus"],[1,"fas","fa-sync","fa-spin"]],template:function(t,a){1&t&&(e.YNc(0,le,7,3,"cp-callout",0),e.YNc(1,_e,23,13,"div",1)),2&t&&(e.Q6J("ngIf",1===a.availableUsers.length),e.xp6(1),e.Q6J("ngIf",a.availableUsers.length>1))},directives:[h.O5,d.Oc,y.w9,C.JJ,C.On,h.sg,y.jq,C.Wl],styles:["#editorContainer[_ngcontent-%COMP%]{padding-top:8px;padding-bottom:8px}#allowEditingCheckbox[_ngcontent-%COMP%]{display:inline-block}#allowEditingCell[_ngcontent-%COMP%]{padding-left:0;padding-right:0;display:flex;align-items:center;padding-top:4px;height:36px}#labelOfHate[_ngcontent-%COMP%]{display:flex;align-items:center}#labelOfHate[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{display:inline-block;padding-left:3px;padding-right:3px;vertical-align:middle}#checkboxOfEvil[_ngcontent-%COMP%]{margin-top:0}#createDelButton[_ngcontent-%COMP%]{width:92px}@media (max-width: 1000px){#allowEditingCell[_ngcontent-%COMP%]{padding-left:16px;padding-right:16px;margin-bottom:10px}.ng-select[_ngcontent-%COMP%]{margin-bottom:10px}}"]}),n})(),ue=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n,bootstrap:[oe]}),n.\u0275inj=e.cJS({providers:[T],imports:[[b.b2,d.Sw,d.nM,d.zf,d.CQ,f.xD,M.JF,U.z8.forRoot(),y.A0,C.u5,d.df,se.m]]}),n})();e.B6R(k,[ge,h.O5,d.go,f.nE,f.UC,f.tk,f.vq,U.i9],[ae]),(0,e.G48)(),b.q6().bootstrapModule(ue).catch(n=>console.error(n))}},m=>{m.O(0,[736],()=>m(m.s=8819)),m.O()}]);
Back to Directory File Manager