1import{j as e,A as pe,m as re}from"./vendor-motion-hRg_q8lq.js";import{r as o,a as Ve,b as Pe}from"./vendor-react-E98sgxjj.js";import{u as Ze,P as oe,N as Je}from"./useCanonicalPlayPath-DJjTWyxc.js";import{p as H}from"./publicGameMetadata-qDtp_1-a.js";import{u as L,b as Se,a0 as Y,L as d,T as W,l as Ce,an as K,m as Ge,H as _e,c as Xe,q as et,n as tt,ae as st,am as rt,v as fe,E as be,d as U,s as je,o as ae,C as at,Z as ot,$ as nt,ay as it,az as lt}from"./index-BKzE8EQ8.js";import{u as Ie}from"./useLocaleNavigate-BNriJdRU.js";import{b as Te,a as ne,u as Q}from"./vendor-query-bOUN_gKe.js";import{u as ct}from"./useIsStaff-DZf24Ivp.js";import{A as ye}from"./Avatar-B60wpoS5.js";import{D as mt}from"./DesktopGamePanel-BehZ5Jia.js";import{P as dt,b as ut,a as xt,u as gt,c as ht,R as pt}from"./index-B_kJqugV.js";import ft from"./ShareModal-YOmfr9ti.js";import{du as m}from"./vendor-fa-Bn2dnpnC.js";import{A as Ne}from"./index-BxtVm1Yj.js";import{u as bt}from"./useFullscreen-Cs7diftf.js";import{u as jt,a as yt,b as Nt,p as wt}from"./GameFrame-COJWxWBt.js";import{C as vt}from"./CoinTopUpModal-CAwRJTIr.js";import{u as kt}from"./usePlayFeatures-C6KNVcgO.js";import"./PlayPanelHost-DZaYs6Qz.js";import"./useGameVolume-DDLs3th3.js";import"./StudioContext-C1fnzqLL.js";import"./useOrchestrationEnabled-BWYxrOff.js";import"./paywall-CG7xVZtx.js";import"./plansApi-C_2vGYRm.js";import"./planChat-Cir7UVv6.js";import"./Tooltip-C8AvPGtA.js";import"./VolumeControl-DJ2K5ohZ.js";import"./screenshotStore-B6ItflPb.js";import"./MediaImage-DKgx-nW4.js";import"./planPerks-uEcgEuVc.js";import"./plans-CbMJY2XS.js";import"./socialLinks-DmmZmq5v.js";import"./usePlayingNow-D0BSBy1C.js";import"./playingNowApi-CB_pr25U.js";import"./vanitySite-BtpHcDVO.js";import"./useChatUnread-BF3F7z48.js";import"./useGameChatSocket-Ca57ylO8.js";import"./chatRoomStore-oLAeRb02.js";import"./playIntent-BFBGkqRe.js";import"./chatReturn-BikAGK6w.js";import"./SubmitVideoModal-DzX5MAqQ.js";import"./earnProgram-B9pqjKbP.js";import"./trailerShare-BGlMG0RV.js";import"./usePublishingFeatures-C8zY31rs.js";import"./exploreHandoff-RQymaHkp.js";import"./AuthShell-DPeun0C_.js";import"./AuthPanel-B4zt6SJ5.js";import"./pendingReferral-B4JPXhl_.js";import"./LaunchPromoClips-eRoWsyBt.js";import"./PlayingNowBadge-CH2HUoBo.js";import"./useFocusTrap-BzqZufCW.js";function Pt({comment:t,gameId:l}){const{t:r}=L("social"),{user:x,isAuthenticated:i}=Se(),f=Te(),[b,g]=o.useState(!1),[N,h]=o.useState(""),[G,V]=o.useState(!1),w=n=>{const I=new Date(n),p=new Date().getTime()-I.getTime(),S=Math.floor(p/(1e3*60*60)),A=Math.floor(p/(1e3*60*60*24));return S<1?r("comments.justNow"):S<24?r("comments.hoursAgo",{count:S}):A<7?r("comments.daysAgo",{count:A}):I.toLocaleDateString()},_=ne({mutationFn:()=>Y.createComment(l,N,t.id),onSuccess:()=>{h(""),g(!1),f.invalidateQueries({queryKey:["game-comments",l]})}}),F=ne({mutationFn:n=>Y.deleteComment(n),onSuccess:()=>{f.invalidateQueries({queryKey:["game-comments",l]})}}),v=n=>{n.preventDefault(),N.trim()&&_.mutate()},k=n=>{confirm(r("comments.deleteConfirm"))&&F.mutate(n)},Z=G?t.replies:t.replies.slice(0,3),P=t.replies.length-3;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsx(ye,{user:t.user,size:"sm"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(d,{to:`/u/${t.user.username}`,className:"text-sm text-foreground hover:text-accent",children:["@",t.user.username]}),e.jsx("span",{className:"text-xs text-muted-foreground",children:w(t.created_at)})]}),e.jsx("p",{className:"mt-1 text-sm text-foreground whitespace-pre-wrap break-words",children:t.content}),e.jsxs("div",{className:"mt-2 flex items-center gap-4",children:[i&&e.jsx("button",{onClick:()=>g(!b),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r("comments.reply")}),x?.username===t.user.username&&e.jsx("button",{onClick:()=>k(t.id),className:"text-xs text-muted-foreground hover:text-destructive transition-colors",children:r("comments.delete")})]}),b&&e.jsxs("form",{onSubmit:v,className:"mt-3 relative flex",children:[e.jsx("textarea",{value:N,onChange:n=>h(n.target.value),placeholder:r("comments.replyPlaceholder"),className:"w-full px-3 pt-2 pb-14 text-sm bg-transparent border border-border rounded-md resize-none focus:outline-none focus:border-foreground transition-colors",rows:4,maxLength:1e3}),e.jsxs("div",{className:"mt-2 flex justify-end gap-1 absolute bottom-1 right-1",children:[e.jsx("button",{type:"button",onClick:()=>g(!1),className:"text-sm h-8 px-2.5 rounded-sm text-muted-foreground hover:text-foreground bg-foreground
1/6 hover:bg-foreground/10 transition-colors cursor-pointer",children:r("comments.cancel")}),e.jsx("button",{type:"submit",disabled:!N.trim()||_.isPending,className:"h-8 px-2.5 text-sm rounded-sm transition-all cursor-pointer bg-foreground text-background hover:opacity-80 disabled:opacity-30 disabled:cursor-not-allowed",children:_.isPending?r("comments.posting"):r("comments.reply")})]})]})]})]}),t.replies.length>0&&e.jsxs("div",{className:"ml-11 space-y-3 border-l-2 border-border pl-4",children:[Z.map(n=>e.jsxs("div",{className:"flex gap-3",children:[e.jsx(ye,{user:n.user,size:"sm"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(d,{to:`/u/${n.user.username}`,className:"text-sm text-foreground hover:text-accent",children:["@",n.user.username]}),e.jsx("span",{className:"text-xs text-muted-foreground",children:w(n.created_at)})]}),e.jsx("p",{className:"mt-1 text-sm text-foreground whitespace-pre-wrap break-words",children:n.content}),x?.username===n.user.username&&e.jsx("button",{onClick:()=>k(n.id),className:"mt-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:r("comments.delete")})]})]},n.id)),!G&&P>0&&e.jsx("button",{onClick:()=>V(!0),className:"text-xs text-accent hover:underline",children:r("comments.showMore",{count:P})})]})]})}const we=2;function St(t,l){return t&&!t.closed&&l<=we?{kind:"close-tab"}:l>we?{kind:"history"}:{kind:"home"}}function ve({signedIn:t,maybe:l=!1}){const{t:r}=L("company"),x=Ie(),i=Ve();return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:e.jsxs("div",{className:"flex max-w-sm flex-col items-center text-center",children:[e.jsx("span",{className:"mb-6 flex size-14 items-center justify-center rounded-full bg-foreground
1/6 text-muted-foreground",children:e.jsx(m,{icon:["far","building"],className:"text-xl","aria-hidden":!0})}),e.jsx("h1",{className:"mb-3 text-lg text-foreground",children:r(t?"privateGame.noAccessTitle":l?"privateGame.maybeTitle":"privateGame.title")}),e.jsx("p",{className:"mb-6 text-sm text-muted-foreground",children:r(t?"privateGame.noAccessBody":l?"privateGame.maybeBody":"privateGame.body")}),t?e.jsx(d,{to:"/dashboard",className:"flex h-9 items-center justify-center rounded-md bg-foreground/6 px-3 text-sm text-foreground transition-colors hover:bg-foreground/10",children:r("privateGame.back")}):e.jsx("button",{type:"button",onClick:()=>x("/login",{state:{next:i.pathname+i.search}}),className:"flex h-9 cursor-pointer items-center justify-center rounded-md bg-foreground px-3 text-sm text-background transition-opacity hover:opacity-85",children:r("privateGame.signIn")})]})})}const ke="share-page-game-muted",Ct="tesana_play_signup_banner";function Ss(){const{t}=L("game"),{playerShell:l,ready:r}=kt();return r?l?e.jsx(Gt,{}):e.jsx(Ae,{}):e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx(W,{size:"lg",text:t("sharePage.loadingGame")})})}function Gt(){const{t}=L("game"),{gameId:l}=Pe(),{data:r,isLoading:x}=Q({queryKey:["game-public",l],queryFn:()=>Ce.getPublic(l),enabled:!!l,retry:(f,b)=>{const g=K(b);return!(g&&g>=400&&g<500)&&f<1}}),i=!!r&&!!Ge(r)&&r.platform_tier!=="desktop";return Ze(i?r:null,l,"play"),x?e.jsx("div",{className:"fixed inset-0 bg-black flex items-center justify-center",children:e.jsx(W,{size:"lg",overlay:!1,text:t("sharePage.loadingGame")})}):!r||!i?e.jsx(Ae,{}):e.jsxs("div",{className:"fixed inset-0 bg-black",children:[e.jsx(oe,{game:r,surface:"play"}),e.jsxs(_e,{children:[e.jsx("title",{children:t("sharePage.playTitle",{name:r.name})}),e.jsx("meta",{name:"description",content:H(r)}),e.jsx("meta",{property:"og:title",content:t("sharePage.playTitle",{name:r.name})}),e.jsx("meta",{property:"og:description",content:H(r)}),e.jsx("meta",{property:"og:type",content:"website"}),e.jsx("meta",{name:"twitter:card",content:"summary_large_image"})]}),e.jsx(dt,{game:r,surface:"play"})]})}function Ae(){const{t}=L("game"),{isLight:l}=Xe(),{gameId:r}=Pe(),{user:x,isAuthenticated:i,loading:f}=Se(),b=ct(),[g,N]=ut(Ct),h=Ie(),G=Te(),[V,w]=o.useState(!0),[_,F]=o.use
1State(!1),[v,k]=o.useState(!1),[Z,P]=o.useState(!1),[n,I]=o.useState(!1),[T,p]=o.useState(!1),[S,A]=o.useState(!1),[D,ie]=o.useState(""),[u,Re]=o.useState(()=>typeof window>"u"?!1:window.sessionStorage.getItem(ke)==="1"),le=o.useRef(null),J=o.useRef(null),{isFullscreen:ce,toggleFullscreen:Ee}=bt(le),{data:s,isLoading:Me,error:j}=Q({queryKey:["game-public",r],queryFn:()=>Ce.getPublic(r),enabled:!!r,retry:(a,$)=>{const M=K($);return!(M&&M>=400&&M<500)&&a<1}});o.useEffect(()=>{if(!(!s||!r)&&s.resolved_via_legacy_numeric_id&&s.public_id){et("play",r,s.public_id);const a=window.location.pathname.replace(`/play/${r}`,`/play/${s.public_id}`);a!==window.location.pathname&&window.history.replaceState(null,"",a+window.location.search+window.location.hash)}},[s,r]);const c=s?.id??Number(r),R=Number.isFinite(c)&&c>0,C=!!(i&&x&&s&&s.user===x.username);xt(R?c:null,!!s&&s.status==="completed"&&R,{surface:"play",isOwner:C,gameName:s?.name,gamePublicId:s?.public_id,game:s});const[Ue,me]=o.useState(!1),de=o.useRef(()=>{}),[Le,ue]=o.useState(null),X=o.useRef(null),Fe=o.useCallback(a=>new Promise($=>{X.current=$,ue({sku:a.sku})}),[]),{sendBootstrap:xe,completeTopUp:ee,answerSignIn:De,session:B}=jt({iframeRef:J,gameId:R?c:null,playGameId:s?.public_id??null,isAuthenticated:i,authLoading:f,onTopUpRequest:()=>me(!0),onCheckoutRequest:Fe,onSignInRequest:()=>de.current()}),{signInOpen:Be,requestSignIn:qe,closeSignIn:ze}=yt(i,De);de.current=qe;const Oe=o.useCallback(()=>{me(!1),tt.getWallet().then(a=>ee(!0,a.balance)).catch(()=>ee(!1))},[ee]),{data:q,isLoading:$e}=Q({queryKey:["game-comments",c],queryFn:()=>Y.getComments(c),enabled:R&&v}),te=ne({mutationFn:a=>Y.createComment(c,a),onSuccess:()=>{ie(""),G.invalidateQueries({queryKey:["game-comments",c]})}}),Ke=a=>{a.preventDefault(),D.trim()&&te.mutate(D.trim())},{data:E}=Q({queryKey:["game-access",c],queryFn:()=>st.checkGameAccess(c),enabled:R&&!!s});o.useEffect(()=>{E&&!E.has_access&&E.slug&&!b&&h(`/game/${E.slug}`,{replace:!0})},[E,h,b]);const y=s?Ge(s):null,Qe=y?`${y}${typeof window<"u"?window.location.search:""}`:null,z=s?.platform_tier==="desktop";gt(!!y,{onlyWhenFullscreen:!0});const He=!f&&!i&&!!s&&(!!y||z)&&!g,O=o.useCallback(()=>{const a=J.current?.contentWindow;a&&a.postMessage({type:"set-muted",muted:u},"*")},[u]),Ye=o.useCallback(()=>{w(!1),O(),xe()},[O,xe]),We=()=>{w(!1),F(!0)},ge=o.useCallback(()=>{Re(a=>!a)},[]),se=o.useCallback(()=>{window.history.length>2?h(-1):h(i?"/dashboard":"/")},[h,i]),he=o.useCallback(()=>{let a=null;try{a=window.opener}catch{a=null}if(St(a,window.history.length).kind==="close-tab"&&a){const M=a;try{M.focus()}catch{}window.close(),window.setTimeout(se,0);return}se()},[se]);return o.useEffect(()=>{typeof window>"u"||window.sessionStorage.setItem(ke,u?"1":"0")},[u]),o.useEffect(()=>{y&&O()},[y,u,O]),o.useEffect(()=>{if(T){A(!1);return}const a=window.setTimeout(()=>A(!0),4e3);return()=>window.clearTimeout(a)},[T]),Me?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx(W,{size:"lg",text:t("sharePage.loadingGame")})}):j&&(K(j)===403||rt(j))?e.jsx(ve,{signedIn:i}):j&&!i&&K(j)===404&&j?.response?.data?.may_require_sign_in?e.jsx(ve,{signedIn:!1,maybe:!0}):j||!s?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsxs("div",{className:"text-center flex flex-col items-center",children:[e.jsx("span",{className:"text-6xl mb-8",children:e.jsx(m,{icon:["fas","face-eyes-xmarks"],className:"text-muted-foreground/50"})}),e.jsx("h1",{className:"text-lg text-foreground mb-3",children:t("sharePage.gameNotFound")}),e.jsx("p",{className:"text-muted-foreground mb-6 text-sm text-center max-w-[260px]",children:t("sharePage.gameNotFoundDescription")}),e.jsx(d,{to:"/",className:"px-3 h-9 rounded-md bg-foreground text-background hover:opacity-80 transition-all flex items-center justify-center text-sm",children:t("sharePage.goToTesana")})]})}):!y&&!z?e.jsxs("div",{className:"min-h-screen bg-sidebar flex items-center justify-center",children:[e.jsx(oe,{game:s,surface:"play"}),e.jsxs("div",{className:"text-center",children:[e.jsx("span",{className:"text-6xl block mb-6",children:"ð¨"}),e.jsx("h1",{className:"text-2xl text-foreground mb-2",children:s.name}),e.jsx("p",{className:"text-muted-foreground mb-6",children:t("sharePage.gameBeingBuilt")}),e.jsx(d,{to:"/",className:"inline-block px-6 py-3 bg-accent text-accent-foreground rounded-lg hover:opacity-90 transition-opacity",children:t("sharePage.createYourOwnGame")})]})]}):e.jsxs("div",{className:"tesana-embedded-clearpath h-dvh bg-background flex flex-col overflow-hidden",children:[e.jsx(oe,{game:s,surface:"play"}),e.jsxs(_e,{children:[e.jsx("title",{children:s?t("sharePage.playT
1itle",{name:s.name}):t("sharePage.playOnTesana")}),e.jsx("meta",{name:"description",content:H(s)}),e.jsx("meta",{property:"og:title",content:s?t("sharePage.playTitle",{name:s.name}):t("sharePage.playOnTesana")}),e.jsx("meta",{property:"og:description",content:H(s)}),e.jsx("meta",{property:"og:type",content:"website"}),e.jsx("meta",{name:"twitter:card",content:"summary_large_image"})]}),He&&e.jsx(ht,{className:"flex-shrink-0 [@media(max-width:639px),(max-height:520px)]:hidden",message:t("sharePage.signupBanner.message"),cta:t("sharePage.signupBanner.cta"),onClick:()=>{fe(be.SIGNUP_BANNER_CLICKED,{game_id:c}),I(!0)},onDismiss:()=>{fe(be.SIGNUP_BANNER_DISMISSED,{game_id:c}),N()},dismissLabel:t("sharePage.signupBanner.dismiss")}),e.jsxs("header",{className:"flex-shrink-0 flex [@media(max-width:639px),(max-height:520px)]:hidden items-center justify-between px-4 py-3 bg-background",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("button",{onClick:he,className:"flex items-center text-sm transition-colors cursor-pointer gap-2 h-9 w-9 flex items-center justify-center rounded-md text-sm text-muted-foreground hover:text-foreground bg-foreground
1/6 hover:bg-foreground/10",title:t("sidebar.goBack","Go back"),"aria-label":t("sidebar.goBack","Go back"),children:e.jsx(m,{icon:["far","arrow-left"],className:"text-sm"})}),e.jsx(d,{to:"/",className:"flex items-center",children:e.jsx("img",{src:"/logos/tessala-logo.svg",alt:"Tesana",className:`object-contain object-left w-[106px] h-[28px] transition-all ${l?"invert":"invert-0"} -translate-y-0.5`})})]}),e.jsx("div",{className:"flex items-center gap-2",children:i?C?e.jsxs(d,{to:`/studio/${s.id}`,className:"px-3 h-9 flex items-center justify-center rounded-md text-sm text-muted-foreground hover:text-foreground bg-foreground/6 hover:bg-foreground/10 transition-colors cursor-pointer gap-2",children:[e.jsx(m,{icon:["far","pen"],className:"text-sm"}),t("sharePage.edit")]}):null:e.jsxs(e.Fragment,{children:[e.jsx(d,{to:"/login",className:"px-3 h-9 flex items-center justify-center rounded-md text-sm text-muted-foreground hover:text-foreground bg-foreground/6 hover:bg-foreground/10 transition-colors cursor-pointer gap-2",children:t("sharePage.logIn")}),e.jsx(d,{to:"/register",className:"px-3 h-9 flex items-center justify-center rounded-md text-sm text-background bg-foreground hover:opacity-80 transition-all cursor-pointer gap-2",children:t("sharePage.signUp")})]})})]}),e.jsx("main",{className:"flex-1 relative mx-2 border border-border rounded-md [@media(max-width:639px),(max-height:520px)]:mx-0 [@media(max-width:639px),(max-height:520px)]:border-0 [@media(max-width:639px),(max-height:520px)]:rounded-none",children:e.jsxs("div",{ref:le,className:U("absolute inset-0 rounded-md [@media(max-width:639px),(max-height:520px)]:rounded-none overflow-hidden",!(z&&je)&&"bg-black"),children:[z?je?e.jsx(Je,{gameId:c,gameName:s.name,posterUrl:ae(s),pckUrl:s.pck_url,pckSha:s.pck_sha,studioGameId:C?c:null,surface:"share"}):e.jsx(mt,{gameName:s.name,posterUrl:ae(s),surface:"share",studioGameId:C?c:null}):e.jsxs(e.Fragment,{children:[V&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-card z-10",children:e.jsx(W,{size:"lg",text:t("sharePage.loadingGameName",{name:s.name}),overlayColor:at})}),_&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-card",children:e.jsxs("div",{className:"text-center",children:[e.jsx("span",{className:"text-6xl block mb-6",children:"â ï¸"}),e.jsx("h2",{className:"text-xl text-foreground mb-2",children:t("sharePage.failedToLoad")}),e.jsx("p",{className:"text-muted-foreground mb-6",children:t("sharePage.errorLoadingGame")}),e.jsx("button",{onClick:()=>{F(!1),w(!0)},className:"px-6 py-3 bg-accent text-accent-foreground rounded-lg hover:opacity-90 transition-opacity",children:t("sharePage.tryAgain")})]})}),e.jsx("iframe",{ref:J,src:Qe??void 0,className:"absolute inset-0 w-full h-full border-none bg-black",onLoad:Ye,onError:We,title:s.name,sandbox:"allow-scripts allow-modals allow-same-origin allow-popups allow-forms allow-pointer-lock",allow:"fullscreen"}),e.jsx("button",{onClick:ge,"aria-label":t(u?"sharePage.unmuteGame":"sharePage.muteGame"),"aria-pressed":u,className:"absolute top-4 right-15 h-9 w-9 flex [@media(max-width:639px),(max-height:520px)]:hidden items-center justify-center bg-black/40 hover:bg-black/50 rounded-md transition-colors z-20 cursor-pointer",title:t(u?"sharePage.unmuteGame":"sharePage.muteGame"),children:e.jsxs("span",{className:"relative flex items-center justify-center text-white",children:[e.jsx(m,{icon:["far","volume"],className:"text-sm"}),u&&e.jsx("span",{"aria-hidden":"true",className:"absolute h-0.5 w-4 rotate-45 rounded-full bg-current"})]})}),e.jsx("button",{onClick:Ee,className:"absolute top-4 right-4 h-9 w-9 flex [@media(max-width:639px),(max-height:520px)]:hidden items-center justify-center bg-black/40 hover:bg-black/50 rounded-md transition-colors z-20 cursor-pointer",title:t(ce?"sharePage.exitFullscreen":"sharePage.fullscreen"),children:e.jsx(m,{icon:["far",ce?"minimize":"maximize"],className:"text-sm text-white"})}),e.jsx(pt,{orientation:s.orientation})]}),e.jsx("button",{onClick:he,"aria-label":t("sidebar.goBack","Go back"),title:t("sidebar.goBack","Go back"),className:U("hidden [@media(max-width:639px),(max-height:520px)]:flex absolute top-3 left-3 h-8 w-8 items-center justify-center bg-black/60 hover:bg-black/75 rounded-md transition-opacity duration-500 z-40 cursor-pointer",S?"opacity-40":"opacity-100"),children:e.jsx(m,{icon:["far","arrow-left"],className:"text-xs text-white"})}),e.jsx("button",{onClick:()=>p(!0),"aria-label":t("sharePage.moreOptions"),"aria-haspopup":"dialog","aria-expanded":T,title:t("sharePage.moreOptions"),className:U("hidden [@media(max-width:639px),(max-height:520px)]:flex absolute top-3 right-3 h-8 w-8 items-center justify-center bg-black/60 hover:bg-black/75 rounded-md transition-opacity duration-500 z-40 cursor-pointer",S?"opacity-40":"opacity-100"),children:e.jsx(m,{icon:["far","ellipsis"],className:"text-xs text-white"})})]})}),e.jsx(pe,{children:T&&e.jsxs(e.Fragment,{children:[e.jsx(re.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 z-50 bg-black/50",onClick:()=>p(!1)}),e.jsxs(re.div,{role:"dialog","aria-modal":"true","aria-label":s.name,initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:{duration:.25,ease:[.16,1,.3,1]},className:"fixed inset-x-0 bottom-0 z-50 mx-auto w-full max-w-md max-h-[90dvh] overflow-y-auto rounded-t-xl border-t border-border bg-card px-4 pt-3 pb-[max(1rem,env(safe-area-inset-bottom))]",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm text-foreground",children:s.name}),s.user&&e.jsx(d,{to:`/u/${s.user}`,className:"text-xs text-muted-foreground hover:text-accent transition-colors",children:t("sharePage.byUser",{user:s.user})})]}),e.jsx("button",{onClick:()=>p(!1),"aria-label":t("gamePreview.close"),className:"w-8 h-8 flex-shrink-0 flex items-center justify-center rounded-md text-muted-foreground hover:text-foreground bg-foreground
1/6 hover:bg-foreground/10 transition-colors cursor-pointer",children:e.jsx(m,{icon:["far","xmark"],className:"text-sm"})})]}),e.jsxs("div",{className:U("mt-3 grid gap-2",C?"grid-cols-4":"grid-cols-3"),children:[e.jsxs("button",{onClick:()=>{p(!1),P(!0)},className:"flex flex-col items-center justify-center gap-1.5 h-16 rounded-md text-xs text-foreground bg-foreground/6 hover:bg-foreground/10 transition-colors cursor-pointer",children:[e.jsx(m,{icon:["far","share-nodes"],className:"text-base"}),t("sharePage.share")]}),e.jsxs("button",{onClick:ge,"aria-pressed":u,className:"flex flex-col items-center justify-center gap-1.5 h-16 rounded-md text-xs text-foreground bg-foreground/6 hover:bg-foreground/10 transition-colors cursor-pointer",children:[e.jsx(m,{icon:["far",u?"volume-xmark":"volume"],className:"text-base"}),t(u?"sharePage.unmuteGame":"sharePage.muteGame")]}),e.jsxs("button",{onClick:()=>{p(!1),k(!0)},className:"flex flex-col items-center justify-center gap-1.5 h-16 rounded-md text-xs text-foreground bg-foreground/6 hover:bg-foreground
1/10 transition-colors cursor-pointer",children:[e.jsx(m,{icon:["far","comment-dots"],className:"text-base"}),t("sharePage.comments")]}),C&&e.jsxs(d,{to:`/studio/${s.id}`,className:"flex flex-col items-center justify-center gap-1.5 h-16 rounded-md text-xs text-foreground bg-foreground/6 hover:bg-foreground/10 transition-colors cursor-pointer",children:[e.jsx(m,{icon:["far","pen"],className:"text-base"}),t("sharePage.edit")]})]}),!i&&e.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2",children:[e.jsx(d,{to:"/login",className:"h-10 flex items-center justify-center rounded-md text-sm text-muted-foreground hover:text-foreground bg-foreground/6 hover:bg-foreground/10 transition-colors cursor-pointer",children:t("sharePage.logIn")}),e.jsx(d,{to:"/register",className:"h-10 flex items-center justify-center rounded-md text-sm text-background bg-foreground hover:opacity-80 transition-all cursor-pointer",children:t("sharePage.signUp")})]})]})]})}),e.jsx(pe,{children:v&&e.jsx(re.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{duration:.2,ease:[.16,1,.3,1]},className:"flex-shrink-0 bg-card absolute z-50 bottom-17 left-4 [@media(max-width:639px),(max-height:520px)]:bottom-2 [@media(max-width:639px),(max-height:520px)]:left-2 w-[calc(100%-16px)] max-w-[500px] rounded-lg border border-border shadow-lg",children:e.jsxs("div",{className:"",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[e.jsxs("h3",{className:"text-sm text-foreground",children:[t("sharePage.comments")," ",q?.total?`(${q.total})`:""]}),e.jsx("button",{onClick:()=>k(!1),className:"w-7 h-7 flex items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-foreground
1/4 transition-colors cursor-pointer",children:e.jsx(m,{icon:["far","xmark"],className:"text-sm"})})]}),e.jsxs("div",{className:"max-h-[50vh] overflow-y-auto px-4",children:[i?e.jsx("form",{onSubmit:Ke,className:"py-4 border-b border-border",children:e.jsxs("div",{className:"relative flex",children:[e.jsx("textarea",{value:D,onChange:a=>ie(a.target.value),placeholder:t("sharePage.writeComment"),className:"w-full px-3 pt-2 pb-10 text-sm bg-transparent border border-border rounded-md resize-none focus:outline-none focus:border-foreground transition-colors",rows:5,maxLength:1e3}),e.jsx("button",{type:"submit",disabled:!D.trim()||te.isPending,className:"absolute bottom-1 right-1 h-8 px-2.5 text-sm rounded-sm transition-all cursor-pointer bg-foreground text-background hover:opacity-80 disabled:opacity-30 disabled:cursor-not-allowed",children:te.isPending?t("sharePage.posting"):t("sharePage.post")})]})}):e.jsxs("div",{className:"mb-4 p-3 bg-secondary rounded-md text-center",children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:t("sharePage.signInToComment")}),e.jsx(d,{to:"/login",className:"text-sm text-accent hover:underline",children:t("sharePage.logIn")})]}),$e?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx("div",{className:"spinner"})}):q?.comments.length===0?e.jsx("p",{className:"text-sm text-muted-foreground text-center py-12",children:t("sharePage.noComments")}):e.jsx("div",{className:"space-y-4 py-4",children:q?.comments.map(a=>e.jsx(Pt,{comment:a,gameId:c},a.id))})]})]})})}),e.jsxs("footer",{className:"flex-shrink-0 flex [@media(max-width:639px),(max-height:520px)]:hidden flex-row-reverse md:flex-row items-center justify-between px-4 py-3 gap-2 bg-background",children:[e.jsxs("div",{className:"flex flex-row-reverse md:flex-row items-center gap-2",children:[e.jsxs("button",{onClick:()=>P(!0),className:"flex items-center gap-2 px-3 h-9 flex items-center justify-center rounded-md text-sm text-background bg-foreground hover:opacity-80 transition-opacity cursor-pointer",children:[e.jsx(m,{icon:["far","share-nodes"],className:"text-sm hidden md:block"}),t("sharePage.share")]}),e.jsxs("button",{onClick:()=>k(!v),className:U("flex items-center gap-2 px-3 h-9 flex items-center justify-center rounded-md text-sm transition-all cursor-pointer gap-2",v?"bg-yellow-500/20 text-yellow-500 hover:bg-yellow-500/25":"text-muted-foreground hover:text-foreground bg-foreground
1/6 hover:bg-foreground/10"),children:[e.jsx(m,{icon:["far","comment-dots"],className:"text-sm hidden md:block"}),t("sharePage.comments")]})]}),e.jsxs("div",{className:"flex flex-col items-start md:flex-row md:items-center gap-0 md:gap-2 text-center truncate",children:[e.jsx("span",{className:"text-sm text-foreground",children:s.name}),s.user&&e.jsx(d,{to:`/u/${s.user}`,className:"text-muted-foreground text-xs hover:text-accent transition-colors",children:t("sharePage.byUser",{user:s.user})})]}),e.jsx("div",{className:"hidden md:block","aria-hidden":"true"})]}),e.jsx(vt,{isOpen:Ue,onClose:Oe,returnUrl:window.location.href}),e.jsx(Nt,{sku:Le?.sku??null,play:B?{endpoint:wt(B),token:B.save_token||B.token}:null,onSettle:a=>{X.current?.(a),X.current=null,G.invalidateQueries({queryKey:["wallet"]})},onClose:()=>ue(null)}),e.jsx(ft,{isOpen:Z,onClose:()=>P(!1),title:s.name,trailerUrl:lt(s),trailerShortUrl:it(s),shareUrl:nt(s),previewImage:ae(s)||void 0,gameId:s.id,isOwner:!!x&&s.user===x.username,slug:s.slug,restrictedToOrg:ot(s)}),e.jsx(Ne,{isOpen:n,onClose:()=>I(!1),initialMode:"signup"}),e.jsx(Ne,{isOpen:Be,onClose:ze,initialMode:"login"})]})}export{Ss 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.