1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8318],{20438:(e,l,n)=>{"use strict";n.d(l,{A:()=>i});var s=n(37876),t=n(14232),a=n(89311),r=n(95726);let i=e=>{let{id:l,containerClassName:n="",labelClassName:i="",inputClassName:o="",placeholder:c="",wrapperClassName:d="",label:u="",type:m="text",error:x="",disabled:h=!1,color:f="primary",fromCustom:g=!1,...b}=e,p=(0,t.useRef)();return(0,s.jsxs)("div",{className:n,onClick:()=>{var e;return null==p||null==(e=p.current)?void 0:e.focus()},role:"none",children:[(0,s.jsxs)("div",{className:"w-full pl-2 outline-none text-sm rounded-lg border transition-all duration-100 ".concat((0,r.g$)({disabled:h,error:x})," ").concat(d," ").concat(""," flex text-sm font-light overflow-hidden dark:!bg-gray-00"),children:[(0,s.jsx)("label",{htmlFor:l,className:"select-none ".concat(h?"text-gray-500 cursor-not-allowed":"text-gray"," placeholder-gray-400 ").concat(i),children:u}),(0,s.jsx)("input",{ref:p,type:m,className:"outline-none py-1.5 pr-2 rounded-md font-medium w-full ".concat(h?"bg-gray-100 text-gray-500 cursor-not-allowed":"bg-gray-00 text-".concat(f)," ").concat(o),id:l,placeholder:c,disabled:h,...b})]}),x&&(0,s.jsx)(a.ErrorText,{className:"mt-1",children:x})]})}},61382:(e,l,n)=>{"use strict";n.r(l),n.d(l,{default:()=>b});var s=n(37876),t=n(77328),a=n.n(t),r=n(14232),i=n(2171),o=n(57994),c=n(38614),d=n(47553),u=n(5357),m=n(21639),x=n(82669),h=n(16495),f=n(83872);let g=(0,r.memo)(()=>{var e,l;let{primaryUserData:n}=(0,i.useSelector)(e=>e.PrimaryUserData),t=[{label:"profile",key:"profile",url:h.APP_PATHS.profileSettings,event:"settings-profile-tab",description:"Edit your profile information like name, profile picture, skills"},{label:"inbox",key:"inbox",url:h.APP_PATHS.inboxSettings,event:"settings-inbox-tab",description:"Edit shorthands and control who can send you messages on Peerlist"},{label:"account",key:"account",url:h.APP_PATHS.accountSettings,event:"settings-account-tab",description:"Change your password anytime."},{label:"notifications",key:"notifications",url:h.APP_PATHS.notificationSettings,event:"notifications-account-tab",description:"Select the kinds of notifications you get about your activities, interests, and recommendations."},{label:"job preferences",key:"jobPreferences",url:h.APP_PATHS.jobPreferenceSettings,event:"settings-jobPreferences-tab",description:"You can see & set your job preferences",badge:(null==n||null==(e=n.jobPreferences)?void 0:e.status)!==h.JOB_PREFERENCES_CONST.STATUS_INACTIVE?(0,s.jsx)(u.A.Green,{className:"ml-2",children:"Open"}):null},{label:"custom domain",key:"customDomain",url:h.APP_PATHS.customDomainSettings,event:"settings-customDomain-tab",description:"Use your profile as a portfolio on your domain",badge:(null==n||null==(l=n.customDomain)?void 0:l.domainName)?(0,s.jsx)(u.A.Green,{className:"ml-2",children:"Connected"}):(0,s.jsx)(u.A.Red,{className:"ml-2",children:"Not Connected"})}];return(0,s.jsx)("ul",{children:t.map(e=>"notifications"!==e.key||(null==n?void 0:n.published)?(0,s.jsx)("li",{className:"w-full",children:(0,s.jsx)(c.A,{page:e,children:(0,s.jsx)("p",{className:"text-xs block lg:hidden",children:e.description})})},e.url):null)})}),b=(0,d.A)(e=>{let{children:l,pageHeading:n="Settings",title:t=null,loading:i=!1,centerTopChildren:c=null}=e,[d,u]=(0,r.useState)(!1);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a(),{children:(0,s.jsx)("title",{children:"Peerlist Settings | ".concat(t||n)})}),(0,s.jsxs)(o.A.Center,{children:[(0,s.jsxs)(o.A.CenterTop,{internalPage:!0,children:[(0,s.jsxs)("div",{className:"flex justify-between items-center w-full",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(o.A.BackButton,{}),(0,s.jsx)(o.A.PageHeading,{children:n})]}),c]}),(0,s.jsx)(m.Ay.CarbonOutline,{circular:!0,onClick:()=>u(e=>!e),className:"lg:hidden flex",children:d?(0,s.jsx)(f.CloseXIcon,{size:18}):(0,s.jsx)(f.MenuIcon,{size:16})})]}),(0,s.jsx)("main",{children:i?(0,s.jsx)("div",{className:"flex items-center justify-center vertical-center-loader w-full",children:(0,s.jsx)(x.A,{})}):(0,s.jsx)("div",{children:l})})]}),(0,s.jsx)(o.A.Right,{showSidePanel:d,paddingX:"px-0",children:(0,s.jsx)(g,{})})]})})},84459:(e,l,n)=>{"use strict";n.r(l),n.d(l,{default:()=>S});var s=n(37876),t=n(2171),a=n(14232),r=n(61382),i=n(86425),o=n(83872),c=n(16495),d=n(51915),u=n(34321),m=n(68827),x=n(21639),h=n(20438),f=n(95726),g=n(71297),b=n(89311),p=n(41205),v=n(69198),j=n(6827);let y=()=>{let e=(0,t.useDispatch)(),l=(0,t.useSelector)(j.Tx),[n,r]=(0,a.useState)([]),[i,d]=(0,a.useState)(!1),[y,S]=(0,a.useState)(""),A=async s=>{s.preventDefault();let t=p.Ay.validateShortHands(n);if((null==t?void 0:t.error)&&Object.keys(t.error).length>0)return void S(t.error);let a={...l,shortHands:(null==t?void 0:t.finalShorthandArr)||[]};try{d(!0),await u.bz.updateInboxPreference(a),e(j.Yt.updatePrimaryUserData({inboxPreferences:a})),g.A.SuccessToast(v.A.SETTINGS.shortHandAdd)}catch(e){var r,i;g.A.ErrorToast((null==e||null==(i=e.response)||null==(r=i.data)?void 0:r.message)||m.A.GLOBAL.wrong)}finally{d(!1)}},E=(e,l)=>{y&&S("");let s=e.target;r(n.map((e,n)=>{if(n===l){var t;let l={...e};return(null==s?void 0:s.name)==="name"&&(l.name=null==s||null==(t=s.value)?void 0:t.trim()),(null==s?void 0:s.name)==="value"&&(l.value=s.value),l}return e}))};return(0,a.useEffect)(()=>{l.shortHands.length>0&&r(l.shortHands)},[JSON.stringify(l)]),(0,s.jsxs)("div",{children:[(0,s.jsx)(b.default.MutedText,{children:"Use shorthands to quickly share the data while messaging. You can open the shorthand menu by entering / while writing message."}),!i&&0===n.length&&(0,s.jsx)(b.default.MutedText,{className:"my-10",children:"No shorthands present ;)"}),(0,s.jsxs)("form",{id:"short-hand-inbox",onSubmit:A,children:[(0,s.jsx)("ul",{className:"my-4",children:null==n?void 0:n.map((e,l)=>(0,s.jsxs)("li",{className:"w-full flex items-center sm:flex-row gap-4 mb-4",children:[(0,s.jsx)(h.A,{name:"name",value:e.name,onChange:e=>E(e,l),label:(0,s.jsx)(N,{}),placeholder:"shorthand",maxLength:30,error:(null==y?void 0:y.inputError)===l&&(null==y?void 0:y.message)||"",wrapperClassName:"items-center",required:!0}),(0,s.jsx)("div",{className:"flex-grow",children:(0,s.jsx)(f.Ay,{name:"value",value:e.value,onChange:e=>E(e,l),placeholder:"value",maxLength:200,error:(null==y?void 0:y.inputError)===l&&(null==y?void 0:y.message)||"",required:!0})}),(0,s.jsx)(x.Ay.CarbonTransparent,{small:!0,circular:!0,disabled:i,onClick:()=>
1{y&&S(""),r(n.filter((e,n)=>n!==l))},children:(0,s.jsx)(o.TrashIcon,{size:16})})]},"".concat(e.key,"-").concat(l,"}")))}),y&&(0,s.jsx)(b.default.ErrorText,{className:"mb-2",children:y.message})]}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsxs)("button",{type:"button",className:"gap-0.5 flex items-center text-xs font-semibold hover:text-gray-800 w-max px-1",onClick:()=>{n.length!==c.MAX_SHORT_HAND_ALLOWED&&r([...n,{name:"",value:""}])},disabled:n.length>=c.MAX_SHORT_HAND_ALLOWED||i,children:[(0,s.jsx)(o.PlusIcon,{size:16}),"New Shorthand"]}),(0,s.jsx)(x.Ay.Carbon,{small:!0,type:"submit",loading:i,disabled:i||Object.keys(y).length>0,form:"short-hand-inbox",className:"ml-auto mr-0 mt-6 ",children:"Save"})]})]})},N=()=>(0,s.jsx)("div",{className:"flex items-center",children:(0,s.jsx)(b.default.SemiBoldText,{xs:!0,children:"/"})}),S=()=>{var e;let l=(0,t.useDispatch)(),{primaryUserData:n}=(0,t.useSelector)(e=>e.PrimaryUserData),x=(0,t.useSelector)(j.Tx),[h,f]=(0,a.useState)(""),[p,v]=(0,a.useState)((null==n||null==(e=n.inboxPreferences)?void 0:e.allowMsgFrom)||c.INBOX_PREFERENCES.EVERYONE),N=[{label:"Everyone",value:c.INBOX_PREFERENCES.EVERYONE,description:"Recommended. If you're not following them, the message will go into your Other inbox."},{label:"Peers only",value:c.INBOX_PREFERENCES.PEERSONLY,description:"Only the people whom you follow back will be able to message you."},{label:"No one",value:c.INBOX_PREFERENCES.NOONE,description:"That's ok. No one will be able to message you on Peerlist."}],S=async e=>{try{let n={...x,allowMsgFrom:e};await u.bz.updateInboxPreference(n),l(j.Yt.updatePrimaryUserData({inboxPreferences:n})),g.A.SuccessToast("Inbox preferences updated successfully.")}catch(e){var n,s,t;f((null==e||null==(t=e.response)||null==(s=t.data)||null==(n=s.error)?void 0:n.message)||m.A.GLOBAL.wrong)}};return(0,a.useEffect)(()=>{var e,l,s;(null==n||null==(e=n.inboxPreferences)?void 0:e.allowMsgFrom)&&(null==n||null==(l=n.inboxPreferences)?void 0:l.allowMsgFrom)!==p&&v(null==n||null==(s=n.inboxPreferences)?void 0:s.allowMsgFrom)},[JSON.stringify(null==n?void 0:n.inboxPreferences)]),(0,s.jsx)(r.default,{pageHeading:"Settings â Inbox",children:(0,s.jsxs)("div",{className:"p-6 flex flex-col gap-20",children:[(0,s.jsxs)(i.A.Section,{title:"ALLOW MESSAGES FROM",icon:(0,s.jsx)(o.UserAddIcon,{size:16}),children:[(0,s.jsx)("div",{className:"mt-6",children:N.map(e=>(0,s.jsx)(d.A,{id:e.value,name:"allowMsgFrom",value:e.value,label:e.label,subLabel:e.description,containerClassName:"py-2 gap-4 justify-between flex",labelClassName:"flex flex-col",sm:!0,checked:p===e.value,onChange:()=>{h&&f(""),S(e.value)}},e.value))}),h&&(0,s.jsx)(b.default.ErrorText,{className:"my-2",children:h})]}),(0,s.jsx)(i.A.Section,{title:"SHORTHANDS",icon:(0,s.jsx)(o.SlashIcon,{size:16}),children:(0,s.jsx)("div",{className:"mt-6",children:(0,s.jsx)(y,{})})})]})})}},91484:(e,l,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/user/settings/inbox",function(){return n(84459)}])}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=91484)),_N_E=e.O()}]);
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.