1import{aw as h,gl as b,ca as f,j as e,a3 as k,a4 as j}from"./vendor-data-eBPZki-Z.js";import"./vendor-zod-Bei2Z9MS.js";import{f as y,u as v,o as P,r as i,n as C}from"./vendor-react-BgtJhS2O.js";import{c as N,S,P as T}from"./PremiumStudioLocked-BZEnltKI.js";import{dT as O,aY as A,en as D,aZ as M,at as I,a_ as R,a$ as w,m as F}from"./index-DTQGL8n8.js";import{u as L}from"./useTrackScreen-BLOOZkQ_.js";import{P as E}from"./PostCard-BpLSQMtH.js";import{P as _}from"./PostSkeleton-BY0I-Fub.js";import{u as z}from"./usePostActions-B9V6JroX.js";import{b as Q}from"./usePremiumGateAccess-_F9WRRYB.js";import"./usePostComments-Dl6oiND2.js";import"./ExpandableBody-DWLBBjw0.js";import"./user-multiple-F5jephUU.js";import"./useFeedVideoAutoplayPref-B5Ho7cdm.js";import"./useUserSettingValue-BuB0sMd0.js";const p="/studio?tab=content";function B(){L("StudioContentPostDetails");const r=y(),n=v(),{postId:d}=P(),l=d?.trim()??"",s=h(l,{requirePlayableMedia:!1,parentDepth:2}),c=b(),a=i.useMemo(()=>s.data?f(s.data):null,[s.data]),u=i.useMemo(()=>s.data?N(s.data,c.data):[],[s.data,c.data]),x=i.useCallback(()=>{n.key==="default"?r(p,{replace:!0}):r(-1)},[n.key,r]),t=z({onPostRemoved:()=>r(p,{replace:!0})}),m=i.useCallback(o=>{a&&t.openPostActions(a,o.currentTarget)},[a,t]),g=i.useCallback(()=>{s.refetch()},[s]);return e.jsxs("div",{"data-testid":"studio-content-post-details",className:`flex flex-col w-full min-h-[calc(100dvh-4rem)] md:min-h-dvh ${O}`,children:[e.jsxs("header",{className:"sticky top-0 z-10 flex items-center gap-2 px-2 py-3 bg-bg/90 dark:bg-bg-dark/90 backdrop-blur border-b border-border-light/60 dark:border-border-dark/60",children:[e.jsx("button",{type:"button",onClick:x,"aria-label":"Back",className:"p-2 rounded-full hover:bg-bg-elevated dark:hover:bg-bg-elevated-dark text-text dark:text-text-dark",children:e.jsx(A,{width:20,height:20})}),e.jsx("h1",{className:"flex-1 text-xl font-bold text-text dark:text-text-dark",children:"Post"}),a?e.jsx("button",{type:"button","aria-label":"Post actions",className:"p-2 rounded-full hover:bg-bg-elevated dark:hover:bg-bg-elevated-dark text-text dark:text-text-dark",onClick:m,children:e.jsx(D,{size:20,"aria-hidden":!0})}):e.jsx("span",{className:"size-9","aria-hidden":!0})]}),e.jsx("div",{className:"flex-1 min-w-0 max-w-[600px] w-full mx-auto",children:l?s.isPending&&!a?e.jsx("div",{className:"px-4 py-4","aria-label":"Loading post",children:e.jsx(_,{inline:!0})}):s.isError&&!a?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-16 text-center px-4",children:[e.jsx("p",{className:"text-sm text-text-secondary dark:text-text-secondary-dark",children:"Couldn't load this post."}),e.jsx("button",{type:"button",onClick:g,disabled:s.isFetching,className:"h-10 px-4 rounded-lg border border-border-light dark:border-border-dark text-sm font-semibold text-text dark:text-text-dark disabled:opacity-50",children:s.isFetching?"Retryingâ¦":"Try again"})]}):a?e.jsxs(e.Fragment,{children:[e.jsx(E,{post:a,onOpenActions:t.openPostActions,hideBorder:!0,hideActionRow:!0,disableCardNavigation:!0,autoplayOnVisible:!1}),e.jsxs("section",{className:"px-4 pt-2 pb-8","aria-labelledby":"studio-post-insights-heading",children:[e.jsx("h2",{id:"studio-post-insights-heading",className:"text-lg font-bold text-text dark:text-text-dark mb-3",children:"Insights"}),e.jsx("div",{className:"grid grid-cols-2 gap-2","aria-label":"Post insights",children:u.map(o=>e.jsx(S,{metric:o,compact:!0},o.id))})]})]}):null:e.jsx("p",{className:"px-4 py-8 text-center text-sm text-text-secondary dark:text-text-secondary-dark",children:"This post link is invalid."})}),e.jsx(M,{open:t.postActionsOpen,onOpenChange:o=>!o&&t.closePostActions(),options:t.postActionOptions,triggerEl:t.postActionsTriggerEl}),e.jsx(I,{open:t.confirmDeleteOpen,onOpenChange:o=>!o&&t.closeConfirmDelete(),title:"Delete post",description:"This can't be undone.",confirmLabel:"Delete",onConfirm:t.confirmDelete,isPending:t.isDeleting}),e.jsx(R,{open:t.reportModalOpen,onClose:t.closeReportModal,targetId:t.reportPost?.id||"",targetType:"post",onReportSubmitted:t.handleReportSubmitted}),e.jsx(w,{...t})]})}function ae(){const r=k("studio_content"),{isPending:n}=j(),d=Q("content");return r?d?e.jsx(T,{surfaceLabel:"Content"}):e.jsx(B,{}):n?e.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:e.jsx(F,{size:"lg"})}):e.jsx(C,{to:"/studio",replace:!0})}export{ae as default};
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.