1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,582705,203933,e=>{"use strict";let t;var r=e.i(843476),n=e.i(271645),a=e.i(494913),s=e.i(975558),l=e.i(425063),o=e.i(778917),i=e.i(686311),d=e.i(916371),c=e.i(548106),u=e.i(572377),m=e.i(647163);function p({iconUrl:e,className:t="h-8 w-8"}){let n=(0,r.jsx)("div",{className:(0,m.cn)(t,"shrink-0 flex items-center justify-center squircle bg-[#FF4500]"),children:(0,r.jsx)(u.RedditGlyph,{className:"size-[62%] text-white"})});return e?(0,r.jsx)(c.SafeImage,{src:e,alt:"",className:(0,m.cn)(t,"shrink-0 squircle object-cover avatar-border"),fallback:n}):n}e.s(["SubredditAvatar",0,p],203933);var h=e.i(845157),x=e.i(146183),f=e.i(428605),g=e.i(327147),b=e.i(609216);async function j(){if(void 0!==t)return t;try{t=(await (0,h.fetchRedditIdentity)()).username}catch{t=null}return t}function y({username:e,className:t}){let n=(0,x.normalizeRedditUsername)(e);return!n||n.startsWith("[")?(0,r.jsxs)("span",{className:t,children:["u/",e]}):(0,r.jsxs)("a",{href:`https://www.reddit.com/user/${encodeURIComponent(n)}/`,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),title:`Open u/${n} on Reddit`,className:(0,m.cn)("hover:text-foreground hover:underline",t),children:["u/",e]})}function w(e){return e>=1e6?`${(e/1e6).toFixed(1).replace(/\.0$/,"")}m`:e>=1e3?`${(e/1e3).toFixed(1).replace(/\.0$/,"")}k`:String(e)}function N(e){let t=e instanceof Error?e.message:String(e);return/timed out|No response|extension_reloaded/i.test(t)?"Reddit actions need the Everything extension (recent build). Check Settings â Integrations â Reddit.":/not signed in/i.test(t)?"Sign in to Reddit in this browser first: Settings â Integrations â Reddit.":t}e.s(["RedditPostCard",0,function({post:e,iconUrl:t,authorSlot:u,interactive:x=!1}){let[v,k]=(0,n.useState)(0),[_,S]=(0,n.useState)(!1),[C,R]=(0,n.useState)(!1),[U,P]=(0,n.useState)(!1),[$,T]=(0,n.useState)(!1),[I,O]=(0,n.useState)(null),[A,F]=(0,n.useState)(!1),[z,E]=(0,n.useState)(null),[M,L]=(0,n.useState)([]),[q,D]=(0,n.useState)(!1),[X,B]=(0,n.useState)(null),J=(0,f.decodeHtmlEntities)(e.selftext),V=J.length>400,H=V&&!U?`${J.slice(0,400).trimEnd()}â¦`:J;async function K(t){let r=v===t?0:t;S(!0),O(null);try{let t=await (0,h.voteOnReddit)(`t3_${e.id}`,r);if(!t.ok)throw Error(t.error||"Vote failed");k(r)}catch(e){O(N(e))}finally{S(!1)}}async function W(t,r){let n=[t.trim(),...r].filter(Boolean).join("\n").trim();if(n){O(null);try{let t=await (0,h.replyToReddit)(`t3_${e.id}`,n);if(!t.ok)throw Error(t.error||"Reply failed");T(!0),R(!1),await Q(n,null,t.thingId??null)}catch(e){O(`${N(e)} 2 3Your reply: ${n}`),R(!1)}}}async function Y(t){if(null===z&&!q){D(!0),O(null);try{let t=await (0,h.fetchPostComments)(e.id,60);E(t.comments)}catch(e){O(N(e)),t&&F(!1)}finally{D(!1)}}}async function Z(){let e=!A;F(e),e&&await Y(!0)}async function G(e,t,r){let n=[t.trim(),...r].filter(Boolean).join("\n").trim();if(n){O(null);try{let t=await (0,h.replyToReddit)(e,n);if(!t.ok)throw Error(t.error||"Reply failed");B(null),await Q(n,e,t.thingId??null)}catch(e){O(`${N(e)} 4 5Your reply: ${n}`),B(null)}}}async function Q(t,r,n){let a=await j()??"you";L(s=>[...s,{id:(n??`local-${Date.now()}`).replace(/^t1_/,""),author:a,body:t,score:1,createdAt:new Date().toISOString(),permalink:e.permalink,depth:0,parentId:r}]),F(!0),Y(!1)}let ee=(()=>{let e=z??[],t=new Set(e.map(e=>e.id)),r=M.filter(e=>!t.has(e.id)),n=[...r.filter(e=>null===e.parentId).map(e=>({...e,depth:0}))];for(let t of e)for(let e of(n.push(t),r))e.parentId===`t1_${t.id}`&&n.push({...e,depth:Math.min(t.depth+1,6)});let a=new Set(n.map(e=>e.id));for(let e of r)a.has(e.id)||n.push({...e,depth:0});return n})(),et=e.score+v;return(0,r.jsxs)("article",{className:"rounded-2xl border border-border bg-card p-4 sm:p-5",children:[(0,r.jsxs)("header",{className:"flex items-start gap-3",children:[(0,r.jsx)(p,{iconUrl:t,className:"h-8 w-8"}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs",children:[(0,r.jsxs)("a",{href:`https://www.reddit.com/r/${e.subreddit}/`,target:"_blank",rel:"noopener noreferrer",className:"font-semibold text-foreground hover:underline",children:["r/",e.subreddit]}),(0,r.jsx)("span",{className:"text-muted-foreground",children:"·"}),(0,r.jsx)("span",{className:"text-muted-foreground",children:(0,a.formatDistanceToNow)(new Date(e.createdAt),{addSuffix:!0})})]}),(0,r.jsxs)("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-muted-foreground",children:[(0,r.jsx)(y,{username:e.author,className:"truncate"}),u]})]}),(0,r.jsx)("a",{href:e.permalink,target:"_blank",rel:"noopener noreferrer",className:"shrink-0 rounded-full p-1.5 text-muted-foreground hover:bg-accent hover:text-foreground",title:"Open on Reddit",children:(0,r.jsx)(o.Exter
5nalLink,{className:"h-3.5 w-3.5"})})]}),(0,r.jsx)("a",{href:e.permalink,target:"_blank",rel:"noopener noreferrer",className:"mt-3 block text-[15px] font-semibold leading-snug text-foreground hover:underline",children:e.title}),(0,r.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[e.flair&&(0,r.jsx)("span",{className:"inline-block rounded-full border border-border px-2 py-0.5 text-[11px] text-muted-foreground",children:e.flair}),e.crosspostFrom&&(0,r.jsxs)("span",{className:"inline-block rounded-full border border-border px-2 py-0.5 text-[11px] text-muted-foreground",children:["Crossposted from r/",e.crosspostFrom]})]}),H&&(0,r.jsxs)("p",{className:"mt-2 whitespace-pre-wrap text-sm leading-relaxed text-muted-foreground",children:[H,V&&!U&&(0,r.jsx)("button",{type:"button",onClick:()=>P(!0),className:"ml-1 font-medium text-foreground hover:underline",children:"see more"})]}),e.videoUrl&&(0,r.jsx)(b.VideoPlayer,{src:e.videoUrl,poster:e.videoPosterUrl??void 0,muted:!0,preload:"none",className:"mt-3 block w-full rounded-xl border border-border",videoClassName:"max-h-[420px] w-full object-contain"}),!e.videoUrl&&e.imageUrls.length>0&&(0,r.jsxs)("div",{className:(0,m.cn)("mt-3 gap-1.5",1===e.imageUrls.length?"block":"grid grid-cols-2"),children:[e.imageUrls.slice(0,4).map(t=>(0,r.jsx)(c.SafeImage,{src:t,alt:"",className:(0,m.cn)("w-full rounded-xl border border-border object-cover",1===e.imageUrls.length?"max-h-[420px]":"h-40"),fallback:(0,r.jsx)(r.Fragment,{})},t)),e.imageUrls.length>4&&(0,r.jsxs)("a",{href:e.permalink,target:"_blank",rel:"noopener noreferrer",className:"col-span-2 rounded-xl border border-border px-3 py-2 text-center text-xs text-muted-foreground hover:bg-accent",children:["+",e.imageUrls.length-4," more on Reddit"]})]}),e.linkUrl&&!e.imageUrl&&!e.videoUrl&&(0,r.jsxs)("a",{href:e.linkUrl,target:"_blank",rel:"noopener noreferrer",className:"mt-3 flex items-center gap-2 rounded-xl border border-border px-3 py-2 text-xs text-muted-foreground hover:bg-accent",children:[(0,r.jsx)(o.ExternalLink,{className:"h-3.5 w-3.5 shrink-0"}),(0,r.jsx)("span",{className:"truncate",children:e.linkUrl.replace(/^https?:\/\/(www\.)?/,"")})]}),(0,r.jsxs)("footer",{className:"mt-3 flex items-center gap-3 text-xs text-muted-foreground",children:[x?(0,r.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,r.jsx)("button",{type:"button",onClick:()=>void K(1),disabled:_,"aria-label":"Upvote",className:(0,m.cn)("rounded-full p-1 hover:bg-accent hover:text-foreground",1===v&&"text-[#FF4500]"),children:(0,r.jsx)(s.ArrowUp,{className:"h-3.5 w-3.5"})}),(0,r.jsx)("span",{className:(0,m.cn)("min-w-6 text-center",0!==v&&"text-foreground"),children:w(et)}),(0,r.jsx)("button",{type:"button",onClick:()=>void K(-1),disabled:_,"aria-label":"Downvote",className:(0,m.cn)("rounded-full p-1 hover:bg-accent hover:text-foreground",-1===v&&"text-[#7193FF]"),children:(0,r.jsx)(l.ArrowDown,{className:"h-3.5 w-3.5"})})]}):(0,r.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,r.jsx)(s.ArrowUp,{className:"h-3.5 w-3.5"}),w(e.score)]}),x?(0,r.jsxs)("button",{type:"button",onClick:()=>void Z(),"aria-expanded":A,className:(0,m.cn)("inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 hover:bg-accent hover:text-foreground",A&&"text-foreground"),children:[q?(0,r.jsx)(g.ButtonSpinner,{}):(0,r.jsx)(i.MessageSquare,{className:"h-3.5 w-3.5"}),(0,r.jsx)(g.ShimmerLabel,{active:q,children:w(e.numComments+M.length)})]}):(0,r.jsxs)("a",{href:e.permalink,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 hover:text-foreground",children:[(0,r.jsx)(i.MessageSquare,{className:"h-3.5 w-3.5"}),w(e.numComments)]}),x&&(0,r.jsx)("button",{type:"button",onClick:()=>R(e=>!e),className:"ml-auto rounded-full px-2 py-1 font-medium hover:bg-accent hover:text-foreground",children:$?"Replied":"Reply"})]}),C&&(0,r.jsx)("div",{className:"mt-3",children:(0,r.jsx)(d.CommentComposer,{placeholder:`Reply to u/${e.author}â¦`,submitLabel:"Reply",autoFocus:!0,onCancel:()=>R(!1),disableMentions:!0,onSubmit:async({body:e,attachments:t})=>{await W(e,t.map(e=>e.url).filter(e=>!!e))}})}),A&&(0,r.jsx)("div",{className:"mt-3 space-y-2 border-t border-border pt-3",children:q?(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"Loading commentsâ¦"}):0===ee.length?(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"No comments yet."}):ee.map(e=>(0,r.jsxs)("div",{style:{marginLeft:14*Math.min(e.depth,6)},className:"rounded-xl bg-muted/40 px-3 py-2",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 text-[11px] text-muted-foreground",children:[(0,r.jsx)(y,{username:e.author,className:"font-medium text-foreground"}),(0,r.jsx)("span",{children:"·"}),(0,r.jsx)("span",{children:(0,a.formatDistanceToNow)(new Date(e.createdAt),{addSuffix:!0})}),(0,r.jsxs)("span",{className:"inline-flex items-center gap-0.5",children:[(0,r.jsx)(s.ArrowUp,{className:"h-3 w-3"}),w(e.score)]}),x&&(0,r.jsx)("button",{type:"button",onClick:()=>B(X===`t1_${e.id}`?null:`t1_${e.id}`),className:"ml-auto font-medium hover:text-foreground",children:"Reply"})]}),(0,r.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm leading-relaxed",children:(0,f.decodeHtmlEntities)(e.body)}),X===`t1_${e.id}
5`&&(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsx)(d.CommentComposer,{placeholder:`Reply to u/${e.author}â¦`,submitLabel:"Reply",autoFocus:!0,onCancel:()=>B(null),disableMentions:!0,onSubmit:async({body:t,attachments:r})=>{await G(`t1_${e.id}`,t,r.map(e=>e.url).filter(e=>!!e))}})})]},e.id))}),I&&(0,r.jsx)("p",{className:"mt-2 whitespace-pre-wrap text-xs text-amber-600 dark:text-amber-500",children:I})]})}],582705)},589917,e=>{"use strict";var t=e.i(843476),r=e.i(115057),n=e.i(572377),a=e.i(647163);e.s(["PlatformLinkPill",0,function({platform:e,href:s,surface:l="white"}){let o="x"===e?n.XSquircle:n.LinkedInSquircle,i="x"===e?"Open on X":"Open on LinkedIn",d=(0,t.jsxs)("span",{className:(0,a.cn)("inline-flex items-center gap-1.5 rounded-full sq-capsule px-2 py-1.5 shrink-0 transition-colors","white"===l?"bg-[#FAF9F5] hover:bg-[#F0EEE6] dark:bg-white/10 dark:hover:bg-white/15":"bg-white hover:bg-white/80 dark:bg-white/10 dark:hover:bg-white/15"),children:[(0,t.jsx)(o,{className:"h-5 w-5"}),(0,t.jsx)(r.ArrowUpRight,{className:"size-3 text-muted-foreground"})]});return s?(0,t.jsx)("a",{href:s,target:"_blank",rel:"noopener noreferrer","aria-label":i,title:i,className:"shrink-0",children:d}):d}])},531772,640539,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(476819),a=e.i(494913),s=e.i(194983),l=e.i(102008),o=e.i(790597),i=e.i(613278);e.s(["BarChart2",()=>i.default],640539);var i=i,d=e.i(115057),c=e.i(431343),u=e.i(846696),m=e.i(548106),p=e.i(572377),h=e.i(916371),x=e.i(602487);let f=null;function g(){return f??=e.A(270308)}async function b(){try{let{default:e}=await g();return e.isSupported()}catch{return!1}}async function j(e,t,r){let{default:n,FetchLoader:a}=await g(),s=new n({loader:a,fetchSetup:(e,t)=>new Request(e.url,{...t,referrerPolicy:"no-referrer"}),startLevel:-1,capLevelToPlayerSize:!0});return s.on(n.Events.ERROR,(e,t)=>{t.fatal&&(s.destroy(),r(`${t.type}:${t.details}`))}),s.loadSource(t),s.attachMedia(e),()=>s.destroy()}var y=e.i(893586),w=e.i(428605),N=e.i(647163),v=e.i(609216);function k({text:e,className:r}){let n=(0,w.decodeHtmlEntities)(e),a=[],s=0;for(let e of n.matchAll(/(?<![A-Za-z0-9_])@([A-Za-z0-9_]{1,15})\b/g)){let r=e.index??0;r>s&&a.push(n.slice(s,r));let l=e[1];a.push((0,t.jsxs)("a",{href:`https://x.com/${l}`,target:"_blank",rel:"noopener noreferrer",className:"font-semibold text-[#1d9bf0] hover:underline",onClick:e=>e.stopPropagation(),children:["@",l]},`${r}-${l}`)),s=r+e[0].length}return s<n.length&&a.push(n.slice(s)),(0,t.jsx)("span",{className:r,children:a.length?a:n})}function _(e,t){let[n,a]=(0,r.useState)(!1),s=e.length>t&&!n;return{displayText:s?e.slice(0,t).trimEnd()+"â¦":e,collapsed:s,expand:()=>a(!0)}}function S({onClick:e}){return(0,t.jsx)("button",{type:"button",onClick:t=>{t.preventDefault(),t.stopPropagation(),e()},className:"ml-1 font-medium text-foreground hover:underline",children:"see more"})}function C(e){return e>=1e6?`${(e/1e6).toFixed(1).replace(/\.0$/,"")}M`:e>=1e3?`${(e/1e3).toFixed(1).replace(/\.0$/,"")}K`:e.toLocaleString()}let R=0;function U({className:e}){return(0,t.jsx)("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",className:(0,N.cn)("shrink-0 text-[#1d9bf0]",e),children:(0,t.jsx)("path",{fill:"currentColor",d:"M20.396 11c-.018-.646-.215-1.275-.57-1.816-.354-.54-.852-.972-1.438-1.246.223-.607.27-1.264.14-1.897-.131-.634-.437-1.218-.882-1.687-.47-.445-1.053-.75-1.687-.882-.633-.13-1.29-.083-1.897.14-.273-.587-.704-1.086-1.245-1.44S11.647 1.62 11 1.604c-.646.017-1.273.213-1.813.568s-.969.854-1.24 1.44c-.608-.223-1.267-.272-1.902-.14-.635.13-1.22.436-1.69.882-.445.47-.749 1.055-.878 1.688-.13.633-.08 1.29.144 1.896-.587.274-1.086.705-1.44 1.246-.354.54-.551 1.17-.569 1.816.018.646.215 1.276.57 1.817.353.54.852.972 1.438 1.245-.223.607-.27 1.264-.14 1.898.131.633.437 1.218.882 1.687.47.445 1.055.75 1.688.878.634.13 1.29.084 1.897-.138.274.586.705 1.084 1.246 1.439.54.354 1.17.551 1.816.569.647-.016 1.276-.213 1.817-.567s.972-.854 1.245-1.44c.604.239 1.266.303 1.906.184.64-.12 1.231-.42 1.702-.864.443-.47.749-1.053.877-1.687.128-.633.08-1.29-.144-1.896.586-.274 1.084-.705 1.439-1.246.354-.54.551-1.17.569-1.816zM9.662 14.85l-3.429-3.428 1.293-1.302 2.072 2.072 4.4-4.794 1.347 1.246z"})})}function P({author:e,size:r}){let a="shrink-0 squircle object-cover bg-muted",s=(e.name?.[0]??e.handle?.[0]??"?").toUpperCase(),l=(0,t.jsx)("div",{className:(0,N.cn)(a,"flex items-center justify-center font-medium text-muted-foreground"),style:{height:(0,n.designPx)(r),width:(0,n.designPx)(r),fontSize:Math.max(10,.32*r)},children:s});return e.avatar_url?(0,t.jsx)(m.SafeImage,{src:e.avatar_url,alt:"",fallback:l,className:a,style:{height:(0,n.designPx)(r),width:(0,n.designPx)(r)}}):l}function $({media:e,single:r,postId:n,href:a}){let s=(Array.isArray(e)?e:[]).filter(e=>!!e&&(null!=e.thumb||null!=e.url||null!=e.stored_url));if(!s.length)return null;let l=1===s.length;return(0,t.jsx)("div",{className:(0,N.cn)("mt-3 grid gap-0.5 overflow-hidden rounded-2xl border border-card-border",l?"grid-cols-1":"grid-cols-2"),children:s.slice(0,4).map((e,s)=>(0,t.jsx)(T,{media:e,single:l||!!r,postId:n,href:a}
5,s))})}function T({media:e,single:n,postId:a,href:s}){let l,o="video"===e.type||"animated_gif"===e.type,i=o?e.thumb??null:e.stored_url??e.thumb??e.url??null,d=n?"max-h-[510px]":"h-44",p=n?"h-72":"h-44",h=o&&e.url&&!/\.jpe?g($|\?)/i.test(e.url)?e.url:null,f=h&&!((l=h.match(/\/(\d{3,4})x(\d{3,4})\//))&&Math.min(Number(l[1]),Number(l[2]))>720)?h:null,[g,w]=(0,r.useState)(null),[k,_]=(0,r.useState)(null),[S,C]=(0,r.useState)(!1),U=(0,r.useRef)(null),P=(0,r.useRef)(null),$=(0,r.useRef)(null);async function I(e,t){let r=null;try{r=await fetch("/api/x/posts/media/mirror/presign",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({postId:e,url:t,contentType:"video/mp4"})}).then(e=>e.json())}catch{return{error:"presign-request-failed"}}if(r?.cached&&r.playUrl)return{playUrl:r.playUrl};if(r?.skipped)return{error:`storage:${r.skipped}`,storageOff:!0};if(!r?.uploadUrl)return{error:"no-upload-url"};let n=await (0,x.xAction)("x_mirror_media",{url:t,upload_url:r.uploadUrl,content_type:"video/mp4"},{timeoutMs:18e4});if(!n.ok)return{error:`upload:${n.error||"failed"}`};try{let r=await fetch("/api/x/posts/media/mirror/complete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({postId:e,url:t,contentType:"video/mp4",size:n.data?.size})}).then(e=>e.json());return{playUrl:r?.playUrl}}catch{return{error:"complete-request-failed"}}}function O(){if(e.hls||f&&!a)return Promise.resolve({hls:e.hls??null,mp4:f});if(P.current)return P.current;let t=(async()=>{if(!a)return{hls:null,mp4:f};let e=await (0,x.xAction)("x_tweet_detail",{tweet_id:a});if(e.ok||(e=await (0,x.xAction)("x_tweet_detail",{tweet_id:a},{forceTunnel:!0})),!e.ok||!e.data)return{hls:null,mp4:f};fetch("/api/x/posts/ingest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({raw:e.data})}).catch(()=>{});let t=function(e,t){for(let r of[e,e?.data])if(r)try{let{posts:e}=(0,y.decodeTimeline)(r),n=e.find(e=>e.xPostId===t)??e.find(e=>e.media.some(e=>"video"===e.type||"animated_gif"===e.type)),a=n?.media.find(e=>("video"===e.type||"animated_gif"===e.type)&&(e.url||e.hls));if(a)return{mp4:a.url??null,hls:a.hls??null}}catch{}return{mp4:null,hls:null}}(e.data,a);return{hls:t.hls,mp4:t.mp4??f}})();return P.current=t,t.then(e=>{e.hls||e.mp4||(P.current=null)}),t}function A(){if($.current)return $.current;let e=(async()=>{let e=(await O()).mp4??h;return e&&a?{...await I(a,e),mp4:e}:{mp4:e??null,error:"no-mp4"}})();return $.current=e,e.then(e=>{e.playUrl||($.current=null)}),e}async function F(){if(!g&&!k){C(!0);try{if(await b()){let{hls:e}=await O();if(e)return void _(e)}await z()}finally{C(!1)}}}async function z(){let e=await A();if(e.playUrl)return void w(e.playUrl);if(e.storageOff&&e.mp4){let t=await (0,x.xAction)("x_fetch_media",{url:e.mp4});if(t.ok&&t.data?.base64){let{base64:e,contentType:r}=t.data,n=Uint8Array.from(atob(e),e=>e.charCodeAt(0));w(URL.createObjectURL(new Blob([n],{type:r})));return}}let t=e.mp4?e.error?.startsWith("upload:")?"Reload the X extension to enable inline video":"Couldnât play the video here":"Couldnât load the video. Is the X extension running?";u.toast.error(`${t}. Opening on X`),s&&window.open(s,"_blank","noopener,noreferrer")}return((0,r.useEffect)(()=>{let e=U.current;if(!k||!e)return;let t=null,r=!1;return j(e,k,()=>{r||(_(null),C(!0),z().finally(()=>C(!1)))}).then(n=>{r?n():(t=n,e.play().catch(()=>{}))}),()=>{r=!0,t?.()}},[k]),o)?k?(0,t.jsx)(v.VideoPlayer,{videoRef:U,poster:e.thumb??void 0,onClick:e=>e.stopPropagation(),className:"block w-full",videoClassName:(0,N.cn)("w-full object-contain",d)}):g?(0,t.jsx)(v.VideoPlayer,{src:g,poster:e.thumb??void 0,autoPlay:!0,onClick:e=>e.stopPropagation(),onError:()=>{w(null),u.toast.error("Video failed to load. Tap play to retry")},className:"block w-full",videoClassName:(0,N.cn)("w-full object-contain",d)}):(0,t.jsxs)("div",{role:"button",tabIndex:0,onMouseEnter:function(){!o||g||k||b().then(e=>{e?O():$.current||R>=3||(R+=1,A().finally(()=>{R-=1}))})},onClick:e=>{e.preventDefault(),e.stopPropagation(),F()},className:"relative block cursor-pointer bg-black",children:[(0,t.jsx)(m.SafeImage,{src:i??"",alt:"",fallback:(0,t.jsx)("div",{className:(0,N.cn)("w-full bg-muted",p)}),className:(0,N.cn)("w-full object-cover",d)}),(0,t.jsx)("span",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:(0,t.jsx)("span",{className:(0,N.cn)("flex size-14 items-center justify-center rounded-full bg-black/55 backdrop-blur-sm",S&&"animate-pulse"),children:(0,t.jsx)(c.Play,{className:"ml-0.5 size-7 fill-white text-white"})})})]}):(0,t.jsx)(m.SafeImage,{src:i??"",alt:"",fallback:(0,t.jsx)("div",{className:(0,N.cn)("w-full bg-muted",p)}),className:(0,N.cn)("w-full object-cover",d)})}function I({post:e,surface:r}
5){let{displayText:n,collapsed:s,expand:l}=_(e.content??"",280);return(0,t.jsx)("div",{className:(0,N.cn)("mt-3 overflow-hidden rounded-2xl border","oat"===r?"border-border bg-white dark:bg-background":"border-card-border bg-[#FAF9F5] dark:bg-white/[0.04]"),children:(0,t.jsxs)("div",{className:"p-3",children:[(0,t.jsxs)("div",{role:"link",tabIndex:0,onClick:()=>{e.x_post_url&&window.open(e.x_post_url,"_blank","noopener,noreferrer")},className:"cursor-pointer",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(P,{author:e.author,size:20}),(0,t.jsx)("span",{className:"truncate text-sm font-semibold",children:e.author.name??"Unknown"}),e.author.verified&&(0,t.jsx)(U,{className:"size-3.5"}),e.author.handle&&(0,t.jsxs)("span",{className:"truncate text-xs text-muted-foreground",children:["@",e.author.handle]}),e.posted_at&&(0,t.jsxs)("span",{className:"shrink-0 text-xs text-muted-foreground",children:["· ",(0,a.formatDistanceToNow)(new Date(e.posted_at),{addSuffix:!1})]})]}),e.content&&(0,t.jsxs)("p",{className:"mt-1 whitespace-pre-wrap break-words text-sm leading-snug",children:[(0,t.jsx)(k,{text:n}),s&&(0,t.jsx)(S,{onClick:l})]})]}),(0,t.jsx)($,{media:e.media,postId:e.id,href:e.x_post_url})]})})}function O({compact:e=!1,commentCount:r,reposts:n,likeCount:a,views:d,liked:c,likeBusy:u,onReply:m,onLike:p,xUrl:h}){let x=e?"size-4":"size-[18px]",f=e?"size-7":"size-8";return(0,t.jsxs)("div",{className:(0,N.cn)("flex items-center justify-between",e?"max-w-[340px]":"max-w-md"),children:[(0,t.jsxs)("button",{type:"button",onClick:m,"aria-label":"Reply",className:"group/act -ml-1.5 flex items-center gap-0.5 text-xs tabular-nums text-muted-foreground transition-colors hover:text-[#1d9bf0]",children:[(0,t.jsx)("span",{className:(0,N.cn)("flex items-center justify-center rounded-full transition-colors group-hover/act:bg-[#1d9bf0]/10",f),children:(0,t.jsx)(s.MessageCircle,{className:x})}),r>0&&(0,t.jsx)("span",{children:C(r)})]}),(0,t.jsxs)("a",{href:h??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":"Repost on X",className:"group/act flex items-center gap-0.5 text-xs tabular-nums text-muted-foreground transition-colors hover:text-[#00ba7c]",children:[(0,t.jsx)("span",{className:(0,N.cn)("flex items-center justify-center rounded-full transition-colors group-hover/act:bg-[#00ba7c]/10",f),children:(0,t.jsx)(l.Repeat2,{className:x})}),n>0&&(0,t.jsx)("span",{children:C(n)})]}),(0,t.jsxs)("button",{type:"button",onClick:p,disabled:u,"aria-pressed":c,"aria-label":c?"Unlike":"Like",className:(0,N.cn)("group/act flex items-center gap-0.5 text-xs tabular-nums transition-colors hover:text-[#f91880] disabled:opacity-60",c?"text-[#f91880]":"text-muted-foreground"),children:[(0,t.jsx)("span",{className:(0,N.cn)("flex items-center justify-center rounded-full transition-colors group-hover/act:bg-[#f91880]/10",f),children:(0,t.jsx)(o.Heart,{className:(0,N.cn)(x,c&&"fill-current")})}),a>0&&(0,t.jsx)("span",{children:C(a)})]}),(0,t.jsxs)("span",{className:"flex items-center gap-0.5 text-xs tabular-nums text-muted-foreground",title:"Views",children:[(0,t.jsx)("span",{className:(0,N.cn)("flex items-center justify-center",f),children:(0,t.jsx)(i.default,{className:x})}),d>0&&(0,t.jsx)("span",{children:C(d)})]})]})}function A({reply:e,childrenByParent:n,onReplyPosted:s,composerClassName:l,depth:o=0}){let[i,c]=(0,r.useState)(!1),[m,p]=(0,r.useState)(e.metrics.likes),[x,f]=(0,r.useState)(!1),[g,b]=(0,r.useState)(!1),j=n.get(e.id)??[];async function y(){if(x)return;let t=!i;c(t),p(e=>Math.max(0,e+(t?1:-1))),f(!0);try{if(!(await fetch("/api/x/posts/like",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tweetId:e.id,like:t})})).ok)throw Error()}catch{c(!t),p(e=>Math.max(0,e+(t?-1:1))),u.toast.error("Could not update like. Is the X extension running?")}finally{f(!1)}}async function w(t){let r=t.trim();if(!r)return;let n=await fetch("/api/x/posts/reply",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tweetId:e.id,text:r})});if(!n.ok)throw Error((await n.json().catch(()=>({}))).error||"Could not send reply. Is the X extension running?");u.toast.success("Reply sent"),setTimeout(s,4e3)}return(0,t.jsxs)("div",{className:"group/reply flex gap-3",children:[(0,t.jsx)(P,{author:e.author,size:0===o?40:32}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 leading-tight",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"truncate text-sm font-semibold",children:e.author.name??"Unknown"}),e.author.verified&&(0,t.jsx)(U,{className:"size-3.5"}),e.author.handle&&(0,t.jsxs)("span",{className:"truncate text-xs text-muted-foreground",children:["@",e.author.handle]}),e.posted_at&&(0,t.jsxs)("span",{className:"shrink-0 text-xs text-muted-foreground",children:["· ",(0,a.formatDistanceToNow)(new Date(e.posted_at),{addSuffix:!1})]}),e.x_post_url&&(0,t.jsx)("a",{href:e.x_post_url,target:"_blank",rel:"noopener noreferrer","aria-label":"Open on X",className:"ml-auto shrink-0 rounded-full p-0.5 text-muted-foreground opacity-0 transition-opacity hover:bg-muted hover:text-foreground group-hover/reply:opacity-100",children:(0,t.jsx)(d.ArrowUpRight,{className:"size-3.5"})})]}),e.content&&(0,t.jsx)("p",{className:"mt-1 whitespace-pre-wrap break-words text-sm leading-normal",children:(0,t.jsx)(k,{text:e.content})}),(0,t.jsx)($,{media:e.media,postId:e.id,href:e.x_post_url}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(O,{compact:!0,commentCount:e.metrics.comments,reposts:e.metrics.reposts,likeCount:m,views:e.metrics.views,liked:i,likeBusy:x,onReply:()=>b(e=>!e),onLike:y,xUrl:e.x_post_url})}),g&&(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(h.CommentComposer,{placeholder:e.author.handle?`Reply to @${e.author.handle}
5`:"Post your reply",submitLabel:"Reply",autoFocus:!0,disableMentions:!0,className:l,onCancel:()=>b(!1),onSubmit:async({body:e})=>{await w(e),b(!1)}})}),j.length>0&&(0,t.jsx)("div",{className:"mt-5 space-y-5 border-l border-border/60 pl-4",children:j.map(e=>(0,t.jsx)(A,{reply:e,childrenByParent:n,onReplyPosted:s,composerClassName:l,depth:o+1},e.id))})]})]})}e.s(["XPostCard",0,function({post:e,className:n,surface:s="white",platformTag:l,previewMode:o=!1}){let{displayText:i,collapsed:d,expand:c}=_(e.content??"",400),m="oat"===s?"bg-white dark:bg-background border-border":void 0,[x,f]=(0,r.useState)(!1),[g,b]=(0,r.useState)(e.metrics.likes),[j,y]=(0,r.useState)(!1),[w,v]=(0,r.useState)(e.metrics.comments),[C,R]=(0,r.useState)(!1),[T,F]=(0,r.useState)(null),[z,E]=(0,r.useState)(!1),M=(0,r.useMemo)(()=>{let t=T??[],r=new Set(t.map(e=>e.id)),n=new Map;for(let a of t){let t=a.parent_id&&r.has(a.parent_id)?a.parent_id:e.id,s=n.get(t);s?s.push(a):n.set(t,[a])}return n},[T,e.id]);async function L(t=!1){t||E(!0);try{let t=await fetch(`/api/x/posts/${e.id}/replies`),r=await t.json();F(r.replies??[])}catch{F(e=>e??[])}finally{t||E(!1)}}async function q(){try{let t=await fetch("/api/x/tunnel",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"x_tweet_detail",args:{tweet_id:e.id}})}),{id:r}=await t.json();r&&D(r)}catch{}}async function D(e){for(let t=0;t<12;t++){await new Promise(e=>setTimeout(e,2500));try{let t=await fetch(`/api/x/tunnel?id=${e}`),r=await t.json();if("done"===r.status)return void L(!0);if("error"===r.status)return}catch{return}}}async function X(){if(j)return;let t=!x;f(t),b(e=>Math.max(0,e+(t?1:-1))),y(!0);try{if(!(await fetch("/api/x/posts/like",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tweetId:e.id,like:t})})).ok)throw Error()}catch{f(!t),b(e=>Math.max(0,e+(t?-1:1))),u.toast.error("Could not update like. Is the X extension running?")}finally{y(!1)}}async function B(t){let r=t.trim();if(!r)return;let n=await fetch("/api/x/posts/reply",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tweetId:e.id,text:r})});if(!n.ok)throw Error((await n.json().catch(()=>({}))).error||"Could not send reply. Is the X extension running?");v(e=>e+1),u.toast.success("Reply sent"),setTimeout(()=>void q(),4e3)}return(0,t.jsx)("article",{className:(0,N.cn)("rounded-[20px] border border-card-border overflow-hidden","white"===s?"bg-white dark:bg-background":"bg-[#FAF9F5] dark:bg-background",n),children:(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("header",{className:"flex items-start gap-3",children:[(0,t.jsx)(P,{author:e.author,size:40}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 leading-tight",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"truncate text-sm font-semibold",children:e.author.name??(e.author.handle?`@${e.author.handle}`:"Unknown")}),e.author.verified&&(0,t.jsx)(U,{className:"size-4"})]}),(0,t.jsxs)("div",{className:"truncate text-xs text-muted-foreground",children:[e.author.handle&&(0,t.jsxs)("span",{children:["@",e.author.handle]}),e.author.handle&&e.posted_at&&(0,t.jsx)("span",{children:" · "}),e.posted_at&&(0,t.jsx)("span",{children:(0,a.formatDistanceToNow)(new Date(e.posted_at),{addSuffix:!0})})]})]}),(0,t.jsx)("div",{className:"shrink-0 self-center",children:l??(e.x_post_url?(0,t.jsx)("a",{href:e.x_post_url,target:"_blank",rel:"noopener noreferrer","aria-label":"Open on X",className:"block transition-opacity hover:opacity-80",children:(0,t.jsx)(p.XSquircle,{className:"h-6 w-6"})}):(0,t.jsx)(p.XSquircle,{className:"h-6 w-6"}))})]}),e.reply_to?.author?.handle&&(0,t.jsxs)("p",{className:"mt-2 text-xs text-muted-foreground",children:["Replying to"," ",(0,t.jsxs)("a",{href:e.reply_to.x_post_url??`https://x.com/${e.reply_to.author.handle}`,target:"_blank",rel:"noopener noreferrer",className:"text-[#1d9bf0] hover:underline",onClick:e=>e.stopPropagation(),children:["@",e.reply_to.author.handle]})]}),i&&(0,t.jsxs)("p",{className:"mt-3 whitespace-pre-wrap break-words text-sm leading-relaxed",children:[(0,t.jsx)(k,{text:i}),d&&(0,t.jsx)(S,{onClick:c})]}),(0,t.jsx)($,{media:e.media,single:!0,postId:e.id,href:e.x_post_url}),e.reply_to&&!e.quoted&&(0,t.jsx)(I,{post:e.reply_to,surface:s}),e.quoted&&(0,t.jsx)(I,{post:e.quoted,surface:s}
5),o?(0,t.jsx)("footer",{"aria-hidden":!0,className:"mt-auto pt-3 pointer-events-none select-none",children:(0,t.jsx)(O,{commentCount:0,reposts:0,likeCount:0,views:0,liked:!1,onReply:()=>{},onLike:()=>{},xUrl:null})}):(0,t.jsx)("footer",{className:"mt-3",children:(0,t.jsx)(O,{commentCount:w,reposts:e.metrics.reposts,likeCount:g,views:e.metrics.views,liked:x,likeBusy:j,onReply:function(){let e=!C;R(e),e&&null===T&&(L(),q())},onLike:X,xUrl:e.x_post_url})}),!o&&C&&(0,t.jsxs)("div",{className:"mt-4 border-t border-card-border pt-4",children:[(0,t.jsx)(h.CommentComposer,{placeholder:"Post your reply",submitLabel:"Reply",disableMentions:!0,className:m,onSubmit:async({body:e})=>{await B(e)}}),z&&null===T?(0,t.jsx)("div",{className:"mt-5 space-y-6",children:[0,1].map(e=>(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)("div",{className:"size-10 shrink-0 squircle bg-muted animate-pulse"}),(0,t.jsxs)("div",{className:"flex-1 space-y-1.5 py-0.5",children:[(0,t.jsx)("div",{className:"h-3 w-24 rounded bg-muted animate-pulse"}),(0,t.jsx)("div",{className:"h-3 w-full rounded bg-muted animate-pulse"}),(0,t.jsx)("div",{className:"h-3 w-2/3 rounded bg-muted animate-pulse"})]})]},e))}):T&&T.length>0?(0,t.jsx)("div",{className:"mt-5 space-y-6",children:(M.get(e.id)??[]).map(e=>(0,t.jsx)(A,{reply:e,childrenByParent:M,onReplyPosted:()=>void q(),composerClassName:m},e.id))}):(0,t.jsx)("p",{className:"mt-4 text-xs text-muted-foreground",children:"No replies loaded yet. If you have the X extension running, theyâll appear here shortly."})]})]})})}],531772)}]);
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.