1import{c8 as S,iW as m,k5 as z,hZ as e,r,fg as C,aR as D,i_ as E,kB as $}from"./index-D04aio-r.js";import{V as v,c5 as B,bm as V}from"./index.min-DqM6n_B9.js";import{M}from"./MarketingLayout-CfhLanrX.js";import{M as u,F as R,L as U,d as _}from"./download-qVRqj1Yk.js";import{S as x}from"./ShadcnSeparator-Cywnz346.js";import"./GradientBackground-CE4URicP.js";import"./MaxWidthWrapper-CdJ93Qlu.js";import"./tools-2m-ml1nZ.js";import"./chevron-down-i3Wj6aME.js";import"./index-CxeoeHDb.js";import"./index-DEbtbRBY.js";import"./zod-geqXdhPU.js";import"./index-CBMyeA0S.js";import"./ShadcnForm-BNKupssf.js";import"./ShadcnLabel-MragvuuG.js";import"./ShadcnTextarea-Cwm6ln5J.js";import"./Tooltip-B1bz1H2k.js";import"./Input-DHyEO0-w.js";import"./stripe.esm-dkXHr68O.js";import"./index-CZkcpfv6.js";import"./index-CnJWVjh6.js";import"./SiYoutube-BFjzQCNV.js";import"./SiInstagram-LxFG1EJX.js";import"./Logo-BWgbhxtJ.js";import"./useScreenSize-BEPGl4iJ.js";import"./CustomHead-B5FxR42g.js";const de=()=>{const{linkId:l}=S.useParams(),{capture:b}=$(),[h,p]=m.useState(null),[g,o]=m.useState(!1),{data:t,isLoading:w}=z.video.validateShareableLink.useQuery({linkId:l},{enabled:!!l,onError:a=>{p(a.message||"Failed to load video")}});m.useEffect(()=>{t&&!t.valid&&p(t.error||"Invalid link")},[t]);const y=async()=>{if(!t?.video?.signedUrl)return;o(!0);const a=t.video.title?`${t.video.title}.mp4`:`video-${l}.mp4`;b(D.VIDEO_DOWNLOADED,{videoId:t.video.id,$set_once:{first_download_at:new Date().toISOString()}}),setTimeout(()=>{o(!1)},15e3);try{const n=await _(t.video.signedUrl,a);o(!1)}catch(n){E(n,"linkIdPage.handleDownload"),o(!1)}},c=a=>{const n=window.location.href,d=encodeURIComponent(n),f=encodeURIComponent(`Check out this video: ${t?.video?.title||""}`);let s="";switch(a){case"twitter":s=`https://twitter.com/intent/tweet?text=${f}&url=${d}`;break;case"facebook":s=`https://www.facebook.com/sharer/sharer.php?u=${d}`;break;case"linkedin":s=`https://www.linkedin.com/feed/?shareActive=true&text=${f}%20${d}`;break}s&&window.open(s,"_blank","width=600,height=400")};if(w)return e.jsx("div",{className:"flex items-center justify-center min-h-screen bg-gradient-to-br from-black via-gray-900 to-black",children:e.jsx("div",{className:"text-white",children:"Loading..."})});if(h||t&&!t.valid)return e.jsx("div",{className:"flex items-center justify-center min-h-screen bg-gradient-to-br from-black via-gray-900 to-black",children:e.jsxs("div",{className:"text-center max-w-md mx-auto px-4",children:[e.jsx("h1",{className:"text-2xl font-bold text-white mb-2",children:"Video Not Available"}),e.jsx("p",{className:"text-gray-400 mb-6",children:h||"This link has expired or is invalid."}),e.jsx(r,{variant:"default",size:"lg",onClick:()=>window.open("https://vidmax.ai","_blank"),className:"w-full",children:"Create Your Own Videos with Vidmax"}),e.jsx("p",{className:"text-gray-500 text-sm mt-3",children:"Join thousands creating amazing videos with AI"})]})});if(!t?.video)return null;const i=t.video.aspectRatio||"9:16",[j,N]=i.split(":"),k=Number.parseInt(j||"9",10),I=Number.parseInt(N||"16",10);return e.jsx(e.Fragment,{children:e.jsx(M,{children:e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-black via-gray-900 to-black flex items-center justify-center p-4",children:e.jsx("div",{className:"w-full max-w-5xl",children:e.jsxs("div",{className:"flex flex-col items-center justify-center w-full gap-6 md:items-start md:flex-row",children:[e.jsx("div",{className:C("relative bg-black rounded-lg overflow-hidden shadow-2xl","w-full",{"max-w-[300px]":i==="9:16","max-w-[400px]":i==="1:1"||i==="4:3","max-w-[500px]":i==="16:9"}),style:{aspectRatio:k/I},children:e.jsx("video",{className:"w-full h-full",src:t.video.signedUrl,controls:!0,autoPlay:!1,playsInline:!0,children:e.jsx("track",{kind:"captions"})})}),e.jsxs("div",{className:"flex flex-col gap-7 w-[300px]",children:[e.jsx("h1",{className:"text-xl font-semibold text-white",children:t.video.title||"Shared Video"}),e.jsx(x,{className:"bg-gray-700"}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs(r,{variant:"default",size:"lg",className:"w-full gap-2",onClick:y,disabled:g,loading:g,leftIcon:e.jsx(v,{icon:B,size:18,color:"#000000"}),children:[e.jsx("span",{children:"Download"}),t.video.fileSizeInBytes&&e.jsx(u,{sizeInBytes:t.video.fileSizeInBytes})]}),e.jsx(x,{className:"bg-gray-700 mt-2"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-400",children:"Share on Social Media"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(r,{type:"button",size:"icon",variant:"outline",onClick:()=>c("twitter"),className:"bg-gray-800 border-gray-600 text-gray-300 hover:bg-gray-700 hover:text-white hover:border-gray-500 transition-colors",children:e.jsx(v,{icon:V,size:16})}),e.jsx(r,{type:"button",size:"icon",variant:"outline",onClick:()=>c("facebook"),className:"bg-gray-800 border-gray-600 text-gray-300 hover:bg-gray-700 hover:text-white hover:border-gray-500 transition-colors",children:e.jsx(R,{size:16})}),e.jsx(r,{type:"button",size:"icon",variant:"outline",onClick:()=>c("linkedin"),className:"bg-gray-800 border-gray-600 text-gray-300 hover:bg-gray-700 hover:text-white hover:border-gray-500 transition-colors",children:e.jsx(U,{size:16})})]})]})]}),e.jsx(x,{className:"bg-gray-700"}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("div",{className:"flex px-4 py-3 text-sm font-medium bg-gray-800 rounded",children:[e.jsx("span",{className:"flex-1 text-gray-400",children:"Duration:"}),e.jsx("span",{className:"text-white",children:t.video.duration?`${Math.floor(t.video.duration)}s`:"Unknown"})]}),t.video.fileSizeInBytes&&e.jsxs("div",{className:"flex px-4 py-3 text-sm font-medium bg-gray-800 rounded",children:[e.jsx("span",{className:"flex-1 text-gray-400",children:"Size:"}),e.jsx("span",{className:"text-white",children:e.jsx(u,{sizeInBytes:t.video.fileSizeInBytes})})]})]}),e.jsx("div",{className:"text-center pt-4",children:e.jsxs("p",{className:"text-gray-400 text-sm",children:["Created with"," ",e.jsx("a",{href:"https://vidmax.ai",target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 hover:text-blue-300 transition-colors",children:"Vidmax.ai"})]})})]})]})})})})})};export{de as component}; 2//# sourceMappingURL=_linkId-OFO4rmae.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.