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]="9ffb7604-9c89-c996-122b-e546f604044a")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,282655,817048,e=>{"use strict";var t=e.i(478902),s=e.i(389959),i=e.i(197649),o=e.i(924965),n=e.i(917728),r=e.i(716521),a={full:"cmsirb3",compact:"cmsirb4",medium:"cmsirb5"},l={full:"cmsirbd cmsirbc",compact:"cmsirbe cmsirbc"},d={full:"cmsirbh cmsirbg",compact:"cmsirbi cmsirbg"},c=e.i(465149),u=e.i(599901),h=e.i(202340),p=e.i(777576),m=e.i(962973);let y=({displayType:e="compact"})=>{let{compositionSet:s}=(0,c.useContentLocationContext)(),y=s.get(c.ContentObjectType.FanPost);return(0,t.jsx)("div",{className:(0,i.default)(m.SELECTORS.NativeAdFanPost,"hidden",u.themeBackgroundColor,n.fanPostCard,n.hover),"data-native-ad-id":"container",children:(0,t.jsx)("a",{href:"/","aria-label":"Native Ad Placement",children:(0,t.jsxs)("div",{className:(0,i.default)(r.container,y?.feedPadding&&r.feedPadding),children:[(0,t.jsx)("div",{className:"visually-hidden",children:(0,t.jsx)("div",{className:"dynamic-native-ad-fan-post"})}),(0,t.jsxs)("div",{className:"cmsirbf",children:[(0,t.jsxs)("div",{className:p.container,children:[(0,t.jsx)("div",{className:(0,i.default)(o.avatarImage,o.avatar.small),children:(0,t.jsx)("img",{className:(0,i.default)(o.avatarImage,u.logoImage),alt:"logo","data-native-ad-id":"logo",src:""})}),(0,t.jsx)("div",{"data-native-ad-id":"brand_name",className:(0,i.default)(l[e])}),(0,t.jsx)("div",{className:d[e],children:"promoted"})]}),(0,t.jsxs)("div",{className:"cmsirbj",children:[(0,t.jsx)("div",{className:"cmsirbk",children:(0,t.jsx)("p",{"data-native-ad-id":"title",className:h.title[e]})}),(0,t.jsx)("div",{className:"cmsirb2",children:(0,t.jsxs)("div",{className:a[e],children:[(0,t.jsx)("span",{"data-native-ad-id":"cta"})," ",(0,t.jsx)("span",{children:">"})]})})]})]}),(0,t.jsx)("div",{className:r.attachmentContainer,children:(0,t.jsx)("div",{"data-native-ad-id":"small_thumbnail",className:"cmsirbb"})})]})})},"fan-post-list")};var f=e.i(88615),g={full:"zhu2ge4 zhu2ge3",compact:"zhu2ge5 zhu2ge3"},v={full:"zhu2ge6",compact:"zhu2ge7",medium:"zhu2ge8"},b={full:"zhu2geb zhu2gea",compact:"zhu2gec zhu2gea"},I={full:"zhu2geg zhu2gef",compact:"zhu2geh zhu2gef"},R={full:"zhu2gek zhu2gej",compact:"zhu2gel zhu2gej"};let D=({displayType:e="compact"})=>(0,t.jsx)("div",{className:(0,i.default)(m.SELECTORS.NativeAdFanPost,"hidden",u.themeBackgroun
2dColor,n.fanPostCard,n.hover),"data-native-ad-id":"container",children:(0,t.jsxs)("div",{className:f.container,children:[(0,t.jsx)("div",{className:"visually-hidden",children:(0,t.jsx)("div",{className:"dynamic-native-ad-fan-post"})}),(0,t.jsx)("a",{href:"/","aria-label":"Native Ad Placement",children:(0,t.jsxs)("div",{className:"",children:[(0,t.jsxs)("div",{className:p.container,children:[(0,t.jsx)("div",{className:(0,i.default)(o.avatarImage,o.avatar.large),children:(0,t.jsx)("img",{className:(0,i.default)(o.avatarImage,u.logoImage),alt:"logo","data-native-ad-id":"logo",src:""})}),(0,t.jsx)("div",{"data-native-ad-id":"brand_name",className:(0,i.default)(I[e])}),(0,t.jsx)("div",{className:R[e],children:"promoted"})]}),(0,t.jsx)("div",{className:f.contentContainer,children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"zhu2gei",children:[(0,t.jsx)("p",{"data-native-ad-id":"title",className:g[e]}),(0,t.jsx)("p",{"data-native-ad-id":"text",className:b[e]}),(0,t.jsx)("div",{className:(0,i.default)("zhu2ge2"),children:(0,t.jsxs)("div",{className:v[e],children:[(0,t.jsx)("span",{"data-native-ad-id":"cta"})," ",(0,t.jsx)("span",{children:">"})]})})]}),(0,t.jsx)("div",{className:"zhu2ged",children:(0,t.jsx)("div",{"data-native-ad-id":"large_thumbnail",className:"zhu2gee"})})]})})]})})]})},"fan-post-list");var k=e.i(198821);e.s(["default",0,({displayType:e="compact"})=>((0,s.useEffect)(()=>{(0,k.installAds)()},[]),(0,t.jsx)("div",{children:"full"===e?(0,t.jsx)(D,{displayType:e}):(0,t.jsx)(y,{displayType:e})}))],817048),e.s([],282655)},563281,e=>{"use strict";var t=e.i(478902),s=e.i(262653),i=e.i(197649),o=e.i(389959);e.i(807738);var n=e.i(738886),r=e.i(662983),a=e.i(970060);e.s(["Select",0,e=>{let{options:l,onChange:d,className:c}=e,[u,h]=(0,o.useState)(e.value),p=(0,o.useRef)(null),m=(0,o.useRef)(null),[y,f]=(0,o.useState)(!1),g=(0,o.useCallback)(e=>{h(e.value),p.current?.click(),d&&d(e)},[d,h]);(0,o.useEffect)(()=>{h(e.value)},[e.value,d,l]),(0,o.useEffect)(()=>{let e=m.current;if(!e)return;let t=()=>{f(e.hasAttribute("data-popup-open"))},s=new MutationObserver(t);return s.observe(e,{attributes:!0,attributeFilter:["data-popup-open"]}),t(),()=>{s.disconnect()}},[m]);let v=(0,o.useMemo)(()=>{for(let e of l)if(e.value===u)return e.display;return""},[l,u]);return(0,t.jsx)("div",{className:(0,i.default)("_1385n2o0",c),children:(0,t.jsxs)(s.Popover.Root,{children:[(0,t.jsx)(s.Popover.Trigger,{onClick:e=>{e.stopPropagation()},ref:m,children:(0,t.jsxs)("div",{className:"_1385n2o1",children:[(0,t.jsx)("span",{className:"_1385n2o2",children:v}),(0,t.jsx)(r.default,{height:12,width:12,className:(0,i.default)("_1385n2o5",y&&"_1385n2o6")})]})}),(0,t.jsx)(s.Popover.Portal,{children:(0,t.jsx)(s.Popover.Positioner,{sideOffset:8,className:"_1385n2oa",children:(0,t.jsx)(s.Popover.Popup,{className:"_1385n2o9",children:(0,t.jsx)("div",{className:"_1385n2o4",children:l.map(e=>(0,t.jsx)(n.default,{className:(0,i.default)("_1385n2o3",u===e.value&&"_1385n2o7"),text:e.display,displayType:"cycloneSecondary",onClick:()=>g(e)},e.value))})})})}),(0,t.jsx)(s.Popover.Close,{children:(0,t.jsx)("div",{ref:p,className:a.sharedStyles.layout.hide})})]})})}],563281)},225803,e=>{"use strict";var t=e.i(389959);e.s(["useCycloneThreadLoad",0,function({rootStore:e,load:s,authPending:i,viewerToken:o}){let n=(0,t.useRef)(null),r=(0,t.useRef)(void 0);(0,t.useEffect)(()=>{i||n.current===e||(n.current=e,o&&(e.setToken(o),r.current=o),s())},[i,s,e,o]),(0,t.useEffect)(()=>{o&&r.current!==o&&(e.setToken(o),r.current=o)},[e,o])},"useRunWhenAuthSettles",0,function(e,s,i){let o=(0,t.useRef)(null);(0,t.useEffect)(()=>{e||o.current===i||(o.current=i,s())},[e,s,i])}])},228837,e=>{"use strict";var t=e.i(389959),s=e.i(623690);e.i(807738);var i=e.i(738886);e.i(379067);var o=e.i(533329),n=e.i(970060),r="ka6at88",a="ka6at89",l="ka6at8a",d="ka6at8b",c=e.i(478902);e.s(["default",0,()=>{let{viewer:e,acknowledgeUserMessage:u}=(0,s.useCyclone)(),[h,p]=(0,t.useState)([]),m=e?.activeWarning,y=e?.activeMessages??[],f=(0,t.useCallback)(async e=>{p(t=>[...t,e]);try{await u(e)}finally{p(t=>t.filter(t=>t!==e))}},[u]);return m||y.length?(0,c.jsx)("section",{className:"ka6at82","aria-label":"Moderation messages",children:(0,c.jsx)("div",{className:n.sharedStyles.layout.mainColumn,children:(0,c.jsxs)("div",{className:"ka6at83",children:[m&&(0,c.jsxs)("article",{className:"ka6at84 ka6at80",role:"alert",children:[(0,c.jsx)("span",{className:"ka6at86 ka6at81",children:"Warning"}),(0,c.jsx)("p",{className:r,children:m.message}),(0,c.jsxs)("div",{className:a,children:[(0,c.jsx)(o.default,{timestamp:m.createdAt,format:"notifications",className:l}),(0,c.jsx)(i.default,{className:d,text:h.includes(m.id)?"Dismissing...":"Dism
2iss",displayType:"secondary",disabled:h.includes(m.id),onClick:()=>void f(m.id)})]})]}),y.map(e=>{let t=h.includes(e.id);return(0,c.jsxs)("article",{className:"ka6at85 ka6at80 _1upudxk11",children:[(0,c.jsx)("span",{className:"ka6at87 ka6at81",children:"Message"}),(0,c.jsx)("p",{className:r,children:e.message}),(0,c.jsxs)("div",{className:a,children:[(0,c.jsx)(o.default,{timestamp:e.createdAt,format:"notifications",className:l}),(0,c.jsx)(i.default,{className:d,text:t?"Dismissing...":"Dismiss",displayType:"secondary",disabled:t,onClick:()=>void f(e.id)})]})]},e.id)})]})})}):null}],228837)},547551,e=>{"use strict";let t="feed_navigation_history";function s(){let e=[];try{let s=sessionStorage.getItem(t);e=s?JSON.parse(s):[]}catch{}return{history:e,lastPageVisited:e[e.length-1]??null,nextToLastPageVisited:e[e.length-2]??null}}function i(e){try{sessionStorage.setItem(t,JSON.stringify(e))}catch{}}function o(e){let{history:t}=s();t.push(e),t.length>3&&t.shift(),i(t)}e.s(["addPageToFeedNavigationHistory",0,function(e){let{lastPageVisited:t}=s();t?(t.page!==e.page||"feed_permalink"!==t.page||t.post?.id!==e.post?.id)&&o(e):o(e)},"getFeedNavigationHistory",0,s,"updateNextToLastPageVisited",0,function(e){let{history:t}=s();if(t.length<2)return;let o={...t[t.length-2],...e};t[t.length-2]=o,i(t)}])},624334,925677,e=>{"use strict";var t=e.i(509727),s=e.i(645904);let i=async(e,i,o,n)=>{if(!n)return null;let r=new URL("/api",o),a=await (0,s.makeRequest)(r.toString(),t.CloseRepliesMutation,{communityID:e,contentID:i},n);return a.errors||!a.data?null:a.data.closeReplies??null};e.s(["closeReplies",0,i],624334);let o=async(e,i,o,n)=>{if(!n)return null;let r=new URL("/api",o),a=await (0,s.makeRequest)(r.toString(),t.OpenRepliesMutation,{communityID:e,contentID:i},n);return a.errors||!a.data?null:a.data.openReplies??null};e.s(["openReplies",0,o],925677)},736636,e=>{"use strict";var t=e.i(591370),s=e.i(509727),i=e.i(645904);let o=async(e,o,n,r,a={})=>{let l;if(n&&e.community&&"isRecced"in e&&!e.isRecced){a.optimisticResponse&&r?.insert({...e,isRecced:!0,recs:(e.recs||0)+1});try{let t=new URL("/api",o);l=await (0,i.makeRequest)(t.toString(),s.recContentMutation,{communityID:e.community.id,objectID:e.id},n)}catch(s){(0,t.captureException)(s,{extra:{message:"Error making recContent request"}}),a.optimisticResponse&&r?.insert({...e,isRecced:!1,recs:e.recs-1});return}if(l.errors||!l.data){a.optimisticResponse&&r?.insert({...e,isRecced:!1,recs:e.recs-1});return}r?.insert(l.data.recContent)}},n=async(e,o,n,r,a={})=>{let l;if(n&&e.community&&"isRecced"in e&&e.isRecced&&void 0!==e.recs){a.optimisticResponse&&r?.insert({...e,isRecced:!1,recs:Math.max(0,e.recs-1)});try{let t=new URL("/api",o);l=await (0,i.makeRequest)(t.toString(),s.unrecContentMutation,{communityID:e.community.id,objectID:e.id},n)}catch(s){(0,t.captureException)(s,{extra:{message:"Error making unrecContent request"}}),a.optimisticResponse&&r?.insert({...e,isRecced:!0,recs:e.recs+1});return}if(l.errors||!l.data){a.optimisticResponse&&r?.insert({...e,isRecced:!0,recs:e.recs+1});return}r?.insert(l.data.unrecContent)}};e.s(["recContent",0,o,"unrecContent",0,n])},385799,e=>{"use strict";var t=e.i(509727),s=e.i(645904);let i=async(e,i,o,n,r)=>{let a=`${e}`;if(!r)return;let l=new URL("/api",n),d=await (0,s.makeRequest)(l.toString(),t.updateUserSettingsMutation,{communityID:a,userID:i,settings:o},r);if(!d.errors&&d.data)return d.data.updateUserSettings};e.s(["updateUserSettings",0,i])},323157,e=>{"use strict";var t=e.i(310282),s=e.i(579490),i=e.i(645904);class o{constructor(e,s,i,o,n){this.repliesStore=o,this.serverURL=e,this.communityID=s,this.token=n,this.contentStore=i,this.externalRootID="",this.friendlyID="",this.parentIDs=t.observable.map(new Map),this.hasLoaded=!1,this.hasErrors=!1,(0,t.makeObservable)(this,{hasErrors:t.observable,hasLoaded:t.observable,parentIDs:t.observable,externalRootID:t.observable,friendlyID:t.observable,setExternalRoot:t.action,externalRoot:t.computed,setToken:t.action,getPost:t.action})}setToken(e){this.token=e,this.repliesStore.setToken(e)}getPost(e){return this.contentStore.lookupById.get(e)??null}async loadExternalRoot(e,t,o){let n,r=` 3 query GetExternalRootQuery($communityID: String!, $friendlyID: String!, $url: String!, $title: String) { 4 comments(friendlyID: $friendlyID, communityID: $communityID, url: $url, title: $title) {
5 ${s.ExternalRootFragment} 6 } 7 }`;try{n=await (0,i.makeRequest)(`${this.serverURL}/api`,r,{communityID:e,friendlyID:t,url:o},this.token)}catch{return this.hasErrors=!0,null}return n.data?.comments?(this.setExternalRoot(n.data.comments),this.hasLoaded=!0,this.externalRoot):(this.hasErrors=!0,null)}setExternalRoot(e){this.externalRootID=e.id,this.friendlyID=e.friendlyID||"",this.repliesStore.setRoot(e),this.repliesStore.insert(e)}get externalRoot(){return this.contentStore.lookupById.get(this.externalRootID)}}var n=e.i(722010);let r=e=>{let s={justPostedByViewer:!1,...e,title:e.title?e.title:"",sortDate:new Date(e.createdAt),collapsed:!1,visible:e.visible??!0,recs:"recs"in e?e.recs??0:0,replyCount:e.replyCount??0,showHidden:e.showHidden??!1};return t.observable.object(s)},a=(e,s)=>{(0,t.runInAction)(()=>{let{id:t,parentID:i,title:o,body:r,createdAt:a,recs:l,replyCount:d,directReplyCount:c,collapsed:u,visible:h,deletedAt:p,isRecced:m,isReported:y,isEdited:f,modStatus:g,author:v,repliesAreClosed:b,premod:I,attachments:R,poll:D,seen:k,showHidden:S}=s;e.id=t??e.id,e.body=r??e.body,e.parentID=i??e.parentID,e.createdAt=a??e.createdAt,e.recs=l??e.recs,e.replyCount=d??e.replyCount,e.directReplyCount=c??e.directReplyCount,e.deletedAt=p??e.deletedAt,e.isRecced=m??e.isRecced,e.isReported=y??e.isReported,e.isEdited=f??e.isEdited,e.modStatus=g??e.modStatus,e.author=v??e.author,e.repliesAreClosed=b??e.repliesAreClosed,void 0!==I&&(e.premod=!0===I),e.attachments=void 0!==R?R:e.attachments,e.poll=void 0!==D?D:e.poll,e.collapsed=u??e.collapsed,e.visible=h??e.visible,e.showHidden=S??e.showHidden,e.type===n.ContentObjectType.FanPost&&(e.title=o??e.title),e.type===n.ContentObjectType.QuickPost&&(e.seen=k??!!e.seen),e.sortDate=a?new Date(a):e.sortDate})},l=(e,s)=>{(0,t.runInAction)(()=>{Object.assign(e,s),e.sortDate=new Date(s.createdAt)})};var d=n;let c=(e,t)=>t.sortDate.getTime()-e.sortDate.getTime(),u=(e,t)=>e.sortDate.getTime()-t.sortDate.getTime(),h=(e,t)=>t.recs-e.recs,p=(e,t)=>t.replyCount-e.replyCount,m=(e=d.ReplySort.NewestFirst)=>e===d.ReplySort.OldestFirst?u:e===d.ReplySort.MostRecs?h:e===d.ReplySort.MostReplies?p:c,y=[d.ReplySort.NewestFirst,d.ReplySort.OldestFirst],f=[d.ReplySort.NewestFirst,d.ReplySort.OldestFirst];class g{appliedReplyUpdatedAtMsByID=new Map;pendingReloadUpdates=[];constructor(e,s,i,o,n=d.ReplySort.NewestFirst){this.serverURL=e,this.communityID=s,this.token=o,this.contentStore=i,this.root=null,this.focusedReply=null,this.expandedAncestors=!0,this.traversalFocusContentID=null,this.replyFeeds=t.observable.map(new Map),this.parentIDs=t.observable.map(new Map),this.websocketReplyFeeds=t.observable.map(new Map),this.currentSort=n,this.userHasInteractedWithPage=!1,this.containerWidth=null,this.hasLoaded=!1,this.loadedWithToken=null,this.hasErrors=!1,this.isReloading=!1,this.lastLoadedReplyCreatedAtMs=null,this.lastSyncOk=null,this.pendingReloadUpdates=[],(0,t.makeObservable)(this,{hasErrors:t.observable,hasLoaded:t.observable,loadedWithToken:t.observable,isReloading:t.observable,currentSort:t.observable,replyFeeds:t.observable,websocketReplyFeeds:t.observable,parentIDs:t.observable,expandedAncestors:t.observable,ingestLiveReply:t.action,getToken:t.action,insertWebsocketReplies:t.action,insertAllWebsocketReplies:t.action,addToWebsocketReplies:t.action,setContainerWidth:t.action,root:t.observable,reload:t.action,loadReplies:t.action,setRoot:t.action,setSort:t.action,insert:t.action,applyReplyUpdates:t.action,togglePost:t.action,recursivelyIncrementCounts:t.action,delete:t.action,topLevelReplies:t.computed,bufferedReplyCount:t.computed,bufferedTopLevelReplyCount:t.computed,bufferedTopLevelReplies:t.computed,setToken:t.action,focusedReply:t.observable,setFocusedReply:t.action,focusedTopLevelReply:t.computed,focusedAncestors:t.computed,userHasInteractedWithPage:t.observable,setUserHasInteractedWithPage:t.action,getPost:t.action,containerWidth:t.observable,getWebsocketRepliesSorted:t.action,traversalFocusContentID:t.observable,showHidden:t.action,lastLoadedReplyCreatedAtMs:t.observable,lastSyncOk:t.observable,setLastSyncOk:t.action})}setRoot(e){this.root=e}setLastSyncOk(e){this.lastSyncOk=e}setToken(e){this.token=e}getToken(){return this.token}isInVisibleThread(e,t){if(!t)return!1;let s=this.replyFeeds.get(t);return s?.some(t=>t.id===e)??!1}isInWebsocketFeed(e,t){if(!t)return!1;let s=this.websocketReplyFeeds.get(t);return s?.some(t=>t.id===e)??!1}ingestLiveReply(e,t,s={}
7){let i=e.updatedAt,o="string"==typeof i?i:"createdAt"in e&&"string"==typeof e.createdAt?e.createdAt:null;null!==o&&s.markEventSeen?.(o),this.isReloading&&this.pendingReloadUpdates.push({type:"reply",obj:e,viewerID:t}),this.applyLiveReply(e,t)}applyLiveReply(e,t){let s=e.parentID;if(s&&this.isInVisibleThread(e.id,s)||s&&this.isInWebsocketFeed(e.id,s)){let t=this.contentStore.lookupById.get(e.id);t&&a(t,e);return}let i="author"in e&&e.author?.id?e.author.id:"authorID"in e&&"string"==typeof e.authorID?e.authorID:void 0;t&&i&&i===t?this.insert(e):this.addToWebsocketReplies(e)}setContainerWidth(e){this.containerWidth=e}setFocusedReply(e){if(!e){this.focusedReply=null;return}let t=this.insert(e);this.focusedReply=t}setUserHasInteractedWithPage(e){this.userHasInteractedWithPage=e}getPost(e){return this.contentStore.lookupById.get(e)??null}get topLevelReplies(){if(!this.root)return[];let e=this.replyFeeds.get(this.root.id);return e?.slice().sort(m(this.currentSort))}get focusedAncestors(){let e=[];if(!this.focusedReply)return e;let t=this.focusedReply;for(;t.parentID;){let s=this.contentStore.lookupById.get(t.parentID);if(!s)break;e.splice(0,0,s),t=s}return e}get focusedTopLevelReply(){if(!this.focusedReply)return[];let e=this.parentIDs.get(this.focusedReply.id);if(e===this.focusedReply.rootAncestorID)return[this.focusedReply];if(!e)return[];let t=e;for(;t!==this.focusedReply.rootAncestorID;){let e=this.parentIDs.get(t);if(!e||e===this.focusedReply.rootAncestorID)break;t=e}let s=this.contentStore.lookupById.get(t);return s?[s]:[]}setSort(e){this.currentSort=e}get topLevelSocketPermitted(){return y.includes(this.currentSort)}get nestedSocketPermitted(){return f.includes(this.currentSort)}get bufferedTopLevelReplyCount(){return this.bufferedTopLevelReplies.length}get bufferedReplyCount(){return new Set(Array.from(this.websocketReplyFeeds.values()).flatMap(e=>e.map(e=>e.id))).size}get bufferedTopLevelReplies(){if(!this.root?.id)return[];let e=this.websocketReplyFeeds.get(this.root.id);return e?e.filter(e=>!this.isInVisibleThread(e.id,this.root?.id)):[]}removeFromWebsocketReplies(e,s){let i=this.websocketReplyFeeds.get(s);if(!i||!i.some(t=>t.id===e))return;let o=t.observable.array(i.filter(t=>t.id!==e));this.websocketReplyFeeds.set(s,o)}async reload(){if(!this.hasLoaded||this.isReloading)return"skipped";let e=Date.now();this.pendingReloadUpdates=[],this.isReloading=!0,this.hasErrors=!1,this.lastSyncOk=null;try{return await this.loadReplies()?"reloaded":"failed"}finally{let t=1e3-(Date.now()-e);t>0&&await new Promise(e=>setTimeout(e,t)),this.isReloading=!1,this.pendingReloadUpdates=[]}}async loadReplies(){let e,o=this.root;if(!o)return!1;let n=`query RepliesQuery($communityID: String!, $parentID: String!) { 8 allReplies(communityID: $communityID, id: $parentID) { 9 ${s.QuickPostFragment} 10 } 11 } 12 `,r={communityID:this.communityID,parentID:o.id},l=this.token??null;try{if(e=await (0,i.makeRequest)(`${this.serverURL}/api`,n,r,l),!e.data?.allReplies)return this.hasErrors=!0,!1}catch{return this.hasErrors=!0,!1}let d=e.data.allReplies,c=this.focusedReply?.id;return(0,t.runInAction)(()=>{for(let e of new Set([...this.parentIDs.keys(),...Array.from(this.replyFeeds.values()).flatMap(e=>e.map(e=>e.id)),...Array.from(this.websocketReplyFeeds.values()).flatMap(e=>e.map(e=>e.id))]))this.contentStore.lookupById.delete(e);for(let e of(this.replyFeeds.clear(),this.websocketReplyFeeds.clear(),this.parentIDs.clear(),this.appliedReplyUpdatedAtMsByID.clear(),d)){if(!e.parentID)continue;this.replyFeeds.has(e.parentID)||this.replyFeeds.set(e.parentID,t.observable.array([]));let s=this.contentStore.insert(e);if(e.parentID){this.parentIDs.set(e.id,e.parentID);let t=this.replyFeeds.get(e.parentID);!t?.find(t=>t.id===e.id)&&s&&t?.push(s)}}let e=d.find(e=>e.id===o.id);if(e){let t="number"==typeof e.replyCount?e.replyCount:void 0,s="number"==typeof e.directReplyCount?e.directReplyCount:void 0,i=this.contentStore.lookupById.get(o.id);i&&a(i,{replyCount:t,directReplyCount:s}),void 0!==t&&(o.replyCount=t),void 0!==s&&(o.directReplyCount=s)}for(let e of(this.focusedReply=c?this.contentStore.lookupById.get(c)??null:null,this.traversalFocusContentID&&!this.contentStore.lookupById.has(this.traversalFocusContentID)&&(this.traversalFocusContentID=null),this.pendingReloadUpdates.splice(0)))"reply"===e.type?this.applyLiveReply(e.obj,e.viewerID):this.applyDelete(e.id,e.deletedAt);let s=d.map(e=>"createdAt"in e&&"string"==typeof e.createdAt?Date.parse(e.createdAt):NaN).filter(e=>!Number.isNaN(e));this.lastLoadedReplyCreatedAtMs=s.length>0?Math.max(...s):null,this.loadedWithToken=l,this.hasLoaded=!0}),!0}togglePost(e){let t=this.contentStore.lookupById.get(e);if(!t)return;let s=t.collapsed;a(t,{collapsed:!s})}
12showHidden(e){let t=this.contentStore.lookupById.get(e);t&&!t.showHidden&&a(t,{showHidden:!0})}recursivelyIncrementCounts(e,t){if(!e.parentID)return;let s=this.contentStore.lookupById.get(e.parentID);if(!s)return;let i={replyCount:s.replyCount+1};t&&(i={...i,...{directReplyCount:(s.directReplyCount??0)+1}}),a(s,i),s.parentID&&this.recursivelyIncrementCounts(s,!1)}recursivelyDecrementCounts(e,t){if(!e.parentID)return;let s=this.contentStore.lookupById.get(e.parentID);if(!s)return;let i={replyCount:Math.max(s.replyCount-1,0)};t&&(i.directReplyCount=Math.max((s.directReplyCount??0)-1,0)),a(s,i),s.parentID&&this.recursivelyDecrementCounts(s,!1)}applyReplyUpdates(e,t){let s=this.root?.id,i=[],o=new Map(this.appliedReplyUpdatedAtMsByID),n=[];for(let t of e){let e=Date.parse(t.updatedAt);if(!t.id||Number.isNaN(e))throw Error("Invalid Cyclone reply update");let i=o.get(t.id);if(void 0!==i&&i>=e)continue;if(t.id===s)throw Error("Cyclone reply update cannot target the thread root");let r=this.contentStore.lookupById.get(t.id);if(r&&r.type!==d.ContentObjectType.QuickPost)throw Error("Cyclone reply update cannot replace root content");if(t.reply&&(t.reply.id!==t.id||t.reply.type!==d.ContentObjectType.QuickPost||!t.reply.parentID))throw Error("Invalid Cyclone reply snapshot");if(r&&t.reply&&r.parentID!==t.reply.parentID)throw Error("Cyclone reply updates cannot change parents");o.set(t.id,e),n.push(t)}for(let e of n){if(!e.reply){this.removeReplyUpdate(e.id),i.push(e.id);continue}let s=e.reply,o=this.contentStore.lookupById.get(s.id);if(o){l(o,s);continue}let n=s.author?.id??("authorID"in s&&"string"==typeof s.authorID?s.authorID:void 0);t&&n===t?this.insert(s):this.addToWebsocketReplies(s)}for(let e of i)this.contentStore.lookupById.has(e)||this.removeReplyDescendants(e);return this.appliedReplyUpdatedAtMsByID=o,n.length}insert(e,s={}){let i=r({...e,justPostedByViewer:!!s.justPostedByViewer,rootAncestorID:"rootAncestorID"in e?e.rootAncestorID:this.root?.id,rootAncestor:"rootAncestor"in e?e.rootAncestor:this.root});i.parentID&&!this.replyFeeds.has(i.parentID)&&this.replyFeeds.set(i.parentID,t.observable.array([]));let o=this.contentStore.lookupById.get(i.id);o?a(o,e):this.contentStore.lookupById.set(i.id,i);let n=o??i;if(this.root?.id===n.id&&(this.root=n),i.parentID){let e=this.replyFeeds.get(i.parentID),t=e?.some(e=>e.id===i.id),s=o??i;t||(e?.push(s),this.parentIDs.set(i.id,i.parentID),this.recursivelyIncrementCounts(s,!0)),this.removeFromWebsocketReplies(i.id,i.parentID)}return o??i}removeReplyFromFeed(e,t,s){let i=e.get(t),o=i?.findIndex(e=>e.id===s)??-1;i&&o>=0&&i.splice(o,1)}removeReplyDescendants(e,t=new Set){if(!t.has(e)){for(let s of(t.add(e),new Set([...this.replyFeeds.get(e)?.map(e=>e.id)??[],...this.websocketReplyFeeds.get(e)?.map(e=>e.id)??[]])))this.removeReplyDescendants(s,t),this.removeReplyUpdate(s);this.replyFeeds.delete(e),this.websocketReplyFeeds.delete(e)}}removeReplyUpdate(e){let t=this.contentStore.lookupById.get(e);if(!t||t.type!==d.ContentObjectType.QuickPost)return;let s=t.parentID,i=!!s&&this.isInVisibleThread(t.id,s);s&&(this.removeReplyFromFeed(this.replyFeeds,s,e),this.removeReplyFromFeed(this.websocketReplyFeeds,s,e)),i&&this.recursivelyDecrementCounts(t,!0),this.parentIDs.delete(e),this.contentStore.lookupById.delete(e),this.focusedReply?.id===e&&(this.focusedReply=null)}insertWebsocketReplies(e){if(!e)return;let t=e.slice();for(let s of(e.clear(),t)){let e=this.insert(s),t=this.websocketReplyFeeds.get(e.id);this.insertWebsocketReplies(t)}}insertAllWebsocketReplies(){let e=new Map(Array.from(this.websocketReplyFeeds.values()).flatMap(e=>e.slice()).map(e=>[e.id,e])),t=!0;for(;e.size>0&&t;)for(let[s,i]of(t=!1,e)){let o=i.parentID?this.contentStore.lookupById.get(i.parentID):null;(i.parentID===this.root?.id||o&&o.parentID&&this.isInVisibleThread(o.id,o.parentID))&&(this.insert(i),e.delete(s),t=!0)}}addToWebsocketReplies(e){let s=r(e);s.parentID&&!this.websocketReplyFeeds.has(s.parentID)&&this.websocketReplyFeeds.set(s.parentID,t.observable.array([]));let i=this.contentStore.lookupById.get(s.id);if(i)return void a(i,e);if(!(s.parentID&&this.isInWebsocketFeed(s.id,s.parentID))&&(this.contentStore.lookupById.set(s.id,s),s.parentID)){let e=this.websocketReplyFeeds.get(s.parentID);e?.push(s)}}getWebsocketRepliesSorted(e){let t=this.websocketReplyFeeds.get(e);return t?t.slice().sort(m(this.currentSort)):[]}delete({id:e,deletedAt:t}){this.isReloading&&this.pendingReloadUpdates.push({type:"delete",id:e,deletedAt:t}),this.applyDelete(e,t)}applyDelete(e,t){let s=this.contentStore.lookupById.get(e);s&&a(s,{deletedAt:t})}}var v=e.i(781333);class b{constructor(e,s,i){this.serverURL=e,this.networkID=s,this.token=i,this.ongoingDiscussions=t.observable.object({hasErrors:!1,hasLoaded:!1,items:[]}),(0,t.makeObservable)(this,{networkID:t.observable,ongoingDiscussions:t.observable,loadOngoingDiscussions:t.action,setToken:t.action})}setToken(e){this.token=e}async loadOngoingDiscussions(){let e,o=`query OngoingDiscussionsQuery($communityIDs: [String!]!) { 13 viewer { 14 ongoingDiscussions(communityIDs: $communityIDs) { 15 ... on QuickPost {
16 ${s.QuickPostFragment} 17 id 18 createdAt 19 community { 20 id 21 name 22 } 23 rootAncestor { 24 ... on ExternalRoot { 25 title 26 urls 27 replyCount 28 community { 29 id 30 } 31 } 32 } 33 } 34 } 35 } 36 } 37 `,n={communityIDs:(0,v.getNetworkCycloneCommunityIds)(this.networkID)};try{if(e=await (0,i.makeRequest)(`${this.serverURL}/api`,o,n,this.token),!e.data?.viewer?.ongoingDiscussions){this.ongoingDiscussions.hasErrors=!0;return}}catch{this.ongoingDiscussions.hasErrors=!0;return}this.ongoingDiscussions.hasLoaded=!0,this.ongoingDiscussions.items=t.observable.array(e.data.viewer.ongoingDiscussions)}}let I=` 38 query CommunityQuery($id: String!) { 39 community(id: $id) { 40 settings { 41 userIsTooNewThresholdMs 42 } 43 pinnedContentObject { 44 ... on FanPost { 45 ${s.FanPostFragment} 46 } 47 } 48 } 49 } 50`;class R{constructor(e,s,i){this.contentStore=i,this.communityID=e,this.serverURL=s,this.pinnedContentID=null,this.community=null,this.loadCommunity(),(0,t.makeObservable)(this,{loadCommunity:t.action,pinnedContentID:t.observable,setPinnedContentID:t.action,pinnedContent:t.computed,community:t.observable})}setPinnedContentID(e){this.pinnedContentID=e}get pinnedContent(){return this.pinnedContentID?this.contentStore.get(this.pinnedContentID):null}async loadCommunity(){let e=new URL("/api",this.serverURL),t=await (0,i.makeRequest)(e.toString(),I,{id:this.communityID});if(!t.data||!t.data.community||t.errors)return;let s=t.data.community??null;this.community=s,s.pinnedContentObject&&(this.pinnedContentID=s.pinnedContentObject.id,this.contentStore.insert(s.pinnedContentObject))}}class D{constructor(){this.lookupById=t.observable.map(new Map),this.unfurlMediaEmbeds=t.observable.array([]),(0,t.makeObservable)(this,{lookupById:t.observable,unfurlMediaEmbeds:t.observable,updateUnfurlMediaEmbeds:t.action})}updateUnfurlMediaEmbeds(e){let t=this.unfurlMediaEmbeds.indexOf(e);-1===t?this.unfurlMediaEmbeds.push(e):this.unfurlMediaEmbeds.splice(t,1)}get(e){return this.lookupById.get(e)}insert(e){let t=r({...e}),s=this.lookupById.get(t.id);return s?a(s,e):this.lookupById.set(t.id,t),this.lookupById.get(e.id)}}var k=e.i(649784);let S=` 51 query GetFanPostByShortID($communityID: String!, $shortID: String!) { 52 fanPost: fanPostByShortID(shortID: $shortID, communityID: $communityID) { 53 ${s.FanPostFragment} 54 } 55 } 56`,C=async(e,t,s,o)=>{let n=`${t}`,r=new URL("/api",e).toString(),a=await (0,i.makeRequest)(r,S,{communityID:n,shortID:s},o);return{fanPost:a.data?.fanPost}};var x=e.i(860047);class w{constructor(e,s,i,o,n,r){this.items=t.observable.array([]),this.hasNext=null,this.endCursor=null,this.contentStore=e,this.serverURL=s,this.communityID=i,this.communityStore=o,this.token=n,this.ignoredUsers=r,this.filterMode=x.FanPostsMode.NEWEST,this.loadingMore=!1,(0,t.makeObservable)(this,{visibleItems:t.computed,visibleItemsWithNativeAds:t.computed,hasNext:t.observable,endCursor:t.observable,insert:t.action,items:t.observable,setItems:t.action,setEndCursor:t.action,setHasNext:t.action,delete:t.action,loadMore:t.action,reload:t.action,setToken:t.action,setIgnoredUsers:t.action,setFilterMode:t.action,filterMode:t.observable,loadingMore:t.observable,setLoadingMore:t.action,ignoredUsers:t.observable})}setToken(e){this.token=e}setIgnoredUsers(e){this.ignoredUsers=e}setFilterMode(e){this.filterMode=e}setLoadingMore(e){this.loadingMore=e}get visibleItems(){let e=this.ignoredUsers??[];return this.filterMode===x.FanPostsMode.NEWEST?this.items.filter(t=>"string"==typeof t||!t.deletedAt&&t.id!==this.communityStore.pinnedContent?.id&&!e.some(e=>e.id===t.author?.id)):this.items.filter(t=>"string"==typeof t||!t.deletedAt||!e.some(e=>e.id===t.author?.id))}get visibleItemsWithNativeAds(){let e=this.visibleItems,t=e=>3===e||e>3&&(e-3)%8==0,s=[];for(let i=0;i<e.length;i++)t(i)&&e[i]!==k.NATIVE_AD_PLACEHOLDER&&s.push(k.NATIVE_AD_PLACEHOLDER),s.push(e[i]);return s}setHasNext(e){this.hasNext=e}setEndCursor(e){this.endCursor=e}async reload(e,t=10,s=!1){e&&(this.token=e);let{fanPosts:i}=await (0,x.fetchFanPosts)(`${this.serverURL}
56/api`,this.communityID,new Date().toISOString(),t,this.token,this.filterMode);for(let e of i.items){let t=this.contentStore.lookupById.get(e.id);t&&a(t,e)}if(s&&(this.setHasNext(!!i.hasNext),this.setEndCursor(i.endCursor??null),this.setItems([...i.items])),this.communityStore.pinnedContent?.shortID&&this.filterMode===x.FanPostsMode.NEWEST){let{fanPost:e}=await C(this.serverURL,this.communityID,this.communityStore.pinnedContent.shortID,this.token);e&&this.insert(e)}}async loadMore(){if(!this.hasNext||!this.endCursor)return;this.setLoadingMore(!0);let{fanPosts:e}=await (0,x.fetchFanPosts)(`${this.serverURL}/api`,this.communityID,this.endCursor,10,this.token);this.setHasNext(!!e.hasNext),this.setEndCursor(e.endCursor??null),this.setItems([...this.items,...e.items]),this.setLoadingMore(!1)}insert(e){let t=r({...e}),s=this.contentStore.lookupById.get(t.id);return s?a(s,e):this.contentStore.lookupById.set(t.id,t),s??t}setItems(e){let t=[];for(let s of e){if(s===k.NATIVE_AD_PLACEHOLDER)continue;let e=this.insert(s);t.push(e)}this.items.replace(t)}delete({id:e,deletedAt:t}){let s=this.contentStore.lookupById.get(e);s&&(a(s,{deletedAt:t}),this.communityStore.pinnedContentID===e&&this.communityStore.setPinnedContentID(null))}}class N{constructor(e,s,i,o,n){this.serverURL=e,this.communityID=s,this.token=n,this.contentStore=i,this.repliesStore=o,this.fanPostID="",this.parentIDs=t.observable.map(new Map),(0,t.makeObservable)(this,{parentIDs:t.observable,fanPostID:t.observable,setFanPost:t.action,fanPost:t.computed,setToken:t.action,getPost:t.action})}setToken(e){this.token=e,this.repliesStore.setToken(e)}getPost(e){return this.contentStore.lookupById.get(e)??null}async loadFanPost(e,t){let o=` 57 query GetFanPostQuery($communityID: String!, $id: String!) { 58 fanPost(id: $id, communityID: $communityID) { 59 ${s.FanPostFragment} 60 } 61 }`,n=await (0,i.makeRequest)(`${this.serverURL}/api`,o,{communityID:e,id:t},this.token);return n.data?.fanPost?(this.setFanPost(n.data.fanPost),this.fanPost):null}setFanPost(e){this.fanPostID=e.id,this.repliesStore.setRoot(e),this.repliesStore.insert(e)}get fanPost(){return this.contentStore.lookupById.get(this.fanPostID)}}e.s(["RootStore",0,class{constructor(e,t,s,i,n){this.token=i,this.ignoredUsers=n,this.contentStore=new D,this.communityStore=new R(s,e,this.contentStore),this.repliesStore=new g(e,s,this.contentStore,i),this.externalRootStore=new o(e,s,this.contentStore,this.repliesStore,i),this.fanPostStore=new N(e,s,this.contentStore,this.repliesStore,i),this.fanPostIndexStore=new w(this.contentStore,e,s,this.communityStore,i,n),this.viewerStore=new b(e,t,i)}setToken(e){this.token=e,this.fanPostStore.setToken(e),this.fanPostIndexStore.setToken(e),this.repliesStore.setToken(e),this.externalRootStore.setToken(e),this.viewerStore.setToken(e)}setIgnoredUsers(e){this.ignoredUsers=e,this.fanPostIndexStore.setIgnoredUsers(e)}}],323157)},613329,e=>{"use strict";let t=()=>({children:new Map});e.s(["wait",0,e=>{var t,s,i,o;return t=void 0,s=void 0,i=void 0,o=function*(){return new Promise(t=>setTimeout(t,e))},new(i||(i=Promise))(function(e,n){function r(e){try{l(o.next(e))}catch(e){n(e)}}function a(e){try{l(o.throw(e))}catch(e){n(e)}}function l(t){var s;t.done?e(t.value):((s=t.value)instanceof i?s:new i(function(e){e(s)})).then(r,a)}l((o=o.apply(t,s||[])).next())})},"withCoalescing",0,e=>{let s=t();return(...i)=>{let o=s,n=[];for(let e of i){let s=o.children.get(e);s||(s=t(),o.children.set(e,s)),n.push({parent:o,key:e}),o=s}if(o.inFlight)return o.inFlight;let r=Promise.resolve().then(()=>e(...i)).finally(()=>{o.inFlight=void 0;for(let e=n.length-1;e>=0;e--){let t=n[e];if(!t)continue;let{parent:s,key:i}=t,o=s.children.get(i);if(o){if(o.inFlight||o.children.size>0)break;s.children.delete(i)}}});return o.inFlight=r,r}}])},678460,e=>{"use strict";var t=e.i(389959),s=e.i(613329);e.s(["useCoalescedCallback",0,function(e,i=[]){return(0,t.useCallback)((0,s.withCoalescing)(e),i)}])}]); 62 63//# debugId=9ffb7604-9c89-c996-122b-e546f604044a 64//# sourceMappingURL=2eg4ijwa0d3pg.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.