1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4635,7772,86145,95019],{4635:(e,t,a)=>{a.d(t,{AY:()=>m,Db:()=>f,Hb:()=>c,LY:()=>E,MG:()=>N,Or:()=>w,Pl:()=>j,S:()=>x,Ss:()=>v,T8:()=>M,TI:()=>b,W8:()=>u,WF:()=>T,XA:()=>g,Yd:()=>h,a3:()=>o,aI:()=>A,ae:()=>i,cp:()=>S,createPagePost:()=>I,fetchPages:()=>s,fj:()=>k,kG:()=>n,nY:()=>P,pm:()=>d,togglePageActive:()=>F,z0:()=>p,z5:()=>C,z_:()=>y});var r=a(87492);let l=e=>{var t;return null!=(t=null==e?void 0:e.data)?t:e};function n(e){return e?"string"==typeof e?e.trim()||null:e.profileImageUrl||e.img||null:null}let s=async()=>{var e;let t=l(await r.default.get("/pages"));return Array.isArray(t)?t:null!=(e=null==t?void 0:t.data)?e:[]},i=async e=>l(await r.default.get("/pages/".concat(e))),o=async e=>l(await r.default.post("/pages",e,{timeout:15e3})),d=async()=>{var e;let t=l(await r.default.get("/pages/followed"));return Array.isArray(t)?t:null!=(e=null==t?void 0:t.data)?e:[]},c=async()=>{var e;let t=l(await r.default.get("/pages/invites"));return Array.isArray(t)?t:null!=(e=null==t?void 0:t.data)?e:[]},u=async function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s={page:t,limit:a},i=(n||"").trim();i&&(s.q=i);let o=l(await r.default.get("/pages/discover",{params:s}));return o&&o.data&&void 0!==o.hasMore?o:{data:Array.isArray(o)?o:null!=(e=null==o?void 0:o.data)?e:[],hasMore:!1,total:0}},m=async e=>{var t;let a=l(await r.default.get("/pages/".concat(e,"/scheduled-posts")));return Array.isArray(a)?a:null!=(t=null==a?void 0:a.data)?t:[]},x=async(e,t)=>(await r.default.delete("/pages/".concat(e,"/scheduled-posts/").concat(t)),{success:!0}),p=async e=>(await r.default.post("/pages/".concat(e,"/follow")),{success:!0}),h=async e=>(await r.default.delete("/pages/".concat(e,"/follow")),{success:!0}),g=async(e,t)=>l(await r.default.patch("/pages/".concat(e),t)),f=async e=>(await r.default.delete("/pages/".concat(e)),{success:!0}),b=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a={};return t.limit&&(a.limit=t.limit),t.offset&&(a.offset=t.offset),l(await r.default.get("/pages/".concat(e,"/posts"),{params:a}))},y=async e=>{var t;let a=l(await r.default.get("/pages/".concat(e,"/followers")));return Array.isArray(a)?a:null!=(t=null==a?void 0:a.data)?t:[]},v=async(e,t)=>(await r.default.delete("/pages/".concat(e,"/followers/").concat(t)),{success:!0}),w=async(e,t)=>l(await r.default.post("/pages/".concat(e,"/invite"),{inviteeIds:t})),k=async(e,t)=>l(await r.default.post("/pages/invites/".concat(e,"/respond"),{action:t})),j=async e=>l(await r.default.post("/pages/".concat(e,"/block"))),N=async(e,t,a)=>l(await r.default.post("/pages/".concat(e,"/request-verification"),{reason:t,documentUrl:a})),C=async e=>l(await r.default.get("/pages/".concat(e,"/verification-status"))),S=async e=>{var t;let a=l(await r.default.get("/pages/".concat(e,"/inbox/conversations")));return null!=(t=null==a?void 0:a.conversations)?t:Array.isArray(a)?a:[]},A=async(e,t)=>l(await r.default.get("/pages/".concat(e,"/inbox/messages/").concat(t))),P=async(e,t,a)=>l(await r.default.post("/pages/".concat(e,"/inbox/send"),{content:t,recipientId:a})),E=async(e,t)=>l(await r.default.post("/pages/".concat(e,"/message"),{content:t})),T=async e=>l(await r.default.get("/pages/".concat(e,"/my-thread"))),I=async(e,t)=>l(await r.default.post("/pages/".concat(e,"/posts"),t,{timeout:3e4})),F=async e=>l(await r.default.patch("/pages/".concat(e,"/toggle-active"))),M=async()=>l(await r.default.get("/pages/unread-messages"))},5163:(e,t,a)=>{function r(e,t){let a=null==e?void 0:e.mediaDetails;if(!a||"object"!=typeof a)return null;let r=function(e){if(!e||"string"!=typeof e)return null;try{let t=new URL(e.trim(),"http://local.invalid").pathname;return decodeURIComponent(t).replace(/\/{2,}/g,"/")||null}catch(e){return null}}(t);return r&&a[r]||null}function l(e,t){var a;let l=null==(a=r(e,t))?void 0:a.tags;if(!Array.isArray(l)||!l.length)return[];let n=new Map(((null==e?void 0:e.taggedUsers)||[]).map(e=>[e.id,e]));return l.map(e=>{let t=n.get(e.userId);if(!t)return null;
1let a=t.name||[t.firstName,t.lastName].filter(Boolean).join(" ")||t.username||"Friend";return{...e,name:a,username:t.username||""}}).filter(Boolean)}function n(e){if("string"==typeof(null==e?void 0:e.video)&&e.video.trim())return e.video;let t=Array.isArray(null==e?void 0:e.media)?e.media.find(e=>e&&"object"==typeof e&&"video"===e.type&&e.url):null;return t?t.url:Array.isArray(null==e?void 0:e.videos)&&e.videos[0]?e.videos[0]:null}a.d(t,{H7:()=>n,PT:()=>l,S5:()=>r})},7772:(e,t,a)=>{a.d(t,{A:()=>tp});var r=a(95155),l=a(12115),n=a(67909),s=a(96175),i=a(9399),o=a(29715),d=a(9878),c=a(92208),u=a(46350),m=a(85921),x=a(27209),p=a(39259),h=a(53282);let g="feed.video.muted",f=function(){try{let e=window.localStorage.getItem(g);if("0"===e||"false"===e)return!1;return!0}catch(e){return!0}}(),b=new EventTarget;function y(e){let t=!!e;if(t!==f){f=t;try{window.localStorage.setItem(g,t?"1":"0")}catch(e){}b&&b.dispatchEvent(new CustomEvent("change",{detail:f}))}}function v(){let[e,t]=(0,l.useState)(f);return(0,l.useEffect)(()=>{if(!b)return;f!==e&&t(f);let a=e=>t(e.detail);return b.addEventListener("change",a),()=>b.removeEventListener("change",a)},[]),[e,(0,l.useCallback)(e=>y(e),[])]}let w=new Map,k=null,j=null,N=0,C=!1;function S(){N||(N=window.requestAnimationFrame(()=>{N=0,function(){let e=null,t=1/0;for(let[a,r]of w){if(!r.onScreen||!a.isConnected||"function"==typeof r.eligible&&!r.eligible())continue;let l=function(e){let t=window.innerHeight||document.documentElement.clientHeight||0;if(!e||!e.getBoundingClientRect)return{top:0,bottom:t};let a=e.getBoundingClientRect(),r=Math.max(0,a.top),l=Math.min(t,a.bottom);return l>r?{top:r,bottom:l}:{top:0,bottom:t}}(r.root),n=(l.top+l.bottom)/2,s=a.getBoundingClientRect();if(!s.height||Math.max(0,Math.min(s.bottom,l.bottom)-Math.max(s.top,l.top))/s.height<.5)continue;let i=Math.abs((s.top+s.bottom)/2-n);i<t&&(t=i,e=a)}if(e===j)return;let a=j;if(j=e,a){let e=w.get(a);if(e)try{e.onInactive()}catch(e){}}if(e){let t=w.get(e);if(t)try{t.onActive()}catch(e){}}}()}))}function A(e,t){if(!e||!t)return()=>{};let a={onScreen:!1,onActive:t.onActive||(()=>{}),onInactive:t.onInactive||(()=>{}),eligible:t.eligible,root:t.root||null};w.set(e,a);let r=k||(k=new IntersectionObserver(e=>{for(let t of e){let e=w.get(t.target);e&&(e.onScreen=t.isIntersecting)}S()},{threshold:[0,.25,.5,.75,1]}));return r&&r.observe(e),C||(C=!0,window.addEventListener("scroll",S,{passive:!0,capture:!0}),window.addEventListener("resize",S,{passive:!0})),S(),()=>{let t=k;t&&t.unobserve(e),w.delete(e),j===e&&(j=null),S()}}let P=new Set;try{window.__FT_BUILD="FT1.4-2026-05-28"}catch(e){}function E(e){if(e&&!1!==window.__VIDEO_PLAY_CAP&&!P.has(e)){for(;P.size>=3;){let e=P.values().next().value;if(!e)break;P.delete(e);try{e.dataset.capEvicting="1",e.pause()}catch(e){}}P.add(e)}}function T(e){e&&P.delete(e)}var I=a(53364),F=a(62546),M=a(95704);function _(e,t,a){if(!0===window.__FEED_VIDEO_LOG&&!1!==window.__FEED_VIDEO_LOG)try{let r="[upload-perf] [feed-video]";void 0!==a?console.warn("".concat(r," ").concat(e,": ").concat(t),a):console.warn("".concat(r," ").concat(e,": ").concat(t))}catch(e){}}try{_("boot","FeedMedia module loaded (FT1.4)")}catch(e){}let D=!(void 0!==M&&M.env&&"off"===M.env.NEXT_PUBLIC_FEED_VIDEO_AUTOPLAY),L=null,R=new WeakMap;if("undefined"!=typeof document&&!document.getElementById("feed-media-keyframes")){let e=document.createElement("style");e.id="feed-media-keyframes",e.textContent="\n @keyframes feedShimmer {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n }\n @keyframes feedSpinnerSpin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n ",document.head.appendChild(e)}let z={background:"linear-gradient(90deg, rgba(55,60,70,1) 0%, rgba(120,130,145,1) 50%, rgba(55,60,70,1) 100%)",backgroundSize:"200% 100%",animation:"feedShimmer 1.0s ease-in-out infinite"},U=/(?:^|\.)(?:wnsocial\.com|worldnoor\.com)$/i,B=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1080,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:72;
1if(!e||"string"!=typeof e||/^(data:|blob:)/i.test(e)||/\.(svg|gif)(\?|$)/i.test(e))return e;if(e.startsWith("/")&&!e.startsWith("//"))return"/_next/image?url=".concat(encodeURIComponent(e),"&w=").concat(t,"&q=").concat(a);if(/^https?:\/\//i.test(e))try{let r=new URL(e).hostname;if(U.test(r)||"localhost"===r||"127.0.0.1"===r)return"/_next/image?url=".concat(encodeURIComponent(e),"&w=").concat(t,"&q=").concat(a)}catch(e){}return e},O=(0,l.memo)(function(e){let{posterResolved:t,priority:a=!1,alt:l="",onLoadAt:n,onErrorAt:s}=e;if(!t)return null;let i=B(t)||t;return(0,r.jsx)("img",{src:i,alt:l,loading:"eager",decoding:"async",fetchPriority:a?"high":"auto",className:"absolute inset-0 w-full h-full object-contain z-[2]",draggable:!1,onLoad:n,onError:e=>{let a=e.currentTarget;if("1"!==a.dataset.rawTried&&-1!==a.src.indexOf("/_next/image")){a.dataset.rawTried="1",a.src=t;return}a.style.display="none",s&&s(e)}})}),H=(0,l.memo)(e=>{let{src:t,fit:a="cover",objectPosition:n="center",thumbSrc:s,alt:i="",className:o="",containerStyle:d,onClick:c,overlay:u,priority:m=!1,optimizeWidth:x=1080}=e,[h,g]=(0,l.useState)(!1),[f,b]=(0,l.useState)(!1),y=(0,l.useMemo)(()=>t?(0,p.resolveMediaUrl)(t):null,[t]),v=(0,l.useMemo)(()=>s?(0,p.resolveMediaUrl)(s):null,[s]),w=(0,l.useMemo)(()=>y?B(y,x):null,[y,x]),[k,j]=(0,l.useState)(!1),[N,C]=(0,l.useState)(!1),S=(0,l.useRef)(!1),A=(0,l.useRef)(!1),P=(0,l.useRef)(null),E=v&&!k?v:N?y:w||y;(0,l.useEffect)(()=>{g(!1),b(!1),j(!1),C(!1),S.current=!1,A.current=!1},[y,v]),(0,l.useEffect)(()=>{if(!P.current)return;let e=()=>{let e=P.current;e&&e.complete&&e.naturalWidth>0&&g(!0)};e();let t="function"==typeof requestAnimationFrame?requestAnimationFrame(e):null;return()=>{t&&cancelAnimationFrame(t)}},[E]);let T=(0,l.useCallback)(()=>g(!0),[]),I=(0,l.useCallback)(()=>{if(v&&!S.current){S.current=!0,j(!0);return}if(!A.current&&w&&w!==y){A.current=!0,C(!0);return}b(!0)},[w,y,v]);return(0,r.jsxs)("div",{className:"relative w-full overflow-hidden ".concat(o),style:d,onClick:c,role:c?"button":void 0,tabIndex:c?0:void 0,"aria-label":c?i||"Open image":void 0,onKeyDown:c?e=>{"Enter"===e.key&&c(e)}:void 0,children:[(0,r.jsx)("div",{className:"absolute inset-0",style:f?{background:"linear-gradient(135deg, #1a1a1d 0%, #202024 100%)"}:h?{background:"#0f0f11"}:z,"aria-hidden":"true"}),y&&"contain"===a&&(0,r.jsx)("img",{src:v||E,alt:"","aria-hidden":"true",draggable:!1,className:"absolute inset-0 w-full h-full object-cover z-0",style:{filter:"blur(28px) saturate(1.35)",transform:"scale(1.15)",opacity:+!!h,transition:"opacity 300ms ease"}}),y&&(0,r.jsx)("img",{ref:P,src:E,alt:i,loading:m?"eager":"lazy",decoding:"async",fetchPriority:m?"high":"auto",onLoad:T,onError:I,className:"relative z-[1] block w-full h-full ".concat("contain"===a?"object-contain":"object-cover"," transition-opacity duration-300"),style:{opacity:h&&!f?1:0,objectPosition:n},draggable:!1}),u&&(0,r.jsx)("div",{className:"absolute inset-0 bg-black/50 flex items-center justify-center z-[2] pointer-events-none",children:(0,r.jsxs)("span",{className:"text-white text-3xl font-bold",children:["+",u]})})]})});function W(e,t){(0,l.useEffect)(()=>{let a=e.current;if(!a||!t)return;let r=()=>{try{if(document.fullscreenElement||document.webkitFullscreenElement){var e;document.exitFullscreen?null==(e=document.exitFullscreen())||e.catch(()=>{}):document.webkitExitFullscreen&&document.webkitExitFullscreen()}"function"==typeof a.webkitExitFullscreen&&a.webkitExitFullscreen()}catch(e){}t()},l=()=>{(document.fullscreenElement||document.webkitFullscreenElement)===a&&r()};return document.addEventListener("fullscreenchange",l),document.addEventListener("webkitfullscreenchange",l),a.addEventListener("webkitbeginfullscreen",r),()=>{document.removeEventListener("fullscreenchange",l),document.removeEventListener("webkitfullscreenchange",l),a.removeEventListener("webkitbeginfullscreen",r)}},[e,t])}H.displayName="FeedImgCore";let K=(0,l.memo)(e=>{let{src:t,thumbSrc:a,alt:n,onClick:s,maxHeight:i=520,priority:o}=e,d=(0,l.useMemo)(()=>({maxHeight:"number"==typeof i?"min(68vh, ".concat(i,"px)"):i,minHeight:240,aspectRatio:"4 / 3",background:"#0f0f11",width:"100%",overflow:"hidden"}),[i]);return(0,r.jsx)(H,{fit:"contain",src:t,thumbSrc:a,alt:n||"Post content",onClick:s,containerStyle:d,priority:o})});K.displayName="FeedImage";let V=(0,l.memo)(e=>{let{src:t,thumbSrc:a,alt:l,onClick:n,className:s="",overlay:i,priority:o}=e;return(0,r.jsx)(H,{fit:"contain",src:t,thumbSrc:a,alt:l,onClick:n,className:"bg-[#0f0f11] cursor-pointer ".concat(s),overlay:i,priority:o,optimizeWidth:750})});V.displayName="FeedImageCell";let q=(0,l.memo)(e=>{let{src:t,poster:a,postId:n,onClick:s,onOpen:i,className:o="",overlay:d,onAudioOnly:c,captions:u=null}=e,{dataSaverActive:g}=(0,h.A)(),b=l.useRef(null),w=l.useRef(null),k=l.useRef(!1),j=l.useRef(!1),N=(0,l.useRef)(0),C=(0,l.useRef)(!1),P=(0,l.useRef)(!1),[M,L]=(0,l.useState)(!1),[R,U]=(0,l.useState)(!1),[B,H]=(0,l.useState)(!1),[K]=v(),[V,q]=(0,l.useState)(null),Y=(0,l.useMemo)(()=>t?(0,p.resolveMediaUrl)(t):null,[t]),G=(0,l.useMemo)(()=>a&&(0,p.resolveMediaUrl)(a)||null,[a]);(0,l.useEffect)(()=>{N.current="undefined"!=typeof performance?performance.now():Date.now()},[]);let Z=(0,l.useCallback)(()=>{let e=b.current;if(!e)return;let t=e.duration&&isFinite(e.duration)?Math.max(1,Math.min(3,.1*e.duration)):1;try{e.currentTime=t}catch(e){}e.videoWidth>0&&e.videoHeight>0&&q(Math.max(.4,Math.min(2.5,e.videoWidth/e.videoHeight)))},[]),$=(0,l.useCallback)(e=>{if(P.current)return;P.current=!0;let t=("undefined"!=typeof performance?performance.now():Date.now())-N.current;try{(0,I.N9)("feedFirstFrame",t,{_category:"images",surface:"FeedVideoCell",via:e})}catch(e){}_("cell.firstFrame","via=".concat(e," dt=").concat(Math.round(t),"ms"))},[]),Q=(0,l.useCallback)(e=>{var t;U(!0),$("seeked");let a=null==e?void 0:e.currentTarget;a&&_("cell.seeked","currentTime=".concat(null==(t=a.currentTime)?void 0:t.toFixed(2)," readyState=").concat(a.readyState))},[$]),J=(0,l.useCallback)(e=>{U(!0),$("canPlay");let t=null==e?void 0:e.currentTarget;t&&_("cell.canPlay","readyState=".concat(t.readyState))},[$]),X=(0,l.useCallback)(e=>{var t;let a=null==e?void 0:e.currentTarget,r=null==a||null==(t=a.error)?void 0:t.code;ea(!1),H(!0),_("cell.error","".concat({1:"ABORTED",2:"NETWORK",3:"DECODE",4:"SRC_NOT_SUPPORTED"}[r]||"code=".concat(null!=r?r:"?")," src=").concat((Y||"").slice(0,100)))},[Y]);(0,l.useEffect)(()=>{H(!1)},[Y]);let ee=(0,l.useCallback)(()=>
1{if(C.current)return;C.current=!0;let e=("undefined"!=typeof performance?performance.now():Date.now())-N.current,t="string"==typeof G&&G.startsWith("data:");try{(0,I.N9)("feedPosterMount",e,{_category:"images",surface:"FeedVideoCell",kind:t?"synth":"real"})}catch(e){}},[G]);(0,l.useEffect)(()=>{if(g)return;let e=w.current;if(!e)return;let t=null,a=e.parentElement;for(;a&&a!==document.body;){let e=window.getComputedStyle(a);if(/(auto|scroll|overlay)/.test(e.overflowY)&&a.clientHeight<a.scrollHeight){t=a;break}a=a.parentElement}let r=null,l=()=>{r&&(clearTimeout(r),r=null);let e=b.current;e&&!e.paused&&(j.current=!0,e.pause())},n=A(e,{root:t,eligible:()=>D&&!k.current,onActive:()=>{r&&clearTimeout(r),r=setTimeout(()=>{r=null;let e=b.current;if(!e||k.current)return;E(e),e.muted=f;let t=e.play();t&&"function"==typeof t.catch&&t.catch(()=>{if(!e.muted){e.muted=!0;let t=e.play();t&&"function"==typeof t.catch&&t.catch(()=>{})}})},120)},onInactive:l});return()=>{r&&clearTimeout(r),n(),l()}},[g]),(0,l.useEffect)(()=>{let e=b.current;e&&e.muted!==K&&(e.muted=K)},[K]),(0,l.useEffect)(()=>()=>{let e=b.current;if(e)try{e.pause(),e.muted=!0,e.removeAttribute("src"),e.load()}catch(e){}},[]);let[et,ea]=(0,l.useState)(!1),er=(0,l.useCallback)(e=>{e.stopPropagation();let t=b.current;if(t){if(t.paused){ea(!0);try{E(t);try{t.preload="auto"}catch(e){}let e=t.play();e&&"function"==typeof e.then&&e.then(()=>{}).catch(()=>{ea(!1)})}catch(e){ea(!1)}}else t.pause(),L(!1),T(t);s&&s(e)}},[s]),el=(0,l.useCallback)(e=>{i&&(e.preventDefault(),e.stopPropagation(),i())},[i]);return(W(b,i),(0,l.useEffect)(()=>()=>{let e=b.current;e&&T(e)},[]),Y)?(0,r.jsxs)("div",{ref:w,className:"relative overflow-hidden bg-black cursor-pointer ".concat(o),onClick:er,onDoubleClick:el,role:"button",tabIndex:0,"aria-label":"Play video",children:[!R&&!M&&!B&&(0,r.jsx)("div",{className:"absolute inset-0",style:z,"aria-hidden":"true"}),!M&&(0,r.jsx)(O,{posterResolved:G,alt:"",onLoadAt:ee}),(0,r.jsx)("video",{ref:b,src:Y,poster:G||void 0,"data-explicit-mute":"true",muted:K,...g||!D?{}:{autoPlay:!0},playsInline:!0,loop:!0,controls:!0,controlsList:"nodownload",preload:g?"none":"metadata",onLoadedMetadata:e=>{var a;null==Z||Z(e);let r=e.currentTarget;0===r.videoWidth&&0===r.videoHeight&&r.duration>0&&(null==c||c(t)),_("cell.loadedMetadata","duration=".concat(null==(a=r.duration)?void 0:a.toFixed(1),"s size=").concat(r.videoWidth,"x").concat(r.videoHeight))},onSeeked:Q,onCanPlay:J,onError:X,onVolumeChange:e=>{let t=e.currentTarget;if(t&&"boolean"==typeof t.muted&&(y(t.muted),!t.muted&&t.paused)){let e=t.play();e&&"function"==typeof e.catch&&e.catch(()=>{})}},onPlay:e=>{L(!0),k.current=!1,E(e.currentTarget)},onPlaying:()=>{ea(!1)},onPause:e=>{L(!1);let t=e.currentTarget;if(t&&"1"===t.dataset.capEvicting){delete t.dataset.capEvicting,T(t);return}if(j.current){j.current=!1,T(t);return}t&&!t.ended&&(k.current=!0),S(),T(t)},onEnded:e=>T(e.currentTarget),className:"absolute inset-0 w-full h-full object-contain transition-opacity duration-200",style:{opacity:+!!R,zIndex:1},children:(0,r.jsx)(F.A,{captions:u})}),!M&&!et&&!B&&(0,r.jsx)("div",{className:"absolute inset-0 z-[3] flex items-center justify-center bg-black/20 pointer-events-none",children:(0,r.jsx)("span",{className:"w-12 h-12 rounded-full bg-white/25 backdrop-blur-sm flex items-center justify-center shadow-lg",children:(0,r.jsx)(m.A,{className:"w-5 h-5 text-white ml-0.5",fill:"currentColor"})})}),B&&!G&&(0,r.jsx)("div",{className:"absolute inset-0 z-[2] flex items-center justify-center bg-zinc-900/70","aria-hidden":"true",children:(0,r.jsx)(x.A,{className:"w-6 h-6 text-white/30"})}),et&&(0,r.jsx)("div",{className:"absolute inset-0 z-[4] flex items-center justify-center bg-black/35 pointer-events-none","aria-hidden":"true",children:(0,r.jsx)("span",{className:"w-10 h-10 rounded-full border-[3px] border-white/30 border-t-white",style:{animation:"feedSpinnerSpin 0.9s linear infinite"}})}),(0,r.jsx)("div",{className:"absolute bottom-1.5 left-1.5 z-[3] bg-black/60 text-white text-[10px] uppercase tracking-wide px-1.5 py-0.5 rounded pointer-events-none",children:"Video"}),d&&(0,r.jsx)("div",{className:"absolute inset-0 bg-black/55 flex items-center justify-center z-[2] pointer-events-none",children:(0,r.jsxs)("span",{className:"text-white text-3xl font-bold",children:["+",d]})})]}):null});q.displayName="FeedVideoCell";let Y=(0,l.memo)(e=>{let{src:t,poster:a,postId:n,maxHeight:s=500,priority:i=!1,onOpen:o,onAudioOnly:d,captions:c=null}=e,u=(0,l.useRef)(d);u.current=d;let{dataSaverActive:x}=(0,h.A)(),g=(0,l.useRef)(null),b=(0,l.useRef)(null),w=(0,l.useRef)(0),k=(0,l.useRef)(!1),j=(0,l.useRef)(!1),[N,C]=(0,l.useState)(i),[P,M]=(0,l.useState)(!1),[U,B]=(0,l.useState)(!1),[H,K]=(0,l.useState)(!1),V=(0,l.useRef)(!1),q=(0,l.useRef)(!1),[Y,G]=(0,l.useState)(null),[Z]=v(),$=(0,l.useMemo)(()=>t?(0,p.resolveMediaUrl)(t):null,[t]),Q=(0,l.useMemo)(()=>a&&(0,p.resolveMediaUrl)(a)||null,[a]),[J,X]=(0,l.useState)(!1),ee=(0,l.useRef)(!1),[et,ea]=(0,l.useState)(null),[er,el]=(0,l.useState)(!1);(0,l.useEffect)(()=>{w.current="undefined"!=typeof performance?performance.now():Date.now()},[]),(0,l.useEffect)(()=>{_("mount","priority=".concat(i," src=").concat(($||"").slice(0,100)))},[$,i]),(0,l.useEffect)(()=>
1{if(!N||P)return;let e=setTimeout(()=>{P||(el(!0),_("stuck","no first frame after 10s",{src:($||"").slice(0,80)}))},1e4);return()=>clearTimeout(e)},[N,P,$]);let en=(0,l.useMemo)(()=>Y&&Number.isFinite(Y)?Math.max(.5,Math.min(16/9,Y)):16/9,[Y]),es=(0,l.useMemo)(()=>({maxHeight:"min(68vh, 520px)",minHeight:240,aspectRatio:"".concat(en)}),[en]),ei=Y?"object-contain":"object-cover";(0,l.useEffect)(()=>{if(i||N)return;let e=g.current;if(!e)return;let t=((e,t)=>{let a=L||(L=new IntersectionObserver(e=>{for(let t of e){let e=R.get(t.target);e&&e(t)}},{rootMargin:"800px 0px",threshold:.01}));return a&&e?(R.set(e,t),a.observe(e),()=>{a.unobserve(e),R.delete(e)}):()=>{}})(e,e=>{e.isIntersecting&&(C(!0),t())});return t},[i,N]),(0,l.useEffect)(()=>{if(!N||x)return;let e=g.current;if(!e)return;let t=null,a=e.parentElement;for(;a&&a!==document.body;){let e=window.getComputedStyle(a);if(/(auto|scroll|overlay)/.test(e.overflowY)&&a.clientHeight<a.scrollHeight){t=a;break}a=a.parentElement}let r=null,l=()=>{r&&(clearTimeout(r),r=null);let e=b.current;e&&!e.paused&&(q.current=!0,e.pause())},n=A(e,{root:t,eligible:()=>D&&!V.current,onActive:()=>{r&&clearTimeout(r),r=setTimeout(()=>{r=null;let e=b.current;if(!e||V.current)return;E(e),e.muted=f;let t=e.play();t&&"function"==typeof t.catch&&t.catch(()=>{if(!e.muted){e.muted=!0;let t=e.play();t&&"function"==typeof t.catch&&t.catch(()=>{})}})},120)},onInactive:l});return()=>{r&&clearTimeout(r),n(),l()}},[N,x]),(0,l.useEffect)(()=>()=>{let e=b.current;e&&T(e)},[]),(0,l.useEffect)(()=>{let e=b.current;e&&e.muted!==Z&&(e.muted=Z)},[Z]),(0,l.useEffect)(()=>()=>{let e=b.current;if(e)try{e.pause(),e.muted=!0,e.removeAttribute("src"),e.load()}catch(e){}},[]);let eo=(0,l.useCallback)(()=>{var e,t;let a=b.current;if(!a)return;let r=a.duration&&isFinite(a.duration)?Math.max(1,Math.min(3,.1*a.duration)):1;try{a.currentTime=r}catch(e){}0===a.videoWidth&&0===a.videoHeight&&a.duration>0&&(null==(t=u.current)||t.call(u,a.currentSrc||a.src)),_("loadedMetadata","duration=".concat(null==(e=a.duration)?void 0:e.toFixed(1),"s size=").concat(a.videoWidth,"x").concat(a.videoHeight," seekTarget=").concat(r.toFixed(2),"s"))},[]),ed=(0,l.useCallback)(e=>{let t=(null==e?void 0:e.currentTarget)||b.current,a=null==t?void 0:t.error,r=null==a?void 0:a.code,l={1:"ABORTED",2:"NETWORK",3:"DECODE",4:"SRC_NOT_SUPPORTED"}[r]||"code=".concat(null!=r?r:"?");ea(l),X(!1),_("error","".concat(l," src=").concat(($||"").slice(0,100)),a)},[$]),ec=(0,l.useCallback)(e=>{if(j.current)return;j.current=!0;let t=("undefined"!=typeof performance?performance.now():Date.now())-w.current;try{(0,I.N9)("feedFirstFrame",t,{_category:"images",surface:"FeedVideo",via:e})}catch(e){}_("firstFrame","via=".concat(e," dt=").concat(Math.round(t),"ms"))},[]),eu=(0,l.useRef)(!1),em=(0,l.useRef)(!1),ex=(0,l.useCallback)(e=>{if(M(!0),ec("seeked"),!eu.current){var t;eu.current=!0;let a=null==e?void 0:e.currentTarget;a&&_("seeked","currentTime=".concat(null==(t=a.currentTime)?void 0:t.toFixed(2)," readyState=").concat(a.readyState))}},[ec]),ep=(0,l.useCallback)(e=>{if(M(!0),ec("canPlay"),!em.current){var t;em.current=!0;let a=null==e?void 0:e.currentTarget;a&&_("canPlay","readyState=".concat(a.readyState," duration=").concat(null==(t=a.duration)?void 0:t.toFixed(1)))}},[ec]),eh=(0,l.useCallback)(()=>{if(k.current)return;k.current=!0;let e=("undefined"!=typeof performance?performance.now():Date.now())-w.current,t="string"==typeof Q&&Q.startsWith("data:");try{(0,I.N9)("feedPosterMount",e,{_category:"images",surface:"FeedVideo",kind:t?"synth":"real"})}catch(e){}},[Q]),eg=(0,l.useCallback)(e=>{if(e.stopPropagation(),K(!0),X(!0),!N){ee.current=!0,C(!0);return}let t=b.current;if(!t){ee.current=!0;return}try{E(t);try{t.preload="auto"}catch(e){}let e=t.play();e&&"function"==typeof e.then&&e.then(()=>{}).catch(()=>{X(!1)})}catch(e){X(!1)}},[N]);(0,l.useEffect)(()=>{if(!N||!ee.current)return;let e=b.current;if(e){ee.current=!1;try{E(e);try{e.preload="auto"}catch(e){}let t=e.play();t&&"function"==typeof t.then&&t.then(()=>{}).catch(()=>{X(!1)})}catch(e){X(!1)}}},[N]);let ef=(0,l.useCallback)(e=>{o&&(e.preventDefault(),e.stopPropagation(),o())},[o]);return(W(b,o),$)?(0,r.jsxs)("div",{ref:g,className:"relative w-full overflow-hidden bg-black",style:es,onDoubleClick:ef,children:[o&&(0,r.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),o()},"aria-label":"Open video",title:"Open video",className:"absolute top-2 right-2 z-[3] w-9 h-9 rounded-full bg-black/55 hover:bg-black/75 text-white flex items-center justify-center backdrop-blur-sm transition-colors",children:(0,r.jsxs)("svg",{viewBox:"0 0 24 24",className:"w-4 h-4",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("path",{d:"M15 3h6v6"}),(0,r.jsx)("path",{d:"M9 21H3v-6"}),(0,r.jsx)("path",{d:"M21 3l-7 7"}),(0,r.jsx)("path",{d:"M3 21l7-7"})]})}),!P&&!U&&!et&&(0,r.jsx)("div",{className:"absolute inset-0",style:z,"aria-hidden":"true"}),!U&&(0,r.jsx)(O,{posterResolved:Q,priority:i,alt:"",onLoadAt:eh}),N&&(0,r.jsx)("video",{ref:b,src:$,poster:Q||void 0,"data-explicit-mute":"true",muted:Z,...x||!D?{}:{autoPlay:!0}
1,playsInline:!0,loop:!0,preload:x?"none":"metadata",controls:H||U,controlsList:"nodownload",onVolumeChange:e=>{let t=e.currentTarget;if(t&&"boolean"==typeof t.muted&&(y(t.muted),!t.muted&&t.paused)){let e=t.play();e&&"function"==typeof e.catch&&e.catch(()=>{})}},onLoadedMetadata:e=>{let t=e.currentTarget;t&&t.videoWidth&&t.videoHeight&&G(t.videoWidth/t.videoHeight),null==eo||eo(e)},onSeeked:ex,onCanPlay:ep,onError:ed,onStalled:e=>{e.currentTarget.dataset.stalledLogged||(e.currentTarget.dataset.stalledLogged="1",_("stalled","readyState=".concat(e.currentTarget.readyState," networkState=").concat(e.currentTarget.networkState)))},onSuspend:e=>{e.currentTarget.dataset.suspendLogged||(e.currentTarget.dataset.suspendLogged="1",_("suspend","readyState=".concat(e.currentTarget.readyState," networkState=").concat(e.currentTarget.networkState)))},onWaiting:e=>{e.currentTarget.dataset.waitingLogged||(e.currentTarget.dataset.waitingLogged="1",_("waiting","readyState=".concat(e.currentTarget.readyState)))},onPlay:e=>{B(!0),V.current=!1,E(e.currentTarget)},onPlaying:()=>{X(!1)},onPause:e=>{B(!1);let t=e.currentTarget;if(t&&"1"===t.dataset.capEvicting){delete t.dataset.capEvicting,T(t);return}if(q.current){q.current=!1,T(t);return}t&&!t.ended&&(V.current=!0),S(),T(t)},onEnded:e=>T(e.currentTarget),className:"absolute inset-0 w-full h-full ".concat(ei," transition-opacity duration-300"),style:{opacity:+!!P,zIndex:1},children:(0,r.jsx)(F.A,{captions:c})}),!U&&!H&&!J&&!et&&(0,r.jsx)("button",{type:"button",onClick:eg,className:"absolute inset-0 z-[3] flex items-center justify-center bg-black/20 hover:bg-black/30 active:bg-black/40 transition-colors group cursor-pointer","aria-label":"Play video",children:(0,r.jsx)("span",{className:"w-16 h-16 rounded-full bg-white/25 backdrop-blur-sm flex items-center justify-center group-hover:scale-110 transition-transform shadow-2xl",children:(0,r.jsx)(m.A,{className:"w-7 h-7 text-white ml-1",fill:"currentColor"})})}),J&&!et&&(0,r.jsx)("div",{className:"absolute inset-0 z-[4] flex items-center justify-center bg-black/35 pointer-events-none","aria-hidden":"true",children:(0,r.jsx)("span",{className:"w-12 h-12 rounded-full border-[3px] border-white/30 border-t-white",style:{animation:"feedSpinnerSpin 0.9s linear infinite"}})}),er&&!P&&!et&&(0,r.jsxs)("div",{className:"absolute inset-0 z-[4] flex flex-col items-center justify-center bg-black/55 text-white/90 text-sm pointer-events-none","aria-hidden":"true",children:[(0,r.jsx)("span",{className:"w-10 h-10 rounded-full border-[3px] border-white/30 border-t-white mb-3",style:{animation:"feedSpinnerSpin 0.9s linear infinite"}}),(0,r.jsx)("span",{children:"Still loading videoâ¦"})]}),et&&!Q&&(0,r.jsx)("div",{className:"absolute inset-0 z-[2] flex items-center justify-center bg-zinc-900/40 dark:bg-zinc-950/50 pointer-events-none","aria-hidden":"true",children:(0,r.jsx)("span",{className:"w-14 h-14 rounded-full bg-white/10 flex items-center justify-center",children:(0,r.jsx)(m.A,{className:"w-6 h-6 text-white/35"})})})]}):null});Y.displayName="FeedVideo";let G=l.forwardRef(function(e,t){let{onVolumeChange:a,poster:n,posterPostId:s,...i}=e,o=(0,l.useRef)(null),[d]=v(),c=(0,l.useMemo)(()=>n&&(0,p.resolveMediaUrl)(n)||null,[n]),u=(0,l.useCallback)(e=>{o.current=e,"function"==typeof t?t(e):t&&(t.current=e)},[t]);(0,l.useEffect)(()=>{let e=o.current;e&&e.muted!==d&&(e.muted=d)},[d]),(0,l.useEffect)(()=>()=>{let e=o.current;if(e)try{e.pause(),e.muted=!0,e.removeAttribute("src"),e.load()}catch(e){}},[]);let m=(0,l.useCallback)(e=>{let t=e.currentTarget;t&&"boolean"==typeof t.muted&&y(t.muted),"function"==typeof a&&a(e)},[a]);return(0,r.jsx)("video",{ref:u,"data-explicit-mute":"true",muted:d,poster:c,onVolumeChange:m,...i})});var Z=a(87492);function $(e){return"string"==typeof e&&e.includes("/moderation/blurred/")}function Q(e){let{url:t,children:a,className:n,overlayLabel:s="18+ content",overlaySubLabel:i="This post may contain adult content. Tap to view."}=e,o=$(t),d=o?function(e){if(!e)return null;let t=String(e).match(/\/moderation\/blurred\/([0-9a-f-]{8,})(?:\.[a-z0-9]+)?/i);return t?t[1]:null}(t):null,[c,u]=(0,l.useState)(!1),[m,x]=(0,l.useState)(null),[p,h]=(0,l.useState)(!1),[g,f]=(0,l.useState)(null);(0,l.useEffect)(()=>
1{if(!o||!c||m||p)return;let e=!1;return(async()=>{h(!0),f(null);try{var a,r,l;let n={};d?n.id=d:n.url=t;let s=await Z.default.get("/posts/media/reveal",{params:n});if(e)return;let i=(null==s||null==(a=s.data)?void 0:a.originalUrl)||(null==s||null==(l=s.data)||null==(r=l.data)?void 0:r.originalUrl);i?x(i):f("no_original")}catch(t){e||f((null==t?void 0:t.message)||"reveal_failed")}finally{e||h(!1)}})(),()=>{e=!0}},[o,c,m,p,d,t]);let b=(0,l.useCallback)(e=>{e&&(e.stopPropagation(),e.preventDefault()),u(!0)},[]),y=(0,l.useCallback)(e=>{e&&(e.stopPropagation(),e.preventDefault()),u(!1),x(null)},[]);if(!o)return a(t);let v=m||t;return(0,r.jsxs)("div",{className:"relative w-full h-full ".concat(n||""),style:{minHeight:180},children:[a(v),!c&&(0,r.jsxs)("div",{className:"absolute inset-0 z-[50] flex flex-col items-center justify-center gap-3 text-center text-white",style:{background:"radial-gradient(circle at center, rgba(0,0,0,0.80) 0%, rgba(0,0,0,0.90) 100%)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)"},onClick:e=>{e.stopPropagation()},children:[(0,r.jsxs)("span",{className:"inline-flex items-center gap-2 bg-red-600 text-white text-xs font-extrabold px-3 py-1 rounded-full tracking-widest uppercase shadow-lg",children:["â ",s]}),(0,r.jsx)("span",{className:"text-sm md:text-base font-semibold max-w-sm px-6 leading-snug",children:i}),(0,r.jsx)("button",{type:"button",onClick:b,className:"mt-1 inline-flex items-center gap-1.5 bg-white text-black hover:bg-gray-100 font-semibold rounded-full px-5 py-2 text-sm shadow-lg transition","aria-label":"Confirm I am 18+ and show the original content",children:"I'm 18+ â Show me"}),(0,r.jsx)("span",{className:"text-[10px] text-white/60 max-w-xs px-6",children:"You can hide it again at any time."})]}),c&&p&&(0,r.jsx)("div",{className:"absolute top-2 right-2 z-[51] bg-black/70 text-white text-[11px] px-2 py-1 rounded",children:"Loading originalâ¦"}),c&&!p&&(0,r.jsx)("button",{type:"button",onClick:y,className:"absolute top-2 right-2 z-[51] bg-black/70 hover:bg-black/85 text-white text-[11px] px-2 py-1 rounded transition","aria-label":"Re-blur",children:"Hide"}),c&&g&&!m&&(0,r.jsx)("div",{className:"absolute bottom-2 left-2 right-2 z-[51] bg-red-900/80 text-white text-[11px] px-2 py-1 rounded text-center",children:"Could not load original â showing blurred copy"})]})}var J=a(38059),X=a(59928),ee=a(5856),et=a(52056),ea=a(21873),er=a(17910),el=a(70532),en=a(65229),es=a(5917),ei=a(93141),eo=a(38392),ed=a(24589),ec=a(66630),eu=a(26983),em=a(9058),ex=a(91169),ep=a(79397),eh=a(37772),eg=a(83457),ef=a(60235),eb=a(25276),ey=a(50859),ev=a(93499),ew=a(94266),ek=a(85998),ej=a(23327),eN=a(21190),eC=a(52334),eS=a(80534),eA=a(1375),eP=a(80501),eE=a(5937),eT=a(17181),eI=a(47650),eF=a(2008),eM=a(30901),e_=a(1213),eD=a(85472),eL=a(98589),eR=a(66801),ez=a(33637),eU=a(95019),eB=a(35299),eO=a(96583),eH=a(26155);let eW=Object.fromEntries(eU.nM.map(e=>[e.type,e.emoji])),eK=Object.fromEntries(eU.nM.map(e=>[e.type,e.label]));function eV(e){let{users:t=[],loading:a=!1,onClose:n}=e,[s,o]=(0,l.useState)("all"),[d,c]=(0,l.useState)({}),[u,m]=(0,l.useState)({});(0,l.useEffect)(()=>{let e=e=>{"Escape"===e.key&&(null==n||n())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n]);let x=(0,l.useMemo)(()=>{let e=new Map;for(let a of t){let t=a.reactionType||"like";e.set(t,(e.get(t)||0)+1)}return[...e.entries()].sort((e,t)=>t[1]-e[1]).map(e=>{let[t,a]=e;return{type:t,count:a}})},[t]),p="all"===s?t:t.filter(e=>(e.reactionType||"like")===s),h=(0,l.useCallback)(e=>{var t,a;return null!=(a=null!=(t=u[e.id])?t:e.friendshipStatus)?a:"none"},[u]),g=(0,l.useCallback)(async e=>{var t,a;let r=null!=(a=null!=(t=u[e.id])?t:e.friendshipStatus)?a:"none";if("none"!==r&&"request_sent"!==r)return;let l="none"===r?"request_sent":"none";c(t=>({...t,[e.id]:!0})),m(t=>({...t,[e.id]:l}));try{"none"===r?await (0,eH.UP)(e.id):await (0,eH.$4)(e.id)}catch(t){m(t=>({...t,[e.id]:r}))}finally{c(t=>{let a={...t};return delete a[e.id],a})}},[u]);return"undefined"==typeof document?null:(0,eI.createPortal)((0,r.jsx)("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center p-4",onClick:n,role:"dialog","aria-modal":"true","aria-label":"People who reacted",children:(0,r.jsxs)("div",{className:"bg-white dark:bg-[#242526] rounded-2xl w-full max-w-md max-h-[80vh] flex flex-col shadow-[0_12px_48px_rgba(0,0,0,0.28)] ring-1 ring-black/10 dark:ring-white/15",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center gap-1 px-2 pt-2 border-b border-gray-200 dark:border-white/10",children:[(0,r.jsx)("button",{type:"button",onClick:()=>o("all"),className:"px-4 py-3 text-[15px] font-semibold border-b-2 -mb-px transition-colors ".concat("all"===s?"border-primary text-primary":"border-transparent text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white"),"aria-current":"all"===s?"true":void 0,children:"All"}),x.map(e=>{let{type:t,count:a}=e;return(0,r.jsxs)("button",{type:"button",onClick:()=>o(t),title:eK[t]||t,className:"px-3 py-3 text-[15px] font-semibold border-b-2 -mb-px inline-flex items-center gap-1.5 transition-colors ".concat(s===t?"border-primary text-primary":"border-transparent text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white"),"aria-current":s===t?"true":void 0,children:[(0,r.jsx)("span",{"aria-hidden":"true",children:eW[t]||"\uD83D\uDC4D"}),(0,r.jsx)("span",{className:"tabular-nums",children:a})]},t)}),(0,r.jsx)("button",{type:"button",onClick:n,"aria-label":"Close",className:"ml-auto mr-1 mb-1 p-2 rounded-full text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-white/10 transition-colors",children:(0,r.jsx)(en.A,{className:"w-5 h-5"})})]}),(0,r.jsx)("div",{className:"overflow-y-auto p-2",children:a?(0,r.jsx)("div",{className:"py-10 text-center text-sm text-gray-500",children:"Loadingâ¦"}):0===p.length?(0,r.jsx)("div",{className:"py-10 text-center text-sm text-gray-500",children:"No reactions yet"}):p.map(e=>{let t=h(e),a=!!d[e.id];return(0,r.jsxs)("div",{className:"flex items-center gap-3 px-2 py-2 rounded-xl hover:bg-gray-50 dark:hover:bg-white/5 transition-colors",children:[(0,r.jsxs)(eD.N_,{to:"/profile/".concat(e.id),onClick:n,className:"relative shrink-0",children:[(0,r.jsx)("span",{className:"block w-10 h-10 rounded-full overflow-hidden bg-gray-200 dark:bg-white/10",children:(0,r.jsx)(i.A,{src:e.avatar,alt:e.name,useImg:!0,variant:"avatar",className:"w-full h-full object-cover"})}),(0,r.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5 w-4 h-4 rounded-full bg-white dark:bg-[#242526] grid place-items-center text-[10px] leading-none","aria-label":e
1K[e.reactionType]||"Like",children:eW[e.reactionType]||"\uD83D\uDC4D"})]}),(0,r.jsx)(eD.N_,{to:"/profile/".concat(e.id),onClick:n,className:"flex-1 min-w-0 font-semibold text-[15px] text-gray-900 dark:text-white truncate hover:underline",children:e.name}),("none"===t||"request_sent"===t)&&(0,r.jsxs)("button",{type:"button",onClick:()=>g(e),disabled:a,className:"shrink-0 inline-flex items-center gap-1.5 h-9 px-3 rounded-lg text-[14px] font-semibold transition-colors disabled:opacity-60 ".concat("request_sent"===t?"bg-gray-100 dark:bg-white/10 text-gray-700 dark:text-gray-200 hover:bg-gray-200 dark:hover:bg-white/20":"bg-primary/10 text-primary hover:bg-primary/20"),children:[a?(0,r.jsx)(eB.A,{className:"w-4 h-4 animate-spin","aria-hidden":"true"}):(0,r.jsx)(eO.A,{className:"w-4 h-4","aria-hidden":"true"}),"request_sent"===t?"Cancel request":"Add friend"]}),"friends"===t&&(0,r.jsx)("span",{className:"shrink-0 text-[13px] font-medium text-gray-500 dark:text-gray-400",children:"Friends"}),"request_received"===t&&(0,r.jsx)("span",{className:"shrink-0 text-[13px] font-medium text-gray-500 dark:text-gray-400",children:"Requested you"})]},e.id)})})]})}),document.body)}var eq=a(3032),eY=a(76250),eG=a(96202);a(78276);var eZ=a(75662),e$=a(44517),eQ=a(16785),eJ=a(81139),eX=a(96574),e0=a(4635),e1=a(87884),e5=a(52111),e2=a(86145),e4=a(67620),e3=a(5163),e6=a(27483),e9=a(36976),e7=a(53011),e8=a(56970),te=a(98502);let tt=null,ta=new Set;function tr(e){tt!==e&&(tt=e,ta.forEach(e=>{try{e()}catch(e){}}))}function tl(e){return ta.add(e),()=>{ta.delete(e)}}let tn=(0,n.default)(()=>a.e(86667).then(a.bind(a,86667)),{loadableGenerated:{webpack:()=>[86667]},ssr:!1}),ts=(0,n.default)(()=>Promise.resolve().then(a.bind(a,61101)),{loadableGenerated:{webpack:()=>[61101]},ssr:!1}),ti=l.lazy(()=>Promise.all([a.e(99078),a.e(96631)]).then(a.bind(a,16286))),to=(0,n.default)(()=>Promise.all([a.e(52105),a.e(67501),a.e(20710),a.e(86667),a.e(18178),a.e(79044)]).then(a.bind(a,79044)),{loadableGenerated:{webpack:()=>[79044]},ssr:!1,loading:()=>(0,r.jsx)("div",{className:"rounded-xl bg-white dark:bg-[#242526] border border-gray-200 dark:border-white/10 animate-pulse",style:{minHeight:420},"aria-hidden":"true"})}),td=e=>{var t;let{content:a}=e,l=a.split("\n").filter(e=>e.trim()),n=(l[0]||"").replace("\uD83D\uDEA8 Crisis Alert:","").trim(),s=(null==(t=l.find(e=>e.startsWith("\uD83D\uDCCD")))?void 0:t.replace("\uD83D\uDCCD","").trim())||"",i=l.find(e=>!e.startsWith("\uD83D\uDEA8")&&!e.startsWith("\uD83D\uDCCD")&&!e.startsWith("â ï¸")&&!e.startsWith("Stay safe")&&e.trim())||"",o=(l.find(e=>e.includes("Severity:"))||"").replace(/.*Severity:\s*/i,"").trim().toLowerCase(),d="critical"===o?"from-red-600 to-red-500":"high"===o?"from-orange-500 to-amber-500":"from-yellow-500 to-amber-400",c="critical"===o?"bg-red-50 dark:bg-red-500/10 border-red-200 dark:border-red-500/20":"high"===o?"bg-orange-50 dark:bg-orange-500/10 border-orange-200 dark:border-orange-500/20":"bg-yellow-50 dark:bg-yellow-500/10 border-yellow-200 dark:border-yellow-500/20",u="critical"===o?"text-red-700 dark:text-red-400":"high"===o?"text-orange-700 dark:text-orange-400":"text-yellow-700 dark:text-yellow-400";return(0,r.jsxs)("div",{className:"mx-0 mb-2 rounded-xl border overflow-hidden ".concat(c),children:[(0,r.jsx)("div",{className:"h-1.5 bg-gradient-to-r ".concat(d)}),(0,r.jsxs)("div",{className:"p-4",children:[(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br ".concat(d," flex items-center justify-center flex-shrink-0 shadow-sm"),children:(0,r.jsx)(et.A,{className:"w-5 h-5 text-white"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("h3",{className:"text-[16px] font-bold ".concat(u," leading-snug"),children:n||"Crisis Alert"}),s&&(0,r.jsxs)("p",{className:"flex items-center gap-1 text-[13px] text-gray-600 dark:text-gray-400 mt-1",children:[(0,r.jsx)(ea.A,{className:"w-3.5 h-3.5 flex-shrink-0"})," ",s]})]}),o&&(0,r.jsx)("span",{className:"px-2.5 py-1 rounded-lg text-[11px] font-bold uppercase tracking-wide ".concat(u," bg-white/60 dark:bg-black/20 flex-shrink-0"),children:o})]}),i&&(0,r.jsx)("p",{className:"text-[14px] text-gray-700 dark:text-gray-300 mt-3 leading-relaxed",children:i}),(0,r.jsxs)("div",{className:"flex items-center gap-2 mt-3 pt-3 border-t border-black/5 dark:border-white/5",children:[(0,r.jsx)(er.A,{className:"w-4 h-4 text-primary"}),(0,r.jsx)(eD.N_,{to:"/crisis-response",className:"text-[13px] font-semibold text-primary dark:text-primary-light hover:underline no-underline",children:"View Crisis Response Center â"})]})]})]})},tc=e=>{var t;let{content:a,video:n,image:s,reelId:o}=e,d=(0,eD.Zp)(),c=null==a?void 0:a.match(/https?:\/\/[^\s]+\/watch\?v=([a-zA-Z0-9-]+)/),u=o||(null==c?void 0:c[1])||"",m=(null==a||null==(t=a.split("\uD83C\uDFAC")[0])?void 0:t.trim())||"",x=n?(0,p.resolveMediaUrl)(n):null,h=s?(0,p.resolveMediaUrl)(s):null,[g,f]=(0,l.useState)(!1),[b,y]=(0,l.useState)(!1);return(0,r.jsxs)("div",{className:"pb-1",children:[m&&(0,r.jsx)("p",{className:"text-[15px] text-[#050505] dark:text-[#E4E6EB] px-4 pb-2 leading-relaxed",children:m}),(0,r.jsx)("div",{className:"cursor-pointer group relative overflow-hidden border-y border-gray-200/60 dark:border-white/5",onClick:()=>u&&d("/minis?v=".concat(u)),children:(0,r.jsxs)("div",{className:"relative w-full bg-black",style:{maxHeight:"500px"},children:[x&&!g?(0,r.jsxs)(r.Fragment,{children:[h&&!b&&(0,r.jsx)("img",{src:h,alt:"","aria-hidden":"true",className:"absolute inset-0 w-full h-full object-cover",draggable:!1,onError:()=>y(!0)}),(0,r.jsx)("video",{src:x,...h&&!b?{poster:h}:{},className:"relative w-full object-cover",style:{maxHeight:"500px"}
1,muted:!0,preload:"metadata",playsInline:!0,onError:()=>f(!0)})]}):h&&!b?(0,r.jsx)(i.A,{src:h,alt:"Mini",width:600,height:500,sizes:"(max-width:640px) 100vw, 600px",className:"w-full object-cover",style:{maxHeight:"500px"},onError:()=>y(!0)}):(0,r.jsxs)("div",{className:"w-full h-[300px] bg-gradient-to-br from-zinc-700 to-zinc-900 flex flex-col items-center justify-center gap-2 text-white/80",children:[(0,r.jsxs)("svg",{className:"w-8 h-8 opacity-80",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("rect",{x:"2",y:"2",width:"20",height:"20",rx:"2.18"}),(0,r.jsx)("line",{x1:"7",y1:"2",x2:"7",y2:"22"}),(0,r.jsx)("line",{x1:"17",y1:"2",x2:"17",y2:"22"}),(0,r.jsx)("line",{x1:"2",y1:"12",x2:"22",y2:"12"})]}),(0,r.jsx)("p",{className:"text-[12px] font-medium",children:"Mini unavailable"})]}),(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-black/10"}),x&&!g||h&&!b?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,r.jsx)("div",{className:"w-16 h-16 rounded-full bg-white/20 backdrop-blur-md flex items-center justify-center border border-white/30 shadow-2xl group-hover:scale-110 group-hover:bg-white/30 transition-all duration-200",children:(0,r.jsx)("svg",{className:"w-7 h-7 text-white ml-1",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)("path",{d:"M8 5v14l11-7z"})})})}),(0,r.jsxs)("div",{className:"absolute top-3 left-3 flex items-center gap-1.5 px-3 py-1.5 bg-black/50 backdrop-blur-sm rounded-full",children:[(0,r.jsxs)("svg",{className:"w-4 h-4 text-white",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,r.jsx)("rect",{x:"2",y:"2",width:"20",height:"20",rx:"2.18"}),(0,r.jsx)("line",{x1:"7",y1:"2",x2:"7",y2:"22"}),(0,r.jsx)("line",{x1:"17",y1:"2",x2:"17",y2:"22"}),(0,r.jsx)("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),(0,r.jsx)("line",{x1:"2",y1:"7",x2:"7",y2:"7"}),(0,r.jsx)("line",{x1:"2",y1:"17",x2:"7",y2:"17"}),(0,r.jsx)("line",{x1:"17",y1:"7",x2:"22",y2:"7"}),(0,r.jsx)("line",{x1:"17",y1:"17",x2:"22",y2:"17"})]}),(0,r.jsx)("span",{className:"text-white text-[12px] font-bold",children:"Mini"})]}),(0,r.jsx)("div",{className:"absolute bottom-0 left-0 right-0 p-3",children:(0,r.jsx)("div",{className:"flex items-center justify-between",children:(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 bg-white/15 backdrop-blur-md rounded-xl border border-white/20 group-hover:bg-white/25 transition-colors",children:[(0,r.jsx)("svg",{className:"w-4 h-4 text-white",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)("path",{d:"M8 5v14l11-7z"})}),(0,r.jsx)("span",{className:"text-white text-[13px] font-semibold",children:"Watch Mini"})]})})})]}):null]})})]})},tu=Object.fromEntries(eU.nM.map(e=>[e.type,e.emoji])),tm=new Set(["shared a video","shared a audio"]);function tx(e){let{userName:t,submitting:a,onCancel:n,onConfirm:s}=e;return(0,l.useEffect)(()=>{let e=e=>{"Escape"!==e.key||a||null==n||n()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[n,a]),(0,r.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"post-block-confirm-title",className:"fixed inset-0 z-[9999] flex items-center justify-center px-4 animate-in fade-in duration-150",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:n,"aria-hidden":"true"}),(0,r.jsxs)("div",{className:"relative w-full max-w-sm bg-white dark:bg-[#242526] rounded-2xl shadow-2xl border border-gray-200 dark:border-white/10 overflow-hidden animate-in zoom-in-95 duration-150",children:[(0,r.jsxs)("div",{className:"px-6 pt-6 pb-4 text-center",children:[(0,r.jsx)("div",{className:"mx-auto w-12 h-12 rounded-full bg-red-100 dark:bg-red-500/20 flex items-center justify-center mb-3",children:(0,r.jsx)(eo.A,{className:"w-6 h-6 text-red-600 dark:text-red-400"})}),(0,r.jsxs)("h2",{id:"post-block-confirm-title",className:"text-lg font-bold text-gray-900 dark:text-white",children:["Block ",t||"this user","?"]}),(0,r.jsx)("p",{className:"mt-2 text-sm text-gray-600 dark:text-gray-300 leading-relaxed",children:"They wonât be able to see your profile or interact with you, and their posts will stop appearing in y
1our feed."})]}),(0,r.jsxs)("div",{className:"px-4 pb-4 flex items-center gap-2",children:[(0,r.jsx)("button",{type:"button",onClick:n,disabled:a,className:"flex-1 py-2.5 rounded-xl bg-gray-100 hover:bg-gray-200 dark:bg-white/10 dark:hover:bg-white/15 text-gray-800 dark:text-gray-100 text-sm font-semibold transition-colors disabled:opacity-60",children:"Cancel"}),(0,r.jsx)("button",{type:"button",onClick:s,disabled:a,className:"flex-1 py-2.5 rounded-xl bg-red-600 hover:bg-red-700 text-white text-sm font-semibold transition-colors disabled:opacity-70",children:a?"Blockingâ¦":"Block"})]})]})]})}let tp=(0,l.memo)(e=>{var t,n,m,x,h,g,f,b,y,v,w,k,j,N,C,S,A,P,E,T,I,F,M,_,D,L,R,z,U,B,O,H,W,et,er,eB,eO,eH,eW,eK,ta,tp,th,tg,tf,tb,ty,tv,tw,tk,tj,tN,tC,tS,tA,tP,tE,tT,tI,tF,tM,t_,tD,tL,tR,tz,tU,tB,tO,tH,tW,tK,tV,tq,tY,tG,tZ,t$,tQ,tJ,tX,t0,t1,t5,t2,t4,t3,t6,t9;let{post:t7,onReport:t8,priority:ae=!1,feedPosition:at,feedSurface:aa,onDeleted:ar}=e,{t:al}=(0,eZ.Bd)(),[an,as]=(0,l.useState)(()=>{if(!t7.timestamp)return al("common.justNow");let e=new Date(t7.timestamp).toISOString();return"".concat(e.slice(0,10)," \xb7 ").concat(e.slice(11,16))});(0,l.useEffect)(()=>{if(!t7.timestamp)return;let e=new Date(t7.timestamp);if(Number.isNaN(e.getTime()))return;let t=e.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}),a=e.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"});as("".concat(t," \xb7 ").concat(a))},[t7.timestamp]);let[ai,ao]=(0,l.useState)(()=>new Set),ad=(0,l.useCallback)(e=>{e&&ao(t=>{if(t.has(e))return t;let a=new Set(t);return a.add(e),a})},[]),[ac,au]=(0,l.useState)(!1),[am,ax]=(0,l.useState)(!1),ap=(0,e_.d4)(e=>{var t;return null==(t=e.auth.user)?void 0:t.id}),ah=(0,e_.d4)(e=>e.auth.user),ag=(null==t7||null==(t=t7.user)?void 0:t.id)||(null==t7||null==(n=t7.author)?void 0:n.id),af=(0,e_.d4)(e=>(0,eL.rP)(e,t7.id,ap)),ab=(0,e_.d4)(e=>{var t;return null==(t=e.groups)?void 0:t.currentGroup}),ay=(0,e_.d4)(e=>{var t;return!!(null==t7?void 0:t7.id)&&Array.isArray(null==(t=e.posts)?void 0:t.reportedPostIds)&&e.posts.reportedPostIds.includes(t7.id)}),av=(0,eD.Zp)(),aw=(0,e_.wA)(),{requireAuth:ak,isAuthenticated:aj}=(0,e6.N)(),[aN,aC]=(0,l.useState)(null!=(tq=null==t7||null==(m=t7.page)?void 0:m.isFollowedByCurrentUser)&&tq),[aS,aA]=(0,l.useState)(!1),aP=(null==t7||null==(x=t7.page)?void 0:x.isOwnedByCurrentUser)===!0||(null==t7||null==(h=t7.page)?void 0:h.ownerId)&&ap&&String(t7.page.ownerId)===String(ap)||(null==t7?void 0:t7.page)&&ag&&ap&&String(ag)===String(ap),aE=(0,l.useCallback)(async()=>{var e;if((null==t7||null==(e=t7.page)?void 0:e.id)&&!aS){if(!aj)return void ak();aA(!0);try{aN?(await (0,e0.Yd)(t7.page.id),aC(!1),e$.default.success(al("toasts.unfollowedName","Unfollowed {{name}}",{name:t7.page.name}))):(await (0,e0.z0)(t7.page.id),aC(!0),e$.default.success(al("toasts.followingName","Following {{name}}",{name:t7.page.name})))}catch(e){e$.default.error((null==e?void 0:e.message)||al("toasts.followStatusFailed","Could not update follow status"))}finally{aA(!1)}}},[null==t7?void 0:t7.page,aN,aS,aj,ak]),[aT,aI]=(0,l.useState)(!1),aF=(0,l.useRef)(null),aM=(0,l.useRef)(null),a_=(0,l.useRef)(null),[aD,aL]=(0,l.useState)(null),[aR,az]=(0,l.useState)(!1),[aU,aB]=(0,l.useState)(!1),[aO,aH]=(0,l.useState)(!1),[aW,aK]=(0,l.useState)(!1),[aV,aq]=(0,l.useState)(!1),[aY,aG]=(0,l.useState)(null!=(tG=null!=(tY=null==t7||null==(g=t7.user)?void 0:g.isFollowing)?tY:null==t7||null==(f=t7.author)?void 0:f.isFollowing)?tG:null),aZ=(0,e_.d4)(eX.su),[a$,aQ]=(0,l.useState)(null),aJ=(0,l.useRef)(null);(0,l.useEffect)(()=>()=>{aJ.current&&(clearTimeout(aJ.current),aJ.current=null)},[]);let aX=(0,l.useCallback)(e=>{let{kind:t,headline:a,detail:r,undo:l,commit:n}=e;aJ.current&&clearTimeout(aJ.current),aQ({kind:t,headline:a,detail:r,undo:l,commit:n}),aJ.current=setTimeout(()=>{try{null==n||n()}catch(e){}aQ(null),aJ.current=null},2500)},[]),a0=(0,l.useCallback)(()=>{aJ.current&&(clearTimeout(aJ.current),aJ.current=null),aQ(null)},[]);(0,l.useEffect)(()=>{var e,t;if(a_.current&&(null==t7?void 0:t7.id))return(0,e9.createImpressionObserver)(a_.current,{targetType:"post",targetId:t7.id,surface:aa||"feed",position:Number.isFinite(at)?at:void 0,metadata:{type:t7.type,authorId:(null==(e=t7.user)?void 0:e.id)||(null==(t=t7.author)?void 0:t.id)}})},[null==t7?void 0:t7.id,aa,at,null==t7?void 0:t7.type]);let a1=(0,l.useCallback)(()=>{let e=aF.current;if(!e)return;let t=e.getBoundingClientRect(),a=window.innerWidth,r=window.innerHeight,l=Math.max(16,Math.min(t.top,r-16)),n=Math.max(160,r-l-16),s=t.right+8;if(s+256+16<=a)return void aL({top:l,left:s,placement:"right",maxHeight:n});let i=t.left-8-256;if(i>=16)return void aL({top:l,left:i,placement:"left",maxHeight:n});let o=t.bottom+8,d=Math.max(160,r-o-16),c=t.right-256;c<16&&(c=16),c+256+16>a&&(c=a-256-16),aL({top:o,left:c,placement:"below",maxHeight:d})},[]),a5=(0,l.useCallback)(()=>
1{if(!aj)return void ak();aI(e=>{let t=!e;return t&&a1(),t})},[aj,ak,a1]),a2=(0,l.useCallback)(()=>aI(!1),[]);(0,l.useEffect)(()=>{if(!aT)return;let e=()=>a1();return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[aT,a1]),(0,l.useEffect)(()=>{if(!aT)return;let e=e=>{!(aF.current&&aF.current.contains(e.target))&&(aM.current&&aM.current.contains(e.target)||aI(!1))},t=e=>{"Escape"===e.key&&aI(!1)},a=setTimeout(()=>{document.addEventListener("mousedown",e),document.addEventListener("keydown",t)},50);return()=>{clearTimeout(a),document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[aT]);let[a4,a3]=(0,l.useState)(!1),[a6,a9]=(0,l.useState)(0),[a7,a8]=(0,l.useState)(!1),[re,rt]=(0,l.useState)(null),[ra,rr]=(0,l.useState)(!1),[rl,rn]=(0,l.useState)(!1),[rs,ri]=(0,l.useState)(!1),[ro,rd]=(0,l.useState)(!1);(0,l.useCallback)(async e=>{rd(!0);try{let t=(await Promise.resolve().then(a.bind(a,87492))).default;await t.post("/translate/rate",{rating:e,sourceText:(null==t7?void 0:t7.content)||"",translatedText:"string"==typeof re?re:(null==re?void 0:re.translation)||(null==re?void 0:re.text)||"",targetLang:"undefined"!=typeof navigator?(navigator.language||"en").split("-")[0]:"en",contextType:"post",contextId:(null==t7?void 0:t7.id)||null})}catch(e){}},[null==t7?void 0:t7.content,null==t7?void 0:t7.id,re]),(0,l.useEffect)(()=>{rt(null),rr(!1),rn(!1),ri(!1)},[t7.id,t7.content]),(0,l.useCallback)(async e=>{var t,a,r,l,n,s,i;if(e&&(null==(t=e.stopPropagation)||t.call(e),null==(a=e.preventDefault)||a.call(e)),ra)return;if(re)return void ri(e=>!e);let o=(t7.content||"").trim();if(o){rn(!1),rr(!0);try{let e="undefined"!=typeof navigator&&navigator.language&&navigator.language.split("-")[0]||"en",t=await Z.default.post("/translate",{text:o,targetLang:e,contextType:"post",contextId:t7.id}),a=null!=(i=null!=(s=null==t||null==(l=t.data)||null==(r=l.data)?void 0:r.translatedText)?s:null==t||null==(n=t.data)?void 0:n.translatedText)?i:null;a&&"string"==typeof a?(rt(a),ri(!0)):rn(!0)}catch(e){rn(!0)}finally{rr(!1)}}},[t7.id,t7.content,re,ra]);let[rc,ru]=function(e){let t=(0,l.useSyncExternalStore)(tl,()=>tt===e,()=>!1),a=(0,l.useCallback)(t=>{t?tr(e):tt===e&&tr(null)},[e]);return(0,l.useEffect)(()=>()=>{tt===e&&tr(null)},[e]),[t,a]}(t7.id),[rm,rx]=(0,l.useState)(t7.content||""),[rp,rh]=(0,l.useState)(["public","friends","only_me"].includes(t7.type)?t7.type:"public"),[rg,rf]=(0,l.useState)(!!t7.commentsMuted),[rb,ry]=(0,l.useState)(!1),[rv,rw]=(0,l.useState)([]),[rk,rj]=(0,l.useState)([]),[rN,rC]=(0,l.useState)(!1),rS=(0,l.useRef)(null),[rA,rP]=(0,l.useState)(null),[rE,rT]=(0,l.useState)(!1),[rI,rF]=(0,l.useState)(!1),[rM,r_]=(0,l.useState)(!1),[rD,rL]=(0,l.useState)(null),[rR,rz]=(0,l.useState)(!1),[rU,rB]=(0,l.useState)(null),[rO,rH]=(0,l.useState)(!1),[rW,rK]=(0,l.useState)(!1),[rV,rq]=(0,l.useState)(!1),[rY,rG]=(0,l.useState)([]),[rZ,r$]=(0,l.useState)([]),[rQ,rJ]=(0,l.useState)(!1),[rX,r0]=(0,l.useState)(!1),[r1,r5]=(0,l.useState)(t7.isPinned||!1),[r2,r4]=(0,l.useState)(t7.commentsMuted||t7.commentsDisabled||!1),r3=(0,l.useMemo)(()=>{let e=Array.isArray(null==t7?void 0:t7.topReactions)?t7.topReactions:null;if(null==e?void 0:e.length){let t=e.find(e=>e.type&&"like"!==e.type);return t&&tu[t.type]||null}if(!rY.length)return null;let t=new Map;for(let e of rY){let a=e.reactionType||"like";"like"!==a&&t.set(a,(t.get(a)||0)+1)}return t.size&&tu[[...t.entries()].sort((e,t)=>t[1]-e[1])[0][0]]||null},[null==t7?void 0:t7.topReactions,rY]),r6=(0,l.useRef)(!1),r9=(0,l.useCallback)(async()=>{if(!r6.current){r6.current=!0,rJ(!0);try{let e=localStorage.getItem("token"),t=await fetch("/api/v1/feed/".concat(t7.id,"/likes"),{headers:e?{Authorization:"Bearer ".concat(e)}:{}}),a=await t.json();rG(Array.isArray(null==a?void 0:a.data)?a.data:Array.isArray(a)?a:[])}catch(e){rG([]),r6.current=!1}finally{rJ(!1)}}},[t7.id]),r7=(0,e_.d4)(e=>{var t;return Array.isArray(null==(t=e.posts)?void 0:t.items)?e.posts.items:null}),r8=(()=>
1{if(!r7)return;let e=r7.find(e=>e&&e.id===t7.id);return e?!!e.isPinned:void 0})();(0,l.useEffect)(()=>{void 0!==r8&&r8!==r1&&r5(r8)},[r8]);let le=null!=(tZ=t7.likes)?tZ:0,lt=t7.isLiked||!!af,la=!!ah&&(0,eM.p)(t7,ah.id||ah._id),[lr,ll]=(0,l.useState)(!1),ln=(null==t7||null==(b=t7.user)?void 0:b.id)||(null==t7||null==(y=t7.author)?void 0:y.id)||null,ls=!la&&!(null==t7?void 0:t7.page)&&!!ln&&!1===aY,li=(0,l.useCallback)(async e=>{var t,a,r;if((null==e||null==(t=e.stopPropagation)||t.call(e),ln&&!lr)&&ak()){ll(!0),aG(!0);try{await Z.default.post("/graph/follow/".concat(ln)),e$.default.success(al("post.followed","Following"))}catch(e){aG(!1),e$.default.error((null==e||null==(r=e.response)||null==(a=r.data)?void 0:a.message)||al("post.followFailed","Couldn't follow"))}finally{ll(!1)}}},[ln,lr,ak,al]),lo=(0,l.useCallback)(e=>{var t;null==e||null==(t=e.stopPropagation)||t.call(e),aw((0,eR.p9)(t7.id)),(0,e$.default)(e=>(0,r.jsxs)("span",{className:"flex items-center gap-3",children:[al("post.postHidden","Post hidden"),(0,r.jsx)("button",{type:"button",className:"font-semibold text-[#0866FF]",onClick:()=>{aw((0,eR.tQ)(t7.id)),e$.default.dismiss(e.id)},children:al("common.undo","Undo")})]}),{duration:5e3});
1try{(0,p.submitFeedback)(t7.id,"not_interested").catch(()=>{})}catch(e){}},[aw,null==t7?void 0:t7.id,al]),ld=ab&&ab.id===t7.groupId&&"admin"===ab.role,lc=la||ld||aP,lu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"success";rL({type:t,message:e}),setTimeout(()=>rL(null),3e3)},lm=async()=>{if(a2(),!(0,e5.L)(t7)){aw((0,eR.dw)(t7.id)),lu(t7.isFavorite?"Removed from Favourites":"Added to Favourites");return}let e=t7.isFavorite;aw((0,eR.dw)(t7.id)),lu(e?"Removed from Favourites":"Added to Favourites");try{await aw((0,eR.Vv)({postId:t7.id,isFavorite:e})).unwrap()}catch(e){aw((0,eR.dw)(t7.id)),e$.default.error((null==e?void 0:e.message)||"Could not update favourites")}},lx=async()=>{a2(),t7.id&&((0,e7.Sq)("post",t7.id,"hide").catch(()=>{}),"foryou"===aa&&aw((0,e8.K6)({postId:t7.id,action:"hide"})),(0,e5.L)(t7)&&(0,p.hidePostAPI)(t7.id).catch(()=>{}),aX({kind:"hide",headline:"Post hidden",detail:"We'll show fewer posts like this in your feed.",commit:()=>aw((0,eR.p9)(t7.id)),undo:async()=>{try{(await Promise.resolve().then(a.bind(a,87492))).default.post("/feed/".concat(t7.id,"/unhide")).catch(()=>{})}catch(e){}}}))},lp=async()=>{rF(!1),await lx()},lh=async()=>{r_(!1);try{await aw((0,eR.$H)(t7.id)).unwrap(),null==ar||ar(t7.id),e$.default.success(al("toasts.postDeleted","Post deleted successfully"))}catch(e){e$.default.error(al("toasts.deletePostFailed","Failed to delete post"))}},lg=async()=>{let e=Array.isArray(t7.files)?t7.files.filter(e=>!rv.includes(e.id)).length:0,t=(!!t7.image||!!t7.video)&&0===e&&!rv.includes("__hero__")||e>0||rk.length>0;if(!rm.trim()&&!t)return void e$.default.error(al("toasts.postEmpty","Post cannot be empty."));if(!rb){ry(!0);try{await aw((0,eR.S3)({postId:t7.id,postData:{content:rm,privacy:rp,commentsMuted:rg,remove_file_ids:rv.filter(e=>"__hero__"!==e),add_files:rk}})).unwrap(),r4(rg),ru(!1),rw([]),rj([]),e$.default.success(al("toasts.postUpdated","Post updated successfully"))}catch(e){e$.default.error((null==e?void 0:e.message)||al("toasts.updatePostFailed","Failed to update post"))}finally{ry(!1)}}},lf=async()=>{if(a2(),!(0,e5.L)(t7)){aw((0,eR.i_)({postId:t7.id,isSaved:!t7.isSaved})),e$.default.success(t7.isSaved?al("toasts.removedFromSaved","Removed from saved."):al("toasts.savedViewInSaved","Saved. View in Saved."));return}try{t7.isSaved?(await (0,eJ.sy)(t7.id),aw((0,eR.i_)({postId:t7.id,isSaved:!1})),e$.default.success(al("toasts.removedFromSaved","Removed from saved."))):(await (0,eJ.E0)(t7.id),aw((0,eR.i_)({postId:t7.id,isSaved:!0})),e$.default.success(al("toasts.savedViewInSaved","Saved. View in Saved.")))}catch(e){e$.default.error((null==e?void 0:e.message)||al("toasts.savePostFailed","Could not save post"))}},lb=()=>{var e,t,a,r,l,n,s;a2(),(null==t7?void 0:t7.id)&&(aK(!1),aw((0,eX.gF)({surface:"post",targetType:"post",targetId:null==t7?void 0:t7.id,targetName:(null==t7||null==(e=t7.page)?void 0:e.name)||(null==t7||null==(t=t7.user)?void 0:t.name),authorName:(null==t7||null==(a=t7.page)?void 0:a.name)||(null==t7||null==(r=t7.user)?void 0:r.name),authorId:null==t7||null==(l=t7.user)?void 0:l.id,isPageAuthor:!!(null==t7||null==(n=t7.page)?void 0:n.id),viewerFollows:!!(null==t7||null==(s=t7.page)?void 0:s.id)&&!0===aN})))},ly=(0,l.useCallback)(async()=>{if(aK(!1),(null==t7?void 0:t7.id)&&aw((0,eR.QU)(t7.id)),aZ)try{await (0,eF.withdrawReportAPI)(aZ)}catch(e){}try{(await Promise.resolve().then(a.bind(a,87492))).default.post("/feed/".concat(t7.id,"/unhide")).catch(()=>{})}catch(e){}(0,e7.Sq)("post",t7.id,"undo").catch(()=>{}),e$.default.success("Restored")},[aw,aZ,null==t7?void 0:t7.id]),lv=(0,l.useCallback)(()=>{(null==t7?void 0:t7.id)&&((0,p.submitFeedback)(t7.id,"not_interested").cat
1ch(()=>{}),(0,e7.Sq)("post",t7.id,"not_interested").catch(()=>{}),"foryou"===aa&&aw((0,e8.K6)({postId:t7.id,action:"not_interested"})),aq(!0))},[aw,aa,null==t7?void 0:t7.id]),lw=(0,l.useCallback)(()=>{aq(!1),(null==t7?void 0:t7.id)&&((0,p.submitFeedback)(t7.id,null).catch(()=>{}),(0,e7.Sq)("post",t7.id,"undo").catch(()=>{}),e$.default.success("Restored"))},[null==t7?void 0:t7.id]);(0,l.useEffect)(()=>{var e,t,a;if(!aV||(null==t7||null==(e=t7.page)?void 0:e.id)||la||null!==aY)return;let r=(null==t7||null==(t=t7.user)?void 0:t.id)||(null==t7||null==(a=t7.author)?void 0:a.id);if(!r)return;let l=!1;return(async()=>{try{var e,t;let a=await Z.default.get("/graph/follow/".concat(r,"/status")),n=!!(null!=(t=null==a||null==(e=a.data)?void 0:e.isFollowing)?t:null==a?void 0:a.isFollowing);l||aG(n)}catch(e){l||aG(!1)}})(),()=>{l=!0}},[aV,null==t7||null==(v=t7.page)?void 0:v.id,null==t7||null==(w=t7.user)?void 0:w.id,null==t7||null==(k=t7.author)?void 0:k.id,la,aY]);let lk=(0,l.useCallback)(async()=>{var e,t,a,r,l,n,s,i,o;if(null==t7||null==(e=t7.page)?void 0:e.id){if(!aN)return;let e=(null==t7||null==(n=t7.page)?void 0:n.name)||"Page";aC(!1);try{await (0,e0.Yd)(t7.page.id),e$.default.success("Unfollowed ".concat(e))}catch(e){aC(!0),e$.default.error((null==e?void 0:e.message)||"Could not unfollow")}return}let d=(null==t7||null==(t=t7.user)?void 0:t.id)||(null==t7||null==(a=t7.author)?void 0:a.id);if(!d||!0!==aY)return;let c=(null==t7||null==(r=t7.user)?void 0:r.name)||(null==t7||null==(l=t7.author)?void 0:l.name)||"this user";aG(!1);try{await Z.default.delete("/graph/follow/".concat(d));try{aw((0,e1.E2)({creatorId:d,isFollowing:!1}))}catch(e){}e$.default.success("Unfollowed ".concat(c))}catch(e){aG(!0),e$.default.error((null==e||null==(i=e.response)||null==(s=i.data)?void 0:s.message)||(null==e||null==(o=e.body)?void 0:o.message)||(null==e?void 0:e.message)||"Could not unfollow")}},[aw,aN,aY,null==t7||null==(j=t7.page)?void 0:j.id,null==t7||null==(N=t7.page)?void 0:N.name,null==t7||null==(C=t7.user)?void 0:C.id,null==t7||null==(S=t7.user)?void 0:S.name,null==t7||null==(A=t7.author)?void 0:A.id,null==t7||null==(P=t7.author)?void 0:P.name]),lj=async function(e,t,a){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30;a2();let l=1===r?"1 day":"".concat(r," days");if(!(0,e5.L)(t7)&&!(0,e5.v)(t)){aw((0,eR.p9)(t7.id)),e$.default.success("Snoozed ".concat(a," for ").concat(l));return}try{await (0,p.snoozeSourceAPI)(e,t,r),aw((0,eR.p9)(t7.id)),e$.default.success("Snoozed ".concat(a," for ").concat(l))}catch(e){e$.default.error((null==e?void 0:e.message)||"Could not snooze. Ensure the backend is running.")}},lN=async()=>{var e;if(a2(),null==t7||null==(e=t7.user)?void 0:e.id){if(!(0,e5.L)(t7)&&!(0,e5.v)(t7.user.id)){aw((0,eR.p9)(t7.id)),e$.default.success("Stopped seeing posts from ".concat(t7.user.name));return}try{await (0,p.hideFromUserAPI)(t7.user.id),aw((0,eR.p9)(t7.id)),e$.default.success("Stopped seeing posts from ".concat(t7.user.name))}catch(e){e$.default.error((null==e?void 0:e.message)||"Could not hide. Ensure the backend is running.")}}},lC=async()=>{var e;if(a2(),null==t7||null==(e=t7.page)?void 0:e.id){if(!(0,e5.L)(t7)){aw((0,eR.p9)(t7.id)),e$.default.success("Stopped seeing posts from ".concat(t7.page.name));return}try{await (0,p.hideFromPageAPI)(t7.page.id),aw((0,eR.p9)(t7.id)),e$.default.success("Stopped seeing posts from ".concat(t7.page.name))}catch(e){e$.default.error((null==e?void 0:e.message)||"Could not hide.")}}},lS=async()=>{var e;if(a2(),null==t7||null==(e=t7.group)?void 0:e.id){if(!(0,e5.L)(t7)){aw((0,eR.p9)(t7.id)),e$.default.success("Unfollowed ".concat(t7.group.name,". You stay in the group."));return}try{await (0,p.unfollowGroupAPI)(t7.group.id),aw((0,eR.p9)(t7.id)),e$.default.success("Unfollowed ".concat(t7.group.name,". You stay in the group."))}catch(e){e$.default.error((null==e?void 0:e.message)||"Could not unfollow.")}}},lA=(0,l.useCallback)(async()=>{var e,t,a;if(!(null==t7||null==(e=t7.user)?void 0:e.id))return;let r=t7.user.id;if(aB(!1),az(!1),aw((0,eR.Zh)(t7.id)),(0,e5.L)(t7)||(0,e5.v)(r))try{await (null==(t=(a=aw((0,eX.blockUser)({userId:r,user:{id:r,username:t7.user.username||null,name:t7.user.n
1ame||null,avatar:t7.user.avatar||null}}))).unwrap)?void 0:t.call(a))}catch(e){aw((0,eR.kb)(t7.id)),e$.default.error("Could not block user");return}aH(!0)},[t7,aw]),lP=async()=>{a2();let e=!r1;if(e){let e=(()=>{var e,t;if(!Array.isArray(r7))return null;let a=(null==(e=t7.author)?void 0:e.id)||(null==(t=t7.user)?void 0:t.id)||t7.authorId||null;return r7.filter(e=>{var t,r;return!!(null==e?void 0:e.isPinned)&&(t7.groupId?e.groupId===t7.groupId:t7.pageId?e.pageId===t7.pageId:((null==(t=e.author)?void 0:t.id)||(null==(r=e.user)?void 0:r.id)||e.authorId||null)===a&&!e.groupId&&!e.pageId)}).length})();if("number"==typeof e&&e>=3)return void e$.default.error("You can only pin 3 posts")}if(r5(e),(0,e5.L)(t7))try{let t=await Promise.resolve().then(a.bind(a,39259));e?await t.pinPost(t7.id):await t.unpinPost(t7.id),aw((0,eR.L)({postId:t7.id,isPinned:e,pinnedAt:e?new Date().toISOString():null,pinnedById:e&&(ap||ag)||null}))}catch(a){r5(!e);let t=(null==a?void 0:a.message)||"";/maximum.*3.*pinned/i.test(t)||/can only pin 3/i.test(t)?e$.default.error("You can only pin 3 posts"):e$.default.error(t||"Failed to pin/unpin post.");return}lu(e?"Post pinned to top.":"Post unpinned.")},lE=async()=>{a2();let e=!r2;if(r4(e),(0,e5.L)(t7))try{let t=(await Promise.resolve().then(a.bind(a,87492))).default;await t.put("/feed/posts/".concat(t7.id),{commentsMuted:e})}catch(t){r4(!e),e$.default.error("Failed to update comment settings.");return}lu(e?"Comments turned off.":"Comments turned on.")},[lT,lI]=(0,l.useState)(!1),lF=async()=>{a2();let e=t7.slug&&t7.authorUsername?"/p/".concat(t7.authorUsername,"/").concat(t7.slug):"/post/".concat(t7.id),t=window.location.origin+e;try{var a;if("undefined"!=typeof navigator&&(null==(a=navigator.clipboard)?void 0:a.writeText))await navigator.clipboard.writeText(t);else{let e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}e$.default.success(al("toasts.linkCopied","Post link copied"))}catch(e){e$.default.error(al("toasts.copyLinkFailed","Could not copy link"))}},[lM,l_]=(0,l.useState)(!!t7.notifyOnReplies),[lD,lL]=(0,l.useState)(!1),lR=async()=>{if(lD)return;a2();let e=!lM;l_(e),lL(!0);try{let t=(await Promise.resolve().then(a.bind(a,87492))).default;await t.post("/feed/posts/".concat(t7.id,"/notifications"),{enabled:e}),e$.default.success(e?"Notifications turned on":"Notifications turned off")}catch(l){var t,r;let a=(null==l||null==(t=l.response)?void 0:t.status)===404?e?"Notifications turned on":"Notifications turned off":(null==l?void 0:l.message)||"Could not update notifications";(null==l||null==(r=l.response)?void 0:r.status)===404?e$.default.success(a):(l_(!e),e$.default.error(a))}finally{lL(!1)}},lz=async()=>{if(a2(),window.confirm("Hide this post from your timeline? People who already saw it can still see it via direct link.")){aw((0,eR.p9)(t7.id));try{let e=(await Promise.resolve().then(a.bind(a,87492))).default;await e.post("/feed/posts/".concat(t7.id,"/archive")),e$.default.success("Post hidden from your timeline"),null==lu||lu("Post hidden")}catch(e){aw((0,eR.tQ)(t7.id)),e$.default.error((null==e?void 0:e.message)||"Failed to hide post")}}};if((null==t7?void 0:t7.type)==="live"&&(null==t7||null==(E=t7.liveStream)?void 0:E.status)==="live")return(0,r.jsx)("div",{ref:a_,children:(0,r.jsx)(to,{post:t7,onReport:t8})});if(aO)return(0,r.jsx)(ez.A,{authorName:(null==t7||null==(t$=t7.user)?void 0:t$.name)||"this user",onDismiss:()=>{aH(!1),(null==t7?void 0:t7.id)&&(aw((0,eR.kb)(t7.id)),aw((0,eR.p9)(t7.id)))}});if(aV&&!aW&&!ay){let e=!!(null==t7||null==(tQ=t7.page)?void 0:tQ.id),t=(null==t7||null==(tJ=t7.page)?void 0:tJ.name)||(null==t7||null==(tX=t7.user)?void 0:tX.name)||"this account",a=e?!0===aN:!0===aY;return(0,r.jsxs)("div",{ref:a_,className:"bg-white dark:bg-dark-paper rounded-xl shadow-sm border border-gray-200 dark:border-white/10 mb-4 overflow-hidden",role:"status","aria-live":"polite",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 px-4 py-3.5",children:[(0,r.jsxs)("div",{className:"flex items-start gap-3 min-w-0",children:[(0,r.jsx)("span",{className:"mt-0.5 w-8 h-8 rounded-full bg-gray-100 dark:bg-white/10 flex items-center justify-center flex-shrink-0",children:(0,r.jsx)(el.A,{className:"w-[18px] h-[18px] text-gray-700 dark:text-gray-200"})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("p",{className:"text-[15px] font-bold text-gray-900 dark:text-white leading-tight",children:"Hidden"}),(0,r.jsx)("p",{className:"text-[13px] text-gray-500 dark:text-gray-400 mt-0.5 leading-snug",children:"You'll see fewer posts like this for a while."})]})]}),(0,r.jsxs)("button",{type:"button",onClick:lw,className:"flex-shrink-0 inline-flex items-center gap-1.5 px-3.5 py-1.5 rounded-md bg-gray-100 hover:bg-gray-200 dark:bg-white/10 dark:hover:bg-white/15 text-gray-800 dark:text-gray-100 text-[14px] font-semibold transition-colors",children:[(0,r.jsx)(ei.A,{className:"w-3.5 h-3.5"}),"Undo"]})]}),a&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"border-t border-gray-100 dark:border-white/10"}),(0,r.jsxs)("button",{type:"button",onClick:lk,className:"w-full flex items-start gap-3 px-4 py-3 text-left hover:bg-gray-50 dark:hover:bg-white/5 transition-colors",children:[(0,r.jsx)("span",{className:"mt-0.5 w-9 h-9 rounded-full bg-gray-100 dark:bg-white/10 flex items-center justify-center flex-shrink-0",children:(0,r.jsx)(eo.A,{className:"w-[18px] h-[18px] text-gray-700 dark:text-gray-200"})}),(0,r.jsxs)("span",{className:"min-w-0",children:[(0,r.jsxs)("span",{className:"block text-[15px] font-semibold text-gray-900 dark:text-white",children:["Unfollow ",t]}),(0,r.jsx)("span",{className:"block text-[13px] text-gray-500 dark:text-gray-400",children:e?"Stop seeing posts from this Page. They w
1on't be notified that you unfollowed.":"Stop seeing posts from ".concat(t,". They won't be notified that you unfollowed.")})]})]})]}),(0,r.jsx)("div",{className:"border-t border-gray-100 dark:border-white/10"}),(0,r.jsxs)("button",{type:"button",onClick:lb,className:"w-full flex items-start gap-3 px-4 py-3 text-left hover:bg-gray-50 dark:hover:bg-white/5 transition-colors",children:[(0,r.jsx)("span",{className:"mt-0.5 w-9 h-9 rounded-full bg-gray-100 dark:bg-white/10 flex items-center justify-center flex-shrink-0",children:(0,r.jsx)(ed.A,{className:"w-[18px] h-[18px] text-gray-700 dark:text-gray-200"})}),(0,r.jsxs)("span",{className:"min-w-0",children:[(0,r.jsx)("span",{className:"block text-[15px] font-semibold text-gray-900 dark:text-white",children:"Report post"}),(0,r.jsxs)("span",{className:"block text-[13px] text-gray-500 dark:text-gray-400",children:["We won't let ",t," know who reported this."]})]})]}),(0,r.jsx)("div",{className:"border-t border-gray-100 dark:border-white/10"}),(0,r.jsxs)("button",{type:"button",onClick:()=>av("/settings/content-preferences"),className:"w-full flex items-start gap-3 px-4 py-3 text-left hover:bg-gray-50 dark:hover:bg-white/5 transition-colors",children:[(0,r.jsx)("span",{className:"mt-0.5 w-9 h-9 rounded-full bg-gray-100 dark:bg-white/10 flex items-center justify-center flex-shrink-0",children:(0,r.jsx)(ec.A,{className:"w-[18px] h-[18px] text-gray-700 dark:text-gray-200"})}),(0,r.jsx)("span",{className:"min-w-0",children:(0,r.jsx)("span",{className:"block text-[15px] font-semibold text-gray-900 dark:text-white",children:"Content preferences"})})]})]})}if(aW||ay){let e=(null==t7||null==(t0=t7.page)?void 0:t0.name)||(null==t7||null==(t1=t7.user)?void 0:t1.name)||"this",t=(null==t7||null==(t5=t7.page)?void 0:t5.id)?"page":"user",a=(null==t7||null==(t2=t7.page)?void 0:t2.id)||(null==t7||null==(t4=t7.user)?void 0:t4.id)||null;return(0,r.jsxs)("div",{ref:a_,className:"bg-white dark:bg-dark-paper rounded-xl shadow-sm border border-gray-200 dark:border-white/10 mb-4 overflow-hidden",role:"status","aria-live":"polite",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 px-4 py-3.5",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("p",{className:"text-[15px] font-bold text-gray-900 dark:text-white",children:"Hidden"}),(0,r.jsx)("p",{className:"text-[13px] text-gray-500 dark:text-gray-400 mt-0.5",children:"Reporting helps us deal with unwanted content."})]}),(0,r.jsxs)("button",{type:"button",onClick:ly,className:"flex-shrink-0 inline-flex items-center gap-1.5 px-3.5 py-1.5 rounded-md bg-gray-100 hover:bg-gray-200 dark:bg-white/10 dark:hover:bg-white/15 text-gray-800 dark:text-gray-100 text-[14px] font-semibold transition-colors",children:[(0,r.jsx)(ei.A,{className:"w-3.5 h-3.5"}),"Undo"]})]}),(0,r.jsx)("div",{className:"border-t border-gray-100 dark:border-white/10"}),(0,r.jsxs)("button",{type:"button",onClick:()=>{a&&lj(t,a,e,30)},className:"w-full flex items-start gap-3 px-4 py-3 text-left hover:bg-gray-50 dark:hover:bg-white/5 transition-colors",children:[(0,r.jsx)("span",{className:"mt-0.5 w-9 h-9 rounded-full bg-gray-100 dark:bg-white/10 flex items-center justify-center flex-shrink-0",children:(0,r.jsx)(eu.A,{className:"w-[18px] h-[18px] text-gray-700 dark:text-gray-200"})}),(0,r.jsxs)("span",{className:"min-w-0",children:[(0,r.jsxs)("span",{className:"block text-[15px] font-semibold text-gray-900 dark:text-white",children:["Snooze ",e," for 30 days"]}),(0,r.jsx)("span",{className:"block text-[13px] text-gray-500 dark:text-gray-400",children:"Temporarily stop seeing posts."})]})]}),(0,r.jsx)("div",{className:"border-t border-gray-100 dark:border-white/10"}),(0,r.jsxs)("button",{type:"button",onClick:()=>av("/settings/content-preferences"),className:"w-full flex items-start gap-3 px-4 py-3 text-left hover:bg-gray-50 dark:hover:bg-white/5 transition-colors",children:[(0,r.jsx)("span",{className:"mt-0.5 w-9 h-9 rounded-full bg-gray-100 dark:bg-white/10 flex items-center justify-center flex-shrink-0",children:(0,r.jsx)(ec.A,{className:"w-[18px] h-[18px] text-gray-700 dark:text-gray-200"})}),(0,r.jsxs)("span",{className:"min-w-0",children:[(0,r.jsx)("span",{className:"block text-[15px] font-semibold text-gray-900 dark:text-white",children:"Content preferences"}),(0,r.jsx)("span",{className:"block text-[13px] text-gray-500 dark:text-gray-400",children:"Adjust what you see in your feed."})]})]})]})}return(0,r.jsxs)("div",{ref:a_,className:"bg-white dark:bg-dark-paper rounded-xl shadow-sm border border-gray-200 dark:border-white/10 p-4 mb-4 relative",children:[a$&&(0,r.jsx)("div",{className:"absolute inset-0 z-40 flex items-center justify-center bg-white/95 dar
1k:bg-[#242526]/95 backdrop-blur-sm rounded-xl animate-in fade-in",role:"status","aria-live":"polite",children:(0,r.jsxs)("div",{className:"relative w-[min(86%,320px)] text-center px-5 py-6",children:[(0,r.jsx)("button",{type:"button",onClick:a0,className:"absolute top-2 right-2 p-1.5 rounded-full hover:bg-black/5 dark:hover:bg-white/10 text-gray-500 hover:text-gray-700 dark:hover:text-white transition-colors","aria-label":"Dismiss",title:"Dismiss",children:(0,r.jsx)(en.A,{className:"w-4 h-4"})}),(0,r.jsx)("div",{className:"w-12 h-12 rounded-full bg-green-100 dark:bg-green-500/20 flex items-center justify-center mx-auto mb-3",children:(0,r.jsx)(es.A,{className:"w-6 h-6 text-green-600 dark:text-green-400"})}),(0,r.jsx)("h3",{className:"text-[15px] font-bold text-gray-900 dark:text-white",children:a$.headline}),(0,r.jsx)("p",{className:"text-[12.5px] text-gray-600 dark:text-gray-300 mt-1.5 leading-relaxed",children:a$.detail}),(0,r.jsxs)("button",{type:"button",onClick:async()=>{aJ.current&&(clearTimeout(aJ.current),aJ.current=null);try{var e;await (null==(e=a$.undo)?void 0:e.call(a$))}catch(e){}e$.default.success("Restored"),aQ(null)},className:"mt-4 inline-flex items-center gap-2 px-4 py-2 rounded-full bg-gray-900 dark:bg-white text-white dark:text-gray-900 text-sm font-bold hover:opacity-90 active:scale-[0.98] transition-all",children:[(0,r.jsx)(ei.A,{className:"w-4 h-4"}),"Undo"]})]})}),rD&&(0,r.jsxs)("div",{className:"absolute top-4 left-1/2 -translate-x-1/2 z-[50] bg-gray-900 dark:bg-white text-white dark:text-gray-900 px-4 py-2 rounded-full shadow-xl flex items-center gap-2 animate-in slide-in-from-top-2 fade-in whitespace-nowrap",children:[(0,r.jsx)(es.A,{className:"w-4 h-4 text-green-400 dark:text-green-600"}),(0,r.jsx)("span",{className:"font-medium text-sm",children:rD.message})]}),rI&&"undefined"!=typeof document&&(0,eI.createPortal)((0,r.jsx)("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/50 backdrop-blur-sm p-4 animate-in fade-in",children:(0,r.jsxs)("div",{className:"bg-white dark:bg-[#242526] w-full max-w-sm rounded-xl shadow-2xl p-6 text-center animate-in zoom-in-95 border border-gray-100 dark:border-white/10",children:[(0,r.jsx)("div",{className:"w-16 h-16 bg-gray-100 dark:bg-white/10 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,r.jsx)(el.A,{className:"w-8 h-8 text-gray-600 dark:text-gray-300"})}),(0,r.jsx)("h3",{className:"text-xl font-bold text-gray-900 dark:text-white mb-2",children:al("post.menu.hidePostQ","Hide Post?")}),(0,r.jsx)("p",{className:"text-gray-500 dark:text-gray-400 mb-6 text-sm",children:al("post.menu.hidePostConfirmDesc","This post will be hidden from your feed. You can undo this action later in settings.")}),(0,r.jsxs)("div",{className:"flex gap-3",children:[(0,r.jsx)("button",{onClick:()=>rF(!1),className:"flex-1 py-2.5 bg-gray-100 dark:bg-white/10 rounded-lg font-semibold text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-white/20 transition-colors",children:al("common.cancel")}),(0,r.jsx)("button",{onClick:lp,className:"flex-1 py-2.5 bg-primary text-white rounded-lg font-semibold hover:bg-primary transition-colors",children:al("post.menu.hidePostAction","Hide Post")})]})]})}),document.body),rM&&"undefined"!=typeof document&&(0,eI.createPortal)((0,r.jsx)("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/50 backdrop-blur-sm p-4 animate-in fade-in",children:(0,r.jsxs)("div",{className:"bg-white dark:bg-[#242526] w-full max-w-sm rounded-xl shadow-2xl p-6 text-center animate-in zoom-in-95 border border-gray-100 dark:border-white/10",children:[(0,r.jsx)("div",{className:"w-16 h-16 bg-red-100 dark:bg-red-900/30 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,r.jsx)(en.A,{className:"w-8 h-8 text-red-600 dark:text-red-400"})}),(0,r.jsx)("h3",{className:"text-xl font-bold text-gray-900 dark:text-white mb-2",children:al("post.menu.deletePostQ","Delete Post?")}),(0,r.jsx)("p",{className:"text-gray-500 dark:text-gray-400 mb-6 text-sm",children:al("post.menu.deletePostConfirmDesc","Are you sure you want to delete this post? This action cannot be undone.")}),(0,r.jsxs)("div",{className:"flex gap-3",children:[(0,r.jsx)("button",{onClick:()=>r_(!1),className:"flex-1 py-2.5 bg-gray-100 dark:bg-white/10 rounded-lg font-semibold text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-white/20 transition-colors",children:al("
1common.cancel")}),(0,r.jsx)("button",{onClick:lh,className:"flex-1 py-2.5 bg-red-500 text-white rounded-lg font-semibold hover:bg-red-600 transition-colors",children:al("post.menu.deletePost","Delete Post")})]})]})}),document.body),rE&&"undefined"!=typeof document&&(()=>{let e=window.location.origin,t="".concat(e,"/embed/post/").concat(t7.id),a='<iframe src="'.concat(t,'" width="500" height="600" frameborder="0" scrolling="no" allowtransparency="true" style="border:none;overflow:hidden"></iframe>');return(0,eI.createPortal)((0,r.jsx)("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center bg-black/60 backdrop-blur-sm p-4",role:"dialog","aria-modal":"true",onClick:()=>rT(!1),children:(0,r.jsxs)("div",{className:"bg-white dark:bg-[#242526] rounded-2xl shadow-2xl w-full max-w-md",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-5 py-4 border-b border-gray-100 dark:border-white/10",children:[(0,r.jsx)("h2",{className:"text-lg font-bold text-gray-900 dark:text-white",children:al("post.embed.title","Embed this post")}),(0,r.jsx)("button",{type:"button",onClick:()=>rT(!1),"aria-label":al("common.close"),className:"p-1.5 rounded-full hover:bg-gray-100 dark:hover:bg-white/10 text-gray-500",children:(0,r.jsx)(en.A,{className:"w-5 h-5"})})]}),(0,r.jsxs)("div",{className:"px-5 py-4 space-y-3",children:[(0,r.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:al("post.embed.copyInstructions","Copy the snippet below and paste it into any HTML page or blog post.")}),(0,r.jsx)("textarea",{readOnly:!0,rows:4,value:a,onFocus:e=>e.currentTarget.select(),className:"w-full font-mono text-xs p-2 rounded-md border border-gray-200 dark:border-white/10 bg-gray-50 dark:bg-[#3A3B3C] text-gray-900 dark:text-white outline-none focus:ring-2 focus:ring-primary/30 resize-none"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("button",{type:"button",onClick:async()=>{try{var e;"undefined"!=typeof navigator&&(null==(e=navigator.clipboard)?void 0:e.writeText)&&(await navigator.clipboard.writeText(a),e$.default.success(al("toasts.embedCopied","Embed code copied")))}catch(e){e$.default.error(al("toasts.copyFailed","Copy failed â select and copy manually"))}},className:"flex-1 py-2 bg-primary hover:bg-primary text-white font-semibold rounded-md",children:al("post.embed.copyCode","Copy code")}),(0,r.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"flex-1 py-2 text-center bg-gray-100 dark:bg-white/10 hover:bg-gray-200 dark:hover:bg-white/20 text-gray-700 dark:text-gray-300 font-semibold rounded-md",children:al("post.embed.preview","Preview")})]})]})]})}),document.body)})(),(0,r.jsx)(ts,{isOpen:a4,onClose:()=>a3(!1),post:t7,onShareComplete:()=>{aw((0,eR.incrementPostShares)(t7.id)),a9(e=>e+1)}}),r1&&(0,r.jsxs)("div",{className:"flex items-center gap-1 text-[11px] text-gray-500 dark:text-gray-400 mb-2",children:[(0,r.jsx)(em.A,{className:"w-3 h-3"})," ",al("post.pinnedPost","Pinned post")]}),(0,r.jsxs)("div",{className:"flex items-center justify-between -mt-1 -mx-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(null==t7?void 0:t7.page)&&!(null==t7?void 0:t7.group)?(0,r.jsx)(eD.N_,{href:(0,te.fi)(t7.page),className:"flex-shrink-0",children:(0,r.jsx)(i.A,{src:t7.page.profileImageUrl||t7.page.profileImage||null,alt:t7.page.name,name:t7.page.name,useImg:!0,variant:"avatar",width:40,height:40,className:"w-10 h-10 rounded-full object-cover border-2 border-gray-200 dark:border-white/10 cursor-pointer hover:opacity-90 transition-opacity"})}):ag?(0,r.jsx)(eD.N_,{href:"/profile/".concat(ag),className:"flex-shrink-0",children:(0,r.jsx)(o.A,{userId:ag,size:40,children:(0,r.jsx)(i.A,{src:(0,eQ.M$)((null==t7?void 0:t7.user)||(null==t7?void 0:t7.author)||{},150),alt:(null==t7||null==(T=t7.user)?void 0:T.name)||(null==t7||null==(I=t7.author)?void 0:I.name),name:(null==t7||null==(F=t7.user)?void 0:F.name)||(null==t7||null==(M=t7.author)?void 0:M.name)||[null==t7||null==(_=t7.author)?void 0:_.firstName,null==t7||null==(D=t7.author)?void 0:D.lastName].filter(
1Boolean).join(" ")||(null==t7||null==(L=t7.user)?void 0:L.username)||(null==t7||null==(R=t7.author)?void 0:R.username),useImg:!0,variant:"avatar",width:40,height:40,className:"w-10 h-10 rounded-full object-cover border border-gray-200 dark:border-white/10 cursor-pointer hover:opacity-90 transition-opacity"})})}):(0,r.jsx)(i.A,{src:(0,eQ.M$)((null==t7?void 0:t7.user)||(null==t7?void 0:t7.author)||{},150),alt:(null==t7||null==(z=t7.user)?void 0:z.name)||(null==t7||null==(U=t7.author)?void 0:U.name),name:(null==t7||null==(B=t7.user)?void 0:B.name)||(null==t7||null==(O=t7.author)?void 0:O.name)||[null==t7||null==(H=t7.author)?void 0:H.firstName,null==t7||null==(W=t7.author)?void 0:W.lastName].filter(Boolean).join(" ")||(null==t7||null==(et=t7.user)?void 0:et.username)||(null==t7||null==(er=t7.author)?void 0:er.username),useImg:!0,variant:"avatar",width:40,height:40,className:"w-10 h-10 rounded-full object-cover border border-gray-200 dark:border-white/10"}),(0,r.jsxs)("div",{children:[(null==t7?void 0:t7.page)&&!(null==t7?void 0:t7.group)?(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)(eD.N_,{href:(0,te.fi)(t7.page),className:"inline-flex items-center gap-1",children:[(0,r.jsx)("span",{className:"font-semibold text-[15px] text-[#050505] dark:text-[#E4E6EB] hover:underline cursor-pointer leading-tight",children:t7.page.name}),t7.page.isVerified&&(0,r.jsx)(c.A,{size:"sm"})]}),!aP&&"page"!==aa&&(0,r.jsx)("button",{onClick:aE,disabled:aS,className:"inline-flex items-center gap-0.5 px-2 py-0.5 rounded-full text-[11px] font-semibold transition-all ".concat(aN?"bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600":"bg-primary text-white hover:bg-primary"," ").concat(aS?"opacity-50 cursor-wait":"cursor-pointer"),children:aS?"...":aN?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(es.A,{className:"w-3 h-3"})," Following"]}):"+ Follow"})]}):ag?(0,r.jsx)(u.A,{userId:ag,children:(0,r.jsxs)(eD.N_,{href:"/profile/".concat(ag),className:"inline-flex items-center gap-1",children:[(0,r.jsx)("span",{className:"font-semibold text-[15px] text-[#050505] dark:text-[#E4E6EB] hover:underline cursor-pointer leading-tight",children:(null==t7||null==(eB=t7.user)?void 0:eB.name)||(null==t7||null==(eO=t7.author)?void 0:eO.name)||[null==t7||null==(eH=t7.author)?void 0:eH.firstName,null==t7||null==(eW=t7.author)?void 0:eW.lastName].filter(Boolean).join(" ")||(null==t7||null==(eK=t7.user)?void 0:eK.username)||(null==t7||null==(ta=t7.author)?void 0:ta.username)||"User"}),((null==t7||null==(tp=t7.user)?void 0:tp.isVerified)||(null==t7||null==(th=t7.author)?void 0:th.isVerified))&&(0,r.jsx)(c.A,{size:"sm"})]})}):(0,r.jsxs)("span",{className:"font-semibold text-[15px] text-[#050505] dark:text-[#E4E6EB] leading-tight inline-flex items-center gap-1",children:[(null==t7||null==(tg=t7.user)?void 0:tg.name)||(null==t7||null==(tf=t7.author)?void 0:tf.name)||[null==t7||null==(tb=t7.author)?void 0:tb.firstName,null==t7||null==(ty=t7.author)?void 0:ty.lastName].filter(Boolean).join(" ")||(null==t7||null==(tv=t7.user)?void 0:tv.username)||(null==t7||null==(tw=t7.author)?void 0:tw.username)||"User",((null==t7||null==(tk=t7.user)?void 0:tk.isVerified)||(null==t7||null==(tj=t7.author)?void 0:tj.isVerified))&&(0,r.jsx)(c.A,{size:"sm"})]}),((null==(tN=t7.meta)?void 0:tN.kind)==="cover_update"||(null==(tC=t7.meta)?void 0:tC.kind)==="avatar_update")&&(0,r.jsxs)("span",{className:"text-[15px] text-[#050505] dark:text-[#E4E6EB] font-normal leading-tight",children:[" ","cover_update"===t7.meta.kind?"updated their cover photo.":"updated their profile picture."]}),(t7.activity||t7.feeling||t7.location)&&(0,r.jsxs)("span",{className:"text-[14px] text-[#65676B] dark:text-[#B0B3B8] font-normal leading-tight",children:[t7.activity&&(t7.activity.label||t7.activity.emoji)?(0,r.jsxs)(r.Fragment,{children:[" is ",t7.activity.emoji?"".concat(t7.activity.emoji," "):"",(0,r.jsxs)("span",{className:"font-semibold text-[#050505] dark:text-[#E4E6EB]",children:[String(t7.activity.label||"").toLowerCase(),t7.activity.detail?" ".concat(t7.activity.detail):""]})]}):t7.feeling?(0,r.jsxs)(r.Fragment,{children:[" is feeling ",(0,r.jsx)("span",{className:"font-semibold text-[#050505] dark:text-[#E4E6EB]",children:t7.feeling})," ",t7.feelingEmoji||""]}):null,t7.location&&(0,r.jsxs)(r.Fragment,{children:[" ",t7.feeling||t7.activity?"at":"is at"," "," ",(null==(tS=t7.locationCoords)?void 0:tS.lat)!=null&&(null==(tA=t7.locationCoords)?void 0:tA.lng)!=null?(0,r.jsxs)("a",{href:"https://www.google.com/maps?q=".concat(t7.locationCoords.lat,",").concat(t7.locationCoords.lng),target:"_blank",rel:"noopener noreferrer",className:"font-semibold text-[#050505] dark:text-[#E4E6EB] hover:text-primary dark:hover:text-primary-light hover:underline inline-flex items-center gap-0.5",onClick:e=>e.stopPropagation(),title:"Open in Google Maps",children:[(0,r.jsx)(ea.A,{className:"w-3 h-3"}),t7.location]}):(0,r.jsx)("span",{className:"font-semibold text-[#050505] dark:text-[#E4E6EB]",children:t7.location})]})]}),Array.isArray(t7.taggedUsers)&&t7.taggedUsers.length>0&&(()=>
1{let e=t7.taggedUsers.filter(Boolean),t=e.slice(0,2),a=e.length-t.length;return(0,r.jsxs)("span",{className:"text-[14px] text-[#65676B] dark:text-[#B0B3B8] font-normal leading-tight",children:[" â with ",t.map((e,n)=>(0,r.jsxs)(l.Fragment,{children:[(0,r.jsx)(eD.N_,{href:e.id?(0,te.DW)(e):"#",className:"font-semibold text-[#050505] dark:text-[#E4E6EB] hover:underline",onClick:e=>e.stopPropagation(),children:e.name||e.username||"User"}),n<t.length-1&&(n===t.length-2&&0===a?" and ":", ")]},e.id||n)),a>0&&(0,r.jsxs)(r.Fragment,{children:[" and ",(0,r.jsxs)("span",{className:"font-semibold text-[#050505] dark:text-[#E4E6EB]",title:e.slice(t.length).map(e=>e.name||e.username).join(", "),children:[a," other",1===a?"":"s"]})]})]})})(),ls&&(0,r.jsx)("button",{type:"button",onClick:li,disabled:lr,className:"ml-1.5 text-[14px] font-semibold text-[#0866FF] hover:underline disabled:opacity-60 align-baseline",children:lr?"â¦":al("common.follow","Follow")}),(null==t7?void 0:t7.group)&&(0,r.jsxs)("div",{className:"flex items-center gap-1 text-[12px] text-primary dark:text-primary-light font-medium leading-tight mb-0.5",children:[(0,r.jsx)(ex.A,{className:"w-3 h-3 flex-shrink-0"}),(0,r.jsxs)("span",{children:["post by ",(null==t7||null==(tP=t7.user)?void 0:tP.name)||(null==t7||null==(tE=t7.author)?void 0:tE.name)," in"]}),(0,r.jsx)(eD.N_,{href:(0,te.Lp)(t7.group),className:"font-semibold hover:underline truncate max-w-[160px]",children:t7.group.name})]}),(null==t7?void 0:t7.page)&&!(null==t7?void 0:t7.group)&&(0,r.jsxs)("div",{className:"flex items-center gap-1 text-[12px] text-purple-600 dark:text-purple-400 font-medium leading-tight mb-0.5",children:[(0,r.jsx)(ep.A,{className:"w-3 h-3 flex-shrink-0"}),(0,r.jsx)(eD.N_,{href:(0,te.fi)(t7.page),className:"font-semibold hover:underline truncate max-w-[200px]",children:t7.page.name})]}),(null==t7?void 0:t7.wallOwner)&&(0,r.jsxs)("div",{className:"flex items-center gap-1 text-[12px] text-gray-500 dark:text-gray-400 font-medium leading-tight mb-0.5",children:[(0,r.jsx)("span",{children:"â¸"}),(0,r.jsx)(eD.N_,{href:(0,te.DW)(t7.wallOwner),className:"font-semibold hover:underline text-gray-700 dark:text-gray-300",children:t7.wallOwner.name})]}),(0,r.jsxs)("div",{className:"flex items-center text-gray-500 dark:text-[#B0B3B8] text-[13px] leading-tight",children:[(0,r.jsx)(eD.N_,{href:(0,te.KI)(t7),className:"hover:underline",onClick:e=>e.stopPropagation(),suppressHydrationWarning:!0,children:an}),(0,r.jsx)("span",{className:"mx-1",children:"\xb7"}),(0,r.jsx)(d.Ay,{value:t7.type,className:"w-3 h-3"})]})]})]}),(0,r.jsx)("button",{type:"button",onClick:lo,"aria-label":al("post.hidePost","Hide post"),title:al("post.hidePost","Hide post"),className:"ml-auto p-2 hover:bg-black/5 dark:hover:bg-white/10 rounded-full transition-colors",children:(0,r.jsx)(en.A,{className:"w-5 h-5 text-gray-500"})}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("button",{ref:aF,onClick:a5,"aria-label":"Post options",className:"p-2 hover:bg-black/5 dark:hover:bg-white/10 rounded-full transition-colors",children:(0,r.jsx)(eh.A,{className:"w-5 h-5 text-gray-500"})}),aT&&aD&&"undefined"!=typeof document&&(0,eI.createPortal)((0,r.jsxs)("div",{ref:aM,className:"fixed w-64 overflow-y-auto custom-scrollbar bg-white dark:bg-gray-800 rounded-lg shadow-xl border border-gray-100 dark:border-gray-700 p-1 animate-in fade-in zoom-in-95",style:{to
1p:aD.top,left:aD.left,maxHeight:aD.maxHeight,zIndex:9999},role:"menu","data-placement":aD.placement,children:[(null==t7?void 0:t7.groupId)&&!la&&(0,r.jsxs)("button",{onClick:lb,className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-red-600 dark:text-red-400",children:[(0,r.jsx)(ed.A,{className:"w-4 h-4"}),(0,r.jsx)("span",{children:al("post.menu.reportToGroupAdmins","Report post to group admins")})]}),!la&&(0,r.jsxs)("button",{onClick:lx,className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-gray-700 dark:text-gray-200",children:[(0,r.jsx)(el.A,{className:"w-4 h-4"}),(0,r.jsxs)("div",{className:"text-left",children:[(0,r.jsx)("span",{className:"block",children:al("post.menu.hidePost","Hide post")}),(0,r.jsx)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:al("post.menu.hidePostDesc","See fewer posts like this.")})]})]}),(null==t7?void 0:t7.page)&&!la&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("button",{onClick:e=>{e.stopPropagation(),rP("page"===rA?null:"page")},className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-gray-700 dark:text-gray-200","aria-expanded":"page"===rA,children:[(0,r.jsx)(eu.A,{className:"w-4 h-4"}),(0,r.jsxs)("div",{className:"text-left",children:[(0,r.jsx)("span",{className:"block",children:al("post.menu.snoozeName","Snooze {{name}}",{name:t7.page.name})}),(0,r.jsx)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:al("post.menu.snoozeDesc","Temporarily stop seeing posts.")})]})]}),"page"===rA&&(0,r.jsx)("div",{className:"pl-7 pb-1 flex flex-col gap-0.5",children:[1,7,30].map(e=>(0,r.jsx)("button",{onClick:()=>lj("page",t7.page.id,t7.page.name,e),className:"px-3 py-1.5 text-sm text-left rounded-md hover:bg-gray-100 dark:hover:bg-gray-700/60 text-gray-700 dark:text-gray-200",children:1===e?al("post.menu.forOneDay","For 1 day"):al("post.menu.forNDays","For {{count}} days",{count:e})},e))}),(0,r.jsxs)("button",{onClick:lC,className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-gray-700 dark:text-gray-200",children:[(0,r.jsx)(el.A,{className:"w-4 h-4"}),(0,r.jsxs)("div",{className:"text-left",children:[(0,r.jsx)("span",{className:"block",children:al("post.menu.hideAllFromName","Hide all from {{name}}",{name:t7.page.name})}),(0,r.jsx)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:al("post.menu.hideAllFromPageDesc","Stop seeing posts from this Page.")})]})]})]}),(null==t7?void 0:t7.user)&&!la&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("button",{onClick:e=>{e.stopPropagation(),rP("user"===rA?null:"user")},className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-gray-700 dark:text-gray-200","aria-expanded":"user"===rA,children:[(0,r.jsx)(eu.A,{className:"w-4 h-4"}),(0,r.jsxs)("div",{className:"text-left",children:[(0,r.jsx)("span",{className:"block",children:al("post.menu.snoozeName","Snooze {{name}}",{name:t7.user.name})}),(0,r.jsx)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:al("post.menu.snoozeDesc","Temporarily stop seeing posts.")})]})]}),"user"===rA&&(0,r.jsx)("div",{className:"pl-7 pb-1 flex flex-col gap-0.5",children:[1,7,30].map(e=>(0,r.jsx)("button",{onClick:()=>lj("user",t7.user.id,t7.user.name,e),className:"px-3 py-1.5 text-sm text-left rounded-md hover:bg-gray-100 dark:hover:bg-gray-700/60 text-gray-700 dark:text-gray-200",children:1===e?al("post.menu.forOneDay","For 1 day"):al("post.menu.forNDays","For {{count}} days",{count:e})},e))}),(0,r.jsxs)("button",{onClick:lN,className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-gray-700 dark:text-gray-200",children:[(0,r.jsx)(el.A,{className:"w-4 h-4"}),(0,r.jsxs)("div",{className:"text-left",children:[(0,r.jsx)("span",{className:"block",children:al("post.menu.hideAllFromName","Hide all from {{name}}
1",{name:t7.user.name})}),(0,r.jsx)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:al("post.menu.hideAllFromUserDesc","Stop seeing posts from this person.")})]})]})]}),(null==t7?void 0:t7.group)&&!la&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("button",{onClick:e=>{e.stopPropagation(),rP("group"===rA?null:"group")},className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-gray-700 dark:text-gray-200","aria-expanded":"group"===rA,children:[(0,r.jsx)(eu.A,{className:"w-4 h-4"}),(0,r.jsxs)("div",{className:"text-left",children:[(0,r.jsx)("span",{className:"block",children:al("post.menu.snoozeName","Snooze {{name}}",{name:t7.group.name})}),(0,r.jsx)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:al("post.menu.snoozeDesc","Temporarily stop seeing posts.")})]})]}),"group"===rA&&(0,r.jsx)("div",{className:"pl-7 pb-1 flex flex-col gap-0.5",children:[1,7,30].map(e=>(0,r.jsx)("button",{onClick:()=>lj("group",t7.group.id,t7.group.name,e),className:"px-3 py-1.5 text-sm text-left rounded-md hover:bg-gray-100 dark:hover:bg-gray-700/60 text-gray-700 dark:text-gray-200",children:1===e?al("post.menu.forOneDay","For 1 day"):al("post.menu.forNDays","For {{count}} days",{count:e})},e))}),(0,r.jsxs)("button",{onClick:lS,className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-gray-700 dark:text-gray-200",children:[(0,r.jsx)(el.A,{className:"w-4 h-4"}),(0,r.jsxs)("div",{className:"text-left",children:[(0,r.jsx)("span",{className:"block",children:al("post.menu.unfollowName","Unfollow {{name}}",{name:t7.group.name})}),(0,r.jsx)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:al("post.menu.unfollowGroupDesc","Stop seeing posts but stay in group.")})]})]})]}),(0,r.jsx)("div",{className:"h-px bg-gray-100 dark:bg-gray-700 my-1"}),(0,r.jsxs)("button",{onClick:lm,className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-gray-700 dark:text-gray-200",children:[(0,r.jsx)(eg.A,{className:"w-4 h-4 ".concat(t7.isFavorite?"fill-red-500 text-red-500":"")}),(0,r.jsx)("span",{children:t7.isFavorite?"Remove from Favourites":"Add to Favourites"})]}),(0,r.jsxs)("button",{onClick:lf,className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-gray-700 dark:text-gray-200",children:[(0,r.jsx)(ef.A,{className:"w-4 h-4 ".concat(t7.isSaved?"fill-primary text-primary":"")}),(0,r.jsx)("span",{children:t7.isSaved?al("post.menu.unsavePost","Unsave Post"):al("post.menu.savePost","Save Post")})]}),!la&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("button",{onClick:()=>
1{(0,p.submitFeedback)(t7.id,"interested").catch(()=>{}),(0,e7.Sq)("post",t7.id,"see_more").catch(()=>{}),"foryou"===aa&&aw((0,e8.K6)({postId:t7.id,action:"show_more_like_this"})),a2()},className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-gray-700 dark:text-gray-200",children:[(0,r.jsx)(eb.A,{className:"w-4 h-4"}),(0,r.jsx)("span",{children:al("post.menu.showMoreLikeThis","Show more like this")})]}),"foryou"===aa&&(0,r.jsxs)("button",{onClick:()=>{aw((0,e8.K6)({postId:t7.id,action:"show_less_like_this"})),a2(),(0,e$.default)("We'll show you fewer posts like this",{duration:2500})},className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-gray-700 dark:text-gray-200",children:[(0,r.jsx)(el.A,{className:"w-4 h-4"}),(0,r.jsx)("span",{children:al("post.menu.showLessLikeThis","Show less like this")})]}),(0,r.jsxs)("button",{onClick:()=>{a2(),lv()},className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-gray-700 dark:text-gray-200",children:[(0,r.jsx)(el.A,{className:"w-4 h-4"}),(0,r.jsx)("span",{children:al("post.menu.notInterested","Not interested")})]})]}),(0,r.jsx)("div",{className:"h-px bg-gray-100 dark:bg-gray-700 my-1"}),(0,r.jsxs)("button",{onClick:lF,className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-gray-700 dark:text-gray-200",children:[(0,r.jsx)(ey.A,{className:"w-4 h-4"}),(0,r.jsx)("span",{children:al("post.menu.copyLink","Copy link")})]}),(0,r.jsxs)("button",{onClick:()=>{a2();let e=t7.slug&&t7.authorUsername?"/p/".concat(t7.authorUsername,"/").concat(t7.slug):"/post/".concat(t7.id);window.open(e,"_blank","noopener,noreferrer")},className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-gray-700 dark:text-gray-200",children:[(0,r.jsx)(ev.A,{className:"w-4 h-4"}),(0,r.jsx)("span",{children:al("post.menu.openInNewTab","Open in new tab")})]}),(0,r.jsxs)("button",{onClick:()=>{a2(),rT(!0)},className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-gray-700 dark:text-gray-200",children:[(0,r.jsx)(ey.A,{className:"w-4 h-4"}),(0,r.jsx)("span",{children:al("post.menu.getEmbedCode","Get embed code")})]}),(0,r.jsxs)("button",{onClick:lR,disabled:lD,className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-gray-700 dark:text-gray-200 disabled:opacity-60",children:[lM?(0,r.jsx)(ew.A,{className:"w-4 h-4"}):(0,r.jsx)(ek.A,{className:"w-4 h-4"}),(0,r.jsx)("span",{children:lM?al("post.menu.turnOffNotifications","Turn off notifications"):al("post.menu.turnOnNotifications","Turn on notifications")})]}),!la&&(0,r.jsxs)("button",{onClick:()=>{var e,t,a,r,l,n;a2();let s=[];if(t7.isCurated){let a=(null==(e=t7.user)?void 0:e.name)||(null==(t=t7.author)?void 0:t.name);s.push(a?"it's a suggested video from ".concat(a):"it's suggested content")}else t7.rankerReason?s.push(t7.rankerReason):((!0===aY||(null==t7||null==(a=t7.user)?void 0:a.isFollowing)===!0)&&(null==(r=t7.user)?void 0:r.name)&&s.push("you follow ".concat(t7.user.name)),(null==(l=t7.group)?void 0:l.name)&&s.push("you're a member of ".concat(t7.group.name)),(null==(n=t7.page)?void 0:n.name)&&s.push("you follow the page ".concat(t7.page.name)),t7.mutualCount&&s.push("".concat(t7.mutualCount," mutual friends")));let i=s.length?"You're seeing this because: ".concat(s.join(" \xb7 ")):"You're seeing this because it's relevant to your interests and recent activity.";(0,e$.default)(i,{duration:6e3,icon:"â¹ï¸"})},className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-gray-700 dark:text-gray-200",children:[(0,r.jsx)(ej.A,{className:"w-4 h-4"}),(0,r.jsx)("span",{children:al("post.menu.whyAmISeeingThis","Why am I seeing this?")})]}),la&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"h-px bg-gray-100 dark:bg-gray-700 my-1"}),(0,r.jsxs)("button",{onClick:()=>{a2(),ru(!0),rx(t7.content||""),rh(["public","friends","only_me"].includes(t7.type)?t7.type:"public"),rf(!!t7.commentsMuted)},className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-gray-700 dark:text-gray-200",children:[(0,r.jsx)(eN.A,{className:"w-4 h-4"}),(0,r.jsx)("span",{children:al("post.menu.editPost","Edit Post")})]}),(0,r.jsxs)("button",{onClick:lP,className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-gray-700 dark:text-gray-200",children:[(0,r.jsx)(em.A,{className:"w-4 h-4 ".concat(r1?"text-primary fill-primary":"")}),(0,r.jsx)("span",{children:r1?al("post.menu.unpinPost","Unpin Post"):al("post.menu.pinPost","Pin Post")})]}),(0,r.jsxs)("button",{onClick:lE,className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-gray-700 dark:text-gray-200",children:[(0,r.jsx)(eC.A,{className:"w-4 h-4"}),(0,r.jsx)("span",{children:r2?al("post.menu.turnOnComments","Turn on comments"):al("post.menu.turnOffComments","Turn off comments")})]}),(0,r.jsxs)("button",{onClick:()=>{a2(),lI(!0)},className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-gray-700 dark:text-gray-200",children:[(0,r.jsx)(eS.A,{className:"w-4 h-4"}),(0,r.jsx)("span",{children:al("post.menu.viewInsights","View insights")})]}),(0,r.jsxs)("button",{onClick:lz,className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-gray-700 dark:text-gray-200",children:[(0,r.jsx)(eA.A,{className:"w-4 h-4"}),(0,r.jsxs)("div",{className:"text-left",children:[(0,r.jsx)("span",{className:"block",children:al("post.menu.hideFromTimeline","Hide from your timeline")}),(0,r.jsx)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:al("post.menu.hideFromTimelineDesc","Removes from feed without deleting.")})]})]})]}),lc&&(0,r.jsxs)(r.Fragment,{children:[!la&&(0,r.jsx)("div",{className:"h-px bg-gray-100 dark:bg-gray-700 my-1"}),(0,r.jsxs)("button",{onClick:()=>{a2(),r_(!0)},className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-red-600 dark:text-red-400",children:[(0,r.jsx)(en.A,{className:"w-4 h-4"}),(0,r.jsx)("span",{children:al("post.menu.deletePost","Delete Post")})]})]}),!la&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"h-px bg-gray-100 dark:bg-gray-700 my-1"}),!(null==t7?void 0:t7.groupId)&&(0,r.jsxs)("button",{onClick:lb,className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-red-600 dark:text-red-400",children:[(0,r.jsx)(ed.A,{className:"w-4 h-4"}),(0,r.jsxs)("div",{className:"text-left",children:[(0,r.jsx)("span",{className:"block",children:al("post.menu.reportPost","Report post")}),(0,r.jsx)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:al("post.menu.reportPostDesc","We won't let them know who reported this.")})]})]}),(null==t7?void 0:t7.user)&&(0,r.jsxs)("button",{onClick:()=>{var e;a2(),(null==t7||null==(e=t7.user)?void 0:e.id)&&az(!0)},className:"flex items-center gap-3 w-full px-4 py-2.5 text-sm text-left hover:bg-gray-50 dark:hover:bg-gray-700/50 rounded-md transition-colors text-red-600 dark:text-red-400",children:[(0,r.jsx)(eP.A,{className:"w-4 h-4"}),(0,r.jsxs)("div",{className:"text-left",children:[(0,r.jsx)("span",{className:"block",children:al("post.menu.blockProfileName","Block {{name}}
1's profile",{name:t7.user.name})}),(0,r.jsx)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:al("post.menu.blockProfileDesc","You won't be able to see or contact each other.")})]})]})]})]}),document.body)]})]}),t7.isSponsored&&(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,r.jsx)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:al("feed.sponsored")}),(0,r.jsx)("button",{className:"text-xs text-gray-500 hover:underline",children:al("widgets.ads.hideAd")})]}),t7.isCurated&&(0,r.jsx)("div",{className:"flex items-center mb-2",children:(0,r.jsx)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:al("feed.suggestedForYou")})}),t7.lifeEventBadge&&(t7.lifeEventBadge.label||t7.lifeEventBadge.emoji)&&(0,r.jsx)("div",{className:"mb-2 flex",children:(0,r.jsxs)("span",{className:"inline-flex items-center gap-2 max-w-full px-3 py-1.5 rounded-full bg-gradient-to-r from-pink-500/10 to-violet-500/10 dark:from-pink-500/25 dark:to-violet-500/25 border border-pink-300/50 dark:border-pink-400/30",children:[t7.lifeEventBadge.emoji&&(0,r.jsx)("span",{className:"text-base leading-none","aria-hidden":"true",children:t7.lifeEventBadge.emoji}),(0,r.jsx)("span",{className:"text-[13px] font-semibold text-pink-700 dark:text-pink-300 truncate",children:t7.lifeEventBadge.label||"Life update"})]})}),(t7.lifeEvent||"life_event"===t7.type)&&(()=>{var e;let t=t7.lifeEvent||{},a={"new-job":{from:"#3b82f6",to:"#8b5cf6",icon:"\uD83D\uDCBC",label:"New job"},relationship:{from:"#ec4899",to:"#f43f5e",icon:"â¤ï¸",label:"Relationship"},moved:{from:"#10b981",to:"#14b8a6",icon:"\uD83C\uDFE0",label:"Moved"},education:{from:"#8b5cf6",to:"#6366f1",icon:"\uD83C\uDF93",label:"Education"},achievement:{from:"#f59e0b",to:"#ef4444",icon:"\uD83C\uDFC6",label:"Achievement"}}[t.type]||{from:"#6366f1",to:"#8b5cf6",icon:t.icon||"\uD83C\uDF89",label:"Life event"},l=t.icon||a.icon,n=t.eventDate||t.date,s=n?new Date(n).toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"}):null;return(0,r.jsxs)("div",{className:"mb-3 rounded-2xl overflow-hidden relative shadow-[0_4px_14px_-4px_rgba(99,102,241,0.35)] dark:shadow-[0_4px_14px_-4px_rgba(99,102,241,0.55)]",style:{background:"linear-gradient(135deg, ".concat(a.from,", ").concat(a.to,")")},children:[(0,r.jsx)("div",{className:"absolute inset-x-0 top-0 h-1/2 bg-gradient-to-b from-white/20 to-transparent pointer-events-none"}),(0,r.jsx)("div",{"aria-hidden":"true",className:"absolute -right-6 -top-8 w-32 h-32 rounded-full bg-white/15 blur-2xl pointer-events-none"}),(0,r.jsxs)("div",{className:"relative flex items-center gap-2 px-4 pt-3 pb-1",children:[(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-black/25 backdrop-blur-sm text-white text-[10px] font-bold uppercase tracking-[0.1em] shadow-sm",children:[(0,r.jsx)("span",{children:"â¨"}),"Life Event"]}),(0,r.jsx)("span",{className:"text-[11px] text-white/85 font-medium",children:a.label})]}),(0,r.jsxs)("div",{className:"relative flex items-start gap-4 px-4 pb-4 pt-2",children:[(0,r.jsx)("div",{className:"flex-shrink-0 w-16 h-16 rounded-2xl bg-white/95 shadow-[inset_0_1px_0_rgba(255,255,255,0.9),0_4px_10px_-2px_rgba(0,0,0,0.25)] flex items-center justify-center text-[34px] leading-none",children:l}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("h3",{className:"text-white text-[19px] font-extrabold leading-tight drop-shadow-sm break-words",children:t.title||(null==(e=t7.content)?void 0:e.split("\n")[0])||"Life update"}),t.description&&t.description!==t.title&&(0,r.jsx)("p",{className:"text-white/90 text-[13px] leading-snug mt-1 break-words line-clamp-3",children:t.description}),(s||t.location)&&(0,r.jsxs)("p",{className:"text-white/80 text-[12px] mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-0.5",children:[s&&(0,r.jsxs)("span",{children:["\uD83D\uDCC5 ",s]}),t.location&&(0,r.jsxs)("span",{children:["\uD83D\uDCCD ",t.location]})]})]})]})]})})(),t7.event&&(()=>{let e=t7.event,t=e.eventDate?new Date(e.eventDate).toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"}):null,a=e.eventDate?new Date(e.eventDate).toLocaleDateString(void 0,{month:"short"}).toUpperCase():null,l=e.eventDate?new Date(e.eventDate).getDate():null,n=e.imageUrl||t7.image||null;return(0,r.jsxs)("div",{onClick:t=>{t.stopPropagation(),av("/events/".concat(e.id))},role:"button",tabIndex:0,onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),av("/events/".concat(e.id)))},className:"mb-3 rounded-2xl overflow-hidden border border-gray-200 dark:border-white/10 bg-white dark:bg-gray-900 cursor-pointer hover:shadow-lg transition-shadow",children:[n&&(0,r.jsxs)("div",{className:"relative w-full bg-gray-100 dark:bg-gray-800",style:{aspectRatio:"16 / 9"},children:[(0,r.jsx)(s.A,{src:n,alt:e.title||"Event",fill:!0,sizes:"(max-width: 768px) 100vw, 600px",className:"object-cover",loading:"lazy"}),l&&a&&(0,r.jsxs)("div",{className:"absolute top-3 left-3 bg-white dark:bg-gray-900 rounded-lg shadow-md overflow-hidden text-center w-12",children:[(0,r.jsx)("div",{className:"bg-rose-500 text-white text-[10px] font-bold py-0.5 uppercase tracking-wide",children:a}),(0,r.jsx)("div",{className:"text-gray-900 dark:text-white text-lg font-bold py-0.5 leading-tight",children:l})]}),(0,r.jsx)("span",{className:"absolute top-3 right-3 inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-black/60 backdrop-blur-sm text-white text-[10px] font-semibold uppercase tracking-wider",children:"\uD83D\uDCC5 Event"})]}),(0,r.jsxs)("div",{className:"px-4 py-3",children:[(0,r.jsx)("h3",{className:"text-gray-900 dark:text-white text-[16px] font-bold leading-snug line-clamp-2",children:e.title||"Event"}),(0,r.jsxs)("div",{className:"mt-1 text-[12px] text-gray-500 dark:text-gray-400 flex flex-wrap items-center gap-x-2 gap-y-0.5",children:[t&&(0,r.jsxs)("span",{children:[t,e.eventTime?" \xb7 ".concat(e.eventTime):""]}),e.location&&(0,r.jsxs)("span",{className:"truncate max-w-[180px]",children:["\uD83D\uDCCD ",e.location]})]}),("number"==typeof e.goingCount||"number"==typeof e.interestedCount)&&(0,r.jsxs)("div",{className:"mt-1.5 text-[11px] text-gray-500 dark:text-gray-400",children:[e.goingCount?"".concat(e.goingCount," going"):"",e.goingCount&&e.interestedCount?" \xb7 ":"",e.interestedCount?"".concat(e.interestedCount," interested"):""]}),(0,r.jsx)("div",{className:"mt-2 inline-flex items-center gap-1 px-2.5 py-1 rounded-md bg-primary/10 text-primary text-[11px] font-semibold",children:"View event â"})]})]})})(),rc&&"undefined"!=typeof document&&(0,eI.createPortal)((0,r.jsx)("div",{className:"fixed inset-0 z-[10000] flex items-end sm:items-center justify-center bg-black/50 backdrop-blur-sm sm:p-4 animate-in fade-in",role:"dialog","aria-modal":"true","aria-labelledby":"edit-post-title",onClick:()=>{rb||ru(!1)},children:(0,r.jsxs)("div",{className:"relative bg-white dark:bg-dark-paper shadow-2xl w-full sm:max-w-[520px] flex flex-col animate-in zoom-in-95 rounded-t-2xl sm:rounded-2xl max-h-[95dvh] sm:max-h-[90vh]",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex-shrink-0 flex items-center justify-between px-5 py-4 border-b border-gray-100 dark:border-white/10",children:[(0,r.jsx)("h2",{id:"edit-post-title",className:"text-lg font-bold text-gray-900 dark:text-white",children:"Edit post"}),(0,r.jsx)("button",{type:"button",onClick:()=>ru(!1),disabled:rb,"aria-label":"Close",className:"p-1.5 rounded-full hover:bg-gray-100 dark:hover:bg-white/10 text-gray-500 disabled:opacity-60",children:(0,r.jsx)(en.A,{className:"w-5 h-5"})})]}),(0,r.jsxs)("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-4",children:[(0,r.jsx)("textarea",{value:rm,onChange:e=>rx(e.target.value),placeholder:"What's on your mind?",rows:4,disabled:rb,className:"w-full p-3 border border-gray-300 dark:border-gray-600 rounded-lg bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-white resize-y focus:ring-2 focus:ring-primary/30 focus:border-primary outline-none disabled:opacity-60"}),Array.isArray(t7.files)&&t7.files.length>0||rk.length>0?(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("div",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300",children:"Media"}),(0,r.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(t7.files||[]).map(e=>{let t=rv.includes(e.id),a="video"===(e.type||"").toLowerCase()||/\.(mp4|webm|mov)$/i.test(e.url||"");return(0,r.jsxs)("div",{className:"relative rounded-lg overflow-hidden bg-black aspect-square ".concat(t?"opacity-30":""),children:[a?(0,r.jsx)("video",{src:e.url,muted:!0,className:"w-full h-full object-cover"}):(0,r.jsx)(i.A,{src:e.url,alt:"media",fill:!0,sizes:"(max-width:640px) 33vw, 200px",className:"object-cover"}),(0,r.jsx)("button",{type:"button",onClick:()=>rw(a=>t?a.filter(t=>t!==e.id):[...a,e.id]),disabled:rb,className:"absolute top-1 right-1 w-6 h-6 rounded-full bg-black/70 text-white flex items-center justify-center hover:bg-black/90","aria-label":t?"Undo remove":"Remove",title:t?"Undo":"Remove",children:t?(0,r.jsx)(ei.A,{className:"w-3 h-3"}):(0,r.jsx)(en.A,{className:"w-3 h-3"})})]},e.id)}),rk.map((e,t)=>(0,r.jsxs)("div",{className:"relative rounded-lg overflow-hidden bg-black aspect-square ring-2 ring-green-500",children:["video"===e.type?(0,r.jsx)("video",{src:e.url,muted:!0,className:"w-full h-full object-cover"}):(0,r.jsx)(i.A,{src:e.url,alt:"new media",useImg:!0,fill:!0,className:"w-full h-full object-cover"}),(0,r.jsx)("button",{type:"button",onClick:()=>rj(e=>e.filter((e,a)=>a!==t)),disabled:rb,className:"absolute top-1 right-1 w-6 h-6 rounded-full bg-black/70 text-white flex items-center justify-center hover:bg-black/90","aria-label":"Remove",children:(0,r.jsx)(en.A,{className:"w-3 h-3"})})]},"new-".concat(t)))]})]}):null,(0,r.jsxs)("div",{children:[(0,r.jsx)("input",{ref:rS,type:"file",accept:"image/*,video/*",multiple:!0,hidden:!0,onChange:async e=>{var t,r;let l=Array.from((null==(t=e.target)?void 0:t.files)||[]);if(0!==l.length){rC(!0);try{let{uploadPostMedia:e}=await Promise.resolve().then(a.bind(a,39259));try{let t=await e(l.slice(0,10));for(let e of Array.isArray(t)?t:Array.isArray(null==t?void 0:t.files)?t.files:[]){let t=(null==e?void 0:e.url)||(null==e||null==(r=e.data)?void 0:r.url);if(!t)continue;let a=/\.(mp4|webm|mov|m4v)$/i.test(t)?"video":"image";rj(r=>[...r,{url:t,type:e.type||a}])}}catch(e){e$.default.error("Upload failed: "+((null==e?void 0:e.message)||"unknown"))}}finally{rC(!1),rS.current&&(rS.current.value="")}}}}),(0,r.jsx)("button",{type:"button",onClick:()=>{var e;return null==(e=rS.current)?void 0:e.click()},disabled:rb||rN,className:"text-sm font-semibold text-primary hover:underline disabled:opacity-60",children:rN?"Uploadingâ¦":"+ Add photos / videos"})]}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("label",{className:"flex items-center justify-between gap-3",children:[(0,r.jsx)("span",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300",children:"Audience"}),(0,r.jsxs)("select",{value:rp,onChange:e=>rh(e.target.value),disabled:rb,className:"px-3 py-1.5 rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 text-sm text-gray-900 dark:text-white focus:ring-2 focus:ring-primary/30 outline-none disabled:opacity-60",children:[(0,r.jsx)("option",{value:"public",children:"\uD83C\uDF0D Public"}),(0,r.jsx)("option",{value:"friends",children:"\uD83D\uDC65 Friends"}),(0,r.jsx)("option",{value:"only_me",children:"\uD83D\uDD12 Only me"})]})]}),(0,r.jsxs)("label",{className:"flex items-center justify-between gap-3 cursor-pointer",children:[(0,r.jsx)("span",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300",children:"Turn off comments"}),(0,r.jsx)("input",{type:"checkbox",checked:rg,onChange:e=>rf(e.target.checked),disabled:rb,className:"w-5 h-5 rounded border-gray-300 dark:border-gray-600 text-primary focus:ring-primary/30"})]})]})]}),(0,r.jsxs)("div",{className:"flex-shrink-0 flex justify-end gap-2 px-5 py-4 border-t border-gray-100 dark:border-white/10 bg-white dark:bg-dark-paper rounded-b-2xl",children:[(0,r.jsx)("button",{type:"button",onClick:()=>ru(!1),disabled:rb,className:"px-4 py-2 text-sm font-semibold text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-md disabled:opacity-60",children:"Cancel"}),(0,r.jsx)("button",{type:"button",onClick:lg,disabled:rb,className:"px-5 py-2 text-sm font-semibold bg-primary hover:bg-primary text-white rounded-md disabled:opacity-60 disabled:cursor-not-allowed",children:rb?"Savingâ¦":"Save"})]})]})}),document.body),t7.attachedReel?(0,r.jsx)(tc,{content:t7.content,video:t7.attachedReel.videoUrl,image:t7.attachedReel.thumbnailUrl,reelId:t7.attachedReel.id}):(null==(tT=t7.content)?void 0:tT.startsWith("\uD83D\uDEA8 Crisis Alert:"))?(0,r.jsx)(td,{content:t7.content}):(null==(tI=t7.content)?void 0:tI.includes("\uD83C\uDFAC"))&&((null==(tF=t7.content)?void 0:tF.includes("/watch?v="))||(null==(tM=t7.content)?void 0:tM.includes("/minis?v=")))?(0,r.jsx)(tc,{content:t7.content,video:t7.video,image:t7.image}):t7.content&&!t7.lifeEvent&&"life_event"!==t7.type&&!t7.event&&(null==(t_=t7.meta)?void 0:t_.kind)!=="cover_update"&&(null==(tD=t7.meta)?void 0:tD.kind)!=="avatar_update"&&(0,r.jsxs)("div",{className:"pb-2",children:[(()=>{let e=!(t7.image||t7.video||t7.images&&t7.images.length)&&t7.backgroundColor?({sunrise:"bg-gradient-to-br from-orange-400 via-pink-500 to-rose-500",ocean:"bg-gradient-to-br from-sky-500 via-primary to-indigo-700",forest:"bg-gradient-to-br from-emerald-500 via-teal-600 to-emerald-800",twilight:"bg-gradient-to-br from-violet-600 via-fuchsia-600 to-pink-600",midnight:"bg-gradient-to-br from-slate-800 via-slate-900 to-black"})[t7.backgroundColor]:null;return(0,r.jsx)(eG.A,{text:t7.content,originalLanguage:t7.originalLanguage,contextType:"post",contextId:t7.id,variant:"post",render:(t,a)=>e?(0,r.jsx)("div",{className:"mx-[-16px] my-2 px-6 py-12 ".concat(e," text-white text-center"),children:(0,r.jsx)("p",{className:"text-2xl font-semibold whitespace-pre-wrap break-words",...(0,ee.Vo
1)(t),...a,children:(0,r.jsx)(X.A,{text:t})})}):(0,r.jsx)("p",{className:"text-[#050505] dark:text-[#E4E6EB] text-[15px] leading-normal whitespace-pre-wrap ".concat(!a7&&(null==t?void 0:t.length)>150?"line-clamp-3":""),...(0,ee.Vo)(t),...a,children:(0,r.jsx)(X.A,{text:t})})})})(),(null==(tL=t7.content)?void 0:tL.length)>150&&(0,r.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),a8(!a7)},className:"text-[#050505] dark:text-[#E4E6EB] font-semibold hover:underline mt-1 text-[15px]",children:a7?al("common.seeLess"):al("common.seeMore")})]}),t7.linkPreview&&(0,r.jsxs)("a",{href:t7.linkPreview.url,target:"_blank",rel:"noopener noreferrer nofollow",onClick:e=>e.stopPropagation(),className:"mx-3 mt-2 block rounded-lg border border-gray-200 dark:border-white/10 overflow-hidden bg-gray-50 dark:bg-white/5 hover:bg-gray-100 dark:hover:bg-white/10 transition-colors",children:[t7.linkPreview.imageUrl&&(0,r.jsxs)("div",{className:"relative w-full h-[280px] overflow-hidden bg-gray-100 dark:bg-white/5",children:[(0,r.jsx)(i.A,{useImg:!0,src:t7.linkPreview.imageUrl,alt:"","aria-hidden":"true",className:"absolute inset-0 w-full h-full object-cover",style:{filter:"blur(28px) saturate(1.35)",transform:"scale(1.15)"}}),(0,r.jsx)(i.A,{useImg:!0,src:t7.linkPreview.imageUrl,alt:"",width:600,height:280,sizes:"(max-width:640px) 100vw, 600px",className:"absolute inset-0 z-[1] w-full h-full object-contain"})]}),(0,r.jsxs)("div",{className:"p-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px] font-bold uppercase tracking-wide text-gray-500 dark:text-gray-400 mb-1",children:[t7.linkPreview.faviconUrl&&(0,r.jsx)(i.A,{useImg:!0,src:t7.linkPreview.faviconUrl,alt:"",width:12,height:12,sizes:"12px",className:"w-3 h-3 rounded-sm"}),(0,r.jsx)("span",{className:"truncate",children:t7.linkPreview.domain||t7.linkPreview.siteName||""})]}),t7.linkPreview.title&&(0,r.jsx)("p",{className:"text-[15px] font-semibold text-gray-900 dark:text-white line-clamp-2",children:t7.linkPreview.title}),t7.linkPreview.description&&(0,r.jsx)("p",{className:"text-xs text-gray-600 dark:text-gray-300 line-clamp-2 mt-1",children:t7.linkPreview.description})]})]}),(null==(tR=t7.meta)?void 0:tR.kind)==="story_share"&&(0,r.jsx)("div",{className:"mx-3 mt-2 rounded-lg border border-purple-200 dark:border-purple-500/30 overflow-hidden bg-gradient-to-r from-purple-50 to-pink-50 dark:from-purple-900/20 dark:to-pink-900/20 cursor-pointer hover:from-purple-100 hover:to-pink-100 dark:hover:from-purple-900/30 dark:hover:to-pink-900/30 transition-colors",onClick:()=>{var e;(null==(e=t7.meta)?void 0:e.storyId)&&av("/stories/".concat(t7.meta.storyId))},role:"button",tabIndex:0,children:(0,r.jsxs)("div",{className:"flex items-center gap-3 p-3",children:[(0,r.jsx)("div",{className:"flex-shrink-0 w-10 h-10 rounded-full bg-gradient-to-br from-purple-500 via-pink-500 to-orange-400 flex items-center justify-center shadow-md",children:(0,r.jsx)("span",{className:"text-xl","aria-hidden":"true",children:"\uD83D\uDCD6"})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("p",{className:"text-[11px] font-bold uppercase tracking-wide text-purple-700 dark:text-purple-300",children:"Shared a story"}),(null==(tz=t7.meta)?void 0:tz.storyOwnerName)&&(0,r.jsxs)("p",{className:"text-sm font-semibold text-gray-900 dark:text-white truncate",children:["by ",t7.meta.storyOwnerName]})]}),(0,r.jsxs)("span",{className:"px-3 py-1.5 bg-purple-600 text-white text-xs font-semibold rounded-lg whitespace-nowrap flex items-center gap-1",children:["View story",(0,r.jsx)("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,r.jsx)("polyline",{points:"9 18 15 12 9 6"})})]})]})}),t7.sharedPost&&(0,r.jsxs)("div",{className:"mx-3 mt-2 rounded-lg border border-gray-200 dark:border-white/10 overflow-hidden bg-gray-50 dark:bg-white/5 cursor-pointer hover:bg-gray-100 dark:hover:bg-white/10 transition-colors",onClick:()=>av("/post/".concat(t7.sharedPost.id||t7.sharedPostId)),role:"button",tabIndex:0,children:[(t7.sharedPost.author||t7.sharedPost.user)&&(()=>{let e=t7.sharedPost.author||t7.sharedPost.user;return(0,r.jsxs)("div",{className:"flex items-center gap-2 p-3 pb-2",children:[(0,r.jsx)(eD.N_,{to:(0,te.DW)(e),className:"flex-shrink-0",onClick:e=>e.stopPropagation(),children:(0,r.jsx)(i.A,{src:e.avatar||e.profilePicture,alt:e.name||e.username,className:"w-8 h-8 rounded-full object-cover",variant:"avatar"})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)(eD.N_,{to:(0,te.DW)(e),className:"text-sm font-semibold text-gray-900 dark:text-white hover:underline truncate block",onClick:e=>e.stopPropagation(),children:e.name||e.username||"User"}),t7.sharedPost.timestamp&&(0,r.jsx)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:new Date(t7.sharedPost.timestamp).toISOString().slice(0,10)})]})]})})(),t7.sharedPost.content&&(0,r.jsx)("p",{className:"text-sm text-gray-800 dark:text-gray-200 px-3 pb-2 line-clamp-3",...(0,ee.Vo
1)(t7.sharedPost.content),children:t7.sharedPost.content}),t7.sharedPost.image&&(0,r.jsx)("div",{className:"w-full flex items-center justify-center bg-black/5 dark:bg-black/20",children:(0,r.jsx)(i.A,{src:(0,p.resolveMediaUrl)(t7.sharedPost.image),alt:"Shared post",width:600,height:400,sizes:"(max-width:640px) 100vw, 600px",className:"w-full max-h-[400px] object-contain"})}),t7.sharedPost.video&&(0,r.jsx)("div",{className:"w-full",onClick:e=>e.stopPropagation(),children:(0,r.jsx)(G,{src:(0,p.resolveMediaUrl)(t7.sharedPost.video),poster:t7.sharedPost.videoThumbnail||null,posterPostId:t7.sharedPost.id||t7.sharedPostId,controls:!0,className:"w-full max-h-[400px]",preload:"metadata"})}),!t7.sharedPost.content&&!t7.sharedPost.image&&!t7.sharedPost.video&&!(t7.sharedPost.author||t7.sharedPost.user)&&(0,r.jsx)("p",{className:"text-sm text-gray-400 italic p-4 text-center",children:"This post is no longer available"})]}),t7.sharedPage&&(0,r.jsxs)("div",{className:"mx-3 mt-2 rounded-lg border border-gray-200 dark:border-white/10 overflow-hidden cursor-pointer hover:shadow-md transition-shadow",onClick:()=>av("/pages/".concat(t7.sharedPage.id||t7.sharedPageId)),role:"button",tabIndex:0,children:[(0,r.jsx)("div",{className:"h-24 bg-gradient-to-r from-primary to-purple-600 relative",children:t7.sharedPage.profileImageUrl&&(0,r.jsx)(s.A,{src:(0,p.resolveMediaUrl)(t7.sharedPage.profileImageUrl),alt:"",fill:!0,sizes:"(max-width: 768px) 100vw, 600px",className:"object-cover opacity-60",loading:"lazy"})}),(0,r.jsxs)("div",{className:"p-3 bg-gray-50 dark:bg-white/5 flex items-center gap-3",children:[(0,r.jsx)(i.A,{src:t7.sharedPage.profileImageUrl?(0,p.resolveMediaUrl)(t7.sharedPage.profileImageUrl):null,alt:t7.sharedPage.name,name:t7.sharedPage.name,useImg:!0,variant:"avatar",width:48,height:48,className:"w-12 h-12 rounded-lg object-cover border border-gray-200 dark:border-white/10 flex-shrink-0"}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("h4",{className:"font-bold text-gray-900 dark:text-white text-sm truncate",children:t7.sharedPage.name}),(0,r.jsx)("p",{className:"text-xs text-gray-500 truncate",children:t7.sharedPage.category||"Page"}),t7.sharedPage.bio&&(0,r.jsx)("p",{className:"text-xs text-gray-400 truncate mt-0.5",children:t7.sharedPage.bio})]}),(0,r.jsx)("span",{className:"px-3 py-1.5 bg-primary/10 text-primary text-xs font-semibold rounded-lg whitespace-nowrap",children:"View Page"})]})]}),!t7.event&&!((null==(tU=t7.content)?void 0:tU.includes("\uD83C\uDFAC"))&&((null==(tB=t7.content)?void 0:tB.includes("/watch?v="))||(null==(tO=t7.content)?void 0:tO.includes("/minis?v="))))&&(()=>{var e,t;let a=new Set,l=[],n=/\.(mp4|mov|webm|avi|mkv|m3u8)(\?|$)/i,s=(e,t)=>{if(!e||"string"!=typeof e)return;let r=e.trim();if(!r||a.has(r))return;a.add(r);let s=(0,J.Fr)(r,t)||ai.has(r)?"audio":t||(n.test(r)?"video":"image");l.push({url:r,type:s})},i=Array.isArray(t7.files)?t7.files:[];if(i.length>0){for(let e of i){let t=(null==e?void 0:e.fileUrl)||(null==e?void 0:e.file_url);t&&s(t,((null==e?void 0:e.fileType)||(null==e?void 0:e.file_type)||"").toLowerCase().startsWith("video")?"video":void 0)}t7.video&&"string"==typeof t7.video&&t7.video.trim()&&s(t7.video,"video")}else{let e=t7.video&&"string"==typeof t7.video&&t7.video.trim();!e&&(t7.image&&"string"==typeof t7.image&&t7.image.trim()&&s(t7.image,"image"),Array.isArray(t7.images)&&t7.images.forEach(e=>s(e))),e&&s(t7.video,"video")}if(0===l.length)return null;let o=new Map;if(Array.isArray(t7.media))for(let e of t7.media)e&&e.url&&e.thumbnail&&o.set(e.url,e.thumbnail);if(Array.isArray(t7.files))for(let e of t7.files){let t=(null==e?void 0:e.fileUrl)||(null==e?void 0:e.file_url),a=(null==e?void 0:e.thumbnail)||(null==e?void 0:e.thumbnailUrl)||(null==e?void 0:e.videoThumbnailUrl);t&&a&&!o.has(t)&&o.set(t,a)}let d=e=>o.get(e)||void 0,c=l.length,u=e=>{rB("string"==typeof e?e:null),rz(!0)},m=l.some(e=>"image"===e.type),x=(null==(e=l.find(e=>"video"===e.type))?void 0:e.url)||null,p=e=>d(e)||e&&e===x&&t7.videoThumbnail||(m?null:t7.videoThumbnail||t7.thumbnail||t7.image||null),h=e=>(0,e3.S5)(t7,e),g=e=>{var t,a;let{item:l,className:n,overlay:s,priority:i,onClick:o}=e,c=()=>null==o?void 0:o(l.url);return"audio"===l.type?(0,r.jsxs)("div",{className:n,onClick:c,children:[(0,r.jsx)(J.Ay,{src:l.url}),s]}):"video"===l.type?(0,r.jsx)(q,{src:l.url,poster:p(l.url),onAudioOnly:ad,postId:t7.id,captions:null==(a=h(l.url))?void 0:a.captions,onClick:()=>rH(!0),onOpen:()=>rH(!0),className:n,overlay:s}):$(l.url)?(0,r.jsx)(Q,{url:l.url,className:n,children:e=>{var t;return(0,r.jsx)(V,{src:e,alt:(null==(t=h(l.url))?void 0:t.altText)||"",onClick:c,className:"w-full h-full",overlay:s,priority:i})}}):(0,r.jsx)(V,{src:l.url,thumbSrc:d(l.url),alt:(null==(t=h(l.url))?void 0:t.altText)||"",onClick:c,className:n,overlay:s,priority:i})};if(1===c){let e=l[0];return(0,r.jsx)("div",{className:"mt-1 border-y border-gray-200/60 dark:border-white/5",children:"audio"===e.type?(0,r.jsx)("div",{className:"p-3",children:(0,r.jsx)(J.Ay,{src:e.url,title:function(e){let t=String(e||"").trim();return tm.has(t.toLowerCase())?"":t}(null==t7?void 0:t7.content)})}):"video"===e.type?(0,r.jsx)(Y,{src:e.url,poster:p(e.url),onAudioOnly:ad,postId:t7.id,priority:ae,onOpen:()=>rH(!0),captions:null==(t=h(e.url))?void 0:t.captions}):(0,r.jsx)(Q,{url:e.url,children:t=>{var a;return(0,r.jsx)(K,{src:t,thumbSrc:t===e.url?d(e.url):void 0,alt:(null==(a=h(e.url))?void 0:a.altText)||"Post content",onClick:u,priority:ae})}})})}let f="mt-1 border-y border-gray-200/60 dark:border-white/5 overflow-hidden",b={aspectRatio:"5 / 4",maxHeight:520,minHeight:260};if(2===c)return(0,r.jsxs)("div",{className:"".concat(f," grid grid-cols-2 gap-0.5"),style:{...b,aspectRatio:"16 / 10"},children:[(0,r.jsx)(g,{item:l[0],onClick:u,className:"h-full w-full",priority:ae}),(0,r.jsx)(g,{item:l[1],onClick:u,className:"h-full w-full",priority:ae})]});if(3===c)return(0,r.jsxs)("div",{className:"".concat(f," grid grid-cols-2 grid-rows-2 gap-0.5"),style:b,children:[(0,r.jsx)(g,{item:l[0],onClick:u,className:"row-span-2 h-full w-full",priority:ae}),(0,r.jsx)(g,{item:l[1],onClick:u,className:"h-full w-full"}),(0,r.jsx)(g,{item:l[2],onClick:u,className:"h-full w-full"})]});if(4===c)return(0,r.jsxs)("div",{className:"".concat(f," grid grid-cols-2 grid-rows-2 gap-0.5"),style:b,children:[(0,r.jsx)(g,{item:l[0],onClick:u,className:"h-full w-full",priority:ae}),(0,r.jsx)(g,{item:l[1],onClick:u,className:"h-full w-full",priority:ae}),(0,r.jsx)(g,{item:l[2],onClick:u,className:"h-full w-full"}),(0,r.jsx)(g,{item:l[3],onClick:u,className:"h-full w-full"})]});let y=c>5?c-5:0;return(0,r.jsxs)("div",{className:"".concat(f," grid grid-cols-6 gap-0.5"),style:{...b,gridTemplateRows:"3fr 2fr"},children:[(0,r.jsx)(g,{item:l[0],onClick:u,className:"col-span-3 h-full w-full",priority:ae}),(0,r.jsx)(g,{item:l[1],onClick:u,className:"col-span-3 h-full w-full",priority:ae}),(0,r.jsx)(g,{item:l[2],onClick:u,className:"col-span-2 h-full w-full"}),(0,r.jsx)(g,{item:l[3],onClick:u,className:"col-span-2 h-full w-full"}),(0,r.jsx)(g,{item:l[4],onClick:u,className:"col-span-2 h-full w-full",overlay:y>0?y:void 0})]})})(),(()=>{let e=(0,e3.H7)(t7),t=e?(0,e3.S5)(t7,e):null;return t?(0,r.jsx)(e4.A,{details:t,className:"mt-2 px-3 sm:px-4"}):null})(),t7.linkPreview&&(0,r.jsxs)("a",{href:t7.linkPreview.url,target:"_blank",rel:"noopener noreferrer",className:"mt-2 block rounded-lg border border-gray-200 dark:border-white/10 overflow-hidden hover:opacity-95",children:[t7.linkPreview.image&&(0,r.jsx)(i.A,{useImg:!0,src:t7.linkPreview.image.startsWith("http")?t7.linkPreview.image:(0,p.resolveMediaUrl)(t7.linkPreview.image),alt:"Link preview",width:500,height:160,className:"w-full h-40 object-cover",loading:"lazy"}),(0,r.jsxs)("div",{className:"p-3 bg-gray-50 dark:bg-white/5",children:[(0,r.jsx)("p",{className:"font-semibold text-gray-900 dark:text-white text-sm",children:t7.linkPreview.title}),(0,r.jsx)("p",{className:"text-xs text-gray-500 truncate",children:t7.linkPreview.url})]})]}),t7.isSponsored&&t7.ctaText&&(0,r.jsx)("button",{className:"mt-2 w-full py-2 bg-primary text-white rounded-lg font-semibold text-sm hover:bg-primary transition-colors",children:t7.ctaText}),(null==(tH=t7.tags)?void 0:tH.length)>0&&(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5 mt-2 mb-1",children:t7.tags.filter(e=>("topic"===e.tagType||"hashtag"===e.tagType)&&(void 0===e.confidence||e.confidence>=.5)).slice(0,5).map((e,t)=>(0,r.jsx)(eD.N_,{to:"/feeds/tag?tag=".concat(encodeURIComponent(e.tag),"&tagType=").concat(e.tagType),className:"inline-flex items-center px-2 py-0.5 rounded-full text-[11px] font-medium transition-colors ".concat("topic"===e.tagType?"bg-primary/10 text-primary hover:bg-primary/20 dark:bg-primary-dark/20 dark:text-primary-light dark:hover:bg-primary-dark/40":"bg-gray-100 text-gray-600 hover:bg-gray-200 dark:bg-white/5 dark:text-gray-400 dark:hover:bg-white/10"),onClick:e=>e.stopPropagation(),children:"hashtag"===e.tagType?e.tag.startsWith("#")?e.tag:"#".concat(e.tag):e.tag},"".concat(e.tag,"-").concat(t)))}),(0,r.jsxs)("div",{className:"flex items-center justify-between pt-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)(eU.Ay,{postId:t7.id,isLiked:lt,userReactionType:t7.userReactionType,variant:"count",count:le}),(0,r.jsxs)("button",{type:"button",className:"flex items-center gap-1.5 px-2 py-1.5 rounded-lg text-[#65676B] dark:text-[#B0B3B8] hover:bg-gray-100 dark:hover:bg-white/10 transition-colors","aria-label":al("common.comment"),onClick:()=>{ak()&&ax(!0)},children:[(0,r.jsx)(eE.A,{className:"w-5 h-5"}),(0,r.jsx)("span",{className:"text-[15px] font-medium tabular-nums",children:t7.comments||0})]}),(0,r.jsxs)("button",{type:"button",className:"flex items-center gap-1.5 px-2 py-1.5 rounded-lg text-[#65676B] dark:text-[#B0B3B8] hover:bg-gray-100 dark:hover:bg-white/10 transition-colors","aria-label":al("common.share"),onClick:()=>{ak()&&a3(!0)},children:[(0,r.jsx)(eT.A,{className:"w-5 h-5"}),(0,r.jsx)("span",{className:"text-[15px] font-medium tabular-nums",children:(t7.shares||0)+a6})]})]}),(0,r.jsx)("button",{type:"button",onMouseEnter:r9,onFocus:r9,onClick:()=>{r9(),rK(!0)},disabled:0===le,"aria-label":al("post.reactions.whoReacted","See who reacted"),"aria-haspopup":"dialog",className:"relative group h-9 pl-1 pr-0.5 flex items-center rounded-full hover:bg-gray-100 dark:hover:bg-white/10 transition-colors disabled:opacity-40 disabled:pointer-events-none",children:(0,r.jsxs)("span",{className:"flex items-center -space-x-1.5",children:[(0,r.jsx)("span",{className:"w-[22px] h-[22px] rounded-full bg-[#0866FF] grid place-items-center ring-2 ring-white dark:ring-[#242526]",children:(0,r.jsx)(eb.A,{className:"w-3 h-3 text-white fill-white"})}),r3&&(0,r.jsx)("span",{className:"w-[22px] h-[22px] rounded-full bg-white dark:bg-[#3A3B3C] grid place-items-center ring-2 ring-white dark:ring-[#242526] text-[13px] leading-none",children:r3})]})})]}),ac&&(0,r.jsxs)("div",{children:[(0,r.jsx)(eq.A,{postId:t7.id,postAuthorId:ag,pageId:(null==t7||null==(tW=t7.page)?void 0:tW.id)||(null==t7?void 0:t7.pageId)||null,isPageOwner:!!aP}),r2?(0,r.jsx)("p",{className:"text-center text-xs text-gray-400 py-3",children:la?al("post.commentsOffOwner","You've turned comments off for this post"):al("post.commentsOff","Comments are turned off for this post")}):(0,r.jsx)(eY.A,{postId:t7.id,post:t7,identity:(null==t7?void 0:t7.page)&&(null==t7||null==(tK=t7.page)?void 0:tK.isOwnedByCurrentUser)?{name:t7.page.name,avatar:t7.page.profileImageUrl||null}:null})]}),(0,r.jsx)(tn,{open:am,onClose:()=>ax(!1),post:t7,isPageOwner:!!aP,commentsDisabled:r2,isOwnPost:la}),(0,r.jsx)(e2.A,{isOpen:rR,onClose:()=>rz(!1),post:t7,initialUrl:rU}),rO&&(0,r.jsx)(l.Suspense,{fallback:null,children:(0,r.jsx)(ti,{startPostId:t7.id,onClose:()=>rH(!1)})}),lT&&"undefined"!=typeof document&&(0,eI.createPortal)((0,r.jsx)("div",{className:"fixed inset-0 z-[9999] bg-black/50 flex items-center justify-center p-4",onClick:()=>lI(!1),children:(0,r.jsxs)("div",{className:"bg-white dark:bg-[#242526] rounded-2xl shadow-2xl w-full max-w-md overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-5 py-4 border-b border-gray-200 dark:border-white/10",children:[(0,r.jsxs)("h3",{className:"text-lg font-bold text-gray-900 dark:text-white flex items-center gap-2",children:[(0,r.jsx)(eS.A,{className:"w-5 h-5"})," Post Insights"]}),(0,r.jsx)("button",{"aria-label":"Close insights",onClick:()=>lI(!1),className:"p-1.5 hover:bg-gray-100 dark:hover:bg-white/10 rounded-full",children:(0,r.jsx)(en.A,{className:"w-5 h-5 text-gray-500"})})]}),(0,r.jsxs)("div",{className:"p-5 space-y-4",children:[(0,r.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,r.jsxs)("div",{className:"bg-primary/10 dark:bg-primary/10 rounded-xl p-4 text-center",children:[(0,r.jsx)("p",{className:"text-2xl font-bold text-primary",children:null!=(t3=t7.likes)?t3:0}),(0,r.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Likes"})]}),(0,r.jsxs)("div",{className:"bg-green-50 dark:bg-green-500/10 rounded-xl p-4 text-center",children:[(0,r.jsx)("p",{className:"text-2xl font-bold text-green-600",children:null!=(t6=t7.comments)?t6:0}),(0,r.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Comments"})]}),(0,r.jsxs)("div",{className:"bg-purple-50 dark:bg-purple-500/10 rounded-xl p-4 text-center",children:[(0,r.jsx)("p",{className:"text-2xl font-bold text-purple-600",children:(null!=(t9=t7.shares)?t9:0)+a6}),(0,r.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Shares"})]})]}),(0,r.jsxs)("div",{className:"bg-gray-50 dark:bg-white/5 rounded-xl p-4",children:[(0,r.jsxs)("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:[(0,r.jsx)("span",{className:"font-semibold",children:"Privacy:"})," ","public"===t7.type?"\uD83C\uDF0D Public":"friends"===t7.type||"friend"===t7.type?"\uD83D\uDC65 Friends":"only_me"===t7.type?"\uD83D\uDD12 Only Me":"specific_friends"===t7.type?"â Specific Friends":t7.type]}),(0,r.jsxs)("p",{className:"text-sm text-gray-600 dark:text-gray-300 mt-2",children:[(0,r.jsx)("span",{className:"font-semibold",children:"Posted:"}
1)," ",t7.timestamp?new Date(t7.timestamp).toLocaleString():"Unknown"]}),t7.isPinned&&(0,r.jsx)("p",{className:"text-sm text-primary mt-2 font-semibold",children:"\uD83D\uDCCC Pinned Post"}),t7.commentsMuted&&(0,r.jsx)("p",{className:"text-sm text-orange-600 mt-2 font-semibold",children:"\uD83D\uDD07 Comments Off"})]})]})]})}),document.body),rW&&(0,r.jsx)(eV,{users:rY,loading:rQ,onClose:()=>rK(!1)}),rV&&"undefined"!=typeof document&&(0,eI.createPortal)((0,r.jsx)("div",{className:"fixed inset-0 z-[9999] bg-black/50 flex items-center justify-center p-4",onClick:()=>rq(!1),children:(0,r.jsxs)("div",{className:"bg-white dark:bg-[#242526] rounded-2xl shadow-2xl w-full max-w-sm max-h-[60vh] flex flex-col overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-white/10",children:[(0,r.jsx)("h3",{className:"font-bold text-gray-900 dark:text-white",children:"People who shared this"}),(0,r.jsx)("button",{"aria-label":"Close shares list",onClick:()=>rq(!1),className:"p-1 hover:bg-gray-100 dark:hover:bg-white/10 rounded-full",children:(0,r.jsx)(en.A,{className:"w-4 h-4"})})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar p-2",children:rX?(0,r.jsx)("div",{className:"flex justify-center py-8",children:(0,r.jsx)("div",{className:"w-6 h-6 border-2 border-primary border-t-transparent rounded-full animate-spin"})}):0===rZ.length?(0,r.jsx)("p",{className:"text-center text-gray-400 text-sm py-8",children:"No shares yet"}):rZ.map(e=>(0,r.jsxs)(eD.N_,{to:"/profile/".concat(e.id||e.userId),onClick:()=>rq(!1),className:"flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-gray-50 dark:hover:bg-white/5 transition-colors",children:[(0,r.jsx)(s.A,{src:e.avatar||(0,eQ.dJ)(e.name||"U",36),alt:"",width:36,height:36,className:"w-9 h-9 rounded-full object-cover"}),(0,r.jsx)("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:e.name||e.username||"User"})]},e.id||e.userId))})]})}),document.body),aR&&"undefined"!=typeof document&&(0,eI.createPortal)((0,r.jsx)(tx,{userName:null==t7||null==(tV=t7.user)?void 0:tV.name,submitting:aU,onCancel:()=>{aU||az(!1)},onConfirm:lA}),document.body)]})},(e,t)=>{var a,r,l,n,s,i,o,d,c,u,m,x;if(e.onReport!==t.onReport||e.priority!==t.priority)return!1;let p=e.post,h=t.post;if(p===h)return!0;if(!p||!h||p.id!==h.id||p.updatedAt!==h.updatedAt||p.likeCount!==h.likeCount||p.commentCount!==h.commentCount||p.shareCount!==h.shareCount||p.isLiked!==h.isLiked||p.isSaved!==h.isSaved||p.isFavorite!==h.isFavorite||p.content!==h.content||p.image!==h.image||p.video!==h.video||(null==(a=p.user)?void 0:a.avatar)!==(null==(r=h.user)?void 0:r.avatar)||(null==(l=p.user)?void 0:l.name)!==(null==(n=h.user)?void 0:n.name)||(null==(s=p.user)?void 0:s.username)!==(null==(i=h.user)?void 0:i.username)||(null==(o=p.author)?void 0:o.avatar)!==(null==(d=h.author)?void 0:d.avatar)||(null==(c=p.author)?void 0:c.name)!==(null==(u=h.author)?void 0:u.name))return!1;let g=(null==(m=p.images)?void 0:m.length)||0;return g===((null==(x=h.images)?void 0:x.length)||0)&&(!(g>0)||p.images[0]===h.images[0])})},27483:(e,t,a)=>{a.d(t,{N:()=>i,Q:()=>s});var r=a(95155);a(12115);var l=a(1213),n=a(85472);function s(e){var t;let{children:a,fallback:s=null,redirectToLogin:i=!0}=e,o=(0,l.d4)(e=>{var t;return null==(t=e.auth)?void 0:t.isAuthenticated});(0,n.Zp)();let d=null==(t=window.location)?void 0:t.pathname;if(o)return(0,r.jsx)(r.Fragment,{children:a});if(s)return(0,r.jsx)(r.Fragment,{children:s});if(i){let e=encodeURIComponent(d||"/");return(0,r.jsxs)("div",{className:"rounded-xl bg-gray-100 dark:bg-white/10 p-6 text-center",children:[(0,r.jsx)("p",{className:"text-gray-700 dark:text-gray-300 mb-4",children:"Sign in to continue."}),(0,r.jsxs)("div",{className:"flex items-center justify-center gap-3",children:[(0,r.jsx)(n.N_,{to:"/login?returnUrl=".concat(e),className:"px-4 py-2 rounded-lg bg-primary text-white font-medium hover:bg-primary-dark",children:"Log in"}),(0,r.jsx)(n.N_,{to:"/register?returnUrl=".concat(e),className:"px-4 py-2 rounded-lg border border-gray-300 dark:border-white/20 text-gray-700 dark:text-gray-200 font-medium hover:bg-gray-100 dark:hover:bg-white/10",children:"Sign up"})]})]})}return null}function i(){let e=(0,l.d4)(e=>{var t;return null==(t=e.auth)?void 0:t.isAuthenticated}),t=(0,n.Zp)();return{requireAuth:function(){var a;if(arguments.length>0&&void 0!==arguments[0]&&arguments[0],e)return!0;let r=encodeURIComponent((null==(a=window.location)?void 0:a.pathname)||"/");return t("/login?returnUrl=".concat(r)),!1},isAuthenticated:e}}},29715:(e,t,a)=>{a.d(t,{A:()=>h});var r=a(95155),l=a(12115),n=a(1213),s=a(71866),i=a(59702),o=a(49966),d=a(87492);let c=new Set,u=new Set,m=null;async function x(){m=null;let e=[...c];
1if(c.clear(),e.length){e.forEach(e=>u.add(e));try{for(let l=0;l<e.length;l+=200){var t,a,r;let n=e.slice(l,l+200),s=await d.default.post("/stories/active-among",{userIds:n}),c=null!=(r=null!=(a=null==s||null==(t=s.data)?void 0:t.data)?a:null==s?void 0:s.data)?r:[];Array.isArray(c)&&c.length&&o.M.dispatch((0,i.AI)(c))}}catch(t){e.forEach(e=>u.delete(e))}}}var p=a(46215);let h=l.memo(function(e){let{userId:t,size:a=44,children:o,className:d=""}=e,h=(0,n.d4)(e=>(0,i.Py)(e,t)),g=(0,n.wA)();if((0,l.useEffect)(()=>{t&&!(!t||u.has(t)||c.has(t))&&(c.add(t),m||(m=setTimeout(x,250)))},[t]),!(null==h?void 0:h.hasStory))return o;let f=e=>{e.preventDefault(),e.stopPropagation(),g((0,p.Ak)(t))};return(0,r.jsx)("span",{role:"button",tabIndex:0,"aria-label":"View story",onClick:f,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),f(e))},className:"cursor-pointer inline-flex",children:(0,r.jsx)(s.A,{hasStory:!0,viewed:h.allViewed,size:a,className:d,children:o})})})},30901:(e,t,a)=>{a.d(t,{p:()=>r});function r(e,t){var a,r,l,n,s,i,o,d,c,u;if(!e||"object"!=typeof e)return!1;if(!0===e.isOwnedByCurrentUser||!0===e.isOwner||!0===e.isMine)return!0;if(null==t||""===t)return!1;let m=String(t);return[e.userId,e.authorId,e.uploaderId,e.creatorId,e.ownerId,null==(a=e.user)?void 0:a.id,null==(r=e.user)?void 0:r._id,null==(l=e.author)?void 0:l.id,null==(n=e.author)?void 0:n._id,null==(s=e.uploader)?void 0:s.id,null==(i=e.uploader)?void 0:i._id,null==(o=e.creator)?void 0:o.id,null==(d=e.creator)?void 0:d._id,null==(c=e.owner)?void 0:c.id,null==(u=e.owner)?void 0:u._id].some(e=>null!=e&&String(e)===m)}},33637:(e,t,a)=>{a.d(t,{A:()=>o});var r=a(95155);a(12115);var l=a(50069),n=a(65229),s=a(66630),i=a(20063);let o=e=>{let{authorName:t,onDismiss:a}=e,o=(0,i.useRouter)();return(0,r.jsxs)("article",{className:"mb-4 rounded-2xl border border-gray-200 dark:border-white/10 bg-white dark:bg-dark-paper overflow-hidden",role:"region","aria-label":"Blocked ".concat(t||"this user"),children:[(0,r.jsxs)("div",{className:"px-4 py-3 flex items-start gap-3",children:[(0,r.jsx)("span",{className:"w-9 h-9 rounded-full bg-gray-100 dark:bg-white/5 flex items-center justify-center shrink-0",children:(0,r.jsx)(l.A,{className:"w-5 h-5 text-gray-700 dark:text-gray-200"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("p",{className:"font-semibold text-gray-900 dark:text-white text-[15px] leading-tight",children:["You blocked ",t||"this user","âs profile"]}),(0,r.jsx)("p",{className:"text-[13px] text-gray-500 dark:text-gray-400 mt-0.5",children:"You wonât be able to see or contact each other."})]}),(0,r.jsx)("button",{type:"button",onClick:a,className:"p-1.5 -mt-0.5 rounded-full text-gray-500 hover:bg-gray-100 dark:hover:bg-white/5","aria-label":"Dismiss",title:"Dismiss",children:(0,r.jsx)(n.A,{className:"w-4 h-4"})})]}),(0,r.jsx)("div",{className:"border-t border-gray-100 dark:border-white/5"}),(0,r.jsxs)("button",{type:"button",onClick:()=>{try{o.push("/settings/feed-preferences")}catch(e){}},className:"w-full px-4 py-3 flex items-center gap-3 text-left hover:bg-gray-50 dark:hover:bg-white/5 transition-colors",children:[(0,r.jsx)("span",{className:"w-9 h-9 rounded-full bg-gray-100 dark:bg-white/5 flex items-center justify-center shrink-0",children:(0,r.jsx)(s.A,{className:"w-4 h-4 text-gray-700 dark:text-gray-200"})}),(0,r.jsx)("span",{className:"text-[14px] font-semibold text-gray-900 dark:text-white",children:"Content preferences"})]})]})}},36468:(e,t,a)=>{a.d(t,{$B:()=>r,EH:()=>s,KS:()=>o,VP:()=>d,Vp:()=>l,rO:()=>u,t6:()=>m,ux:()=>c});let r=[{code:"en",label:"English"},{code:"ar",label:"Arabic"},{code:"bn",label:"Bengali"},{code:"zh",label:"Chinese"},{code:"fr",label:"French"},{code:"de",label:"German"},{code:"hi",label:"Hindi"},{code:"id",label:"Indonesian"},{code:"it",label:"Italian"},{code:"ja",label:"Japanese"},{code:"ko",label:"Korean"},{code:"ms",label:"Malay"},{code:"fa",label:"Persian"},{code:"pt",label:"Portuguese"},{code:"ru",label:"Russian"},{code:"es",label:"Spanish"},{code:"tl",label:"Tagalog"},{code:"tr",label:"Turkish"},{code:"ur",label:"Urdu"},{code:"vi",label:"Vietnamese"}],l=e=>{var t;return(null==(t=r.find(t=>t.code===e))?void 0:t.label)||"Captions"},n=/(?:(\d+):)?(\d{1,2}):(\d{1,2})(?:[.,](\d{1,3}))?/;function s(e){let t=n.exec(String(e||"").trim());if(!t)return null;let[,a,r,l,s]=t,i=s?Number(s.padEnd(3,"0")):0;return 3600*Number(a||0)+60*Number(r)+Number(l)+i/1e3}function i(e){let t=Math.max(0,Number(e)||0),a=Math.floor(t/3600),r=M
1ath.floor(t%3600/60),l=Math.floor(t%60),n=Math.round((t-Math.floor(t))*1e3)%1e3,s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return String(e).padStart(t,"0")};return"".concat(s(a),":").concat(s(r),":").concat(s(l),".").concat(s(n,3))}function o(e){let t=Math.max(0,Number(e)||0),a=Math.floor(t/60),r=(t%60).toFixed(1).padStart(4,"0");return"".concat(a,":").concat(r)}function d(e){let t=String(e||"").replace(/^\uFEFF/,"").replace(/\r\n?/g,"\n"),a=[];for(let e of t.split(/\n{2,}/)){let t=e.split("\n").filter(e=>""!==e.trim()),r=t.findIndex(e=>e.includes("--\x3e"));if(r<0)continue;let[l,n]=t[r].split("--\x3e"),i=s(l),o=s(String(n||"").trim().split(/\s+/)[0]),d=t.slice(r+1).join("\n").trim();null!=i&&null!=o&&o>i&&d&&a.push({start:i,end:o,text:d})}return a.sort((e,t)=>e.start-t.start)}function c(e){let t=(e||[]).filter(e=>e&&e.end>e.start&&String(e.text||"").trim()).map(e=>"".concat(i(e.start)," --\x3e ").concat(i(e.end),"\n").concat(String(e.text).trim())).join("\n\n");return"WEBVTT\n\n".concat(t,"\n")}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,r=Math.max(0,Number(t)||0),l=Number.isFinite(a)&&a>r?a:1/0;return(e||[]).filter(e=>e.end>r&&e.start<l).map(e=>({...e,start:Math.max(0,e.start-r),end:Math.min(l,e.end)-r})).filter(e=>e.end>e.start)}let m=(e,t)=>
1(e||[]).find(e=>t>=e.start&&t<e.end)||null},38059:(e,t,a)=>{a.d(t,{Ay:()=>m,Fr:()=>d});var r=a(95155),l=a(12115),n=a(85449),s=a(53511),i=a(85921);let o=/\.(mp3|m4a|aac|wav|ogg|oga|opus|flac|weba)(\?|$)/i;function d(e,t){return!!String(t||"").toLowerCase().startsWith("audio")||o.test(String(e||""))}let c={feed:48,story:26},u=e=>{(!Number.isFinite(e)||e<0)&&(e=0);let t=Math.floor(e/60),a=Math.floor(e%60);return"".concat(t,":").concat(String(a).padStart(2,"0"))};function m(e){let{src:t,title:a,variant:o="feed",autoPlay:d=!1,className:m=""}=e,x=(0,l.useRef)(null),[p,h]=(0,l.useState)(!1),[g,f]=(0,l.useState)(0),[b,y]=(0,l.useState)(0),[v,w]=(0,l.useState)(!1),k=c[o]||c.feed,j=(0,l.useMemo)(()=>(function(e,t){let a=0x811c9dc5,r=String(e||"");for(let e=0;e<r.length;e++)a^=r.charCodeAt(e),a=Math.imul(a,0x1000193)>>>0;let l=a||1,n=[];for(let e=0;e<t;e++)n.push(.18+(l=Math.imul(l,0x41c64e6d)+12345&0x7fffffff)%1e3/1e3*.82);return n})(t,k),[t,k]),N=b>0?Math.min(1,g/b):0;(0,l.useEffect)(()=>{h(!1),f(0),y(0),w(!1)},[t]);let C=(0,l.useCallback)(()=>{let e=x.current;e&&(e.paused?e.play().catch(()=>w(!0)):e.pause())},[]),S=(0,l.useCallback)((e,t)=>{let a=x.current;if(!a||!b)return;let r=t.getBoundingClientRect();a.currentTime=Math.min(1,Math.max(0,(e-r.left)/r.width))*b,f(a.currentTime)},[b]),A="story"===o;return(0,r.jsxs)("div",{className:"relative w-full overflow-hidden bg-black ".concat(A?"h-full flex flex-col justify-center":"rounded-lg"," ").concat(m),"data-testid":"audio-media-card",children:[(0,r.jsx)("audio",{ref:x,src:t,preload:"metadata",autoPlay:d,onPlay:()=>h(!0),onPause:()=>h(!1),onEnded:()=>{h(!1),f(0)},onTimeUpdate:e=>f(e.currentTarget.currentTime||0),onLoadedMetadata:e=>y(e.currentTarget.duration||0),onError:()=>w(!0)}),(0,r.jsxs)("div",{className:"flex flex-col ".concat(A?"gap-4 p-6":"gap-3 p-4"),children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-white/60",children:[(0,r.jsx)(n.A,{className:"h-3.5 w-3.5 shrink-0"}),(0,r.jsx)("span",{className:"text-[10px] font-semibold uppercase tracking-widest",children:"Audio"}),(0,r.jsxs)("span",{className:"ml-auto text-[11px] tabular-nums text-white/50",children:[u(g)," / ",b>0?u(b):"--:--"]})]}),a?(0,r.jsx)("p",{className:"line-clamp-2 text-white/90 ".concat(A?"text-base font-medium":"text-sm"),children:a}):null,(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("button",{type:"button",onClick:C,disabled:v,"aria-label":p?"Pause audio":"Play audio",className:"grid h-12 w-12 shrink-0 place-items-center rounded-full bg-white/25 text-white backdrop-blur-sm transition hover:bg-white/35 disabled:opacity-40",children:p?(0,r.jsx)(s.A,{className:"h-5 w-5"}):(0,r.jsx)(i.A,{className:"ml-0.5 h-5 w-5"})}),(0,r.jsx)("div",{role:"slider",tabIndex:0,"aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.round(b)||0,"aria-valuenow":Math.round(g),onClick:e=>S(e.clientX,e.currentTarget),onKeyDown:e=>{let t=x.current;t&&b&&("ArrowRight"===e.key&&(t.currentTime=Math.min(b,t.currentTime+5)),"ArrowLeft"===e.key&&(t.currentTime=Math.max(0,t.currentTime-5)),(" "===e.key||"Enter"===e.key)&&(e.preventDefault(),C()))},className:"flex min-w-0 flex-1 cursor-pointer items-center gap-[2px] overflow-hidden outline-none ".concat(A?"h-16":"h-10"),children:j.map((e,t)=>{let a=t/k<=N;return(0,r.jsx)("span",{className:"flex-1 rounded-full transition-colors duration-150 ".concat(a?"bg-[rgb(var(--primary))]":"bg-white/25"),style:{height:"".concat(Math.round(100*e),"%"),minWidth:A?1.5:2}},t)})})]}),v?(0,r.jsx)("p",{className:"text-xs text-white/60",children:"This audio couldnât be played."}):null]})]})}},52111:(e,t,a)=>{a.d(t,{L:()=>l,v:()=>n});let r=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,l=e=>!!(null==e?void 0:e.id)&&r.test(e.id),n=e=>!!e&&r.test(e)},53282:(e,t,a)=>{a.d(t,{A:()=>o});var r=a(12115);let l="wn:dataSaver",n=new Set(["2g","slow-2g","3g"]),s=()=>{try{return"1"===window.localStorage.getItem(l)}catch(e){return!1}},i=()=>{if("undefined"==typeof navigator)return{effectiveType:"unknown",downlink:10,rtt:50,saveData:!1};let e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return e?{effectiveType:e.effectiveType||"unknown",downlink:"number"==typeof e.downlink?e.downlink:10,rtt:"number"==typeof e.rtt?e.rtt:50,saveData:!!e.saveData}:{effectiveType:"unknown",downlink:10,rtt:50,saveData:!1}};function o(){let[e,t]=(0,r.useState)("undefined"==typeof navigator||navigator.onLine),[a,o]=(0,r.useState)(i),[d,c]=(0,r.useState)(s);(0,r.useEffect)(()=>{let e=()=>t(!0),a=()=>t(!1);window.addEventListener("online",e),window.addEventListener("offline",a);let r=navigator.connection||navigator.mozConnection||navigator.webkitConnection,n=()=>o(i());r&&"function"==typeof r.addEventListener&&r.addEventListener("change",n);let s=e=>{e.key===l&&c("1"===e.newValue)};
1return window.addEventListener("storage",s),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",a),r&&"function"==typeof r.removeEventListener&&r.removeEventListener("change",n),window.removeEventListener("storage",s)}},[]);let u=(0,r.useCallback)(e=>{let t=!!e;c(t);try{window.localStorage.setItem(l,t?"1":"0")}catch(e){}try{window.dispatchEvent(new StorageEvent("storage",{key:l,newValue:t?"1":"0"}))}catch(e){}},[]),m=n.has(a.effectiveType)||a.downlink>0&&a.downlink<1,x=!!a.saveData||d||m;return{online:e,effectiveType:a.effectiveType,downlink:a.downlink,rtt:a.rtt,saveDataHint:!!a.saveData,userDataSaver:d,isSlowConnection:m,dataSaverActive:x,setUserDataSaver:u}}},59928:(e,t,a)=>{a.d(t,{A:()=>o});var r=a(95155),l=a(12115),n=a(85472),s=a(98502);let i=RegExp("(https?:\\/\\/[^\\s<]+)|((?:^|(?<=\\s))www\\.[A-Za-z0-9-]+\\.[A-Za-z0-9.-]+[^\\s<]*)|(#[a-zA-Z0-9_]+)|(@[a-zA-Z0-9._]+)","g");function o(e){let{text:t,className:a=""}=e,[o,d]=(0,l.useState)(!1),{parts:c,hashtagCount:u}=(0,l.useMemo)(()=>{let e;if(!t||"string"!=typeof t)return{parts:[],hashtagCount:0};let a=[],r=0,l=0,n=RegExp(i.source,"g");for(;null!==(e=n.exec(t));)e.index>r&&a.push({type:"text",value:t.slice(r,e.index)}),e[1]?a.push({type:"url",value:e[1]}):e[2]?a.push({type:"url",value:e[2],href:"https://".concat(e[2])}):e[3]?(a.push({type:"hashtag",value:e[3],hashtagIndex:l}),l+=1):e[4]&&a.push({type:"mention",value:e[4]}),r=n.lastIndex;return r<t.length&&a.push({type:"text",value:t.slice(r)}),{parts:a,hashtagCount:l}},[t]),m=u>4,x=m&&!o?u-4:0,p=!1;return(0,r.jsxs)("span",{className:a,children:[c.map((e,t)=>{if(m&&!o&&"hashtag"===e.type&&"number"==typeof e.hashtagIndex&&e.hashtagIndex>=4)return p?null:(p=!0,(0,r.jsxs)(l.Fragment,{children:[" ",(0,r.jsxs)("button",{type:"button",onClick:e=>{e.stopPropagation(),d(!0)},className:"inline-flex items-center px-2 py-0.5 rounded-full text-[12px] font-semibold bg-primary/10 dark:bg-primary/10 text-primary dark:text-primary-light hover:bg-primary/20 dark:hover:bg-primary/20 transition-colors align-middle","aria-label":"Show ".concat(x," more hashtag").concat(1===x?"":"s"),children:["+ ",x," more"]})]},"pill-".concat(t)));if("hashtag"===e.type){let a=e.value.slice(1);return(0,r.jsx)(n.N_,{to:"/hashtag/".concat(encodeURIComponent(a)),className:"text-primary dark:text-primary-light hover:underline font-medium",onClick:e=>e.stopPropagation(),children:e.value},t)}if("mention"===e.type){let a=e.value.slice(1);return(0,r.jsx)(n.N_,{to:(0,s.o3)(a),className:"text-primary dark:text-primary-light hover:underline font-medium",onClick:e=>e.stopPropagation(),children:e.value},t)}if("url"===e.type){let a=e.href||e.value;return(0,r.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer nofollow",className:"text-primary dark:text-primary-light hover:underline break-all",onClick:e=>e.stopPropagation(),children:e.value},t)}return(0,r.jsx)(l.Fragment,{children:e.value},t)}),m&&o&&(0,r.jsxs)(r.Fragment,{children:[" ",(0,r.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),d(!1)},className:"text-[12px] font-semibold text-primary dark:text-primary-light hover:underline align-middle",children:"Show less"})]})]})}},62546:(e,t,a)=>{a.d(t,{A:()=>s});var r=a(95155),l=a(12115),n=a(36468);function s(e){let{captions:t,showByDefault:a=!0}=e,s=null==t?void 0:t.cues,[i,o]=(0,l.useState)(null);if((0,l.useEffect)(()=>{if(!Array.isArray(s)||!s.length)return void o(null);let e=URL.createObjectURL(new Blob([(0,n.ux)(s)],{type:"text/vtt"}));return o(e),()=>URL.revokeObjectURL(e)},[s]),!i)return null;let d=t.lang||"en";return(0,r.jsx)("track",{kind:"captions",src:i,srcLang:d,label:(0,n.Vp)(d),default:a})}},67620:(e,t,a)=>{a.d(t,{A:()=>d});var r=a(95155),l=a(12115),n=a(89715),s=a(41805),i=a(59e3),o=a(35130);function d(e){let{details:t,className:a="",tone:d="light"}=e,c=(null==t?void 0:t.transcript)||"",u=(null==t?void 0:t.audioDescription)||"",[m,x]=(0,l.useState)(null),[p,h]=(0,l.useState)(!1),g=!!window.speechSynthesis;if((0,l.useEffect)(()=>()=>{if(p)try{window.speechSynthesis.cancel()}catch(e){}},[p]),!c&&!u)return null;let f="dark"===d,b=e=>"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[12px] font-semibold transition-colors ".concat(e?"bg-primary text-white":f?"bg-white/10 text-gray-100 hover:bg-white/20":"bg-gray-100 dark:bg-white/10 text-gray-700 dark:text-gray-200 hover:bg-gray-200 dark:hover:bg-white/15");return(0,r.jsxs)("div",{className:a,children:[(0,r.jsxs)("div",{className:"flex flex-wrap gap-2",children:[c&&(0,r.jsxs)("button",{type:"button",className:b("transcript"===m),"aria-expanded":"transcript"===m,onClick:()=>x(e=>"transcript"===e?null:"transcript"),children:[(0,r.jsx)(n.A,{className:"w-3.5 h-3.5"})," Transcript"]}),u&&(0,r.jsxs)("button",{type:"button",className:b("ad"===m),"aria-expanded":"ad"===m,onClick:()=>x(e=>"ad"===e?null:"ad"),children:[(0,r.jsx)(s.A,{className:"w-3.5 h-3.5"})," Audio description"]})]}),m&&(0,r.jsxs)("div",{className:"mt-2 rounded-xl px-3 py-2.5 text-[14px] leading-relaxed whitespace-pre-line ".concat(f?"bg-white/10 text-gray-100":"bg-gray-50 dark:bg-white/5 text-gray-800 dark:text-gray-200"),children:["ad"===m&&g&&(0,r.jsx)("button",{type:"button",onClick:()=>
1{if(!g)return;if(p){window.speechSynthesis.cancel(),h(!1);return}let e=new SpeechSynthesisUtterance(u);e.onend=()=>h(!1),e.onerror=()=>h(!1),window.speechSynthesis.cancel(),window.speechSynthesis.speak(e),h(!0)},className:"mb-2 inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-primary hover:bg-primary-dark text-white text-[12px] font-semibold",children:p?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.A,{className:"w-3 h-3"})," Stop"]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.A,{className:"w-3.5 h-3.5"})," Read aloud"]})}),(0,r.jsx)("div",{className:"max-h-60 overflow-y-auto overscroll-contain",children:"transcript"===m?c:u})]})]})}},71866:(e,t,a)=>{a.d(t,{A:()=>n});var r=a(95155),l=a(12115);let n=l.memo(e=>{var t;let{hasStory:a,viewed:n,size:s=44,children:i,className:o=""}=e;if(!a)return(0,r.jsx)("div",{className:o,style:{width:s,height:s,borderRadius:"50%",overflow:"hidden"},children:i});let d=Math.max(3,Math.round(s/18)),c=Math.max(2,Math.round(s/50)),u=s-(d+c)*2;return(0,r.jsx)("div",{className:"inline-flex items-center justify-center ".concat(o," ").concat(n?"":"animate-pulse-subtle"),style:{width:s,height:s,background:n?"linear-gradient(135deg, #d1d5db, #9ca3af)":"linear-gradient(135deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5)",borderRadius:"50%",padding:d,boxSh
1adow:n?"none":"0 0 12px rgba(214, 41, 118, 0.3)"},children:(0,r.jsx)("div",{className:"bg-white dark:bg-[#18191A]",style:{width:s-2*d,height:s-2*d,borderRadius:"50%",padding:c,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,r.jsx)("div",{className:"flex items-center justify-center",style:{width:u,height:u,borderRadius:"50%",overflow:"hidden"},children:l.isValidElement(i)?l.cloneElement(i,{className:[null==(t=i.props)?void 0:t.className,"!w-full !h-full !min-w-0 !min-h-0"].filter(Boolean).join(" ")}):i})})})})},86145:(e,t,a)=>{a.d(t,{A:()=>I});var r=a(95155),l=a(12115),n=a(96175),s=a(47650),i=a(65229),o=a(34904),d=a(71629),c=a(36369),u=a(97515),m=a(90368),x=a(45345),p=a(27937),h=a(83457),g=a(5937),f=a(17181),b=a(52619),y=a.n(b),v=a(3032),w=a(76250),k=a(61101),j=a(39259),N=a(44517),C=a(62546),S=a(67620),A=a(5163),P=a(98502);let E=/\.(mp4|mov|webm|avi|mkv|m3u8|ts)(\?|$)/i,T=e=>{if("string"!=typeof e||!e)return"";try{return new URL(e,"http://_").pathname}catch(t){return e.split("?")[0]}},I=l.memo(e=>{var t,a,b,I,F,M,_;let{isOpen:D,onClose:L,post:R,initialUrl:z=null}=e,U=(e=>{if(!e)return[];if(Array.isArray(e.media)&&e.media.length>0)return e.media.filter(e=>e&&"string"==typeof e.url&&e.url.trim()).map(e=>({url:(0,j.resolveMediaUrl)(e.url),type:"video"===e.type?"video":"image"}));let t=new Set,a=[],r=(e,r)=>{if(!e||"string"!=typeof e)return;let l=(0,j.resolveMediaUrl)(e);if(t.has(l))return;t.add(l);let n=r||(E.test(l)?"video":"image");a.push({url:l,type:n})};return e.image&&r(e.image,"image"),Array.isArray(e.images)&&e.images.forEach(e=>r(e)),e.video&&r(e.video,"video"),a})(R),[B,O]=(0,l.useState)(0),[H,W]=(0,l.useState)(!1),[K,V]=(0,l.useState)((null==R?void 0:R.isLiked)||!1),[q,Y]=(0,l.useState)(null!=(F=null==R?void 0:R.likes)?F:0),[G,Z]=(0,l.useState)(!1),[$,Q]=(0,l.useState)(!1),[J,X]=(0,l.useState)(null!=(_=null!=(M=null==R?void 0:R.commentsCount)?M:null==R?void 0:R.comments)?_:0),[ee,et]=(0,l.useState)(!1),[ea,er]=(0,l.useState)(1),[el,en]=(0,l.useState)(!0);(0,l.useEffect)(()=>{if(R){var e,t,a;V(R.isLiked||!1),Y(null!=(e=R.likes)?e:0),X(null!=(a=null!=(t=R.commentsCount)?t:R.comments)?a:0),O(0),Q(!1),et(!1),er(1)}},[null==R?void 0:R.id]),(0,l.useEffect)(()=>{if(!D)return;if(!z)return void O(0);let e=(0,j.resolveMediaUrl)(z),t=U.findIndex(t=>t.url===e);if(t<0){let a=T(e);a&&(t=U.findIndex(e=>T(e.url)===a))}O(t>=0?t:0)},[D,z]),(0,l.useEffect)(()=>{er(1)},[B]),(0,l.useEffect)(()=>{if(D)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[D]),(0,l.useEffect)(()=>{if(!D)return;let e=e=>{ee||("Escape"===e.key&&L(),"ArrowLeft"===e.key&&O(e=>Math.max(0,e-1)),"ArrowRight"===e.key&&O(e=>Math.min(U.length-1,e+1)))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[D,U.length,L,ee]);let es=(0,l.useCallback)(async e=>{if(e.stopPropagation(),!G&&(null==R?void 0:R.id)){Z(!0),V(!K),Y(e=>e+(K?-1:1));try{await (0,j.likePostAPI)(R.id)}catch(e){V(K),Y(e=>e+(K?1:-1)),N.default.error("Failed to like photo")}finally{Z(!1)}}},[G,K,null==R?void 0:R.id]),ei=(0,l.useCallback)(e=>{e.stopPropagation(),Q(e=>!e)},[]),eo=(0,l.useCallback)(e=>{e.stopPropagation(),et(!0)},[]),ed=(0,l.useCallback)(e=>{e.target===e.currentTarget&&L()},[L]),ec=(0,l.useCallback)(e=>{e.stopPropagation()},[]);if(!D||!R||0===U.length)return null;let eu=Math.min(B,U.length-1),em=U[eu]||U[0],ex=em.url,ep="video"===em.type,eh=U.length>1,eg=(0,A.S5)(R,em.url),ef=ep?[]:(0,A.PT)(R,em.url),eb=!ep&&(null==eg?void 0:eg.caption)||"",ey=ep?R.image?(0,j.resolveMediaUrl)(R.image):null:em.url,ev={id:R.id,image:ey,content:R.content||"",author:R.author||R.user},ew=(null==(t=R.author)?void 0:t.name)||(null==(a=R.user)?void 0:a.name)||"User",ek=(null==(b=R.author)?void 0:b.avatar)||(null==(I=R.user)?void 0:I.avatar),ej=(0,r.jsxs)("div",{className:"fixed inset-0 z-[9999] flex bg-black/95 animate-in fade-in duration-200",role:"dialog","aria-modal":"true",onClick:ed,children:[(0,r.jsxs)("div",{className:"flex-1 relative flex items-center justify-center min-w-0 overflow-hidden",onClick:ed,children:[(0,r.jsxs)("div",{className:"absolute top-4 left-4 z-10 flex items-center gap-2",onClick:ec,children:[(0,r.jsx)("button",{onClick:L,className:"p-2.5 rounded-full bg-white/10 hover:bg-white/25 text-white transition-colors backdrop-blur-sm","aria-label":"Close",children:(0,r.jsx)(i.A,{className:"w-5 h-5"})}),(0,r.jsx)("button",{onClick:()=>er(e=>Math.min(e+.1,4)),className:"p-2.5 rounded-full bg-white/10 hover:bg-white/25 text-white transition-colors backdrop-blur-sm","aria-label":"Zoom in",title:"Zoom in",children:(0,r.jsx)(o.A,{className:"w-5 h-5"})}),(0,r.jsx)("button",{onClick:()=>er(e=>Math.max(e-.1,.5)),className:"p-2.5 rounded-full bg-white/10 hover:bg-white/25 text-white transition-colors backdrop-blur-sm","aria-label":"Zoom out",title:"Zoom out",children:(0,r.jsx)(d.A,{className:"w-5 h-5"})}),1!==ea&&(0,r.jsxs)("span",{className:"text-white/70 text-xs font-medium bg-black/40 px-2 py-1 rounded-full",children:[Math.round(100*ea),"%"]})]}),(0,r.jsx)("div",{className:"absolute top-4 right-4 z-10 hidden md:block",onClick:ec,children:(0,r.jsx)("button",{onClick:()=>en(e=>!e),className:"p-2.5 rounded-full bg-white/10 hover:bg-white/25 text-white transition-colors backdrop-blur-sm","aria-label":el?"Hide sidebar":"Show sidebar",title:el?"Hide sidebar":"Show sidebar",children:el?(0,r.jsx)(c.A,{className:"w-5 h-5"}):(0,r.jsx)(u.A,{className:"w-5 h-5"})})}),eh&&eu>0&&(0,r.jsx)("button",{onClick:e=>{e.stopPropagation(),O(e=>Math.max(0,e-1))},className:"absolute left-4 z-10 p-3 rounded-full bg-white/10 hover:bg-white/25 text-white transition-colors backdrop-blur-sm","aria-label":"Previous",children:(0,r.jsx)(m.A,{className:"w-7 h-7"})}
1),ep?(0,r.jsx)("video",{src:ex,controls:!0,autoPlay:!0,playsInline:!0,preload:"metadata",className:"max-h-[96vh] max-w-full select-none bg-black",onClick:ec,children:(0,r.jsx)(C.A,{captions:null==eg?void 0:eg.captions})},ex):(0,r.jsxs)("div",{className:"group relative inline-block max-h-[96vh] max-w-full transition-transform duration-200",style:{transform:"scale(".concat(ea,")"),cursor:ea>1?"grab":"default"},onClick:ec,children:[(0,r.jsx)("img",{src:ex,alt:(null==eg?void 0:eg.altText)||"Post media ".concat(eu+1),className:"block max-h-[96vh] max-w-full object-contain select-none",draggable:!1}),ef.map(e=>(0,r.jsxs)(y(),{href:(0,P.DW)({id:e.userId,username:e.username}),onClick:L,className:"absolute -translate-x-1/2 flex flex-col items-center transition-opacity ".concat(H?"opacity-100":"opacity-0 group-hover:opacity-100"),style:{left:"".concat(100*e.x,"%"),top:"".concat(100*e.y,"%")},children:[(0,r.jsx)("span",{className:"w-0 h-0 border-x-[6px] border-x-transparent border-b-[6px] border-b-black/80"}),(0,r.jsx)("span",{className:"px-2 py-0.5 rounded-md bg-black/80 hover:bg-black text-white text-[13px] font-semibold whitespace-nowrap",children:e.name})]},e.userId))]}),ef.length>0&&(0,r.jsxs)("button",{type:"button",onClick:e=>{e.stopPropagation(),W(e=>!e)},"aria-pressed":H,className:"absolute bottom-4 left-4 z-10 inline-flex items-center gap-1.5 px-3 py-2 rounded-full text-sm font-semibold backdrop-blur-sm transition-colors ".concat(H?"bg-white text-gray-900":"bg-white/10 hover:bg-white/25 text-white"),children:[(0,r.jsx)(x.A,{className:"w-4 h-4"})," ",1===ef.length?ef[0].name:"".concat(ef.length," people")]}),eb&&(0,r.jsx)("p",{className:"md:hidden absolute inset-x-4 bottom-16 z-10 text-center text-white text-[15px] leading-snug whitespace-pre-line bg-black/60 rounded-xl px-3 py-2 max-h-40 overflow-y-auto",onClick:ec,children:eb}),ep&&eg&&(0,r.jsx)("div",{className:"md:hidden absolute inset-x-4 top-16 z-10",onClick:ec,children:(0,r.jsx)(S.A,{details:eg,tone:"dark"})}),eh&&eu<U.length-1&&(0,r.jsx)("button",{onClick:e=>{e.stopPropagation(),O(e=>Math.min(U.length-1,e+1))},className:"absolute right-4 z-10 p-3 rounded-full bg-white/10 hover:bg-white/25 text-white transition-colors backdrop-blur-sm","aria-label":"Next",children:(0,r.jsx)(p.A,{className:"w-7 h-7"})}),eh&&(0,r.jsxs)("span",{className:"absolute top-4 left-1/2 -translate-x-1/2 bg-black/60 text-white text-sm font-medium px-4 py-1.5 rounded-full backdrop-blur-sm",children:[eu+1," / ",U.length]})]}),el&&(0,r.jsxs)("div",{className:"hidden md:flex w-[360px] lg:w-[400px] flex-col bg-white dark:bg-[#242526] border-l border-gray-200 dark:border-gray-700 h-full animate-in slide-in-from-right duration-200",onClick:ec,children:[(0,r.jsxs)("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700 flex items-center gap-3",children:[(0,r.jsx)("div",{className:"relative w-10 h-10 rounded-full bg-gray-300 overflow-hidden flex-shrink-0",children:ek&&(0,r.jsx)(n.A,{src:ek,alt:"",fill:!0,sizes:"40px",className:"object-cover"})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("p",{className:"font-semibold text-gray-900 dark:text-white text-sm truncate",children:ew}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"This photo is from a post"})]}),(0,r.jsx)("button",{onClick:()=>en(!1),className:"ml-auto p-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-full",title:"Close sidebar",children:(0,r.jsx)(c.A,{className:"w-4 h-4 text-gray-500"})})]}),R.content&&(0,r.jsx)("div",{className:"px-4 py-3 border-b border-gray-100 dark:border-gray-700",children:(0,r.jsx)("p",{className:"text-sm text-gray-800 dark:text-gray-200 line-clamp-4",children:R.content})}),(eb||ep&&eg)&&(0,r.jsxs)("div",{className:"px-4 py-3 border-b border-gray-100 dark:border-gray-700 space-y-2",children:[eb&&(0,r.jsx)("p",{className:"text-[15px] text-gray-900 dark:text-gray-100 whitespace-pre-line",children:eb}),ep&&eg&&(0,r.jsx)(S.A,{details:eg})]}),(0,r.jsxs)("div",{className:"px-4 py-2 flex items-center justify-between text-xs text-gray-500 border-b border-gray-100 dark:border-gray-700",children:[(0,r.jsx)("span",{children:q>0?"".concat(q," likes"):""}),(0,r.jsx)("span",{children:J>0?"".concat(J," comments"):""})]}),(0,r.jsxs)("div",{className:"flex items-center border-b border-gray-200 dark:border-gray-700",children:[(0,r.jsxs)("button",{onClick:es,disabled:G,className:"flex-1 flex items-center justify-center gap-2 py-2.5 text-sm font-semibold transition-colors ".concat(K?"text-primary":"text-gray-600 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-white/5"),children:[(0,r.jsx)(h.A,{className:"w-5 h-5 ".concat(K?"fill-current":"")}),"Like"]}),(0,r.jsxs)("button",{onClick:ei,className:"flex-1 flex items-center justify-center gap-2 py-2.5 text-sm font-semibold text-gray-600 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-white/5 transition-colors",children:[(0,r.jsx)(g.A,{className:"w-5 h-5"}),"Comment"]}),(0,r.jsxs)("button",{onClick:eo,className:"flex-1 flex items-center justify-center gap-2 py-2.5 text-sm font-semibold text-gray-600 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-white/5 transition-colors",children:[(0,r.jsx)(f.A,{className:"w-5 h-5"}),"Share"]})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar",children:(0,r.jsx)(v.A,{postId:R.id})}),R.commentsMuted||R.commentsDisabled?(0,r.jsx)("div",{className:"border-t border-gray-200 dark:border-gray-700 px-4 py-3 text-center text-[13px] text-gray-500 dark:text-gray-400",children:"Comments are turned off for this post"}):(0,r.jsx)("div",{className:"border-t border-gray-200 dark:border-gray-700",children:(0,r.jsx)(w.A,{postId:R.id,onCommentAdded:()=>X(e=>e+1)})})]}),(0,r.jsx)("div",{className:"md:hidden fixed bottom-0 left-0 right-0 bg-[#242526] px-4 py-3 z-10",onClick:ec,children:(0,r.jsxs)("div",{className:"flex items-center justify-center gap-8",children:[(0,r.jsxs)("button",{onClick:es,disabled:G,className:"flex items-center gap-2 font-semibold ".concat(K?"text-red-500":"text-white"),children:[(0,r.jsx)(h.A,{className:"w-5 h-5 ".concat(K?"fill-current":"")}),(0,r.jsx)("span",{className:"text-sm",children:q>0?q:"Like"})]}),(0,r.jsxs)("button",{onClick:ei,className:"flex items-center gap-2 font-semibold text-white",children:[(0,r.jsx)(g.A,{className:"w-5 h-5"}),(0,r.jsx)("span",{className:"text-sm",children:J>0?J:"Comment"})]}),(0,r.jsxs)("button",{onClick:eo,className:"flex items-center gap-2 font-semibold text-white",children:[(0,r.jsx)(f.A,{className:"w-5 h-5"}),(0,r.jsx)("span",{className:"text-sm",children:"Share"})]})]})})]});return(0,r.jsxs)(r.Fragment,{children:[(0,s.createPortal)(ej,document.body),(0,r.jsx)(k.default,{isOpen:ee,onClose:()=>et(!1),post:ev,onShareComplete:()=>et(!1)})]})})},95019:(e,t,a)=>{a.d(t,{Ay:()=>f,nM:()=>x,x1:()=>g});var r=a(95155),l=a(12115),n=a(1213),s=a(25276),i=a(24033),o=a(65229),d=a(6191),c=a(98589),u=a(27483),m=a(75662);let x=[{type:"like",emoji:"\uD83D\uDC4D",label:"Like",labelKey:"like",colour:"text-primary"},{type:"love",emoji:"â¤ï¸",label:"Love",labelKey:"love",colour:"text-rose-500"},{type:"haha",emoji:"\uD83D\uDE06",label:"Haha",labelKey:"haha",colour:"text-yellow-500"},{type:"wow",emoji:"\uD83D\uDE2E",label:"Wow",labelKey:"wow",colour:"text-yellow-500"},{type:"sad",emoji:"\uD83D\uDE22",label:"Sad",labelKey:"sad",colour:"text-yellow-500"},{type:"angry",emoji:"\uD83D\uDE21",label:"Angry",labelKey:"angry",colour:"text-orange-500"},{type:"care",emoji:"\uD83E\uDD70",label:"Care",labelKey:"care",colour:"text-rose-400"},{type:"heart_eyes",emoji:"\uD83D\uDE0D",label:"Adore",labelKey:"adore",colour:"text-rose-500"},{type:"starstruck",emoji:"\uD83E\uDD29",label:"Star-struck",labelKey:"starstruck",colour:"text-yellow-500"},{type:"kiss",emoji:"\uD83D\uDE18",label:"Kiss",labelKey:"kiss",colour:"text-pink-500"},{type:"joy",emoji:"\uD83D\uDE02",label:"Joy",labelKey:"joy",colour:"text-yellow-500"},{type:"rofl",emoji:"\uD83E\uDD23",label:"ROFL",labelKey:"rofl",colour:"text-yellow-500"},{type:"fire",emoji:"\uD83D\uDD25",label:"Fire",labelKey:"fire",colour:"text-orange-500"},{type:"hundred",emoji:"\uD83D\uDCAF",label:"Hundred",labelKey:"hundred",colour:"text-red-500"},{type:"party",emoji:"\uD83C\uDF89",label:"Party",labelKey:"party",colour:"text-pink-500"},{type:"clap",emoji:"\uD83D\uDC4F",label:"Clap",labelKey:"clap",colour:"text-amber-500"},{type:"praise",emoji:"\uD83D\uDE4C",label:"Praise",labelKey:"praise",colour:"text-amber-500"},{type:"muscle",emoji:"\uD83D\uDCAA",label:"Strong",labelKey:"strong",colour:"text-amber-600"},{type:"cool",emoji:"\uD83D\uDE0E",label:"Cool",labelKey:"cool",colour:"text-primary"},{type:"thinking",emoji:"\uD83E\uDD14",label:"Hmm",labelKey:"hmm",colour:"text-yellow-600"},{type:"eye_roll",emoji:"\uD83D\uDE44",label:"Eye-roll",labelKey:"eyeRoll",colour:"text-gray-500"},{type:"mind_blown",emoji:"\uD83E\uDD2F",label:"Mind blown",labelKey:"mindBlown",colour:"text-yellow-500"},{type:"pleading",emoji:"\uD83E\uDD7A",label:"Pleading",labelKey:"pleading",colour:"text-rose-400"},{type:"handshake",emoji:"\uD83E\uDD1D",label:"Agree",labelKey:"agree",colour:"text-amber-700"}],p=x.slice(0,6),h=x.slice(6),g=Object.fromEntries(x.map(e=>[e.type,e])),f=e=>{let{targetType:t="post",targetId:a,postId:x,isLiked:f=!1,userReactionType:b=null,variant:y="bar",count:v=null}=e,w=(0,n.wA)(),{t:k}=(0,m.Bd)(),{user:j}=(0,n.d4)(e=>e.auth),{requireAuth:N}=(0,u.N)(),C=t||"post",S=a||x,A=(0,n.d4)(e=>{let t=(0,c.yO)(e,C,S,null==j?void 0:j.id);return t||("post"===C?(0,c.rP)(e,S,null==j?void 0:j.id):null)})||b||(f?"like":null),P=!!A,E=g[A]||g.like,[T,I]=(0,l.useState)(!1),[F,M]=(0,l.useState)(!1),_=(0,l.useRef)(null),D=(0,l.useRef)(null),L=(0,l.useRef)(!1),R=(0,l.useRef)(!1);(0,l.useEffect)(()=>()=>{_.current&&clearTimeout(_.current),D.current&&clearTimeout(D.current),V.current&&clearTimeout(V.current)},[]);let z=(0,l.useCallback)(()=>{_.current&&(clearTimeout(_.current),_.current=null)},[]),U=(0,l.useCallback)(()=>{z(),_.current=setTimeout(()=>{I(!1),M(!1)},200)},[z]),B=(0,l.useCallback)(async e=>{if(!N()||!S||R.current)return;R.current=!0;let t=(null==j?void 0:j.id)||"guest";A===e?w((0,c.S9)({postId:S,targetType:C,targetId:S,userId:t})):w((0,c.mQ)({postId:S,targetType:C,targetId:S,userId:t,type:e})),I(!1),M(!1);try{await w((0,c.Qw)({postId:"post"===C?S:void 0,targetType:C,targetId:S,reactionType:e})).unwrap()}catch(e){A?w((0,c.mQ)({postId:S,targetType:C,targetId:S,userId:t,type:A})):w((0,c.S9)({postId:S,targetType:C,targetId:S,userId:t}))}finally{R.current=!1}},[A,w,N,S,C,null==j?void 0:j.id]),O=(0,l.useCallback)(()=>
1{if(L.current){L.current=!1;return}P?B(A):B("like")},[B,A,P]),H=(0,l.useCallback)(()=>{L.current=!1,D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{L.current=!0,I(!0)},350)},[]),W=(0,l.useCallback)(()=>{D.current&&(clearTimeout(D.current),D.current=null)},[]),K=(0,l.useCallback)(()=>{z(),I(e=>!e)},[z]),V=(0,l.useRef)(null),q=(0,l.useCallback)(()=>{z(),V.current&&clearTimeout(V.current),V.current=setTimeout(()=>I(!0),350)},[z]),Y=(0,l.useCallback)(()=>{V.current&&(clearTimeout(V.current),V.current=null),U()},[U]),G="icon"===y,Z="count"===y,$=G||Z;return(0,r.jsxs)("div",{className:"relative flex items-center ".concat($?"":"flex-1"),onMouseEnter:q,onMouseLeave:Y,children:[(0,r.jsxs)("button",{type:"button",onClick:O,onTouchStart:H,onTouchEnd:W,onTouchCancel:W,className:G?"w-9 h-9 grid place-items-center rounded-full transition-colors ".concat(P?"bg-primary text-white":"bg-gray-100 dark:bg-white/10 text-gray-600 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-white/20"):Z?"flex items-center gap-1.5 px-2 py-1.5 rounded-lg transition-colors hover:bg-gray-100 dark:hover:bg-white/10 ".concat(P?E.colour:"text-[#65676B] dark:text-[#B0B3B8]"):"flex-1 flex items-center justify-center gap-1.5 py-1.5 pl-2 pr-1 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-l-md transition-colors ".concat(P?E.colour:"text-gray-600 dark:text-gray-300"),"aria-pressed":P,"aria-label":P?k("post.reactions.reactedAria","{{label}} â tap to remove",{label:k("post.reactions.".concat(E.labelKey),E.label)}):k("common.like"),children:[P?(0,r.jsx)("span",{className:Z?"text-[19px] leading-none":"text-lg leading-none","aria-hidden":"true",children:E.emoji}):(0,r.jsx)(s.A,{className:$?"w-5 h-5":"w-5 h-5 text-gray-600 dark:text-gray-300"}),Z&&(0,r.jsx)("span",{className:"text-[15px] font-medium tabular-nums",children:null!=v?v:0}),!$&&(0,r.jsx)("span",{className:"font-medium",children:P?k("post.reactions.".concat(E.labelKey),E.label):k("common.like")})]}),!$&&(0,r.jsx)("button",{type:"button",onClick:K,className:"px-1.5 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-r-md transition-colors text-gray-500 dark:text-gray-400 ".concat(T?"bg-gray-100 dark:bg-gray-800":""),"aria-label":k("post.reactions.more","More reactions"),"aria-haspopup":"menu","aria-expanded":T,title:k("post.reactions.more","More reactions"),children:(0,r.jsx)(i.A,{className:"w-3.5 h-3.5"})}),T&&(0,r.jsxs)("div",{role:"menu","aria-label":k("post.reactions.pickAria","Pick a reaction"),onMouseEnter:z,onMouseLeave:U,className:"absolute bottom-full left-0 mb-2 z-30 px-2 py-1.5 bg-white dark:bg-gray-900 shadow-xl ring-1 ring-black/5 dark:ring-white/10 ".concat(F?"rounded-2xl":"rounded-full"),children:[(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[p.map(e=>{let t=A===e.type,a=k("post.reactions.".concat(e.labelKey),e.label);return(0,r.jsx)("button",{type:"button",role:"menuitemradio",title:a,"aria-label":a,"aria-checked":t,onClick:t=>{t.stopPropagation(),B(e.type)},className:"w-9 h-9 sm:w-10 sm:h-10 rounded-full flex items-center justify-center text-2xl transition-transform duration-150 hover:rotate-3 hover:-translate-y-0.5 hover:scale-110 focus:outline-none focus:ring-2 focus:ring-primary ".concat(t?"bg-primary/10 dark:bg-primary-dark/30":""),children:(0,r.jsx)("span",{"aria-hidden":"true",children:e.emoji})},e.type)}),(0,r.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),M(e=>!e)},"aria-label":F?k("post.reactions.showFewer","Show fewer reactions"):k("post.reactions.showMore","Show more reactions"),"aria-expanded":F,title:F?k("post.reactions.showFewerShort","Show fewer"):k("post.reactions.more","More reactions"),className:"w-9 h-9 sm:w-10 sm:h-10 rounded-full flex items-center justify-center transition-colors focus:outline-none focus:ring-2 focus:ring-primary ".concat(F?"bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-200":"bg-gray-100 dark:bg-gray-800 text-gray-500 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700"),children:F?(0,r.jsx)(o.A,{className:"w-4 h-4"}):(0,r.jsx)(d.A,{className:"w-4 h-4"})})]}),F&&(0,r.jsx)("div",{className:"grid grid-cols-6 gap-1 mt-1.5 pt-1.5 border-t border-gray-100 dark:border-gray-700/50 w-full place-items-center",children:h.map(e=>{let t=A===e.type,a=k("post.reactions.".concat(e.labelKey),e.label);return(0,r.jsx)("button",{type:"button",role:"menuitemradio",title:a,"aria-label":a,"aria-checked":t,onClick:t=>{t.stopPropagation(),B(e.type)},className:"w-9 h-9 sm:w-10 sm:h-10 rounded-full flex items-center justify-center text-2xl transition-transform duration-150 hover:rotate-3 hover:-translate-y-0.5 hover:scale-110 focus:outline-none focus:ring-2 focus:ring-primary ".concat(t?"bg-primary/10 dark:bg-primary-dark/30":""),children:(0,r.jsx)("span",{"aria-hidden":"true",children:e.emoji})},e.type)})})]})]})}}}]);
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.