1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1025],{1025:function(e,i,t){t.r(i),t.d(i,{default:function(){return x}});var o=t(52322),n=t(2784),a=t(10495),s=t(29254),c=t(17625),r=t(12910),l=t(95207),d=t(90047),m=t(37129),u=t(94757),p=t(5632),f=t(94449),h=t(69745),y=t(57675);function x(e){var i,t,x,b;let N=e.user.userId,g=(0,p.useRouter)(),T=(0,f.I0)(),v="An error occurred while saving your notification preferences.",[S,j]=n.useState(!1),[C,k]=n.useState(!0),[w,E]=n.useState(null===(x=null==e?void 0:null===(i=e.emailNotificationPreferences)||void 0===i?void 0:i.notify)||void 0===x||x),[R,P]=n.useState(null!==(b=null==e?void 0:null===(t=e.summaryEmailNotificationPreference)||void 0===t?void 0:t.notify)&&void 0!==b&&b),{subscriptionEnabled:A}=(0,f.v9)(e=>e.subscriptionManager);(0,n.useEffect)(()=>{var i;let t=null==e?void 0:null===(i=e.pushNotificationPreferences)||void 0===i?void 0:i.types;if(t&&(null==t?void 0:t.length)>0){let e=[];z.forEach(i=>{let o=i.subscribed,n=null==t?void 0:t.find(e=>e.type===i.name);if(n){var a;o=null!==(a=null==n?void 0:n.subscribed)&&void 0!==a?a:o}e.push({id:i.id,name:i.name,text:i.text,subscribed:o})}),L(e)}},[]);let[z,L]=n.useState([{id:u.NotificationType.ContentShared,name:u.NotificationType.ContentShared,text:"Someone shares content with you",subscribed:!0},{id:u.NotificationType.MeetingInvitation,name:u.NotificationType.MeetingInvitation,text:"Someone wants to meet with you right now",subscribed:!0},{id:u.NotificationType.ESignDocumentShared,name:u.NotificationType.ESignDocumentShared,text:"Someone asks you to sign a document",subscribed:!0},{id:u.NotificationType.ESignDocumentSigned,name:u.NotificationType.ESignDocumentSigned,text:"Someone signs a document",subscribed:!0},{id:u.NotificationType.ReceiveChatMessage,name:u.NotificationType.ReceiveChatMessage,text:"Someone sends you a message",subscribed:!0},{id:u.NotificationType.ChatReply,name:u.NotificationType.ChatReply,text:"Someone replies to your message",subscribed:!0},{id:u.NotificationType.ChatLiked,name:u.NotificationType.ChatLiked,text:"Someone likes your message",subscribed:!0},{id:u.NotificationType.ChatReplyLiked,name:u.NotificationType.ChatReplyLiked,text:"Someone likes your reply to a message",subscribed:!0},{id:u.NotificationType.ConnectionRequestReceived,name:u.NotificationType.ConnectionRequestReceived,text:"Someone wants to connect with you",subscribed:!0},{id:u.NotificationType.ConnectionRequestAccepted,name:u.NotificationType.ConnectionRequestAccepted,text:"Someone accepts your connection request",subscribed:!0},{id:u.NotificationType.PostComment,name:u.NotificationType.PostComment,text:"Someone comments or replies to a post",subscribed:!0},{id:u.NotificationType.AddedToAGroup,name:u.NotificationType.AddedToAGroup,text:"Someone adds you to a group",subscribed:!0},{id:u.NotificationType.PostLiked,name:u.NotificationType.PostLiked,text:"Someone likes your post",subscribed:!0},{id:u.NotificationType.GroupMembersAdded,name:u.NotificationType.GroupMembersAdded,text:"Someone gets added to a group youâre in",subscribed:!0}]),Z=(0,n.useCallback)(e=>{L(null==z?void 0:z.map(i=>(i.name===e.target.name&&(i.subscribed=e.target.checked),i)))},[z]),M={emailNotification:!1,summaryEmail:!1,pushNotification:!1},[D,q]=n.useState({...M,pushNotification:!0}),[I,G]=n.useState([{id:u.NotificationType.ContentShared,name:u.NotificationType.ContentShared,text:"Someone shares content with you",subscribed:!0},{id:u.NotificationType.MeetingInvitation,name:u.NotificationType.MeetingInvitation,text:"Someone wants to meet with you right now",subscribed:!0},{id:u.NotificationType.ESignDocumentShared,name:u.NotificationType.ESignDocumentShared,text:"Someone asks you to sign a document",subscribed:!0},{id:u.NotificationType.ESignDocumentSigned,name:u.NotificationType.ESignDocumentSigned,text:"Someone signs a document",subscribed:!0},{id:u.NotificationType.ReceiveChatMessage,name:u.NotificationType.ReceiveChatMessage,text:"Someone sends you a message",subscribed:!0},{id:u.NotificationType.ConnectionRequestReceived,name:u.NotificationType.ConnectionRequestReceived,text:"Someone wants to connect with you",subscribed:!0},{id:u.NotificationType.ConnectionRequestAccepted,name:u.NotificationType.ConnectionRequestAccepted,text:"Someone accepts your connection request",subscribed:!0},{id:u.NotificationType.PostComment,name:u.NotificationType.PostComment,text:"Someone comments or replies to a post",subscribed:!0},{id:u.NotificationType.AddedToAGroup,name:u.NotificationType.AddedToAGroup,text:"Someone adds you to a group",subscribed:!0},{id:u.NotificationType.PostLiked,name:u.NotificationType.PostLiked,text:"Someone likes your post",subscribed:!0},{id:u.NotificationType.ChatLiked,name:u.NotificationType.ChatLiked,text:"Someone liked your message",subscribed:!0},{id:u.NotificationType.ChatReply,name:u.NotificationType.ChatReply,text:"Someone replies to your message",subscribed:!0},{id:u.NotificationType.ChatReplyLiked,name:u.NotificationType.ChatReplyLiked,text:"Someone likes your reply to a message",subscribed:!0},{id:u.NotificationType.GroupMembersAdded,name:u.NotificationType.GroupMembersAdded,text:"Someone gets added to a group youâre in",subscribed:!1}]),_=(0,n.useCallback)(e=>{G(null==I?void 0:I.map(i=>(i.name===e.target.name&&(i.subscribed=e.target.checked),i)))},[I]);(0,n.useEffect)(()=>{var i;let t=null==e?void 0:null===(i=e.emailNotificationPreferences)||void 0===i?void 0:i.types;if(t&&(null==t?void 0:t.length)>0){let e=[];I.forEach(i=>
1{let o=i.subscribed,n=null==t?void 0:t.find(e=>e.type===i.name);if(n){var a;o=null!==(a=null==n?void 0:n.subscribed)&&void 0!==a?a:o}e.push({id:i.id,name:i.name,text:i.text,subscribed:o})}),G(e)}},[]),(0,n.useEffect)(()=>{let e=u.PubNubChannelPrefix.NotificationPreference+N,i=e=>{let[i]=e,{eventName:t,eventData:o}=i||{},{type:n}=o;n&&t===u.vp.Unsubscribe&&(n===u.NotificationType.UnreadNotification?P(!1):(_({target:{name:n,checked:!1}}),[u.NotificationType.PostComment,u.NotificationType.CommentReply].includes(n)&&_({target:{name:u.NotificationType.PostComment,checked:!1}})))};return m.T.on(e,i),()=>{m.T.removeListener(e,i)}},[_,N]);let B=n.useCallback(()=>{delete g.query.notification_preferences,g.push(g),e.onCloseDrawer()},[e]),U=()=>{B()},X=async()=>{let e=[],i=[];I.forEach(i=>{e.push({type:i.name,subscribed:i.subscribed}),i.name===u.NotificationType.PostComment&&e.push({type:u.NotificationType.CommentReply,subscribed:i.subscribed})}),z.forEach(e=>{i.push({type:e.name,subscribed:e.subscribed}),e.name===u.NotificationType.PostComment&&i.push({type:u.NotificationType.CommentReply,subscribed:e.subscribed})}),j(!0);try{let t=JSON.stringify({userId:N,summaryEmailNotification:{notify:R}
1,emailNotification:{notify:w,types:e},pushNotification:{notify:!0,types:i}}),o=await l.zk.patch("".concat(r.R8,"/user/notification/preferences"),t);if(j(!1),o.data.data.isSuccess){d.Am.error(v);return}d.Am.success("Preferences saved successfully."),m.Z.dispatch("USER_PREFERENCES_UPDATED"),B()}catch(e){j(!1),d.Am.error(v);return}};return(0,o.jsx)(a.vj,{className:"common-sidebar",id:"profile-update-drawer",anchor:"right",open:e.onOpenDrawer,onClose:()=>{U()},children:(0,o.jsxs)("div",{className:"max-h-screen overflow-auto",children:[(0,o.jsxs)("div",{className:"sticky top-0 bg-white z-10",children:[(0,o.jsxs)(a.xu,{className:"sidebar-header",display:"flex",alignItems:"center",px:4,py:2.4,children:[(0,o.jsx)(a.xu,{color:"text.textBlue",children:(0,o.jsx)(a.ZT,{variant:"h6",gutterBottom:!0,color:"inherit",children:"Notification Preferences"})}),(0,o.jsx)(a.xu,{className:"close-drawer cursor-pointer",display:"flex",alignItems:"center",color:"grey.500",onClick:()=>U(),children:(0,o.jsx)(a.Tw,{color:"inherit"})})]}),(0,o.jsx)(a.iz,{}),(0,o.jsx)(a.xu,{className:"pref-alert",children:(0,o.jsx)(c.Z,{in:C,children:(0,o.jsxs)(a.bZ,{severity:"info",onClose:()=>{k(!1)},children:[(0,o.jsx)("b",{children:"Choose your notification preferences!"}),(0,o.jsx)("p",{children:"Because your relationships are important, we can let you know right away in multiple ways when someone reaches out to you. Here is where you can tell us what types of real-time notifications you prefer to receive."})]})})})]}),(0,o.jsx)(a.xu,{px:3,pb:1,children:(0,o.jsx)(a.xu,{className:"preferences email-pref",children:(0,o.jsx)(y.S7,{expanded:D.pushNotification,onToggle:()=>q({...M,pushNotification:!D.pushNotification}),title:(0,o.jsx)(a.xu,{className:"panel-main-heading flex items-center w-full",children:(0,o.jsxs)("div",{className:"panel-heading flex items-center",children:[(0,o.jsx)("button",{children:(0,o.jsx)("span",{style:{fontSize:24},className:"text-xs material-icons",children:"notifications"})}),(0,o.jsx)(a.ZT,{children:(0,o.jsx)("p",{className:"text-lg font-medium text-gray800 whitespace-normal mr-3 pr-3",children:"Desktop/Mobile Notifications"})})]})}),icons:(0,o.jsx)(s.Z,{defaultChecked:A,checked:A,onChange:()=>{A?T((0,h.jQ)(N)):T((0,h.Li)(N))},color:"primary",size:"small"}),children:(0,o.jsx)(a.xu,{mt:2,children:null==z?void 0:z.map(e=>(0,o.jsxs)(a.xu,{display:"flex",alignItems:"flex-start",mb:1,children:[(0,o.jsx)(a.XZ,{id:"".concat(e.id,"PushNotification"),name:e.name,color:"primary",inputProps:{"aria-label":"".concat(e.name,"PushNotification")},defaultChecked:e.subscribed,checked:e.subscribed,onChange:Z,disabled:!A},"".concat(e.id,"PushNotification")),(0,o.jsx)(a.xu,{color:"primary.linkColor",children:(0,o.jsx)(a.ZT,{variant:"body2",gutterBottom:!0,children:e.text})})]}))})})})}),(0,o.jsx)(a.xu,{px:3,pb:1,children:(0,o.jsx)(a.xu,{className:"preferences email-pref",children:(0,o.jsx)(y.S7,{expanded:D.emailNotification,onToggle:()=>q({...M,emailNotification:!D.emailNotification}),title:(0,o.jsx)(a.xu,{className:"panel-main-heading flex items-center w-full",children:(0,o.jsxs)("div",{className:"panel-heading flex items-center",children:[(0,o.jsx)("button",{children:(0,o.jsx)("span",{style:{fontSize:24},className:"text-xs material-icons",children:"email"})}),(0,o.jsx)(a.ZT,{children:(0,o.jsx)("p",{className:"text-lg font-medium text-gray800 whitespace-normal mr-3 pr-3",children:"Email Notifications"})})]})}),icons:(0,o.jsx)(s.Z,{defaultChecked:w,checked:w,onChange:()=>{E(!w)},color:"primary",size:"small"}),children:(0,o.jsx)(a.xu,{mt:2,children:null==I?void 0:I.map(e=>(0,o.jsxs)(a.xu,{display:"flex",alignItems:"flex-start",mb:1,children:[(0,o.jsx)(a.XZ,{id:"".concat(e.id,"EmailNotification"),name:e.name,color:"primary",inputProps:{"aria-label":"".concat(e.name,"EmailNotification")},defaultChecked:e.subscribed,checked:e.subscribed,onChange:_,disabled:!w},"".concat(e.id,"EmailNotification")),(0,o.jsx)(a.xu,{color:"primary.linkColor",children:(0,o.jsx)(a.ZT,{variant:"body2",gutterBottom:!0,children:e.text})})]}))})})})}),(0,o.jsx)(a.xu,{px:3,pb:1,children:(0,o.jsx)(a.xu,{className:"preferences email-pref",children:(0,o.jsx)(y.S7,{expanded:D.summaryEmail,onToggle:()=>q({...M,summaryEmail:!D.summaryEmail}),title:(0,o.jsx)(a.xu,{className:"panel-main-heading flex items-center w-full",children:(0,o.jsxs)("div",{className:"panel-heading flex items-center",children:[(0,o.jsx)("button",{children:(0,o.jsx)("span",{style:{fontSize:24},className:"text-xs material-icons",children:"email"})}),(0,o.jsx)(a.ZT,{children:(0,o.jsx)("p",{className:"text-lg font-medium text-gray800 whitespace-normal mr-3 pr-3",children:"Summary Emails"})})]})}),children:(0,o.jsxs)(a.xu,{mt:2,children:[(0,o.jsx)("p",{className:"pref-text",children:"Let us help you make sure that you donât miss anything that people share with you!"}),(0,o.jsxs)(a.xu,{display:"flex",alignItems:"flex-start",mb:1,children:[(0,o.jsx)(a.XZ,{name:"summaryEmails",id:"summaryEmails",color:"primary",checked:R,onChange:()=>{P(!R)},inputProps:{"aria-label":"summaryEmails"}}),(0,o.jsx)(a.xu,{color:"primary.linkColor",children:(0,o.jsx)(a.ZT,{variant:"body2",gutterBottom:!0,children:"Receive unread notifications email"})})]})]})})})}),(0,o.jsxs)("div",{className:"sticky bottom-0 flex gap-1 px-6 py-3 bg-white",children:[(0,o.jsx)(a.xu,{width:"50%",pr:1,boxSizing:"border-box",children:(0,o.jsx)(a.zx,{variant:"outlined",style:{paddingTop:10},className:"cancel-button",disableElevation:!0,size:"large",onClick:B,children:"Cancel"})}),(0,o.jsx)(a.xu,{width:"50%",boxSizing:"border-box",children:(0,o.jsx)(a.zx,{onClick:X,variant:"contained",color:"primary",disableElevation:!0,size:"large",className:S?"custom-button button-diasabled":"custom-button",fullWidth:!0,children:S?(0,o.jsx)(a.aN,{color:"inherit",size:20}):"Save"})})]})]})})}}}]);
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.