PageSourceSearch

https://www.lesswrong.com/_next/static/immutable/chunks/3h0ebdo3kuh4t.js

js lesswrong.com collected 2026-10-01 08:37:01 UTC 53,589 bytes, 5 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="633d8a38-c7b9-6d7f-c77b-77cd43adf7b6")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,647904,e=>{"use strict";var t=e.i(843476);e.s(["GiftIcon",0,e=>{let{style:a}=e;return(0,t.jsxs)("svg",{version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 293.373 293.373",style:a,fill:"currentColor",children:[(0,t.jsx)("g",{children:(0,t.jsxs)("g",{children:[(0,t.jsxs)("g",{children:[(0,t.jsx)("path",{d:"M130.265,162.904c-24.162,0-95.274,0-95.274,0c-7.549,0-13.726,6.176-13.726,13.725v103.02\n        c0,7.549,6.177,13.725,13.726,13.725c0,0,72.6,0,96.876,0c3.229,0,3.229-3.469,3.229-3.469V167.568\n        C135.095,167.568,135.095,162.904,130.265,162.904z"}),(0,t.jsx)("path",{d:"M258.383,162.904c0,0-71.384,0-95.177,0c-5.797,0-4.929,6.037-4.929,6.037v121.076c0,0-0.047,3.354,3.44,3.354\n        c24.166,0,96.664,0,96.664,0c7.549,0,13.726-6.176,13.726-13.725V176.629C272.109,169.08,265.932,162.904,258.383,162.904z"})]}),(0,t.jsxs)("g",{children:[(0,t.jsx)("path",{d:"M135.095,81.846c0,0,0-4.651-4.596-4.651c-27.521,0-111.008,0-111.008,0c-7.549,0-13.726,6.177-13.726,13.725v42.845\n        c0,7.549,6.177,13.725,13.726,13.725c0,0,83.861,0,111.384,0c4.22,0,4.22-3.66,4.22-3.66V81.846L135.095,81.846z"}),(0,t.jsx)("path",{d:"M273.882,77.195c0,0-83.521,0-111.362,0c-4.241,0-4.241,4.041-4.241,4.041v62.679c0,0,0,3.575,5.156,3.575\n        c27.611,0,110.447,0,110.447,0c7.549,0,13.726-6.176,13.726-13.725V90.92C287.608,83.372,281.431,77.195,273.882,77.195z"})]}),(0,t.jsx)("g",{children:(0,t.jsx)("path",{d:"M88.41,67.04c-6.28,0-12.016-0.498-17.046-1.481c-12.776-2.496-21.557-7.354-26.845-14.85\n        c-4.738-6.718-6.188-15-4.311-24.617C43.496,9.266,54.796,0,72.024,0c3.646,0,7.65,0.421,11.902,1.252\n        c10.816,2.113,24.65,8.315,37.007,16.59c20.965,14.041,22.002,22.77,20.958,28.115c-1.535,7.854-8.876,13.466-22.443,17.158\n        C110.282,65.609,98.969,67.04,88.41,67.04z M72.025,21.999c-6.672,0-8.965,1.864-10.224,8.311\n        c-1.03,5.271,0.269,7.112,0.695,7.717c1.784,2.53,6.431,4.64,13.086,5.939c3.591,0.702,8.028,1.073,12.827,1.073\n        c10.553,0,19.85-1.599,26.019-3.348c0.449-0.127,1.146-0.658,0.399-1.103c-8.065-6.57-22.82-15.343-35.119-17.746\n        C76.843,22.284,74.257,21.999,72.025,21.999z"})}),(0,t.jsx)("g",{children:(0,t.jsx)("path",{d:"M205.281,67.04c0,0,0,0-0.002,0c-10.559,0-21.871-1.431-31.037-3.925c-13.568-3.691-20.908-9.304-22.443-17.157\n        c-1.043-5.345-0.008-14.074,20.959-28.115c12.355-8.275,26.189-14.477,37.007-16.59c4.252-0.831,8.256-1.252,11.899-1.252\n        c17.232,0,28.531,9.267,31.816,26.093c1.879,9.616,0.43,17.898-4.309,24.616c-5.288,7.497-14.068,12.354-26.847,14.85\n        C217.296,66.541,211.56,67.04,205.281,67.04z M179.039,40.452c-0.715,0.415-0.369,1.07,0.002,1.177\n        c6.166,1.773,15.561,3.411,26.238,3.411c4.801,0,9.236-0.371,12.828-1.073c6.654-1.3,11.303-3.409,13.086-5.939\n        c0.428-0.605,1.728-2.446,0.695-7.717C230.63,23.864,228.336,22,221.663,22c-2.231,0-4.815,0.284-7.682,0.844\n        C201.681,25.246,187.104,33.881,179.039,40.452z"})})]})}),(0,t.jsx)("g",{}),(0,t.jsx)("g",{}),(0,t.jsx)("g",{}),(0,t.jsx)("g",{}),(0,t.jsx)("g",{}),(0,t.jsx)("g",{}),(0,t.jsx)("g",{}),(0,t.jsx)("g",{}),(0,t.jsx)("g",{}),(0,t.jsx)("g",{}),(0,t.jsx)("g",{}),(0,t.jsx)("g",{}),(0,t.jsx)("g",{}),(0,t.jsx)("g",{}),(0,t.jsx)("g",{})]})}])},312923,115278,694356,e=>{"use strict";var t=e.i(843476),a=e.i(77284),n=e.i(552275),i=e.i(495314),o=e.i(85528),s=e.i(945040),l=e.i(946271);e.i(813868);var r=e.i(122756),d=e.i(239832),c=e.i(93495),u=e.i(415617),m=e.i(110601),g=e.i(87828),p=e.i(429329),h=e.i(79732);let y=(0,r.gql)("\n  query PostNominatedNotification($documentId: String) {\n    post(input: { selector: { documentId: $documentId } }) {\n      result {\n        ...PostsList\n      }\n    }\n  }\n"),f=(0,p.defineStyles)("PostNominatedNotification",e=>({root:{padding:12,width:(0,o.getPostPreviewWidth)()},loading:{...(0,s.notificationLoadingStyles)(e)},reviewButton:{padding:8,textAlign:"center"}}));e.s(["default",0,e=>{var o;let{postId:s}=e,{forumType:r}=(0,a.useForumType)(),p=(0,h.useStyles)(f),{loading:x,data:v}=(0,l.useQuery)(y,{variables:{documentId:s},fetchPolicy:"cache-first"}),j=null==v||null==(o=v.post)?void 0:o.result;return x?(0,t.jsx)("div",{className:p.loading,children:(0,t.jsx)(d.default,{})}):j?(0,t.jsxs)("div",{className:p.root,children:[(0,t.jsx)(c.default,{post:j}),(0,t.jsxs)(g.default,{contentType:"comment",children:[(0,t.jsxs)("p",{children:["Your post has been nominated for the ",(0,i.getReviewNameInSitu)(),"."]}),(0,t.jsx)("p",{children:"You're encouraged to write a self-review, exploring how you think about the post today. Do you still endorse it? Have you learned anything new that adds more depth? How might you improve the post? What further work do you think should be done exploring the ideas here?"}),(0,t.jsx)("div",{className:p.reviewButton,children:(0,t.jsx)(u.default,{post:j,year:i.REVIEW_YEAR+"",reviewMessage:(0,t.jsx)(m.default,{title:"Write up your thoughts on what was good about a post, how it could be improved, and how you think stands the tests of time as part of the broader ".concat(n.forumTitleSetting.get(r)," conversation"),placement:"bottom",children:(0,t.jsx)("div",{className:p.reviewButton,children:"Write a Review"})})})})]})]}):(0,t.jsx)("div",{className:p.root,children:"Error"})}],312923);let x=(0,r.gql)("\n  query TagRelNotificationItem($documentId: String) {\n    tagRel(input: { selector: { documentId: $documentId } }) {\n      result {\n        ...TagRelFragment\n      }\n    }\n  }\n"),v=(0,p.defineStyles)("TagRelNotificationItem",e=>({meta:{fontSize:".9rem",color:e.palette.text.dim45}
2,title:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}}));e.s(["default",0,e=>{var a,n,i;let{tagRelId:o}=e,s=(0,h.useStyles)(v),{loading:r,data:c}=(0,l.useQuery)(x,{variables:{documentId:o}}),u=null==c||null==(a=c.tagRel)?void 0:a.result;return r?(0,t.jsx)(d.default,{}):u?(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:s.meta,children:["New post tagged ",(0,t.jsx)("em",{children:null==(n=u.tag)?void 0:n.name}),":"]}),(0,t.jsx)("div",{className:s.title,children:null==(i=u.post)?void 0:i.title})]}):null}],115278);var j=e.i(530841),w=e.i(271645),S=e.i(11422);let N=(0,w.createContext)({closeNotifications:()=>{}}),b=e=>{let{...a}=e,{closeNotifications:n}=(0,w.useContext)(N),{onClick:i}=a,o=(0,w.useCallback)(e=>{i&&i(e),n()},[i,n]);return(0,t.jsx)(S.Link,{...a,onClick:o})};var k=e.i(841658);let C=(0,r.gql)("\n  query CommentOnYourDraftNotificationHover($documentId: String) {\n    post(input: { selector: { documentId: $documentId } }) {\n      result {\n        ...PostsMinimumInfo\n      }\n    }\n  }\n"),I=(0,p.defineStyles)("CommentOnYourDraftNotificationHover",e=>({root:{padding:16,...e.typography.commentStyle,...e.typography.body2,maxWidth:600}})),F=e=>{var a,n,i,o;let{notification:s}=e,r=(0,h.useStyles)(I),c=null!=(a=s.documentId)?a:void 0,u="/editPost?postId=".concat(c),m=(0,j.useCurrentUser)(),{data:g}=(0,l.useQuery)(C,{variables:{documentId:c},skip:!c}),p=null==g||null==(n=g.post)?void 0:n.result,y=null==(i=s.extraData)?void 0:i.senderUserID,f=null==(o=s.extraData)?void 0:o.senderDisplayName,x=(null==p?void 0:p.draft)?"draft":"post";return(0,t.jsxs)("div",{className:r.root,children:[(0,t.jsxs)("div",{children:[y?(0,t.jsx)(k.default,{documentId:y,fallbackName:f}):"Someone",(null==m?void 0:m._id)!==(null==p?void 0:p.userId)?" replied to your comment on ":" commented on your ".concat(x),(0,t.jsx)(b,{to:u,children:p?p.title:(0,t.jsx)(d.default,{})})]}),s.extraData&&(0,t.jsx)("blockquote",{dangerouslySetInnerHTML:{__html:s.extraData.commentHtml}})]})};var T=e.i(514089),D=e.i(937636),M=e.i(182584);let R=(0,r.gql)("\n  query TypoSuggestionHoverQuery($suggestionId: String) {\n    typoSuggestion(selector: { _id: $suggestionId }) {\n      result {\n        ...TypoSuggestionsDefaultFragment\n      }\n    }\n  }\n"),P=(0,r.gql)("\n  mutation acceptTypoSuggestionFromHover($suggestionId: String!, $mode: TypoAcceptMode!) {\n    acceptTypoSuggestion(suggestionId: $suggestionId, mode: $mode) {\n      ...TypoSuggestionsDefaultFragment\n    }\n  }\n"),O=(0,r.gql)("\n  mutation rejectTypoSuggestionFromHover($suggestionId: String!) {\n    rejectTypoSuggestion(suggestionId: $suggestionId) {\n      ...TypoSuggestionsDefaultFragment\n    }\n  }\n"),B=(0,p.defineStyles)("TypoSuggestionHover",e=>({root:{padding:16,...e.typography.commentStyle,...e.typography.body2,maxWidth:480},flaggedBy:{fontSize:13,color:e.palette.text.dim,marginBottom:8},diff:{margin:"8px 0",padding:8,background:e.palette.panelBackground.darken02,borderRadius:4,fontFamily:e.typography.code.fontFamily,fontSize:13,lineHeight:"20px",whiteSpace:"pre-wrap",wordBreak:"break-word"},del:{background:e.palette.background.diffDeleted,textDecoration:"line-through"},ins:{background:e.palette.background.diffInserted},arrow:{margin:"0 6px",color:e.palette.text.dim},explanation:{fontSize:13,color:e.palette.text.dim,fontStyle:"italic",marginBottom:12},buttons:{display:"flex",gap:8,marginTop:12},button:{padding:"6px 12px",border:e.palette.greyBorder("1px",.2),borderRadius:4,cursor:"pointer",background:e.palette.panelBackground.default,fontFamily:"inherit",fontSize:13,"&:hover":{background:e.palette.panelBackground.darken02},"&:disabled":{cursor:"default",opacity:.6}},primaryButton:{background:e.palette.primary.main,color:e.palette.text.invertedBackgroundText,borderColor:e.palette.primary.main,"&:hover":{background:e.palette.primary.dark}},status:{marginTop:12,fontSize:13,color:e.palette.text.dim}})),A=e=>{var a,n,i,o,s,r,c,u,m;let{notification:g}=e,p=(0,h.useStyles)(B),y=(0,D.useNavigate)(),f=null!=(a=g.documentId)?a:void 0,[x,v]=(0,w.useState)(null),{data:j,loading:S,refetch:N}=(0,l.useQuery)(R,{variables:{suggestionId:f},skip:!f}),[b]=(0,T.useMutation)(P),[k]=(0,T.useMutation)(O),[C,I]=(0,w.useState)(!1);if(S)return(0,t.jsx)("div",{className:p.root,children:(0,t.jsx)(d.default,{})});let F=null==j||null==(u=j.typoSuggestion)?void 0:u.result;if(!F)return(0,t.jsx)("div",{className:p.root,children:"This typo suggestion is no longer available."});let A="Posts"===F.collectionName,G="pending"!==F.status,z=null!=(n=null==(m=F.reactor)?void 0:m.displayName)?n:"A reader",q=null!=(i=null!=(o=F.llmCanonicalQuote)?o:F.quote)?i:"",U=null!=(s=F.proposedReplacement)?s:"",L=null!=(r=F.narrowedQuote)?r:q,W=null!=(c=F.narrowedReplacement)?c:U,H=L?q.indexOf(L):-1,E=H>=0&&L!==q,$=E?q.slice(0,H):"",K=E?q.slice(H+L.length):"",_=async e=>{if(f&&!C){v(null),I(!0);
2try{"apply"===e?await b({variables:{suggestionId:f,mode:"APPLY"},optimisticResponse:{acceptTypoSuggestion:{...F,status:"accepted"}}}):"suggest"===e?(await b({variables:{suggestionId:f,mode:"SUGGEST"},optimisticResponse:{acceptTypoSuggestion:{...F,status:"accepted_as_suggestion"}}}),F.documentId&&y((0,M.postGetEditUrl)(F.documentId))):await k({variables:{suggestionId:f},optimisticResponse:{rejectTypoSuggestion:{...F,status:"rejected"}}})}catch(e){v(e instanceof Error?e.message:String(e)),await N()}finally{I(!1)}}},V=G||C;return(0,t.jsxs)("div",{className:p.root,children:[(0,t.jsxs)("div",{className:p.flaggedBy,children:["Flagged by ",(0,t.jsx)("strong",{children:z})]}),(0,t.jsx)("div",{className:p.diff,children:E?(0,t.jsxs)(t.Fragment,{children:[$,L&&(0,t.jsx)("span",{className:p.del,children:L}),W&&(0,t.jsx)("span",{className:p.ins,children:W}),K]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:p.del,children:q}),(0,t.jsx)("span",{className:p.arrow,children:"→"}),(0,t.jsx)("span",{className:p.ins,children:U})]})}),F.explanation&&(0,t.jsx)("div",{className:p.explanation,children:F.explanation}),!G&&(0,t.jsxs)("div",{className:p.buttons,children:[(0,t.jsx)("button",{type:"button",className:"".concat(p.button," ").concat(p.primaryButton),onClick:()=>_("apply"),disabled:V,children:"Apply"}),A&&(0,t.jsx)("button",{type:"button",className:p.button,onClick:()=>_("suggest"),disabled:V,children:"Open in editor"}),(0,t.jsx)("button",{type:"button",className:p.button,onClick:()=>_("reject"),disabled:V,children:"Reject"})]}),x&&(0,t.jsxs)("div",{className:p.status,children:["Failed: ",x]}),G&&(0,t.jsxs)("div",{className:p.status,children:["Status: ",F.status]})]})};e.s(["onsiteHoverViewComponents",0,{newCommentOnDraft:()=>F,typoSuggestion:()=>A}],694356)},37345,e=>{"use strict";var t=e.i(843476),a=e.i(77284),n=e.i(538794),i=e.i(271645);e.i(33055);var o=e.i(775942);e.i(266523);var s=e.i(155726);e.i(115004);var l=e.i(717888);e.i(720030);var r=e.i(275261),d=e.i(605299),c=e.i(96009),u=e.i(244026),m=e.i(971603),g=e.i(681387),p=e.i(79732),h=e.i(429329),y=e.i(372593);let f=(0,h.defineStyles)("KarmaChangeNotifierSettings",e=>({root:{fontFamily:e.typography.fontFamily},heading:{fontFamily:e.typography.fontFamily,fontSize:14,fontWeight:500,color:e.palette.grey[800]},description:{fontFamily:e.typography.fontFamily,fontSize:13,color:e.palette.grey[600],lineHeight:1.5,marginTop:4},radioGroup:{display:"flex",flexDirection:"column",flexWrap:"wrap",marginTop:8,gap:2},radioButton:{padding:4},radioLabel:{fontFamily:e.typography.fontFamily,fontSize:13,color:e.palette.grey[700]},inline:{display:"inline"},checkbox:{paddingRight:4},showNegative:{marginTop:4},warningText:{fontFamily:e.typography.fontFamily,fontSize:12,color:e.palette.grey[500],fontStyle:"italic",marginTop:4}}));function x(e){let t={disabled:{label:"Disabled",infoText:"Karma and react notifications are disabled",emptyText:"Karma and react notifications are disabled"},daily:{label:"Batched daily",infoText:"Karma Changes and Reacts (batched daily):",emptyText:"No karma changes or reacts yesterday"},weekly:{label:"Batched weekly",infoText:"Karma Changes and Reacts (batched weekly):",emptyText:"No karma changes or reacts last week"},realtime:{label:"Realtime",infoText:"Recent Karma Changes and Reacts",emptyText:"No karma changes or reacts since you last checked"}},a=g.karmaChangeNotifierDefaultSettings.get(e).updateFrequency;return t[a].label+=" (default)",t}let v=(e,t)=>{let{timeOfDayGMT:a,dayOfWeekGMT:n}=e,{timeOfDay:i,dayOfWeek:o}=(0,m.convertTimeOfWeekTimezone)(a,n,"GMT",t);return{timeOfDay:i,dayOfWeek:o}},j=(0,n.registerComponent)("KarmaChangeNotifierSettings",e=>{let{field:n}=e,{forumType:c}=(0,a.useForumType)(),g=(0,p.useStyles)(f),{timezone:h}=(0,d.useTimezone)(),j=n.state.value,w=e=>{let t={...j,...e};n.handleChange(t)};if(!j.timeOfDayGMT||!j.dayOfWeekGMT)return null;let{timeOfDay:S,dayOfWeek:N}=v(j,h),b=(0,t.jsx)("span",{children:("daily"===j.updateFrequency||"weekly"===j.updateFrequency)&&(0,t.jsxs)(i.default.Fragment,{children:[" at ",(0,t.jsx)(l.default,{value:S,onChange:e=>{var t;let a,n;return t=parseInt(e.target.value),a={timeOfDay:t,dayOfWeek:v(j,h).dayOfWeek},void w({timeOfDayGMT:(n=(0,m.convertTimeOfWeekTimezone)(a.timeOfDay,a.dayOfWeek,h,"GMT")).timeOfDay,dayOfWeekGMT:n.dayOfWeek})},children:Array.from({length:24},(e,a)=>(0,t.jsxs)(y.MenuItem,{value:a,children:[a,":00"]},a))}),(0,u.default)().tz(h).format("z"),"weekly"===j.updateFrequency&&(0,t.jsxs)(i.default.Fragment,{children:[" on ",(0,t.jsxs)(l.default,{value:N,onChange:e=>{var t;let a,n;return t=e.target.value,a={timeOfDay:v(j,h).timeOfDay,dayOfWeek:t},void w({timeOfDayGMT:(n=(0,m.convertTimeOfWeekTimezone)(a.timeOfDay,a.dayOfWeek,h,"GMT")).timeOfDay,dayOfWeekGMT:n.dayOfWeek})},children:[(0,t.jsx)(y.MenuItem,{value:"Sunday",children:"Sunday"}),(0,t.jsx)(y.MenuItem,{value:"Monday",children:"Monday"}),(0,t.jsx)(y.MenuItem,{value:"Tuesday",children:"Tuesday"}),(0,t.jsx)(y.MenuItem,{value:"Wednesday",children:"Wednesday"}),(0,t.jsx)(y.MenuItem,{value:"Thursday",children:"Thursday"}),(0,t.jsx)(y.MenuItem,{value:"Friday",children:"Friday"}),(0,t.jsx)(y.MenuItem,{value:"Saturday",children:"Saturday"})]})]})]})});return(0,t.jsxs)("div",{className:g.root,children:[(0,t.jsx)("div",{className:g.heading,children:"Vote and Reaction Notifications"}),(0,t.jsx)("div",{className:g.description,children:"Shows reactions, upvotes and downvotes on your posts and comments on top of the page. By default, this is on but only updates once per day, to avoid creating a distracting temptation to frequently recheck it."}),(0,t.jsx)("div",{className:g.radioGroup,children:Object.entries(x(c)).map(e=>{let[a,n]=e;return(0,t.jsx)(s.default,{control:(0,t.jsx)(o.default,{checked:a===j.updateFrequency,onChange:e=>w({updateFrequency:a}),className:g.radioButton,value:a}),label:(0,t.jsxs)("span",{className:g.radioLabel,children:[n.label,j.updateFrequency===a?b:null]}),classes:{label:null}},a)})}),"realtime"===j.updateFrequency&&(0,t.jsx)("div",{className:g.warningText,children:"Warning: Immediate karma updates may lead to over-updating on tiny amounts of feedback, and to checking the site frequently when you'd rather be doing something else."}),(0,t.jsx)(s.default,{control:(0,t.jsx)(r.default,{id:"showNegativeCheckbox",classes:{root:g.checkbox},checked:j.showNegativeKarma,onChange:(e,t)=>
2w({showNegativeKarma:t})}),label:(0,t.jsx)("span",{className:g.radioLabel,children:"Show negative karma notifications"}),className:g.showNegative})]})},{hocs:[c.default]});e.s(["default",0,j,"getKarmaNotificationTimingChoices",0,x])},62784,610243,96355,e=>{"use strict";var t=e.i(843476),a=e.i(271645),n=e.i(444098);e.i(905511);var i=e.i(504270),o=e.i(621938),s=e.i(161517),l=e.i(343794),r=e.i(946271);e.i(813868);var d=e.i(122756),c=e.i(105736),u=e.i(813292),m=e.i(824083),g=e.i(163929),p=e.i(79732),h=e.i(429329);let y=(0,h.defineStyles)("ColoredNumber",e=>({gainedPoints:{color:e.palette.primary.main},zeroPoints:{},lostPoints:{}})),f=e=>{let{n:a}=e,n=(0,p.useStyles)(y);return a>0?(0,t.jsx)("span",{className:n.gainedPoints,children:"+".concat(a)}):0===a?(0,t.jsx)("span",{className:n.zeroPoints,children:a}):(0,t.jsx)("span",{className:n.lostPoints,children:a})};e.s(["ColoredNumber",0,f],610243);var x=e.i(530841),v=e.i(77284),j=e.i(372593),w=e.i(716512),S=e.i(566721),N=e.i(182584),b=e.i(35693),k=e.i(11422),C=e.i(964344),I=e.i(87828),F=e.i(690118),T=e.i(110601),D=e.i(85528),M=e.i(348129),R=e.i(405706),P=e.i(695310),O=e.i(37345);let B=(0,h.defineStyles)("NewReactions",e=>({individualAddedReact:{marginLeft:2},votedItemReacts:{marginLeft:6}})),A=e=>{let{reactionChanges:a}=e,n=(0,p.useStyles)(B);if(!a||!a.length)return null;let i=new Set;for(let e of a)i.add(e.reactionType);return(0,t.jsx)("span",{className:n.votedItemReacts,children:[...i.keys()].map(e=>(0,t.jsx)("span",{className:n.individualAddedReact,children:(0,t.jsx)(T.default,{title:a.filter(t=>t.reactionType===e).map((e,a)=>{var n;return(0,t.jsxs)(t.Fragment,{children:[a>0&&(0,t.jsx)(t.Fragment,{children:", "}),(0,t.jsx)(P.default,{documentId:null!=(n=e.userId)?n:void 0})]})}),disabled:!1,children:(0,t.jsx)(R.default,{react:e})})},e))})};e.s(["NewReactions",0,A],96355);let G=(0,h.defineStyles)("KarmaChangesDisplay",e=>({title:{display:"block",paddingTop:16,paddingLeft:16,paddingRight:16,paddingBottom:8},votedItems:{},votedItemRow:{height:20},votedItemScoreChange:{display:"inline-block",minWidth:20,textAlign:"right"},votedItemDescription:{display:"inline-block",marginLeft:5,whiteSpace:"nowrap",overflow:"hidden",maxWidth:250,textOverflow:"ellipsis"},settings:{display:"block",textAlign:"right",paddingTop:8,paddingRight:16,paddingLeft:16,paddingBottom:16,color:e.palette.grey[600],"&:hover":{color:e.palette.grey[500]}},tooltipCard:{width:(0,D.getPostPreviewWidth)(),position:"relative","& img":{maxHeight:"200px"}},tooltipHeader:{padding:12,paddingBottom:0},tooltipTitle:{marginBottom:-6,color:e.palette.text.normal,lineHeight:"1.7rem",fontFamily:e.typography.postStyle.fontFamily,...e.typography.postsItemTitle},tooltipSubtitle:{marginLeft:2,...e.typography.body2,...e.typography.commentStyle,fontSize:"1.1rem",color:e.palette.grey[600]},tooltipBody:{maxHeight:450,padding:12,paddingBottom:0,paddingTop:0},tooltipHighlight:{marginTop:20,marginBottom:12,marginRight:4,wordBreak:"break-word",fontSize:"1.1rem","& h1":{fontSize:"1.2rem"},"& h2":{fontSize:"1.2rem"},"& h3":{fontSize:"1.1rem"},"& li":{fontSize:"1.1rem"},...M.highlightSimplifiedStyles},tooltipCommentBody:{marginTop:12,marginBottom:12,marginRight:4,wordBreak:"break-word",...M.highlightSimplifiedStyles},tooltipReacts:{padding:12,fontFamily:e.typography.commentStyle.fontFamily},tooltipReactsAfterBody:{paddingTop:0},tooltipReact:{display:"flex",alignItems:"flex-start",gap:4,marginTop:6,paddingTop:6,borderTop:"1px solid ".concat(e.palette.border.faint),"&:first-child":{marginTop:0,paddingTop:0,borderTop:"none"}},tooltipReactIcon:{flex:"0 0 auto",marginTop:2},tooltipReactDetails:{flex:"1 1 auto",minWidth:0},tooltipQuote:{paddingLeft:6,marginTop:2,fontSize:"0.9em",color:e.palette.text.primary,display:"-webkit-box","-webkit-line-clamp":3,"-webkit-box-orient":"vertical",overflow:"hidden",textOverflow:"ellipsis"}}),{stylePriority:-1}),z=(0,d.gql)("\n  query KarmaChangePostBodies($selector: PostSelector, $limit: Int) {\n    posts(selector: $selector, limit: $limit, enableTotal: false) {\n      results {\n        _id\n        contents {\n          _id\n          htmlHighlight\n        }\n      }\n    }\n  }\n"),q=(0,d.gql)("\n  query KarmaChangeCommentBodies($selector: CommentSelector, $limit: Int) {\n    comments(selector: $selector, limit: $limit, enableTotal: false) {\n      results {\n        _id\n        contents {\n          _id\n          html\n        }\n      }\n    }\n  }\n");function U(e){var a,n;let{postChange:i,bodyHtml:o}=e;return(0,t.jsx)(E,{link:(0,N.postGetPageUrl)(i),scoreChange:i.scoreChange,addedReacts:i.addedReacts,description:null!=(a=i.title)?a:"",tooltipTitle:null!=(n=i.title)?n:null,tooltipSubtitle:null,tooltipBodyHtml:o,tooltipBodyContentType:"postHighlight"})}function L(e){var a,n;
2let{commentChange:i,bodyHtml:o}=e;return(0,t.jsx)(E,{link:(0,S.commentGetPageUrlFromIds)({postId:i.postId,tagSlug:i.tagSlug,tagCommentType:i.tagCommentType,commentId:i._id}),scoreChange:i.scoreChange,addedReacts:i.addedReacts,description:null!=(a=i.description)?a:"",tooltipTitle:null,tooltipSubtitle:null!=(n=i.postTitle)?n:null,tooltipBodyHtml:o,tooltipBodyContentType:"comment"})}function W(e){var a,n,i;let{tagChange:o}=e,s=(0,x.useCurrentUser)();return(0,t.jsx)(E,{link:"".concat((0,b.tagGetHistoryUrl)({slug:null!=(a=o.tagSlug)?a:""}),"?user=").concat(s.slug),scoreChange:o.scoreChange,addedReacts:o.addedReacts,description:null!=(n=o.tagName)?n:"",tooltipTitle:null!=(i=o.tagName)?i:null,tooltipSubtitle:null,tooltipBodyHtml:null,tooltipBodyContentType:null})}function H(e){var a;let{title:i,subtitle:o,bodyHtml:s,bodyContentType:r,addedReacts:d}=e,c=(0,p.useStyles)(G),u=!!(i||o),m=!!(s&&r),g=!!(d&&d.length);if(!u&&!m&&!g)return null;let h=m?(0,C.truncate)(s,100,"words"):null;return(0,t.jsxs)(n.Card,{className:c.tooltipCard,children:[u&&(0,t.jsxs)("div",{className:c.tooltipHeader,children:[i&&(0,t.jsx)("div",{className:c.tooltipTitle,children:i}),o&&(0,t.jsx)("div",{className:c.tooltipSubtitle,children:o})]}),h&&r&&(0,t.jsx)("div",{className:c.tooltipBody,children:(0,t.jsx)(I.default,{contentType:r,className:"comment"===r?c.tooltipCommentBody:c.tooltipHighlight,children:(0,t.jsx)(F.ContentItemBody,{dangerouslySetInnerHTML:{__html:h},description:null!=(a=null!=i?i:o)?a:"karma change preview"})})}),g&&(0,t.jsx)("div",{className:(0,l.default)(c.tooltipReacts,(u||m)&&c.tooltipReactsAfterBody),children:null==d?void 0:d.map((e,a)=>{var n,i,o;return(0,t.jsxs)("div",{className:c.tooltipReact,children:[(0,t.jsx)("span",{className:c.tooltipReactIcon,children:(0,t.jsx)(R.default,{react:e.reactionType})}),(0,t.jsxs)("div",{className:c.tooltipReactDetails,children:[(0,t.jsx)(P.default,{documentId:null!=(n=e.userId)?n:void 0}),e.quote&&(0,t.jsx)("div",{className:c.tooltipQuote,children:e.quote})]})]},"".concat(null!=(i=e.userId)?i:"anon","-").concat(e.reactionType,"-").concat(null!=(o=e.quote)?o:"","-").concat(a))})})]})}function E(e){var a;let{link:n,scoreChange:i,addedReacts:o,description:s,tooltipTitle:l,tooltipSubtitle:r,tooltipBodyHtml:d,tooltipBodyContentType:c}=e,u=(0,p.useStyles)(G),m=(0,x.useCurrentUser)(),g=(null==m||null==(a=m.karmaChangeNotifierSettings)?void 0:a.showNegativeKarma)===!1,h=!!(l||r||d||(null==o?void 0:o.length)),y=(0,t.jsxs)(j.MenuItemLink,{className:u.votedItemRow,to:n,children:[(i>0||!g&&0!==i)&&(0,t.jsx)("span",{className:u.votedItemScoreChange,children:(0,t.jsx)(f,{n:i})}),(0,t.jsx)(A,{reactionChanges:o}),(0,t.jsx)("div",{className:u.votedItemDescription,children:s})]});return h?(0,t.jsx)(T.default,{title:(0,t.jsx)(H,{title:l,subtitle:r,bodyHtml:d,bodyContentType:c,addedReacts:o}),placement:"left-start",inlineBlock:!1,As:"div",clickable:!0,tooltip:!1,hideOnTouchScreens:!0,children:y}):y}let $=e=>{var a,n,i,o,s,l,d,c,u;let{karmaChanges:m,handleClose:g}=e,{forumType:h}=(0,v.useForumType)(),y=(0,p.useStyles)(G),{posts:f,comments:x,tagRevisions:j,updateFrequency:S}=m,N=!(f&&f.length>0||x&&x.length>0||j&&j.length>0),b=(0,O.getKarmaNotificationTimingChoices)(h),C=(null!=f?f:[]).map(e=>e.postId),{data:I}=(0,r.useQuery)(z,{variables:{selector:{default:{exactPostIds:C}},limit:C.length},skip:0===C.length}),F=new Map;for(let e of null!=(a=null==I||null==(i=I.posts)?void 0:i.results)?a:[])(null==(c=e.contents)?void 0:c.htmlHighlight)&&F.set(e._id,e.contents.htmlHighlight);let T=(null!=x?x:[]).map(e=>e._id),{data:D}=(0,r.useQuery)(q,{variables:{selector:{default:{commentIds:T}},limit:T.length},skip:0===T.length}),M=new Map;for(let e of null!=(n=null==D||null==(o=D.comments)?void 0:o.results)?n:[])(null==(u=e.contents)?void 0:u.html)&&M.set(e._id,e.contents.html);return(0,t.jsxs)(w.Typography,{variant:"body2",children:[N?(0,t.jsx)("span",{className:y.title,children:b[S].emptyText}):(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:y.title,children:b[S].infoText}),(0,t.jsxs)("div",{className:y.votedItems,children:[null==(s=m.posts)?void 0:s.map(e=>{var a;return(0,t.jsx)(U,{postChange:e,bodyHtml:null!=(a=F.get(e.postId))?a:null},e._id)}),null==(l=m.comments)?void 0:l.map(e=>{var a;return(0,t.jsx)(L,{commentChange:e,bodyHtml:null!=(a=M.get(e._id))?a:null},e._id)}),null==(d=m.tagRevisions)?void 0:d.map(e=>(0,t.jsx)(W,{tagChange:e},e._id))]})]}),(0,t.jsx)(k.Link,{to:"/account",onClick:g,children:(0,t.jsx)("span",{className:y.settings,children:"Change Settings"})})]})};var K=e.i(903780),_=e.i(417222),V=e.i(937636),Y=e.i(189584),Q=e.i(558467),J=e.i(181832);let X=(0,h.defineStyles)("KarmaChangeNotifier",e=>({root:{display:"flex",alignItems:"center"},placeholder:{},karmaNotifierButton:{},karmaNotifierPaper:{}
2,karmaNotifierPopper:{zIndex:e.zIndexes.karmaChangeNotifier},starIcon:{color:e.palette.header.text,...(0,J.isIfAnyoneBuildsItFrontPage)({color:e.palette.text.bannerAdOverlay})},pointBadge:{fontSize:"0.9rem"}}),{stylePriority:-1}),Z=(0,d.gql)("\n  query KarmaChangeNotifier($documentId: String) {\n    user(input: { selector: { documentId: $documentId } }) {\n      result {\n        ...UserKarmaChanges\n      }\n    }\n  }\n"),ee=(0,d.gql)("\n  mutation karmaChangesCheckedKarmaChangeNotifier($startDate: Date, $endDate: Date) {\n    karmaChangesChecked(startDate: $startDate, endDate: $endDate)\n  }\n"),et=e=>{var d;let{className:m,onOpen:g,notificationOpen:h}=e,y=(0,p.useStyles)(X),v=(0,x.useCurrentUser)(),[j]=(0,Q.useMutationNoCache)(ee),[w,S]=(0,a.useState)(!1),[N,b]=(0,a.useState)(!1),k=(0,a.useRef)(null),{captureEvent:C}=(0,s.useTracking)(),[I,F]=(0,a.useState)((null==v?void 0:v.karmaChangeLastOpened)||new Date),{data:T}=(0,r.useSuspenseQuery)(Z,{variables:{documentId:v._id}}),D=null==T||null==(d=T.user)?void 0:d.result,[M,R]=(0,a.useState)(null==D?void 0:D.karmaChanges);(0,a.useEffect)(()=>{h&&b(!1)},[h]);let P=()=>{b(!1),v&&(null==D?void 0:D.karmaChanges)&&(j({variables:{startDate:D.karmaChanges.startDate,endDate:D.karmaChanges.endDate}}),"realtime"===D.karmaChanges.updateFrequency&&S(!0))};if(!D)return(0,t.jsx)(ea,{});let O=M||D.karmaChanges;if(!O)return(0,t.jsx)(ea,{});let{karmaChangeNotifierSettings:B}=v;if(B&&"disabled"===B.updateFrequency)return null;let{posts:A,comments:G,tagRevisions:z,endDate:q,totalChange:U}=O,L=new Date(I||0)<new Date(q||0),W=!(null==G?void 0:G.length)&&!(null==A?void 0:A.length)&&!(null==z?void 0:z.length)||w||!L;return(0,t.jsx)(s.AnalyticsContext,{pageSection:"karmaChangeNotifer",children:(0,t.jsxs)("div",{className:(0,l.default)(y.root,m),children:[(0,t.jsx)("div",{ref:k,children:(0,t.jsx)(i.default,{onClick:()=>{N?P():(b(!0),F(new Date),null==g||g()),C("karmaNotifierToggle",{open:!N,karmaChangeLastOpened:I,karmaChanges:M})},className:y.karmaNotifierButton,children:W?(0,t.jsx)(u.default,{icon:"KarmaOutline",className:y.starIcon}):(0,t.jsx)(o.Badge,{badgeContent:(0,t.jsx)("span",{className:y.pointBadge,children:!!U&&(0,t.jsx)(f,{n:U})}),children:(0,t.jsx)(u.default,{icon:"Karma",className:y.starIcon})})})}),(0,t.jsx)(K.default,{open:N,anchorEl:k.current,placement:"bottom-end",className:y.karmaNotifierPopper,children:(0,t.jsx)(c.default,{onClickAway:P,children:(0,t.jsx)(n.Paper,{className:y.karmaNotifierPaper,children:(0,t.jsx)($,{karmaChanges:O,handleClose:P})})})})]})})},ea=e=>{let{className:a}=e,n=(0,p.useStyles)(X);return(0,t.jsx)("div",{className:(0,l.default)(n.root,n.placeholder,a),children:(0,t.jsx)(i.default,{className:n.karmaNotifierButton,children:(0,t.jsx)(u.default,{icon:"KarmaOutline",className:n.starIcon})})})};e.s(["KarmaChangeNotifier",0,e=>{let{className:a,onOpen:n,notificationOpen:i}=e,{pathname:o}=(0,V.useLocation)(),s=(0,Y.canonicalizePath)(o);return(0,t.jsx)(g.default,{children:(0,t.jsx)(m.SuspenseWrapper,{name:"KarmaChangeNotifier",fallback:(0,t.jsx)(ea,{className:a}),children:(0,t.jsx)(_.default,{ssr:!!s,fallback:(0,t.jsx)(ea,{className:a}),children:(0,t.jsx)(et,{className:a,onOpen:n,notificationOpen:i})})})})},"UserKarmaChangesQuery",0,Z],62784)},301100,e=>{"use strict";var t=e.i(843476),a=e.i(182584),n=e.i(566721),i=e.i(422046),o=e.i(831195),s=e.i(495314),l=e.i(797341),r=e.i(681387),d=e.i(11422),c=e.i(161432),u=e.i(35693),m=e.i(898892),g=e.i(973327);let p=async(e,t,a)=>{var n;return null==(n=await y(e,t,a))?void 0:n.document};async function h(e,t){var a,n;let{Tags:i,Posts:o}=t;return e.postId?null==(a=await o.findOne(e.postId))?void 0:a.title:e.tagId?null==(n=await i.findOne(e.tagId))?void 0:n.name:"Unknown Parent"}let y=async(e,t,i)=>{var o,s;if(!t)return null;let{Posts:l,Comments:d,Users:c,Messages:u,Conversations:m,Localgroups:g,TagRels:p,Sequences:y}=i;switch(e){case"post":let f=await l.findOne(t);return f&&{type:e,document:f,displayName:f.title,associatedUserName:await (0,a.postGetAuthorName)(f,i)};case"comment":let x=await d.findOne(t);return x&&{type:e,document:x,displayName:await h(x,i),associatedUserName:await (0,n.commentGetAuthorName)(x,i)};case"user":let v=await c.findOne(t);return v&&{type:e,document:v,displayName:(0,r.userGetDisplayName)(v,i.forumType),associatedUserName:(0,r.userGetDisplayName)(v,i.forumType)};case"message":let j=await u.findOne(t);if(!j)return null;let w=await m.findOne(j.conversationId),S=await c.findOne(j.userId);return{type:e,document:j,displayName:null!=(o=null==w?void 0:w.title)?o:void 0,associatedUserName:(0,r.userGetDisplayName)(S,i.forumType)};case"localgroup":let N=await g.findOne(t);return N&&{type:e,document:N,displayName:null!=(s=N.name)?s:"[missing local group name]",associatedUserName:null};case"tagRel":let b=await p.findOne(t);
2return b&&{type:e,document:b,displayName:null,associatedUserName:null};case"sequence":let k=await y.findOne(t);return k&&{type:e,document:k,displayName:null,associatedUserName:null};case"dialogueCheck":case"dialogueMatchPreference":case"typoSuggestion":case"researchDocument":return null;default:return console.error("Invalid documentType type: ".concat(e)),null}},f=async e=>{let{documentType:t,documentId:a,context:n}=e,{Tags:i,Posts:o}=n,s=await p(t,a,n),l=await i.findOne({_id:s.tagId}),r=await o.findOne({_id:s.postId});return"New post tagged '".concat(null==l?void 0:l.name,": ").concat(null==r?void 0:r.title,"'")};async function x(e,t){var n,i,o;if(!e)return null;let s=await t.TypoSuggestions.findOne(e);if(!s)return null;let[l,r,d]=await Promise.all([s.voteId?t.loaders.Votes.load(s.voteId):Promise.resolve(null),"Posts"===s.collectionName?t.loaders.Posts.load(s.documentId):Promise.resolve(null),"Comments"===s.collectionName?t.loaders.Comments.load(s.documentId):Promise.resolve(null)]),[c,u]=await Promise.all([l?t.loaders.Users.load(l.userId):Promise.resolve(null),(null==d?void 0:d.postId)?t.loaders.Posts.load(d.postId):Promise.resolve(null)]),m=null!=(n=null==c?void 0:c.displayName)?n:"A reader",g="your post",p="/notifications";if("Posts"===s.collectionName&&r){let e=(null==(i=r.title)?void 0:i.trim())||"(untitled)";g='your post "'.concat(e,'"'),p=(0,a.postGetPageUrl)(r)}else if("Comments"===s.collectionName&&d)if(u){let e=(null==(o=u.title)?void 0:o.trim())||"(untitled)";g='your comment on "'.concat(e,'"'),p="".concat((0,a.postGetPageUrl)(u),"?commentId=").concat(d._id)}else g="your comment";return{reactorName:m,targetDescription:g,targetUrl:p}}let v=e=>{let{allowedChannels:t=["onsite","email"],...a}=e;return{allowedChannels:t,...a}},j=v({name:"newPost",userSettingField:"notificationSubscribedUserPost",async getMessage(e){let{documentType:t,documentId:n,context:i}=e,o=await p(t,n,i);return await (0,a.postGetAuthorName)(o,i)+" has created a new post: "+o.title},Display:e=>{let{User:a,Post:n}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a,{})," created a new post ",(0,t.jsx)(n,{})]})}}),w=v({name:"newUserComment",userSettingField:"notificationSubscribedUserComment",async getMessage(e){let{documentType:t,documentId:a,context:i}=e,o=await p(t,a,i);return await (0,n.commentGetAuthorName)(o,i)+" left a new comment on the post "+await h(o,i)},Display:e=>{let{User:a,Comment:n}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a,{})," left a new ",(0,t.jsx)(n,{})]})}}),S=v({name:"postApproved",userSettingField:null,async getMessage(e){let{documentType:t,documentId:a,context:n}=e;return'Your post "'+(await p(t,a,n)).title+'" has been approved'},Display:e=>{let{Post:a}=e;return(0,t.jsxs)(t.Fragment,{children:["Your post ",(0,t.jsx)(a,{})," has been approved"]})}}),N=v({name:"postNominated",userSettingField:"notificationPostsNominatedReview",async getMessage(e){let{documentType:t,documentId:a,context:n}=e,i=await p(t,a,n);return"Your post is nominated for the ".concat((0,s.getReviewNameInSitu)(),': "').concat(i.title,'"')}}),b=v({name:"newEvent",userSettingField:"notificationPostsInGroups",async getMessage(e){let{documentType:t,documentId:n,context:i}=e,{Localgroups:o}=i,s=await p(t,n,i),l=null;return("post"===t&&s.groupId&&(l=await o.findOne(s.groupId)),l)?"".concat(l.name," posted a new event"):await (0,a.postGetAuthorName)(s,i)+" has created a new event"},Display:e=>{let{User:a,Localgroup:n,notification:{post:i}}=e;return(0,t.jsxs)(t.Fragment,{children:[(null==i?void 0:i.groupId)?(0,t.jsx)(n,{}):(0,t.jsx)(a,{})," has created a new event"]})}}),k=v({name:"newGroupPost",userSettingField:"notificationPostsInGroups",async getMessage(e){let{documentType:t,documentId:n,context:i}=e,{Localgroups:o}=i,s=await p(t,n,i),l=null;return("post"===t&&s.groupId&&(l=await o.findOne(s.groupId)),l)?await (0,a.postGetAuthorName)(s,i)+' has created a new post in the group "'+l.name+'"':await (0,a.postGetAuthorName)(s,i)+" has created a new post in a group"},Display:e=>{let{User:a,Localgroup:n,notification:{post:i}}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a,{})," has created a new post in ",(null==i?void 0:i.group)?(0,t.jsxs)(t.Fragment,{children:["the group ",(0,t.jsx)(n,{})]}):(0,t.jsx)(t.Fragment,{children:"a group"})]})}}),C=v({name:"newComment",userSettingField:"notificationCommentsOnSubscribedPost",async getMe
2ssage(e){let{documentType:t,documentId:a,context:i}=e,o=await p(t,a,i);return await (0,n.commentGetAuthorName)(o,i)+' left a new comment on "'+await h(o,i)+'"'},Display:e=>{let{User:a,Comment:n,Post:i}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a,{})," left a new ",(0,t.jsx)(n,{})," on ",(0,t.jsx)(i,{})]})}}),I=v({name:"newSubforumComment",userSettingField:"notificationSubforumUnread",async getMessage(e){let{documentType:t,documentId:a,context:i}=e,o=await p(t,a,i);return"".concat((0,l.default)(await h(o,i)),": ").concat(await (0,n.commentGetAuthorName)(o,i)," left a new comment")},Display:e=>{let{User:a,Comment:n,Post:i}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a,{})," left a new ",(0,t.jsx)(n,{})," on ",(0,t.jsx)(i,{})]})}}),F=v({name:"newDialogueMessages",userSettingField:"notificationDialogueMessages",async getMessage(e){var t;let{documentType:a,documentId:n,extraData:i,context:o}=e,s=null==i?void 0:i.newMessageAuthorId,l=await p(a,n,o),d=null!=(t=await p("user",s,o))?t:"[Missing Author Name]";return(0,r.userGetDisplayName)(d,o.forumType)+' left a new reply in your dialogue "'+l.title+'"'},getLink:e=>{let{documentId:t}=e;return"/editPost?postId=".concat(t)},causesRedBadge:()=>!0,Display:e=>{let{User:a,Post:n}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a,{})," left a new reply in your dialogue ",(0,t.jsx)(n,{})]})}}),T=v({name:"newDialogueBatchMessages",userSettingField:"notificationDialogueMessages",async getMessage(e){let{documentType:t,documentId:a,context:n}=e;return'Multiple new messages in your dialogue "'+(await p(t,a,n)).title+'"'},getLink:e=>{let{documentId:t}=e;return"/editPost?postId=".concat(t)},Display:e=>{let{Post:a}=e;return(0,t.jsxs)(t.Fragment,{children:["Multiple new messages in your dialogue ",(0,t.jsx)(a,{})]})}}),D=v({name:"newPublishedDialogueMessages",userSettingField:"notificationPublishedDialogueMessages",async getMessage(e){let{documentType:t,documentId:a,context:n}=e,i=await p(t,a,n);return'New content in the dialogue "'.concat(i.title,'"')},causesRedBadge:()=>!1,Display:e=>{let{Post:a}=e;return(0,t.jsxs)(t.Fragment,{children:["New content in the dialogue ",(0,t.jsx)(a,{})]})}}),M=v({name:"newDialogueMatch",userSettingField:"notificationDialogueMatch",async getMessage(e){let{documentType:t,documentId:a}=e;return"This is an old notification for a deprecated feature."}}),R=v({name:"newDialogueChecks",userSettingField:"notificationNewDialogueChecks",allowedChannels:["onsite"],getMessage:async e=>"This is an old notification for a deprecated feature."}),P=v({name:"yourTurnMatchForm",userSettingField:"notificationYourTurnMatchForm",allowedChannels:["onsite"],async getMessage(e){let{documentType:t,documentId:a}=e;return"This is an old notification for a deprecated feature."}}),O=v({name:"newDebateComment",userSettingField:"notificationDebateCommentsOnSubscribedPost",async getMessage(e){let{documentType:t,documentId:a,context:i}=e,o=await p(t,a,i);return await (0,n.commentGetAuthorName)(o,i)+' left a new reply on the dialogue "'+await h(o,i)+'"'}}),B=v({name:"newDebateReply",userSettingField:"notificationDebateReplies",async getMessage(e){let{documentType:t,documentId:a,context:i}=e,o=await p(t,a,i);return await (0,n.commentGetAuthorName)(o,i)+' left a new reply on the dialogue "'+await h(o,i)+'"'},causesRedBadge:()=>!0}),A=v({name:"newShortform",userSettingField:"notificationShortformContent",async getMessage(e){let{documentType:t,documentId:a,context:n}=e,i=await p(t,a,n);return'New comment on "'+await h(i,n)+'"'},Display:e=>{let{User:a,Comment:n,Post:i}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a,{})," left a new ",(0,t.jsx)(n,{})," on ",(0,t.jsx)(i,{})]})}}),G=v({name:"newTagPosts",userSettingField:"notificationSubscribedTagPost",async getMessage(e){let{documentType:t,documentId:a,context:n}=e;return await f({documentType:t,documentId:a,context:n})},Display:e=>{let{Tag:a,Post:n}=e;return(0,t.jsxs)(t.Fragment,{children:["New post tagged ",(0,t.jsx)(a,{}),": ",(0,t.jsx)(n,{})]})}}),z=v({name:"newSequencePosts",userSettingField:"notificationSubscribedSequencePost",async getMe
2ssage(e){let{documentType:t,documentId:a,context:n}=e,i=await p(t,a,n);return"Posts added to ".concat(i.title)},getLink(e){let{documentId:t}=e;return t?(0,c.sequenceGetPageUrl)({_id:t}):"#"},Display:e=>{let{Sequence:a}=e;return(0,t.jsxs)(t.Fragment,{children:["Posts added to ",(0,t.jsx)(a,{})]})}}),q=v({name:"newReply",userSettingField:"notificationRepliesToSubscribedComments",async getMessage(e){let{documentType:t,documentId:a,context:i}=e,o=await p(t,a,i);return await (0,n.commentGetAuthorName)(o,i)+' replied to a comment on "'+await h(o,i)+'"'},Display:e=>{let{User:a,Comment:n,Post:i}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a,{})," replied to a ",(0,t.jsx)(n,{})," on ",(0,t.jsx)(i,{})]})}}),U=v({name:"newReplyToYou",userSettingField:"notificationRepliesToMyComments",async getMessage(e){let{documentType:t,documentId:a,context:i,extraData:o}=e,s=await p(t,a,i);return(null==o?void 0:o.direct)===!1?await (0,n.commentGetAuthorName)(s,i)+" replied to a thread you're in on \""+await h(s,i)+'"':await (0,n.commentGetAuthorName)(s,i)+' replied to your comment on "'+await h(s,i)+'"'},Display:e=>{var a;let{notification:n,User:i,Comment:o,Post:s}=e,l=(null==(a=n.extraData)?void 0:a.direct)!==!1;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i,{})," replied to ",l?"your comment":"a thread you're in"," on ",(0,t.jsx)(s,{})]})}}),L=v({name:"newUser",userSettingField:null,async getMessage(e){let{documentType:t,documentId:a,context:n}=e;return(await p(t,a,n)).displayName+" just signed up!"},Display:e=>{let{User:a}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a,{})," just signed up"]})}}),W=v({name:"newMessage",userSettingField:"notificationPrivateMessage",async getMessage(e){var t;let{documentType:a,documentId:n,context:i}=e,{Users:o,Conversations:s}=i,l=await p(a,n,i),r=await s.findOne(l.conversationId);return(null==(t=await o.findOne(l.userId))?void 0:t.displayName)+" sent you a new message"+((null==r?void 0:r.title)?" in the conversation "+r.title:"")+"!"},causesRedBadge:()=>!0}),H=v({name:"newMessageReaction",userSettingField:"notificationPrivateMessage",async getMessage(e){let{documentType:t,documentId:a,extraData:n,context:i}=e,{Users:o,Conversations:s}=i,l=await p(t,a,i),d=await s.findOne(l.conversationId),c=(null==n?void 0:n.reactorId)?await o.findOne(n.reactorId):null,u=c?(0,r.userGetDisplayName)(c,i.forumType):"Someone",m=(null==n?void 0:n.reactLabel)?' "'.concat(n.reactLabel,'"'):"";return"".concat(u," reacted").concat(m," to your message")+((null==d?void 0:d.title)?" in the conversation "+d.title:"")},Display:e=>{var a,n,i;let{notification:o,LazyUser:s}=e,l=null==(n=o.extraData)?void 0:n.reactorId,r=null==(i=o.extraData)?void 0:i.reactLabel;return(0,t.jsxs)(t.Fragment,{children:[l?(0,t.jsx)(s,{userId:l}):"Someone"," reacted",r?' "'.concat(r,'"'):""," to your ",(0,t.jsx)(d.Link,{to:null!=(a=o.link)?a:"/inbox",children:"message"})]})}}),E=v({name:"wrapped",userSettingField:null,async getMessage(e){var t;let{extraData:a}=e;return"Check out your ".concat(null!=(t=null==a?void 0:a.year)?t:2023," EA Forum Wrapped")},getLink:()=>"/wrapped",Display:e=>{var a;let{notification:{link:n,extraData:i}}=e;return(0,t.jsxs)(t.Fragment,{children:["Check out your ",null!=(a=null==i?void 0:i.year)?a:2023," ",(0,t.jsx)(d.Link,{to:n,children:"EA Forum Wrapped"})]})}}),$=v({name:"emailVerificationRequired",userSettingField:null,async getMessage(e){let{documentType:t,documentId:a}=e;return"Verify your email address to activate email subscriptions."},Display:()=>(0,t.jsx)(t.Fragment,{children:"Verify your email address to activate email subscriptions"})}),K=v({name:"postSharedWithUser",userSettingField:"notificationSharedWithMe",async getMessage(e){let{documentType:t,documentId:n,context:i}=e,o=await p(t,n,i),s=await (0,a.postGetAuthorName)(o,i);return"".concat(s," shared their ").concat(o.draft?"draft":"post",' "').concat(o.title,'" with you')},getLink:e=>{let{documentType:t,documentId:n,extraData:i}=e;if(!n)throw Error("PostSharedWithUserNotification documentId is missing");return(0,a.postGetEditUrl)(n)},Display:e=>{let{User:a,Post:n,notification:{post:i}}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a,{})," shared their ",(null==i?void 0:i.draft)?"draft":"post"," ",(0,t.jsx)(n,{})," with you"]})}}),_=v({name:"addedAsCoauthor",userSettingField:"notificationAddedAsCoauthor",async getMe
2ssage(e){let{documentType:t,documentId:n,context:i}=e,o=await p(t,n,i),s=await (0,a.postGetAuthorName)(o,i),l=o.collabEditorDialogue?"dialogue":"post";return"".concat(s," added you as a coauthor to the ").concat(l,' "').concat(o.title,'"')},getLink:e=>{let{documentType:t,documentId:n,extraData:i}=e;if(!n)throw Error("PostAddedAsCoauthorNotification documentId is missing");return(0,a.postGetEditUrl)(n)},Display:e=>{let{User:a,Post:n,notification:{post:i}}=e,o=(null==i?void 0:i.collabEditorDialogue)?"dialogue":"post";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a,{})," added you as a coauthor to the ",o," ",(0,t.jsx)(n,{})]})}}),V=v({name:"alignmentSubmissionApproved",userSettingField:"notificationAlignmentSubmissionApproved",async getMessage(e){let{documentType:t,documentId:a,context:n}=e;if("comment"===t)return"Your comment has been accepted to the Alignment Forum";if("post"===t){let e=await p(t,a,n);return"Your post has been accepted to the Alignment Forum: ".concat(e.title)}throw Error("documentType must be post or comment!")}}),Y=v({name:"newEventInRadius",userSettingField:"notificationEventInRadius",async getMessage(e){let{documentType:t,documentId:a,context:n}=e,i=await p(t,a,n);return"New event in your area: ".concat(i.title)},Display:e=>{let{Post:a}=e;return(0,t.jsxs)(t.Fragment,{children:["New event in your area: ",(0,t.jsx)(a,{})]})}}),Q=v({name:"editedEventInRadius",userSettingField:"notificationEventInRadius",async getMessage(e){let{documentType:t,documentId:a,context:n}=e,i=await p(t,a,n);return"Event in your area updated: ".concat(i.title)},Display:e=>{let{Post:a}=e;return(0,t.jsxs)(t.Fragment,{children:["Event in your area updated: ",(0,t.jsx)(a,{})]})}}),J=v({name:"newRSVP",userSettingField:"notificationRSVPs",async getMessage(e){let{documentType:t,documentId:a,context:n}=e,s=await p(t,a,n),l=s.rsvps||[],r=(0,o.default)(l,e=>e.createdAt)[l.length-1];return"".concat(r.name,' responded "').concat(i.responseToText[r.response],'" to your event ').concat(s.title)},Display:e=>{var a;let{Post:n,LazyUser:i,notification:{post:s}}=e,l=null!=(a=null==s?void 0:s.rsvps)?a:[],r=(0,o.default)(l,e=>e.createdAt)[l.length-1];return(null==r?void 0:r.userId)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i,{userId:r.userId})," responded to your event ",(0,t.jsx)(n,{})]}):(0,t.jsxs)(t.Fragment,{children:["Someone responded to your event ",(0,t.jsx)(n,{})]})}}),X=v({name:"karmaPowersGained",userSettingField:"notificationKarmaPowersGained",getMessage:async()=>"Your votes are stronger because your karma went up!",getLink:()=>(0,u.tagGetUrl)({slug:"vote-strength"})}),Z=v({name:"cancelledRSVP",userSettingField:"notificationRSVPs",async getMessage(e){let{documentType:t,documentId:a,context:n}=e,i=await p(t,a,n);return"Someone cancelled their RSVP to your event ".concat(i.title)},Display:e=>{let{Post:a}=e;return(0,t.jsxs)(t.Fragment,{children:["Someone cancelled their RSVP to your event ",(0,t.jsx)(a,{})]})}}),ee=v({name:"newGroupOrganizer",userSettingField:"notificationGroupAdministration",async getMessage(e){let{documentType:t,documentId:a,context:n}=e,{Localgroups:i}=n;if("localgroup"!==t)throw Error("documentType must be localgroup");let o=await i.findOne(a);if(!o)throw Error("Cannot find local group for which this notification is being sent");return"You've been added as an organizer of ".concat(o.name)},Display:e=>{let{Localgroup:a}=e;return(0,t.jsxs)(t.Fragment,{children:["You've been added as an organizer of ",(0,t.jsx)(a,{})]})}}),et=v({name:"newCommentOnDraft",userSettingField:"notificationCommentsOnDraft",async getMessage(e){let{documentType:t,documentId:a,context:n}=e,i=await p(t,a,n);return"New comments on your draft ".concat(i.title)},getLink:e=>{let{documentType:t,documentId:n,extraData:i}=e;if(!n)throw Error("NewCommentOnDraftNotification documentId is missing");let{linkSharingKey:o}=i;return(0,a.postGetEditUrl)(n,o)},Display:e=>{let{Post:a}=e;return(0,t.jsxs)(t.Fragment,{children:["New comments on your draft ",(0,t.jsx)(a,{})]})}}),ea=v({name:"newCommentOnResearchDoc",userSettingField:null,allowedChannels:["onsite"],async getMe
2ssage(e){let{documentId:t,context:a}=e,n=t?await a.ResearchDocuments.findOne(t):null;return(null==n?void 0:n.title)?"New comments on your research document ".concat(n.title):"New comments on your research document"},getLink:e=>{let{documentId:t,extraData:a}=e;return t&&(null==a?void 0:a.projectId)?"/research/projects/".concat(a.projectId,"?documentId=").concat(t):"/notifications"},Display:()=>(0,t.jsx)(t.Fragment,{children:"New comments on your research document"})}),en=v({name:"coauthorRequestNotification",userSettingField:"notificationSharedWithMe",async getMessage(e){let{documentType:t,documentId:n,context:i}=e,o=await p(t,n,i),s=await (0,a.postGetAuthorName)(o,i);return"".concat(s," requested that you co-author their post: ").concat(o.title)},Display:e=>{let{User:a,Post:n}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a,{})," requested that you co-author their post ",(0,t.jsx)(n,{})]})}}),ei=v({name:"coauthorAcceptNotification",userSettingField:"notificationSharedWithMe",async getMessage(e){let{documentType:t,documentId:a,context:n}=e,i=await p(t,a,n);return"Your co-author request for '".concat(i.title,"' was accepted")},Display:e=>{let{Post:a}=e;return(0,t.jsxs)(t.Fragment,{children:["Your co-author request for ",(0,t.jsx)(a,{})," was accepted"]})}}),eo=v({name:"typoSuggestion",userSettingField:"notificationTypoSuggestions",async getMessage(e){let{documentId:t,context:a}=e,n=await x(null!=t?t:null,a);return n?"".concat(n.reactorName," flagged a possible typo in ").concat(n.targetDescription,", and AI proposed a fix."):"A reader flagged a possible typo and AI proposed a fix."},Display:()=>(0,t.jsx)(t.Fragment,{children:"A reader flagged a possible typo and AI proposed a fix."})}),es=v({name:"newMention",userSettingField:"notificationNewMention",async getMessage(e){let{documentType:t,documentId:a,context:n}=e,i=await y(t,a,n);return"".concat(null==i?void 0:i.associatedUserName," mentioned you in ").concat(null==i?void 0:i.displayName)},Display:e=>{let{User:a,Comment:n,Post:i,Tag:o,notification:{comment:s,tag:l}}=e;return l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a,{})," mentioned you in ",(0,t.jsx)(o,{})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a,{})," mentioned you in ",s?(0,t.jsxs)(t.Fragment,{children:["their ",(0,t.jsx)(n,{})," on "]}):"",(0,t.jsx)(i,{})]})}}),el=(0,g.default)([j,w,S,N,b,k,C,I,F,T,D,M,R,P,O,B,A,G,z,q,U,L,W,H,E,$,K,_,V,Y,Q,J,X,Z,ee,et,ea,en,ei,es,eo],e=>e.name),er=function(e){let t={};for(let a of Object.values(e)){let{userSettingField:e}=a;if(e){let n=t[e];n&&!(0,m.default)(n.allowedChannels,a.allowedChannels)&&console.error('Error: Conflicting channels for notifications using "'.concat(e,'"')),t[e]=a}}return t}(el);function ed(e){return e in el}e.s(["getNotificationTypeByName",0,e=>{if(ed(e))return el[e];throw Error("Invalid notification type: ".concat(e))},"getNotificationTypeByUserSetting",0,e=>{let t=er[e];if(!t)throw Error("Setting does not correspond to a notification type");return t},"isNotificationTypeName",0,ed],301100)},33055,775942,e=>{"use strict";var t=e.i(843476),a=e.i(343794),n=e.i(965448),i=e.i(339213);let o=(0,i.default)((0,t.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),s=(0,i.default)((0,t.jsx)("path",{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonChecked");var l=e.i(79732);let r=(0,e.i(429329).defineStyles)("MuiRadio",e=>({root:{color:e.palette.text.secondary},checked:{},disabled:{},colorPrimary:{"&$checked":{color:e.palette.primary.main},"&$disabled":{color:e.palette.action.disabled}},colorSecondary:{"&$checked":{color:e.palette.secondary.main},"&$disabled":{color:e.palette.action.disabled}}}),{stylePriority:-10});e.s(["default",0,function(e){let{classes:i,color:d="secondary",...c}=e,u=(0,l.useStyles)(r,i);return(0,t.jsx)(n.default,{type:"radio",icon:(0,t.jsx)(o,{}),checkedIcon:(0,t.jsx)(s,{}),classes:{root:(0,a.default)(u.root,{[u.colorPrimary]:"primary"===d,[u.colorSecondary]:"secondary"===d}),checked:u.checked,disabled:u.disabled},...c})}],775942),e.s([],33055)},838630,e=>{"use strict";var t=e.i(843476),a=e.i(271645);let n=(0,e.i(339213).default)((0,t.jsxs)(a.default.Fragment,{children:[(0,t.jsx)("path",{fill:"none",d:"M0 0h24v24H0z"}),(0,t.jsx)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})]}),"Done");e.s(["default",0,n])},321888,e=>{"use strict";var t=e.i(843476),a=e.i(271645);let n=(0,e.i(339213).default)((0,t.jsxs)(a.default.Fragment,{children:[(0,t.jsx)("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"}),(0,t.jsx)("path",{fill:"none",d:"M0 0h24v24H0z"})]}),"Mail");e.s(["default",0,n])}]);
3
4//# debugId=633d8a38-c7b9-6d7f-c77b-77cd43adf7b6
5//# sourceMappingURL=3ylthn0kej4bk.js.map

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.