"use strict";(self.webpackChunkworklenz=self.webpackChunkworklenz||[]).push([[940],{94940:(b,d,o)=>{o.r(d),o.d(d,{NotificationSettingsModule:()=>T});var v=o(96814),c=o(35420),g=o(15861),u=o(86408),h=o(27782),n=o(65879),y=o(90586),S=o(16849),k=o(85080),p=o(82962),f=o(24139),m=o(62612),C=o(8083),z=o(66987);const N=function(){return{rows:6}},Z=[{path:"",component:(()=>{var i;class l{constructor(e,t,a,s){this.app=e,this.api=t,this.settingsService=a,this.ngZone=s,this.loading=!1,this.updating=!1,this.model={},this.app.setTitle("Notification Settings"),u.s.track(h.le)}ngOnInit(){this.get()}get(){var e=this;return(0,g.Z)(function*(){try{e.loading=!0;const t=yield e.api.getNotificationSettings();t.done&&(e.model=t.body),e.loading=!1}catch{e.loading=!1}})()}update(){var e=this;return(0,g.Z)(function*(){try{e.updating=!0;const t=yield e.api.updateNotificationSettings(e.model);t.done&&(e.model=t.body,u.s.track(h.uf,e.model),e.settingsService.settings=t.body),e.updating=!1}catch{e.updating=!1}})()}updateSettings(){this.updating||this.update()}requestPermissions(){this.model.popup_notifications_enabled&&"default"===Notification.permission&&this.askNotificationPermission()}askNotificationPermission(){this.ngZone.runOutsideAngular(()=>{"Notification"in window?Notification.requestPermission():console.log("This browser does not support notifications.")})}}return(i=l).\u0275fac=function(e){return new(e||i)(n.Y36(y.z),n.Y36(S.G),n.Y36(k.g),n.Y36(n.R0b))},i.\u0275cmp=n.Xpm({type:i,selectors:[["worklenz-notification-settings"]],decls:29,vars:8,consts:[[3,"nzActive","nzLoading","nzParagraph"],["nz-checkbox","",1,"d-flex","align-items-baseline","mb-2",3,"nzChecked","nzCheckedChange"],["nz-typography","",1,"mb-0"],["nz-typography","","nzType","secondary",1,"mb-0"],[1,"my-3"]],template:function(e,t){1&e&&(n.TgZ(0,"nz-card")(1,"nz-skeleton",0),n.ynx(2),n.TgZ(3,"label",1),n.NdJ("nzCheckedChange",function(s){return t.model.email_notifications_enabled=s})("nzCheckedChange",function(){return t.updateSettings()}),n.TgZ(4,"h4",2),n._uU(5,"Send me email notifications"),n.qZA()(),n.TgZ(6,"p",3),n._uU(7," This includes new task assignments. "),n.qZA(),n._UZ(8,"nz-divider",4),n.BQk(),n.ynx(9),n.TgZ(10,"label",1),n.NdJ("nzCheckedChange",function(s){return t.model.daily_digest_enabled=s})("nzCheckedChange",function(){return t.updateSettings()}),n.TgZ(11,"h4",2),n._uU(12,"Send me a daily digest"),n.qZA()(),n.TgZ(13,"p",3),n._uU(14," Every evening, you will receive a summary of recent activity in tasks. "),n.qZA(),n._UZ(15,"nz-divider",4),n.BQk(),n.ynx(16),n.TgZ(17,"label",1),n.NdJ("nzCheckedChange",function(s){return t.model.popup_notifications_enabled=s})("nzCheckedChange",function(){return t.updateSettings(),t.requestPermissions()}),n.TgZ(18,"h4",2),n._uU(19,"Pop up notifications on my computer when Worklenz is open"),n.qZA()(),n.TgZ(20,"p",3),n._uU(21," Pop up notifications can be disabled by your browser. Change your browser settings to allow them. "),n.qZA(),n._UZ(22,"nz-divider",4),n.BQk(),n.ynx(23),n.TgZ(24,"label",1),n.NdJ("nzCheckedChange",function(s){return t.model.show_unread_items_count=s})("nzCheckedChange",function(){return t.updateSettings()}),n.TgZ(25,"h4",2),n._uU(26,"Show the number of unread items"),n.qZA()(),n.TgZ(27,"p",3),n._uU(28," You\u2019ll see counts for each notification. "),n.qZA(),n.BQk(),n.qZA()()),2&e&&(n.xp6(1),n.Q6J("nzActive",!0)("nzLoading",t.loading)("nzParagraph",n.DdM(7,N)),n.xp6(2),n.Q6J("nzChecked",t.model.email_notifications_enabled),n.xp6(7),n.Q6J("nzChecked",t.model.daily_digest_enabled),n.xp6(7),n.Q6J("nzChecked",t.model.popup_notifications_enabled),n.xp6(7),n.Q6J("nzChecked",t.model.show_unread_items_count))},dependencies:[p.bd,f.ng,m.Ie,C.ZU,z.g],styles:["h4[_ngcontent-%COMP%]{position:relative;top:2px}label[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none}"]}),l})()}];let _=(()=>{var i;class l{}return(i=l).\u0275fac=function(e){return new(e||i)},i.\u0275mod=n.oAB({type:i}),i.\u0275inj=n.cJS({imports:[c.Bz.forChild(Z),c.Bz]}),l})(),T=(()=>{var i;class l{}return(i=l).\u0275fac=function(e){return new(e||i)},i.\u0275mod=n.oAB({type:i}),i.\u0275inj=n.cJS({imports:[v.ez,_,p.vh,f.H0,m.Wr,C.ZJ,z.S]}),l})()}}]);