PageSourceSearch

https://meetspace.me/_next/static/chunks/325-9dfdb37d2a7da88d.js

js meetspace.me collected 2026-09-24 15:05:50 UTC 337,019 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[325],{3953:function(e,t,a){"use strict";a.d(t,{Z:function(){return te}});var s=a(5893),l=a(7294),r=a(1163),n=a(9008),i=a.n(n),o=a(6356),c=a(1352),d=a(5554),u=a(2841),m=a(387),p=a(221);async function x(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=await fetch("/api/upload-url",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ext:e,contentType:t,forcedKey:a})}),l=await s.json();return{...l,uploadUrl:l.uploadUrl||l.url}}async function h(e,t,a){let s=await fetch(e,{method:"PUT",headers:{"Content-Type":a},body:t});if(!s.ok)throw Error("Direct upload to R2 failed")}async function g(e){let t=document.createElement("video");t.preload="auto",t.muted=!0,t.setAttribute("muted",""),t.playsInline=!0,t.setAttribute("playsinline",""),t.autoplay=!0,t.setAttribute("autoplay",""),t.style.position="fixed",t.style.top="-9999px",t.style.opacity="0",document.body.appendChild(t);let a=URL.createObjectURL(e);t.src=a,t.load();let s=()=>{URL.revokeObjectURL(a),document.body.contains(t)&&document.body.removeChild(t)};try{await new Promise((e,a)=>{let s=setTimeout(()=>a(Error("Video load timeout")),1e4),l=()=>{clearTimeout(s),t.removeEventListener("loadeddata",l),t.removeEventListener("canplay",l),e()};t.addEventListener("loadeddata",l),t.addEventListener("canplay",l),t.addEventListener("error",()=>{clearTimeout(s),a(Error("Video load error"))},{once:!0})});let e=t.duration||0;try{await t.play()}catch(e){}t.pause(),t.currentTime=e>2?1:Math.max(0,.1*e),await new Promise((e,a)=>{let s=setTimeout(()=>a(Error("Seek timeout")),5e3);t.addEventListener("seeked",()=>{clearTimeout(s),e()},{once:!0})}),await new Promise(e=>setTimeout(e,300));let a=document.createElement("canvas");a.width=t.videoWidth||1920,a.height=t.videoHeight||1080;let l=a.getContext("2d");l.drawImage(t,0,0,a.width,a.height);let r=await new Promise(e=>a.toBlob(e,"image/jpeg",.85));return s(),{blob:r,width:a.width,height:a.height}}catch(e){throw s(),e}}async function f(e){return new Promise(t=>{let a=URL.createObjectURL(e),s=new Image;s.onload=()=>
1{try{let l=document.createElement("canvas");l.width=s.naturalWidth,l.height=s.naturalHeight;let r=l.getContext("2d");r.drawImage(s,0,0),l.toBlob(s=>{URL.revokeObjectURL(a),s?t(new File([s],e.name.replace(/\.(heic|heif)$/i,".jpg"),{type:"image/jpeg"})):t(null)},"image/jpeg",.85)}catch(e){URL.revokeObjectURL(a),t(null)}},s.onerror=()=>{URL.revokeObjectURL(a),t(null)},s.src=a})}async function b(e){let t=e.type.startsWith("video/"),s=e.type.startsWith("image/")||e.name.toLowerCase().endsWith(".heic")||e.name.toLowerCase().endsWith(".heif"),l=e,r=null,n=null,i=null,o=null,c=e.name.toLowerCase().endsWith(".heic")||e.name.toLowerCase().endsWith(".heif");if(c||"image/heic"===e.type||"image/heif"===e.type){let t=await f(e);if(t)l=t,e=t,s=!0;else if("image/jpeg"===e.type||"image/png"===e.type)e=l=new File([e],e.name.replace(/\.(heic|heif)$/i,".jpg"),{type:e.type}),s=!0;else try{let t=(await a.e(838).then(a.t.bind(a,1616,23))).default,r=await t({blob:e,toType:"image/jpeg",quality:.8}),n=Array.isArray(r)?r[0]:r;e=l=new File([n],e.name.replace(/\.(heic|heif)$/i,".jpg"),{type:"image/jpeg"}),s=!0}catch(e){console.warn("HEIC conversion failed:",e)}}if(s)try{var d;let t="image/gif"===e.type,a=await (d=e,new Promise(e=>{let t=new Image,a=URL.createObjectURL(d);t.onload=()=>{let s=document.createElement("canvas");s.width=t.naturalWidth,s.height=t.naturalHeight,s.getContext("2d").drawImage(t,0,0),URL.revokeObjectURL(a),s.toBlob(e,"image/jpeg",.92)},t.onerror=()=>{URL.revokeObjectURL(a),e(d)},t.src=a})),s=new File([a],"image.jpg",{type:"image/jpeg"});l=t?e:await (0,p.Z)(s,{maxSizeMB:3,maxWidthOrHeight:1920,useWebWorker:!0,fileType:"image/jpeg"}),o=await (0,p.Z)(s,{maxSizeMB:.5,maxWidthOrHeight:600,useWebWorker:!0,fileType:"image/jpeg"})}catch(e){console.warn("Image processing failed, uploading original:",e)}let u=null;if(t)try{let t=await g(e);u=t.blob,n=t.width,i=t.height}catch(e){console.warn("Video thumbnail generation failed:",e)}let m="image/gif"===e.type,b=s?m?"gif":"jpg":l.name.split(".").pop().toLowerCase(),v=s?m?"image/gif":"image/jpeg":e.type,y=await x(b,v);await h(y.uploadUrl,l,v);let j=null;if(s&&(j={original:y.publicUrl}),u){let e="rnbw/".concat(y.slug,"_w600.jpg"),t=await x("jpg","image/jpeg",e);await h(t.uploadUrl,u,"image/jpeg"),r=t.publicUrl}else if(o){let e=await new Promise(e=>{let t=new Image,a=URL.createObjectURL(o);t.onload=()=>{let s=document.createElement("canvas");s.width=t.naturalWidth,s.height=t.naturalHeight,s.getContext("2d").drawImage(t,0,0),URL.revokeObjectURL(a),s.toBlob(e,"image/jpeg",.82)},t.onerror=()=>{URL.revokeObjectURL(a),e(o)},t.src=a}),t="rnbw/".concat(y.slug,"_w600.jpg"),a=await x("jpg","image/jpeg",t);await h(a.uploadUrl,e,"image/jpeg"),r=a.publicUrl,j.w600=a.publicUrl}return{type:v,url:y.publicUrl,storage_key:y.key,name:e.name,thumbnail_url:r,video_width:n,video_height:i,cached_urls:j,slug:y.slug}}var v=a(7764);function y(e){let{isOpen:t,onClose:a,onSelect:r}=e,{t:n}=(0,m.$G)(),[i,o]=(0,l.useState)(""),[u,p]=(0,l.useState)([]),[x,h]=(0,l.useState)(!1);l.useEffect(()=>{let e=setTimeout(()=>{i.trim()?g(i):p([])},500);return()=>clearTimeout(e)},[i]);let g=async e=>{h(!0);try{let t=await fetch("/api/music/search?q=".concat(encodeURIComponent(e))),a=await t.json();p(a.results||[])}catch(e){console.error(e)}finally{h(!1)}};return t?(0,s.jsx)("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-[100] p-4",children:(0,s.jsxs)("div",{className:"bg-gray-800 rounded-xl w-full max-w-md border border-gray-700 overflow-hidden flex flex-col max-h-[80vh]",children:[(0,s.jsxs)("div",{className:"p-4 border-b border-gray-700 flex justify-between items-center bg-gray-850",children:[(0,s.jsxs)("h3",{className:"font-semibold text-lg flex items-center gap-2",children:[(0,s.jsx)(d.Z,{className:"w-5 h-5 text-purple-400"}),n("music.searchTitle","Search Music")]}),(0,s.jsx)("button",{onClick:a,className:"text-gray-400 hover:text-white",children:(0,s.jsx)(c.Z,{className:"w-5 h-5"})})]}),(0,s.jsxs)("div",{className:"p-4 flex-1 overflow-hidden flex flex-col",children:[(0,s.jsxs)("form",{onSubmit:e=>{e.preventDefault(),i.trim()&&g(i)},className:"relative mb-4 flex-shrink-0",children:[(0,s.jsx)("input",{autoFocus:!0,t
1ype:"text",value:i,onChange:e=>o(e.target.value),placeholder:n("music.searchPlaceholder","Search for a song..."),className:"w-full pl-10 pr-4 py-2 bg-gray-700 border border-gray-600 rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-purple-500"}),(0,s.jsx)(v.Z,{className:"w-5 h-5 absolute left-3 top-2.5 text-gray-400"}),(0,s.jsx)("button",{type:"submit",className:"hidden"})]}),(0,s.jsx)("div",{className:"overflow-y-auto space-y-2 pr-1 flex-1 min-h-[300px]",children:x?(0,s.jsx)("div",{className:"text-center py-8 text-gray-400",children:n("common.loading","Loading...")}):u.length>0?u.map(e=>(0,s.jsxs)("button",{onClick:()=>r(e.trackViewUrl),className:"w-full text-left flex items-center gap-3 p-2 hover:bg-gray-700 rounded-lg transition-colors group",children:[(0,s.jsx)("img",{src:e.artworkUrl60,alt:e.trackName,className:"w-12 h-12 rounded bg-gray-800 object-cover"}),(0,s.jsxs)("div",{className:"flex-1 overflow-hidden",children:[(0,s.jsx)("p",{className:"font-medium text-white truncate",children:e.trackName}),(0,s.jsx)("p",{className:"text-sm text-gray-400 truncate",children:e.artistName})]})]},e.trackId)):i?(0,s.jsx)("div",{className:"text-center py-8 text-gray-500",children:n("music.noResults","No results found")}):(0,s.jsxs)("div",{className:"text-center py-12 text-gray-500",children:[(0,s.jsx)(d.Z,{className:"w-12 h-12 mx-auto mb-3 opacity-20"}),(0,s.jsx)("p",{children:n("music.searchPrompt","Search for a song to attach")})]})})]})]})}):null}var j=e=>{let{message:t,onSend:a,onCancel:r,context:n,autoFocusOnce:i=!1}=e,{t:p}=(0,m.$G)(),[x,h]=(0,l.useState)(""),[g,f]=(0,l.useState)(!1),[b,v]=(0,l.useState)(!1),j=(0,l.useRef)(null);return(0,l.useLayoutEffect)(()=>{i&&!g&&j.current&&requestAnimationFrame(()=>{j.current&&(j.current.focus(),f(!0))})},[i,g]),(0,s.jsxs)("div",{className:"mt-3 p-3 bg-gray-750 rounded-lg border border-gray-700",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsxs)("span",{className:"text-sm text-purple-400 font-medium flex items-center gap-2",children:[(0,s.jsx)(o.Z,{className:"w-4 h-4"}),p("messages.replyingTo",{userName:t.userName})]}),(0,s.jsx)("button",{onClick:()=>{h(""),r()},className:"text-gray-400 hover:text-white",children:(0,s.jsx)(c.Z,{className:"w-4 h-4"})})]}),(0,s.jsx)("textarea",{ref:j,value:x,onChange:e=>{h(e.target.value)},placeholder:p("messages.replyPlaceholder",{userName:t.userName}),className:"w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-purple-500 resize-none text-[16px] sm:text-sm",style:{minHeight:"60px",maxHeight:"120px"},rows:2}),(0,s.jsxs)("div",{className:"flex justify-between items-center mt-2",children:[(0,s.jsx)("button",{onClick:()=>v(!0),className:"p-2 rounded-lg bg-gray-600 hover:bg-gray-500 mr-auto",title:p("music.addSong","Add Song"),children:(0,s.jsx)(d.Z,{className:"w-4 h-4"})}),(0,s.jsxs)("button",{onClick:()=>{x.trim()&&(a({content:x,media:[],replyToSlug:t.slug}),h(""))},disabled:!x.trim(),className:"px-4 py-2 bg-purple-600 hover:bg-purple-700 disabled:opacity-50 rounded-lg text-sm flex items-center gap-2",children:[(0,s.jsx)(u.Z,{className:"w-4 h-4"}),p("messages.reply")]})]}),(0,s.jsx)(y,{isOpen:b,onClose:()=>v(!1),onSelect:e=>{h(t=>{let a=!t||t.endsWith(" ")||t.endsWith("\n")?"":" ";return t+a+e}),v(!1),j.current&&setTimeout(()=>{j.current.style.height="auto";let e=j.current.scrollHeight;j.current.style.height=Math.min(e,120)+"px"},0)}})]})},w=a(2297),N=a(5041);let k=(0,l.memo)(e=>{let{onSend:t,placeholder:a,showTitle:r=!1,disabled:n=!1,submitLabel:i}=e,{t:o}=(0,m.$G)(),[p,x]=(0,l.useState)(""),[h,g]=(0,l.useState)(""),[f,v]=(0,l.useState)([]),[j,k]=(0,l.useState)(!1),[S,C]=(0,l.useState)(!1),[E,I]=(0,l.useState)(!1),A=(0,l.useRef)(null),F=(0,l.useRef)(null),Z=e=>{if(x(e.target.value),F.current){F.current.style.height="auto";let e=F.current.scrollHeight;F.current.style.height=Math.min(e,r?240:72)+"px"}},P=async e=>{let t=Array.from(e.target.files||[]);if(0!==t.length){k(!0);try{let e=await Promise.all(t.map(e=>b(e)));v(t=>[...t,...e])}catch(e){console.error("Upload failed:",e),alert("".concat(o("newPost.uploadFailed"),": ").concat(e.message))}finally{k(!1),A.current&&(A.current.value="")}}},T=e=>{v(t=>t.filter((t,a)=>a!==e))},D=async()=>
1{if(p.trim()||0!==f.length){I(!0);try{await t({content:p,title:r?h:void 0,media:f}),x(""),g(""),v([]),F.current&&(F.current.style.height=r?"120px":"48px")}catch(e){console.error("Failed to send post:",e)}finally{I(!1)}}};return(0,s.jsxs)(s.Fragment,{children:[r&&(0,s.jsx)("div",{className:"mb-2",children:(0,s.jsx)("input",{type:"text",value:h,onChange:e=>{g(e.target.value)},placeholder:o("newPost.titlePlaceholder"),disabled:n,className:"w-full px-4 py-2 bg-gray-700 border border-gray-600 rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-purple-500 text-[16px]"})}),f.length>0&&(0,s.jsx)("div",{className:"mb-2 flex gap-2 flex-wrap",children:f.map((e,t)=>(0,s.jsxs)("div",{className:"relative group/media",children:[e.type&&e.type.startsWith("video/")?(0,s.jsxs)("div",{className:"h-20 w-20 rounded-lg overflow-hidden bg-black flex items-center justify-center relative",children:[e.thumbnail_url?(0,s.jsx)("img",{src:e.thumbnail_url,alt:"Video",className:"w-full h-full object-cover"}):(0,s.jsx)("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"white",children:(0,s.jsx)("polygon",{points:"5,3 19,12 5,21"})}),(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,s.jsx)("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"rgba(255,255,255,0.9)",children:(0,s.jsx)("polygon",{points:"5,3 19,12 5,21"})})})]}):(0,s.jsx)("img",{src:e.url,alt:e.name,className:"h-20 w-20 object-cover rounded-lg"}),(0,s.jsx)("button",{onClick:()=>T(t),disabled:n,className:"absolute -top-2 -right-2 bg-red-600 rounded-full p-1 opacity-0 group-hover/media:opacity-100 transition-opacity disabled:opacity-50",children:(0,s.jsx)(c.Z,{className:"w-3 h-3"})})]},t))}),r?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"mb-3",children:(0,s.jsx)("textarea",{ref:F,value:p,onChange:Z,placeholder:a||o("newPost.placeholder"),disabled:n,className:"w-full px-4 py-3 bg-gray-700 border border-gray-600 rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-purple-500 resize-none overflow-y-auto text-[16px]",style:{minHeight:"120px",maxHeight:"240px"},rows:4})}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)("input",{type:"file",ref:A,onChange:P,accept:"image/*,video/*",multiple:!0,disabled:n,className:"hidden"}),(0,s.jsx)("button",{onClick:()=>{var e;return null===(e=A.current)||void 0===e?void 0:e.click()},disabled:j||n,className:"px-4 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg disabled:opacity-50 flex items-center gap-2",title:o("newPost.chooseMedia"),children:j?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.Z,{className:"w-5 h-5 animate-spin"}),(0,s.jsx)("span",{className:"text-sm",children:o("newPost.uploadingMedia")})]}):(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(N.Z,{className:"w-5 h-5"})})}),(0,s.jsx)("button",{onClick:()=>C(!0),disabled:n,className:"px-4 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg disabled:opacity-50 flex items-center gap-2 mr-auto ml-2",title:o("music.addSong","Add Song"),children:(0,s.jsx)(d.Z,{className:"w-5 h-5"})}),(0,s.jsx)("button",{onClick:D,disabled:!p.trim()&&0===f.length||j||n||E,className:"px-6 py-2 bg-purple-600 hover:bg-purple-700 disabled:opacity-50 rounded-lg font-medium flex items-center justify-center gap-2",children:E?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.Z,{className:"w-5 h-5 animate-spin"})," ",o("newPost.uploadingMedia")]}):i||o("newPost.send")})]})]}):(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{type:"file",ref:A,onChange:P,accept:"image/*,video/*",multiple:!0,disabled:n,className:"hidden"}),(0,s.jsx)("button",{onClick:()=>{var e;return null===(e=A.current)||void 0===e?void 0:e.click()},disabled:j||n,className:"px-3 py-3 bg-gray-700 hover:bg-gray-600 rounded-lg disabled:opacity-50 flex-shrink-0 flex items-center gap-2",title:o("newPost.chooseMedia"),children:j?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.Z,{className:"w-5 h-5 animate-spin"}),(0,s.jsx)("span",{className:"hidden sm:inline text-sm",children:o("newPost.uploadingMedia")})]}):(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(N.Z,{className:"w-5 h-5"})})}),(0,s.jsx)("button",{onClick:()=>C(!0),disabled:n,className:"px-3 py-3 bg-gray-700 hover:bg-gray-600 rounded-lg disabled:opacity-50 flex-shrink-0 flex items-center gap-2",title:o("music.addSong","Add Song"),children:(0,s.jsx)(d.Z,{className:"w-5 h-5"})}),(0,s.jsx)("textarea",{ref:F,value:p,onChange:Z,placeholder:a||o("newPost.placeholder"),disabled:n,className:"flex-1 px-4 py-3 bg-gray-700 border border-gray-600 rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-purple-500 resize-none overflow-y-auto text-[16px]",style:{minHeight:"48px",maxHeight:"72px"},rows:1}),(0,s.jsx)("button",{onClick:D,disabled:!p.trim()&&0===f.length||j||n||E,className:"px-6 py-3 bg-purple-600 hover:bg-purple-700 disabled:opacity-50 rounded-lg flex items-center gap-2 flex-shrink-0",children:E?(0,s.jsx)(w.Z,{className:"w-5 h-5 animate-spin mx-auto"}):i||(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.Z,{className:"w-5 h-5"}),(0,s.jsx)("span",{className:"hidden sm:inline ml-2",children:o("newPost.send")})]})})]}),(0,s.jsx)(y,{isOpen:S,onClose:()=>C(!1),onSelect:e=>{x(t=>{let a=!t||t.endsWith(" ")||t.endsWith("\n")?"":" ";return t+a+e}),C(!1),F.current&&setTimeout(()=>{F.current.style.height="auto";let e=F.current.scrollHeight;F.current.style.height=Math.min(e,r?240:72)+"px"},0)}})]})});k.displayName="NewPost";let S={current:null};var C=e=>{let{video:t,galleryMode:a=!1}=e,r=(0,l.useRef)(null),n=(0,l.useRef)(null),[i,o]=(0,l.useState)(!1),[c,d]=(0,l.useState)(!1),u=t.video_width&&t.video_height?t.video_height/t.video_width:9/16,m=(0,l.useCallback)(()=>{let e=r.current;e&&(e.pause(),e.currentTime=0,o(!1))},[]),p=(0,l.useCallback)(()=>{let e=r.current;e&&(S.current&&S.current!==e&&(S.current.pause(),S.current.currentTime=0,S.current.dispatchEvent(new CustomEvent("videoplayerstopped",{bubbles:!0}))),S.current=e,e.play().catch(()=>{}),o(!0))},[]);(0,l.useEffect)(()=>{let e=r.current;if(!e)return;let t=()=>o(!1);return e.addEventListener("videoplayerstopped",t),()=>e.removeEventListener("videoplayerstopped",t)},[]),(0,l.useEffect)(()=>
1{if(a)return;let e=n.current;if(!e)return;let t=new IntersectionObserver(e=>{let[t]=e;!t.isIntersecting&&i&&m()},{threshold:.25});return t.observe(e),()=>t.disconnect()},[i,m,a]);let x=t.thumbnail_url&&!c;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{children:"\n        .vp-video::-webkit-media-controls { display: none !important; }\n        .vp-video::-webkit-media-controls-enclosure { display: none !important; }\n        .vp-video::-webkit-media-controls-panel { display: none !important; }\n        .vp-video::-webkit-media-controls-play-button { display: none !important; }\n        .vp-video::-webkit-media-controls-timeline { display: none !important; }\n        .vp-video::-webkit-media-controls-current-time-display { display: none !important; }\n        .vp-video::-webkit-media-controls-time-remaining-display { display: none !important; }\n        .vp-video::-webkit-media-controls-mute-button { display: none !important; }\n        .vp-video::-webkit-media-controls-volume-slider { display: none !important; }\n        .vp-video::-webkit-media-controls-fullscreen-button { display: none !important; }\n        /* Firefox */\n        .vp-video::-moz-range-track { display: none !important; }\n      "}),(0,s.jsxs)("div",{ref:n,onClick:()=>{i?m():p()},style:{position:"relative",width:"100%",height:a?"100%":"auto",maxWidth:a?"100%":"".concat(Math.round(550/u),"px"),borderRadius:a?"0px":"12px",overflow:"hidden",cursor:"pointer",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center"},children:[!a&&(0,s.jsx)("div",{style:{paddingTop:"".concat((100*u).toFixed(4),"%"),width:"100%"}}),(0,s.jsx)("video",{ref:r,src:t.url,loop:!0,playsInline:!0,muted:!1,preload:"metadata",className:"vp-video",style:{position:a?"relative":"absolute",inset:a?"auto":0,width:"100%",height:"100%",objectFit:a?"contain":"cover",display:"block",maxHeight:a?"100%":"none"},onContextMenu:e=>e.preventDefault()}),!i&&(0,s.jsxs)("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:[x?(0,s.jsx)("img",{src:t.thumbnail_url,alt:"Video thumbnail",onError:()=>d(!0),style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:a?"contain":"cover",display:"block"}}):(0,s.jsx)("div",{style:{position:"absolute",inset:0,background:"linear-gradient(135deg, #1a1a2e 0%, #16213e 100%)"}}),(0,s.jsx)("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(0,0,0,0.35)"}}),(0,s.jsx)("div",{style:{position:"relative",zIndex:2,width:60,height:60,borderRadius:"50%",backgroundColor:"rgba(255,255,255,0.92)",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 24px rgba(0,0,0,0.5)",transition:"transform 0.15s ease, background-color 0.15s ease"},onMouseEnter:e=>{e.currentTarget.style.transform="scale(1.1)",e.currentTarget.style.backgroundColor="#fff"},onMouseLeave:e=>{e.currentTarget.style.transform="scale(1)",e.currentTarget.style.backgroundColor="rgba(255,255,255,0.92)"},children:(0,s.jsx)("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"#111",style:{marginLeft:3},children:(0,s.jsx)("polygon",{points:"5,3 19,12 5,21"})})})]}),i&&(0,s.jsx)("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:0,transition:"opacity 0.2s",backgroundColor:"rgba(0,0,0,0)"},className:"vp-pause-hint",onMouseEnter:e=>{e.currentTarget.style.opacity="1",e.currentTarget.style.backgroundColor="rgba(0,0,0,0.2)"},onMouseLeave:e=>{e.currentTarget.style.opacity="0",e.currentTarget.style.backgroundColor="rgba(0,0,0,0)"},children:(0,s.jsx)("div",{style:{width:52,height:52,borderRadius:"50%",backgroundColor:"rgba(255,255,255,0.8)",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 16px rgba(0,0,0,0.4)"},children:(0,s.jsxs)("svg",{viewBox:"0 0 24 24",width:"22",height:"22",fill:"#111",children:[(0,s.jsx)("rect",{x:"6",y:"4",width:"4",height:"16"}),(0,s.jsx)("rect",{x:"14",y:"4",width:"4",height:"16"})]})})})]})]})},E=a(6341),I=a(1538),A=a(1512),F=a(9482),Z=a(6179);function P(e){let{slug:t}=e,{t:a}=(0,m.$G)(),[r,n]=(0,l.useState)(null),[i,o]=(0,l.useState)(!0),[c,d]=(0,l.useState)(!1),[u,p]=(0,l.useState)(0),x=(0,l.useRef)(null);return((0,l.useEffect)(()=>{let e=!0,a=async()=>{try{let a=await fetch("/api/music/song?slug=".concat(t));if(a.ok){let t=await a.json();e&&n(t)}}catch(e){console.error("Failed to load song:",e)}finally{e&&o(!1)}};return a(),()=>{e=!1}},[t]),(0,l.useEffect)(()=>{let e=x.current;if(!e)return;let t=()=>{p(e.currentTime/e.duration*100)},a=()=>{d(!1),p(0)};return e.addEventListener("timeupdate",t),e.addEventListener("ended",a),()=>{e.removeEventListener("timeupdate",t),e.removeEventListener("ended",a)}},[r]),i)?(0,s.jsx)("div",{className:"animate-pulse bg-gray-800 h-[380px] w-full max-w-[300px] rounded-xl mt-2 mb-2"}):r?(0,s.jsxs)("div",{className:"flex flex-col gap-3 bg-gray-800/80 backdrop-blur border border-gray-700/50 p-4 rounded-xl mt-2 mb-2 w-full max-w-[300px] transition-colors hover:bg-gray-800",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"relative group cursor-pointer w-full rounded-lg overflow-hidden shadow-md",onClick:()=>{x.current&&(c?x.current.pause():x.current.play(),d(!c))},children:[r.cover_url?(0,s.jsx)("img",{src:r.cover_url,alt:r.title,className:"w-full h-auto aspect-square object-cover block"}):(0,s.jsx)("div",{className:"w-full aspect-square bg-gray-700 flex items-center justify-center",children:(0,s.jsx)(F.Z,{className:"w-12 h-12 text-gray-500"})}),(0,s.jsx)("div",{className:"absolute inset-0 bg-black/40 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:c?(0,s.jsx)(Z.Z,{className:"w-12 h-12 text-white fill-white"}):(0,s.jsx)(F.Z,{className:"w-12 h-12 text-white fill-white ml-2"})})]}),(0,s.jsxs)("div",{className:"flex flex-col w-full",children:[(0,s.jsxs)("div",{className:"flex justify-between items-start mb-2",children:[(0,s.jsxs)("div",{className:"truncate pr-2",children:[(0,s.jsx)("h4",{className:"font-semibold text-gray-100 truncate text-base leading-tight",children:(0,s.jsx)("a",{href:"/song/".concat(t),className:"hover:underline",children:r.title})}),(0,s.jsx)("p",{className:"text-gray-400 text-sm truncate mt-1",children:r.artist})]}),(0,s.jsxs)("div",{className:"flex gap-2 flex-shrink-0 items-center",children:[r.apple_url&&(0,s.jsx)("a",{href:r.apple_url,target:"_blank",rel:"noreferrer",className:"text-gray-500 hover:text-white transition-colors",title:a("music.openApple","Open in Apple Music"),children:(0,s.jsx)("svg",{viewBox:"0 0 24 24",className:"w-4 h-4 fill-current","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M23.994 6.124a9.23 9.23 0 00-.24-2.19c-.317-1.31-1.062-2.31-2.18-3.043a5.022 5.022 0 00-1.877-.726 10.496 10.496 0 00-1.564-.15c-.04-.003-.083-.01-.124-.013H5.986c-.152.01-.303.017-.455.026-.747.043-1.49.123-2.193.4-1.336.53-2.3 1.452-2.865 2.78-.192.448-.292.925-.363 1.408-.056.392-.088.785-.1 1.18 0 .032-.007.062-.01.
1093v12.223c.01.14.017.283.027.424.05.815.154 1.624.497 2.373.65 1.42 1.738 2.353 3.234 2.801.42.127.856.187 1.293.228.555.053 1.11.06 1.667.06h11.03a12.5 12.5 0 001.57-.1c.822-.106 1.596-.35 2.295-.81a5.046 5.046 0 001.88-2.207c.186-.42.293-.87.37-1.324.113-.675.138-1.358.137-2.04-.002-3.8 0-7.595-.003-11.393zm-6.423 3.99v5.712c0 .417-.058.827-.244 1.206-.29.59-.76.962-1.388 1.14-.35.1-.706.157-1.07.173-.95.045-1.773-.6-1.943-1.536a1.88 1.88 0 011.038-2.022c.323-.16.67-.25 1.018-.324.378-.082.758-.153 1.134-.24.274-.063.457-.23.51-.516a.904.904 0 00.02-.193c0-1.815 0-3.63-.002-5.443a.725.725 0 00-.026-.185c-.04-.15-.15-.243-.304-.234-.16.01-.318.035-.475.066-.76.15-1.52.303-2.28.456l-2.325.47-1.374.278c-.016.003-.032.01-.048.013-.277.077-.377.203-.39.49-.002.042 0 .086 0 .13-.002 2.602 0 5.204-.003 7.805 0 .42-.047.836-.215 1.227-.278.64-.77 1.04-1.434 1.233-.35.1-.71.16-1.075.172-.96.036-1.755-.6-1.92-1.544-.14-.812.23-1.685 1.154-2.075.357-.15.73-.232 1.108-.31.287-.06.575-.116.86-.177.383-.083.583-.323.6-.714v-.15c0-2.96 0-5.922.002-8.882 0-.123.013-.25.042-.37.07-.285.273-.448.546-.518.255-.066.515-.112.774-.165.733-.15 1.466-.296 2.2-.444l2.27-.46c.67-.134 1.34-.27 2.01-.403.22-.043.442-.088.663-.106.31-.025.523.17.554.482.008.073.012.148.012.223.002 1.91.002 3.822 0 5.732z"})})}),(r.spotify_url||r.isrc)&&(0,s.jsx)("a",{href:r.spotify_url||"https://open.spotify.com/search/isrc:".concat(r.isrc),target:"_blank",rel:"noreferrer",className:"text-gray-500 hover:text-white transition-colors",title:a("music.openSpotify","Open in Spotify"),children:(0,s.jsx)("svg",{viewBox:"0 0 24 24",className:"w-5 h-5 fill-current","aria-hidden":"true",children:(0,s.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm4.588 14.434c-.183.3-.564.402-.863.22-2.366-1.446-5.348-1.774-8.86-.973-.342.078-.68-.135-.758-.476-.078-.34.135-.68.476-.758 3.834-.875 7.126-.496 9.786 1.125.3.18.402.56.22.862zm1.31-3.104c-.23.376-.723.49-1.1.258-2.7-1.657-6.84-2.13-9.84-1.164-.42.135-.872-.095-1.008-.516-.135-.42.096-.872.517-1.008 3.486-1.123 8.082-.596 11.173 1.303.377.23.49.724.26 1.127zm.134-3.238C14.778 8.125 8.567 7.92 4.985 9.01c-.512.155-1.056-.134-1.21-.645-.155-.512.134-1.056.645-1.21 4.14-1.26 11.02-1.023 14.887 1.27.464.276.613.882.338 1.346-.275.464-.88.613-1.344.338z"})})})]})]}),r.preview_url?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("audio",{ref:x,src:r.preview_url}),(0,s.jsx)("div",{className:"h-1 bg-gray-700 rounded-full mt-2 overflow-hidden cursor-pointer",onClick:e=>{if(x.current){let t=e.currentTarget.getBoundingClientRect(),a=e.clientX-t.left,s=a/t.width;x.current.currentTime=s*x.current.duration}},children:(0,s.jsx)("div",{className:"h-full bg-purple-500 rounded-full transition-all duration-100 ease-linear",style:{width:"".concat(u,"%")}})})]}):(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-2",children:a("music.noPreview","No audio preview available")})]})]}):null}var T=a(3742),D=a(4463),_=a(9461),M=a(9525),U=a(1408),R=a(7420),O=a(9455),L=a(4979),z=a(1012),B=a(3217),W=a(2701);let K=[{category:"storage",categoryName:"Storage & Media",features:[{name:"Unlimited photo and video storage with highest quality",tag:"Public",desc:"Upload and preserve photos and videos in original uncompressed quality for public posts.",free:!0,plus:!0,business:!0},{name:"Unlimited photo and video storage with highest quality",tag:"Private Albums",desc:"Store unlimited high-resolution photos and videos inside private, secure albums.",free:!1,plus:!0,business:!0}]},{category:"account",categoryName:"Account & Profile",features:[{name:"Multi-Account Flexibility",desc:"Create and seamlessly switch between multiple distinct profiles under one account.",free:"2",plus:"5",business:"5"},{name:"Customize your profile with different colors, music, and fonts",desc:"Express yourself with personalized color palettes, profile background tracks, and unique fonts.",free:!1,plus:!0,business:!0}]},{category:"community",categoryName:"Community & Groups",features:[{name:"Acce
1ss to groups",desc:"Join and participate in community groups, interest spaces, and team discussion hubs.",free:!1,plus:!0,business:!0},{name:"Create your groups for your community, work, friends, or interests",tag:"No Data Monetization",desc:"Launch custom groups with absolute privacy control — no data monetization, you keep your data.",free:!1,plus:!1,business:!0}]},{category:"business",categoryName:"Business & AI Suite",features:[{name:"Access to Business Suite",desc:"Unlock powerful management dashboards, team workspace tools, and business operations.",free:!1,plus:!1,business:!0},{name:"GoodAI website and link-in-bio builder",desc:"AI-assisted site builder to easily design clean, high-converting websites and landing pages.",free:!1,plus:!1,business:!0},{name:"GoodAI smart bookings",desc:"Get fully customizable custom calendar for your client appointments or business meetings.",free:!1,plus:!1,business:!0},{name:"GoodAI Compass Coach & MyAIAvatar business license*",linkWord:"MyAIAvatar",linkUrl:"https://createmyaiavatar.com",desc:"AI avatar license and business agentic engine powered by GoodAI's triple consensus architecture.",free:!1,plus:!1,business:!0}]},{category:"tools",categoryName:"Tools & Events",features:[{name:"QRDb smart QR code generator with your custom domain",linkWord:"QRDb",linkUrl:"https://ovrtxt.me/whitelabel",desc:"Generate branded smart QR codes routed through your custom domain with live analytics.",free:!1,plus:!1,business:!0},{name:"%0 commission for your events",desc:"Organize and host ticketed events with 0% platform fee on all ticket sales.",free:!1,plus:!1,business:"0%"}]}];function q(e){let{isAuthenticated:t,autotarihok:a}=e,n=(0,r.useRouter)(),[i,o]=(0,l.useState)(null),[c,d]=(0,l.useState)(!1),[u,m]=(0,l.useState)("all"),[p,x]=(0,l.useState)(""),h=a&&new Date(a)>new Date,g=async e=>{if(!t){n.push("/");return}try{o(e);let t=await fetch("/api/stripe/checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:e})}),a=await t.json();a.url?window.location.href=a.url:(alert("Failed to initiate checkout. Please try again later."),o(null))}catch(e){console.error(e),alert("An error occurred. Please try again."),o(null)}},f=K.map(e=>{if("all"!==u&&e.category!==u)return null;let t=e.features.filter(e=>{if(!p.trim())return!0;let t=p.toLowerCase();return e.name.toLowerCase().includes(t)||e.desc&&e.desc.toLowerCase().includes(t)||e.tag&&e.tag.toLowerCase().includes(t)});return 0===t.length?null:{...e,features:t}}).filter(Boolean);f.reduce((e,t)=>e+t.features.length,0);let b=e=>!0===e?(0,s.jsx)("div",{className:"w-7 h-7 rounded-full bg-emerald-500/20 border border-emerald-500/40 flex items-center justify-center mx-auto text-emerald-400",children:(0,s.jsx)(T.Z,{className:"w-4 h-4"})}):!1===e?(0,s.jsx)("span",{className:"text-gray-600 font-medium",children:"—"}):(0,s.jsx)("span",{className:"inline-block px-3 py-1 bg-emerald-500/10 text-emerald-300 border border-emerald-500/30 rounded-lg text-sm font-semibold",children:e});return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{className:"min-h-screen bg-[#0a0a0a] text-white selection:bg-emerald-500/30 selection:text-white font-sans relative overflow-hidden",children:[(0,s.jsx)("div",{className:"absolute top-[-20%] left-[-10%] w-[800px] h-[800px] bg-emerald-600/10 blur-[120px] rounded-full pointer-events-none"}),(0,s.jsx)("div",{className:"absolute bottom-[10%] right-[-10%] w-[600px] h-[600px] bg-teal-600/10 blur-[100px] rounded-full pointer-events-none"}),(0,s.jsxs)("div",{className:"pt-32 pb-24 px-6 max-w-5xl mx-auto relative z-10",children:[(0,s.jsxs)("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-emerald-500/10 border border-emerald-500/20 text-emerald-300 text-sm font-medium mb-8",children:[(0,s.jsx)("span",{className:"w-2 h-2 rounded-full bg-emerald-400 animate-pulse"}),"Privacy-first, community-managed social media starts here"]}),(0,s.jsxs)("h1",{className:"text-6xl md:text-8xl lg:text-9xl font-black tracking-tighter leading-[0.9] mb-10 text-transparent bg-clip-text bg-gradient-to-br from-emerald-300 via-white to-teal-600",children:["Your network.",(0,s.jsx)("br",{}),"Not theirs."]}),(0,s.jsxs)("p",{className:"text-2xl md:text-4xl text-gray-400 font-medium max-w-4xl leading-tight tracking-tight",children:["MeetSpace is a nonprofit, community-managed social media platform built to put people, privacy, and shared ownership first.",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Unlike traditional social media platforms, MeetSpace is not built to be sold, acquired, or controlled by outside investors. The platform exists for its community and is designed to remain independent, transparent, and focused on long-term public benefit.",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"MeetSpace is governed by its community, with opportunities for members to participate in shaping its future, contributing ideas, and helping guide platform decisions.",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Our mission is simple: create a social network where people can connect, share, and communicate freely — without sacrificing privacy, ownership, or control of their digital lives."]})]}),(0,s.jsxs)("div",{className:"max-w-5xl mx-auto px-6 py-12",children:[(0,s.jsx)("div",{className:"mb-12 flex flex-col md:flex-row md:items-end justify-between gap-6 border-t border-white/10 pt-12",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-4xl font-bold tracking-tight mb-3",children:"MeetSpace+"}),(0,s.jsx)("p",{className:"text-xl text-gray-500 max-w-xl",children:"Support our mission and unlock powerful tools designed for creators and businesses."})]})}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 md:gap-6 mb-24 relative z-10",children:[(0,s.jsxs)("div",{className:"bg-[#111]/80 backdrop-blur-sm hover:bg-[#151515] transition-colors border border-white/5 hover:border-emerald-500/30 rounded-3xl p-8 md:p-10 flex flex-col justify-between group shadow-lg",children:[(0,s.jsx)("div",{className:"w-14 h-14 bg-emerald-500/10 border border-emerald-500/20 rounded-2xl flex items-center justify-center mb-8 group-hover:scale-110 group-hover:bg-emerald-500/20 transition-all duration-500",children:(0,s.jsx)(D.Z,{className:"w-7 h-7 text-emerald-400"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-2xl font-bold mb-3 text-white",children:"Privacy by Design"}),(0,s.jsx)("p",{className:"text-gray-400 text-lg leading-relaxed",children:"No data sharing, no tracking, no monetization of personal data, and no use of your content for AI training — ever."})]})]}),(0,s.jsxs)("div",{className:"bg-[#111]/80 backdrop-blur-sm hover:bg-[#151515] transition-colors border border-white/5 hover:border-emerald-500/30 rounded-3xl p-8 md:p-10 flex flex-col justify-between group shadow-lg",children:[(0,s.jsx)("div",{className:"w-14 h-14 bg-emerald-500/10 border border-emerald-500/20 rounded-2xl flex items-center justify-center mb-8 group-hover:scale-110 group-hover:bg-emerald-500/20 transition-all duration-500",children:(0,s.jsx)(_.Z,{className:"w-7 h-7 text-emerald-400"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-2xl font-bold mb-3 text-white",children:"Unlimited Lifetime Cloud Space"}),(0,s.jsx)("p",{className:"text-gray-400 text-lg leading-relaxed",children:"Share your videos and photos with 
1no quality loss, preserving your memories in their original quality."})]})]}),(0,s.jsxs)("div",{className:"bg-[#111]/80 backdrop-blur-sm hover:bg-[#151515] transition-colors border border-white/5 hover:border-emerald-500/30 rounded-3xl p-8 md:p-10 flex flex-col justify-between group shadow-lg",children:[(0,s.jsx)("div",{className:"w-14 h-14 bg-emerald-500/10 border border-emerald-500/20 rounded-2xl flex items-center justify-center mb-8 group-hover:scale-110 group-hover:bg-emerald-500/20 transition-all duration-500",children:(0,s.jsx)(M.Z,{className:"w-7 h-7 text-emerald-400"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-2xl font-bold mb-3 text-white",children:"Multi-Account Flexibility"}),(0,s.jsx)("p",{className:"text-gray-400 text-lg leading-relaxed",children:"Create and manage up to 5 distinct accounts with one phone number for personal and work use."})]})]}),(0,s.jsxs)("div",{className:"bg-[#111]/80 backdrop-blur-sm hover:bg-[#151515] transition-colors border border-white/5 hover:border-emerald-500/30 rounded-3xl p-8 md:p-10 flex flex-col justify-between group shadow-lg",children:[(0,s.jsx)("div",{className:"w-14 h-14 bg-emerald-500/10 border border-emerald-500/20 rounded-2xl flex items-center justify-center mb-8 group-hover:scale-110 group-hover:bg-emerald-500/20 transition-all duration-500",children:(0,s.jsx)(U.Z,{className:"w-7 h-7 text-emerald-400"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-2xl font-bold mb-3 text-white",children:"Personalized Profiles"}),(0,s.jsx)("p",{className:"text-gray-400 text-lg leading-relaxed",children:"Customize your profile for free and get early access to new features as MeetSpace continues to grow. Express yourself without limits."})]})]}),(0,s.jsxs)("div",{className:"bg-[#111]/80 backdrop-blur-sm hover:bg-[#151515] transition-colors border border-white/5 hover:border-emerald-500/30 rounded-3xl p-8 md:p-10 flex flex-col justify-between group shadow-lg",children:[(0,s.jsx)("div",{className:"w-14 h-14 bg-emerald-500/10 border border-emerald-500/20 rounded-2xl flex items-center justify-center mb-8 group-hover:scale-110 group-hover:bg-emerald-500/20 transition-all duration-500",children:(0,s.jsx)(R.Z,{className:"w-7 h-7 text-emerald-400"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-2xl font-bold mb-3 text-white",children:"Community Ownership"}),(0,s.jsx)("p",{className:"text-gray-400 text-lg leading-relaxed",children:"Gain a direct ownership stake and actively participate in the governance of the entire platform."})]})]}),(0,s.jsxs)("div",{className:"bg-[#111]/80 backdrop-blur-sm hover:bg-[#151515] transition-colors border border-white/5 hover:border-emerald-500/30 rounded-3xl p-8 md:p-10 flex flex-col justify-between group shadow-lg",children:[(0,s.jsx)("div",{className:"w-14 h-14 bg-emerald-500/10 border border-emerald-500/20 rounded-2xl flex items-center justify-center mb-8 group-hover:scale-110 group-hover:bg-emerald-500/20 transition-all duration-500",children:(0,s.jsx)(O.Z,{className:"w-7 h-7 text-emerald-400"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-2xl font-bold mb-3 text-white",children:"Business & AI Tools"}),(0,s.jsx)("p",{className:"text-gray-400 text-lg leading-relaxed",children:"Securely automate and enhance workflows using privacy-first business AI tools, powered by GoodAI. Grow your brand without compromising your values."})]})]})]}),(0,s.jsx)("div",{className:"flex flex-col items-center justify-center mb-12 relative z-10",children:(0,s.jsx)("button",{onClick:()=>d(!c),className:"inline-flex items-center gap-3 text-emerald-400 hover:text-emerald-300 font-bold text-lg hover:underline transition-all group px-8 py-4 rounded-full bg-emerald-500/10 border border-emerald-500/30 hover:bg-emerald-500/20 hover:border-emerald-400/50 shadow-[0_0_25px_rgba(16,185,129,0.15)] cursor-pointer",children:c?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(L.Z,{className:"w-5 h-5 group-hover:-translate-y-1 transition-transform"}),(0,s.jsx)("span",{children:"Hide feature details"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(z.Z,{className:"w-5 h-5 group-hover:rotate-90 transition-transform duration-300"}),(0,s.jsx)("span",{children:"Show all features with details"})]})})}),c&&(0,s.jsxs)("div",{className:"mb-16 relative z-10 transition-all duration-500 animate-fadeIn",children:[!1,(0,s.jsxs)("div",{className:"bg-[#111]/90 backdrop-blur-md border border-white/10 rounded-3xl overflow-hidden shadow-2xl",children:[(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)("table",{className:"w-full min-w-[768px] border-collapse text-left",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"border-b border-white/10 bg-[#161616]/95 backdrop-blur-md sticky top-0 z-20",children:[(0,s.jsx)("th",{className:"p-6 w-[40%] text-sm font-bold text-gray-400 uppercase tracking-wider",children:"Features & Capabilities"}),(0,s.jsxs)("th",{className:"p-6 w-[20%] text-center border-l border-white/5 bg-white/[0.01]",children:[(0,s.jsx)("div",{className:"font-bold text-xl text-white",children:"MeetSpace"}),(0,s.jsx)("div",{className:"text-emerald-400 font-semibold text-sm mt-0.5",children:"(Free)"})]}),(0,s.jsxs)("th",{className:"p-6 w-[20%] text-center border-l border-white/5 bg-emerald-500/[0.03]",children:[(0,s.jsx)("div",{className:"font-bold text-xl text-white",children:"MeetSpace+"}),(0,s.jsx)("div",{className:"text-emerald-400 font-semibold text-sm mt-0.5",children:"($1/month)"})]}),(0,s.jsxs)("th",{className:"p-6 w-[20%] text-center border-l border-white/5 bg-teal-500/[0.05]",children:[(0,s.jsx)("div",{className:"inline-block px-2.5 py-0.5 rounded-full bg-teal-500/20 text-teal-300 text-[10px] font-bold uppercase tracking-wider mb-1",children:"Business Suite"}),(0,s.jsx)("div",{className:"font-bold text-xl text-white",children:"MeetSpace+ Business**"}),(0,s.jsx)("div",{className:"text-teal-300 font-semibold text-sm mt-0.5",children:"($24.99/month)"})]})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-white/5",children:f.length>0?f.map(e=>(0,s.jsxs)(l.Fragment,{children:[(0,s.jsx)("tr",{className:"bg-white/[0.02]",children:(0,s.jsx)("td",{colSpan:4,className:"px-6 py-3 text-xs font-bold text-emerald-400 uppercase tracking-widest bg-emerald-500/5 border-y border-emerald-500/10",children:e.categoryName})}),e.features.map((e,t)=>(0,s.jsxs)("tr",{className:"hover:bg-white/[0.03] transition-colors group",children:[(0,s.jsx)("td",{className:"p-6",children:(0,s.jsx)("div",{className:"flex items-start gap-2.5",children:(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"font-semibold text-white group-hover:text-emerald-300 transition-colors text-base flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{children:e.linkWord&&e.linkUrl&&e.name.includes(e.linkWord)?(()=>{let t=e.name.split(e.linkWord);return(0,s.jsxs)(s.Fragment,{children:[t[0],(0,s.jsx)("a",{href:e.linkUrl,target:"_blank",rel:"noopener noreferrer",className:"text-emerald-400 hover:text-emerald-300 hover:underline font-bold transition-colors underline-offset-2",onClick:e=>e.stopPropagation(),children:e.linkWord}),t.slice(1).join(e.linkWord)]})})():e.name}),e.tag&&(0,s.jsx)("span",{className:"text-xs px-2 py-0.5 rounded-md bg-white/10 text-emerald-300 font-medium",children:e.tag})]}),e.desc&&(0,s.jsx)("p",{className:"text-sm text-gray-400 mt-1 leading-relaxed",children:e.desc})]})})}),(0,s.jsx)("td",{className:"p-6 text-center border-l border-white/5 bg-white/[0.01]",children:b(e.free)}),(0,s.jsx)("td",{className:"p-6 text-center border-l border-white/5 bg-emerald-500/[0.02]",children:b(e.plus)}),(0,s.jsx)("td",{className:"p-6 text-center border-l border-white/5 bg-teal-500/[0.03]",children:b(e.business)})]},t))]},e.category)):(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{colSpan:4,className:"p-12 text-center text-gray-400",children:['No features found matching "',p,'".']})})})]})}),(0,s.jsxs)("div",{className:"p-4 bg-white/[0.02] border-t border-white/5 text-xs text-gray-500 italic space-y-1",children:[(0,s.jsx)("p",{children:"* Triple Consensus Architecture delivers multi-layered AI reasoning, contextual avatar synthesis, and automated business coaching."}),(0,s.jsx)("p",{children:"** MeetSpace+ Business Suite is currently available by invitation only."})]})]})]}),h?(0,s.jsxs)("div",{className:"mb-24 relative z-10 flex flex-col items-center justify-center p-12 bg-[#111]/80 backdrop-blur-sm border border-emerald-500/30 rounded-[2rem] 
1shadow-xl text-center",children:[(0,s.jsx)("div",{className:"w-20 h-20 bg-emerald-500/10 border border-emerald-500/20 rounded-full flex items-center justify-center mb-6 shadow-[0_0_30px_rgba(16,185,129,0.3)]",children:(0,s.jsx)(R.Z,{className:"w-10 h-10 text-emerald-400"})}),(0,s.jsx)("h3",{className:"text-3xl md:text-4xl font-bold mb-4 text-transparent bg-clip-text bg-gradient-to-br from-emerald-300 via-white to-teal-600",children:"Thank you for your support on MeetSpace!"}),(0,s.jsx)("p",{className:"text-xl text-gray-400 max-w-2xl mb-2",children:"Your support is vital in keeping this platform independent, ad-free, and community-managed."}),new Date(a).getFullYear()>new Date().getFullYear()+50?(0,s.jsx)("p",{className:"text-lg text-emerald-500/80 mb-10 font-medium px-4 py-1.5 rounded-full bg-emerald-500/10 border border-emerald-500/20 inline-block mt-4",children:"Lifetime Membership Active"}):(0,s.jsxs)("p",{className:"text-lg text-emerald-500/80 mb-10 font-medium px-4 py-1.5 rounded-full bg-emerald-500/10 border border-emerald-500/20 inline-block mt-4",children:["Next renewal date: ",new Date(a).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})]}),(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)("button",{onClick:async()=>{if(window.confirm("Are you sure you want to cancel your membership? You will retain access until the end of your current billing period."))try{let e=await fetch("/api/stripe/cancel",{method:"POST"});if(e.ok)alert("Your membership has been cancelled successfully."),window.location.reload();else{let t=await e.json();alert(t.error||"Failed to cancel membership.")}}catch(e){alert("An error occurred. Please try again.")}},className:"px-6 py-3 rounded-xl border border-white/10 text-gray-400 hover:bg-white/5 hover:text-white transition-colors text-sm font-medium",children:"Cancel Membership"})})]}):(0,s.jsx)("div",{className:"mb-24 relative z-10",children:(0,s.jsxs)("div",{className:"grid md:grid-cols-2 gap-6",children:[(0,s.jsxs)("div",{className:"bg-[#111]/90 backdrop-blur-md border border-white/10 hover:border-emerald-500/30 transition-colors rounded-[2rem] p-10 md:p-12 flex flex-col shadow-xl",children:[(0,s.jsx)("h4",{className:"text-2xl font-bold mb-2",children:"Monthly Supporter"}),(0,s.jsx)("p",{className:"text-gray-400 mb-12 text-lg",children:"Access all features and support the global privacy-first nonprofit social media platform."}),(0,s.jsxs)("div",{className:"mt-auto mb-10",children:[(0,s.jsx)("span",{className:"text-6xl font-black tracking-tighter",children:"$1"}),(0,s.jsx)("span",{className:"text-xl text-gray-500 font-medium",children:"/mo"})]}),(0,s.jsx)("button",{onClick:()=>g("monthly"),disabled:null!==i,className:"w-full py-5 rounded-2xl bg-white text-black font-bold text-lg hover:bg-emerald-50 hover:text-emerald-900 transition-colors flex items-center justify-center gap-2 group disabled:opacity-50",children:"monthly"===i?(0,s.jsx)(B.Z,{className:"w-5 h-5 animate-spin"}):(0,s.jsxs)(s.Fragment,{children:["Upgrade Now",(0,s.jsx)(W.Z,{className:"w-5 h-5 group-hover:translate-x-1 transition-transform"})]})})]}),(0,s.jsxs)("div",{className:"bg-gradient-to-b from-[#111] to-[#0a0a0a] border border-emerald-500/40 hover:border-emerald-400/60 transition-colors rounded-[2rem] p-10 md:p-12 flex flex-col relative shadow-[0_0_50px_rgba(16,185,129,0.1)] mt-8 md:mt-0",children:[(0,s.jsx)("div",{className:"absolute -top-4 left-1/2 -translate-x-1/2",children:(0,s.jsx)("div",{className:"bg-emerald-500 text-white text-xs font-bold px-4 py-2 rounded-full uppercase tracking-wider shadow-lg whitespace-nowrap",children:"First 100k Users"})}),(0,s.jsx)("h4",{className:"text-2xl font-bold mb-2 text-emerald-400",children:"Lifetime Membership"}),(0,s.jsx)("p",{className:"text-gray-400 text-lg",children:"Includes an optional ownership opportunity in the platform."}),(0,s.jsx)("p",{className:"text-sm text-emerald-500/70 mt-2 font-medium",children:"Read our whitepaper for details"}),(0,s.jsxs)("div",{className:"mt-auto mb-10",children:[(0,s.jsx)("span",{className:"text-6xl font-black tracking-tighter text-white",children:"$12"}),(0,s.jsx)("span",{className:"text-xl text-gray-500 font-medium",children:" once"})]}),(0,s.jsx)("button",{onClick:()=>g("lifetime"),disabled:null!==i,className:"w-full py-5 rounded-2xl bg-emerald-500 text-white font-bold text-lg hover:bg-emerald-400 transition-colors flex items-center justify-center gap-2 group shadow-[0_0_30px_rgba(16,185,129,0.3)] disabled:opacity-50",children:"lifetime"===i?(0,s.jsx)(B.Z,{className:"w-5 h-5 animate-spin"}):(0,s.jsxs)(s.Fragment,{children:["Upgrade Now",(0,s.jsx)(W.Z,{className:"w-5 h-5 group-hover:translate-x-1 transition-transform"})]})})]})]})})]})]})})}var H=a(5977),J=a(7369),V=a(5162),G=a(8835),Y=a(792),$=a(6583),Q=a(2367),X=a(4171),ee=a(3761),et=a(7737);function ea(){let[e,t]=(0,l.useState)("hot"),[a,r]=(0,l.useState)({1:!0,2:!1,3:!1}),n=e=>{r(t=>({...t,[e]:!t[e]}))};return(0,s.jsxs)("div",{className:"landing-features-wrapper",children:[(0,s.jsx)("style",{children:'\n  @keyframes marquee-left {\n    0% { transform: translateX(0%); }\n    100% { transform: translateX(-50%); }\n  }\n  @keyframes marquee-right {\n    0% { transform: translateX(-50%); }\n    100% { transform: translateX(0%); }\n  }\n  @keyframes pulse-glow {\n    0%, 100% { opacity: 0.6; transform: scale(1); }\n    50% { opacity: 1; transform: scale(1.05); }\n  }\n  @keyframes sound-wave-1 { 0%, 100% { height: 6px; } 50% { height: 20px; } }\n  @keyframes sound-wave-2 { 0%, 100% { height: 18px; } 50% { height: 8px; } }\n  @keyframes sound-wave-3 { 0%, 100% { height: 10px; } 50% { height: 24px; } }\n  @keyframes sound-wave-4 { 0%, 100% { height: 22px; } 50% { height: 12px; } }\n  @keyframes rainbow-border {\n    0% { background-position: 0% 50%; }\n    50% { background-position: 100% 50%; }\n    100% { background-position: 0% 50%; }\n  }\n\n  .landing-features-wrapper {\n    background: #0d0e12;\n    background-image: \n      radial-gradient(circle at 10% 20%, rgba(88, 101, 242, 0.12) 0%, transparent 40%),\n      radial-gradient(circle at 90% 60%, rgba(255, 69, 0, 0.12) 0%, transparent 45%),\n      radial-gradient(circle at 50% 90%, rgba(235, 69, 158, 0.10) 0%, transparent 50%);\n    color: #ffffff;\n    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;\n    overflow-x: hidden;\n    line-height: 1.5;\n    position: relative;\n  }\n\n  .landing-container {\n    max-width: 1240px;\n    margin: 0 auto;\n    padding: 0 20px;\n  }\n\n  /* Section Intro Header */\n  .section-hero-header {\n    text-align: center;\n    padding: 60px 20px 40px;\n    position: relative;\n  }\n  .hero-top-badge {\n    display: inline-flex;
1\n    align-items: center;\n    gap: 8px;\n    background: linear-gradient(90deg, rgba(88, 101, 242, 0.2), rgba(255, 69, 0, 0.2));\n    border: 1px solid rgba(88, 101, 242, 0.5);\n    color: #ffffff;\n    padding: 8px 18px;\n    border-radius: 999px;\n    font-size: 0.85rem;\n    font-weight: 800;\n    text-transform: uppercase;\n    letter-spacing: 0.08em;\n    margin-bottom: 24px;\n    box-shadow: 0 0 24px rgba(88, 101, 242, 0.25);\n  }\n  .section-hero-header h2.main-hero-title {\n    font-size: clamp(2.4rem, 5vw, 3.8rem);\n    font-weight: 900;\n    line-height: 1.1;\n    letter-spacing: -0.03em;\n    margin-bottom: 20px;\n    text-transform: uppercase;\n  }\n  .gradient-text-friends {\n    background: linear-gradient(90deg, #FF0038 0%, #FF5500 50%, #FFA200 100%);\n    -webkit-background-clip: text;\n    -webkit-text-fill-color: transparent;\n    display: inline-block;\n  }\n  .gradient-text-creators {\n    background: linear-gradient(90deg, #FFC000 0%, #FFE600 35%, #36D665 70%, #00EA96 100%);\n    -webkit-background-clip: text;\n    -webkit-text-fill-color: transparent;\n    display: inline-block;\n  }\n  .gradient-text-audience {\n    background: linear-gradient(90deg, #00D4FF 0%, #0062FF 45%, #9416F5 100%);\n    -webkit-background-clip: text;\n    -webkit-text-fill-color: transparent;\n    display: inline-block;\n  }\n  .section-hero-subtitle {\n    font-size: clamp(0.95rem, 3vw, 1.25rem);\n    color: #a3a6aa;\n    max-width: 720px;\n    margin: 0 auto 28px;\n    line-height: 1.6;\n  }\n\n  /* Highlights Pill Bar */\n  .stats-pill-bar {\n    display: flex;\n    flex-wrap: wrap;\n    justify-content: center;\n    gap: 14px;\n    margin-bottom: 20px;\n  }\n  .stat-pill {\n    display: inline-flex;\n    align-items: center;\n    gap: 8px;\n    background: #18191c;\n    border: 1px solid #2b2d31;\n    padding: 8px 16px;\n    border-radius: 999px;\n    font-size: 0.9rem;\n    font-weight: 700;\n    color: #e0e2e5;\n    box-shadow: 0 4px 12px rgba(0,0,0,0.2);\n    transition: all 0.25s ease;\n  }\n  .stat-pill:hover {\n    border-color: #5865F2;\n    transform: translateY(-2px);\n    box-shadow: 0 8px 20px rgba(88, 101, 242, 0.2);\n  }\n  .pulse-dot {\n    width: 8px;\n    height: 8px;\n    border-radius: 50%;\n    background-color: #57F287;\n    box-shadow: 0 0 10px #57F287;\n    animation: pulse-glow 2s infinite ease-in-out;\n  }\n  .pulse-dot.orange {\n    background-color: #FF4500;\n    box-shadow: 0 0 10px #FF4500;\n  }\n  .pulse-dot.cyan {\n    background-color: #00F5D4;\n    box-shadow: 0 0 10px #00F5D4;\n  }\n\n  /* High-Energy Feature Cards */\n  .feature-card {\n    display: flex;\n    align-items: stretch;\n    justify-content: space-between;\n    gap: 48px;\n    background: #14151a;\n    border-radius: 32px;\n    padding: 44px;\n    margin-bottom: 32px;\n    position: relative;\n    overflow: hidden;\n    border: 1px solid #262830;\n    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;\n  }\n  .feature-card:hover {\n    transform: translateY(-4px);\n  }\n  .feature-card.reverse {\n    flex-direction: row-reverse;\n  }\n\n  /* Distinct Accent Glows per Card */\n  .feature-card.accent-blurple {\n    border-color: rgba(88, 101, 242, 0.3);\n  }\n  .feature-card.accent-blurple:hover {\n    border-color: #5865F2;\n    box-shadow: 0 20px 50px -10px rgba(88, 101, 242, 0.25);\n  }\n  .feature-card.accent-nitro {\n    border-color: rgba(235, 69, 158, 0.3);\n  }\n  .feature-card.accent-nitro:hover {\n    border-color: #EB459E;\n    box-shadow: 0 20px 50px -10px rgba(235, 69, 158, 0.25);\n  }\n  .feature-card.accent-flame {\n    border-color: rgba(255, 69, 0, 0.3);\n  }\n  .feature-card.accent-flame:hover {\n    border-color: #FF4500;\n    box-shadow: 0 20px 50px -10px rgba(255, 69, 0, 0.25);\n  }\n  .feature-card.accent-emerald {\n    border-color: rgba(87, 242, 135, 0.3);\n  }\n  .feature-card.accent-emerald:hover {\n    border-color: #57F287;\n    box-shadow: 0 20px 50px -10px rgba(87, 242, 135, 0.25);\n  }\n  .feature-card.accent-gold {\n    border-color: rgba(254, 231, 92, 0.3);\n  }\n  .feature-card.accent-gold:hover {\n    border-color: #FEE75C;\n    box-shadow: 0 20px 50px -10px rgba(254, 231, 92, 0.25);\n  }\n\n  /* Card Inner Layout */\n  .card-text-col {\n    flex: 1.1;\n    display: flex;\n    flex-direction: column;\n    justify-content: center;\n    z-index: 2;\n  }\n  .card-visual-col {\n    flex: 1.2;\n    position: relative;\n    border-radius: 24px;\n    overflow: hidden;\n    background: #1c1d24;\n    min-height: 360px;\n    display: flex;\n    flex-direction: column;\n    justify-content: center;\n    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);\n    border: 1px solid rgba(255, 255, 255, 0.08);\n  }\n\n  /* Card Badge */\n  .feature-pill-badge {\n    display: inline-flex;
1\n    align-items: center;\n    gap: 8px;\n    padding: 6px 14px;\n    border-radius: 999px;\n    font-size: 0.8rem;\n    font-weight: 800;\n    text-transform: uppercase;\n    letter-spacing: 0.06em;\n    margin-bottom: 20px;\n    width: fit-content;\n  }\n  .badge-blurple {\n    background: rgba(88, 101, 242, 0.15);\n    border: 1px solid #5865F2;\n    color: #929cf8;\n  }\n  .badge-nitro {\n    background: rgba(235, 69, 158, 0.15);\n    border: 1px solid #EB459E;\n    color: #f77abf;\n  }\n  .badge-flame {\n    background: rgba(255, 69, 0, 0.15);\n    border: 1px solid #FF4500;\n    color: #ff7e4f;\n  }\n  .badge-emerald {\n    background: rgba(87, 242, 135, 0.15);\n    border: 1px solid #57F287;\n    color: #79f4a0;\n  }\n  .badge-gold {\n    background: rgba(254, 231, 92, 0.15);\n    border: 1px solid #FEE75C;\n    color: #ffea79;\n  }\n\n  .card-text-col h3 {\n    font-size: clamp(1.75rem, 3vw, 2.3rem);\n    font-weight: 900;\n    line-height: 1.15;\n    margin-bottom: 16px;\n    letter-spacing: -0.02em;\n    color: #ffffff;\n    text-transform: uppercase;\n  }\n  .card-text-col p {\n    font-size: 1.08rem;\n    color: #b5bac1;\n    line-height: 1.65;\n    margin-bottom: 24px;\n  }\n\n  /* Feature Tag Pills */\n  .tag-pills-row {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 10px;\n  }\n  .feature-subtag {\n    display: inline-flex;\n    align-items: center;\n    gap: 6px;\n    background: #1e1f26;\n    border: 1px solid #2d303b;\n    color: #949ba4;\n    padding: 6px 12px;\n    border-radius: 8px;\n    font-size: 0.82rem;\n    font-weight: 700;\n    font-family: monospace;\n    letter-spacing: -0.01em;\n  }\n\n  /* Visual Column Background Image & Overlays */\n  .visual-bg-img {\n    position: absolute;\n    inset: 0;\n    width: 100%;\n    height: 100%;\n    object-fit: cover;\n    opacity: 0.28;\n    filter: saturate(1.4) contrast(1.1);\n    transition: transform 0.5s ease, opacity 0.5s ease;\n  }\n  .feature-card:hover .visual-bg-img {\n    transform: scale(1.04);\n    opacity: 0.35;\n  }\n  .visual-overlay-content {\n    position: relative;\n    z-index: 2;\n    padding: 30px;\n    height: 100%;\n    display: flex;\n    flex-direction: column;\n    justify-content: center;\n  }\n\n  /* MINI MOCKUP: E2EE Secret Chat Window */\n  .chat-window-mock {\n    background: rgba(24, 25, 28, 0.92);\n    backdrop-filter: blur(12px);\n    border: 1px solid rgba(88, 101, 242, 0.4);\n    border-radius: 18px;\n    padding: 20px;\n    box-shadow: 0 20px 40px rgba(0,0,0,0.6);\n  }\n  .chat-window-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    border-bottom: 1px solid #2b2d31;\n    padding-bottom: 12px;\n    margin-bottom: 14px;\n    font-size: 0.85rem;\n    font-weight: 700;\n    color: #dbdee1;\n  }\n  .chat-window-header .channel-name {\n    display: flex;\n    align-items: center;\n    gap: 6px;\n    color: #fff;\n  }\n  .chat-window-header .encryption-tag {\n    background: rgba(87, 242, 135, 0.15);\n    color: #57F287;\n    border: 1px solid #57F287;\n    padding: 2px 8px;\n    border-radius: 999px;\n    font-size: 0.72rem;\n    font-weight: 800;\n  }\n  .chat-window-bubble {\n    display: flex;\n    gap: 12px;\n    margin-bottom: 12px;\n  }\n  .chat-window-avatar {\n    width: 38px;\n    height: 38px;\n    border-radius: 50%;\n    background: linear-gradient(135deg, #5865F2, #00F5D4);\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    font-weight: 800;\n    font-size: 0.85rem;\n    flex-shrink: 0;\n  }\n  .chat-window-body {\n    flex: 1;\n  }\n  .chat-window-user {\n    font-weight: 800;\n    font-size: 0.88rem;\n    color: #5865F2;\n    margin-bottom: 2px;\n    display: flex;\n    align-items: center;\n    gap: 6px;\n  }\n  .chat-window-time {\n    font-size: 0.72rem;\n    color: #80848e;\n    font-weight: 500;\n  }\n  .chat-window-text {\n    font-size: 0.9rem;\n    color: #dbdee1;\n    line-height: 1.4;\n  }\n  .e2ee-lock-banner {\n    background: rgba(88, 101, 242, 0.12);\n    border: 1px dashed #5865F2;\n    border-radius: 10px;\n    padding: 8px 12px;\n    font-size: 0.78rem;\n    color: #929cf8;\n    display: flex;
1\n    align-items: center;\n    gap: 8px;\n    font-weight: 600;\n    margin-top: 10px;\n  }\n\n  /* MINI MOCKUP: Nitro Profile Card */\n  .nitro-profile-mock {\n    background: rgba(22, 23, 27, 0.94);\n    backdrop-filter: blur(12px);\n    border: 1px solid rgba(235, 69, 158, 0.4);\n    border-radius: 20px;\n    overflow: hidden;\n    box-shadow: 0 20px 40px rgba(0,0,0,0.6);\n  }\n  .nitro-profile-banner {\n    height: 70px;\n    background: linear-gradient(90deg, #EB459E, #8A2BE2, #5865F2);\n    background-size: 200% 200%;\n    animation: rainbow-border 6s infinite ease;\n    position: relative;\n  }\n  .nitro-profile-body {\n    padding: 0 20px 20px;\n    position: relative;\n  }\n  .nitro-avatar-wr {\n    width: 64px;\n    height: 64px;\n    border-radius: 50%;\n    margin-top: -32px;\n    position: relative;\n    padding: 3px;\n    background: linear-gradient(45deg, #EB459E, #00F5D4, #FEE75C);\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    box-shadow: 0 4px 14px rgba(0,0,0,0.5);\n    flex-shrink: 0;\n  }\n  .nitro-avatar-img {\n    width: 100%;\n    height: 100%;\n    border-radius: 50%;\n    object-fit: cover;\n    background: #111;\n  }\n  .nitro-status-indicator {\n    position: absolute;\n    bottom: 2px;\n    right: 2px;\n    width: 16px;\n    height: 16px;\n    background: #23a55a;\n    border: 3px solid #16171b;\n    border-radius: 50%;\n  }\n  .nitro-user-info {\n    margin-top: 10px;\n  }\n  .nitro-user-name {\n    font-size: 1.15rem;\n    font-weight: 800;\n    color: #fff;\n    display: flex;\n    align-items: center;\n    gap: 8px;\n  }\n  .nitro-badges-row {\n    display: flex;\n    gap: 6px;\n    margin-top: 6px;\n  }\n  .nitro-tag-badge {\n    background: rgba(235, 69, 158, 0.2);\n    border: 1px solid #EB459E;\n    color: #ff9ed6;\n    font-size: 0.72rem;\n    font-weight: 800;\n    padding: 2px 8px;\n    border-radius: 6px;\n    line-height: 1.4;\n    white-space: nowrap;\n  }\n  /* Listening to Spotify equalizer */\n  .listening-music-bar {\n    margin-top: 14px;\n    background: rgba(30, 31, 37, 0.9);\n    border: 1px solid #353742;\n    border-radius: 12px;\n    padding: 10px 14px;\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n  }\n  .equalizer-bars {\n    display: flex;\n    align-items: flex-end;\n    gap: 3px;\n    height: 24px;\n  }\n  .eq-bar {\n    width: 3px;\n    background: #57F287;\n    border-radius: 2px;\n  }\n  .eq-bar:nth-child(1) { animation: sound-wave-1 0.8s infinite ease-in-out; }\n  .eq-bar:nth-child(2) { animation: sound-wave-2 0.7s infinite ease-in-out; }\n  .eq-bar:nth-child(3) { animation: sound-wave-3 0.9s infinite ease-in-out; }\n  .eq-bar:nth-child(4) { animation: sound-wave-4 0.6s infinite ease-in-out; }\n\n  /* MINI MOCKUP: IRL Meetup Event Ticket */\n  .event-pass-mock {\n    background: rgba(22, 23, 27, 0.95);\n    backdrop-filter: blur(12px);\n    border: 1px solid rgba(255, 69, 0, 0.45);\n    border-radius: 20px;\n    padding: 22px;\n    box-shadow: 0 20px 40px rgba(0,0,0,0.6);\n  }\n  .event-post-meta {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n    font-size: 0.78rem;\n    color: #949ba4;\n    margin-bottom: 10px;\n  }\n  .community-tag {\n    color: #ff4500;\n    font-weight: 800;\n  }\n  .event-card-title {\n    font-size: 1.15rem;\n    font-weight: 800;\n    color: #fff;\n    margin-bottom: 12px;\n    line-height: 1.3;\n  }\n  .event-action-bar {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    flex-wrap: wrap;\n    gap: 8px;\n    background: #18191e;\n    border: 1px solid #2d2f36;\n    border-radius: 12px;\n    padding: 10px 14px;\n    margin-bottom: 12px;\n  }\n  .upvote-counter-pill {\n    display: inline-flex;\n    align-items: center;\n    gap: 6px;\n    background: rgba(244, 63, 94, 0.15);\n    border: 1px solid #f43f5e;\n    color: #fb7185;\n    padding: 4px 12px;\n    border-radius: 999px;\n    font-weight: 800;\n    font-size: 0.85rem;\n  }\n  .rsvp-badge-confirmed {\n    background: linear-gradient(90deg, #FF4500, #FFA500);\n    color: #fff;\n    font-weight: 800;\n    font-size: 0.78rem;\n    padding: 5px 12px;\n    border-radius: 999px;\n    box-shadow: 0 0 16px rgba(255, 69, 0, 0.4);\n    line-height: 1.4;\n    white-space: nowrap;\n    text-align: center;\n  }\n  .event-spots-progress {\n    width: 100%;\n    height: 6px;\n    background: #2a2b33;\n    border-radius: 999px;\n    overflow: hidden;\n    margin-top: 10px;\n  }\n  .event-spots-fill {\n    width: 88%;\n    height: 100%;\n    background: linear-gradient(90deg, #FF4500, #FEE75C);\n    border-radius: 999px;\n  }\n\n  /* MINI MOCKUP: 4K Camera Lens Lossless HUD */\n  .lossless-hud-mock {\n    background: rgba(18, 19, 23, 0.9);\n    backdrop-filter: blur(12px);\n    border: 1px solid rgba(87, 242, 135, 0.4);\n    border-radius: 20px;\n    padding: 22px;\n    box-shadow: 0 20px 40px rgba(0,0,0,0.6);\n  }\n  .hud-crosshair-row {\n    display: flex;\n    justify-content: space-between;\n    font-family: monospace;\n    font-size: 0.75rem;\n    color: #57F287;\n    margin-bottom: 14px;\n    border-bottom: 1px dashed rgba(87, 242, 135, 0.3);\n    padding-bottom: 8px;\n  }\n  .awards-badge-row {\n    display: flex;\n    gap: 8px;\n    margin-top: 12px;\n  }\n  .honor-badge {\n    display: inline-flex;
1\n    align-items: center;\n    gap: 4px;\n    background: rgba(254, 231, 92, 0.15);\n    border: 1px solid #FEE75C;\n    color: #ffea79;\n    padding: 3px 10px;\n    border-radius: 999px;\n    font-size: 0.75rem;\n    font-weight: 700;\n  }\n  .compression-comparison {\n    margin-top: 14px;\n    background: #15161b;\n    border-radius: 10px;\n    padding: 10px 14px;\n    font-size: 0.8rem;\n    display: flex;\n    justify-content: space-between;\n    color: #949ba4;\n  }\n  .compression-comparison strong {\n    color: #57F287;\n  }\n\n  /* MINI MOCKUP: Watch Party */\n  .watch-party-mock {\n    background: rgba(22, 23, 27, 0.94);\n    backdrop-filter: blur(12px);\n    border: 1px solid rgba(254, 231, 92, 0.4);\n    border-radius: 20px;\n    padding: 16px;\n    box-shadow: 0 20px 40px rgba(0,0,0,0.6);\n  }\n  .watch-player {\n    background: #111;\n    border-radius: 12px;\n    height: 120px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    position: relative;\n    overflow: hidden;\n    margin-bottom: 16px;\n  }\n  .watch-progress-bar {\n    position: absolute;\n    bottom: 0;\n    left: 0;\n    right: 0;\n    height: 4px;\n    background: rgba(255, 255, 255, 0.2);\n  }\n  .watch-progress-fill {\n    height: 100%;\n    background: #FF0000;\n  }\n  .watch-info {\n    margin-bottom: 12px;\n  }\n  .watch-reactions {\n    display: flex;\n    gap: 8px;\n  }\n  .reaction-bubble {\n    background: rgba(255, 255, 255, 0.1);\n    border-radius: 99px;\n    padding: 4px 10px;\n    font-size: 0.85rem;\n    border: 1px solid rgba(255, 255, 255, 0.15);\n  }\n\n  /* MINI MOCKUP: Curated Upvoted Tier Lists */\n  .curated-tier-mock {\n    background: rgba(22, 23, 27, 0.94);\n    backdrop-filter: blur(12px);\n    border: 1px solid rgba(255, 69, 0, 0.4);\n    border-radius: 20px;\n    padding: 20px;\n    box-shadow: 0 20px 40px rgba(0,0,0,0.6);\n  }\n  .tier-tab-row {\n    display: flex;\n    gap: 8px;\n    margin-bottom: 14px;\n    border-bottom: 1px solid #2b2d31;\n    padding-bottom: 10px;\n  }\n  .tier-tab {\n    font-size: 0.8rem;\n    font-weight: 800;\n    padding: 4px 12px;\n    border-radius: 999px;\n    color: #80848e;\n    cursor: pointer;\n  }\n  .tier-tab.active {\n    background: rgba(255, 69, 0, 0.15);\n    color: #FF4500;\n    border: 1px solid #FF4500;\n  }\n  .tier-list-item {\n    display: flex;\n    align-items: center;\n    gap: 12px;\n    background: #18191f;\n    border: 1px solid #282a33;\n    border-radius: 10px;\n    padding: 10px 12px;\n    margin-bottom: 8px;\n    font-size: 0.88rem;\n    font-weight: 700;\n    color: #e3e5e8;\n  }\n  .tier-list-item .rank-badge {\n    color: #FEE75C;\n    font-weight: 900;\n  }\n  .tier-upvote-btn {\n    margin-left: auto;\n    background: rgba(244, 63, 94, 0.12);\n    border: 1px solid #f43f5e;\n    color: #fb7185;\n    padding: 3px 10px;\n    border-radius: 6px;\n    font-size: 0.78rem;\n    font-weight: 800;\n    display: flex;\n    align-items: center;\n    gap: 4px;\n    cursor: pointer;\n    transition: all 0.2s ease;\n  }\n  .tier-upvote-btn:hover {\n    background: rgba(244, 63, 94, 0.22);\n    border-color: #fb7185;\n  }\n\n  /* MINI MOCKUP: Longform Blogging Megathread */\n  .blog-megathread-mock {\n    background: rgba(22, 23, 27, 0.94);\n    backdrop-filter: blur(12px);\n    border: 1px solid rgba(235, 69, 158, 0.4);\n    border-radius: 20px;\n    padding: 22px;\n    box-shadow: 0 20px 40px rgba(0,0,0,0.6);\n  }\n  .blog-article-flair {\n    display: inline-flex;\n    gap: 6px;\n    margin-bottom: 8px;\n  }\n  .flair-pill {\n    background: rgba(0, 168, 252, 0.15);\n    border: 1px solid #00A8FC;\n    color: #5ec7ff;\n    font-size: 0.72rem;\n    font-weight: 800;\n    padding: 2px 8px;\n    border-radius: 4px;\n  }\n  .blog-article-snippet {\n    font-size: 0.88rem;\n    color: #949ba4;\n    line-height: 1.5;\n    border-left: 3px solid #EB459E;\n    padding-left: 12px;\n    margin: 12px 0;\n    font-style: italic;\n  }\n  .blog-reactions-bar {\n    display: flex;\n    align-items: center;\n    gap: 12px;\n    font-size: 0.8rem;\n    font-weight: 700;\n    color: #80848e;\n    margin-top: 14px;\n  }\n\n  /* Dual High-Energy Ticker Ribbons with Perfect Vertical Alignment */\n  .dual-ticker-wrapper {\n    margin: 48px 0 56px;\n    position: relative;\n    overflow: hidden;\n    padding: 16px 0;\n  }\n  .ticker-ribbon-blue {\n    background: linear-gradient(90deg, #5865F2, #7289DA, #5865F2);\n    color: #ffffff;\n    height: 48px;\n    white-space: nowrap;\n    overflow: hidden;\n    font-weight: 900;\n    text-transform: uppercase;\n    letter-spacing: 0.08em;\n    font-size: 0.95rem;\n    box-shadow: 0 8px 24px rgba(88, 101, 242, 0.35);\n    transform: rotate(-1.2deg);\n    display: flex;
1\n    align-items: center;\n  }\n  .ticker-ribbon-flame {\n    background: linear-gradient(90deg, #FF4500, #EB459E, #FF4500);\n    color: #ffffff;\n    height: 48px;\n    white-space: nowrap;\n    overflow: hidden;\n    font-weight: 900;\n    text-transform: uppercase;\n    letter-spacing: 0.08em;\n    font-size: 0.95rem;\n    box-shadow: 0 8px 24px rgba(255, 69, 0, 0.35);\n    transform: rotate(1.4deg);\n    margin-top: -6px;\n    display: flex;\n    align-items: center;\n  }\n  .ticker-track-left {\n    display: flex;\n    align-items: center;\n    gap: 32px;\n    animation: marquee-left 24s linear infinite;\n    width: max-content;\n    height: 100%;\n  }\n  .ticker-track-right {\n    display: flex;\n    align-items: center;\n    gap: 32px;\n    animation: marquee-right 24s linear infinite;\n    width: max-content;\n    height: 100%;\n  }\n  .ticker-item-inline {\n    display: flex;\n    align-items: center;\n    height: 100%;\n    gap: 16px;\n    line-height: 1;\n  }\n  .ticker-item-inline span {\n    display: inline-flex;\n    align-items: center;\n    line-height: 1;\n  }\n  .ticker-separator {\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    font-size: 0.8rem;\n    opacity: 0.75;\n    line-height: 1;\n  }\n\n  /* High-Energy Call To Action Banner */\n  .high-energy-cta {\n    margin: 56px 0 72px;\n    position: relative;\n    background: radial-gradient(circle at 50% 30%, rgba(88, 101, 242, 0.25) 0%, rgba(255, 69, 0, 0.15) 50%, rgba(13, 14, 18, 0.95) 100%), #121318;\n    border: 1px solid rgba(88, 101, 242, 0.4);\n    border-radius: 28px;\n    padding: 52px 24px;\n    text-align: center;\n    box-shadow: 0 30px 80px -20px rgba(88, 101, 242, 0.3);\n    overflow: hidden;\n  }\n  .cta-glow-orb {\n    position: absolute;\n    top: -50px;\n    left: 50%;\n    transform: translateX(-50%);\n    width: 300px;\n    height: 150px;\n    background: radial-gradient(circle, rgba(88, 101, 242, 0.5) 0%, transparent 70%);\n    filter: blur(40px);\n    pointer-events: none;\n  }\n  .high-energy-cta h2 {\n    font-size: clamp(1.8rem, 5vw, 3.4rem);\n    font-weight: 900;\n    line-height: 1.15;\n    margin-bottom: 16px;\n    text-transform: uppercase;\n    letter-spacing: -0.02em;\n  }\n  .high-energy-cta p {\n    font-size: clamp(0.95rem, 2.5vw, 1.2rem);\n    color: #b5bac1;\n    max-width: 680px;\n    margin: 0 auto 28px;\n    line-height: 1.6;\n  }\n  .cta-buttons-wrap {\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    flex-wrap: wrap;\n    gap: 18px;\n  }\n  .cta-btn-primary {\n    display: inline-flex;\n    align-items: center;\n    gap: 10px;\n    background: #5865F2;\n    color: #ffffff;\n    padding: 16px 36px;\n    border-radius: 999px;\n    font-weight: 800;\n    font-size: 1.1rem;\n    text-decoration: none;\n    box-shadow: 0 10px 28px rgba(88, 101, 242, 0.45);\n    transition: all 0.2s ease;\n  }\n  .cta-btn-primary:hover {\n    background: #4752c4;\n    transform: translateY(-3px) scale(1.02);\n    box-shadow: 0 14px 36px rgba(88, 101, 242, 0.6);\n  }\n  .cta-btn-secondary {\n    display: inline-flex;\n    align-items: center;\n    gap: 10px;\n    background: #FF4500;\n    color: #ffffff;\n    padding: 16px 36px;\n    border-radius: 999px;\n    font-weight: 800;\n    font-size: 1.1rem;\n    text-decoration: none;\n    box-shadow: 0 10px 28px rgba(255, 69, 0, 0.4);\n    transition: all 0.2s ease;\n  }\n  .cta-btn-secondary:hover {\n    background: #e03d00;\n    transform: translateY(-3px) scale(1.02);\n    box-shadow: 0 14px 36px rgba(255, 69, 0, 0.6);\n  }\n  .cta-footer-stats {\n    display: flex;\n    justify-content: center;\n    flex-wrap: wrap;\n    gap: 24px;\n    margin-top: 36px;\n    font-size: 0.88rem;\n    color: #949ba4;\n    font-weight: 600;\n  }\n\n  /* Responsive Behavior */\n  @media (max-width: 960px) {\n    .feature-card,\n    .feature-card.reverse {\n      flex-direction: column !important;\n      padding: 28px 20px;\n      gap: 28px;\n    }\n    .card-text-col,\n    .card-visual-col {\n      width: 100%;\n      max-width: 100%;\n    }\n    .card-visual-col {\n      min-height: 300px;\n    }\n    .dual-ticker-wrapper {\n      margin: 36px 0 44px;\n    }\n    .ticker-ribbon-blue,\n    .ticker-ribbon-flame {\n      font-size: 0.88rem;\n      height: 42px;\n      transform: rotate(0deg) !important;\n    }\n  }\n  @media (max-width: 600px) {\n    .section-hero-header {\n      padding: 40px 16px 28px;\n    }\n    .hero-top-badge {\n      font-size: 0.75rem;\n      padding: 6px 14px;\n    }\n    .stats-pill-bar {\n      gap: 8px;\n    }\n    .stat-pill {\n      font-size: 0.8rem;\n      padding: 6px 12px;\n    }\n    .feature-card {\n      padding: 20px 16px;\n      border-radius: 20px;\n      margin-bottom: 20px;\n    }\n    .card-text-col h3 {\n      font-size: 1.4rem;\n    }\n    .card-text-col p {\n      font-size: 0.95rem;\n    }\n    .card-visual-col {\n      min-height: 260px;\n    }\n    .visual-overlay-content {\n      padding: 14px;\n    }\n    .hud-crosshair-row {\n      flex-wrap: wrap;\n      gap: 4px;\n      font-size: 0.68rem;\n    }\n    .compression-comparison {\n      flex-direction: column;\n      gap: 4px;\n    }\n    .high-energy-cta {\n      padding: 36px 16px;\n      border-radius: 20px;\n      margin: 40px 0 56px;\n    }\n    .cta-btn-primary,\n    .cta-btn-secondary {\n      width: 100%;\n      justify-content: center;\n      font-size: 1rem;\n      padding: 14px 24px;\n    }\n    .cta-footer-stats {\n      flex-direction: column;\n      align-items: center;\n      gap: 10px;\n      font-size: 0.82rem;\n    }\n    .cta-footer-stats > span:nth-child(even) {\n      display: none;\n    }\n    .dual-ticker-wrapper {\n      margin: 28px 0 36px;\n    }\n  }\n  @media (max-width: 400px) {\n    .section-hero-header {\n      padding: 32px 12px 24px;\n    }\n    .landing-container {\n      padding: 0 12px;\n    }\n    .feature-card {\n      padding: 16px 12px;\n      border-radius: 16px;\n    }\n    .card-visual-col {\n      min-height: 220px;\n    }\n    .high-energy-cta {\n      padding: 28px 12px;\n    }\n  }\n'}),(0,s.jsxs)("div",{className:"landing-container",children:[(0,s.jsxs)("header",{className:"section-hero-header",children:[(0,s.jsxs)("div",{className:"hero-top-badge",children:[(0,s.jsx)(_.Z,{size:15,className:"text-yellow-400"}),(0,s.jsx)("span",{children:"Next-Gen Social Network • Zero Noise"})]}),(0,s.jsxs)("h2",{className:"main-hero-title",children:["Cut the noise.",(0,s.jsx)("br",{}),"Stay connected with your",(0,s.jsx)("br",{}),(0,s.jsx)("span",{className:"gradient-text-friends",children:"friends,"})," ",(0,s.jsx)("span",{className:"gradient-text-creators",children:"creators,"})," ",(0,s.jsx)("span",{className:"gradient-text-audience",children:"audience."})]}),(0,s.jsx)("p",{className:"section-hero-subtitle",children:"MeetSpace brings together high-octane IRL gatherings, seamless private messaging, and crowdsourced community rankings so you can truly connect with your friends, creators, and audience."}),(0,s.jsxs)("div",{className:"stats-pill-bar",children:[(0,s.jsxs)("div",{className:"stat-pill",children:[(0,s.jsx)("span",{className:"pulse-dot"}),(0,s.jsx)("span",{children:"100% Zero-Knowledge"})]}),(0,s.jsxs)("div",{className:"stat-pill",children:[(0,s.jsx)("span",{className:"pulse-dot orange"}),(0,s.jsx)("span",{children:"0 Algorithmic Shadowbans"})]}),(0,s.jsxs)("div",{className:"stat-pill",children:[(0,s.jsx)("span",{className:"pulse-dot cyan"}),(0,s.jsx)("span",{children:"4K Lossless Media Vaults"})]}),(0,s.jsxs)("div",{className:"stat-pill",children:[(0,s.jsx)(R.Z,{size:16,className:"text-rose-500 fill-rose-500"}),(0,s.jsx)("span",{children:"Community-Ranked Lore"})]})]})]}),(0,s.jsxs)("div",{className:"feature-card accent-blurple",children:[(0,s.jsxs)("div",{className:"card-text-col",children:[(0,s.jsxs)("span",{className:"feature-pill-badge badge-blurple",children:[(0,s.jsx)(D.Z,{size:14})," Zero-Knowledge E2EE"]}),(0,s.jsxs)("h3",{children:["Encrypted Messenger.",(0,s.jsx)("br",{}),"Zero Snoopers."]}),(0,s.jsx)("p",{children:"Your conversations belong exclusively to you and your people. Powered by device-level TweetNaCl cryptography, your messages and media are locked before ever touching the wire. Not even our servers can read a single character."}),(0,s.jsxs)("div",{className:"tag-pills-row",children:[(0,s.jsx)("span",{className:"feature-subtag",children:"#tweetnacl-256"}),(0,s.jsx)("span",{className:"feature-subtag",children:"#zero-telemetry"}),(0,s.jsx)("span",{className:"feature-subtag",children:"#ephemeral-keys"})]})]}),(0,s.jsxs)("div",{className:"card-visual-col",children:[(0,s.jsx)("img",{src:"https://static.amerigone.com/mess.png",alt:"Neon digital cyber lock",className:"visual-bg-img"}),(0,s.jsx)("div",{className:"visual-overlay-content",children:(0,s.jsxs)("div",{className:"chat-window-mock",children:[(0,s.jsxs)("div",{className:"chat-window-header",children:[(0,s.jsxs)("div",{className:"channel-name",children:[(0,s.jsx)(H.Z,{size:14,className:"text-indigo-400"}),(0,s.jsx)("span",{children:"#classified-dm"})]}),(0,s.jsx)("div",{className:"encryption-tag",children:"● E2EE VERIFIED"})]}),(0,s.jsxs)("div",{className:"chat-window-bubble",children:[(0,s.jsx)("div",{className:"chat-window-avatar",children:"AG"}),(0,s.jsxs)("div",{className:"chat-window-body",children:[(0,s.jsxs)("div",{className:"chat-window-user",children:[(0,s.jsx)("span",{children:"Alex_Shadow"}),(0,s.jsx)("span",{className:"chat-window-time",children:"Today at 9:41 PM"})]}),(0,s.jsx)("div",{className:"chat-window-text",children:"Dropping the private keys and the coordinates for tonight \uD83D\uDDDD️\uD83D\uDCCD"})]})]}),(0,s.jsxs)("div",{className:"e2ee-lock-banner",children:[(0,s.jsx)(J.Z,{size:16,className:"text-emerald-400 flex-shrink-0"}),(0,s.jsx)("span",{children:"TweetNaCl 256-bit handshake confirmed."})]})]})})]})]}),(0,s.jsxs)("div",{className:"feature-card accent-nitro reverse",children:[(0,s.jsxs)("div",{className:"card-text-col",children:[(0,s.jsxs)("span",{className:"feature-pill-badge badge-nitro",children:[(0,s.jsx)(V.Z,{size:14})," Maximum Flex • High Vibes"]}),(0,s.jsx)("h3",{children:"Supercharge Your Digital Identity"}),(0,s.jsx)("p",{children:"Forget boring corporate bio fields. Custom badges, animated holographic avatar borders, custom banners, and autoplay background music that plays your chosen soundtrack 
1whenever anyone visits your page."}),(0,s.jsxs)("div",{className:"tag-pills-row",children:[(0,s.jsx)("span",{className:"feature-subtag",children:"#autoplay-anthem"}),(0,s.jsx)("span",{className:"feature-subtag",children:"#nitro-borders"}),(0,s.jsx)("span",{className:"feature-subtag",children:"#48.9k-karma"})]})]}),(0,s.jsxs)("div",{className:"card-visual-col",children:[(0,s.jsx)("img",{src:"/landing/feature-identity-neon.jpg",alt:"Vibrant abstract neon 3D shapes",className:"visual-bg-img"}),(0,s.jsx)("div",{className:"visual-overlay-content",children:(0,s.jsxs)("div",{className:"nitro-profile-mock",children:[(0,s.jsx)("div",{className:"nitro-profile-banner"}),(0,s.jsxs)("div",{className:"nitro-profile-body",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"nitro-avatar-wr",children:[(0,s.jsx)("img",{src:"https://cdn.qrsite.app/rnbw/bratparty.png",alt:"Profile avatar",className:"nitro-avatar-img"}),(0,s.jsx)("span",{className:"nitro-status-indicator"})]}),(0,s.jsxs)("div",{className:"nitro-badges-row",children:[(0,s.jsx)("span",{className:"nitro-tag-badge",children:"\uD83D\uDC51 QUEEN"}),(0,s.jsx)("span",{className:"nitro-tag-badge",children:"\uD83D\uDC8E BOOSTER"}),(0,s.jsx)("span",{className:"nitro-tag-badge",children:"⚡ LVL 42"})]})]}),(0,s.jsxs)("div",{className:"nitro-user-info",children:[(0,s.jsxs)("div",{className:"nitro-user-name",children:[(0,s.jsx)("span",{children:"CyberVixen"}),(0,s.jsx)("span",{className:"text-xs text-purple-300 font-mono",children:"u/cybervixen"})]}),(0,s.jsx)("div",{className:"text-xs text-gray-400 mt-1",children:"Building the future of encrypted social. Synthwave obsessive."})]}),(0,s.jsxs)("div",{className:"listening-music-bar",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(G.Z,{size:16,className:"text-emerald-400"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-xs font-bold text-white",children:"Overdrive // Night City"}),(0,s.jsx)("div",{className:"text-[11px] text-gray-400",children:"Crystal Castles"})]})]}),(0,s.jsxs)("div",{className:"equalizer-bars",children:[(0,s.jsx)("div",{className:"eq-bar"}),(0,s.jsx)("div",{className:"eq-bar"}),(0,s.jsx)("div",{className:"eq-bar"}),(0,s.jsx)("div",{className:"eq-bar"})]})]})]})]})})]})]}),(0,s.jsxs)("div",{className:"feature-card accent-flame",children:[(0,s.jsxs)("div",{className:"card-text-col",children:[(0,s.jsxs)("span",{className:"feature-pill-badge badge-flame",children:[(0,s.jsx)(Y.Z,{size:14})," Touch Grass • IRL Meetups"]}),(0,s.jsx)("h3",{children:"Host Unforgettable Real-World Events"}),(0,s.jsx)("p",{children:"Take the online squad offline. Easily orchestrate secret rooftop parties, underground hackathons, and weekend road trips. Generate glowing digital ticket passes, track live RSVPs, and coordinate meetup coordinates without messy group chat chaos."}),(0,s.jsxs)("div",{className:"tag-pills-row",children:[(0,s.jsx)("span",{className:"feature-subtag",children:"#irl-meetups"}),(0,s.jsx)("span",{className:"feature-subtag",children:"#live-rsvps"}),(0,s.jsx)("span",{className:"feature-subtag",children:"#secret-coordinates"})]})]}),(0,s.jsxs)("div",{className:"card-visual-col",children:[(0,s.jsx)("img",{src:"/landing/feature-events-crowd.jpg",alt:"Crowd at vibrant event",className:"visual-bg-img"}),(0,s.jsx)("div",{className:"visual-overlay-content",children:(0,s.jsxs)("div",{className:"event-pass-mock",children:[(0,s.jsxs)("div",{className:"event-post-meta",children:[(0,s.jsx)("span",{className:"community-tag",children:"c/meetspace_irl"}),(0,s.jsx)("span",{children:"• Posted by @dj_pulse"}),(0,s.jsx)("span",{children:"• 3h ago"})]}),(0,s.jsx)("div",{className:"event-card-title",children:"⚡ Underground Synthwave Rooftop Rave // NYC"}),(0,s.jsxs)("div",{className:"event-action-bar",children:[(0,s.jsxs)("div",{className:"upvote-counter-pill",children:[(0,s.jsx)(R.Z,{size:16,className:"text-rose-400 fill-rose-400"}),(0,s.jsx)("span",{children:"2,840"})]}),(0,s.jsx)("div",{className:"rsvp-badge-confirmed",children:"\uD83C\uDF9F️ RSVP CONFIRMED #042"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex justify-between text-xs font-bold text-gray-300",children:[(0,s.jsx)("span",{children:"Attending: 186 / 200 (Capacity)"}),(0,s.jsx)("span",{className:"text-orange-400",children:"\uD83D\uDD25 Almost Sold Out"})]}),(0,s.jsx)("div",{className:"event-spots-progress",children:(0,s.jsx)("div",{className:"event-spots-fill"})})]})]})})]})]})]}),(0,s.jsxs)("div",{className:"dual-ticker-wrapper",children:[(0,s.jsx)("div",{className:"ticker-ribbon-blue",children:(0,s.jsxs)("div",{className:"ticker-track-left",children:[(0,s.jsxs)("div",{className:"ticker-item-inline",children:[(0,s.jsx)("span",{children:"⚡ ZERO TRACKERS"}),(0,s.jsx)("span",{className:"ticker-separator",children:"✦"}),(0,s.jsx)("span",{children:"\uD83C\uDFAE COMMUNITY CHANNELS"}),(0,s.jsx)("span",{className:"ticker-separator",children:"✦"}),(0,s.jsx)("span",{children:"\uD83D\uDD12 100% DEVICE ENCRYPTION"}),(0,s.jsx)("span",{className:"ticker-separator",children:"✦"}),(0,s.jsx)("span",{children:"\uD83D\uDC51 PROFILE BADGES"}),(0,s.jsx)("span",{className:"ticker-separator",children:"✦"}),(0,s.jsx)("span",{children:"\uD83C\uDFA7 PROFILE SOUNDTRACKS"}),(0,s.jsx)("span",{className:"ticker-separator",children:"✦"}),(0,s.jsx)("span",{children:"\uD83D\uDE80 NO ALGORITHMIC CENSORSHIP"}),(0,s.jsx)("span",{className:"ticker-separator",children:"✦"})]}),(0,s.jsxs)("div",{className:"ticker-item-inline",children:[(0,s.jsx)("span",{children:"⚡ ZERO TRACKERS"}),(0,s.jsx)("span",{className:"ticker-separator",children:"✦"}),(0,s.jsx)("span",{children:"\uD83C\uDFAE COMMUNITY CHANNELS"}),(0,s.jsx)("span",{className:"ticker-separator",children:"✦"}),(0,s.jsx)("span",{children:"\uD83D\uDD12 100% DEVICE ENCRYPTION"}),(0,s.jsx)("span",{className:"ticker-separator",children:"✦"}),(0,s.jsx)("span",{children:"\uD83D\uDC51 PROFILE BADGES"}),(0,s.jsx)("span",{className:"ticker-separator",children:"✦"}),(0,s.jsx)("span",{children:"\uD83C\uDFA7 PROFILE SOUNDTRACKS"}),(0,s.jsx)("span",{className:"ticker-separator",children:"✦"}),(0,s.jsx)("span",{children:"\uD83D\uDE80 NO ALGORITHMIC CENSORSHIP"}),(0,s.jsx)("span",{className:"ticker-separator",children:"✦"})]})]})}),(0,s.jsx)("div",{className:"ticker-ribbon-flame",children:(0,s.jsxs)("div",{className:"ticker-track-right",children:[(0,s.jsxs)("div",{className:"ticker-item-inline",children:[(0,s.jsx)("span",{children:"❤️ HEART EVERYTHING"}),(0,s.jsx)("span",{className:"ticker-separator",children:"✦"}),(0,s.jsx)("span",{children:"\uD83D\uDD25 REAL-WORLD IRL PARTIES"}),(0,s.jsx)("span",{className:"ticker-separator",children:"✦"}),(0,s.jsx)("span",{children:"\uD83D\uDCF8 4K LOSSLESS RAW"}),(0,s.jsx)("span",{className:"ticker-separator",children:"✦"}),(0,s.jsx)("span",{children:"\uD83D\uDCAC 24/7 LIVE LOUNGES"}),(0,s.jsx)("span",{className:"ticker-separator",children:"✦"}),(0,s.jsx)("span",{children:"✍️ COMMUNITY MEGATHREADS"}),(0,s.jsx)("span",{className:"ticker-separator",children:"✦"}),(0,s.jsx)("span",{children:"\uD83C\uDFC6 PLATINUM AWARDS"}),(0,s.jsx)("span",{className:"ticker-separator",children:"✦"})]}),(0,s.jsxs)("div",{className:"ticker-item-inline",children:[(0,s.jsx)("span",{children:"❤️ HEART EVERYTHING"}),(0,s.jsx)("span",{className:"ticker-separator",children:"✦"}),(0,s.jsx)("span",{children:"\uD83D\uDD25 REAL-WORLD IRL PARTIES"}),(0,s.jsx)("span",{className:"ticker-separator",children:"✦"}),(0,s.jsx)("span",{children:"\uD83D\uDCF8 4K LOSSLESS RAW"}),(0,s.jsx)("span",{className:"ticker-separator",children:"✦"}),(0,s.jsx)("span",{children:"\uD83D\uDCAC 24/7 LIVE LOUNGES"}),(0,s.jsx)("span",{className:"ticker-separator",children:"✦"}),(0,s.jsx)("span",{children:"✍️ COMMUNITY MEGATHREADS"}),(0,s.jsx)("span",{className:"ticker-separator",children:"✦"}),(0,s.jsx)("span",{children:"\uD83C\uDFC6 PLATINUM AWARDS"}),(0,s.jsx)("span",{className:"ticker-separator",children:"✦"})]})]})})]}),(0,s.jsxs)("div",{className:"landing-container",children:[(0,s.jsxs)("div",{className:"feature-card accent-emerald reverse",children:[(0,s.jsxs)("div",{className:"card-text-col",children:[(0,s.jsxs)("span",{className:"feature-pill-badge badge-emerald",children:[(0,s.jsx)(N.Z,{size:14})," 100% Lossless • No Compression"]}),(0,s.jsx)("h3",{children:"Pixel-Perfect Lossless Photo Vaults"}),(0,s.jsx)("p",{children:"Never watch your favorite memories get butchered by aggressive compression algorithms again. Upload, share, and preserve pristine 4K galleries, film rolls, and captures exactly as your camera shot them."}),(0,s.jsxs)("div",{className:"tag-pills-row",children:[(0,s.jsx)("span",{className:"feature-subtag",children:"#raw-4k-uhd"}),(0,s.jsx)("span",{className:"feature-subtag",children:"#exif-preserved"}),(0,s.jsx)("span",{className:"feature-subtag",children:"#zero-potato-mode"})]})]}),(0,s.jsxs)("div",{className:"card-visual-col",children:[(0,s.jsx)("img",{src:"/landing/feature-lossless-camera.jpg",alt:"
1Vintage camera lens",className:"visual-bg-img"}),(0,s.jsx)("div",{className:"visual-overlay-content",children:(0,s.jsxs)("div",{className:"lossless-hud-mock",children:[(0,s.jsxs)("div",{className:"hud-crosshair-row",children:[(0,s.jsx)("span",{children:"[RAW SENSOR STREAM]"}),(0,s.jsx)("span",{children:"4K UHD • 6000x4000"}),(0,s.jsx)("span",{children:"ISO 100 • 35mm f/1.4"})]}),(0,s.jsx)("div",{className:"text-sm font-bold text-white mb-2",children:"Uncompressed Camera Roll"}),(0,s.jsxs)("div",{className:"awards-badge-row",children:[(0,s.jsxs)("span",{className:"honor-badge",children:[(0,s.jsx)($.Z,{size:12})," Gold Award"]}),(0,s.jsxs)("span",{className:"honor-badge",children:[(0,s.jsx)(V.Z,{size:12})," Platinum"]}),(0,s.jsxs)("span",{className:"honor-badge",children:[(0,s.jsx)(Y.Z,{size:12})," Hot Shot"]})]}),(0,s.jsxs)("div",{className:"compression-comparison",children:[(0,s.jsx)("span",{children:"Traditional Apps (80KB mush) ❌"}),(0,s.jsx)("span",{children:(0,s.jsx)("strong",{children:"Meetspace (Lossless 4K) ✅"})})]})]})})]})]}),(0,s.jsxs)("div",{className:"feature-card accent-gold",children:[(0,s.jsxs)("div",{className:"card-text-col",children:[(0,s.jsxs)("span",{className:"feature-pill-badge badge-gold",children:[(0,s.jsx)(Q.Z,{size:14})," Always Poppin' • Watch Parties"]}),(0,s.jsx)("h3",{children:"Always Have Something to Do Together"}),(0,s.jsx)("p",{children:"Queue up videos, launch integrated discussions, spin collaborative playlists, or just laugh at memes together right inside your chat channels."}),(0,s.jsxs)("div",{className:"tag-pills-row",children:[(0,s.jsx)("span",{className:"feature-subtag",children:"#shared-youtube"}),(0,s.jsx)("span",{className:"feature-subtag",children:"#watch-together"}),(0,s.jsx)("span",{className:"feature-subtag",children:"#meme-reactions"})]})]}),(0,s.jsxs)("div",{className:"card-visual-col",children:[(0,s.jsx)("img",{src:"/landing/feature-watch-party.jpg",alt:"Arcade games and retro controllers",className:"visual-bg-img"}),(0,s.jsx)("div",{className:"visual-overlay-content",children:(0,s.jsxs)("div",{className:"watch-party-mock",children:[(0,s.jsxs)("div",{className:"watch-player",children:[(0,s.jsx)(X.Z,{size:32,className:"text-white opacity-80"}),(0,s.jsx)("div",{className:"watch-progress-bar",children:(0,s.jsx)("div",{className:"watch-progress-fill",style:{width:"45%"}})})]}),(0,s.jsxs)("div",{className:"watch-info",children:[(0,s.jsx)("div",{className:"text-sm font-bold text-white mb-1",children:"Lo-Fi Cyberpunk Radio 24/7"}),(0,s.jsx)("div",{className:"text-xs text-gray-400",children:"Synced with 4 friends"})]}),(0,s.jsxs)("div",{className:"watch-reactions",children:[(0,s.jsx)("span",{className:"reaction-bubble",children:"\uD83D\uDD25"}),(0,s.jsx)("span",{className:"reaction-bubble",children:"✨"}),(0,s.jsx)("span",{className:"reaction-bubble",children:"\uD83C\uDFA7"})]})]})})]})]}),(0,s.jsxs)("div",{className:"feature-card accent-flame reverse",children:[(0,s.jsxs)("div",{className:"card-text-col",children:[(0,s.jsxs)("span",{className:"feature-pill-badge badge-flame",children:[(0,s.jsx)(R.Z,{size:14,className:"fill-current text-rose-400"})," Crowdsourced • Community Ranked"]}),(0,s.jsx)("h3",{children:"Curate & Heart Community Tier Lists"}),(0,s.jsx)("p",{children:"Harness the taste of your community. Build crowdsourced recommendations, underground food guides, gear tier lists, and secret spots—voted to the top by real people without corporate pay-for-play algorithms."}),(0,s.jsxs)("div",{className:"tag-pills-row",children:[(0,s.jsx)("span",{className:"feature-subtag",children:"#tier-lists"}),(0,s.jsx)("span",{className:"feature-subtag",children:"#community-hearts"}),(0,s.jsx)("span",{className:"feature-subtag",children:"#zero-promoted-ads"})]})]}),(0,s.jsxs)("div",{className:"card-visual-col",children:[(0,s.jsx)("img",{src:"/landing/feature-tier-list.jpg",alt:"Minimalist curated list",className:"visual-bg-img"}),(0,s.jsx)("div",{className:"visual-overlay-content",children:(0,s.jsxs)("div",{className:"curated-tier-mock",children:[(0,s.jsxs)("div",{className:"tier-tab-row",children:[(0,s.jsx)("span",{className:"tier-tab ".concat("hot"===e?"active":""),onClick:()=>t("hot"),children:"HOT \uD83D\uDD25"}),(0,s.jsx)("span",{className:"tier-tab ".concat("top"===e?"active":""),onClick:()=>t("top"),children:"TOP \uD83D\uDCC8"}),(0,s.jsx)("span",{className:"tier-tab ".concat("new"===e?"active":""),onClick:()=>t("new"),children:"NEW ⚡"})]}),(0,s.jsxs)("div",{className:"tier-list-item",children:[(0,s.jsx)("span",{className:"rank-badge",children:"#1"}),(0,s.jsx)("span",{children:"Secret Rooftop Ramen Spots"}),(0,s.jsxs)("button",{className:"tier-upvote-btn",onClick:()=>n(1),children:[(0,s.jsx)(R.Z,{size:14,className:a[1]?"fill-rose-500 text-rose-500":"text-gray-400"}),(0,s.jsx)("span",{children:a[1]?"3,421":"3,420"})]})]}),(0,s.jsxs)("div",{className:"tier-list-item",children:[(0,s.jsx)("span",{className:"rank-badge",children:"#2"}),(0,s.jsx)("span",{children:"Underground Vinyl Speakeasies"}),(0,s.jsxs)("button",{className:"tier-upvote-btn",onClick:()=>n(2),children:[(0,s.jsx)(R.Z,{size:14,className:a[2]?"fill-rose-500 text-rose-500":"text-gray-400"}),(0,s.jsx)("span",{children:a[2]?"2,151":"2,150"})]})]}),(0,s.jsxs)("div",{className:"tier-list-item",children:[(0,s.jsx)("span",{className:"rank-badge",children:"#3"}),(0,s.jsx)("span",{children:"Open-Source Hardware Setups"}),(0,s.jsxs)("button",{className:"tier-upvote-btn",onClick:()=>n(3),children:[(0,s.jsx)(R.Z,{size:14,className:a[3]?"fill-rose-500 text-rose-500":"text-gray-400"}
1),(0,s.jsx)("span",{children:a[3]?"1,891":"1,890"})]})]})]})})]})]}),(0,s.jsxs)("div",{className:"feature-card accent-nitro",children:[(0,s.jsxs)("div",{className:"card-text-col",children:[(0,s.jsxs)("span",{className:"feature-pill-badge badge-nitro",children:[(0,s.jsx)(ee.Z,{size:14})," Lore & Stories • Deep Dives"]}),(0,s.jsx)("h3",{children:"Built-In Longform Blogging"}),(0,s.jsx)("p",{children:"When 280 characters just aren't enough. Publish rich, immersive longform essays, travelogues, and tech teardowns with markdown, embedded media, code blocks, and threaded community discussions."}),(0,s.jsxs)("div",{className:"tag-pills-row",children:[(0,s.jsx)("span",{className:"feature-subtag",children:"#markdown-rich"}),(0,s.jsx)("span",{className:"feature-subtag",children:"#community-lore"}),(0,s.jsx)("span",{className:"feature-subtag",children:"#threaded-replies"})]})]}),(0,s.jsxs)("div",{className:"card-visual-col",children:[(0,s.jsx)("img",{src:"/landing/feature-blogging.jpg",alt:"Writing on laptop",className:"visual-bg-img"}),(0,s.jsx)("div",{className:"visual-overlay-content",children:(0,s.jsxs)("div",{className:"blog-megathread-mock",children:[(0,s.jsxs)("div",{className:"blog-article-flair",children:[(0,s.jsx)("span",{className:"flair-pill",children:"DEEP DIVE"}),(0,s.jsx)("span",{className:"flair-pill",children:"CRYPTO ESSAY"})]}),(0,s.jsx)("div",{className:"text-sm font-extrabold text-white",children:"Why We Built a Platform Without Algorithmic Feeds"}),(0,s.jsx)("div",{className:"blog-article-snippet",children:"“Centralized algorithms were designed for advertisers, not humans. By bringing cryptography and genuine community moderation together, we take our spaces back…”"}),(0,s.jsxs)("div",{className:"blog-reactions-bar",children:[(0,s.jsxs)("span",{className:"text-rose-400 flex items-center gap-1 font-bold",children:[(0,s.jsx)(R.Z,{size:16,className:"fill-rose-500 text-rose-500"})," 5.2k"]}),(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(et.Z,{size:14})," 438 Comments"]}),(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)($.Z,{size:14,className:"text-yellow-400"})," 24 Awards"]})]})]})})]})]}),(0,s.jsxs)("section",{className:"high-energy-cta",children:[(0,s.jsx)("div",{className:"cta-glow-orb"}),(0,s.jsxs)("div",{className:"hero-top-badge",style:{marginBottom:"18px"},children:[(0,s.jsx)(_.Z,{size:14,className:"text-yellow-300"}),(0,s.jsx)("span",{children:"Ready for High-Voltage Connection?"})]}),(0,s.jsx)("h2",{children:"Ready for a Better Way to Connect?"}),(0,s.jsx)("p",{children:"Join thousands of creators, gamers, party hosts, and communities who switched to private, high-energy spaces. No ads. No surveillance."}),(0,s.jsxs)("div",{className:"cta-buttons-wrap",children:[(0,s.jsxs)("a",{href:"#",className:"cta-btn-primary",children:[(0,s.jsx)(_.Z,{size:18}),(0,s.jsx)("span",{children:"Enter MeetSpace — It's Free"})]}),(0,s.jsxs)("a",{href:"/plus",className:"cta-btn-secondary",children:[(0,s.jsx)(Y.Z,{size:18}),(0,s.jsx)("span",{children:"Learn More"})]})]}),(0,s.jsxs)("div",{className:"cta-footer-stats",children:[(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"pulse-dot"})," 4,820 Joined This Week"]}),(0,s.jsx)("span",{children:"•"}),(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsx)(H.Z,{size:14,className:"text-indigo-400"})," All DMs Encrypted"]}),(0,s.jsx)("span",{children:"•"}),(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsx)(Y.Z,{size:14,className:"text-orange-400"})," 120+ IRL Events This Week"]})]})]})]})]})}var es=a(780),el=a.n(es),er=a(1578),en=a.n(er);let ei=en().default||en(),{encodeBase64:eo,decodeBase64:ec,encodeUTF8:ed,decodeUTF8:eu}=ei,em="meetspace_e2ee_private_key",ep="meetspace_e2ee_public_key",ex="meetspace_e2ee_master_secret",eh="meetspace_e2ee_registered_pubkey",eg="meetspace_e2ee_sent_cache",ef="meetspace_e2ee_auth_entropy",eb={},ev={getItem:e=>{try{return localStorage.getItem(e)}catch(t){return eb[e]||null}},setItem:(e,t)=>{try{localStorage.setItem(e,t)}catch(a){eb[e]=String(t)}},removeItem:e=>{try{localStorage.removeItem(e)}catch(t){delete eb[e]}}};async function ey(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){let a=t?"".concat(ef,"_").concat(t):ef;ev.setItem(a,String(e)),ev.setItem(ef,String(e))}}(t,a);let s=t||function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(e){let t=ev.getItem("".concat(ef,"_").concat(e));if(t)return t}return ev.getItem(ef)}(a),l=function(e,t){if(!e)return t||null;if(!t)return e||null;try{let a=String(e).trim().toLowerCase().replace(/^0x/,""),s=String(t).trim().toLowerCase().replace(/^0x/,"");if(a.length===s.length&&a.length>=32&&a.length%2==0&&/^[0-9a-f]+$/.test(a)&&/^[0-9a-f]+$/.test(s)){let e="";for(let t=0;t<a.length;t+=2){let l=parseInt(a.substr(t,2),16),r=parseInt(s.substr(t,2),16);e+=(l^r).toString(16).padStart(2,"0")}return e}return a}catch(a){return console.warn("[E2EE] combineKeyShares error:",a),e||t||null}}(e,s);return l&&await ek(l,a),l}function ej(){try{let e=ev.getItem(eg);return e?JSON.parse(e):{}}catch(e){return{}}}function ew(e){if(!e)return null;try{let t=ej();if(t[e])return t[e];try{let a="string"==typeof e?JSON.parse(e):e;if((null==a?void 0:a.box)&&t[a.box])return t[a.box]}catch(e){}}catch(e){}return null}function eN(e,t){let a=ec(e),s=new Uint8Array(32);for(let e=0;e<32;e++)s[e]=parseInt(t.substr(2*e,2),16)||0;let l=el().randomBytes(el().secretbox.nonceLength),r=el().secretbox(a,l,s);return JSON.stringify({nonce:eo(l),box:eo(r)})}async function ek(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){let a=t?"".concat(ex,"_").concat(t):ex;ev.setItem(a,String(e)),ev.setItem(ex,String(e))}}async function eS(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(e){let t=ev.getItem("".concat(ex,"_").concat(e));if(t)return t}return ev.getItem(ex)}async function eC(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{let t=e?"".concat(em,"_").concat(e):em,a=e?"".concat(ep,"_").concat(e):ep,s=ev.getItem(t),l=ev.getItem(a);if((!s||!l)&&e){let e=ev.getItem(em),r=ev.getItem(ep);e&&r&&(s=e,l=r,ev.setItem(t,s),ev.setItem(a,l))}if(s&&l)return{publicKey:l,secretKey:s};let r=el().box.keyPair(),n=eo(r.publicKey),i=eo(r.secretKey);return ev.setItem(a,n),ev.setItem(t,i),{publicKey:n,secretKey:i}}catch(e){throw console.error("[E2EE] Failed to get/create key pair:",e),e}}async function eE(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(!e||"string"!=typeof e||!e.startsWith('{"e2ee":true'))return e;if(!0===a){let t=ew(e);if(t)return t}try{let l=JSON.parse(e);if(!l.e2ee||!l.ephem||!l.nonce||!l.box)return e;let r=t;if(!r){let e=await eC(s);r=null==e?void 0:e.secretKey}let n=null;if(r)try{let e=ec(l.ephem),t=ec(r);if(!0===a&&l.sBox&&l.sNonce){let a=ec(l.sNonce),s=ec(l.sBox);if(!(n=el().box.open(s,a,e,t))&&l.box&&l.nonce){let a=ec(l.nonce),s=ec(l.box);n=el().box.open(s,a,e,t)}}else{let a=ec(l.nonce),s=ec(l.box);if(!(n=el().box.open(s,a,e,t))&&l.sBox&&l.sNonce){let a=ec(l.sNonce),s=ec(l.sBox);n=el().box.open(s,a,e,t)}}}catch(e){n=null}if(n){if("undefined"!=typeof TextDecoder)return new TextDecoder().decode(n);return ed(n)}if(!1!==a){let t=ew(e);if(t)return t;if(r&&l.sBox&&l.sNonce)try{let e=ec(l.ephem),t=ec(l.sNonce),a=ec(l.sBox),s=ec(r),n=el().box.open(a,t,e,s);if(n)return"undefined"!=typeof TextDecoder?new TextDecoder().decode(n):ed(n)}catch(e){}}return"[Encrypted message - cannot decrypt]"}catch(t){return console.warn("[E2EE] Decryption error:",t),e}}async function eI(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{if(!e)return;let{publicKey:a,secretKey:s}=await eC(t),l=await eS(t),r=null;l&&(r=eN(s,l));let n=await e("/api/e2ee/keys",{method:"POST",body:JSON.stringify({publicKey:a,encryptedPrivKey:r,public_key:a,encrypted_privkey:r})});if(n&&n.e2eeSecret){let i=await ey(n.e2eeSecret,null,t);if((!r||l!==i)&&i){let t=eN(s,i);await e("/api/e2ee/keys",{method:"POST",body:JSON.stringify({publicKey:a,encryptedPrivKey:t,public_key:a,encrypted_privkey:t})})}}let i=t?"".concat(eh,"_").concat(t):eh;return ev.setItem(i,a),a}catch(e){console.warn("[E2EE] Error registering public key with server:",e)}}async function eA(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e||!t)return!1;try{let s=function(e,t){try{let a="string"==typeof e?JSON.parse(e):e,s=ec(a.nonce),l=ec(a.box),r
1=new Uint8Array(32);for(let e=0;e<32;e++)r[e]=parseInt(t.substr(2*e,2),16)||0;let n=el().secretbox.open(l,s,r);if(!n)return null;return eo(n)}catch(e){return console.warn("[E2EE] Failed to decrypt private key envelope:",e),null}}(e,t);if(s){let e=a?"".concat(em,"_").concat(a):em,t=a?"".concat(ep,"_").concat(a):ep;ev.setItem(e,s);let l=ec(s),r=el().box.keyPair.fromSecretKey(l);return ev.setItem(t,eo(r.publicKey)),!0}}catch(e){console.warn("[E2EE] Error restoring key from envelope:",e)}return!1}async function eF(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{var a,s,l,r,n,i,o;let c=t?"".concat(em,"_").concat(t):em,d=t?"".concat(ep,"_").concat(t):ep,u=t?"".concat(eh,"_").concat(t):eh,m=ev.getItem(c),p=ev.getItem(d),x=null;e&&(x=await e("/api/e2ee/my-key").catch(()=>null),(null===(i=x)||void 0===i?void 0:i.e2eeSecret)&&await ey(x.e2eeSecret,null,t));let h=await eS(t),g=(null===(a=x)||void 0===a?void 0:a.publicKey)||(null===(s=x)||void 0===s?void 0:s.public_key),f=(null===(l=x)||void 0===l?void 0:l.encryptedPrivKey)||(null===(r=x)||void 0===r?void 0:r.encrypted_privkey),b=g&&p&&p!==g,v=!m||!p;if((v||b)&&f&&(h||(null===(n=x)||void 0===n?void 0:n.e2eeSecret))){let e=!1;h&&(e=await eA(f,h,t)),!e&&(null===(o=x)||void 0===o?void 0:o.e2eeSecret)&&x.e2eeSecret!==h&&(e=await eA(f,x.e2eeSecret,t)),e?(m=ev.getItem(c),p=ev.getItem(d),ev.setItem(u,p),console.log("[E2EE] Restored canonical keypair from server. Cross-browser sync active.")):v?console.warn("[E2EE] Cannot decrypt server envelope — generating new keypair."):b&&console.warn("[E2EE] Server key differs from local key and envelope is undecryptable. Will re-register local key.")}let y=await eC(t),j=ev.getItem(u);if(j!==y.publicKey&&e)await eI(e,t);else if(e){let a="".concat(eh,"_env_").concat(t||"default");ev.getItem(a)||(await eI(e,t),ev.setItem(a,"1"))}return y}catch(e){return console.warn("[E2EE] initE2EE error:",e),null}}var eZ=a(1818),eP=a(1646),eT=a(7307),eD=a(3718),e_=a(4077),eM=a(5097),eU=a(6789),eR=a(8971),eO=a(3219),eL=a(4622),ez=a(4976),eB=a(4933),eW=a(1787),eK=a(8051),eq=a(9769),eH=a(6609),eJ=a(6989),eV=a(4485),eG=a(1853),eY=a(8272),e$=a(8814),eQ=a(2674),eX=a(4998),e0=a(5440),e1=a(4844),e2=a(7349),e5=a(3231),e4=a(6953),e3=a(4336),e6=a(1210);let e8={en:"Tap SEND to securely log in to MeetSpace.",tr:"MeetSpace'e g\xfcvenli bir şekilde giriş yapmak i\xe7in G\xd6NDER'e dokunun.",es:"Toca ENVIAR para iniciar sesi\xf3n de forma segura en MeetSpace."};function e7(e,t){if(!e||"string"!=typeof e||!t)return e;let a=t.trim();if(!a)return e;let s=e.match(/^(sms:[^?;&]*)([?;&]+body=)(.*)$/i);if(s){let t=s[1],l=s[2],r=s[3],n="";try{n=decodeURIComponent(r.replace(/\+/g," "))}catch(e){n=r}if(n.includes(a))return e;let i=!1;for(let e of Object.values(e8))if(e!==a&&n.includes(e)){n=n.replace(e,a),i=!0;break}if(!i){let e=n.endsWith("\n\n")?"":n.endsWith("\n")?"\n":n.length>0?"\n\n":"";n="".concat(n).concat(e).concat(a)}return"".concat(t).concat(l).concat(encodeURIComponent(n))}if(e.startsWith("sms:")){let t=e.includes("?")?"&body=":"?body=";return"".concat(e).concat(t).concat(encodeURIComponent("\n\n"+a))}return e}let e9=(e,t)=>{let a=new Set(e.map(e=>e.title).filter(Boolean).map(e=>e.toLowerCase())),s=new Set(e.map(e=>e.id));return t.filter(e=>{if(s.has(e.id))return!1;if(e.title){let t=e.title.toLowerCase();if(a.has(t))return!1;a.add(t)}return!0})};var te=e=>{var t,a,n,d,u,m,p,x,h,g,f,y,S,F,Z,D,L,B,K,J,V,G,Y,$,Q,X,ee,es,er,en,ei,ed;let{initialData:eb}=e,{t:ew,locale:eN}=(0,I.$)(),ek=(0,r.useRouter)(),eS=e=>{var t;return(0,A.nl)({...e,path:(null==ek?void 0:null===(t=ek.asPath)||void 0===t?void 0:t.split("?")[0])||""})},[eI,eA]=(0,l.useState)(!1),[te,tt]=(0,l.useState)(null!==(F=null==eb?void 0:null===(t=eb.auth)||void 0===t?void 0:t.isAuthenticated)&&void 0!==F&&F),[ta,ts]=(0,l.useState)((null==eb?void 0:null===(ed=eb.auth)||void 0===ed?void 0:ed.isAuthenticated)?"complete":eb?["user","group","single-post","tag","user-list","search","event","plus","private-album"].includes(null==eb?void 0:eb.type)||(null==eb?void 0:eb.tab)==="events"||(null==eb?void 0:eb.events)&&Array.isArray(eb.events)||(null==eb?void 0:eb.initialEventModal)?"guest":"phone":"loading"),[tl,tr]=(0,l.useState)(null!==(Z=null==eb?void 0:null===(a=eb.auth)||void 0===a?void 0:a.user)&&void 0!==Z?Z:null),tn=(null==tl?void 0:tl.autotarihok)&&new Date(tl.autotarihok)>new Date,ti="tr"===eN||tn,to=ti?5:2,[tc,td]=(0,l.useState)(null!==(D=null==eb?void 0:null===(d=eb.auth)||void 0===d?void 0:null===(n=d.user)||void 0===n?void 0:n.followingCount)&&void 0!==D?D:0),[tu,tm]=(0,l.useState)(""),[tp,tx]=(0,l.useState)([]),[th,tg]=(0,l.useState)(new Set),[tf,tb]=(0,l.useState)(!1),[tv,ty]=(0,l.useState)(!1),[tj,tw]=(0,l.useState)(null!==(L=null==eb?void 0:null===(u=eb.auth)||void 0===u?void 0:u.accounts)&&void 0!==L?L:[]),[tN,tk]=(0,l.useState)(""),[tS,tC]=(0,l.useState)(""),[tE,tI]=(0,l.useState)(!1),[tA,tF]=(0,l.useState)(""),[tZ,tP]=(0,l.useState)(null),[tT,tD]=(0,l.useState)("messages"),[t_,tM]=(0,l.useState)(""),[tU,tR]=(0,l.useState)(!1),[tO,tL]=(0,l.useState)(!1),[tz,tB]=(0,l.useState)(!1),tW=(0,l.useRef)(null);(0,l.useEffect)(()=>()=>{tW.current&&(clearInterval(tW.current),tW.current=null)},[]);let tK=()=>{tW.current&&(clearInterval(tW.current),tW.current=null),tD("messages"),tM(""),tR(!1),tL(!1)},[tq,tH]=(0,l.useState)(""),[tJ,tV]=(0,l.useState)(""),[tG,tY]=(0,l.useState)(""),[t$,tQ]=(0,l.useState)((null==eb?void 0:eb.type)==="user"?"profile":(null==eb?void 0:eb.type)==="group"?"board":(null==eb?void 0:eb.type)==="dm-list"?"dm-list":(null==eb?void 0:eb.type)==="dm"?"dm":(null==eb?void 0:eb.type)==="private-album"?"private-album":(null==eb?void 0:eb.type)==="single-post"?"single-post":(null==eb?void 0:eb.type)==="tag"?"tag":(null==eb?void 0:eb.type)==="search"?"search":(null==eb?void 0:eb.type)==="user-list"?"user-list":(null==eb?void 0:eb.type)==="plus"?"about":"groups-list"),[tX,t0]=(0,l.useState)((null==eb?void 0:eb.type)==="private-album"?{slug:eb.slug,title:eb.title,owner:null===(m=eb.feed)||void 0===m?void 0:m.owner,media:null===(p=eb.feed)||void 0===p?void 0:p.media}:null),[t1,t2]=(0,l.useState)((null==eb?void 0:eb.type)==="group"?eb.slug:null),[t5,t4]=(0,l.useState)((null==eb?void 0:eb.type)==="dm"?eb.conversationSlug:null),[t3,t6]=(0,l.useState)((null==eb?void 0:eb.type)==="single-post"?eb.slug:null),[t8,t7]=(0,l.useState)((null==eb?void 0:eb.type)==="single-post"?eb.post:null),[t9,ae]=(0,l.useState)((null==eb?void 0:eb.type)==="single-post"?null===(x=eb.post)||void 0===x?void 0:x.highlightReplySlug:null),[at,aa]=(0,l.useState)((null==eb?void 0:eb.type)==="user"?eb.username:null),[as,al]=(0,l.useState)((null==eb?void 0:eb.type)==="user"?{name:eb.name,slug:eb.username,bio:eb.bio,city:eb.city||null,country:eb.country||null,country_full:eb.country_full||null,lat:eb.lat||null,lng:eb.lng||null,avatar:eb.avatar,cover:eb.cover,joinedAt:eb.joinedAt||null,followerCount:eb.followerCount||0,followingCount:eb.followingCount||0,isFollowing:eb.isFollowing||!1,isBlocked:eb.isBlocked||!1}:null),[ar,an]=(0,l.useState)((null==eb?void 0:eb.type)==="user"&&eb.feed?eb.feed:[]),[ai,ao]=(0,l.useState)("activity"),[ac,ad]=(0,l.useState)([]),[au,am]=(0,l.useState)((null==eb?void 0:eb.initialEventModal)||null),[ap,ax]=(0,l.useState)([]),[ah,ag]=(0,l.useState)(!1),[af,ab]=(0,l.useState)(!1),[av,ay]=(0,l.useState)(!1),[aj,aw]=(0,l.useState)((null==eb?void 0:eb.events)&&Array.isArray(eb.events)?eb.events:[]),[aN,ak]=(0,l.useState)(!1),[aS,aC]=(0,l.useState)((null==eb?void 0:eb.events)&&Array.isArray(eb.events)&&eb.events.length>0),[aE,aI]=(0,l.useState)(!1),[aA,aF]=(0,l.useState)(""),[aZ,aP]=(0,l.useState)(""),[aT,aD]=(0,l.useState)(""),[a_,aM]=(0,l.useState)(""),[aU,aR]=(0,l.useState)(""),[aO,aL]=(0,l.useState)(null),[az,aB]=(0,l.useState)(""),[aW,aK]=(0,l.useState)(!1),[aq,aH]=(0,l.useState)(""),[aJ,aV]=(0,l.useState)(!1),[aG,aY]=(0,l.useState)(!1),[a$,aQ]=(0,l.useState)((null==eb?void 0:eb.type)==="tag"?eb.slug:null),[aX,a0]=(0,l.useState)((null==eb?void 0:eb.type)==="tag"&&eb.feed?eb.feed:[]),[a1,a2]=(0,l.useState)((null==eb?void 0:eb.type)==="tag"&&eb.page||0),[a5,a4]=(0,l.useState)((null==eb?void 0:eb.type)!=="tag"||((null==eb?void 0:null===(h=eb.feed)||void 0===h?void 0:h.length)||0)>=20),[a3,a6]=(0,l.useState)(!1),[a8,a7]=(0,l.useState)((null==eb?void 0:eb.type)==="tag"?eb.startedBy:null),[a9,se]=(0,l.useState)((null==eb?void 0:eb.type)==="tag"?eb.totalPosts:0),[st,sa]=(0,l.useState)((null==eb?void 0:eb.songData)||null),[ss,sl]=(0,l.useState)((null==eb?void 0:eb.type)==="search"?eb.query:null),[sr,sn]=(0,l.useState)((null==eb?void 0:eb.type)==="search"&&eb.feed?eb.feed:[]),[si,so]=(0,l.useState)((null==eb?void 0:eb.type)==="search"&&eb.page||0),[sc,sd]=(0,l.useState)((null==eb?void 0:eb.type)!=="search"||((null==eb?void 0:null===(g=eb.feed)||void 0===g?void 0:g.length)||0)>=20),[su,sm]=(0,l.useState)(!1),[sp,sx]=(0,l.useState)([]),[sh,sg]=(0,l.useState)((null==eb?void 0:eb.type)==="group"?{name:eb.name,description:eb.description,slug:eb.slug,logo:eb.logo,is_public:!1!==eb.is_public,invite_enabled:!1!==eb.invite_enabled}:null),[sf,sb]=(0,l.useState)((null==eb?void 0:eb.type)==="group"&&eb.channels?eb.channels:[]),[sv,sy]=(0,l.useState)((null==eb?void 0:eb.type)==="group"&&eb.selectedChannel?eb.selectedChannel:null),[sj,sw]=(0,l.useState)((null==eb?void 0:eb.type)==="group"&&eb.selectedChannel&&eb.feed?{[eb.selectedChannel]:eb.feed}:{}),[sN,sk]=(0,l.useState)((null==eb?void 0:eb.type)==="group"&&eb.members?eb.members:[]),[sS,sC]=(0,l.useState)((null==eb?void 0:eb.type)==="group"&&eb.selectedChannel?{[eb.selectedChannel]:eb.page||0}:{}),[sE,sI]=(0,l.useState)({}),[sA,sF]=(0,l.useState)({}),[sZ,sP]=(0,l.useState)((null==eb?void 0:eb.type)==="dm"&&eb.conversation?[eb.conversation]:[]),[sT,sD]=(0,l.useState)([]),[s_,sM]=(0,l.useState)(0),[sU,sR]=(0,l.useState)(!0),[sO,sL]=(0,l.useState)(!1),[sz,sB]=(0,l.useState)((null==eb?void 0:eb.type)==="user"&&eb.page||0),[sW,sK]=(0,l.useState)((null==eb?void 0:eb.type)!=="user"||((null==eb?void 0:null===(f=eb.feed)||void 0===f?void 0:f.length)||0)>=20),[sq,sH]=(0,l.useState)(!1),[sJ,sV]=(0,l.useState)(""),[sG,sY]=(0,l.useState)(""),[s$,sQ]=(0,l.useState)([]),[sX,s0]=(0,l.useState)(""),[s1,s2]=(0,l.useState)(""),[s5,s4]=(0,l.useState)(!1),[s3,s6]=(0,l.useState)([]),[s8,s7]=(0,l.useState)(""),[s9,le]=(0,l.useState)([]),[lt,la]=(0,l.useState)(!1),[ls,ll]=(0,l.useState)(!1),[lr,ln]=(0,l.useState)(!1),[li,lo]=(0,l.useState)(!1),[lc,ld]=(0,l.useState)(!1),[lu,lm]=(0,l.useState)(!1),[lp,lx]=(0,l.useState)(!1),[lh,lg]=(0,l.useState)(!1),[lf,lb]=(0,l.useState)(!1),[lv,ly]=(0,l.useState)(""),[lj,lw]=(0,l.useState)(""),[lN,lk]=(0,l.useState)("phone"),[lS,lC]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let e=e=>{au&&(am(null),aI(!1),aY(!1),aL(null),aB(""))};return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)},[au]);let[lE,lI]=(0,l.useState)(""),[lA,lF]=(0,l.useState)(!1),[lZ,lP]=(0,l.useState)(!1),[lT,lD]=(0,l.useState)(""),[l_,lM]=(0,l.useState)(!1),[lU,lR]=(0,l.useState)("deactivate"),[lO,lL]=(0,l.useState)(!1),[lz,lB]=(0,l.useState)(""),[lW,lK]=(0,l.useState)(null),[lq,lH]=(0,l.useState)(!1),[lJ,lV]=(0,l.useState)(null),[lG,lY]=(0,l.useState)(""),[l$,lQ]=(0,l.useState)(!1),[lX,l0]=(0,l.useState)(""),[l1,l2]=(0,l.useState)("email"),[l5,l4]=(0,l.useState)(null),[l3,l6]=(0,l.useState)(null),[l8,l7]=(0,l.useState)(""),[l9,re]=(0,l.useState)(null),[rt,ra]=(0,l.useState)(""),[rs,rl]=(0,l.useState)(!eb||(null==eb?void 0:eb.type)==="dm-list"),[rr,rn]=(0,l.useState)(!1),[ri,ro]=(0,l.useState)(""),[rc,rd]=(0,l.useState)(""),[ru,rm]=(0,l.useState)(""),[rp,rx]=(0,l.useState)(""),[rh,rg]=(0,l.useState)(""),[rf,rb]=(0,l.useState)(""),[rv,ry]=(0,l.useState)(""),[rj,rw]=(0,l.useState)(null),[rN,rk]=(0,l.useState)(null),[rS,rC]=(0,l.useState)(null),[rE,rI]=(0,l.useState)(null),[rA,rF]=(0,l.useState)(!1),[rZ,rP]=(0,l.useState)(""),[rT,rD]=(0,l.useState)(""),[r_,rM]=(0,l.useState)(null),[rU,rR]=(0,l.useState)(!1),[rO,rL]=(0,l.useState)(!1),[rz,rB]=(0,l.useState)(""),[rW,rK]=(0,l.useState)({users:[],groups:[],messages:[]}),[rq,rH]=(0,l.useState)(!1),[rJ,rV]=(0,l.useState)(!1),[rG,rY]=(0,l.useState)([]),[r$,rQ]=(0,l.useState)((null==eb?void 0:eb.users)||[]),[rX,r0]=(0,l.useState)((null==eb?void 0:eb.page)||0),[r1,r2]=(0,l.useState)(((null==eb?void 0:null===(y=eb.users)||void 0===y?void 0:y.length)||0)>0),[r5,r4]=(0,l.useState)(!1),[r3,r6]=(0,l.useState)((null==eb?void 0:eb.listType)||null),[r8,r7]=(0,l.useState)((null==eb?void 0:eb.slug)||null),[r9,ne]=(0,l.useState)(0),[nt,na]=(0,l.useState)(null),[ns,nl]=(0,l.useState)(null),[nr,nn]=(0,l.useState)(0),[ni,no]=(0,l.useState)(!1),[nc,nd]=(0,l.useState)(!1),[nu,nm]=(0,l.useState)([]),[np,n
1x]=(0,l.useState)(null),[nh,ng]=(0,l.useState)({}),[nf,nb]=(0,l.useState)({}),[nv,ny]=(0,l.useState)({}),[nj,nw]=(0,l.useState)({}),[nN,nk]=(0,l.useState)(""),[nS,nC]=(0,l.useState)(!1),[nE,nI]=(0,l.useState)(""),[nA,nF]=(0,l.useState)([]),[nZ,nP]=(0,l.useState)(!1),[nT,nD]=(0,l.useState)(null),[n_,nM]=(0,l.useState)(null),[nU,nR]=(0,l.useState)(!1),[nO,nL]=(0,l.useState)(""),[nz,nB]=(0,l.useState)(""),[nW,nK]=(0,l.useState)(""),[nq,nH]=(0,l.useState)(null),[nJ,nV]=(0,l.useState)(!1),[nG,nY]=(0,l.useState)([]),[n$,nQ]=(0,l.useState)(0),[nX,n0]=(0,l.useState)(!1),[n1,n2]=(0,l.useState)((null==eb?void 0:eb.tab)||((null==eb?void 0:eb.type)==="feed"?eb.tab:te?"following":"tr"===eN?"following":"events")),[n5,n4]=(0,l.useState)([]),[n3,n6]=(0,l.useState)(!1),[n8,n7]=(0,l.useState)((null==eb?void 0:eb.type)==="feed"&&eb.feed?eb.feed:[]),[n9,ie]=(0,l.useState)((null==eb?void 0:eb.type)==="feed"&&eb.page||0),[it,ia]=(0,l.useState)((null==eb?void 0:eb.type)!=="feed"||((null==eb?void 0:null===(S=eb.feed)||void 0===S?void 0:S.length)||0)>0),[is,il]=(0,l.useState)(!1),[ir,ii]=(0,l.useState)((null==eb?void 0:eb.modules)||null),[io,ic]=(0,l.useState)(!1);(0,l.useEffect)(()=>(au||lh||rO||nJ||rJ?(document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden"):(document.body.style.overflow="unset",document.documentElement.style.overflow="unset"),()=>{document.body.style.overflow="unset",document.documentElement.style.overflow="unset"}),[au,lh,rO,nJ,rJ]),(0,l.useRef)(null),(0,l.useRef)(null),(0,l.useRef)(null);let id=(0,l.useRef)(null),iu=(0,l.useRef)(null),im=(0,l.useRef)(null),ip=(0,l.useRef)(null),ix=(0,l.useRef)(null),ih=(0,l.useRef)(null),ig=(0,l.useRef)(null),ib=(0,l.useRef)(null);(0,l.useRef)(null);let iv=(0,l.useRef)(null),iy=(0,l.useRef)(null),ij=(0,l.useRef)(null),iw=(0,l.useRef)(null),iN=(0,l.useRef)(null),ik=(0,l.useRef)(null),iS=(0,l.useRef)({page:0,hasMore:!0,loading:!1}),iC=e=>{try{return decodeURIComponent(e)}catch(t){return console.warn("Failed to decode URI component:",e,t),e}},iE=(0,l.useRef)(null),iI=(0,l.useRef)(null),iA=(0,l.useRef)(null);(0,l.useEffect)(()=>{eA(!0);try{let e=localStorage.getItem("join_phone"),t=localStorage.getItem("join_name");e&&tk(e),t&&tH(t)}catch(e){}},[]),(0,l.useEffect)(()=>{iH()},[]),(0,l.useEffect)(()=>{rs||eb&&"groups-list"!==t$||"groups-list"!==t$||iW()},[rs,te,ta,eb]),(0,l.useEffect)(()=>{window.scrollTo(0,0),l4(null),"board"===t$?(s0(""),s2(""),s6([]),s7(""),le([])):"profile"===t$?(sV(""),sY(""),sQ([]),s7(""),le([])):"dm"===t$?(sV(""),sY(""),sQ([]),s0(""),s2(""),s6([])):(sV(""),sY(""),sQ([]),s0(""),s2(""),s6([]),s7(""),le([]))},[t$]),(0,l.useEffect)(()=>{if("groups-list"!==t$||ir||iK("/api/modules?locale=".concat(eN)).then(e=>ii(e)).catch(e=>console.error("Failed to load modules:",e)),te&&tl&&"complete"===ta||"guest"===ta){if("groups-list"===t$)iJ();else if("board"===t$&&t1)(null==eb?void 0:eb.type)==="group"&&eb.slug===t1&&sh?0===sf.length&&iV(t1):iV(t1);else if("profile"===t$&&at){if((null==eb?void 0:eb.type)==="user"&&eb.username===at){if((null==as?void 0:as.slug)!==at&&(al({name:eb.name,slug:eb.username,bio:eb.bio,city:eb.city||null,country:eb.country||null,country_full:eb.country_full||null,lat:eb.lat||null,lng:eb.lng||null,avatar:eb.avatar,cover:eb.cover,joinedAt:eb.joinedAt||null,followerCount:eb.followerCount||0,followingCount:eb.followingCount||0,isFollowing:eb.isFollowing||!1,isBlocked:eb.isBlocked||!1}),an([]),sB(0)),(0===ar.length||(null==as?void 0:as.slug)!==at)&&!sq){let e=te?iK:iq;sH(!0),e("/api/users/".concat(at,"/feed?offset=0&limit=20")).then(e=>{var t;an(e.feed||[]),sK(((null===(t=e.feed)||void 0===t?void 0:t.length)||0)>0)}).catch(e=>console.error("Feed load error",e)||sK(!1)).finally(()=>sH(!1))}}else i8(at)}else"single-post"===t$&&t3&&!t8?i1(t3):"tag"===t$&&a$&&0===sr.length?i2(a$,0):"search"===t$&&ss&&0===sr.length&&i5(ss,0);if("private-album"===t$&&(null==tX?void 0:tX.slug)){let e=!tX.media;iX(tX.slug,e)}"dm-list"===t$&&te&&iG(),te&&oU()}},[te,ta,t$,t1,t5,at,t3,a$,ss]),(0,l.useEffect)(()=>{if("single-post"===t$&&t3&&t8&&!rJ&&t8.media&&t8.media.length>0&&!window.location.search.includes("gallery=false")){let e=t8.media.findIndex(e=>e.message_slug===t3);ce(t8.media,e>=0?e:0,t8.title,!0)}},[t$,t3,t8]),(0,l.useEffect)(()=>
1{if(!te||"complete"!==ta)return;oU();let e=setInterval(oU,3e4);return()=>clearInterval(e)},[te,ta]),(0,l.useEffect)(()=>{te&&"complete"===ta&&(null==tl?void 0:tl.id)&&eF(iK,tl.id).catch(e=>{console.warn("[E2EE] Key initialization failed:",e)})},[te,ta,null==tl?void 0:tl.id]),(0,l.useEffect)(()=>{nJ&&te&&oM()},[nJ,te]),(0,l.useEffect)(()=>{if(sv&&"board"===t$){let e=sj[sv];e&&0!==e.length||iQ(sv,0,10)}},[sv,t$]),(0,l.useEffect)(()=>{t5&&"dm"===t$&&(i$(0),sP(e=>(e.find(e=>e.slug===t5)||iY(t5),e)))},[t5,t$]),(0,l.useEffect)(()=>{t9&&sj[sv]&&setTimeout(()=>{let e=document.getElementById("msg-".concat(t9));e&&(e.scrollIntoView({behavior:"smooth",block:"center"}),e.classList.add("highlight-flash"),setTimeout(()=>{e.classList.remove("highlight-flash"),ae(null)},2e3))},500)},[t9,sj,sv]),(0,l.useEffect)(()=>{"board"===t$?iZ(iE):"profile"===t$?iZ(iI):"dm"===t$&&iZ(iA)},[sJ,sX,s8,t$]),(0,l.useEffect)(()=>{if("onboarding"!==ta||!tG||tG===(null==tl?void 0:tl.slug)){nD(null);return}if(!iM(tG)){nD({status:"invalid",message:ew("auth.usernameRequirements")});return}let e=!1;nD({status:"checking",message:"Checking availability..."});let t=setTimeout(async()=>{try{let t=await iO(tG,null==tl?void 0:tl.slug);e||nD({status:t.available?"available":"taken",message:t.available?ew("auth.usernameAvailable",{username:tG}):t.reason||ew("auth.usernameTaken",{username:tG})})}catch(t){e||nD({status:"error",message:t.message||"Unable to check username availability"})}},300);return()=>{e=!0,clearTimeout(t)}},[ta,tG,null==tl?void 0:tl.slug]),(0,l.useEffect)(()=>{if(!rr||!ru){nM(null);return}let e=(null==tl?void 0:tl.slug)||"";if(ru===e){nM({status:"available",message:ew("auth.currentUsername")});return}if(!iM(ru)){nM({status:"invalid",message:ew("auth.usernameRequirements")});return}let t=!1;nM({status:"checking",message:"Checking availability..."});let a=setTimeout(async()=>{try{let a=await iO(ru,e);t||nM({status:a.available?"available":"taken",message:a.available?ew("auth.usernameAvailable",{username:ru}):a.reason||ew("auth.usernameTaken",{username:ru})})}catch(e){t||nM({status:"error",message:e.message||"Unable to check username availability"})}},300);return()=>{t=!0,clearTimeout(a)}},[ru,rr,null==tl?void 0:tl.slug]),(0,l.useEffect)(()=>{if("profile"!==lN||!nW){nH(null);return}if(!iM(nW)){nH({status:"invalid",message:ew("auth.usernameRequirements")});return}let e=!1;nH({status:"checking",message:"Checking availability..."});let t=setTimeout(async()=>{try{let t=await iO(nW);e||nH({status:t.available?"available":"taken",message:t.available?ew("auth.usernameAvailable",{username:nW}):t.reason||ew("auth.usernameTaken",{username:nW})})}catch(t){e||nH({status:"error",message:t.message||"Unable to check username availability"})}},300);return()=>{e=!0,clearTimeout(t)}},[nW,lN]),(0,l.useEffect)(()=>{if(!iv.current||!sv||"board"!==t$)return;let e=iv.current,t=!1,a=()=>{if(t||!sE[sv])return;let{scrollTop:a}=e;if(a<200&&!sA[sv]){t=!0;let s=sS[sv]||0,l=e.scrollHeight;iQ(sv,s+1).then(()=>{setTimeout(()=>{let s=e.scrollHeight;e.scrollTop=a+(s-l),t=!1},100)})}};return e.addEventListener("scroll",a),()=>e.removeEventListener("scroll",a)},[t$,sv,sE,sA,sS]),(0,l.useEffect)(()=>{if(!iy.current||!t5||"dm"!==t$)return;let e=iy.current,t=!1,a=()=>{if(t||!sU||sO)return;let{scrollTop:a}=e;if(a<200){t=!0;let s=e.scrollHeight;i$(s_+1).then(()=>{setTimeout(()=>{let l=e.scrollHeight;e.scrollTop=a+(l-s),t=!1},100)})}};return e.addEventListener("scroll",a),()=>e.removeEventListener("scroll",a)},[t$,t5,sU,sO,s_]),(0,l.useEffect)(()=>{if("profile"!==t$||!ib.current)return;let e=new IntersectionObserver(e=>{e[0].isIntersecting&&("posts"===ai||"activity"===ai)&&sW&&!sq&&i7()},{threshold:.1,rootMargin:"100px"});return e.observe(ib.current),()=>e.disconnect()},[t$,ai,sW,sq]),(0,l.useEffect)(()=>{if("events"===ai&&!av&&!af&&at){ab(!0);let e=te?iK:iq;e("/api/users/".concat(at,"/events")).then(e=>{let t=(null==e?void 0:e.events)||(Array.isArray(null==e?void 0:e.contents)?e.contents:Array.isArray(e)?e:[]),a=new Date,s=t.filter(e=>{if(!e.date)return!1;let t=new Date(e.date);return!isNaN(t.getTime())&&t>=a});ad(s),ay(!0)}).catch(e=>{console.error("Events load error",e),ad([]),ay(!0)}).finally(()=>ab(!1))}},[ai,av,af,at,te]),(0,l.useEffect)(()=>
1{if("groups-list"===t$&&"events"===n1&&!aS&&!aN){ak(!0);let e=te?iK:iq;e("/api/events").then(e=>{let t=(null==e?void 0:e.events)||(Array.isArray(e)?e:[]),a=new Date,s=t.filter(e=>{if(!e.date)return!1;let t=new Date(e.date);return!isNaN(t.getTime())&&t>=a});aw(s),aC(!0)}).catch(e=>{console.error("Global events load error",e),aw([]),aC(!0)}).finally(()=>ak(!1))}},[n1,t$,aS,aN,te]),(0,l.useEffect)(()=>{if(au&&au.dbId){ag(!0);let e=te?iK:iq;e("/api/events/".concat(au.dbId,"/messages")).then(e=>{ax(e.messages||[])}).catch(e=>console.error("Event messages load error",e)).finally(()=>ag(!1))}else ax([])},[au,te]),(0,l.useEffect)(()=>{iS.current={page:n9,hasMore:it,loading:is}},[n9,it,is]),(0,l.useEffect)(()=>{if("groups-list"!==t$||"following"!==n1)return;let e=()=>{let{hasMore:e,loading:t,page:a}=iS.current;if(!e||t)return;let s=window.scrollY+window.innerHeight,l=document.documentElement.scrollHeight-300;s>=l&&i4(a+1)};return window.addEventListener("scroll",e,{passive:!0}),e(),()=>window.removeEventListener("scroll",e)},[t$,n1]);let iF=(0,l.useRef)(null);(0,l.useEffect)(()=>{if("user-list"!==t$||!iw.current)return;let e=new IntersectionObserver(e=>{e[0].isIntersecting&&r1&&!r5&&i9(rX+1)},{threshold:.1,rootMargin:"100px"});return e.observe(iw.current),()=>e.disconnect()},[t$,r1,r5,rX]),(0,l.useEffect)(()=>{if("tag"!==t$||!iN.current||(null==eb?void 0:eb.isBot))return;let e=new IntersectionObserver(e=>{e[0].isIntersecting&&a5&&!a3&&i2(a$,a1+1)},{threshold:.1,rootMargin:"100px"});return e.observe(iN.current),()=>e.disconnect()},[t$,a5,a3,a1,a$,null==eb?void 0:eb.isBot]),(0,l.useEffect)(()=>{if("search"!==t$||!ik.current)return;let e=new IntersectionObserver(e=>{e[0].isIntersecting&&sc&&!su&&i5(ss,si+1)},{threshold:.1,rootMargin:"100px"});return e.observe(ik.current),()=>e.disconnect()},[t$,sc,su,si,ss]);let iZ=e=>{if(e&&e.current){e.current.style.height="auto";let t=e.current.scrollHeight;e.current.style.height=Math.min(t,72)+"px"}},iP=e=>(e||"").replace(/\D/g,""),iT=e=>10===iP(e).length,iD=(e,t)=>{let a=iP(e);return 0===a.length?"":"tr"===t?a.length<=3?a:a.length<=6?"".concat(a.slice(0,3)," ").concat(a.slice(3)):a.length<=8?"".concat(a.slice(0,3)," ").concat(a.slice(3,6)," ").concat(a.slice(6)):"".concat(a.slice(0,3)," ").concat(a.slice(3,6)," ").concat(a.slice(6,8)," ").concat(a.slice(8,10)):a.length<=3?"(".concat(a):a.length<=6?"(".concat(a.slice(0,3),") ").concat(a.slice(3)):"(".concat(a.slice(0,3),") ").concat(a.slice(3,6),"-").concat(a.slice(6,10))},i_=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),iM=e=>/^[a-zA-Z0-9_]{3,20}$/.test(e),iU=e=>(e||"").toLowerCase().replace(/[^a-z0-9_]/g,"").trim(),iR=e=>["invalid","taken","checking"].includes(e),iO=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=iU(e),s=iU(t);if(!a)return{available:!1};let l="/api/users/check-username?username=".concat(encodeURIComponent(a)).concat(s?"&current=".concat(encodeURIComponent(s)):"");try{return await iq(l)}catch(e){try{let e=await iq("/api/auth/check-username?username=".concat(encodeURIComponent(a)));if(!e.available&&s&&a===s)return{available:!0};return e}catch(e){throw e}}},iL=e=>{if(!e)return"text-gray-400";switch(e){case"available":return"text-green-400";case"checking":return"text-purple-400";default:return"text-red-400"}},iz=e=>{if(!e)return null;let t=e.match(/(?:https?:\/\/)?(?:(?:www\.|m\.)?youtube\.com\/watch\?v=|youtu\.be\/)([a-zA-Z0-9_-]{11})/),a=e.match(/(?:https?:\/\/)?(?:www\.)?vimeo\.com\/(\d+)/);return t?{type:"youtube",id:t[1]}:a?{type:"vimeo",id:a[1]}:null},iB=(0,l.useCallback)(async e=>{try{let t=null;try{t=await iq("/api/slug/".concat(e))}catch(s){let a=/^[A-Z]{3}[0-9]{3}$/i.test(e);if(a)try{let a=await iq("/api/messages/".concat(e));a&&(a.id||a.content||a.title)&&(t={type:"message",id:a.id,slug:e})}catch(e){}if(!t)try{let a=await iq("/api/groups/".concat(e));a&&(a.id||a.name)&&(t={type:"group",id:a.id,slug:e})}catch(e){}if(!t)try{let a=await iq("/api/users/".concat(e));a&&a.user&&!a.error&&(t={type:"user",id:a.user.id,slug:e})}catch(e){}}if(!t)throw Error("Slug not found");if("user"===t.type)aa(e),tQ("profile");else if("group"===t.type)t2(e),tQ("board");else if("message"===t.type)t6(e),ae(e),tQ("single-post");else if("conversation"===t.type)try{await iK("/api/auth/me"),t4(e),tQ("dm")}catch(e){alert(ew("auth.loginToViewDM")),tQ("groups-list"),ek.push("/",void 0,{shallow:!0})}}catch(e){console.error("Failed to load slug:",e),tQ("groups-list"),ek.push("/",void 0,{shallow:!0})}},[ek,t$,at,t1,t3]),iW=(0,l.useCallback)(e=>
1{let t=e||window.location.pathname,a=t.split("/").filter(Boolean),s=a.length>0&&["en","es","tr"].includes(a[0])?a.slice(1):a;if(s.length>0){let e=s[0];if("tag"===e&&s.length>1){let e=iC(s[1]);aQ(e),tQ("tag"),i2(e,0);return}if("search"===e&&s.length>1){let e=iC(s[1]);sl(e),tQ("search"),i5(e,0);return}if("dm"===e){tQ("dm-list");return}if("c"===e&&s.length>1){let e=iC(s[1]);t4(e),sD([]),sM(0),sR(!0),tQ("dm");return}if("private"===e&&s.length>1){tQ("private-album");return}if("plus"===e){tQ("about");return}if("suite"===e||"unsubscribe"===e||"terms-of-service"===e||"privacy-policy"===e||"ca-privacy-notice"===e||"code-of-conduct"===e||"events"===e||"help"===e)return;iB(iC(e))}else tQ("groups-list"),aQ(null),sl(null),t2(null),aa(null),t6(null)},[iB]);(0,l.useEffect)(()=>{let e=e=>{rJ||iW(e)};return ek.events.on("routeChangeComplete",e),()=>{ek.events.off("routeChangeComplete",e)}},[ek,te,iW,rJ]);let iK=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,eZ.GU)(e,t,ek.locale||"en")},iq=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{return await (0,eZ.GU)(e,t,ek.locale||"en")}catch(e){throw console.error("API Error:",e),e}},iH=async()=>{try{var e,t,a,s,l,r;let n=await iK("/api/auth/me");if(!(null==n?void 0:n.user))throw Error("Unauthenticated");tr(n.user),n.e2eeSecret&&ey(n.e2eeSecret,null,null===(s=n.user)||void 0===s?void 0:s.id),(null===(e=n.user)||void 0===e?void 0:e.followingCount)!==void 0&&td(n.user.followingCount),tw(n.accounts||[n.user]);let i=((null===(t=n.user)||void 0===t?void 0:t.source)||0)>0,o=(null===(a=n.user)||void 0===a?void 0:a.approved)===0;!n.user.name||i&&o?(tt(!1),ts("onboarding"),tH(""),tV((null===(l=n.user)||void 0===l?void 0:l.email)||""),tY((null===(r=n.user)||void 0===r?void 0:r.slug)||""),nD(null)):(tt(!0),ts("complete"))}catch(a){let e=window.location.pathname.split("/").filter(Boolean),t=e.length>0&&["en","es","tr"].includes(e[0])?e.slice(1):e;t.length>0&&("e"===t[0]||"c"===t[0]||"tag"===t[0]||"song"===t[0]||"search"===t[0]||"plus"===t[0]||"private"===t[0]||"events"===t[0]||"help"===t[0]||t[0].includes("-")||t[0].length>=3&&/^[a-z0-9_]+$/i.test(t[0]))?(tt(!1),ts("guest")):(tt(!1),ts("phone"),"/"!==window.location.pathname&&ek.push("/"))}finally{rl(!1)}},iJ=async()=>{try{let e=await iK("/api/groups");sx(e.groups)}catch(e){console.error("Failed to load groups:",e)}},iV=async e=>{try{let t=await iq("/api/groups/".concat(e));sg(t);let a=te?iK:iq,s=await a("/api/channels?groupSlug=".concat(e));sb(s);let l=localStorage.getItem("lastChannel_".concat(e));if(l&&s.some(e=>e.slug===l)?sy(l):s.length>0?sy(s[0].slug):sy(null),te){let t=await iK("/api/groups/".concat(e,"/members"));sk(t.map(e=>({id:e.userId,slug:e.user.slug,name:e.user.name,avatar:e.user.avatar,status:"online",role:e.role})))}else sk([])}catch(e){console.error("Failed to load group data:",e),alert("".concat(ew("groups.failedLoadGroup"),": ").concat(e.message)),tQ("groups-list"),ek.push("/",void 0,{shallow:!0})}},iG=async()=>{try{let e=await iK("/api/conversations"),t=e.conversations||[];try{let{secretKey:e}=await eC(null==tl?void 0:tl.id);t=await Promise.all(t.map(async t=>{var a,s,l;if((null===(a=t.lastMessage)||void 0===a?void 0:a.content)&&t.lastMessage.content.startsWith('{"e2ee":true')){let a=(null==tl?void 0:tl.id)!=null&&null!=t.lastMessage.senderId?(null===(s=t.lastMessage.senderId)||void 0===s?void 0:s.toString())===(null===(l=tl.id)||void 0===l?void 0:l.toString()):null,r=await eE(t.lastMessage.content,e,a,null==tl?void 0:tl.id);return{...t,lastMessage:{...t.lastMessage,content:r}}}return t}))}catch(e){console.warn("[E2EE] Error decrypting conversations preview:",e)}sP(t)}catch(e){console.error("Failed to load conversations:",e)}},iY=async e=>{try{let t=await iK("/api/conversations/".concat(e));sP(a=>{let s=a.find(t=>t.slug===e);return s?a.map(a=>a.slug===e?{...a,...t.conversation}:a):[t.conversation,...a]}),t4(e),sD([]),sM(0),sR(!0)}catch(e){console.error("Failed to load conversation:",e),alert(ew("dm.failedLoadConversation")),tQ("dm-list")}},i$=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!sO){sL(!0);try{let t=await iK("/api/conversations/".concat(t5,"/messages?offset=").concat(20*e,"&limit=20")),a=null;try{let e=await eC(null==tl?void 0:tl.id);a=null==e?void 0:e.secretKey}catch(e){console.warn("[E2EE] Key retrieve error:",e)}let s=await Promise.all((t.messages||[]).map(async e=>{let t=e.content,s="string"==typeof t&&t.startsWith('{"e2ee":true');
1if(s){var l,r,n;let s=tl&&(null===(r=e.user)||void 0===r?void 0:null===(l=r.id)||void 0===l?void 0:l.toString())===(null===(n=tl.id)||void 0===n?void 0:n.toString());t=await eE(t,a,s,null==tl?void 0:tl.id)}return{id:e.id.toString(),slug:e.slug,userId:e.user.id.toString(),userSlug:e.user.slug,userName:e.user.name,userAvatar:e.user.avatar,content:t,isEncrypted:s,timestamp:new Date(e.createdAt),media:e.media||[],videoEmbed:iz(t)}})),l=s.reverse();sD(t=>0===e?l:[...l,...t]),sM(e),sR(s.length>0),0===e&&l.length>0&&setTimeout(()=>{var e;null===(e=ih.current)||void 0===e||e.scrollIntoView({behavior:"auto"})},100)}catch(e){console.error("Failed to load DM messages:",e),sR(!1)}finally{sL(!1)}}},iQ=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,s="".concat(e,"_").concat(t);if(!sA[s]){sF(e=>({...e,[s]:!0}));try{let s=te?iK:iq,l=await s("/api/messages?channelSlug=".concat(e,"&offset=").concat(t*a,"&limit=").concat(a)),r=l.map(e=>{var t,a,s,l,r,n;return{id:(null===(t=e.id)||void 0===t?void 0:t.toString())||"",slug:e.slug,userId:(null===(s=e.user)||void 0===s?void 0:null===(a=s.id)||void 0===a?void 0:a.toString())||"",userSlug:(null===(l=e.user)||void 0===l?void 0:l.slug)||"",userName:(null===(r=e.user)||void 0===r?void 0:r.name)||"",userAvatar:null===(n=e.user)||void 0===n?void 0:n.avatar,title:e.title||"",content:e.content,timestamp:new Date(e.createdAt),likes:e.likes||0,likedByMe:e.likedByMe||!1,replyCount:e.replyCount||0,replies:(e.replies||[]).map(e=>{var t,a,s,l,r,n;return{id:(null===(t=e.id)||void 0===t?void 0:t.toString())||"",slug:e.slug,userId:(null===(s=e.user)||void 0===s?void 0:null===(a=s.id)||void 0===a?void 0:a.toString())||"",userSlug:(null===(l=e.user)||void 0===l?void 0:l.slug)||"",userName:(null===(r=e.user)||void 0===r?void 0:r.name)||"",userAvatar:null===(n=e.user)||void 0===n?void 0:n.avatar,title:e.title||"",content:e.content,timestamp:new Date(e.createdAt),likes:e.likes||0,likedByMe:e.likedByMe||!1}}),media:e.media||[],videoEmbed:iz(e.content),channelName:e.channelName,groupName:e.groupName,groupSlug:e.groupSlug}}),n=r.reverse();sw(a=>({...a,[e]:0===t?n:[...a[e]||[],...e9(a[e]||[],n)]})),sC(a=>({...a,[e]:t})),sI(t=>({...t,[e]:r.length>0})),0===t&&setTimeout(()=>{var e;null===(e=ip.current)||void 0===e||e.scrollIntoView({behavior:"auto"})},100)}catch(t){console.error("Failed to load messages:",t),sI(t=>({...t,[e]:!1}))}finally{sF(e=>({...e,[s]:!1}))}}},iX=async function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];try{let a=await iK("/api/private-albums/".concat(e));t0(a),t&&a.media&&a.media.length>0&&(rY(a.media),ne(0),na(null),no(!1),nd(!1),rV(!0))}catch(e){console.error("Failed to load private album:",e)}},i0=async()=>{let e=document.getElementById("album-media-upload"),t=Array.from((null==e?void 0:e.files)||[]);if(0!==t.length)try{let a=await Promise.all(t.map(e=>b(e))),s=await fetch("/api/private-albums/".concat(tX.slug,"/upload"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:a}),credentials:"include"});if(!s.ok)throw Error("Upload failed");e&&(e.value="");let l=document.getElementById("album-media-count");l&&(l.innerText=""),iX(tX.slug)}catch(e){console.error("Failed to upload to album:",e),alert("Failed: ".concat(e.message))}},i1=async e=>{try{let t=await iq("/api/messages/".concat(e));if(t7(t),t.highlightReplySlug&&ae(t.highlightReplySlug),t.media&&t.media.length>0){let e=t.media.findIndex(e=>e.message_slug===t3);ce(t.media,e>=0?e:0,t.title),t.highlightReplySlug&&setTimeout(()=>{let e=document.getElementById("msg-".concat(t.highlightReplySlug));e&&e.scrollIntoView({behavior:"smooth",block:"center"})},1e3)}else t.highlightReplySlug&&setTimeout(()=>{let e=document.getElementById("msg-".concat(t.highlightReplySlug));e&&(e.scrollIntoView({behavior:"smooth",block:"center"}),e.classList.add("highlight-flash"))},500)}catch(e){console.error("Failed to load post:",e),alert(ew("messages.postNotFound")),t6(null),t7(null),tQ("groups-list"),window.history.pushState({},"","/")}},i2=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!(t>0)||!a3&&a5){a6(!0);try{let a=te?iK:iq,s=await a("/api/tag/".concat(e,"?offset=").concat(20*t,"&limit=20&locale=").concat(eN));0===t?(a0(s.messages||[]),void 0!==s.startedBy&&a7(s.startedBy),void 0!==s.totalPosts&&se(s.totalPosts)):a0(e=>[...e,...e9(e,s.messages||[])]),a2(t),a4((s.messages||[]).length>=20)}
1catch(e){console.error("Failed to load tag messages:",e),0===t&&a0([]),a4(!1)}finally{a6(!1)}}},i5=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!(t>0)||!su&&sc){sm(!0);try{let a=te?iK:iq,s=await a("/api/search/".concat(e,"?offset=").concat(20*t,"&limit=20"));0===t?sn(s.messages||[]):sn(e=>[...e,...e9(e,s.messages||[])]),so(t),sd((s.messages||[]).length>=20)}catch(e){console.error("Failed to load hashtag messages:",e),0===t&&sn([]),sd(!1)}finally{sm(!1)}}},i4=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;il(!0);try{let t=await iK("/api/feed?offset=".concat(20*e,"&limit=20&locale=").concat(eN)),a=(t.feed||[]).map(e=>{var t,a;return{id:(null===(t=e.id)||void 0===t?void 0:t.toString())||"",slug:e.slug,userId:(null===(a=e.user_id)||void 0===a?void 0:a.toString())||"",userSlug:e.userSlug,userName:e.userName,userAvatar:e.userAvatar,title:e.title||"",content:e.content,timestamp:new Date(e.createdAt),likes:e.likes||0,likedByMe:e.likedByMe||!1,replyCount:e.replyCount||0,replies:(e.replies||[]).map(e=>{var t,a;return{id:(null===(t=e.id)||void 0===t?void 0:t.toString())||"",slug:e.slug,userId:(null===(a=e.user_id)||void 0===a?void 0:a.toString())||"",userSlug:e.userSlug,userName:e.userName,userAvatar:e.userAvatar,title:e.title||"",content:e.content,timestamp:new Date(e.createdAt),likes:e.likes||0,likedByMe:e.likedByMe||!1}}),media:e.media||[],videoEmbed:iz(e.content),channelName:e.channelName,groupName:e.groupName,groupSlug:e.groupSlug,channelSlug:e.channelSlug,channelId:e.channelId}});0===e?n7(a):n7(e=>[...e,...e9(e,a)]),ie(e),ia(a.length>=20)}catch(t){console.error("Failed to load following feed:",t),0===e&&n7([]),ia(!1)}finally{il(!1)}};(0,l.useEffect)(()=>{"groups-list"===t$&&"following"===n1&&0===n8.length&&i4(0),te&&"groups-list"===t$&&"private_albums"===n1&&0===n5.length&&i3()},[te,t$,n1]);let i3=async()=>{n6(!0);try{let e=await iK("/api/private-albums");n4(e)}catch(e){console.error("Failed to load private albums:",e)}finally{n6(!1)}},i6=async()=>{if(io)return;let e=document.getElementById("album-file-upload"),t=document.getElementById("album-upload-text"),a=Array.from((null==e?void 0:e.files)||[]),s=(null==t?void 0:t.value)||"";if(s||0!==a.length){ic(!0);try{let l=await Promise.all(a.map(e=>b(e))),r=await fetch("/api/private-albums",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:s,files:l}),credentials:"include"});if(!r.ok)throw Error("Upload failed");e&&(e.value=""),t&&(t.value="");let n=document.getElementById("album-file-count");n&&(n.innerText=""),i3()}catch(e){console.error("Failed to create album:",e),alert("Failed: ".concat(e.message))}finally{ic(!1)}}},i8=async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{var a;let s=te?iK:iq,l=te?iK:iq,r=await s("/api/users/".concat(e));al(r.user),t||(sB(0),an([]),ay(!1));let n=await l("/api/users/".concat(e,"/feed?offset=0&limit=20"));an(n.feed||[]),sK(((null===(a=n.feed)||void 0===a?void 0:a.length)||0)>0)}catch(e){console.error("Failed to load profile:",e),alert("".concat(ew("profile.failedLoadProfile"),": ").concat(e.message)),tQ("groups-list"),ek.push("/",void 0,{shallow:!0})}},i7=async()=>{if(!sq&&sW){sH(!0);try{var e;let t=sz+1,a=te?iK:iq,s=await a("/api/users/".concat(at,"/feed?offset=").concat(20*t,"&limit=20"));an(e=>[...e,...e9(e,s.feed||[])]),sB(t),sK(((null===(e=s.feed)||void 0===e?void 0:e.length)||0)>0)}catch(e){console.error("Failed to load more feed:",e)}finally{sH(!1)}}},i9=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(r8&&r3&&(!(e>0)||!r5&&r1)){r4(!0);try{var t;let a=te?iK:iq,s=await a("/api/users/".concat(r8,"/").concat(r3,"?offset=").concat(20*e,"&limit=20"));0===e?rQ(s.users||[]):rQ(e=>[...e,...s.users||[]]),r0(e),r2(((null===(t=s.users)||void 0===t?void 0:t.length)||0)>0)}catch(e){console.error("Failed to load ".concat(r3,":"),e)}finally{r4(!1)}}},oe=e=>{aa(e),tQ("profile"),t6(null),t7(null),window.history.pushState(null,"","/".concat(e))},ot=e=>{t2(e),sy(null),tQ("board"),t6(null),t7(null),window.history.pushState(null,"","/".concat(e))},oa=e=>{t4(e),sD([]),sM(0),sR(!0),tQ("dm"),window.history.pushState(null,"","/c/".concat(e))},os=e=>{t6(e),t7(null),tQ("single-post"),window.history.pushState(null,"","/".concat(e)),i1(e)},ol=e=>{if(!e)return;(e.keylog||e.token)&&(0,eZ.uB)(e.keylog||e.token);let t=e.user||e;tr(t),(e.e2eeSecret||e.authEntropy)&&ey(e.e2eeSecret,e.authEntropy,null==t?void 0:t.id),(null==t?void 0:t.followingCount)!==void 0&&td(t.followingCount),tw(e.accounts||[t]),e.isReactivated&&alert(ew("auth.accountReactivated"));let a=((null==t?void 0:t.source)||0)>0,s=(null==t?void 0:t.approved)===0;e.isNewUser||!(null==t?void 0:t.name)||a&&s?(ts("onboarding"),tH(""),tV((null==t?void 0:t.email)||""),tY((null==t?void 0:t.slug)||"")):(tt(!0),ts("complete"),n2("following"),"dm"!==t$&&"single-post"!==t$&&"profile"!==t$&&"board"!==t$&&tQ("groups-list"),i4(0),iK("/api/auth/me").then(e=>{var t;(null==e?void 0:null===(t=e.user)||void 0===t?void 0:t.followingCount)!==void 0&&td(e.user.followingCount),(null==e?void 0:e.accounts)&&tw(e.accounts)}).catch(()=>{}))},or=async()=>{try{let e="";e=window.crypto&&window.crypto.randomUUID?window.crypto.randomUUID():Math.random().toString(36).substring(2)+Date.now().toString(36);let t=new TextEncoder().encode(e),a=await window.crypto.subtle.digest("SHA-256",t),s=Array.from(new Uint8Array(a)),l=s.map(e=>e.toString(16).padStart(2,"0")).join("");return{secret:e,challenge:l}}catch(e){return console.warn("WebCrypto SHA-256 unavailable, skipping client challenge:",e),{secret:null,challenge:null}}},on=(e,t,a)=>{tK(),tW.current=setInterval(async()=>{try{let s="/api/auth/ovrtxt-status?sessionId=".concat(encodeURIComponent(e),"&phone=").concat(encodeURIComponent(t)).concat(a?"&clientSecret=".concat(encodeURIComponent(a)):""),l=await iK(s);l&&"approved"===l.status&&(l.user||l.keylog)?(tK(),ol(l)):l&&("expired"===l.status||"denied"===l.status)&&(tK(),tF("expired"===l.status?"Verification expired. Please try again.":"Verification de
1nied."),ts("phone"),tP(null))}catch(e){console.error("Ovrtxt polling error:",e)}},2e3)},oi=async()=>{if(tF(""),!(null==tZ?void 0:tZ.phone)){tK(),tP(null),tB(!0),ts("phone");return}tD("otp"),tR(!0);try{let e=null==tZ?void 0:tZ.sessionId;e&&await iK("/api/auth/ovrtxt-send-sms",{method:"POST",body:JSON.stringify({sessionId:e})}).catch(async()=>fetch("https://api.ovrtxt.com/v1/verify/".concat(encodeURIComponent(e),"/send-sms"),{method:"POST"}).then(e=>e.json()).catch(()=>({})))}catch(e){console.warn("Error sending SMS code:",e)}finally{tR(!1)}},oo=async()=>{tF("");let e=t_.trim();if(e.length<6){tF(ew("auth.sixDigitRequired")||"Please enter the 6-digit code");return}let t=null==tZ?void 0:tZ.sessionId,a=("tr"===eN?"90":"1")+iP(tN),s=null==tZ?void 0:tZ.clientSecret;tL(!0);try{let l=await iK("/api/auth/ovrtxt-verify-code",{method:"POST",body:JSON.stringify({sessionId:t,code:e,phone:a,clientSecret:s})}).catch(async l=>{var r;let n=await fetch("https://api.ovrtxt.com/v1/verify/".concat(encodeURIComponent(t),"/check"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e})}),i=await n.json();if("approved"===i.status)return iK("/api/auth/ovrtxt-status?sessionId=".concat(encodeURIComponent(t),"&phone=").concat(encodeURIComponent(a)).concat(s?"&clientSecret=".concat(encodeURIComponent(s)):""));throw Error((null===(r=i.error)||void 0===r?void 0:r.message)||l.message||"Incorrect code. Please try again.")});l&&("approved"===l.status||l.user||l.keylog)?(tK(),ol(l)):tF((null==l?void 0:l.error)||"Incorrect code. Please try again.")}catch(e){tF(e.message||"Incorrect code. Please try again.")}finally{tL(!1)}},oc=async()=>{if("tr"===eN){ts("phone");return}tF(""),tI(!0),tK();try{let e=await or(),t=e.challenge,a=e.secret,s=await iK("/api/auth/send-otp",{method:"POST",body:JSON.stringify({clientChallenge:t,locale:eN||"en"})});if(s&&(s.ovrtxt||s.sessionId)&&s.sessionId){let e=ew("auth.tapSendToLogin")||e8[eN]||e8.en,t=e7(s.fallbackUri,e);tP({sessionId:s.sessionId,channel:s.channel,fallbackUri:t,clientSecret:a}),ts("ovrtxt"),on(s.sessionId,"",a),t&&(window.location.href=t)}else s&&s.ovrtxtFailed?ts("phone"):tF((null==s?void 0:s.error)||ew("profile.failedSendCode"))}catch(e){tF(e.message||ew("profile.failedSendCode"))}finally{tI(!1)}},od=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(tF(""),!iT(tN)){tF(ew("auth.invalidPhone"));return}let t=("tr"===eN?"90":"1")+iP(tN);tI(!0);let a=!0===e||!0===tz;tB(!1),tK();try{let e=null,s=null,l="en"===eN||"es"===eN;if(l){let t=await or();e=t.challenge,s=t.secret}let r=await iK("/api/auth/send-otp",{method:"POST",body:JSON.stringify({phone:t,clientChallenge:e,locale:eN})});if(l&&r&&(r.ovrtxt||r.sessionId)&&r.sessionId){let e=ew("auth.tapSendToLogin")||e8[eN]||e8.en,l=e7(r.fallbackUri,e);tP({sessionId:r.sessionId,channel:r.channel,fallbackUri:l,clientSecret:s,phone:t}),ts("ovrtxt"),on(r.sessionId,t,s),a?(tD("otp"),tR(!0),iK("/api/auth/ovrtxt-send-sms",{method:"POST",body:JSON.stringify({sessionId:r.sessionId})}).catch(async()=>fetch("https://api.ovrtxt.com/v1/verify/".concat(encodeURIComponent(r.sessionId),"/send-sms"),{method:"POST"}).then(e=>e.json()).catch(()=>({}))).finally(()=>{tR(!1)})):tD("messages")}else tP(null),ts("otp")}catch(e){tF(e.message||ew("profile.failedSendCode"))}finally{tI(!1)}},ou=async()=>{if(tF(""),!iT(tN)||!tS){tF(ew("auth.phoneRequired"));return}let e=("tr"===eN?"90":"1")+iP(tN);tI(!0);try{let t=await iK("/api/auth/verify-otp",{method:"POST",body:JSON.stringify({phone:e,otp:tS})});ol(t)}catch(e){tF(e.message||ew("auth.invalidCode"))}finally{tI(!1)}},om=async()=>{var e;if(tF(""),!tq.trim()||!i_(tJ)||!iM(tG)){tF(ew("auth.validNameEmailUsername"));return}if((null==nT?void 0:nT.status)==="invalid"){tF(ew("auth.usernameRequirements"));return}if((null==nT?void 0:nT.status)==="checking"){tF(ew("auth.waitWhileChecking"));return}if((null==nT?void 0:nT.status)==="taken"){tF(ew("auth.chooseAvailableUsername"));return}let t=(null==nT?void 0:nT.status)==="available",a=null==nT?void 0:nT.message;if(!t)try{let e=await iO(tG,null==tl?void 0:tl.slug);t=e.available,a=e.reason||e.message||"".concat(tG," is already taken")}catch(e){tF(e.message||ew("auth.verifyError"));return}if(!t){tF(a||ew("auth.chooseAvailableUsername"));return}tI(!0);try{let t=await iK("/api/auth/update-profile",{method:"POST",body:JSON.stringify({name:tq.trim(),email:tJ.trim(),username:tG})});(t.keylog||t.token)&&(0,eZ.uB)(t.keylog||t.token),tr(t.user),(null===(e=t.user)||void 0===e?void 0:e.followingCount)!==void 0&&td(t.user.followingCount),tw(t.accounts||[t.user]),tt(!0),ts("complete"),n2("following"),"dm"!==t$&&"single-post"!==t$&&"profile"!==t$&&"board"!==t$&&tQ("groups-list"),i4(0)}catch(e){tF(e.message||ew("auth.failedUpdateProfile"))}finally{tI(!1)}},op=()=>{ly(""),lw(""),lk("phone"),lI(""),lC(!1),nL(""),nB(""),nK(""),nH(null),nR(!1)},ox=()=>{op(),lb(!1)},oh=()=>
1{if(tj.length>=to){lg(!1),op(),lk("limit-reached"),lb(!0);return}lg(!1),op(),lk("profile"),lb(!0)},og=async()=>{if(lI(""),!iT(lv)){lI(ew("auth.invalidPhone"));return}let e=("tr"===eN?"90":"1")+iP(lv);lC(!0);try{await iK("/api/auth/send-otp",{method:"POST",body:JSON.stringify({phone:e,preferCode:!0})}),lk("otp")}catch(e){lI(e.message||ew("profile.failedSendCode"))}finally{lC(!1)}},of=async()=>{if(lI(""),!iT(lv)||!lj){lI(ew("auth.phoneRequired"));return}let e=("tr"===eN?"90":"1")+iP(lv);lC(!0);try{var t;let a=await iK("/api/auth/create-account-verify",{method:"POST",body:JSON.stringify({phone:e,otp:lj})});tr(a.user),(null===(t=a.user)||void 0===t?void 0:t.followingCount)!==void 0&&td(a.user.followingCount),tw(a.accounts),a.isNewUser||!a.user.name?(lk("profile"),nL(""),nB(""),nK(""),nH(null),nR(!0)):(ox(),alert(ew("auth.newAccountCreated")))}catch(e){lI(e.message||ew("auth.invalidCode"))}finally{lC(!1)}},ob=async()=>{if(lI(""),!nO.trim()||!i_(nz)||!iM(nW)){lI(ew("auth.validNameEmailUsername"));return}if((null==nq?void 0:nq.status)==="invalid"){lI(ew("auth.usernameRequirements"));return}if((null==nq?void 0:nq.status)==="checking"){lI(ew("auth.waitWhileChecking"));return}if((null==nq?void 0:nq.status)==="taken"){lI(ew("auth.chooseAvailableUsername"));return}let e=(null==nq?void 0:nq.status)==="available",t=null==nq?void 0:nq.message;if(!e)try{let a=await iO(nW);e=a.available,t=a.reason||a.message||"".concat(nW," is already taken")}catch(e){lI(e.message||ew("auth.verifyError"));return}if(!e){lI(t||ew("auth.chooseAvailableUsername"));return}lC(!0);try{let e=await iK("/api/auth/add-account-direct",{method:"POST",body:JSON.stringify({name:nO.trim(),email:nz.trim(),username:nW})});tr(e.user),tw(e.accounts),ox(),window.location.reload()}catch(e){lI(e.message||ew("auth.failedUpdateProfile"))}finally{lC(!1)}},ov=async e=>{try{let a=await iK("/api/auth/switch-account",{method:"POST",body:JSON.stringify({slug:e})});if((a.keylog||a.token)&&(0,eZ.uB)(a.keylog||a.token),a.e2eeSecret){var t;ey(a.e2eeSecret,null,null===(t=a.user)||void 0===t?void 0:t.id)}tr(a.user),lg(!1),window.location.reload()}catch(e){alert("".concat(ew("auth.failedSwitchAccount"),": ").concat(e.message))}},oy=()=>{ro(tl.name),rd(tl.email||""),rm(tl.slug||""),rx(tl.bio||""),rg(tl.city||""),rb(tl.country||""),ry(tl.country_full||""),rw(tl.lat||null),rk(tl.lng||null),rC(null),rI(null),nM({status:"available",message:"This is your current username."}),nR(!1),rn(!0)},oj=async()=>{var e;if(!ri.trim()||!i_(rc)||!iM(ru)){alert(ew("auth.validNameEmailUsername"));return}if((null==n_?void 0:n_.status)==="invalid"){alert(ew("auth.usernameRequirements"));return}if((null==n_?void 0:n_.status)==="checking"){alert(ew("auth.waitWhileChecking"));return}if((null==n_?void 0:n_.status)==="taken"){alert(ew("auth.chooseAvailableUsername"));return}let t=!n_||"available"===n_.status,a=null==n_?void 0:n_.message;if(!t)try{let e=await iO(ru,null==tl?void 0:tl.slug);t=e.available,a=e.reason||e.message||ew("auth.isTaken",{username:ru})}catch(e){alert(e.message||ew("auth.verifyError"));return}if(!t){alert(a||ew("auth.chooseAvailableUsername"));return}rF(!0);try{let t=null,a=null;rS&&(t=await b(rS)),rE&&(a=await b(rE));let s=await fetch("/api/users/".concat(tl.slug),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ri.trim(),email:rc.trim(),username:ru,bio:rp,city:rh?rh.trim():null,country:rf||null,country_full:rv||null,lat:rj||null,lng:rN||null,avatar:t?t.url:void 0,avatar_cached_urls:t?t.cac
1hed_urls:void 0,cover:a?a.url:void 0,cover_cached_urls:a?a.cached_urls:void 0}),credentials:"include"});if(!s.ok)throw Error(ew("auth.failedUpdateProfile"));let l=await s.json();tr(l.user),rn(!1),nR(!1),alert(ew("auth.profileUpdated")),"profile"===t$&&(null==at?void 0:at.toLowerCase())===(null==tl?void 0:null===(e=tl.slug)||void 0===e?void 0:e.toLowerCase())&&i8(tl.slug)}catch(e){alert("".concat(ew("auth.failedUpdateProfile"),": ").concat(e.message))}finally{rF(!1)}},ow=async()=>{if(!rZ.trim()){alert(ew("groups.groupNameRequired"));return}rR(!0);try{let e=null;r_&&(e=await b(r_));let t=await fetch("/api/groups/".concat(t1),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:rZ,description:rT,logo:e?e.url:void 0,logo_cached_urls:e?e.cached_urls:void 0}),credentials:"include"});if(!t.ok)throw Error("Failed to update group");let a=await t.json();sg(a.group),lF(!1),alert(ew("groups.groupUpdated"))}catch(e){alert("".concat(ew("groups.failedUpdateGroup"),": ").concat(e.message))}finally{rR(!1)}},oN=async e=>{if(confirm(ew("messages.deletePostConfirm")))try{if(await iK("/api/messages/".concat(e),{method:"DELETE"}),au&&au.dbId){let e=te?iK:iq,t=await e("/api/events/".concat(au.dbId,"/messages"));ax(t.messages||[])}"board"===t$?await iQ(sv,0):"profile"===t$?await i8(at):"groups-list"===t$?await i4(0):"tag"===t$&&a$?await i2(a$,0):"search"===t$&&ss?await i5(ss,0):"single-post"!==t$||au||ek.push("/")}catch(e){alert("".concat(ew("messages.failedDeletePost"),": ").concat(e.message))}},ok=async e=>{if(l8.trim())try{await iK("/api/messages/".concat(e),{method:"PUT",body:JSON.stringify({content:l8})});let t=t=>t.map(t=>({...t,replies:t.replies?t.replies.map(t=>t.slug===e?{...t,content:l8}:t):[]}));sj[sv]&&sw(e=>({...e,[sv]:t(e[sv])})),ar&&an(t(ar)),n8&&n7(t(n8)),aX&&a0(t(aX)),sr&&sn(t(sr)),t8&&t8.replies&&t7(t=>({...t,replies:t.replies.map(t=>t.slug===e?{...t,content:l8}:t)})),nh&&Object.keys(nh).length>0&&ng(e=>{let a={...e};return Object.keys(a).forEach(e=>{a[e]&&(a[e]=t([a[e]])[0])}),a}),ap&&ax(t(ap)),rG&&rY(t(rG)),l6(null),l7("")}catch(e){alert("Failed to edit comment: ".concat(e.message))}},oS=async e=>{if(confirm("Are you sure you want to delete this comment?"))try{await iK("/api/messages/".concat(e),{method:"DELETE"});let t=t=>t.map(t=>{var a;return{...t,replyCount:(null===(a=t.replies)||void 0===a?void 0:a.some(t=>t.slug===e))?Math.max(0,(t.replyCount||1)-1):t.replyCount,replies:t.replies?t.replies.filter(t=>t.slug!==e):[]}});sj[sv]&&sw(e=>({...e,[sv]:t(e[sv])})),ar&&an(t(ar)),n8&&n7(t(n8)),aX&&a0(t(aX)),sr&&sn(t(sr)),t8&&t8.replies&&t7(t=>({...t,replyCount:t.replies.some(t=>t.slug===e)?Math.max(0,(t.replyCount||1)-1):t.replyCount,replies:t.replies.filter(t=>t.slug!==e)})),nh&&Object.keys(nh).length>0&&ng(e=>{let a={...e};return Object.keys(a).forEach(e=>{a[e]&&(a[e]=t([a[e]])[0])}),a}),ap&&ax(t(ap)),rG&&rY(t(rG))}catch(e){alert("Failed to delete comment: ".concat(e.message))}},oC=async e=>{if(confirm(ew("groups.removeMemberConfirm")))try{await iK("/api/groups/".concat(t1,"/members/").concat(e),{method:"DELETE"}),await iV(t1),alert(ew("groups.memberRemoved"))}catch(e){alert("".concat(ew("groups.failedRemoveMember"),": ").concat(e.message))}},oE=async e=>{if(!te||"complete"!==ta){ek.push("/");return}try{let t=await iK("/api/users/".concat(e,"/follow"),{method:"POST"});al(e=>e?{...e,isFollowing:t.following,followerCount:t.following?(e.followerCount||0)+1:Math.max(0,(e.followerCount||0)-1)}:e),td(e=>t.following?e+1:Math.max(0,e-1))}catch(e){console.error("Failed to toggle follow:",e)}},oI=async e=>{if("Enter"===e.key){if(e.preventDefault(),!tu.trim())return;let t=tu.split("\n").map(e=>e.trim()).filter(e=>e);if(0!==t.length){tb(!0);try{let e=await iK("/api/users/invite",{method:"POST",body:JSON.stringify({invites:t,source:1})});e.success&&(tx(t=>[...t,...e.invites]),td(t=>t+e.invites.length),tm(""))}catch(e){console.error("Failed to invite:",e)}finally{tb(!1)}}}},oA=async()=>{if(!tu.trim())return;let e=tu.split("\n").map(e=>e.trim()).filter(e=>e);if(0!==e.length){tb(!0);try{let t=await iK("/api/users/invite",{method:"POST",body:JSON.stringify({invites:e,source:2})});t.success&&(tx(e=>[...e,...t.invites]),td(e=>e+t.invites.length),tm(""),ty(!1))}catch(e){console.error("Failed to invite:",e)}finally{tb(!1)}}},oF=async()=>
1{if(!lz.trim()){alert(ew("profile.enterReason"));return}try{await iK("/api/users/".concat(lW,"/report"),{method:"POST",body:JSON.stringify({reason:lz})}),lq&&(await iK("/api/users/".concat(lW,"/block"),{method:"POST"}),n7(e=>e.filter(e=>e.userSlug!==lW)),an(e=>e.filter(e=>e.userSlug!==lW)),sw(e=>{let t={...e};for(let e in t)t[e]=t[e].filter(e=>e.userSlug!==lW);return t}),a0(e=>e.filter(e=>e.userSlug!==lW)),sn(e=>e.filter(e=>e.userSlug!==lW))),alert(ew("profile.reportSubmitted")),lm(!1),lB(""),lK(null),lH(!1)}catch(e){alert("".concat(ew("profile.failedSubmitReport"),": ").concat(e.message))}},oZ=async()=>{let e=window.prompt("Enter a post URL (e.g., https://www.instagram.com/p/abc/):");if(e){if(!e.includes("instagram.com/p/")){alert("Only IG post links (/p/) are supported at this time.");return}try{sH(!0);let t=await iK("/api/users/".concat(as.slug,"/import-ig-extract"),{method:"POST",body:JSON.stringify({url:e})}),a=await Promise.all(t.mediaItems.map(async(e,t)=>{let a="image"===e.attachmentType?"https://images.weserv.nl/?url=".concat(encodeURIComponent(e.mediaUrl)):e.mediaUrl,s=await fetch(a);if(!s.ok)throw Error("Failed to download media item ".concat(t+1," via proxy (HTTP ").concat(s.status,")"));let l=await s.blob(),r="video"===e.attachmentType?"mp4":"jpg",n=new File([l],"ig-import-".concat(t,".").concat(r),{type:l.type});return b(n)}));await iK("/api/users/".concat(as.slug,"/import-ig-save"),{method:"POST",body:JSON.stringify({description:t.description,media:a,postTimestamp:t.postTimestamp})}),await i8(as.slug,!0),sH(!1)}catch(e){alert("Failed to import post: "+e.message),sH(!1)}}},oP=async()=>{let e=window.prompt("Enter Partiful Event URL (e.g., https://partiful.com/e/abc):");if(e){if(!e.includes("partiful.com/e/")){alert("Only partiful event links are supported at this time.");return}try{ab(!0),await iK("/api/users/".concat(as.slug,"/events"),{method:"POST",body:JSON.stringify({url:e})}),ay(!1),ab(!1)}catch(e){alert("Failed to import event: "+e.message),ab(!1)}}},oT=async(e,t)=>{if(e.preventDefault(),window.confirm("Are you sure you want to delete this event?"))try{await iK("/api/events/".concat(t),{method:"DELETE"}),ad(e=>e.filter(e=>e.id!==t))}catch(e){alert("Failed to delete event: "+e.message)}},oD=async e=>{lR(e);let t="deactivate"===e?"deactivate-request":"delete-request";try{await iK("/api/users/".concat(tl.slug,"/").concat(t),{method:"POST"}),alert(ew("profile.verificationCodeSent")),lD(""),lx(!0)}catch(e){alert("".concat(ew("profile.failedSendCode"),": ").concat(e.message))}},o_=async()=>{if(!lT||6!==lT.length){alert(ew("profile.enter6DigitCode"));return}lM(!0);try{"deactivate"===lU?(await iK("/api/users/".concat(tl.slug,"/deactivate"),{method:"POST",body:JSON.stringify({otp:lT})}),alert(ew("profile.accountDeactivated"))):(await iK("/api/users/".concat(tl.slug,"/delete-confirm"),{method:"POST",body:JSON.stringify({otp:lT})}),alert(ew("profile.accountDeleted"))),lx(!1),lD(""),lR("deactivate"),o2()}catch(e){alert("".concat("deactivate"===lU?ew("profile.failedDeactivate"):ew("profile.failedDeleteAccount"),": ").concat(e.message))}finally{lM(!1)}},oM=async()=>{if(!nX&&te){n0(!0);try{let e=await iK("/api/notifications?limit=50");nY(e.notifications||[])}catch(e){console.error("Failed to load notifications:",e)}finally{n0(!1)}}},oU=async()=>{if(te)try{let e=await iK("/api/notifications/unread-count");nQ(e.count||0)}catch(e){console.error("Failed to load unread count:",e)}},oR=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all";try{await iK("/api/notifications/mark-read",{method:"POST",body:JSON.stringify({notificationIds:e})}),"all"===e?(nY(e=>e.map(e=>({...e,isRead:!0}))),nQ(0)):(nY(t=>t.map(t=>e.includes(t.id)?{...t,isRead:!0}:t)),nQ(t=>Math.max(0,t-(Array.isArray(e)?e.length:0))))}catch(e){console.error("Failed to mark notifications as read:",e)}},oO=e=>{var t,a;if(!e)return;e.isRead||oR([e.id]).catch(e=>console.error("Failed to mark as read:",e)),nV(!1);let s=(null===(t=e.message)||void 0===t?void 0:t.slug)||e.messageSlug||e.message_slug||e.targetSlug||e.slug,l=(null===(a=e.actor)||void 0===a?void 0:a.slug)||e.actorSlug;s?os(s):l&&oe(l)},oL=async()=>
1{if(!lX.trim()){alert(ew("groups.enterContactInfo"));return}try{await iK("/api/groups/".concat(t1,"/invite"),{method:"POST",body:JSON.stringify({method:l1,contact:lX})}),alert(ew("groups.inviteSent",{contact:lX,method:l1})),l0(""),lo(!1)}catch(e){alert("".concat(ew("groups.failedSendInvite"),": ").concat(e.message))}},oz=async()=>{if(!rz.trim()){rK({users:[],groups:[],messages:[]});return}rH(!0);try{let e=await iK("/api/search?q=".concat(encodeURIComponent(rz)));rK(e.results||{users:[],groups:[],messages:[]})}catch(e){console.error("Search failed:",e),rK({users:[],groups:[],messages:[]})}finally{rH(!1)}},oB=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:nE,t=e.trim();nP(!0);try{let e=t?"/users/search?q=".concat(encodeURIComponent(t)):"/users/search",a=await iK(e);nF(a.users||[])}catch(e){console.error("DM search failed:",e),nF([])}finally{nP(!1)}};(0,l.useEffect)(()=>{if(!lZ)return;let e=setTimeout(()=>{oB(nE)},300);return()=>clearTimeout(e)},[nE,lZ]),(0,l.useEffect)(()=>{lZ?oB(""):(nI(""),nF([]))},[lZ]),(0,l.useEffect)(()=>{l5&&(sY(""),s2(""))},[l5]);let oW=async e=>{if(!te||"complete"!==ta){ek.push("/");return}try{let t=await iK("/api/conversations",{method:"POST",body:JSON.stringify({participantSlug:e})});lP(!1),nI(""),nF([]),oa(t.conversation.slug)}catch(e){alert("".concat(ew("dm.failedStartConversation"),": ").concat(e.message))}},oK=(0,l.useCallback)(async e=>{let{content:t,media:a,replyToSlug:s}=e;l4(null);try{await iK("/api/messages",{method:"POST",body:JSON.stringify({content:t,media:a,channelSlug:"board"===t$?sv:void 0,replyToSlug:s})}),"board"===t$?(sC(e=>({...e,[sv]:0})),sI(e=>({...e,[sv]:!0})),await iQ(sv,0)):"profile"===t$?await i8(at,!0):"single-post"===t$?await i1(t3):"groups-list"===t$?await i4(0):"tag"===t$&&a$&&await i2(a$,0),nd(!1);try{let e=await iq("/api/messages/".concat(s,"?noRedirect=true"));ng(t=>({...t,[s]:e}))}catch(e){}if(au&&au.dbId){let e=te?iK:iq,t=await e("/api/events/".concat(au.dbId,"/messages"));ax(t.messages||[])}}catch(e){console.error("Failed to send reply:",e),alert("".concat(ew("messages.failedSendReply"),": ").concat(e.message))}},[t$,sv,iK,iq,iQ,i8,at,au,te]),oq=(0,l.useCallback)(async e=>{let{content:t,title:a,media:s}=e;try{await iK("/api/messages",{method:"POST",body:JSON.stringify({content:t,title:a,media:s,channelSlug:sv})}),sC(e=>({...e,[sv]:0})),sI(e=>({...e,[sv]:!0})),await iQ(sv,0)}catch(e){console.error("Failed to send message:",e),alert("".concat(ew("messages.failedSendMessage"),": ").concat(e.message))}},[sv,iK,iQ]),oH=(0,l.useCallback)(async e=>{if(!au||!au.dbId)return;let{content:t,title:a,media:s}=e;try{await iK("/api/messages",{method:"POST",body:JSON.stringify({content:t,title:a,media:s,eventId:au.dbId})}),ag(!0);let e=te?iK:iq,l=await e("/api/events/".concat(au.dbId,"/messages"));ax(l.messages||[]),ag(!1)}catch(e){console.error("Failed to send post:",e),ag(!1),alert("".concat(ew("messages.failedSendPost"),": ").concat(e.message))}},[iK,au,te]),oJ=(0,l.useCallback)(async()=>{if(null==au?void 0:au.id){aV(!0);try{await iK("/api/events/".concat(au.id),{method:"DELETE"}),ad(e=>e.filter(e=>e.id!==au.id)),aw(e=>e.filter(e=>e.id!==au.id)),am(null),aY(!1),aI(!1)}catch(e){console.error("Delete event error",e)}finally{aV(!1)}}},[iK,au]),oV=(0,l.useCallback)(async()=>{if(null==au?void 0:au.id){aK(!0),aH("");try{let e=aU;if(aO){let t=(aO.name.split(".").pop()||"jpg").toLowerCase(),a=aO.type||"image/jpeg",s=await iK("/api/upload-url",{method:"POST",body:JSON.stringify({ext:t,contentType:a})});if(!(null==s?void 0:s.uploadUrl))throw Error("Failed to get upload URL");await fetch(s.uploadUrl,{method:"PUT",headers:{"Content-Type":a},body:aO}),e=s.publicUrl}let t={title:aA,description:aZ,place:aT,date:a_};e&&e!==au.photo&&(t.imageUrl=e),await iK("/api/events/".concat(au.id),{method:"PUT",body:JSON.stringify(t)});let a=e||au.photo,s={...au,title:aA,description:aZ,place:aT,date:a_,photo:a};am(s),ad(e=>e.map(e=>e.id===s.id?{...e,...s}:e)),aw(e=>e.map(e=>e.id===s.id?{...e,...s}:e)),aI(!1),aL(null),aB("")}catch(e){aH(e.message||"Failed to save")}finally{aK(!1)}}},[iK,au,aA,aZ,aT,a_,aU,aO]),oG=(0,l.useCallback)(async e=>{let{content:t,title:a,media:s}=e;try{await iK("/api/messages",{method:"POST",body:JSON.stringify({content:t,title:a,media:s})}),await i8(at)}catch(e){console.error("Failed to send post:",e),alert("".concat(ew("messages.failedSendPost"),": ").concat(e.message))}},[iK,i8,at]),oY=(0,l.useCallback)(async e=>{let{content:t,title:a,media:s}=e;try{await iK("/api/messages",{method:"POST",body:JSON.stringify({content:t,title:a,media:s})}),ie(0),ia(!0),await i4(0)}catch(e){console.error("Failed to send post:",e),alert("".concat(ew("messages.failedSendPost"),": ").concat(e.message))}},[iK]),o$=(0,l.useCallback)(async e=>{let{content:t,media:a}=e;if(!t5){alert("No active conversation");return}try{var s,l,r,n;let e=t||"",i=null,o=sZ.find(e=>e.slug===t5);if(null==o?void 0:null===(s=o.otherUser)||void 0===s?void 0:s.publicKey)i=o.otherUser.publicKey;else if((null==o?void 0:null===(l=o.otherUser)||void 0===l?void 0:l.slug)||(null==o?void 0:null===(r=o.otherUser)||void 0===r?void 0:r.id))try{let e=await iK("/api/e2ee/keys/".concat(o.otherUser.slug||o.otherUser.id));(null==e?void 0:e.publicKey)&&(i=e.publicKey,sP(t=>t.map(t=>t.slug===t5?{...t,otherUser:{...t.otherUser,publicKey:e.publicKey}}:t)))}catch(e){console.warn("[E2EE] Recipient key lookup error:",e)}if(e&&i)try{let t=await iK("/api/e2ee/my-key").catch(()=>null),a=(null==t?void 0:t.publicKey)||(null===(n=await eC(null==tl?void 0:tl.id))||void 0===n?void 0:n.publicKey);e=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e)return e;if(!t)return console.warn("[E2EE] Missing recipient public key, cannot encrypt"),e;try{let s=ec(t),l=el().box.keyPair(),r=el().randomBytes(el().box.nonceLength),n=eu(e),i=el().box(n,r,s,l.secretKey),o={e2ee:!0,v:1,ephem:eo(l.publicKey),nonce:eo(r),box:eo(i)};if(a)try{let e=ec(a),t=el().randomBytes(el().box.nonceLength),s=el().box(n,t,e,l.secretKey);o.sNonce=eo(t),o.sBox=eo(s)}catch(e){console.warn("[E2EE] Dual encryption for sender copy error:",e)}let c=JSON.stringify(o);return!function(e,t){if(e&&t)try{let a=ej(),s=Object.keys(a);s.length>300&&delete a[s[0]],a[e]=t;try{let s="string"==typeof e?JSON.parse(e):e;(null==s?void 0:s.box)&&(a[s.box]=t)}catch(e){}ev.setItem(eg,JSON.stringify(a))}catch(e){console.warn("[E2EE] Cache sent message error:",e)}}(c,e),c}catch(t){return console.error("[E2EE] Encryption error:",t),e}}(e,i,a)}catch(e){console.warn("[E2EE] Encryption failed, fallback to plain text:",e)}await iK("/api/conversations/send",{method:"POST",body:JSON.stringify({content:e,media:a,conversationSlug:t5})}),sM(0),sD([]),sR(!0),await i$(0)}catch(e){console.error("Failed to send DM:",e),alert("".concat(ew("dm.failedSendDM"),": ").concat(e.message))}},[t5,sZ,iK,i$,ew]),oQ=async e=>{if(!te||"complete"!==ta){ek.push("/");return}let t=t=>{if(!t)return t;if(t.slug===e){let e=!t.likedByMe;return{...t,likedByMe:e,likes:e?(t.likes||0)+1:Math.max(0,(t.likes||0)-1)}}return t.replies?{...t,replies:t.replies.map(t=>{if(t.slug===e){let e=!t.likedByMe;return{...t,likedByMe:e,likes:e?(t.likes||0)+1:Math.max(0,(t.likes||0)-1)}}return t})}:t};n7(e=>e.map(t)),a0(e=>e.map(t)),sn(e=>e.map(t)),ax(e=>e.map(t)),sw(e=>sv&&e[sv]?{...e,[sv]:e[sv].map(t)}:e),al(e=>e&&e.posts?{...e,posts:e.posts.map(t)}:e),t7(e=>e?t(e):e),ng(a=>{if(!a[e]&&!Object.values(a).some(t=>{var a;return null===(a=t.replies)||void 0===a?void 0:a.some(t=>t.slug===e)}))return a;let s={...a};
1return Object.keys(s).forEach(e=>{s[e]=t(s[e])}),s});try{await iK("/api/messages/".concat(e,"/like"),{method:"POST"})}catch(a){console.error("Failed to toggle like:",a),n7(e=>e.map(t)),a0(e=>e.map(t)),sn(e=>e.map(t)),sw(e=>sv&&e[sv]?{...e,[sv]:e[sv].map(t)}:e),al(e=>e&&e.posts?{...e,posts:e.posts.map(t)}:e),t7(e=>e?t(e):e),ng(a=>{if(!a[e]&&!Object.values(a).some(t=>{var a;return null===(a=t.replies)||void 0===a?void 0:a.some(t=>t.slug===e)}))return a;let s={...a};return Object.keys(s).forEach(e=>{s[e]=t(s[e])}),s})}},oX=e=>{lV(e),ld(!0)},o0=()=>{let e=window.location.origin,t="".concat(e,"/").concat(lJ);navigator.clipboard.writeText(t).then(()=>{alert(ew("messages.linkCopied")),ld(!1)}).catch(()=>{alert(ew("messages.failedCopyLink"))})},o1=async()=>{if(lG.trim())try{let e=await iK("/api/channels",{method:"POST",body:JSON.stringify({name:lG.toLowerCase().replace(/\s+/g,"-"),groupSlug:t1,isPrivate:l$})});sb(t=>[...t,{id:e.id,slug:e.slug,name:e.name,is_private:e.isPrivate}]),sw(t=>({...t,[e.slug]:[]})),lY(""),lQ(!1),ll(!1),sy(e.slug)}catch(e){console.error("Failed to create channel:",e),alert("".concat(ew("channels.failedCreateChannel"),": ").concat(e.message))}},o2=async()=>{try{await iK("/api/auth/logout",{method:"POST"}),(0,eZ.Rn)(),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=e?"_".concat(e):"",a=["".concat(em).concat(t),"".concat(ep).concat(t),"".concat(eh).concat(t),"".concat(eh,"_env_").concat(e||"default"),"".concat(ef).concat(t),"".concat(ex).concat(t)];e&&a.push(em,ep,eh,ef,ex),a.forEach(e=>ev.removeItem(e))}(null==tl?void 0:tl.id),tt(!1),ts("phone"),tr(null),td(0),n7([]),tw([]),tQ("groups-list"),t6(null),t7(null),rn(!1),nR(!1),lx(!1),lD(""),lR("deactivate"),lg(!1),nV(!1),rL(!1),am(null),rV(!1),document.body.style.overflow="",document.documentElement.style.overflow="",ek.push("/")}catch(e){console.error("Failed to logout:",e)}},o5=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return"#"+t;if(!e)return"";let a=new Date(e);if(isNaN(a.getTime()))return"";let s=new Date,l=s-a,r=Math.floor(l/6e4),n=Math.floor(l/36e5),i=Math.floor(l/864e5);return r<1?ew("time.justNow"):r<60?ew("time.minutesAgo",{count:r}):n<24?ew("time.hoursAgo",{count:n}):i<7?ew("time.daysAgo",{count:i}):a.toLocaleDateString()},o4=e=>{let t;if(!e)return null;let a=[],l=0,r=/(https?:\/\/[^\s]+)|(www\.[^\s]+)|(@[a-z0-9_]{3,20})|(#[a-zA-Z0-9_]+)|(\[song:([a-zA-Z0-9_-]+)\])/g;for(;null!==(t=r.exec(e));){if(t.index>l&&a.push(e.substring(l,t.index)),t[1]||t[2]){let e=t[1]||"http://".concat(t[2]);a.push((0,s.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"text-purple-400 hover:text-purple-300 hover:underline break-all font-bold",children:t[0]},t.index))}else if(t[3]){let e=t[3].substring(1);a.push((0,s.jsx)("a",{href:"/".concat(e),onClick:e=>e.stopPropagation(),className:"text-purple-400 hover:text-purple-300 hover:underline font-medium",children:t[3]},t.index))}else if(t[4]){let e=t[4].substring(1);a.push((0,s.jsx)("a",{href:"/search/".concat(e),onClick:e=>e.stopPropagation(),className:"text-purple-400 hover:text-purple-300 hover:underline font-medium",children:t[4]},t.index))}else if(t[5]){let e=t[6];a.push((0,s.jsx)(P,{slug:e},t.index))}l=r.lastIndex}return l<e.length&&a.push(e.substring(l)),a.length>0?a:e},o3=e=>{try{if(!e)return"";return e.toLowerCase().replace(RegExp("[^\\p{L}\\p{N}\\s-]","gu"),"").replace(/\s+/g,"-").replace(/-+/g,"-").trim()}catch(t){return console.warn("slugifyTitle failed, using fallback",t),(e||"").toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").trim()}},o6=()=>{window.history.length>2?ek.back():"single-post"===t$&&t8?t8.groupSlug?window.history.pushState(null,"","/".concat(t8.groupSlug)):t8.user?window.history.pushState(null,"","/".concat(t8.user.slug)):window.history.pushState(null,"","/"):"board"===t$?window.history.pushState(null,"","/"):"profile"===t$?window.history.pushState(null,"","/"):"dm"===t$?window.history.pushState(null,"","/dm"):"dm-list"===t$?window.history.pushState(null,"","/dm"):window.history.pushState(null,"","/")},o8=e=>
1{let t=o3(e);aQ(t),tQ("tag"),window.history.pushState(null,"","/tag/".concat(t)),i2(t,0)};(0,l.useEffect)(()=>{let e=e=>{rJ&&("ArrowRight"===e.key?o7(r9<rG.length-1?r9+1:0):"ArrowLeft"===e.key?o7(r9>0?r9-1:rG.length-1):"Escape"===e.key&&o9())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[rJ,r9,rG]);let o7=e=>{var t;ne(e),nd(!1),nC(!1),nk(""),(null===(t=rG[e])||void 0===t?void 0:t.message_slug)&&window.history.replaceState(null,"","/".concat(rG[e].message_slug))},o9=()=>{rV(!1),nC(!1),nk(""),nm([]);let e="/";"board"===t$&&t1?e="/".concat(t1):"profile"===t$&&at?e="/".concat(at):"tag"===t$&&a$?e="/tag/".concat(a$):"single-post"===t$&&t3?e="/".concat(t3):"private-album"===t$&&(null==tX?void 0:tX.slug)?e="/private/".concat(tX.slug):"dm"===t$&&t5&&(e="/c/".concat(t5)),window.history.replaceState(null,"",e)},ce=async function(e,t){var a,s,l,r,n;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];rY(e),ne(t),rV(!0),na(i),no(!1),nd(!1),(null===(a=e[t])||void 0===a?void 0:a.message_slug)&&(o?window.history.replaceState(null,"","/".concat(e[t].message_slug)):window.history.pushState(null,"","/".concat(e[t].message_slug)));let c=!!i;if(c)nm([]);else if((null==t8?void 0:t8.media)&&t8.media.length>0){let t=new Set(e.map(e=>e.id)),a=t8.media.filter(e=>!t.has(e.id));nm(a),nl((null===(l=t8.user)||void 0===l?void 0:l.slug)||null),nn(t8.media.length)}else nm([]),nl(null),nn(e.length);if(c&&"single-post"!==t$&&(null===(s=e[t])||void 0===s?void 0:s.message_slug)){let a=e[t].message_slug;try{let s=await iq("/api/messages/".concat(a,"?noRedirect=true"));if(s&&s.media){nl((null===(r=s.user)||void 0===r?void 0:r.slug)||null),nn(s.media.length),rY(s.media);let a=s.media.findIndex(a=>a.id===e[t].id);a>=0&&ne(a)}}catch(e){console.error("Failed to load full tag gallery media:",e)}}c&&"single-post"===t$&&(nn(e.length),nl((null==t8?void 0:null===(n=t8.user)||void 0===n?void 0:n.slug)||null))},ct=e=>{if(!e)return null;try{let t="string"==typeof e?JSON.parse(e):e;if("string"==typeof t)return t;return t.original||null}catch(t){return e}};(0,l.useEffect)(()=>{sv&&t1&&localStorage.setItem("lastChannel_".concat(t1),sv)},[sv,t1]);let ca=e=>{let{media:t,title:a}=e;if(!t||0===t.length)return null;let l=t.filter(e=>e.type&&e.type.startsWith("image/")),r=t.filter(e=>e.type&&e.type.startsWith("video/"));return 0===l.length&&0===r.length?null:(0,s.jsxs)("div",{className:"mt-2 space-y-2",children:[r.map((e,t)=>(0,s.jsx)(C,{video:e},"vid-".concat(t))),l.length>0&&(0,s.jsx)("div",{className:1===l.length?"w-full max-w-sm":"w-[50%]",children:(0,s.jsx)("div",{className:"grid gap-2 ".concat(1===l.length?"grid-cols-1":"grid-cols-2"),children:l.slice(0,4).map((e,t)=>(0,s.jsxs)("div",{className:"relative cursor-pointer group overflow-hidden rounded-lg ".concat(1===l.length?"":"aspect-square"),onClick:()=>ce(l,l.length>4&&3===t?3:t,a),children:[(0,s.jsx)("img",{src:ct(e.cached_urls)||e.url,alt:e.name||"Image",className:"w-full h-full group-hover:scale-105 transition-transform ".concat(1===l.length?"object-contain":"object-cover")}),3===t&&l.length>4&&(0,s.jsx)("div",{className:"absolute inset-0 bg-black/60 flex items-center justify-center",children:(0,s.jsxs)("span",{className:"text-white text-2xl font-bold",children:["+",l.length-4]})})]},t))})})]})},cs=e=>{let{embed:t}=e;return(null==t?void 0:t.type)==="youtube"?(0,s.jsx)("div",{className:"relative w-full pb-[56.25%] my-2 rounded-lg overflow-hidden",children:(0,s.jsx)("iframe",{className:"absolute top-0 left-0 w-full h-full",src:"https://www.youtube.com/embed/".concat(t.id),frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})}):(null==t?void 0:t.type)==="vimeo"?(0,s.jsx)("div",{className:"relative w-full pb-[56.25%] my-2 rounded-lg overflow-hidden",children:(0,s.jsx)("iframe",{className:"absolute top-0 left-0 w-full h-full",src:"https://player.vimeo.com/video/".concat(t.id),frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0})}):null},cl=e=>{var t,a;let{message:l,showChannelContext:r=!1,showActions:n=!0,allowInteractions:i=!0,canModerate:c=!1,context:d="board"}=e;return(0,s.jsxs)("div",{className:"group",id:"msg-".concat(l.slug),children:[l.replyTo&&(0,s.jsxs)("div",{className:"ml-12 mb-1 flex items-center gap-2 text-xs text-gray-500",children:[(0,s.jsx)(o.Z,{className:"w-3 h-3"}),(0,s.jsx)("span",{children:ew("messages.replyingTo",{userName:l.replyTo.userName||ew("common.unknown")})})]}),(0,s.jsxs)("div",{className:"flex gap-3 hover:bg-gray-800/50 px-3 py-2 rounded-lg transition-colors",children:[(0,s.jsx)("a",{href:"/".concat(l.userSlug),className:"w-10 h-10 bg-gradient-to-br from-purple-500 to-purple-500 rounded-full flex items-center justify-center flex-shrink-0 hover:opacity-80 transition-opacity",children:l.userAvatar?(0,s.jsx)("img",{src:ct(l.userAvatar)||l.userAvatar,alt:l.userName||"(Anonymous)",className:"w-full h-full rounded-full object-cover"}):(0,s.jsx)("span",{className:"text-white font-semibold",children:(null===(a=l.userName||"(Anonymous)")||void 0===a?void 0:null===(t=a.charAt(0))||void 0===t?void 0:t.toUpperCase())||"?"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-baseline gap-2 mb-1 flex-wrap",children:[(0,s.jsx)("a",{href:"/".concat(l.userSlug),className:"font-semibold text-white hover:underline",children:l.userName||"(Anonymous)"}),(0,s.jsxs)("a",{href:"/".concat(l.userSlug),className:"text-xs text-gray-500 hover:underline",children:["@",l.userSlug]}),(0,s.jsx)("a",{href:"/".concat(l.slug),className:"text-xs text-gray-500 hover:underline",children:o5(l.timestamp||l.createdAt,l.slug)}),r&&l.groupName&&(0,s.jsx)("a",{href:"/".concat(l.groupSlug),className:"text-xs text-gray-500 hover:text-gray-300",children:ew("messages.inGroupChannel",{groupName:l.groupName,channelName:l.channelName})})]}),l.title&&"tag"!==t$&&(0,s.jsxs)("a",{href:"/tag/".concat(o3(l.title)),className:"text-base font-semibold text-gray-200 mb-2 break-words hover:text-white transition-colors text-left w-auto bg-gray-700/50 hover:bg-gray-700 border border-gray-600/30 rounded-xl px-3 py-1 inline-block lowercase",children:[(0,s.jsx)(eP.Z,{className:"w-3 h-3 mr-1 inline"}
1),l.title]}),l.content&&l.content.trim().length>0&&(0,s.jsx)("div",{className:"text-gray-300 break-words whitespace-pre-wrap",children:o4(l.content)}),(l.videoEmbed||iz(l.content))&&cs({embed:l.videoEmbed||iz(l.content)}),ca({media:l.media,title:l.title}),n&&(0,s.jsxs)("div",{className:"flex items-center gap-4 mt-2",children:[void 0!==l.likes&&(0,s.jsxs)("button",{onClick:()=>i?oQ(l.slug):ek.push("/"),disabled:!1,className:"flex items-center gap-1 px-2 py-1 rounded-full text-sm transition-all ".concat(l.likedByMe?"bg-red-600 text-white":"bg-gray-700 hover:bg-gray-600 text-gray-400"),children:[(0,s.jsx)(R.Z,{className:"w-4 h-4 ".concat(l.likedByMe?"fill-current":"")}),(0,s.jsx)("span",{children:l.likes>0?l.likes:""})]}),void 0!==l.replyCount&&(0,s.jsxs)("button",{onClick:()=>i?l4(l):ek.push("/"),onMouseDown:e=>e.preventDefault(),disabled:!1,className:"flex items-center gap-1 px-2 py-1 bg-gray-700 hover:bg-gray-600 rounded-full text-sm text-gray-400 transition-colors",children:[(0,s.jsx)(o.Z,{className:"w-4 h-4"}),l.replyCount>0&&(0,s.jsx)("span",{children:l.replyCount})]}),(0,s.jsx)("button",{onClick:()=>oX(l.slug),className:"text-gray-400 hover:text-white transition-all p-1 ".concat(i?"opacity-0 group-hover:opacity-100":"opacity-100"),title:ew("messages.share"),children:(0,s.jsx)(eT.Z,{className:"w-4 h-4"})}),eI&&(c||tl&&(tl.slug===l.userSlug||String(tl.id)===String(l.userId||l.user_id)))&&(0,s.jsx)("button",{onClick:()=>oN(l.slug),className:"opacity-0 group-hover:opacity-100 text-red-400 hover:text-red-300 transition-all p-1",title:ew("common.delete"),children:(0,s.jsx)(eD.Z,{className:"w-4 h-4"})})]}),l.replies&&l.replies.length>0&&(0,s.jsx)("div",{className:"mt-3 pl-4 border-l-2 border-gray-700 space-y-2",children:(()=>{let e=(l.replyCount||l.replies.length)-l.replies.length;return(0,s.jsxs)(s.Fragment,{children:[l.replies.map(e=>(0,s.jsxs)("div",{className:"text-sm group/reply",id:"msg-".concat(e.slug),children:[(0,s.jsxs)("div",{className:"flex items-baseline gap-2 mb-1",children:[(0,s.jsx)("a",{href:"/".concat(e.userSlug),className:"font-semibold text-white hover:underline",children:e.userName||"(Anonymous)"}),(0,s.jsxs)("a",{href:"/".concat(e.userSlug),className:"text-xs text-gray-500 hover:underline",children:["@",e.userSlug]}),(0,s.jsx)("a",{href:"/".concat(e.slug),className:"text-xs text-gray-500 hover:underline",children:o5(e.timestamp||e.createdAt,e.slug)})]}),e.title&&"tag"!==t$&&(0,s.jsxs)("a",{href:"/tag/".concat(o3(e.title)),className:"text-sm font-semibold text-white mb-1 break-words hover:text-purple-400 transition-colors text-left w-full lowercase",children:[(0,s.jsx)(eP.Z,{className:"w-3 h-3 mr-1 inline"}),e.title]}),l3===e.slug?(0,s.jsxs)("div",{className:"flex flex-col gap-2 mb-2",children:[(0,s.jsx)("textarea",{value:l8,onChange:e=>l7(e.target.value),className:"w-full bg-gray-900 border border-gray-700 rounded p-2 text-white resize-none",rows:2,autoFocus:!0}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{onClick:()=>ok(e.slug),className:"px-3 py-1 bg-purple-600 hover:bg-purple-500 rounded text-xs font-semibold",children:"Save"}),(0,s.jsx)("button",{onClick:()=>l6(null),className:"px-3 py-1 bg-gray-700 hover:bg-gray-600 rounded text-xs",children:"Cancel"})]})]}):e.content&&e.content.trim().length>0&&(0,s.jsx)("div",{className:"text-gray-400 mb-2",children:o4(e.content)}),iz(e.content)&&cs({embed:iz(e.content)}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{onClick:()=>i?oQ(e.slug):ek.push("/"),disabled:!1,className:"flex items-center gap-1 px-2 py-0.5 rounded-full text-xs bg-gray-700 hover:bg-gray-600 text-gray-400 transition-all",children:(0,s.jsx)(R.Z,{className:"w-3 h-3"})}),tl&&(tl.slug===e.userSlug||tl.id===e.userId)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:()=>{l6(e.slug),l7(e.content)},className:"opacity-0 group-hover/reply:opacity-100 text-gray-400 hover:text-white transition-all p-1",children:(0,s.jsx)(e_.Z,{className:"w-3 h-3"})}),(0,s.jsx)("button",{onClick:()=>oS(e.slug),className:"opacity-0 group-hover/reply:opacity-100 text-red-400 hover:text-red-300 transition-all p-1",children:(0,s.jsx)(eD.Z,{className:"w-3 h-3"})})]})]})]},e.id)),e>0&&(0,s.jsxs)("a",{href:"/".concat(l.slug),className:"text-xs text-purple-400 hover:text-purple-300 font-medium mt
1-2 flex items-center gap-1 w-max",children:["View ",e," other ",1===e?"reply":"replies"]})]})})()}),l5&&l5.slug===l.slug&&i&&(0,s.jsx)(j,{message:l,onSend:oK,onCancel:()=>l4(null),context:d,autoFocusOnce:!0})]})]})]})},cr="\n    @keyframes highlight-flash {\n      0%, 100% { background-color: transparent; }\n      50% { background-color: rgba(59, 130, 246, 0.3); }\n    }\n    .highlight-flash {\n      animation: highlight-flash 2s ease-in-out;\n      border-radius: 0.5rem;\n    }\n  ",cn=function(){var e;let{maxWidth:t="max-w-5xl"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,s.jsx)("header",{className:"bg-gray-800 border-b border-gray-700 sticky top-0 z-40",children:(0,s.jsxs)("div",{className:"".concat(t," mx-auto px-6 py-4 flex items-center justify-between"),children:[(0,s.jsx)("a",{href:"/",className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:"tr"!==eN?(0,s.jsx)("img",{src:"/meetspace.png",alt:"MeetSpace",className:"h-8 w-auto object-contain"}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eM.Z,{className:"w-8 h-8 text-purple-500"}),(0,s.jsx)("h1",{className:"text-2xl font-bold",children:ew("pages.messageBoards")})]})}),eI&&te&&tl?(0,s.jsxs)("div",{className:"flex items-center gap-1.5 sm:gap-3",children:[(0,s.jsx)("button",{onClick:()=>{rL(!0),rB(""),rK({users:[],groups:[],messages:[]})},className:"p-2.5 bg-gray-700 hover:bg-gray-600 rounded-lg",title:ew("common.search"),children:(0,s.jsx)(v.Z,{className:"w-5 h-5"})}),(0,s.jsxs)("button",{onClick:()=>nV(!0),className:"p-2.5 bg-gray-700 hover:bg-gray-600 rounded-lg relative",title:ew("notifications.notifications"),children:[(0,s.jsx)(eU.Z,{className:"w-5 h-5"}),n$>0&&(0,s.jsx)("span",{className:"absolute -top-1 -right-1 bg-red-600 text-white text-[10px] sm:text-xs rounded-full w-4 h-4 sm:w-5 sm:h-5 flex items-center justify-center font-bold",children:n$>9?"9+":n$})]}),(0,s.jsxs)("a",{href:"/dm",className:"p-2.5 sm:px-4 sm:py-2 bg-gray-700 hover:bg-gray-600 rounded-lg flex items-center gap-2",title:ew("dm.directMessages"),children:[(0,s.jsx)(eM.Z,{className:"w-5 h-5"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:ew("dm.messages")})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 sm:gap-2",children:[(0,s.jsxs)("a",{href:"/".concat(tl.slug||tl.username||tl.id||""),onClick:e=>{window.innerWidth<640&&(e.preventDefault(),lg(!0))},className:"flex items-center gap-1.5 sm:gap-2 p-1.5 sm:px-3 sm:py-1 bg-gray-700 hover:bg-gray-600 rounded-lg transition-colors",title:ew("common.viewProfile"),children:[(0,s.jsx)("div",{className:"w-7 h-7 bg-gradient-to-br from-purple-500 to-purple-500 rounded-full flex items-center justify-center flex-shrink-0",children:tl.avatar?(0,s.jsx)("img",{src:ct(tl.avatar)||tl.avatar,alt:tl.name,className:"w-full h-full rounded-full object-cover"}):(0,s.jsx)("span",{className:"text-white text-xs font-semibold",children:(null===(e=tl.name)||void 0===e?void 0:e.charAt(0))||"?"})}),(0,s.jsx)("span",{className:"hidden sm:inline font-medium",children:tl.name})]}),(0,s.jsx)("button",{onClick:()=>lg(!0),className:"hidden sm:block p-1.5 sm:p-2 bg-gray-700 hover:bg-gray-600 rounded-lg transition-colors",title:ew("profile.accountManagement"),children:(0,s.jsx)(eR.Z,{className:"w-5 h-5"})})]})]}):(0,s.jsx)("div",{className:"flex items-center gap-3",children:(!eI||!te)&&(0,s.jsx)("button",{onClick:()=>{ek.push("/"),window.location.href="/"},className:"px-4 py-2 bg-purple-600 hover:bg-purple-700 text-white rounded-lg font-medium transition-colors",children:ew("auth.signIn")})})]})})},ci=()=>{var e,t,a,l,r,n;return(0,s.jsxs)(s.Fragment,{children:[np&&(0,s.jsx)("div",{className:"fixed inset-0 z-[100] overflow-hidden bg-black/80 backdrop-blur-sm flex items-center justify-center p-4",onClick:()=>nx(null),children:(0,s.jsxs)("div",{className:"bg-white p-4 rounded-sm shadow-2xl relative rotate-2 hover:rotate-0 transition-transform duration-300 max-w-[90vw] sm:max-w-none",onClick:e=>e.stopPropagation(),children:[(0,s.jsx)("button",{onClick:()=>nx(null),className:"absolute -top-4 -right-4 bg-gray-900 text-white rounded-full p-2 border-2 border-white shadow-lg hover:bg-gray-800 transition-colors",children:(0,s.jsx)(c.Z,{className:"w-5 h-5"})}),(0,s.jsx)("div",{className:"w-full sm:w-[512px] sm:h-[512px] aspect-square bg-gray-200",children:(0,s.jsx)("img",{src:np,alt:"Avatar",className:"w-full h-full object-cover"})}),(null==as?void 0:as.name)&&(0,s.jsx)("div",{className:"mt-4 text-center",children:(0,s.jsx)("p",{className:"text-gray-800 font-medium text-lg italic tracking-wide",children:as.name})})]})}),au&&(()=>{let e=eI&&te&&tl&&au.userId&&String(tl.id)===String(au.userId),t=aE?az||aU||au.ph
1oto||au.avatar||"https://cdn.qrsite.app/rnbw/bratparty.png":au.photo||au.avatar||"https://cdn.qrsite.app/rnbw/bratparty.png";return(0,s.jsx)("div",{className:"fixed inset-0 z-50 overflow-hidden bg-black/80 backdrop-blur-sm flex items-center justify-center p-0 md:p-8",children:(0,s.jsxs)("div",{className:"w-full max-w-5xl text-left transition-all transform bg-black md:rounded-3xl overflow-hidden border-0 md:border md:border-gray-800 shadow-2xl relative flex flex-col h-[100dvh] md:h-auto md:max-h-full",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between p-4 border-b border-gray-800 bg-black shrink-0 sticky top-0 z-20",children:[(0,s.jsx)("a",{href:"/".concat((null==as?void 0:as.slug)||""),className:"bg-gray-900 hover:bg-gray-800 p-2 rounded-full text-white transition-colors border border-white/10 inline-block",children:(0,s.jsx)(eO.Z,{className:"w-5 h-5"})}),e&&!aE&&(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("button",{onClick:()=>{aF(au.title||""),aP(au.description||""),aD(au.place||"");let e=au.date,t="string"==typeof e?e.replace(/\s+at\s+/i," "):e,a=t?new Date(t):new Date,s=isNaN(a.getTime())?new Date:a,l=e=>String(e).padStart(2,"0");aM("".concat(s.getFullYear(),"-").concat(l(s.getMonth()+1),"-").concat(l(s.getDate()),"T").concat(l(s.getHours()),":").concat(l(s.getMinutes()))),aR(au.photo||""),aL(null),aB(""),aH(""),aY(!1),aI(!0)},className:"flex items-center gap-1.5 bg-gray-800 hover:bg-gray-700 text-white text-sm font-medium px-3 py-2 rounded-lg transition-colors border border-white/10",children:[(0,s.jsx)(e_.Z,{className:"w-4 h-4"}),"Edit"]}),aG?(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-red-400 text-sm font-medium",children:"Sure?"}),(0,s.jsx)("button",{onClick:oJ,disabled:aJ,className:"bg-red-600 hover:bg-red-500 text-white text-sm font-bold px-3 py-2 rounded-lg transition-colors disabled:opacity-50",children:aJ?"...":"Yes, delete"}),(0,s.jsx)("button",{onClick:()=>aY(!1),className:"bg-gray-800 hover:bg-gray-700 text-white text-sm px-3 py-2 rounded-lg transition-colors",children:"Cancel"})]}):(0,s.jsxs)("button",{onClick:()=>aY(!0),className:"flex items-center gap-1.5 bg-red-900/40 hover:bg-red-800/60 text-red-300 hover:text-red-200 text-sm font-medium px-3 py-2 rounded-lg transition-colors border border-red-800/40",children:[(0,s.jsx)(eD.Z,{className:"w-4 h-4"}),"Delete"]})]}),e&&aE&&(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[aq&&(0,s.jsx)("span",{className:"text-red-400 text-xs",children:aq}),(0,s.jsx)("button",{onClick:()=>{aI(!1),aL(null),aB(""),aH("")},className:"bg-gray-800 hover:bg-gray-700 text-white text-sm px-3 py-2 rounded-lg transition-colors",children:"Cancel"}),(0,s.jsx)("button",{onClick:oV,disabled:aW,className:"bg-purple-600 hover:bg-purple-500 text-white text-sm font-bold px-4 py-2 rounded-lg transition-colors disabled:opacity-50",children:aW?"Saving...":"Save Changes"})]})]}),(0,s.jsxs)("div",{className:"flex flex-col md:flex-row flex-1 overflow-y-auto md:overflow-hidden",children:[(0,s.jsxs)("div",{className:"w-full md:w-1/2 flex flex-col bg-black border-b md:border-b-0 md:border-r border-gray-800 shrink-0 md:overflow-y-auto custom-scrollbar",children:[(0,s.jsxs)("div",{className:"relative aspect-square bg-black flex items-start justify-center w-full",children:[(0,s.jsx)("img",{src:t||au.photo||au.avatar||"https://cdn.qrsite.app/rnbw/bratparty.png",alt:au.title,className:"w-full h-full object-contain"}),aE&&(0,s.jsxs)("label",{className:"absolute inset-0 flex items-center justify-center bg-black/50 cursor-pointer hover:bg-black/60 transition-colors group",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center gap-2 text-white",children:[(0,s.jsx)(N.Z,{className:"w-8 h-8 group-hover:scale-110 transition-transform"}),(0,s.jsx)("span",{className:"text-sm font-medium",children:"Change Photo"})]}),(0,s.jsx)("input",{type:"file",accept:"image/*",className:"hidden",onChange:e=>{var t;let a=null===(t=e.target.files)||void 0===t?void 0:t[0];a&&(aL(a),aB(URL.createObjectURL(a)))}})]})]}),(0,s.jsx)("div",{className:"p-6 md:p-10",children:(0,s.jsxs)("div",{className:"bg-gradient-to-r from-purple-900/40 to-pink-900/40 border border-purple-500/30 rounded-2xl p-6 text-center",children:[(0,s.jsx)("h4",{className:"text-sm font-bold text-purple-300 tracking-widest uppercase mb-2",children:ew("events.getFreeTickets","GET FREE TICKETS & INVITE YOUR FRIENDS")}),(0,s.jsx)("p",{className:"text-lg font-extrabold text-white mb-4",children:ew("events.r
1svpApp","RSVP ON THE OFFICIAL MEETSPACE APP:")}),(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row justify-center items-center gap-3",children:[(0,s.jsx)("a",{href:"https://apps.apple.com/us/app/meet2talk-meetups/id6730110922",target:"_blank",rel:"noopener noreferrer",className:"inline-block hover:opacity-80 transition-opacity",children:(0,s.jsx)("img",{src:"https://upload.wikimedia.org/wikipedia/commons/3/3c/Download_on_the_App_Store_Badge.svg",alt:"Download on the App Store",className:"h-10 mx-auto"})}),(0,s.jsx)("a",{href:"https://play.google.com/store/apps/details?id=com.meet2talk",target:"_blank",rel:"noopener noreferrer",className:"inline-block hover:opacity-80 transition-opacity",children:(0,s.jsx)("img",{src:"https://upload.wikimedia.org/wikipedia/commons/7/78/Google_Play_Store_badge_EN.svg",alt:"Get it on Google Play",className:"h-10 mx-auto"})})]})]})})]}),(0,s.jsxs)("div",{className:"w-full md:w-1/2 p-6 md:p-10 bg-black flex flex-col shrink-0 md:shrink md:overflow-y-auto custom-scrollbar",children:[aE?(0,s.jsxs)("div",{className:"flex flex-col gap-5 flex-1",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-semibold text-gray-400 uppercase tracking-wider mb-1.5",children:"Title"}),(0,s.jsx)("input",{className:"w-full bg-gray-900 border border-gray-700 rounded-xl px-4 py-3 text-white text-lg font-semibold focus:outline-none focus:border-purple-500",value:aA,onChange:e=>aF(e.target.value)})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-semibold text-gray-400 uppercase tracking-wider mb-1.5",children:"Date & Time"}),(0,s.jsx)("input",{type:"datetime-local",className:"w-full bg-gray-900 border border-gray-700 rounded-xl px-4 py-3 text-white focus:outline-none focus:border-purple-500 [color-scheme:dark]",value:a_,onChange:e=>aM(e.target.value)})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-semibold text-gray-400 uppercase tracking-wider mb-1.5",children:"Location"}),(0,s.jsx)("input",{className:"w-full bg-gray-900 border border-gray-700 rounded-xl px-4 py-3 text-white focus:outline-none focus:border-purple-500",value:aT,onChange:e=>aD(e.target.value)})]}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("label",{className:"block text-xs font-semibold text-gray-400 uppercase tracking-wider mb-1.5",children:"Description"}),(0,s.jsx)("textarea",{className:"w-full bg-gray-900 border border-gray-700 rounded-xl px-4 py-3 text-white leading-relaxed focus:outline-none focus:border-purple-500 resize-none",rows:8,value:aZ,onChange:e=>aP(e.target.value)})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"mb-8",children:(0,s.jsx)("h2",{className:"text-4xl font-extrabold tracking-tight mb-2 leading-tight text-white",children:au.title})}),(0,s.jsxs)("div",{className:"space-y-8 flex-1",children:[(0,s.jsxs)("div",{className:"flex flex-col space-y-4 bg-gray-800/50 p-6 rounded-2xl border border-gray-700/50",children:[(0,s.jsxs)("div",{className:"flex items-center text-gray-300",children:[(0,s.jsx)("div",{className:"bg-purple-900/50 p-3 rounded-xl mr-4",children:(0,s.jsx)(eL.Z,{className:"w-6 h-6 text-purple-400"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm text-gray-400 font-medium mb-1",children:ew("events.dateTime","Date & Time")}),(0,s.jsx)("div",{className:"text-lg font-semibold text-white",children:(()=>{let e=au.date;if(!e)return au.humanDate||"";let t="string"==typeof e?e.replace(/\s+at\s+/i," "):e,a=new Date(t);return isNaN(a.getTime())?au.humanDate||au.date||"":(0,s.jsxs)(s.Fragment,{children:[a.toLocaleDateString(void 0,{weekday:"long",year:"numeric",month:"long",day:"numeric"}),(0,s.jsx)("span",{className:"mx-2",children:"•"}),a.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})]})})()})]})]}),au.place&&(0,s.jsxs)("div",{className:"flex items-center text-gray-300",children:[(0,s.jsx)("div",{className:"bg-purple-900/50 p-3 rounded-xl mr-4",children:(0,s.jsx)(ez.Z,{className:"w-6 h-6 text-purple-400"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm text-gray-400 font-medium mb-1",children:ew("events.location","
1Location")}),(0,s.jsx)("div",{className:"text-lg font-semibold text-white",children:au.place})]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-2xl font-bold mb-4 text-white",children:ew("events.about","About Event")}),au.description||au.bio?(0,s.jsx)("div",{className:"text-[17px] text-gray-300 whitespace-pre-wrap leading-relaxed mt-4 bg-[#1a1b1e]/50 p-6 rounded-2xl border border-white/5 shadow-inner",children:o4(au.description||au.bio)}):(0,s.jsx)("p",{className:"text-gray-500 italic",children:ew("events.noDescription","No description provided.")})]})]})]}),as&&(0,s.jsxs)("div",{className:"mt-8 pt-6 border-t border-gray-800 flex items-center",children:[(0,s.jsx)("div",{className:"w-12 h-12 bg-gray-700 rounded-full overflow-hidden mr-4 border-2 border-gray-800",children:as.avatar?(0,s.jsx)("img",{src:as.avatar,alt:as.name,className:"w-full h-full object-cover"}):(0,s.jsx)(eB.Z,{className:"w-full h-full p-2 text-gray-400"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-xs text-gray-400 font-medium uppercase tracking-wider",children:ew("events.hostedBy","Hosted By")}),(0,s.jsx)("h4",{className:"text-lg font-bold text-white",children:as.name})]})]}),(0,s.jsxs)("div",{className:"mt-8 pt-6 border-t border-gray-800",children:[(0,s.jsx)("h3",{className:"text-xl font-bold mb-4 text-white",children:"Event Discussion"}),te&&(0,s.jsx)("div",{className:"mb-8",children:(0,s.jsx)(k,{onSend:oH,placeholder:ew("newPost.placeholder","Share something about this event..."),context:"event-".concat(au.id)})}),ah?(0,s.jsx)("div",{className:"flex justify-center py-8",children:(0,s.jsx)(w.Z,{className:"w-8 h-8 text-purple-500 animate-spin"})}):0===ap.length?(0,s.jsxs)("div",{className:"text-center text-gray-500 py-8 bg-gray-800 rounded-xl",children:[(0,s.jsx)(eM.Z,{className:"w-12 h-12 mx-auto mb-3 opacity-50"}),(0,s.jsx)("p",{children:"No discussion yet. Be the first to post!"})]}):(0,s.jsx)("div",{className:"space-y-4",children:ap.map(e=>{var t,a,l;let r=(e.replies||[]).map(e=>{var t,a;return{id:(null===(t=e.id)||void 0===t?void 0:t.toString())||"",slug:e.slug,userId:(null===(a=e.user_id)||void 0===a?void 0:a.toString())||"",userSlug:e.userSlug,userName:e.userName,userAvatar:e.userAvatar,title:e.title||"",content:e.content,timestamp:new Date(e.createdAt),likes:e.likes||0,likedByMe:e.likedByMe||!1}}),n={id:(null===(t=e.id)||void 0===t?void 0:t.toString())||"",slug:e.slug,userId:(null===(a=e.user_id)||void 0===a?void 0:a.toString())||"",userSlug:e.userSlug,userName:e.userName,userAvatar:e.userAvatar,title:e.title||"",content:e.content,timestamp:new Date(e.createdAt),likes:e.likes||0,likedByMe:e.likedByMe||!1,media:e.media||[],replies:r,replyCount:null!==(l=e.replyCount)&&void 0!==l?l:r.length,videoEmbed:iz(e.content)};return(0,s.jsx)("div",{className:"bg-gray-800 rounded-xl p-4",children:cl({message:n,showChannelContext:!1,allowInteractions:te,canModerate:(null==tl?void 0:tl.slug)===n.userSlug,context:"event"})},n.id)})})]})]})]})]})})})(),lh&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",children:(0,s.jsxs)("div",{className:"bg-gray-800 rounded-xl p-6 w-full max-w-md border border-gray-700",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)("h3",{className:"text-xl font-bold",children:ew("profile.accountManagement")}),(0,s.jsx)("button",{onClick:()=>lg(!1),className:"text-gray-400 hover:text-white",children:(0,s.jsx)(c.Z,{className:"w-5 h-5"})})]}),(0,s.jsxs)("div",{className:"space-y-3 mb-4",children:[(0,s.jsxs)("div",{className:"p-3 bg-gray-700 rounded-lg",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("span",{className:"font-semibold",children:ew("profile.currentAccount")}),(0,s.jsx)("button",{onClick:()=>{oe(tl.slug),lg(!1)},className:"text-purple-400 hover:text-purple-300 text-sm",children:ew("common.viewProfile")})]}),(0,s.jsxs)("div",{className:"text-sm text-gray-400",children:["@",tl.slug||tl.username||tl.id||""]}),(0,s.jsxs)("div",{className:"mt-2 text-xs text-gray-500 flex items-center gap-2",children:[(0,s.jsx)(eW.Z,{className:"w-3 h-3"}),eI?"".concat(window.location.origin,"/").concat(tl.slug||tl.username||tl.id||""):""]})]}),tj.filter(e=>e.slug!==tl.slug).map(e=>(0,s.jsx)("div",{className:"p-3 bg-gray-700 rounded-lg",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-semibold",children:e.name}),(0,s.jsxs)("div",{className:"text-sm text-gray-400",children:["@",e.slug]})]}),(0,s.jsx)("button",{onClick:()=>ov(e.slug),className:"px-3 py-1 bg-purple-600 hover:bg-purple-700 rounded text-sm",children:ew("common.switch")})]})},e.id))]}),(0,s.jsxs)("button",{onClick:oh,className:"w-full py-2 mb-3 bg-purple-600 hover:bg-purple-700 rounded-lg flex items-center justify-center gap-2",children:[(0,s.jsx)(z.Z,{className:"w-4 h-4"}),ew("profile.addNewAccount")]}),(0,s.jsxs)("button",{onClick:()=>{oy(),lg(!1)},className:"w-full py-2 bg-gray-700 hover:bg-gray-600 rounded-lg flex items-center justify-center gap-2",children:[(0,s.jsx)(e_.Z,{className:"w-4 h-4"}),ew("profile.editProfile")]}),tn&&(0,s.jsxs)("button",{onClick:()=>{lg(!1),ek.push("/suite")},className:"w-full py-2 mt-3 bg-gradient-to-r from-indigo-600 to-purple-600 hover:from-indigo-500 hover:to-purple-500 rounded-lg flex items-center justify-center gap-2 font-semibold shadow-lg shadow-indigo-500/20 transition-all",children:[(0,s.jsx)(_.Z,{className:"w-4 h-4"}),"Marketing Suite"]}),(0,s.jsxs)("button",{onClick:o2,className:"w-full py-2 mt-3 bg-red-600 hover:bg-red-700 rounded-lg flex items-center justify-center gap-2",children:[(0,s.jsx)(eK.Z,{className:"w-4 h-4"}),ew("common.logout")]})]})}),lf&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",children:(0,s.jsxs)("div",{className:"bg-gray-800 rounded-xl p-6 w-full max-w-md border border-gray-700",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)("h3",{className:"text-xl font-bold",children:ew("profile.addNewAccount")}
1),(0,s.jsx)("button",{onClick:ox,className:"text-gray-400 hover:text-white",children:(0,s.jsx)(c.Z,{className:"w-5 h-5"})})]}),lE&&(0,s.jsx)("div",{className:"mb-4 p-3 bg-red-600/20 border border-red-600 rounded text-red-400 text-sm",children:lE}),"phone"===lN&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsxs)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:[ew("auth.phoneNumber")," (",ew("profile.useDifferentNumber"),")"]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("div",{className:"flex-none px-4 flex items-center justify-center bg-gray-700 border border-gray-600 rounded-lg text-white font-medium select-none",children:"tr"===eN?"+90":"+1"}),(0,s.jsx)("input",{autoFocus:!0,type:"tel",value:lv,onChange:e=>{ly(iD(e.target.value,eN))},onKeyPress:e=>"Enter"===e.key&&og(),placeholder:"tr"===eN?"532 123 45 67":"(555) 123-4567",className:"w-full px-4 py-3 bg-gray-700 border border-gray-600 rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-purple-500",disabled:lS})]})]}),(0,s.jsx)("button",{onClick:og,disabled:lS||!iT(lv),className:"w-full py-3 bg-purple-600 text-white rounded-lg hover:bg-purple-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 font-medium",children:lS?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.Z,{className:"w-5 h-5 animate-spin"}),ew("auth.sending")]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eq.Z,{className:"w-5 h-5"}),ew("auth.sendCode")]})})]}),"otp"===lN&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("button",{onClick:()=>{lk("phone"),lw(""),lI("")},className:"mb-4 text-gray-400 hover:text-white flex items-center gap-2 text-sm",children:[(0,s.jsx)(eO.Z,{className:"w-4 h-4"}),ew("common.changeNumber")]}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:ew("auth.verificationCode")}
1),(0,s.jsx)("input",{autoFocus:!0,type:"text",inputMode:"numeric",value:lj,onChange:e=>lw(e.target.value.replace(/[^\d]/g,"").slice(0,6)),onKeyPress:e=>"Enter"===e.key&&of(),placeholder:"123456",maxLength:6,className:"w-full px-4 py-3 bg-gray-700 border border-gray-600 rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-purple-500 text-center text-2xl tracking-widest font-mono",disabled:lS}),(0,s.jsxs)("p",{className:"text-xs text-gray-400 mt-4 text-center",children:[ew("auth.legalAgree"),(0,s.jsx)("a",{href:"/terms-of-service",target:"_blank",rel:"noopener noreferrer",className:"text-purple-400 hover:underline",children:ew("auth.termsOfService")}),ew("auth.and"),(0,s.jsx)("a",{href:"/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"text-purple-400 hover:underline",children:ew("auth.privacyPolicy")}),"."]})]}),(0,s.jsx)("button",{onClick:of,disabled:lS||6!==lj.length,className:"w-full py-3 bg-purple-600 text-white rounded-lg hover:bg-purple-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 font-medium",children:lS?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.Z,{className:"w-5 h-5 animate-spin"}),ew("auth.verifying")]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eH.Z,{className:"w-5 h-5"}),ew("auth.verify")]})})]}),"limit-reached"===lN&&(0,s.jsxs)("div",{className:"space-y-6 text-center",children:[(0,s.jsx)("div",{className:"w-16 h-16 bg-purple-500/10 border border-purple-500/20 rounded-full flex items-center justify-center mx-auto mb-2",children:(0,s.jsx)(eJ.Z,{className:"w-8 h-8 text-purple-400"})}),(0,s.jsx)("h3",{className:"text-xl font-bold",children:"Account Limit Reached"}),(0,s.jsx)("p",{className:"text-gray-300",children:"Free members are limited to a maximum of 2 linked accounts. Upgrade to MeetSpace+ to unlock up to 5 linked accounts and seamlessly switch between them."}),(0,s.jsxs)("div",{className:"pt-2",children:[(0,s.jsx)("button",{onClick:()=>{ox(),ek.push("/plus")},className:"w-full py-3 mb-3 bg-purple-600 text-white font-bold rounded-xl hover:bg-purple-700 transition-colors shadow-[0_0_20px_rgba(147,51,234,0.3)]",children:"Upgrade to MeetSpace+"}),(0,s.jsx)("button",{onClick:ox,className:"w-full py-3 bg-gray-700 text-white font-medium rounded-xl hover:bg-gray-600 transition-colors",children:"Close"})]})]}),"profile"===lN&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("p",{className:"text-sm text-gray-300",children:ew("profile.completeToFinish")}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:[ew("auth.name")," *"]}),(0,s.jsx)("input",{type:"text",value:nO,onChange:e=>nL(e.target.value),placeholder:"Jane Doe",className:"w-full px-4 py-3 bg-gray-700 border border-gray-600 rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-purple-500",disabled:lS})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:[ew("auth.email")," *"]}),(0,s.jsx)("input",{type:"email",value:nz,onChange:e=>nB(e.target.value),placeholder:"[email protected]",className:"w-full px-4 py-3 bg-gray-700 border border-gray-600 rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-purple-500",disabled:lS})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:[ew("auth.username")," *"]}),(0,s.jsx)("input",{type:"text",value:nW,onChange:e=>nK(e.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"")),placeholder:"janedoe",className:"w-full px-4 py-3 bg-gray-700 border border-gray-600 rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-purple-500",disabled:lS}),nq&&(0,s.jsx)("p",{className:"mt-2 text-sm ".concat(iL(nq.status)),children:nq.message})]}),(0,s.jsx)("button",{onClick:ob,disabled:lS||!nO.trim()||!nz.trim()||!nW.trim()||iR(null==nq?void 0:nq.status),className:"w-full py-3 bg-purple-600 text-white rounded-lg hover:bg-purple-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 font-medium",children:lS?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.Z,{className:"w-5 h-5 animate-spin"}),ew("auth.saving")]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(T.Z,{className:"w-5 h-5"}),ew("common.save")," ",ew("common.profile")]})})]})]})}),nJ&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",children:(0,s.jsxs)("div",{className:"bg-gray-800 rounded-xl p-6 w-full max-w-2xl border border-gray-700 max-h-[80vh] flex flex-col",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)("h3",{className:"text-xl font-bold",children:ew("notifications.notifications")}),(0,s.jsxs)("div",{className:"flex gap-2",children:[n$>0&&(0,s.jsx)("button",{onClick:()=>oR("all"),className:"text-sm text-purple-400 hover:text-purple-300",children:ew("notifications.markAllRead")}
1),(0,s.jsx)("button",{onClick:()=>nV(!1),className:"text-gray-400 hover:text-white",children:(0,s.jsx)(c.Z,{className:"w-5 h-5"})})]})]}),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto space-y-2",children:nX?(0,s.jsx)("div",{className:"flex justify-center py-8",children:(0,s.jsx)(w.Z,{className:"w-6 h-6 text-purple-500 animate-spin"})}):0===nG.length?(0,s.jsxs)("div",{className:"text-center py-12 text-gray-500",children:[(0,s.jsx)(eU.Z,{className:"w-16 h-16 mx-auto mb-4 opacity-50"}),(0,s.jsx)("p",{children:ew("notifications.noNotifications")})]}):nG.map(e=>{var t,a,l,r,n,i,o;return(0,s.jsx)("div",{onClick:()=>oO(e),role:"button",tabIndex:0,onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),oO(e))},className:"w-full p-4 rounded-lg text-left transition-colors cursor-pointer ".concat(e.isRead?"bg-gray-700 hover:bg-gray-600":"bg-purple-900/30 hover:bg-purple-900/50 border border-purple-500/30"),children:(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsx)("div",{onClick:t=>{var a;t.stopPropagation(),(null===(a=e.actor)||void 0===a?void 0:a.slug)&&(nV(!1),oe(e.actor.slug))},className:"w-10 h-10 bg-gradient-to-br from-purple-500 to-purple-500 rounded-full flex items-center justify-center flex-shrink-0 cursor-pointer hover:ring-2 hover:ring-purple-400 transition-all",title:(null===(t=e.actor)||void 0===t?void 0:t.name)||"User profile",children:(null===(a=e.actor)||void 0===a?void 0:a.avatar)?(0,s.jsx)("img",{src:e.actor.avatar,alt:(null===(l=e.actor)||void 0===l?void 0:l.name)||"User",className:"w-full h-full rounded-full object-cover"}):(0,s.jsx)("span",{className:"text-white font-semibold",children:(null===(n=e.actor)||void 0===n?void 0:null===(r=n.name)||void 0===r?void 0:r.charAt(0))||"?"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("p",{className:"text-white mb-1",children:[(0,s.jsx)("span",{onClick:t=>{var a;t.stopPropagation(),(null===(a=e.actor)||void 0===a?void 0:a.slug)&&(nV(!1),oe(e.actor.slug))},className:"font-semibold cursor-pointer hover:underline hover:text-purple-400 transition-colors mr-1",title:"View profile",children:(null===(i=e.actor)||void 0===i?void 0:i.name)||"Someone"}),"like"===e.type&&ew("notifications.likedYourPost"),"reply"===e.type&&ew("notifications.repliedToYourPost"),"mention"===e.type&&ew("notifications.mentionedYou"),"comment"===e.type&&ew("notifications.commentedOnYourPost"),"follow"===e.type&&ew("notifications.followedYou"," started following you")]}),(null===(o=e.message)||void 0===o?void 0:o.content)&&(0,s.jsxs)("p",{className:"text-gray-400 text-sm truncate",children:[e.message.title&&"".concat(e.message.title,": "),e.message.content]}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:o5(e.createdAt,e.messageSlug)})]}),!e.isRead&&(0,s.jsx)("div",{className:"w-2 h-2 bg-purple-500 rounded-full flex-shrink-0 mt-2"})]})},e.id)})})]})}),rO&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",children:(0,s.jsxs)("div",{className:"bg-gray-800 rounded-xl p-6 w-full max-w-2xl border border-gray-700 max-h-[80vh] flex flex-col",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)("h3",{className:"text-xl font-bold",children:ew("common.search")}),(0,s.jsx)("button",{onClick:()=>rL(!1),className:"text-gray-400 hover:text-white",children:(0,s.jsx)(c.Z,{className:"w-5 h-5"})})]}),(0,s.jsx)("div",{className:"mb-4",children:(0,s.jsx)("input",{type:"text",value:rz,onChange:e=>{rB(e.target.value),e.target.value&&oz()},onKeyDown:e=>{"Enter"===e.key&&rz.trim()&&(rL(!1),ek.push("/search/".concat(encodeURIComponent(rz.trim()))))},placeholder:ew("search.searchPlaceholder"),className:"w-full px-4 py-2 bg-gray-700 border border-gray-600 rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-purple-500",autoFocus:!0})}),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4",children:rq?(0,s.jsx)("div",{className:"flex justify-center py-8",children:(0,s.jsx)(w.Z,{className:"w-6 h-6 text-purple-500 animate-spin"})}):(0,s.jsxs)(s.Fragment,{children:[rW.users.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"text-sm font-semibold text-gray-400 mb-2",children:ew("search.users")}),rW.users.map(e=>{var t;return(0,s.jsxs)("button",{onClick:()=>{rL(!1),oe(e.slug)},className:"w-full p-3 bg-gray-700 hover:bg-gray-600 rounded-lg mb-2 flex items-center gap-3 text-left",children:[(0,s.jsx)("div",{className:"w-10 h-10 bg-gradient-to-br from-purple-500 to-purple-500 rounded-full flex items-center justify-center flex-shrink-0",children:e.avatar?(0,s.jsx)("img",{src:e.avatar,alt:e.name,className:"w-full h-full rounded-full object-cover"}):(0,s.jsx)("span",{className:"text-white font-semibold",children:(null===(t=e.name)||void 0===t?void 0:t.charAt(0))||"?"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"font-semibold",children:e.name}),(0,s.jsxs)("p",{className:"text-sm text-gray-400",children:["@",e.slug]})]})]},e.id)})]}),rW.groups.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"text-sm font-semibold text-gray-400 mb-2",children:ew("groups.groups")}),rW.groups.map(e=>(0,s.jsx)("button",{onClick:()=>{rL(!1),ot(e.slug)},className:"w-full p-3 bg-gray-700 hover:bg-gray-600 rounded-lg mb-2 text-left",children:(0,s.jsx)("p",{className:"font-semibold",children:e.name})},e.id))]}),rW.messages.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"text-sm font-semibold text-gray-400 mb-2",children:ew("search.messages")}),Array.from(new Map(rW.messages.filter(e=>e.title).map(e=>[e.title.toLowerCase().trim(),e])).values()).map(e=>(0,s.jsxs)("button",{onClick:()=>{rL(!1),o8(e.title)},className:"w-full p-3 bg-gray-700 hover:bg-gray-600 rounded-lg mb-2 text-left",children:[(0,s.jsx)("p",{className:"font-semibold mb-1",children:e.title}),e.content&&(0,s.jsx)("p",{className:"text-sm text-gray-300 truncate",children:e.content})]},e.id))]}),rz&&!rW.users.length&&!rW.groups.length&&!rW.messages.length&&(0,s.jsx)("div",{className:"text-center text-gray-500 py-8",children:ew("search.noResults")})]})})]})}),rr&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",children:(0,s.jsxs)("div",{className:"bg-gray-800 rounded-xl p-6 w-full max-w-md border border-gray-700 max-h-[90vh] overflow-y-auto",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)("h3",{className:"text-xl font-bold",children:ew("profile.editProfile")}),(0,s.jsx)("button",{onClick:()=>!nU&&rn(!1),className:"text-gray-400 hover:text-white ".concat(nU?"opacity-40 cursor-not-allowed":""),disabled:nU,children:(0,s.jsx)(c.Z,{className:"w-5 h-5"})})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:ew("auth.name")}
1),(0,s.jsx)("input",{type:"text",value:ri,onChange:e=>ro(e.target.value),className:"w-full px-4 py-2 bg-gray-700 border border-gray-600 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-purple-500"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:ew("auth.email")}),(0,s.jsx)("input",{type:"email",value:rc,onChange:e=>rd(e.target.value),className:"w-full px-4 py-2 bg-gray-700 border border-gray-600 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-purple-500"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:[ew("auth.username")," (3-20 chars)"]}),(0,s.jsx)("input",{type:"text",value:ru,onChange:e=>rm(e.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"")),className:"w-full px-4 py-2 bg-gray-700 border border-gray-600 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-purple-500"}),n_&&(0,s.jsx)("p",{className:"mt-2 text-sm ".concat(iL(n_.status)),children:n_.message})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:ew("profile.bio")}),(0,s.jsx)("textarea",{className:"w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-purple-500 resize-none text-[16px] sm:text-sm",value:rp,onChange:e=>rx(e.target.value),rows:3})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:ew("profile.location","Location")}),(0,s.jsx)(E.Z,{value:rh,onChange:e=>{rg(e),e||(rb(""),ry(""),rw(null),rk(null))},onSelect:e=>{e?(rg(e._fullName),rb(e.country||""),ry(e.country_name||""),rw(e.lat||null),rk(e.lng||null)):(rg(""),rb(""),ry(""),rw(null),rk(null))},placeholder:ew("profile.searchCity","Search city...")})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:ew("profile.avatar")}),(0,s.jsx)("input",{type:"file",ref:id,onChange:e=>rC(e.target.files[0]),accept:"image/*",className:"hidden"}),(0,s.jsxs)("button",{onClick:()=>{var e;return null===(e=id.current)||void 0===e?void 0:e.click()},className:"w-full py-2 bg-gray-700 hover:bg-gray-600 rounded-lg flex items-center justify-center gap-2",children:[(0,s.jsx)(N.Z,{className:"w-4 h-4"}),rS?rS.name:ew("profile.chooseAvatar")]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:ew("profile.cover")}),(0,s.jsx)("input",{type:"file",ref:iu,onChange:e=>rI(e.target.files[0]),accept:"image/*",className:"hidden"}),(0,s.jsxs)("button",{onClick:()=>{var e;return null===(e=iu.current)||void 0===e?void 0:e.click()},className:"w-full py-2 bg-gray-700 hover:bg-gray-600 rounded-lg flex items-center justify-center gap-2",children:[(0,s.jsx)(N.Z,{className:"w-4 h-4"}),rE?rE.name:ew("profile.chooseCover")]})]}),(0,s.jsxs)("div",{className:"flex gap-2 pt-4",children:[(0,s.jsx)("button",{onClick:()=>!nU&&rn(!1),disabled:nU,className:"flex-1 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg ".concat(nU?"opacity-40 cursor-not-allowed hover:bg-gray-700":""),children:ew("common.cancel")}),(0,s.jsxs)("button",{onClick:oj,disabled:rA||iR(null==n_?void 0:n_.status),className:"flex-1 py-2 bg-purple-600 hover:bg-purple-700 disabled:opacity-50 rounded-lg flex items-center justify-center gap-2",children:[rA?(0,s.jsx)(w.Z,{className:"w-4 h-4 animate-spin"}):(0,s.jsx)(T.Z,{className:"w-4 h-4"}),ew("common.save")]})]}),nU&&(0,s.jsx)("p",{className:"text-sm text-amber-400 text-center",children:ew("profile.completeBeforeContinuing")}),(0,s.jsxs)("div",{className:"border-t border-gray-700 pt-4",children:[(0,s.jsxs)("button",{onClick:()=>lL(!lO),className:"text-gray-400 hover:text-white text-sm font-medium flex items-center gap-2",children:[(0,s.jsx)(U.Z,{className:"w-4 h-4"}),ew("profile.accountManagement")]}),lO&&(0,s.jsxs)("div",{className:"mt-4 space-y-3 p-4 bg-gray-900/50 rounded-lg",children:[(0,s.jsxs)("button",{onClick:()=>{rn(!1),oD("deactivate")},className:"w-full py-2 bg-red-600 hover:bg-red-700 rounded-lg flex items-center justify-center gap-2 text-sm font-medium transition-colors",children:[(0,s.jsx)(eV.Z,{className:"w-4 h-4"}),ew("profile.deactivateAccount")]}),(0,s.jsxs)("button",{onClick:()=>{rn(!1),oD("delete")},className:"w-full py-2 bg-purple-600 hover:bg-purple-700 rounded-lg flex items-center justify-center gap-2 text-sm font-medium transition-colors",children:[(0,s.jsx)(eD.Z,{className:"w-4 h-4"}),ew("profile.deleteAccount")]})]})]})]})]})}),lp&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",children:(0,s.jsxs)("div",{className:"bg-gray-800 rounded-xl p-6 w-full max-w-md border border-red-600",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,s.jsx)(eG.Z,{className:"w-8 h-8 text-red-500"}),(0,s.jsx)("h3",{className:"text-xl font-bold",children:"deactivate"===lU?ew("profile.deactivateAccount"):ew("profile.deleteAccount")}
1)]}),(0,s.jsx)("p",{className:"text-gray-300 mb-4",children:ew("profile.enterVerificationCode")}),(0,s.jsx)("input",{type:"text",inputMode:"numeric",value:lT,onChange:e=>lD(e.target.value.replace(/[^\d]/g,"").slice(0,6)),placeholder:"123456",maxLength:6,className:"w-full px-4 py-3 bg-gray-700 border border-gray-600 rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-red-500 text-center text-2xl tracking-widest font-mono mb-4"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{onClick:()=>{lx(!1),lD("")},className:"flex-1 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg",children:ew("common.cancel")}),(0,s.jsxs)("button",{onClick:o_,disabled:l_||6!==lT.length,className:"flex-1 py-2 bg-red-600 hover:bg-red-700 disabled:opacity-50 rounded-lg flex items-center justify-center gap-2",children:[l_?(0,s.jsx)(w.Z,{className:"w-4 h-4 animate-spin"}):(0,s.jsx)(eD.Z,{className:"w-4 h-4"}),ew("common.delete")]})]})]})}),lu&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",children:(0,s.jsxs)("div",{className:"bg-gray-800 rounded-xl p-6 w-full max-w-md border border-gray-700",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,s.jsx)(eY.Z,{className:"w-6 h-6 text-red-500"}),(0,s.jsx)("h3",{className:"text-xl font-bold",children:ew("pages.reportUser")})]}),(0,s.jsx)("textarea",{className:"w-full px-3 py-2 bg-gray-800 border border-gray-700 rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-purple-500 resize-none mb-4 text-[16px] sm:text-sm",value:lz,onChange:e=>lB(e.target.value),placeholder:ew("profile.reportReason"),rows:4}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,s.jsx)("input",{type:"checkbox",id:"reportBlockUser",checked:lq,onChange:e=>lH(e.target.checked),className:"w-4 h-4 text-purple-600 bg-gray-700 border-gray-600 rounded focus:ring-purple-500 focus:ring-2"}),(0,s.jsx)("label",{htmlFor:"reportBlockUser",className:"text-sm font-medium text-gray-300 cursor-pointer",children:ew("profile.blockThisProfileToo")||"Block this profile too"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{onClick:()=>lm(!1),className:"flex-1 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg",children:ew("common.cancel")}),(0,s.jsxs)("button",{onClick:oF,disabled:!lz.trim(),className:"flex-1 py-2 bg-red-600 hover:bg-red-700 disabled:opacity-50 rounded-lg flex items-center justify-center gap-2",children:[(0,s.jsx)(eY.Z,{className:"w-4 h-4"}),ew("common.submit")]})]})]})}),lc&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",children:(0,s.jsxs)("div",{className:"bg-gray-800 rounded-xl p-6 w-full max-w-md border border-gray-700",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)("h3",{className:"text-xl font-bold",children:ew("pages.sharePost")}),(0,s.jsx)("button",{onClick:()=>ld(!1),className:"text-gray-400 hover:text-white",children:(0,s.jsx)(c.Z,{className:"w-5 h-5"})})]}),(0,s.jsx)("p",{className:"text-gray-400 text-sm mb-4",children:ew("messages.copyLinkToShare")}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{type:"text",value:"".concat(window.location.origin,"/").concat(lJ),readOnly:!0,className:"flex-1 px-4 py-2 bg-gray-700 border border-gray-600 rounded-lg text-white text-sm"}),(0,s.jsxs)("button",{onClick:o0,className:"px-4 py-2 bg-purple-600 hover:bg-purple-700 rounded-lg flex items-center gap-2",children:[(0,s.jsx)(e$.Z,{className:"w-4 h-4"}),ew("common.copy")]})]})]})}),rJ&&(0,s.jsxs)("div",{className:"fixed inset-0 bg-black z-50 flex flex-col md:flex-row overflow-hidden",children:[(0,s.jsx)("button",{onClick:o9,className:"absolute top-4 left-4 p-2 bg-black/50 hover:bg-black/70 rounded-full z-[60] text-white",children:(0,s.jsx)(c.Z,{className:"w-6 h-6"})}),(0,s.jsxs)("div",{className:"relative w-full md:w-[70%] h-[50vh] md:h-full bg-black flex items-center justify-center",children:[(0,s.jsx)("button",{onClick:()=>o7(r9>0?r9-1:rG.length-1),className:"absolute left-4 p-2 bg-black/50 hover:bg-black/70 rounded-full z-10 text-white",children:(0,s.jsx)(eQ.Z,{className:"w-8 h-8"})}),(null===(t=rG[r9])||void 0===t?void 0:null===(e=t.type)||void 0===e?void 0:e.startsWith("video/"))?(0,s.jsx)("div",{className:"w-full h-full max-w-4xl max-h-full p-4 flex items-center justify-center",children:(0,s.jsx)(C,{video:rG[r9],galleryMode:!0},(null===(a=rG[r9])||void 0===a?void 0:a.id)||r9)}):(0,s.jsx)("img",{src:ct(null===(l=rG[r9])||void 0===l?void 0:l.cached_urls)||(null===(r=rG[r9])||void 0===r?void 0:r.url),alt:"Gallery",className:"max-w-full max-h-full object-contain"}),(0,s.jsx)("button",{onClick:()=>o7(r9<rG.length-1?r9+1:0),className:"absolute right-4 p-2 bg-black/50 hover:bg-black/70 rounded-full z-10 text-white",children:(0,s.jsx)(eX.Z,{className:"w-8 h-8"})})]}),(0,s.jsx)("div",{className:"w-full md:w-[30%] h-[50vh] md:h-full bg-gray-900 overflow-y-auto border-l border-gray-800 flex flex-col",children:(0,s.jsxs)("div",{className:"p-6 flex-1",children:["private-album"===t$?(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"bg-gray-800 border border-gray-700 rounded-xl p-4 mb-6",children:[(0,s.jsxs)("h1",{className:"text-lg font-bold flex items-center gap-2 mb-2 text-white",children:[(0,s.jsx)(H.Z,{className:"w-4 h-4 text-gray-400"}),(null==tX?void 0:tX.title)||"Private Album"]}),(0,s.jsxs)("div",{className:"text-xs text-gray-400 flex flex-wrap items-center gap-2",children:[(0,s.jsxs)("span",{children:[rG.length," medya"]}),(null==tX?void 0:tX.creator_slug)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsxs)("span",{children:[ew("gallery.startedBy")," ",(0,s.jsxs)("a",{href:"/".concat(tX.creator_slug),className:"text-purple-400 hover:underline",children:["@",tX.creator_slug]})]})]})]}),(null===(n=rG[r9])||void 0===n?void 0:n.name)&&(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-2 truncate",children:rG[r9].name})]}),(()=>{let e=rG[r9];if(!e)return null;let t=e.id,a=e.user_name||"",l=e.user_slug||"",r=e.user_avatar,n=e.created_at?new Date(e.created_at):null,i=e.liked_by_me||!1,o=e.like_count||0,c=e.comment_count||0;nv[t],nj[t];let d=async()=>
1{if(!te||"complete"!==ta){ek.push("/");return}rY(e=>e.map((e,t)=>t===r9?{...e,liked_by_me:!e.liked_by_me,like_count:e.liked_by_me?e.like_count-1:e.like_count+1}:e));try{let e=await iK("/api/private-media/".concat(t,"/like"),{method:"POST"});rY(t=>t.map((t,a)=>a===r9?{...t,liked_by_me:e.liked,like_count:e.like_count}:t))}catch(e){rY(e=>e.map((e,t)=>t===r9?{...e,liked_by_me:i,like_count:o}:e))}},u=async()=>{if(!nv[t]){nw(e=>({...e,[t]:!0}));try{let e=await iK("/api/private-media/".concat(t,"/comments"));ny(a=>({...a,[t]:e}))}catch(e){console.error("Failed to load comments:",e)}finally{nw(e=>({...e,[t]:!1}))}}};return(0,s.jsxs)("div",{className:"mb-6 px-4 md:px-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,s.jsx)("a",{href:"/".concat(l),children:r?(0,s.jsx)("img",{src:r,className:"w-10 h-10 rounded-full object-cover",alt:"avatar"}):(0,s.jsx)("div",{className:"w-10 h-10 bg-gradient-to-br from-purple-500 to-purple-500 rounded-full flex items-center justify-center text-white font-bold shrink-0",children:a?a.charAt(0).toUpperCase():"?"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("a",{href:"/".concat(l),className:"font-bold text-white hover:underline",children:a}),(0,s.jsxs)("div",{className:"text-xs text-gray-400",children:[(0,s.jsxs)("a",{href:"/".concat(l),className:"hover:underline",children:["@",l]}),n?" \xb7 ".concat(o5(n,e.message_slug)):""]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,s.jsxs)("button",{onClick:d,className:"flex items-center gap-2 px-3 py-1.5 rounded-full text-sm transition-all ".concat(i?"bg-red-600 text-white":"bg-gray-800 hover:bg-gray-700 text-gray-300"),children:[(0,s.jsx)(R.Z,{className:"w-4 h-4"}),(0,s.jsxs)("span",{children:[o>0?o:""," ",ew("messages.like")||"Like"]})]}),(0,s.jsxs)("button",{onClick:()=>{let e=!nS;nC(e),e&&u()},className:"flex items-center gap-2 px-3 py-1.5 rounded-full text-sm transition-all ".concat(nS?"bg-purple-600 text-white":"bg-gray-800 hover:bg-gray-700 text-gray-300"),children:[(0,s.jsx)(et.Z,{className:"w-4 h-4"}),(0,s.jsxs)("span",{children:[c>0?c:""," ",ew("messages.reply")||"Reply"]})]})]})]})})(),nS&&(()=>{let e=rG[r9];if(!e)return null;let t=e.id;e.user_slug;let a=nv[t]||[],l=nj[t],r=async()=>{if(!nN.trim())return;if(!te||"complete"!==ta){ek.push("/");return}let e=nN.trim();nk("");try{let a=await iK("/api/private-media/".concat(t,"/comments"),{method:"POST",body:JSON.stringify({content:e})});ny(e=>({...e,[t]:[...e[t]||[],a]})),rY(e=>e.map((e,t)=>t===r9?{...e,comment_count:(e.comment_count||0)+1}:e))}catch(t){alert("Failed to post comment."),nk(e)}},n=async e=>{try{await iK("/api/private-media/".concat(t,"/comments/").concat(e),{method:"DELETE"}),ny(a=>({...a,[t]:(a[t]||[]).filter(t=>t.id!==e)})),rY(e=>e.map((e,t)=>t===r9?{...e,comment_count:Math.max(0,(e.comment_count||0)-1)}:e))}catch(e){alert("Failed to delete comment.")}},i=async e=>{if(rt.trim())try{await iK("/api/private-media/".concat(t,"/comments/").concat(e),{method:"PUT",body:JSON.stringify({content:rt.trim()})}),ny(a=>({...a,[t]:(a[t]||[]).map(t=>t.id===e?{...t,content:rt.trim()}:t)})),re(null),ra("")}catch(e){alert("Failed to edit comment.")}};return(0,s.jsxs)("div",{className:"mb-6 border-t border-gray-800 pt-4",children:[l?(0,s.jsx)("div",{className:"text-gray-500 text-sm text-center py-2",children:"Loading..."}):0===a.length?(0,s.jsx)("div",{className:"text-gray-600 text-xs text-center py-2",children:"No comments yet"}):(0,s.jsx)("div",{className:"space-y-3 mb-4",children:a.map(e=>(0,s.jsxs)("div",{className:"flex gap-2 text-sm",children:[(0,s.jsx)("a",{href:"/".concat(e.user_slug),children:e.user_avatar?(0,s.jsx)("img",{src:e.user_avatar,className:"w-7 h-7 rounded-full object-cover shrink-0",alt:""}):(0,s.jsx)("div",{className:"w-7 h-7 rounded-full bg-gradient-to-br from-purple-500 to-purple-500 flex items-center justify-center text-white text-xs font-bold shrink-0",children:(e.user_name||"?").charAt(0).toUpperCase()})}),(0,s.jsxs)("div",{className:"flex-1 bg-gray-800 rounded-lg px-3 py-2",children:[(0,s.jsxs)("div",{className:"flex justify-between items-start",children:[(0,s.jsx)("a",{href:"/".concat(e.user_slug),className:"font-bold text-white text-xs hover:underline",children:e.user_name}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-gray-500 text-xs",children:o5(new Date(e.created_at),e.slug)}),tl&&tl.slug===e.user_slug&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:()=>{re(e.id),ra(e.content)},className:"text-gray-600 hover:text-white transition-colors",children:(0,s.jsx)(e_.Z,{className:"w-3 h-3"})}),(0,s.jsx)("button",{onClick:()=>n(e.id),className:"text-gray-600 hover:text-red-400 transition-colors",children:(0,s.jsx)(eD.Z,{className:"w-3 h-3"})})]})]})]}),l9===e.id?(0,s.jsxs)("div",{className:"mt-2 flex flex-col gap-2",children:[(0,s.jsx)("textarea",{value:rt,onChange:e=>ra(e.target.value),className:"w-full bg-gray-900 border border-gray-700 rounded p-2 text-white text-sm resize-none",rows:2,autoFocus:!0}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{onClick:()=>i(e.id),className:"px-3 py-1 bg-purple-600 hover:bg-purple-500 rounded text-xs font-semibold",children:"Save"}),(0,s.jsx)("button",{onClick:()=>re(null),className:"px-3 py-1 bg-gray-700 hover:bg-gray-600 rounded text-xs",children:"Cancel"})]})]}):(0,s.jsx)("div",{className:"text-gray-300 mt-1 break-words whitespace-pre-wrap",children:o4(e.content||"")})]})]},e.id))}),te&&"complete"===ta&&(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{type:"text",value:nN,onChange:e=>nk(e.target.value),onKeyDown:e=>"Enter"===e.key&&r(),placeholder:"Write a comment...",autoFocus:!0,className:"flex-1 px-3 py-2 bg-gray-800 border border-gray-700 rounded-full text-white text-base sm:text-sm placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-purple-500"}),(0,s.jsx)("button",{onClick:r,disabled:!nN.trim(),className:"px-4 py-2 bg-purple-600 hover:bg-purple-700 disabled:opacity-40 rounded-full text-white text-sm font-bold transition-colors",children:ew("newPost.send")||"Send"})]})]})})()]}):(0,s.jsxs)(s.Fragment,{children:[nt&&(0,s.jsxs)("div",{className:"bg-gray-800 border border-gray-700 rounded-xl p-4 mb-6",children:[(0,s.jsxs)("a",{href:"/tag/".concat(o3(nt)),className:"text-lg font-bold flex items-center gap-2 mb-2 lowercase text-white hover:underline",children:[(0,s.jsx)(eP.Z,{className:"w-4 h-4 text-gray-400"}),nt]}),(0,s.jsxs)("div",{className:"text-xs text-gray-400 flex flex-wrap items-center gap-2",children:[nr>0&&(0,s.jsx)("span",{children:ew("gallery.postsShared",{count:nr})}),nr>0&&ns&&(0,s.jsx)("span",{children:"\xb7"}),ns&&(0,s.jsxs)("span",{children:[ew("gallery.startedBy")," ",(0,s.jsxs)("a",{href:"/".concat(ns),className:"text-purple-400 hover:underline",children:["@",ns]})]})]})]}),(()=>{var e,t,a,l,r,n,i,o,c,d,u,m,p,x,h;let g=null===(e=rG[r9])||void 0===e?void 0:e.message_slug,f=null;if("single-post"===t$&&t8){if(g===t8.slug)f=t8;else if(null===(n=t8.replies)||void 0===n?void 0:n.length){let e=t8.replies.find(e=>e.slug===g);e&&(f={...e,user:e.user||t8.user,userName:(null===(i=e.user)||void 0===i?void 0:i.name)||(null===(o=t8.user)||void 0===o?void 0:o.name),userSlug:(null===(c=e.user)||void 0===c?void 0:c.slug)||(null===(d=t8.user)||void 0===d?void 0:d.slug),userAvatar:(null===(u=e.user)||void 0===u?void 0:u.avatar)||(null===(m=t8.user)||void 0===m?void 0:m.avatar),channelId:t8.channelId,channelSlug:t8.channelSlug,groupSlug:t8.groupSlug})}}if(f||"tag"!==t$||(f=aX.find(e=>e.slug===g)),f||"search"!==t$||(f=sr.find(e=>e.slug===g)),!f&&"profile"===t$&&(null==as?void 0:as.posts)&&(f=as.posts.find(e=>e.slug===g)),f||"groups-list"!==t$||(f=n8.find(e=>e.slug===g)),!f&&sv&&sj[sv]&&(f=sj[sv].find(e=>e.slug===g)),!f){let e=[...Object.values(sj).flat(),...n8,...(null==as?void 0:as.posts)||[],...t8?[t8,...t8.replies||[]]:[],...aX,...sr,...Object.values(nh||{})];f=e.find(e=>e.slug===g)}if(!f&&t8&&(f={id:t8.id,slug:g||t8.slug,title:t8.title,content:t8.content,user:t8.user,userName:null===(p=t8.user)||void 0===p?void 0:p.name,userSlug:null===(x=t8.user)||void 0===x?void 0:x.slug,userAvatar:null===(h=t8.user)||void 0===h?void 0:h.avatar,createdAt:t8.createdAt,likes:t8.likes,likedByMe:t8.likedByMe,replyCount:t8.replyCount}),!f)return(0,s.jsx)("div",{className:"text-gray-500 text-sm py-4 text-center",children:"Loading details..."});let b=f.userName||(null===(t=f.user)||void 0===t?void 0:t.name)||"",v=f.userSlug||(null===(a=f.user)||void 0===a?void 0:a.slug)||"",y=f.userAvatar||(null===(l=f.user)||void 0===l?void 0:l.avatar),w=f.timestamp||(f.createdAt?new Date(f.createdAt):new Date);return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,s.jsx)("a",{href:"/".concat(v),children:y?(0,s.jsx)("img",{src:y,className:"w-10 h-10 rounded-full object-cover",alt:"avatar"}):(0,s.jsx)("div",{className:"w-10 h-10 bg-gradient-to-br from-purple-500 to-purple-500 rounded-full flex items-center justify-center text-white font-bold shrink-0",children:b?b.charAt(0).toUpperCase():"?"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("a",{href:"/".concat(v),className:"font-bold text-white hover:underline",children:b}),(0,s.jsxs)("div",{className:"text-xs text-gray-400",children:[(0,s.jsxs)("a",{href:"/".concat(v),className:"hover:underline",children:["@",v]})," \xb7 ",o5(w,f.slug)]})]})]}),(0,s.jsx)("div",{className:"text-white text-sm mb-4 break-words whitespace-pre-wrap",children:o4(f.content||"")}),(f.videoEmbed||iz(f.content))&&cs({embed:f.videoEmbed||iz(f.content)}),(0,s.jsxs)("div",{className:"flex items-center gap-4 border-t border-gray-800 pt-4 mb-4",children:[(0,s.jsxs)("button",{onClick:()=>oQ(f.slug),className:"flex items-center gap-2 px-3 py-1.5 rounded-full text-sm transition-all ".concat(f.likedByMe?"bg-red-600 text-white":"bg-gray-800 hover:bg-gray-700 text-gray-300"),children:[(0,s.jsx)(R.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:f.likes||0})]}),(0,s.jsxs)("button",{onClick:()=>nd(!nc),className:"flex items-center gap-2 px-3 py-1.5 rounded-full text-sm transition-all ".concat(nc?"bg-purple-600 text-white":"bg-gray-800 hover:bg-gray-700 text-gray-300"),children:[(0,s.jsx)(et.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:f.replyCount||(null===(r=f.replies)||void 0===r?void 0:r.length)||0})]}),tl&&(tl.slug===f.userSlug||String(tl.id)===String(f.userId||f.user_id))&&
1(0,s.jsx)("button",{onClick:()=>{rV(!1),oN(f.slug)},className:"flex items-center gap-2 px-3 py-1.5 rounded-full text-sm transition-all bg-gray-800 hover:bg-gray-700 text-red-400",children:(0,s.jsx)(eD.Z,{className:"w-4 h-4"})})]}),f.replies&&f.replies.length>0&&(0,s.jsxs)("div",{className:"space-y-4 mb-6",children:[(0,s.jsx)("h4",{className:"text-sm font-bold text-gray-400",children:"Replies"}),f.replies.map(e=>{var t,a,l,r;let n=e.userName||(null===(t=e.user)||void 0===t?void 0:t.name)||"",i=e.userSlug||(null===(a=e.user)||void 0===a?void 0:a.slug)||"",o=e.timestamp||(e.createdAt?new Date(e.createdAt):new Date);return(0,s.jsxs)("div",{id:"msg-".concat(e.slug),className:"text-sm bg-gray-800 p-3 rounded-lg ".concat(t9===e.slug?"ring-2 ring-purple-500 highlight-flash":""),children:[(0,s.jsxs)("div",{className:"flex justify-between items-start mb-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("a",{href:"/".concat(i),children:e.userAvatar?(0,s.jsx)("img",{src:e.userAvatar,className:"w-6 h-6 rounded-full object-cover",alt:"avatar"}):(0,s.jsx)("div",{className:"w-6 h-6 bg-gradient-to-br from-purple-500 to-purple-500 rounded-full flex items-center justify-center text-white font-bold text-xs shrink-0",children:n?n.charAt(0).toUpperCase():"?"})}),(0,s.jsx)("a",{href:"/".concat(i),className:"font-bold hover:underline",children:n})]}),(0,s.jsx)("a",{href:"/".concat(e.slug),className:"text-xs text-gray-500 hover:underline",children:o5(o,e.slug)})]}),l3===e.slug?(0,s.jsxs)("div",{className:"flex flex-col gap-2 mb-2",children:[(0,s.jsx)("textarea",{value:l8,onChange:e=>l7(e.target.value),className:"w-full bg-gray-900 border border-gray-700 rounded p-2 text-white resize-none",rows:2,autoFocus:!0}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{onClick:()=>ok(e.slug),className:"px-3 py-1 bg-purple-600 hover:bg-purple-500 rounded text-xs font-semibold",children:"Save"}),(0,s.jsx)("button",{onClick:()=>l6(null),className:"px-3 py-1 bg-gray-700 hover:bg-gray-600 rounded text-xs",children:"Cancel"})]})]}):(0,s.jsx)("div",{className:"text-gray-300 break-words whitespace-pre-wrap mb-2",children:o4(e.content||"")}),iz(e.content)&&cs({embed:iz(e.content)}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{onClick:()=>oQ(e.slug),className:"flex items-center gap-1 px-2 py-0.5 rounded-full text-xs transition-all ".concat(e.likedByMe?"bg-red-600 text-white":"bg-gray-700 hover:bg-gray-600 text-gray-400"),children:(0,s.jsx)(R.Z,{className:"w-3 h-3"})}),tl&&(tl.slug===(e.userSlug||(null===(l=e.user)||void 0===l?void 0:l.slug))||String(tl.id)===String(e.userId||e.user_id||(null===(r=e.user)||void 0===r?void 0:r.id)))&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:()=>{l6(e.slug),l7(e.content)},className:"text-gray-400 hover:text-white transition-all p-1",children:(0,s.jsx)(e_.Z,{className:"w-3 h-3"})}),(0,s.jsx)("button",{onClick:()=>oS(e.slug),className:"text-red-400 hover:text-red-300 transition-all p-1",children:(0,s.jsx)(eD.Z,{className:"w-3 h-3"})})]})]})]},e.id)})]}),co&&nc&&(0,s.jsx)("div",{className:"mt-4 pt-4 border-t border-gray-800",children:(0,s.jsx)(j,{message:{...f,userName:b,userSlug:v,userAvatar:y},onSend:oK,onCancel:()=>nd(!1),context:t$,autoFocusOnce:!0})})]})})()]}),(rG.length>1||nu.length>0)&&(0,s.jsxs)("div",{className:"mt-8 border-t border-gray-800 pt-4 pb-8",children:[(0,s.jsx)("h4",{className:"text-xs font-bold text-gray-500 mb-3 uppercase",children:ew("gallery.otherMedias")}),(0,s.jsxs)("div",{className:"grid grid-cols-5 gap-1",children:[rG.map((e,t)=>{var a;let l=null===(a=e.type)||void 0===a?void 0:a.startsWith("video/");return l?(0,s.jsxs)("div",{onClick:()=>o7(t),className:"relative w-full aspect-square cursor-pointer rounded-sm overflow-hidden bg-black ".concat(t===r9?"ring-2 ring-purple-500":"opacity-70 hover:opacity-100"),children:[e.thumbnail_url?(0,s.jsx)("img",{src:e.thumbnail_url,className:"w-full h-full object-cover",alt:"Video thumbnail"}):(0,s.jsx)("div",{className:"w-full h-full bg-gradient-to-br from-gray-800 to-black"}),(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,s.jsx)("div",{className:"w-8 h-8 rounded-full bg-white/90 flex items-center justify-center shadow-lg",children:(0,s.jsx)("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"#111",style:{marginLeft:2},children:(0,s.jsx)("polygon",{points:"5,3 19,12 5,21"})})})})]},t):(0,s.jsx)("img",{src:e.thumbnail_url||"/api/media/".concat(e.id,"/thumbnail"),alt:"thumbnail",className:"w-full aspect-square object-cover cursor-pointer rounded-sm ".concat(t===r9?"ring-2 ring-purple-500":"opacity-70 hover:opacity-100"),onClick:()=>o7(t)},t)}
1),nu.map((e,t)=>{var a;let l=null===(a=e.type)||void 0===a?void 0:a.startsWith("video/");return l?(0,s.jsxs)("div",{onClick:()=>{e.message_slug&&ce([e],0,null)},className:"relative w-full aspect-square cursor-pointer rounded-sm overflow-hidden bg-black opacity-50 hover:opacity-90 transition-opacity",children:[e.thumbnail_url?(0,s.jsx)("img",{src:e.thumbnail_url,className:"w-full h-full object-cover",alt:"Video thumbnail"}):(0,s.jsx)("div",{className:"w-full h-full bg-gradient-to-br from-gray-800 to-black"}),(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,s.jsx)("div",{className:"w-6 h-6 rounded-full bg-white/90 flex items-center justify-center",children:(0,s.jsx)("svg",{viewBox:"0 0 24 24",width:"12",height:"12",fill:"#111",style:{marginLeft:1},children:(0,s.jsx)("polygon",{points:"5,3 19,12 5,21"})})})})]},"related-".concat(t)):(0,s.jsx)("img",{src:e.thumbnail_url||"/api/media/".concat(e.id,"/thumbnail"),alt:"related",className:"w-full aspect-square object-cover cursor-pointer rounded-sm opacity-50 hover:opacity-90 transition-opacity",onClick:()=>{e.message_slug&&ce([e],0,null)}},"related-".concat(t))})]})]}),nt&&!nt.startsWith("[song:")&&(0,s.jsx)("div",{className:"mt-8 border-t border-gray-800 pt-4 pb-4",children:ni?(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,s.jsx)("h4",{className:"text-xs font-bold text-gray-500 uppercase",children:ew("gallery.addMore")}),(0,s.jsx)("button",{onClick:()=>no(!1),className:"text-gray-400 hover:text-white text-xs",children:ew("common.cancel")||"Cancel"})]}),(0,s.jsxs)("div",{className:"bg-gray-900 border border-gray-700 rounded-xl p-4",children:[(0,s.jsx)("textarea",{className:"w-full bg-transparent text-white placeholder-gray-500 outline-none resize-none mb-4 text-[16px] sm:text-sm",rows:2,placeholder:ew("gallery.sharePlaceholder"),id:"gallery-tag-upload-text"}),(0,s.jsxs)("div",{className:"bg-gray-800 p-8 rounded-xl border border-gray-700 text-center cursor-pointer hover:bg-gray-750 transition-colors",onClick:()=>!io&&document.getElementById("gallery-tag-file-upload").click(),children:[(0,s.jsx)("div",{className:"w-16 h-16 bg-gray-700 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,s.jsx)(z.Z,{className:"w-8 h-8 text-gray-400"})}),(0,s.jsx)("p",{className:"text-gray-400 text-sm font-semibold mb-1",children:ew("gallery.selectPhotos")}),(0,s.jsx)("p",{className:"text-gray-500 text-xs italic",children:ew("gallery.mediaSizeWarning")}),(0,s.jsx)("input",{type:"file",multiple:!0,accept:"image/*,video/*",className:"hidden",id:"gallery-tag-file-upload",disabled:io,onChange:e=>{let t=e.target.files.length,a=document.getElementById("gallery-tag-file-count");a&&(a.innerText=t>0?"".concat(t," files selected"):"")}}),(0,s.jsx)("p",{id:"gallery-tag-file-count",className:"text-purple-400 text-sm mt-2 font-bold"})]}),(0,s.jsx)("button",{className:"w-full bg-purple-600 hover:bg-purple-700 disabled:opacity-50 text-white font-bold py-3 rounded-lg uppercase transition-colors flex items-center justify-center gap-2",disabled:io,onClick:async()=>{if(!te||"complete"!==ta){ek.push("/");return}if(io)return;let e=document.getElementById("gallery-tag-file-upload"),t=document.getElementById("gallery-tag-upload-text"),a=Array.from(e.files||[]),s=t&&t.value||"";if(nt&&nt.startsWith("[song:")&&!s.includes(nt)&&(s=s?"".concat(s,"\n\n").concat(nt):nt),0===a.length&&""===s.trim())return alert("Add text or media!");ic(!0);try{let l=[];a.length>0&&(l=await Promise.all(a.map(e=>b(e))));let r=await iK("/api/messages",{method:"POST",body:JSON.stringify({content:s,title:nt,media:l,channelSlug:null})});e.value="",t&&(t.value="");let n=document.getElementById("gallery-tag-file-count");n&&(n.innerText=""),no(!1),rV(!1),r&&r.slug?ek.push("/".concat(r.slug,"?gallery=false")):"tag"===t$&&a$?await i2(a$,0):"single-post"===t$?await i1(t3):"profile"===t$?await i8(at):"board"===t$?await iQ(sv,0):await i4(0)}catch(e){console.error("Upload failed:",e),alert("Upload failed: "+e.message)}finally{ic(!1)}},children:io?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.Z,{className:"w-5 h-5 animate-spin"})," ",ew("newPost.uploadingMedia")]}):ew("gallery.upload")})]})]}):(0,s.jsxs)("button",{onClick:()=>
1{if(!te||"complete"!==ta){ek.push("/");return}no(!0)},className:"w-full py-2.5 px-4 bg-gray-800 hover:bg-gray-700 border border-gray-700 rounded-xl text-sm font-semibold text-gray-300 hover:text-white flex items-center justify-center gap-2 transition-colors",children:[(0,s.jsx)(z.Z,{className:"w-4 h-4 text-purple-400"}),(0,s.jsx)("span",{children:ew("gallery.addMore")||"Add Photo to Gallery"})]})})]})})]})]})},co=te&&"complete"===ta,cc="guest"!==ta&&"loading"!==ta&&!co;if((0,l.useEffect)(()=>{let e=e=>{if(rJ){if("private-album"===t$)return;let t=e.split("/").pop().split("?")[0],a=rG.findIndex(e=>e.message_slug===t);-1!==a?ne(a):rV(!1)}};return ek.events.on("routeChangeComplete",e),()=>{ek.events.off("routeChangeComplete",e)}},[rJ,rG,ek,t$]),(0,l.useEffect)(()=>{if(rJ&&rG.length>0){var e;let t=null===(e=rG[r9])||void 0===e?void 0:e.message_slug;if(t){let e=[...Object.values(sj).flat(),...n8,...(null==as?void 0:as.posts)||[],...t8?[t8,...t8.replies||[]]:[],...aX,...sr,...Object.values(nh||{})],a=e.find(e=>e.slug===t);a||nf[t]||nh[t]||(nb(e=>({...e,[t]:!0})),iq("/api/messages/".concat(t,"?noRedirect=true")).then(e=>{ng(a=>({...a,[t]:e}))}).catch(e=>console.error("Failed to load gallery detail",e)).finally(()=>{nb(e=>({...e,[t]:!1}))}))}}},[rJ,r9,rG]),rs||"loading"===ta)return(0,s.jsxs)("div",{className:"flex items-center justify-center min-h-screen bg-black",children:[(0,s.jsx)("style",{children:cr}),(0,s.jsx)(w.Z,{className:"w-8 h-8 text-purple-500 animate-spin"})]});if(cc)return(0,s.jsxs)("div",{className:"min-h-screen flex flex-col bg-black overflow-y-auto",children:[(0,s.jsxs)("div",{className:"flex flex-1 items-center justify-center min-h-[100dvh] py-8 px-3 sm:px-4 bg-cover bg-center bg-no-repeat relative",style:{backgroundImage:"en"===eN||"es"===eN?"url('/landing/hero-bg-en.jpg')":"url('/landing/hero-bg-tr.jpg')"},children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),(0,s.jsx)("style",{children:cr}),(0,s.jsxs)("div",{className:"w-full max-w-md p-5 sm:p-8 bg-gray-900/80 backdrop-blur-md border border-white/10 rounded-2xl shadow-2xl relative z-10",children:[(0,s.jsxs)("div",{className:"text-center mb-6",children:["tr"!==eN?(0,s.jsx)("img",{src:"/meetspace.png",alt:"MeetSpace",className:"h-10 w-auto mx-auto mb-4 drop-shadow-lg object-contain"}):(0,s.jsx)(eM.Z,{className:"w-10 h-10 mx-auto mb-4 text-purple-400 drop-shadow-lg"}),(0,s.jsx)("h1",{className:"text-2xl sm:text-3xl font-bold text-white mb-2 tracking-tight",children:ew("auth.getStartedForFree")||ew("newPost.messageBoards")}),(0,s.jsx)("p",{className:"text-gray-400",children:"phone"===ta?ew("auth.pleaseEnterMobile")||ew("auth.enterPhone"):"ovrtxt"===ta?(0,s.jsx)(s.Fragment,{}):"otp"===ta?ew("auth.enterCode"):ew("auth.completeProfile")})]}),tA&&(0,s.jsx)("div",{className:"mb-4 p-3 bg-red-500/10 border border-red-500/50 rounded-lg text-red-200 text-sm backdrop-blur-sm",children:tA}),"phone"===ta&&("en"!==eN&&"es"!==eN||tz?(0,s.jsxs)("div",{children:[tz&&("en"===eN||"es"===eN)&&(0,s.jsxs)("button",{type:"button",onClick:()=>{tB(!1),tF("")},className:"mb-4 text-gray-400 hover:text-white flex items-center gap-2 text-sm transition-colors cursor-pointer",children:[(0,s.jsx)(eO.Z,{className:"w-4 h-4"}),ew("common.back")||"Back"]}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:ew("auth.phoneNumber")}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("div",{className:"flex-none px-4 flex items-center justify-center bg-gray-800/50 border border-gray-600 rounded-xl text-white font-medium select-none",children:"tr"===eN?"+90":"+1"}
1),(0,s.jsx)("input",{autoFocus:!0,type:"tel",value:tN,onChange:e=>{tk(iD(e.target.value,eN))},onKeyPress:e=>"Enter"===e.key&&od(tz),placeholder:"tr"===eN?"532 123 45 67":"(555) 123-4567",className:"w-full px-4 py-3 bg-gray-800/50 border border-gray-600 rounded-xl text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent transition-all",disabled:tE})]})]}),(0,s.jsx)("button",{onClick:()=>od(tz),disabled:tE||!iT(tN),className:"w-full py-3 bg-purple-600 hover:bg-purple-500 text-white rounded-xl shadow-lg hover:shadow-purple-500/25 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 font-medium transition-all duration-200",children:tE?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.Z,{className:"w-5 h-5 animate-spin"}),ew("auth.sending")]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(W.Z,{className:"w-5 h-5"}),ew("auth.continue")||ew("auth.sendCode")]})})]}):(0,s.jsx)("div",{className:"space-y-4",children:(0,s.jsx)("button",{onClick:()=>oc(),disabled:tE,className:"w-full py-4 bg-gradient-to-r from-purple-600 to-indigo-600 hover:from-purple-500 hover:to-indigo-500 text-white rounded-xl shadow-lg hover:shadow-purple-500/25 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2.5 font-bold text-lg tracking-wide transition-all duration-200",children:tE?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.Z,{className:"w-5 h-5 animate-spin"}),ew("auth.sending")]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(_.Z,{className:"w-5 h-5 fill-current text-amber-300"}),ew("auth.letsGo")||"Let's go"]})})})),"ovrtxt"===ta&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("button",{onClick:()=>{tK(),tB(!1),ts("phone"),tP(null),tF("")},className:"mb-4 text-gray-400 hover:text-white flex items-center gap-2 text-sm transition-colors cursor-pointer",children:[(0,s.jsx)(eO.Z,{className:"w-4 h-4"}),"en"===eN||"es"===eN?ew("common.back")||"Back":ew("common.changeNumber")||"Back"]}),(0,s.jsx)("div",{id:"sms-container",children:"messages"===tT?(0,s.jsxs)("div",{id:"view-messages",className:"space-y-4 mb-6",children:[(null==tZ?void 0:tZ.fallbackUri)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"p-4 bg-purple-500/10 border border-purple-500/30 rounded-xl text-center",children:[(0,s.jsx)(eM.Z,{className:"w-10 h-10 mx-auto text-purple-400 mb-2 animate-pulse"}),(0,s.jsx)("p",{className:"text-sm font-semibold text-white mb-1",children:ew("auth.tapToVerify")}),(0,s.jsx)("p",{className:"text-xs text-gray-300 whitespace-pre-line",children:ew("auth.waitingVerificationDesc")})]}),(0,s.jsxs)("a",{id:"messages-link",href:e7(tZ.fallbackUri,ew("auth.tapSendToLogin")||e8[eN]||e8.en),className:"w-full py-3.5 bg-gradient-to-r from-emerald-600 to-green-600 hover:from-emerald-500 hover:to-green-500 text-white rounded-xl shadow-lg hover:shadow-emerald-500/25 flex items-center justify-center gap-2 font-medium transition-all duration-200 text-center select-none cursor-pointer",children:[(0,s.jsx)(et.Z,{className:"w-5 h-5"}),ew("auth.openInMessages")||"Open in Messages"]})]}):(0,s.jsxs)("div",{className:"p-6 bg-purple-500/10 border border-purple-500/30 rounded-xl text-center",children:[(0,s.jsx)(w.Z,{className:"w-8 h-8 mx-auto text-purple-400 mb-3 animate-spin"}),(0,s.jsx)("p",{className:"text-sm font-semibold text-white mb-1",children:ew("auth.waitingVerification")}),(0,s.jsx)("p",{className:"text-xs text-gray-300 whitespace-pre-line",children:ew("auth.waitingVerificationDesc")})]}),(0,s.jsx)("button",{type:"button",onClick:oi,disabled:tU,className:"w-full py-2.5 text-sm text-purple-400 hover:text-purple-300 hover:underline flex items-center justify-center gap-1.5 transition-colors cursor-pointer",children:tU?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.Z,{className:"w-4 h-4 animate-spin text-purple-400"}),(0,s.jsx)("span",{children:ew("auth.sending")||"Sending..."})]}):(0,s.jsx)("span",{children:ew("auth.sendCodeViaSms")||"Send code via SMS"})}),(0,s.jsxs)("div",{className:"flex items-center justify-center gap-2 text-xs text-gray-400 pt-1",children:[(0,s.jsx)(w.Z,{className:"w-3.5 h-3.5 animate-spin text-purple-400"}),(0,s.jsx)("span",{children:ew("auth.waitingVerification")})]})]}):(0,s.jsxs)("div",{id:"view-otp",className:"space-y-4 mb-6",children:[(0,s.jsx)("p",{className:"text-sm text-gray-300",children:ew("auth.enterSixDigitCode")||"Enter the 6-digit code sent to your phone:"}),(0,s.jsx)("input",{id:"otp-code",type:"text",autoFocus:!0,maxLength:6,inputMode:"numeric",placeholder:"123456",value:t_,onChange:e=>{let t=e.target.value.replace(/[^\d]/g,"").slice(0,6);tM(t)},onKeyDown:e=>{"Enter"===e.key&&6===t_.trim().length&&oo()},className:"w-full px-4 py-3.5 bg-gray-800/80 border border-gray-700/80 focus:border-purple-500 rounded-xl text-white text-center text-2xl tracking-[0.3em] font-mono outline-none transition-all placeholder:text-gray-500 placeholder:tracking-normal placeholder:text-lg"}),(0,s.jsx)("button",{type:"button",onClick:oo,disabled:tO||t_.length<6,className:"w-full py-3.5 bg-gradient-to-r from-red-600 to-rose-600 hover:from-red-500 hover:to-rose-500 disabled:opacity-50 disabled:cursor-not-allowed text-white rounded-xl shadow-lg hover:shadow-red-500/25 flex items-center justify-center gap-2 font-medium transition-all duration-200 text-center select-none cursor-pointer",children:tO?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.Z,{className:"w-5 h-5 animate-spin"}),ew("auth.verifying")||"Verifying..."]}):ew("auth.verifyCode")||"Verify Code"}),(0,s.jsx)("button",{type:"button",onClick:()=>{tF(""),tD("messages")},className:"w-full py-2 text-sm text-gray-400 hover:text-white flex items-center justify-center gap-1.5 transition-colors cursor-pointer",children:ew("auth.backToMessages")||"← Open in Messages instead"})]})})]}),"otp"===ta&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("button",{onClick:()=>{tB(!1),ts("phone"),tC(""),tF("")},className:"mb-4 text-gray-400 hover:text-white flex items-center gap-2 text-sm transition-colors",children:[(0,s.jsx)(eO.Z,{className:"w-4 h-4"}),ew("common.changeNumber")]}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:ew("auth.verificationCode")}
1),(0,s.jsx)("input",{autoFocus:!0,type:"text",inputMode:"numeric",value:tS,onChange:e=>tC(e.target.value.replace(/[^\d]/g,"").slice(0,6)),onKeyPress:e=>"Enter"===e.key&&ou(),placeholder:"123456",maxLength:6,className:"w-full px-4 py-3 bg-gray-800/50 border border-gray-600 rounded-xl text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-purple-500 text-center text-2xl tracking-widest font-mono transition-all",disabled:tE}),(0,s.jsxs)("p",{className:"text-xs text-gray-400 mt-4 text-center",children:[ew("auth.legalAgree"),(0,s.jsx)("a",{href:"/terms-of-service",target:"_blank",rel:"noopener noreferrer",className:"text-purple-400 hover:underline",children:ew("auth.termsOfService")}),ew("auth.and"),(0,s.jsx)("a",{href:"/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"text-purple-400 hover:underline",children:ew("auth.privacyPolicy")}),"."]})]}),(0,s.jsx)("button",{onClick:ou,disabled:tE||6!==tS.length,className:"w-full py-3 bg-purple-600 hover:bg-purple-500 text-white rounded-xl shadow-lg hover:shadow-purple-500/25 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 font-medium transition-all duration-200",children:tE?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.Z,{className:"w-5 h-5 animate-spin"}),ew("auth.verifying")]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eH.Z,{className:"w-5 h-5"}),ew("auth.verify")]})})]}),"onboarding"===ta&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsxs)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:[ew("auth.name")," *"]}
1),(0,s.jsx)("input",{autoFocus:!0,type:"text",value:tq,onChange:e=>tH(e.target.value),placeholder:"John Doe",className:"w-full px-4 py-3 bg-gray-800/50 border border-gray-600 rounded-xl text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-purple-500 transition-all",disabled:tE})]}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsxs)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:[ew("auth.emailAddress")," *"]}),(0,s.jsx)("input",{type:"email",value:tJ,onChange:e=>tV(e.target.value),placeholder:"[email protected]",className:"w-full px-4 py-3 bg-gray-800/50 border border-gray-600 rounded-xl text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-purple-500 transition-all",disabled:tE})]}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsxs)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:[ew("auth.username")," * (",ew("auth.usernameRequirements"),")"]}),(0,s.jsx)("input",{type:"text",value:tG,onChange:e=>tY(e.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"")),placeholder:"johndoe",className:"w-full px-4 py-3 bg-gray-800/50 border border-gray-600 rounded-xl text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-purple-500 transition-all",disabled:tE}),nT&&(0,s.jsx)("p",{className:"mt-2 text-sm ".concat(iL(nT.status)),children:nT.message})]}),(0,s.jsx)("button",{onClick:om,disabled:tE||!tq.trim()||!tJ.trim()||!tG.trim()||iR(null==nT?void 0:nT.status),className:"w-full py-3 bg-purple-600 hover:bg-purple-500 text-white rounded-xl shadow-lg hover:shadow-purple-500/25 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 font-medium transition-all duration-200",children:tE?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.Z,{className:"w-5 h-5 animate-spin"}),ew("auth.saving")]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(T.Z,{className:"w-5 h-5"}),ew("auth.completeSetup")]})})]})]})]}),"en"===eN&&("/"===ek.pathname||"/"===ek.asPath||"/en"===ek.asPath||(null==eb?void 0:eb.tab)==="following")&&(0,s.jsx)(ea,{}),ir&&((null===(B=ir.titles)||void 0===B?void 0:B.length)>0||"tr"!==eN&&(null===(K=ir.popularEvents)||void 0===K?void 0:K.length)>0)&&(0,s.jsxs)("div",{className:"bg-gray-900 py-16 px-6",children:["tr"!==eN&&ir.popularEvents&&ir.popularEvents.length>0&&(0,s.jsxs)("div",{className:"max-w-5xl mx-auto ".concat(ir.titles&&ir.titles.length>0?"mb-16":""),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,s.jsx)("h2",{className:"text-xl font-bold text-white text-left",children:"Popular Events"}),(0,s.jsx)("a",{href:"/events",className:"text-sm font-medium text-purple-400 hover:text-purple-300 transition-colors",children:"See All Events →"})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-4",children:ir.popularEvents.map((e,t)=>(0,s.jsxs)("a",{href:"/e/".concat(e.id),className:"bg-gray-800 rounded-xl overflow-hidden shadow-md hover:shadow-purple-500/20 transition-all hover:-translate-y-1 block border border-gray-700 group",children:[(0,s.jsxs)("div",{className:"h-32 bg-gray-700 relative overflow-hidden",children:[e.photo?(0,s.jsx)("img",{src:e.photo,alt:e.title,className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-110"}):(0,s.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-purple-900/30",children:(0,s.jsx)(eL.Z,{className:"w-8 h-8 text-purple-500/50"})}),(0,s.jsx)("div",{className:"absolute top-2 left-2 bg-black/60 backdrop-blur-md px-2 py-1 rounded text-xs font-semibold text-white",children:new Date(e.date).toLocaleDateString(eN,{month:"short",day:"numeric"})})]}),(0,s.jsx)("div",{className:"p-4",children:(0,s.jsx)("h3",{className:"font-bold text-white text-sm line-clamp-2 mb-1 group-hover:text-purple-400 transition-colors",children:e.title})})]},t))})]}),ir.titles&&ir.titles.length>0&&(0,s.jsxs)("div",{className:"max-w-5xl mx-auto",children:[(0,s.jsx)("h2",{className:"text-xl font-bold text-white mb-6 text-left",children:ew("pages.discoverTopics")||"Discover Topics"}),(0,s.jsx)("div",{className:"flex flex-wrap justify-start gap-3",children:ir.titles.map((e,t)=>(0,s.jsx)("a",{href:"/tag/".concat(o3(e)),target:"_blank",rel:"noopener noreferrer",className:"cursor-pointer bg-gray-800 hover:bg-gray-700 text-gray-300 px-4 py-2 rounded-full text-sm font-medium transition-colors",children:e.toLowerCase()},t))})]})]})]});let cd=te&&tl&&"complete"===ta;if("about"===t$)return(0,s.jsxs)("div",{className:"min-h-screen bg-black text-white flex flex-col",children:[(0,s.jsx)("style",{children:cr}),cn(),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,s.jsx)(q,{isAuthenticated:te,autotarihok:null==tl?void 0:tl.autotarihok})}),ci()]});if("groups-list"===t$){let e="/"===ek.pathname||"/"===ek.asPath||"/en"===ek.asPath||"/es"===ek.asPath||"/tr"===ek.asPath,t=eS({locale:eN,titleKey:e?"pages.homeTitle":"pages.messageBoards",path:e?"/":(null==ek?void 0:null===(J=ek.asPath)||void 0===J?void 0:J.split("?")[0])||""});return(0,s.jsxs)("div",{className:"min-h-screen bg-black text-white",children:[(0,s.jsxs)(i(),{children:[(0,s.jsx)("title",{children:t.title}),(0,s.jsx)("meta",{property:"og:title",content:t.title},"og:title")]}),(0,s.jsx)("style",{children:cr}),cn(),(0,s.jsxs)("div",{className:"flex max-w-5xl mx-auto",children:[(0,s.jsx)("aside",{className:"hidden md:block w-64 p-6 border-r border-gray-800 min-h-[calc(100vh-80px)]",children:(0,s.jsxs)("nav",{className:"space-y-2",children:[(0,s.jsx)("button",{onClick:e=>{if(!te&&"tr"!==eN){"/"!==ek.pathname&&ek.push("/");return}n2("following")},className:"w-full text-left px-4 py-2 rounded-lg font-medium transition-colors ".concat("following"===n1?"bg-purple-600 text-white":"text-gray-400 hover:bg-gray-800 hover:text-white"),children:ew("pages.feedTab")}),(0,s.jsx)("button",{onClick:e=>{if(!te){"/"!==ek.pathname&&ek.push("/");return}n2("groups")},className:"w-full text-left px-4 py-2 rounded-lg font-medium transition-colors ".concat("groups"===n1?"bg-purple-600 text-white":"text-gray-400 hover:bg-gray-800 hover:text-white"),children:ew("groups.groups")}),"tr"!==eN&&(0,s.jsx)("button",{onClick:()=>n2("events"),className:"w-full text-left px-4 py-2 rounded-lg font-medium transition-colors ".concat("events"===n1?"bg-purple-600 text-white":"text-gray-400 hover:bg-gray-800 hover:text-white"),children:"Events"}),(0,s.jsx)("button",{onClick:e=>{if(!te){"/"!==ek.pathname&&ek.push("/");return}n2("private_albums")},className:"w-full text-left px-4 py-2 rounded-lg font-medium transition-colors ".concat("private_albums"===n1?"bg-purple-600 text-white":"text-gray-400 hover:bg-gray-800 hover:text-white"),children:ew("pages.privateAlbums")})]})}),(0,s.jsxs)("main",{className:"flex-1 p-0 md:p-6",children:[(0,s.jsxs)("div",{className:"md:hidden flex border-b border-gray-800 mb
1-6",children:[(0,s.jsx)("button",{onClick:e=>{if(!te&&"tr"!==eN){"/"!==ek.pathname&&ek.push("/");return}n2("following")},className:"flex-1 py-3 font-medium text-center border-b-2 ".concat("following"===n1?"border-purple-500 text-purple-500":"border-transparent text-gray-400"),children:ew("pages.feedTab")}),(0,s.jsx)("button",{onClick:e=>{if(!te){"/"!==ek.pathname&&ek.push("/");return}n2("groups")},className:"flex-1 py-3 font-medium text-center border-b-2 ".concat("groups"===n1?"border-purple-500 text-purple-500":"border-transparent text-gray-400"),children:ew("groups.groups")}),"tr"!==eN&&(0,s.jsx)("button",{onClick:()=>n2("events"),className:"flex-1 py-3 font-medium text-center border-b-2 ".concat("events"===n1?"border-purple-500 text-purple-500":"border-transparent text-gray-400"),children:"Events"}),(0,s.jsx)("button",{onClick:e=>{if(!te){"/"!==ek.pathname&&ek.push("/");return}n2("private_albums")},className:"flex-1 py-3 font-medium text-center border-b-2 ".concat("private_albums"===n1?"border-purple-500 text-purple-500":"border-transparent text-gray-400"),children:ew("pages.privateAlbums")})]}),"following"===n1?(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)("h2",{className:"text-xl font-bold mb-4 px-4 md:px-0",children:ew("pages.yourTimeline")}),("tr"===eN?te:tc>=5)&&(0,s.jsx)("div",{className:"mb-6 mx-4 md:mx-0 p-3 bg-gray-800 rounded-lg border border-gray-700",children:(0,s.jsx)(k,{onSend:oY,placeholder:ew("newPost.placeholder"),showTitle:!0,disabled:!1,submitLabel:ew("common.post")})}),"tr"!==eN&&tc<5?(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"text-center py-12 bg-gray-800 rounded-xl mb-6 mx-4 md:mx-0 border border-gray-700 shadow-lg",children:[(0,s.jsx)(M.Z,{className:"w-16 h-16 mx-auto mb-4 text-gray-500"}),(0,s.jsxs)("p",{className:"text-gray-300 font-medium mb-6 px-4",children:["You’re not following anyone on MeetSpace yet.",(0,s.jsx)("br",{}),"Get started by following 5 accounts or inviting 5 people."]}),(0,s.jsxs)("div",{className:"max-w-md mx-auto px-4",children:[(0,s.jsx)("input",{type:"text",value:tu,onChange:e=>tm(e.target.value),onKeyDown:oI,placeholder:"Enter email or phone number to invite a friend",className:"w-full bg-gray-900 border border-gray-700 rounded-lg p-3 text-sm text-white focus:outline-none focus:border-purple-500",disabled:tf}),tf&&(0,s.jsx)("p",{className:"text-purple-400 text-sm mt-2 animate-pulse",children:"Sending invites..."}),tp.length>0&&(0,s.jsxs)("div",{className:"mt-6 text-left bg-gray-900/50 p-4 rounded-xl border border-gray-800",children:[(0,s.jsxs)("p",{className:"text-sm text-gray-400 mb-3 font-medium",children:["Invited (",tp.length,"):"]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:tp.map(e=>(0,s.jsx)("span",{className:"bg-gray-800 border border-gray-700 text-gray-200 px-3 py-1.5 rounded-lg text-xs font-medium",children:e.title},e.id))})]})]})]}),ir&&ir.brandsAndCreatives&&ir.brandsAndCreatives.length>0&&(0,s.jsxs)("section",{className:"mt-8 px-4 md:px-0",children:[(0,s.jsx)("h2",{className:"text-xl font-bold text-white mb-4",children:"Brands & Creatives"}),(0,s.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4",children:ir.brandsAndCreatives.map(e=>(0,s.jsxs)("div",{className:"bg-gray-800 rounded-xl p-5 text-center border border-gray-700 flex flex-col items-center shadow-md",children:[(0,s.jsxs)("a",{href:"/".concat(e.slug),className:"block transition-transform hover:scale-105 mb-4 group",children:[(0,s.jsx)("img",{src:e.avatar||"https://cdn.qrsite.app/rnbw/nophoto.png",alt:e.name,className:"w-20 h-20 mx-auto rounded-full object-cover mb-3 border-2 border-gray-700 group-hover:border-purple-500 transition-colors"}),(0,s.jsx)("h3",{className:"text-white font-bold text-sm truncate w-full max-w-[120px]",children:e.name}),(0,s.jsxs)("p",{className:"text-gray-400 text-xs truncate w-full max-w-[120px]",children:["@",e.slug]})]}),(0,s.jsx)("button",{disabled:e.is_following||th.has(e.slug),onClick:t=>{t.preventDefault(),e.is_following||th.has(e.slug)||(tg(new Set(th).add(e.slug)),oE(e.slug))},className:"px-6 py-1.5 rounded-md font-bold text-xs transition-colors ".concat(e.is_following||th.has(e.slug)?"bg-gray-700 text-gray-400 cursor-not-allowed":"bg-white text-black hover:bg-gray-200"),children:e.is_following||th.has(e.slug)?"Following":"Follow"})]},e.id))})]})]}):0!==n8.length||is?(0,s.jsxs)("div",{className:"space-y-4",children:[n8.map(e=>(0,s.jsx)("div",{className:"bg-gray-800 rounded-xl p-4",children:cl({message:e,showChannelContext:!0,allowInteractions:cd,context:"board"})},e.id)),is&&(0,s.jsx)("div",{className:"flex justify-center py-4",children:(0,s.jsx)(w.Z,{className:"w-6 h-6 text-purple-500 animate-spin"})}),it&&(0,s.jsx)("div",{ref:iF,className:"h-4 w-full"}),it&&(0,s.jsx)("noscript",{children:(0,s.jsx)("a",{href:"?page=".concat(n9+1),className:"block text-center mt-4 px-6 py-2 bg-purple-600 hover:bg-purple-700 rounded-lg text-white mx-auto w-max",style:{display:"block",margin:"1rem auto"},children:ew("common.loadMore")||"Next Page"})})]}):(0,s.jsx)("div",{className:"text-center py-12 bg-gray-800 rounded-xl mb-6 mx-4 md:mx-0 border border-gray-700",children:(0,s.jsx)("p",{className:"text-gray-400",children:"Your feed is empty. Follow more people to see updates here!"})})]}):"about"===t$?(0,s.jsx)("div",{className:"w-full h-full overflow-y-auto",children:(0,s.jsx)(q,{isAuthenticated:te,autotarihok:null==tl?void 0:tl.autotarihok})}):"private_albums"===n1?(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)("h2",{className:"text-xl font-bold mb-4 px-4 md:px-0",children:ew("pages.privateAlbums")}),(0,s.jsxs)("div",{className:"bg-gray-800 border border-gray-700 rounded-xl p-4 mx-4 md:mx-0 mb-6 flex items-start gap-3",children:[(0,s.jsx)("div",{className:"mt-1",children:(0,s.jsx)(eJ.Z,{className:"w-5 h-5 text-purple-400"})}),(0,s.jsx)("p",{className:"text-sm text-gray-300",children:ew("pages.privateAlbumsInfo")})]}),n3?(0,s.jsx)("div",{className:"flex justify-center py-8",children:(0,s.jsx)(w.Z,{className:"w-8 h-8 animate-spin text-purple-500"})}):n5.length>0?(0,s.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mb-8 px-4 md:px-0",children:n5.map(e=>(0,s.jsxs)("a",{href:"/private/".concat(e.slug),className:"group relative aspect-square bg-gray-800 rounded-xl overflow-hidden block",children:[e.cover_image?(0,s.jsx)("img",{src:ct(e.cover_image)||e.cover_image.original,alt:e.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform"}):(0,s.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-gray-800 border-2 border-dashed border-gray-700",children:(0,s.jsx)("span",{className:"text-gray-500 text-sm",children:"No cover"})}),(0,s.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/20 to-transparent flex flex-col justify-end p-4",children:(0,s.jsx)("h3",{className:"text-white font-bold truncate",children:e.title||"Untitled"})})]},e.id))}):null,(0,s.jsxs)("div",{className:"mt-8 border-t border-gray-800 pt-6 px-4 md:px-0",children:[(0,s.jsx)("h4",{className:"text-xs font-bold text-gray-500 mb-3 uppercase",children:ew("pages.createNewPrivateAlbum")}),ti?(0,s.jsxs)("div",{className:"bg-gray-900 border border-gray-700 rounded-xl p-4",children:[(0,s.jsx)("input",{type:"text",className:"w-full bg-transparent text-white placeholder-gray-500 outline-none border-b border-gray-700 pb-2 mb-4",placeholder:ew("gallery.title")||"Title",id:"album-upload-text"}),(0,s.jsxs)("div",{className:"bg-gray-800 p-8 rounded-xl border border-gray-700 text-center cursor-pointer hover:bg-gray-750 transition-colors",onClick:()=>
1{if(!te||"complete"!==ta){ek.push("/");return}io||document.getElementById("album-file-upload").click()},children:[(0,s.jsx)("div",{className:"w-16 h-16 bg-gray-700 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,s.jsx)(z.Z,{className:"w-8 h-8 text-gray-400"})}),(0,s.jsx)("p",{className:"text-gray-400 text-sm font-semibold mb-1",children:ew("gallery.selectPhotosAlbum")}),(0,s.jsx)("p",{className:"text-gray-500 text-xs italic",children:ew("gallery.mediaSizeWarning")}),(0,s.jsx)("input",{type:"file",multiple:!0,accept:"image/*,video/*",className:"hidden",id:"album-file-upload",disabled:io,onChange:e=>{let t=e.target.files.length,a=document.getElementById("album-file-count");a&&(a.innerText=t>0?"".concat(t," files selected"):"")}}),(0,s.jsx)("p",{id:"album-file-count",className:"text-purple-400 text-sm mt-2 font-bold"})]}),(0,s.jsx)("button",{className:"w-full mt-4 bg-purple-600 hover:bg-purple-700 disabled:opacity-50 text-white font-bold py-3 rounded-lg uppercase transition-colors flex items-center justify-center gap-2",disabled:io,onClick:i6,children:io?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.Z,{className:"w-5 h-5 animate-spin"})," ",ew("newPost.uploadingMedia")]}):ew("newPost.send")})]}):(0,s.jsxs)("div",{className:"bg-gray-900 border border-gray-700 rounded-xl p-6 text-center",children:[(0,s.jsx)("div",{className:"w-16 h-16 bg-purple-500/10 border border-purple-500/20 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,s.jsx)(H.Z,{className:"w-8 h-8 text-purple-400"})}),(0,s.jsx)("h3",{className:"text-xl font-bold mb-2",children:"Unlock Private Albums"}),(0,s.jsx)("p",{className:"text-gray-400 mb-6 text-sm max-w-md mx-auto",children:"Private albums allow you to securely share photos with select individuals. Upgrade to MeetSpace+ to start creating unlimited private albums with lifetime cloud space."}),(0,s.jsx)("button",{onClick:()=>ek.push("/plus"),className:"px-6 py-3 bg-purple-600 text-white font-bold rounded-xl hover:bg-purple-700 transition-colors shadow-[0_0_20px_rgba(147,51,234,0.3)]",children:"Upgrade to MeetSpace+"})]})]})]}):"events"===n1?(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)("h2",{className:"text-xl font-bold mb-4 px-4 md:px-0",children:"Upcoming Events"}),aN?(0,s.jsx)("div",{className:"text-center text-gray-500 py-12 bg-gray-800 rounded-xl mx-4 md:mx-0",children:(0,s.jsx)(w.Z,{className:"w-8 h-8 animate-spin text-purple-500 mx-auto"})}):0===aj.length?(0,s.jsxs)("div",{className:"text-center text-gray-500 py-12 bg-gray-800 rounded-xl mx-4 md:mx-0",children:[(0,s.jsx)(eL.Z,{className:"w-16 h-16 mx-auto mb-4 opacity-50"}),(0,s.jsx)("p",{children:"No upcoming events found"})]}):(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 px-4 md:px-0",children:aj.map(e=>(0,s.jsxs)("a",{href:"/e/".concat(e.id),className:"bg-gray-800 rounded-xl overflow-hidden border border-gray-700 hover:border-purple-500/50 transition-colors block relative group cursor-pointer",children:[(0,s.jsx)("div",{className:"aspect-square w-full relative",children:(0,s.jsx)("img",{src:e.photo||e.avatar||"https://cdn.qrsite.app/rnbw/bratparty.png",alt:e.title,className:"w-full h-full object-cover"})}),(0,s.jsxs)("div",{className:"p-4 space-y-3",children:[(0,s.jsx)("h3",{className:"font-bold text-lg leading-tight",children:e.title}),(0,s.jsxs)("div",{className:"flex items-center text-gray-400 text-sm",children:[(0,s.jsx)(eL.Z,{className:"w-4 h-4 mr-2 text-purple-400"}),(()=>{let t=new Date(e.date);return isNaN(t.getTime())?e.humanDate||e.date||"":t.toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})})()]}),e.place&&(0,s.jsxs)("div",{className:"flex items-center text-gray-400 text-sm",children:[(0,s.jsx)(ez.Z,{className:"w-4 h-4 mr-2 text-purple-400"}),(0,s.jsx)("span",{className:"truncate",children:e.place})]})]})]},e.id))})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mb-6 px-4 md:px-0",children:[(0,s.jsx)("h2",{className:"text-xl font-bold mb-2",children:ew("pages.discoverGroups")}),(0,s.jsx)("p",{className:"text-gray-400",children:ew("pages.joinConversationsHint")})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 px-4 md:px-0",children:sp.map(e=>(0,s.jsxs)("button",{onClick:()=>ot(e.slug),className:"bg-gray-800 hover:bg-gray-750 rounded-xl p-6 text-left transition-all hover:scale-105 border border-gray-700",children:[(0,s.jsxs)("div",{className:"flex items-start gap-4 mb-4",children:[e.logo?(0,s.jsx)("img",{src:e.logo,alt:e.name,className:"w-16 h-16 rounded-lg object-cover"}):(0,s.jsx)("div",{className:"w-16 h-16 bg-gradient-to-br from-purple-500 to-purple-500 rounded-lg flex items-center justify-center",children:(0,s.jsx)(e0.Z,{className:"w-8 h-8 text-white"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("h3",{className:"text-lg font-bold text-white mb-1",children:e.name}),(0,s.jsxs)("p",{className:"text-sm text-gray-400",children:[e.memberCount," members"]})]})]}),(0,s.jsx)("p",{className:"text-gray-300 text-sm line-clamp-2",children:e.description}),(0,s.jsxs)("div",{className:"mt-4 flex items-center gap-2",children:[e.is_public?(0,s.jsxs)("span",{className:"flex items-center gap-1 text-xs text-green-400",children:[(0,s.jsx)(e1.Z,{className:"w-3 h-3"}),ew("common.public")]}):(0,s.jsxs)("span",{className:"flex items-center gap-1 text-xs text-yellow-400",children:[(0,s.jsx)(H.Z,{className:"w-3 h-3"}),ew("common.private")]}),1===e.isMember&&(0,s.jsx)("span",{className:"text-xs px-2 py-1 bg-purple-600 rounded",children:ew("common.member")})]})]},e.id))}),!ti&&(0,s.jsx)("div",{className:"mt-8 border-t border-gray-800 pt-6 px-4 md:px-0",children:(0,s.jsxs)("div",{className:"bg-gray-900 border border-gray-700 rounded-xl p-6 text-center",children:[(0,s.jsx)("div",{className:"w-16 h-16 bg-purple-500/10 border border-purple-500/20 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,s.jsx)(H.Z,{className:"w-8 h-8 text-purple-400"})}),(0,s.jsx)("h3",{className:"text-xl font-bold mb-2",children:"Create Your Own Groups"}),(0,s.jsx)("p",{className:"text-gray-400 mb-6 text-sm max-w-md mx-auto",children:"Want to start your own community? Upgrade to MeetSpace+ to create and manage unlimited custom groups for your friends, fans, or team."}),(0,s.jsx)("button",{onClick:()=>ek.push("/plus"),className:"px-6 py-3 bg-purple-600 text-white font-bold rounded-xl hover:bg-purple-700 transition-colors shadow-[0_0_20px_rgba(147,51,234,0.3)]",children:"Upgrade to MeetSpace+"})]})})]})]})]}),ci()]})}if("user-list"===t$){let e="followers"===r3?"profile.followers":"profile.following",t=ew(e),a=eS({locale:eN,title:t});return(0,s.jsxs)("div",{className:"flex flex-col h-screen bg-black text-white overflow-hidden",children:[(0,s.jsxs)(i(),{children:[(0,s.jsx)("title",{children:a.title}),(0,s.jsx)("meta",{property:"og:title",content:a.title},"og:title")]}),(0,s.jsx)("style",{children:cr}),cn(),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto",ref:ij,children:(0,s.jsxs)("div",{className:"max-w-5xl mx-auto w-full p-6",children:[(0,s.jsxs)("div",{className:"mb-6 flex items-center justify-between gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)("button",{onClick:o6,className:"p-2 hover:bg-gray-800 rounded-lg flex items-center justify-center transition-colors",children:(0,s.jsx)(eO.Z,{className:"w-5 h-5"})}),(0,s.jsx)("h1",{className:"text-2xl font-bold",children:t})]}),("followers"===r3||"following"===r3)&&(null==tl?void 0:tl.slug)===r8&&(0,s.jsx)("button",{onClick:()=>ty(!0),className:"text-purple-400 hover:text-purple-300 font-medium text-sm transition-colors px-3 py-1.5 rounded-lg bg-purple-500/10 hover:bg-purple-500/20",children:"Import your contacts"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[r$.map(e=>{var t,a;return(0,s.jsxs)("button",{onClick:()=>oe(e.slug),className:"w-full p-4 bg-gray-800 hover:bg-gray-750 rounded-xl flex items-center gap-4 text-left transition-all",children:[(0,s.jsx)("div",{className:"w-12 h-12 bg-gradient-to-br from-purple-500 to-purple-500 rounded-full flex items-center justify-center flex-shrink-0",children:e.avatar?(0,s.jsx)("img",{src:ct(e.avatar)||e.avatar,alt:e.name,className:"w-full h-full rounded-full object-cover"}):(0,s.jsx)("span",{className:"text-white font-semibold text-lg",children:(null===(a=e.name||"(Anonymous)")||void 0===a?void 0:null===(t=a.charAt(0))||void 0===t?void 0:t.toUpperCase())||"?"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-bold",children:e.name||"(Anonymous)"}),(0,s.jsxs)("p",{className:"text-sm text-gray-400",children:["@",e.slug]})]})]},e.id)}),0===r$.length&&!r5&&(0,s.jsxs)("div",{className:"text-center text-gray-500 py-12 bg-gray-800 rounded-xl",children:[(0,s.jsx)(M.Z,{className:"w-16 h-16 mx-auto mb-4 opacity-50"}),(0,s.jsx)("p",{children:ew("search.noUsersFound")})]}),r5&&(0,s.jsx)("div",{className:"flex justify-center py-8",children:(0,s.jsx)(w.Z,{className:"w-6 h-6 text-purple-500 animate-spin"})}),r1&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{ref:iw,className:"h-4 w-full"}),(0,s.jsx)("noscript",{children:(0,s.jsx)("a",{href:"/".concat(r8,"/").concat(r3,"?page=").concat(rX+1),className:"block text-center mt-4 px-6 py-2 bg-purple-600 hover:bg-purple-700 rounded-lg text-white mx-auto w-max",children:ew("common.loadMore")||"Next Page"})})]})]})]})}),tv&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 bg-black/80 flex items-center justify-center p-4",children:(0,s.jsxs)("div",{className:"bg-gray-900 border border-gray-700 rounded-2xl w-full max-w-lg overflow-hidden shadow-2xl",children:[(0,s.jsxs)("div",{className:"p-6 border-b border-gray-800 flex justify-between items-center",children:[(0,s.jsx)("h3",{className:"text-xl font-bold",children:"Import your contacts"}),(0,s.jsx)("button",{onClick:()=>ty(!1),className:"text-gray-400 hover:text-white transition-colors",children:(0,s.jsx)(c.Z,{className:"w-6 h-6"})})]}),(0,s.jsxs)("div",{className:"p-6",children:[(0,s.jsx)("p",{className:"text-gray-400 mb-4 text-sm",children:"Enter emails or phone numbers, one per line (country codes added if missing). We'll add them to the circle and send a welcome invite."}),(0,s.jsx)("textarea",{value:tu,onChange:e=>tm(e.target.value),placeholder:"e.g. 15551234567 [email protected]",className:"w-full h-40 bg-gray-800 border border-gray-700 rounded-xl p-4 text-white placeholder-gray-500 focus:outline-none focus:border-purple-500 resize-none",disabled:tf}),tp.length>0&&(0,s.jsxs)("div",{className:"mt-4 text-left bg-gray-800 p-4 rounded-xl border border-gray-700",children:[(0,s.jsxs)("p",{className:"text-sm text-gray-400 mb-2 font-medium",children:["Invited (",tp.length,"):"]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:tp.map((e,t)=>(0,s.jsx)("span",{className:"bg-purple-500/20 text-purple-300 text-xs px-2 py-1 rounded",children:e},t))})]}),(0,s.jsxs)("div",{className:"mt-6 flex justify-end gap-3",children:[(0,s.jsx)("button",{onClick:()=>ty(!1),className:"px-6 py-2 rounded-xl text-gray-300 font-medium hover:bg-gray-800 transition-colors",children:"Cancel"}),(0,s.jsxs)("button",{onClick:oA,disabled:tf||!tu.trim(),className:"px-6 py-2 bg-purple-600 hover:bg-purple-700 disabled:opacity-50 text-white font-bold rounded-xl transition-colors flex items-center gap-2",children:[tf&&(0,s.jsx)(w.Z,{className:"w-4 h-4 animate-spin"}),"Import Contacts"]})]})]})]})})]})}if("dm-list"===t$){let e=eS({locale:eN,title:ew("dm.directMessages")});return(0,s.jsxs)("div",{className:"min-h-screen bg-black text-white",children:[(0,s.jsxs)(i(),{children:[(0,s.jsx)("title",{children:e.title}),(0,s.jsx)("meta",{property:"og:title",content:e.title},"og:title")]}),(0,s.jsx)("style",{children:cr}),cn(),(0,s.jsx)("div",{className:"bg-gray-800 border-b border-gray-700 py-4",children:(0,s.jsxs)("div",{className:"max-w-5xl mx-auto px-6 flex items-center justify-between",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold",children:ew("dm.directMessages")}),(0,s.jsxs)("button",{onClick:()=>lP(!0),className:"px-4 py-2 bg-purple-600 hover:bg-purple-700 rounded-lg flex items-center gap-2",children:[(0,s.jsx)(z.Z,{className:"w-5 h-5"}),ew("dm.newMessage")]})]})}),(0,s.jsx)("main",{className:"max-w-5xl mx-auto w-full p-6",children:0===sZ.length?(0,s.jsxs)("div",{className:"text-center text-gray-500 py-12 bg-gray-800 rounded-xl",children:[(0,s.jsx)(eM.Z,{className:"w-16 h-16 mx-auto mb-4 opacity-50"}),(0,s.jsx)("p",{children:ew("dm.noConversations")}),(0,s.jsx)("button",{onClick:()=>lP(!0),className:"mt-4 px-4 py-2 bg-purple-600 hover:bg-purple-700 rounded-lg text-white font-medium transition-colors",children:ew("dm.startConversation")})]}):(0,s.jsx)("div",{className:"space-y-2",children:sZ.map(e=>{var t,a,l,r,n,i;return(0,s.jsx)("button",{onClick:()=>oa(e.slug),className:"w-full p-4 bg-gray-800 hover:bg-gray-750 rounded-xl text-left transition-all",children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"w-12 h-12 bg-gradient-to-br from-purple-500 to-purple-500 rounded-full flex items-center justify-center",children:(null===(t=e.otherUser)||void 0===t?void 0:t.avatar)?(0,s.jsx)("img",{src:ct(e.otherUser.avatar)||e.otherUser.avatar,alt:e.otherUser.name,className:"w-full h-full rounded-full object-cover"}):(0,s.jsx)("span",{className:"text-white font-semibold text-lg",children:(null===(l=e.otherUser)||void 0===l?void 0:null===(a=l.name)||void 0===a?void 0:a.charAt(0))||"?"})}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsxs)("div",{className:"font-semibold flex items-center gap-1.5",children:[(0,s.jsx)("span",{children:null===(r=e.otherUser)||void 0===r?void 0:r.name}),(null===(n=e.otherUser)||void 0===n?void 0:n.publicKey)&&(0,s.jsx)(H.Z,{className:"w-3.5 h-3.5 text-emerald-400 inline shrink-0",title:"End-to-End Encrypted"})]}),(0,s.jsxs)("div",{className:"text-sm text-gray-400",children:["@",null===(i=e.otherUser)||void 0===i?void 0:i.slug]}),e.lastMessage&&(0,s.jsx)("div",{className:"text-sm text-gray-500 mt-1 line-clamp-1",children:e.lastMessage.content})]}),e.lastMessage&&(0,s.jsx)("div",{className:"text-xs text-gray-500",children:o5(e.lastMessage.createdAt)})]})},e.id)})})}),lZ&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",children:(0,s.jsxs)("div",{className:"bg-gray-800 rounded-xl p-6 w-full max-w-md border border-gray-700",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)("h3",{className:"text-xl font-bold",children:ew("dm.newMessage")}),(0,s.jsx)("button",{onClick:()=>{lP(!1),nI(""),nF([])},className:"text-gray-400 hover:text-white",children:(0,s.jsx)(c.Z,{className:"w-5 h-5"})})]}),(0,s.jsx)("div",{className:"mb-4",children:(0,s.jsx)("input",{type:"text",value:nE,onChange:e=>nI(e.target.value),placeholder:ew("search.searchPlaceholder"),className:"w-full px-4 py-2 bg-gray-700 border border-gray-600 rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-purple-500",autoFocus:!0})}),(0,s.jsx)("div",{className:"max-h-64 overflow-y-auto space-y-2",children:nZ?(0,s.jsx)("div",{className:"flex justify-center py-8",children:(0,s.jsx)(w.Z,{className:"w-6 h-6 text-purple-500 animate-spin"})}):nA.length>0?nA.map(e=>{var t;return(0,s.jsx)("button",{onClick:()=>oW(e.slug),className:"w-full p-3 bg-gray-700 hover:bg-gray-600 rounded-lg text-left",children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"w-10 h-10 bg-gradient-to-br from-purple-500 to-purple-500 rounded-full flex items-center justify-center",children:e.avatar?(0,s.jsx)("img",{src:ct(e.avatar)||e.avatar,alt:e.name,className:"w-full h-full rounded-full object-cover"}):(0,s.jsx)("span",{className:"text-white font-semibold",children:(null===(t=e.name)||void 0===t?void 0:t.charAt(0))||"?"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-semibold",children:e.name}),(0,s.jsxs)("div",{className:"text-sm text-gray-400",children:["@",e.slug]})]})]})},e.id)}):nE?(0,s.jsx)("div",{className:"text-center text-gray-500 py-8",children:ew("search.noResults")}):(0,s.jsx)("div",{className:"text-center text-gray-500 py-8",children:ew("dm.typeToSearch")})})]})}),ci()]})}if("dm"===t$&&t5){let e=eS({locale:eN,title:ew("dm.directMessages")
1});return(0,s.jsxs)("div",{className:"flex flex-col h-screen bg-black text-white overflow-hidden",children:[(0,s.jsxs)(i(),{children:[(0,s.jsx)("title",{children:e.title}),(0,s.jsx)("meta",{property:"og:title",content:e.title},"og:title")]}),(0,s.jsx)("style",{children:cr}),cn(),(0,s.jsxs)("div",{className:"flex-1 flex flex-col min-w-0 overflow-hidden",children:[(0,s.jsx)("div",{className:"h-16 bg-gray-800 border-b border-gray-700 flex items-center flex-shrink-0",children:(0,s.jsxs)("div",{className:"max-w-5xl mx-auto w-full px-6 flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("button",{onClick:o6,className:"p-2 hover:bg-gray-700 rounded-lg flex items-center justify-center",children:(0,s.jsx)(eO.Z,{className:"w-5 h-5"})}),(()=>{let e=sZ.find(e=>e.slug===t5);if(e&&e.otherUser){var t;let a=!!e.otherUser.publicKey;return(0,s.jsxs)("a",{href:"/".concat(e.otherUser.slug),className:"flex items-center gap-3 hover:opacity-80 transition-opacity",children:[(0,s.jsx)("div",{className:"w-10 h-10 bg-gradient-to-br from-purple-500 to-purple-500 rounded-full flex items-center justify-center overflow-hidden shrink-0",children:e.otherUser.avatar?(0,s.jsx)("img",{src:ct(e.otherUser.avatar)||e.otherUser.avatar,alt:e.otherUser.name,className:"w-full h-full object-cover"}):(0,s.jsx)("span",{className:"text-white font-semibold",children:(null===(t=e.otherUser.name)||void 0===t?void 0:t.charAt(0))||"?"})}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:e.otherUser.name}),a?(0,s.jsxs)("span",{className:"flex items-center gap-1 text-xs text-emerald-400 font-medium",children:[(0,s.jsx)(H.Z,{className:"w-3 h-3 text-emerald-400"}),(0,s.jsx)("span",{children:"End-to-End Encrypted"})]}):(0,s.jsxs)("span",{className:"text-xs text-gray-400",children:["@",e.otherUser.slug]})]})]})}return(0,s.jsx)("h2",{className:"text-lg font-semibold",children:ew("dm.directMessage")})})()]}),(()=>{var e;let t=sZ.find(e=>e.slug===t5);return(null==t?void 0:null===(e=t.otherUser)||void 0===e?void 0:e.publicKey)?(0,s.jsxs)("div",{className:"flex items-center gap-1.5 px-3 py-1 rounded-full bg-emerald-950/60 border border-emerald-500/30 text-emerald-400 text-xs font-medium",children:[(0,s.jsx)(O.Z,{className:"w-3.5 h-3.5 text-emerald-400"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"E2EE Active"})]}):null})()]})}),(0,s.jsx)("div",{ref:iy,className:"flex-1 overflow-y-auto",children:(0,s.jsxs)("div",{className:"max-w-5xl mx-auto w-full p-6 space-y-4",children:[(0,s.jsx)("div",{ref:ig,className:"h-4 flex items-center justify-center",children:sU&&sO&&(0,s.jsx)(w.Z,{className:"w-5 h-5 text-purple-500 animate-spin"})}),0===sT.length&&!sO&&(0,s.jsxs)("div",{className:"text-center text-gray-500 py-12",children:[(0,s.jsx)(eM.Z,{className:"w-16 h-16 mx-auto mb-4 opacity-50"}),(0,s.jsx)("p",{children:ew("dm.noMessages")})]}),sT.map(e=>{var t,a;let l=tl&&e.userId&&e.userId.toString()===(null===(t=tl.id)||void 0===t?void 0:t.toString());return(0,s.jsx)("div",{className:"group ".concat(l?"flex justify-end":""),id:"msg-".concat(e.slug),children:(0,s.jsxs)("div",{className:"flex gap-3 hover:bg-gray-800/50 px-3 py-2 rounded-lg transition-colors ".concat(l?"flex-row-reverse":""," max-w-[80%]"),children:[(0,s.jsx)("button",{onClick:()=>oe(e.userSlug),className:"w-10 h-10 bg-gradient-to-br from-purple-500 to-purple-500 rounded-full flex items-center justify-center flex-shrink-0 hover:opacity-80 transition-opacity",children:e.userAvatar?(0,s.jsx)("img",{src:ct(e.userAvatar)||e.userAvatar,alt:e.userName,className:"w-full h-full rounded-full object-cover"}):(0,s.jsx)("span",{className:"text-white font-semibold",children:(null===(a=e.userName)||void 0===a?void 0:a.charAt(0))||"?"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-baseline gap-2 mb-1 flex-wrap",children:[(0,s.jsx)("button",{onClick:()=>oe(e.userSlug),className:"font-semibold text-white hover:underline",children:e.userName}),(0,s.jsxs)("span",{className:"text-xs text-gray-500 flex items-center gap-1",children:[(0,s.jsx)("span",{children:o5(e.timestamp)}),e.isEncrypted&&(0,s.jsx)(H.Z,{className:"w-3 h-3 text-emerald-400/80 inline shrink-0",title:"End-to-End Encrypted"})]})]}),e.content&&e.content.trim().length>0&&(0,s.jsx)("div",{className:"text-gray-300 break-words whitespace-pre-wrap",children:o4(e.content)}),e.videoEmbed&&cs({embed:e.videoEmbed}),ca({media:e.media,title:e.title})]})]})},e.id)}),(0,s.jsx)("div",{ref:ih})]})}),(0,s.jsx)("div",{className:"bg-gray-800 border-t border-gray-700 flex-shrink-0",children:(0,s.jsx)("div",{className:"max-w-5xl mx-auto w-full p-4",children:(0,s.jsx)(k,{onSend:o$,placeholder:ew("auth.typeMessage"),showTitle:!1,disabled:!1})})})]}),ci()]})}if("board"===t$&&t1&&sh){let e=sf.find(e=>e.slug===sv),t=sj[sv]||[],a=sA["".concat(sv,"_").concat(sS[sv]||0)],r=tl?sN.find(e=>e.slug===tl.slug):null,n=r&&("admin"===r.role||"moderator"===r.role),o=eS({locale:eN,title:sh.name});return(0,s.jsxs)("div",{className:"flex flex-col h-screen bg-black text-white overflow-hidden",children:[(0,s.jsxs)(i(),{children:[(0,s.jsx)("title",{children:o.title}),(0,s.jsx)("meta",{property:"og:title",content:o.title},"og:title")]}),(0,s.jsx)("style",{children:cr}),cn(),(0,s.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[(0,s.jsxs)("div",{className:"w-64 bg-gray-800 border-r border-gray-700 flex flex-col flex-shrink-0",children:[(0,s.jsx)("div",{className:"p-4 border-b border-gray-700",children:(0,s.jsxs)("button",{onClick:o6,className:"w-full px-4 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg text-sm inline-flex items-center justify-center gap-2",children:[(0,s.jsx)(eO.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{className:"leading-none mt-[2px]",children:ew("common.back")})]})}),(0,s.jsxs)("div",{className:"p-4 border-b border-gray-700",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[sh.logo?(0,s.jsx)("img",{src:sh.logo,alt:sh.name,className:"w-12 h-12 rounded-lg object-cover"}):(0,s.jsx)("div",{className:"w-12 h-12 bg-gradient-to-br from-purple-500 to-purple-500 rounded-lg flex items-center justify-center",children:(0,s.jsx)(e0.Z,{className:"w-6 h-6 text-white"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("h2",{className:"text-lg font-bold truncate",children:sh.name}),(0,s.jsxs)("p",{className:"text-xs text-gray-400",children:[sN.length," ",ew("common.members").toLowerCase()]})]}),n&&(0,s.jsx)("button",{onClick:()=>{rP(sh.name),rD(sh.description||""),rM(null),lF(!0)},className:"p-1 hover:bg-gray-700 rounded",children:(0,s.jsx)(U.Z,{className:"w-4 h-4"})})]}),sh.description&&(0,s.jsx)("p",{className:"text-xs text-gray-400 line-clamp-2",children:sh.description})]}),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,s.jsxs)("div",{className:"p-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-2 py-1 mb-2",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-gray-400 uppercase tracking-wider",children:ew("channels.channels")}),n&&(0,s.jsx)("button",{onClick:()=>ll(!0),className:"p-1 hover:bg-gray-700 rounded",title:ew("channels.createChannel"),children:(0,s.jsx)(z.Z,{className:"w-4 h-4"})})]}),sf.map(e=>(0,s.jsxs)("button",{onClick:()=>sy(e.slug),className:"w-full px-3 py-2 rounded-lg text-left flex items-center gap-2 mb-1 transition-colors ".concat(sv===e.slug?"bg-purple-600 text-white":"hover:bg-gray-700 text-gray-300"),children:[e.is_private?(0,s.jsx)(H.Z,{className:"w-4 h-4"}):(0,s.jsx)(e0.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{className:"text-sm",children:e.name})]},e.id))]})}),(0,s.jsxs)("div",{className:"p-4 border-t border-gray-700 space-y-2",children:[(0,s.jsxs)("button",{onClick:()=>{rL(!0),rB(""),rK({users:[],groups:[],messages:[]})},className:"w-full px-3 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg text-sm flex items-center gap-2",children:[(0,s.jsx)(v.Z,{className:"w-4 h-4"}),ew("common.search")]}),(0,s.jsxs)("button",{onClick:()=>ln(!0),className:"w-full px-3 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg text-sm flex items-center gap-2",children:[(0,s.jsx)(M.Z,{className:"w-4 h-4"}),ew("common.members")]}),sh.invite_enabled&&(0,s.jsxs)("button",{onClick:()=>lo(!0),className:"w-full px-3 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg text-sm flex items-center gap-2",children:[(0,s.jsx)(e2.Z,{className:"w-4 h-4"}),ew("groups.invite")]}),tl&&(0,s.jsxs)("button",{onClick:()=>oe(tl.slug),className:"w-full px-3 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg text-sm flex items-center gap-2",children:[(0,s.jsx)(eB.Z,{className:"w-4 h-4"}),ew("common.profile")]})]})]}),(0,s.jsxs)("div",{className:"flex-1 flex flex-col min-w-0",children:[(0,s.jsx)("div",{className:"h-16 bg-gray-800 border-b border-gray-700 px-6 flex items-center justify-between flex-shrink-0",children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(e0.Z,{className:"w-5 h-5 text-gray-400"}),(0,s.jsx)("h2",{className:"text-lg font-semibold",children:(null==e?void 0:e.name)||ew("channels.selectChannel")})]})}),(0,s.jsxs)("div",{ref:iv,className:"flex-1 overflow-y-auto p-6 space-y-4",children:[(0,s.jsxs)("div",{ref:ix,className:"h-4 flex items-center justify-center",children:[(0,s.jsx)("noscript",{children:(0,s.jsx)("a",{href:"?page=".concat((sS[sv]||0)+1),className:"text-purple-500 underline text-sm py-2",children:ew("common.loadMore")||"Older Messages"})}),sE[sv]&&a&&(0,s.jsx)(w.Z,{className:"w-5 h-5 text-purple-500 animate-spin"})]}),0===t.length&&!a&&(0,s.jsxs)("div",{className:"text-center text-gray-500 py-12",children:[(0,s.jsx)(eM.Z,{className:"w-16 h-16 mx-auto mb-4 opacity-50"}),(0,s.jsx)("p",{children:ew("messages.noMessages")})]}),t.map(e=>(0,s.jsx)(l.Fragment,{children:cl({message:e,allowInteractions:cd,canModerate:n,context:"board"})},e.id)),(0,s.jsx)("div",{ref:ip})]}),(0,s.jsx)("div",{className:"p-4 bg-gray-800 border-t border-gray-700 flex-shrink-0",children:te?(0,s.jsx)(k,{onSend:oq,placeholder:ew("newPost.messagePlaceholder",{channel:(null==e?void 0:e.name)||"channel"}),showTitle:!1,disabled:!1}):(0,s.jsx)("div",{className:"text-center text-gray-400 py-6",children:ew("auth.signInToJoin")})})]}),ls&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",children:(0,s.jsxs)("div",{className:"bg-gray-800 rounded-xl p-6 w-full max-w-md border border-gray-700",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)("h3",{className:"text-xl font-bold",children:ew("channels.createChannel")}),(0,s.jsx)("button",{onClick:()=>ll(!1),className:"text-gray-400 hover:text-white",children:(0,s.jsx)(c.Z,{className:"w-5 h-5"})})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:ew("channels.channelName")}
1),(0,s.jsx)("input",{type:"text",value:lG,onChange:e=>lY(e.target.value),placeholder:"general",className:"w-full px-4 py-2 bg-gray-700 border border-gray-600 rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-purple-500",autoFocus:!0})]}),(0,s.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,s.jsx)("input",{type:"checkbox",checked:l$,onChange:e=>lQ(e.target.checked),className:"w-4 h-4"}),(0,s.jsx)("span",{className:"text-sm text-gray-300",children:ew("channels.privateChannel")})]}),(0,s.jsxs)("div",{className:"flex gap-2 pt-2",children:[(0,s.jsx)("button",{onClick:()=>ll(!1),className:"flex-1 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg",children:ew("common.cancel")}),(0,s.jsx)("button",{onClick:o1,disabled:!lG.trim(),className:"flex-1 py-2 bg-purple-600 hover:bg-purple-700 disabled:opacity-50 rounded-lg",children:ew("common.create")})]})]})]})}),lA&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",children:(0,s.jsxs)("div",{className:"bg-gray-800 rounded-xl p-6 w-full max-w-md border border-gray-700",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)("h3",{className:"text-xl font-bold",children:ew("groups.groupSettings")}),(0,s.jsx)("button",{onClick:()=>lF(!1),className:"text-gray-400 hover:text-white",children:(0,s.jsx)(c.Z,{className:"w-5 h-5"})})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:ew("groups.groupName")}),(0,s.jsx)("input",{type:"text",value:rZ,onChange:e=>rP(e.target.value),className:"w-full px-4 py-2 bg-gray-700 border border-gray-600 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-purple-500"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:ew("groups.description")}),(0,s.jsx)("textarea",{className:"w-full px-3 py-2 bg-gray-800 border border-gray-700 rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-purple-500 resize-none text-[16px] sm:text-sm",value:rT,onChange:e=>rD(e.target.value),rows:3})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:ew("groups.groupAvatar")}),(0,s.jsx)("input",{type:"file",ref:im,onChange:e=>rM(e.target.files[0]),accept:"image/*",className:"hidden"}),(0,s.jsxs)("button",{onClick:()=>{var e;return null===(e=im.current)||void 0===e?void 0:e.click()},className:"w-full py-2 bg-gray-700 hover:bg-gray-600 rounded-lg flex items-center justify-center gap-2",children:[(0,s.jsx)(N.Z,{className:"w-4 h-4"}),r_?r_.name:ew("profile.chooseAvatar")]})]}),(0,s.jsxs)("div",{className:"flex gap-2 pt-2",children:[(0,s.jsx)("button",{onClick:()=>lF(!1),className:"flex-1 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg",children:ew("common.cancel")}),(0,s.jsxs)("button",{onClick:ow,disabled:rU,className:"flex-1 py-2 bg-purple-600 hover:bg-purple-700 disabled:opacity-50 rounded-lg flex items-center justify-center gap-2",children:[rU?(0,s.jsx)(w.Z,{className:"w-4 h-4 animate-spin"}):(0,s.jsx)(T.Z,{className:"w-4 h-4"}),ew("common.save")]})]})]})]})}),lr&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",children:(0,s.jsxs)("div",{className:"bg-gray-800 rounded-xl p-6 w-full max-w-md border border-gray-700 max-h-[80vh] flex flex-col",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)("h3",{className:"text-xl font-bold",children:ew("common.members")}),(0,s.jsx)("button",{onClick:()=>ln(!1),className:"text-gray-400 hover:text-white",children:(0,s.jsx)(c.Z,{className:"w-5 h-5"})})]}),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto space-y-2",children:sN.map(e=>(0,s.jsx)("div",{className:"p-3 bg-gray-700 rounded-lg",children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("button",{onClick:()=>{oe(e.slug),ln(!1)},className:"w-10 h-10 bg-gradient-to-br from-purple-500 to-purple-500 rounded-full flex items-center justify-center hover:opacity-80",children:(0,s.jsx)("span",{className:"text-white font-semibold",children:e.name.charAt(0)})}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("div",{className:"font-semibold text-white",children:e.name}),(0,s.jsxs)("div",{className:"text-xs text-gray-400",children:["@",e.slug]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:["admin"===e.role&&(0,s.jsx)(e5.Z,{className:"w-4 h-4 text-yellow-500",title:ew("groups.admin")}),"moderator"===e.role&&(0,s.jsx)(O.Z,{className:"w-4 h-4 text-purple-500",title:ew("groups.moderator")}),n&&e.slug!==tl.slug&&"admin"!==e.role&&(0,s.jsx)("button",{onClick:()=>oC(e.id),className:"p-1 text-red-400 hover:text-red-300",children:(0,s.jsx)(eV.Z,{className:"w-4 h-4"})})]})]})},e.id))})]})}),li&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",children:(0,s.jsxs)("div",{className:"bg-gray-800 rounded-xl p-6 w-full max-w-md border border-gray-700",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)("h3",{className:"text-xl font-bold",children:ew("groups.inviteToGroup")}),(0,s.jsx)("button",{onClick:()=>lo(!1),className:"text-gray-400 hover:text-white",children:(0,s.jsx)(c.Z,{className:"w-5 h-5"})})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:ew("groups.inviteMethod")}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)("button",{onClick:()=>
1l2("email"),className:"flex-1 py-2 px-4 rounded-lg flex items-center justify-center gap-2 ".concat("email"===l1?"bg-purple-600":"bg-gray-700 hover:bg-gray-600"),children:[(0,s.jsx)(e4.Z,{className:"w-4 h-4"}),ew("auth.email")]}),(0,s.jsxs)("button",{onClick:()=>l2("phone"),className:"flex-1 py-2 px-4 rounded-lg flex items-center justify-center gap-2 ".concat("phone"===l1?"bg-purple-600":"bg-gray-700 hover:bg-gray-600"),children:[(0,s.jsx)(eq.Z,{className:"w-4 h-4"}),ew("auth.phone")]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"email"===l1?ew("auth.emailAddress"):ew("auth.phoneNumber")}),(0,s.jsx)("input",{type:"email"===l1?"email":"tel",value:lX,onChange:e=>l0(e.target.value),placeholder:"email"===l1?"[email protected]":"5321234567",className:"w-full px-4 py-2 bg-gray-700 border border-gray-600 rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-purple-500"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{onClick:()=>lo(!1),className:"flex-1 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg",children:ew("common.cancel")}),(0,s.jsx)("button",{onClick:oL,disabled:!lX.trim(),className:"flex-1 py-2 bg-purple-600 hover:bg-purple-700 disabled:opacity-50 rounded-lg",children:ew("groups.sendInvite")})]})]})]})}),ci()]})]})}if("profile"===t$&&at&&as){let e=(null==tl?void 0:null===(V=tl.slug)||void 0===V?void 0:V.toLowerCase())===(null==at?void 0:at.toLowerCase()),t=(null==as?void 0:as.cover)?ct(as.cover):null;(null==as?void 0:as.avatar)&&ct(as.avatar);let a=(0,A.iP)(eN,as.name,as.slug,as.bio);return(0,s.jsxs)("div",{className:"min-h-screen bg-black text-white",children:[(0,s.jsxs)(i(),{children:[(0,s.jsx)("title",{children:a.title}),(0,s.jsx)("meta",{property:"og:title",content:a.title},"og:title")]}),(0,s.jsx)("style",{children:cr}),cn({maxWidth:"max-w-5xl"}),(0,s.jsx)("main",{className:"max-w-4xl mx-auto",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"h-48 bg-gradient-to-r from-purple-600 via-purple-600 to-pink-600 relative",children:t&&(0,s.jsx)("img",{src:t,alt:"Cover",className:"w-full h-full object-cover"})}),(0,s.jsxs)("div",{className:"bg-gray-800 px-6 pb-6",children:[(0,s.jsxs)("div",{className:"flex items-end gap-6 -mt-16 mb-4 relative z-10",children:[(0,s.jsx)("div",{className:"w-32 h-32 bg-gradient-to-br from-purple-500 to-purple-500 rounded-full flex items-center justify-center border-4 border-gray-800 relative z-30 ".concat(as.avatar?"cursor-pointer hover:opacity-90 transition-opacity":""),onClick:()=>{as.avatar&&nx(ct(as.avatar)||as.avatar)},children:as.avatar?(0,s.jsx)("img",{src:ct(as.avatar)||as.avatar,alt:as.name||"(Anonymous)",className:"w-full h-full rounded-full object-cover"}):(0,s.jsx)("span",{className:"text-white text-5xl font-bold",children:(null===(Y=as.name||"(Anonymous)")||void 0===Y?void 0:null===(G=Y.charAt(0))||void 0===G?void 0:G.toUpperCase())||"?"})}),!e&&(0,s.jsxs)("div",{className:"flex gap-2 mb-4",children:[(0,s.jsx)("button",{onClick:()=>oE(as.slug),className:"px-4 py-2 rounded-lg flex items-center gap-2 ".concat(as.isFollowing?"bg-gray-700 hover:bg-gray-600":"bg-purple-600 hover:bg-purple-700"),children:as.isFollowing?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(e3.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:ew("profile.unfollow")})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(e2.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:ew("profile.follow")})]})}),eI&&(0,s.jsxs)("button",{onClick:()=>{if(!te||"complete"!==ta){ek.push("/");return}oW(as.slug)},className:"px-4 py-2 bg-green-600 hover:bg-green-700 rounded-lg flex items-center gap-2",children:[(0,s.jsx)(eM.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:ew("dm.sendDM")})]}),(0,s.jsxs)("button",{onClick:()=>{if(!te||"complete"!==ta){ek.push("/");return}lK(as.slug),lm(!0)},className:"px-4 py-2 bg-red-600 hover:bg-red-700 rounded-lg flex items-center gap-2",children:[(0,s.jsx)(eY.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:ew("common.report")})]})]})]}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("h2",{className:"text-2xl font-bold mb-1",children:as.name||"(Anonymous)"}),(0,s.jsxs)("p",{className:"text-gray-400 mb-1",children:["@",as.slug]}),as.bio&&(0,s.jsx)("div",{className:"text-gray-300 mt-2 whitespace-pre-wrap break-words",children:o4(as.bio)}),(0,s.jsxs)("div",{className:"flex items-center gap-4 mt-2 text-sm text-gray-400 flex-wrap",children:[(0,s.jsxs)("a",{href:"/".concat(as.slug,"/followers"),className:"group hover:text-purple-400 transition-colors",children:[(0,s.jsx)("span",{className:"text-white font-semibold group-hover:text-purple-400 transition-colors",children:as.followerCount||0})," ",ew("profile.followers")]}),(0,s.jsx)("span",{children:"|"}),(0,s.jsxs)("a",{href:"/".concat(as.slug,"/following"),className:"group hover:text-purple-400 transition-colors",children:[(0,s.jsx)("span",{className:"text-white font-semibold group-hover:text-purple-400 transition-colors",children:as.followingCount||0})," ",ew("profile.following")]}),as.city&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsxs)("span",{className:"flex items-center gap-1 text-gray-300",children:[(0,s.jsx)(ez.Z,{className:"w-3.5 h-3.5 text-purple-400 shrink-0"}),(0,s.jsx)("span",{children:as.city})]})]}),as.joinedAt&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsxs)("span",{children:[ew("profile.joined")," ",new Date(as.joinedAt).toLocaleDateString("tr"===eN?"tr-TR":"es"===eN?"es-ES":"en-US",{month:"long",year:"numeric"})]})]})]})]}),e&&(0,s.jsx)("div",{className:"mb-6 p-3 bg-gray-800 rounded-lg border border-gray-700",children:(0,s.jsx)(k,{onSend:oG,placeholder:ew("newPost.placeholder"),showTitle:!0,disabled:!1,submitLabel:ew("common.post")})})]}),(0,s.jsx)("div",{className:"bg-gray-800 border-t border-gray-700 px-6",children:(0,s.jsxs)("div",{className:"flex gap-8",children:[(0,s.jsxs)("button",{onClick:()=>ao("activity"),className:"py-4 ".concat("activity"===ai?"border-b-2 border-purple-600 text-purple-500":"text-gray-400 hover:text-white"),children:[(0,s.jsx)(e6.Z,{className:"w-5 h-5 inline mr-2"}),ew("profile.allActivity")]}),(0,s.jsxs)("button",{onClick:()=>ao("events"),className:"py-4 ".concat("events"===ai?"border-b-2 border-purple-600 text-purple-500":"text-gray-400 hover:text-white"),children:[(0,s.jsx)(eL.Z,{className:"w-5 h-5 inline mr-2"}),ew("events.upcomingEvents","Upcoming Events")]})]})}),(0,s.jsxs)("div",{className:"pt-3 space-y-4",children:["events"===ai?af?(0,s.jsx)("div",{className:"text-center text-gray-500 py-12 bg-gray-800 rounded-xl",children:(0,s.jsx)("p",{children:ew("events.loading","Loading events...")})}):(0,s.jsxs)(s.Fragment,{children:[te&&"tr"!==eN&&(null==tl?void 0:tl.slug)===(null==as?void 0:as.slug)&&(0,s.jsx)("div",{className:"mb-4 px-4 md:px-0",children:(0,s.jsxs)("button",{onClick:oP,className:"text-purple-400 hover:text-purple-300 font-medium text-sm flex items-center",children:[(0,s.jsx)(z.Z,{className:"w-4 h-4 mr-1"}),ew("events.addOrImport","Add or import an event")]})}),0===ac.length?(0,s.jsxs)("div",{className:"text-center text-gray-500 py-12 bg-gray-800 rounded-xl",children:[(0,s.jsx)(eL.Z,{className:"w-16 h-16 mx-auto mb-4 opacity-50"}),(0,s.jsx)("p",{children:ew("events.noEvents","No events found")})]}):(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:ac.map(e=>(0,s.jsxs)("a",{href:"/e/".concat(e.id),className:"bg-gray-800 rounded-xl overflow-hidden border border-gray-700 hover:border-purple-500/50 transition-colors block relative group cursor-pointer",children:[te&&(null==tl?void 0:tl.slug)===(null==as?void 0:as.slug)&&(0,s.jsx)("button",{onClick:t=>oT(t,e.id),className:"delete-event-btn absolute top-2 left-2 z-10 bg-black/60 hover:bg-red-500/80 backdrop-blur-md p-1.5 rounded-full text-white opacity-0 group-hover:opacity-100 transition-opacity border border-white/10",title:"Delete Event",children:(0,s.jsx)(eD.Z,{className:"w-4 h-4"})}),(0,s.jsx)("div",{className:"aspect-square w-full relative",children:(0,s.jsx)("img",{src:e.photo||e.avatar||"https://cdn.qrsite.app/rnbw/bratparty.png",alt:e.title,className:"w-full h-full object-cover"})}),(0,s.jsxs)("div",{className:"p-4 space-y-3",children:[(0,s.jsx)("h3",{className:"font-bold text-lg leading-tight",children:e.title}),(0,s.jsxs)("div",{className:"flex items-center text-gray-400 text-sm",children:[(0,s.jsx)(eL.Z,{className:"w-4 h-4 mr-2 text-purple-400"}),(()=>{let t=new Date(e.date);return isNaN(t.getTime())?e.humanDate||e.date||"":t.toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})})()]}),e.place&&(0,s.jsxs)("div",{className:"flex items-center text-gray-400 text-sm",children:[(0,s.jsx)(ez.Z,{className:"w-4 h-4 mr-2 text-purple-400"}),(0,s.jsx)("span",{className:"truncate",children:e.place})]})]})]},e.id))})]}):(0,s.jsxs)(s.Fragment,{children:["activity"===ai&&te&&"tr"!==eN&&(null==tl?void 0:tl.slug)===(null==as?void 0:as.slug)&&(0,s.jsx)("div",{className:"mb-4 px-4 md:px-0",children:(0,s.jsxs)("button",{onClick:oZ,className:"text-purple-400 hover:text-purple-300 font-medium text-sm flex items-center",children:[(0,s.jsx)(z.Z,{className:"w-4 h-4 mr-1"}),ew("profile.importPost","Import a post")]})}),0===ar.length?(0,s.jsxs)("div",{className:"text-center text-gray-500 py-12 bg-gray-800 rounded-xl",children:[(0,s.jsx)(eM.Z,{className:"w-16 h-16 mx-auto mb-4 opacity-50"}),(0,s.jsx)("p",{children:ew("profile.noActivity")})]}):ar.map(t=>{var a,l,r;let n=(t.replies||[]).map(e=>{var t,a;return{id:(null===(t=e.id)||void 0===t?void 0:t.toString())||"",slug:e.slug,userId:(null===(a=e.user_id)||void 0===a?void 0:a.toString())||"",userSlug:e.userSlug,userName:e.userName,userAvatar:e.userAvatar,title:e.title||"",content:e.content,timestamp:new Date(e.createdAt),likes:e.likes||0,likedByMe:e.likedByMe||!1}}),i={id:(null===(a=t.id)||void 0===a?void 0:a.toString())||"",slug:t.slug,userId:(null===(l=t.user_id)||void 0===l?void 0:l.toString())||"",userSlug:t.userSlug,userName:t.userName,userAvatar:t.userAvatar,title:t.title||"",content:t.content,timestamp:new Date(t.createdAt),likes:t.likes||0,likedByMe:!0===t.likedByMe||1===t.likedByMe||"1"===t.likedByMe,media:t.media||[],replies:n,replyCount:null!==(r=t.replyCount)&&void 0!==r?r:n.length,videoEmbed:iz(t.content),groupName:t.groupName,channelName:t.channelName,groupSlug:t.groupSlug,channelSlug:t.channelSlug};return(0,s.jsx)("div",{className:"bg-gray-800 rounded-xl p-4",id:"msg-".concat(t.slug),children:cl({message:i,showChannelContext:!0,allowInteractions:cd,canModerate:e,context:"profile"})},t.id)})]}),sW&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{ref:ib,className:"h-4"}),(0,s.jsx)("noscript",{children:(0,s.jsx)("a",{href:"/".concat(null==as?void 0:as.slug,"?page=").concat(sz+1),className:"block text-center mt-4 px-6 py-2 bg-purple-600 hover:bg-purple-700 rounded-lg text-white mx-auto w-max",children:ew("common.loadMore")||"Next Page"})})]}),sq&&(0,s.jsx)("div",{className:"flex justify-center py-4",children:(0,s.jsx)(w.Z,{className:"w-6 h-6 text-purple-500 animate-spin"})})]})]})}),ci()]})}
1if("single-post"===t$&&t8){let e={id:(null===($=t8.id)||void 0===$?void 0:$.toString())||"",slug:t8.slug,userId:(null===(X=t8.user)||void 0===X?void 0:null===(Q=X.id)||void 0===Q?void 0:Q.toString())||"",userSlug:(null===(ee=t8.user)||void 0===ee?void 0:ee.slug)||"",userName:(null===(es=t8.user)||void 0===es?void 0:es.name)||"",userAvatar:null===(er=t8.user)||void 0===er?void 0:er.avatar,title:t8.title||"",content:t8.content,timestamp:new Date(t8.createdAt),likes:t8.likes||0,likedByMe:t8.likedByMe||!1,replyCount:void 0!==t8.replyCount?t8.replyCount:(t8.replies||[]).length,replies:(t8.replies||[]).map(e=>{var t,a,s,l,r,n;return{id:(null===(t=e.id)||void 0===t?void 0:t.toString())||"",slug:e.slug,userId:(null===(s=e.user)||void 0===s?void 0:null===(a=s.id)||void 0===a?void 0:a.toString())||"",userSlug:(null===(l=e.user)||void 0===l?void 0:l.slug)||"",userName:(null===(r=e.user)||void 0===r?void 0:r.name)||"",userAvatar:null===(n=e.user)||void 0===n?void 0:n.avatar,title:e.title||"",content:e.content,timestamp:new Date(e.createdAt),likes:e.likes||0,likedByMe:e.likedByMe||!1}}),media:t8.media||[],videoEmbed:iz(t8.content)},t=t8.title?t8.title:"".concat(ew("messages.reply")," ").concat(ew("notifications.by")," ").concat(null===(en=t8.user)||void 0===en?void 0:en.name),a=eS({locale:eN,title:t});return(0,s.jsxs)("div",{className:"flex flex-col h-screen bg-black text-white overflow-hidden",children:[(0,s.jsxs)(i(),{children:[(0,s.jsx)("title",{children:a.title}),(0,s.jsx)("meta",{property:"og:title",content:a.title},"og:title")]}),(0,s.jsx)("style",{children:cr}),cn(),(0,s.jsxs)("div",{className:"flex-1 flex flex-col min-w-0 overflow-hidden",children:[(0,s.jsx)("div",{className:"h-16 bg-gray-800 border-b border-gray-700 flex items-center flex-shrink-0",children:(0,s.jsx)("div",{className:"max-w-5xl mx-auto w-full px-6 flex items-center justify-between",children:(0,s.jsxs)("button",{onClick:o6,className:"px-4 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg text-sm inline-flex items-center gap-2",children:[(0,s.jsx)(eO.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{className:"leading-none mt-[2px]",children:ew("common.back")})]})})}),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,s.jsx)("div",{className:"max-w-5xl mx-auto w-full p-6",children:cl({message:e,allowInteractions:cd,canModerate:tl&&(tl.slug===e.userSlug||tl.id===e.user_id),context:t8.groupSlug?"board":"profile"})})}),ci()]})]})}if("private-album"===t$&&tX){let e=tX.title||"Private Album",t=eS({locale:eN,title:e});return(0,s.jsxs)("div",{className:"flex flex-col h-screen bg-black text-white overflow-hidden",children:[(0,s.jsxs)(i(),{children:[(0,s.jsx)("title",{children:t.title}),(0,s.jsx)("meta",{property:"og:title",content:t.title},"og:title")]}),(0,s.jsx)("style",{children:cr}),cn(),(0,s.jsxs)("div",{className:"flex-1 flex flex-col min-w-0 overflow-hidden",children:[(0,s.jsx)("div",{className:"bg-gray-800 border-b border-gray-700 py-4 px-6 flex-shrink-0",children:(0,s.jsxs)("div",{className:"max-w-5xl mx-auto w-full",children:[(0,s.jsxs)("h1",{className:"text-xl font-bold flex items-center gap-2 mb-2",children:[(0,s.jsx)(H.Z,{className:"w-5 h-5 text-gray-400"}),e]}),(0,s.jsxs)("div",{className:"flex items-start gap-2 mt-3 p-3 bg-gray-900/50 rounded-lg border border-gray-700/50",children:[(0,s.jsx)(eJ.Z,{className:"w-4 h-4 mt-0.5 text-purple-400 flex-shrink-0"}),(0,s.jsx)("p",{className:"text-sm text-gray-400",children:ew("pages.privateAlbumsInfo")})]})]})}),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto p-6",children:(0,s.jsxs)("div",{className:"max-w-5xl mx-auto w-full",children:[(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("h4",{className:"text-xs font-bold text-gray-500 mb-3 uppercase",children:ew("gallery.addMore")}),(0,s.jsxs)("div",{className:"bg-gray-900 border border-gray-700 rounded-xl p-4",children:[(0,s.jsxs)("div",{className:"bg-gray-800 p-8 rounded-xl border border-gray-700 text-center cursor-pointer hover:bg-gray-750 transition-colors",onClick:()=>!io&&document.getElementById("album-media-upload").click(),children:[(0,s.jsx)("div",{className:"w-16 h-16 bg-gray-700 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,s.jsx)(z.Z,{className:"w-8 h-8 text-gray-400"})}),(0,s.jsx)("p",{className:"text-gray-400 text-sm font-semibold mb-1",children:ew("gallery.selectPhotosAlbum")}),(0,s.jsx)("p",{className:"text-gray-500 text-xs italic",children:ew("gallery.mediaSizeWarning")}),(0,s.jsx)("input",{type:"file",multiple:!0,accept:"image/*,video/*",className:"hidden",id:"album-media-upload",disabled:io,onChange:e=>{let t=e.target.files.length,a=document.getElementById("album-media-count");a&&(a.innerText=t>0?"".concat(t," files selected"):"")}}),(0,s.jsx)("p",{id:"album-media-count",className:"text-purple-400 text-sm mt-2 font-bold"})]}),(0,s.jsx)("button",{className:"w-full bg-purple-600 hover:bg-purple-700 disabled:opacity-50 text-white font-bold py-3 rounded-lg uppercase transition-colors flex items-center justify-center gap-2",disabled:io,onClick:i0,children:io?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.Z,{className:"w-5 h-5 animate-spin"})," ",ew("newPost.uploadingMedia")]}):ew("newPost.send")})]})]}),tX.media&&tX.media.length>0&&(0,s.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:tX.media.map((e,t)=>{var a;let l=null===(a=e.type)||void 0===a?void 0:a.startsWith("video/");return(0,s.jsx)("div",{className:"group relative aspect-square bg-gray-800 rounded-xl overflow-hidden cursor-pointer",onClick:()=>ce(tX.media,t,tX.title),children:l?(0,s.jsxs)(s.Fragment,{children:[e.thumbnail_url?(0,s.jsx)("img",{src:e.thumbnail_url,alt:"Video thumbnail",className:"w-full h-full object-cover group-hover:scale-105 transition-transform"}):(0,s.jsx)("div",{className:"w-full h-full bg-gradient-to-br from-gray-800 to-black group-hover:scale-105 transition-transform"}),(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,s.jsx)("div",{className:"w-12 h-12 rounded-full bg-white/90 flex items-center justify-center shadow-lg",children:(0,s.jsx)("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"#111",style:{marginLeft:3},children:(0,s.jsx)("polygon",{points:"5,3 19,12 5,21"})})})})]}):(0,s.jsx)("img",{src:ct(e.cached_urls)||e.url,alt:e.name||"Album Media",className:"w-full h-full object-cover group-hover:scale-105 transition-transform"})},t)})})]})})]}),ci()]})}if("single-post"===t$&&!t8){let e=eS({locale:eN,title:"Post"});return(0,s.jsxs)("div",{className:"min-h-screen bg-black text-white",children:[(0,s.jsxs)(i(),{children:[(0,s.jsx)("title",{children:e.title}),(0,s.jsx)("meta",{property:"og:title",content:e.title},"og:title")]}),(0,s.jsx)("style",{children:cr}),cn(),(0,s.jsx)("div",{className:"flex items-center justify-center min-h-screen",children:(0,s.jsx)(w.Z,{className:"w-8 h-8 text-purple-500 animate-spin"})}),ci()]})}if("tag"===t$&&a$){let e=null!==st||(null==eb?void 0:eb.slug)&&eb.slug.startsWith("[song:"),t=e&&st?"".concat(st.title," by ").concat(st.artist):(null==aX?void 0:null===(ei=aX[0])||void 0===ei?void 0:ei.title)||a$.replace(/-/g," "),a=eS({locale:eN,title:t.toLowerCase()}),r=()=>{var t;let a=Number(a1)||0,l=a9>0?Math.ceil(a9/20):a5?a+2:a+1;if(l<=1)return null;let r=(null==st?void 0:st.slug)||(null==eb?void 0:null===(t=eb.slug)||void 0===t?void 0:t.replace(/^\[song:/,"").replace(/\]$/,"")),n=e?"/song/".concat(r):"/tag/".concat(a$),i=e=>0===e?n:"".concat(n,"?page=").concat(e),o=[];if(l<=7)for(let e=0;e<l;e++)o.push(e);else{o.push(0);let e=Math.max(1,a-1),t=Math.min(l-2,a+1);a<=2?t=3:a>=l-3&&(e=l-4),e>1&&o.push("ellipsis-start");for(let a=e;a<=t;a++)o.push(a);t<l-2&&o.push("ellipsis-end"),o.push(l-1)}return(0,s.jsxs)("nav",{"aria-label":"Pagination",className:"flex flex-wrap items-center justify-center gap-1.5 sm:gap-2 my-8",children:[a>0?(0,s.jsx)("a",{href:i(a-1),className:"px-3 py-2 text-sm font-medium text-gray-300 bg-gray-800 border border-gray-700 rounded-md hover:bg-gray-700 hover:text-white transition-colors","aria-label":"Previous page",children:ew("common.previous","Previous")}):(0,s.jsx)("span",{className:"px-3 py-2 text-sm font-medium text-gray-600 bg-gray-900/50 border border-gray-800 rounded-md cursor-not-allowed",children:ew("common.previous","Previous")}),o.map((e,t)=>{if("string"==typeof e)return(0,s.jsx)("span",{className:"px-2 py-2 text-sm text-gray-500",children:"…"},"".concat(e,"-").concat(t));let l=e===a;return l?(0,s.jsx)("span",{"aria-current":"page",className:"px-3 py-2 text-sm font-bold text-white bg-purple-600 border border-purple-500 rounded-md",children:e+1},e):(0,s.jsx)("a",{href:i(e),className:"px-3 py-2 text-sm font-medium text-gray-300 bg-gray-800 border border-gray-700 rounded-md hover:bg-gray-700 hover:text-white transition-colors",children:e+1},e)}),a<l-1?(0,s.jsx)("a",{href:i(a+1),className:"px-3 py-2 text-sm font-medium text-gray-300 bg-gray-800 border border-gray-700 rounded-md hover:bg-gray-700 hover:text-white transition-colors","aria-label":"Next page",children:ew("common.next","Next")}):(0,s.jsx)("span",{className:"px-3 py-2 text-sm font-medium text-gray-600 bg-gray-900/50 border border-gray-800 rounded-md cursor-not-allowed",children:ew("common.next","Next")})]})};return(0,s.jsxs)("div",{className:"min-h-screen bg-black text-white",children:[(0,s.jsxs)(i(),{children:[(0,s.jsx)("title",{children:a.title}),(0,s.jsx)("meta",{property:"og:title",content:a.title},"og:title")]}),(0,s.jsx)("style",{children:cr}),cn(),(0,s.jsxs)("main",{children:[(0,s.jsx)("div",{className:"bg-gray-800 border-b border-gray-700 py-4",children:(0,s.jsxs)("div",{className:"max-w-5xl mx-auto w-full px-6",children:[e?(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("h1",{className:"text-xl font-bold flex items-center gap-2 mb-2",children:ew("music.musicFeed","Music Feed")}),(0,s.jsx)(P,{slug:st.slug})]}):(0,s.jsxs)("h1",{className:"text-xl font-bold flex items-center gap-2 mb-2 lowercase",children:[(0,s.jsx)(eP.Z,{className:"w-5 h-5 text-gray-400"}),t]}),(0,s.jsxs)("div",{className:"text-sm text-gray-400 flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{children:ew("gallery.postsShared",{count:a9})}),a8&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{children:"\xb7"}),(0,s.jsxs)("span",{children:[ew("gallery.startedBy")," ",(0,s.jsxs)("a",{href:"/".concat(a8),className:"text-purple-400 hover:underline",children:["@",a8]})]})]})]})]})}),(0,s.jsx)("div",{className:"py-6",children:(0,s.jsxs)("div",{className:"max-w-5xl mx-auto w-full px-6",children:[!e&&(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("h4",{className:"text-xs font-bold text-gray-500 mb-3 uppercase",children:ew("gallery.addMore")}),(0,s.jsxs)("div",{className:"bg-gray-900 border border-gray-700 rounded-xl p-4",children:[(0,s.jsx)("textarea",{className:"w-full bg-transparent text-white placeholder-gray-500 outline-none resize-none mb-4 text-[16px] sm:text-sm",rows:2,placeholder:ew("gallery.sharePlaceholder"),id:"tag-upload-text"}),(0,s.jsxs)("div",{className:"bg-gray-800 p-8 rounded-xl border border-gray-700 text-center cursor-pointer hover:bg-gray-750 transition-colors",onClick:()=>!io&&document.getElementById("tag-file-upload").click(),children:[(0,s.jsx)("div",{className:"w-16 h-16 bg-gray-700 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,s.jsx)(z.Z,{className:"w-8 h-8 text-gray-400"})}),(0,s.jsx)("p",{className:"text-gray-400 text-sm font-semibold mb-1",children:ew("gallery.selectPhotos")}),(0,s.jsx)("p",{className:"text-gray-500 text-xs italic",children:ew("gallery.mediaSizeWarning")}),(0,s.jsx)("input",{type:"file",multiple:!0,accept:"image/*,video/*",className:"hidden",id:"tag-file-upload",disabled:io,onChange:e=>{let t=e.target.files.length,a=document.getElementById("tag-file-count");a&&(a.innerText=t>0?"".concat(t," files selected"):"")}}),(0,s.jsx)("p",{id:"tag-file-count",className:"text-purple-400 text-sm mt-2 font-bold"})]}),(0,s.jsx)("button",{className:"w-full bg-purple-600 hover:bg-purple-700 disabled:opacity-50 text-white font-bold py-3 rounded-lg uppercase transition-colors flex items-center justify-center gap-2",disabled:io,onClick:async()=>
1{if(!te||"complete"!==ta){ek.push("/");return}if(io)return;let e=document.getElementById("tag-file-upload"),a=document.getElementById("tag-upload-text"),s=Array.from(e.files||[]),l=a.value||"";if(0===s.length&&""===l.trim())return alert("Add text or media!");ic(!0);try{let r=[];s.length>0&&(r=await Promise.all(s.map(e=>b(e)))),await iK("/api/messages",{method:"POST",body:JSON.stringify({content:l,title:t,media:r,channelSlug:null})}),e.value="",a.value="";let n=document.getElementById("tag-file-count");n&&(n.innerText=""),no(!1),"tag"===t$&&a$?await i2(a$,0):"single-post"===t$?await i1(t3):"profile"===t$?await i8(at):"board"===t$?await iQ(sv,0):await i4(0)}catch(e){console.error("Upload failed:",e),alert("Upload failed: "+e.message)}finally{ic(!1)}},children:io?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.Z,{className:"w-5 h-5 animate-spin"})," ",ew("newPost.uploadingMedia")]}):ew("gallery.upload")})]})]}),a3&&0===a1?(0,s.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,s.jsx)(w.Z,{className:"w-8 h-8 text-purple-500 animate-spin"})}):0===aX.length?(0,s.jsxs)("div",{className:"text-center text-gray-500 py-12",children:[(0,s.jsx)(e0.Z,{className:"w-16 h-16 mx-auto mb-4 opacity-50"}),(0,s.jsx)("p",{children:ew("search.noPostsTitle")})]}):(0,s.jsxs)("div",{className:"space-y-6",children:[aX.map(e=>{var t,a,r,n,i,o;let c={id:(null===(t=e.id)||void 0===t?void 0:t.toString())||"",slug:e.slug,userId:(null===(r=e.user)||void 0===r?void 0:null===(a=r.id)||void 0===a?void 0:a.toString())||"",userSlug:(null===(n=e.user)||void 0===n?void 0:n.slug)||"",userName:(null===(i=e.user)||void 0===i?void 0:i.name)||"",userAvatar:null===(o=e.user)||void 0===o?void 0:o.avatar,title:e.title||"",content:e.content,timestamp:new Date(e.createdAt),likes:e.likes||0,likedByMe:e.likedByMe||!1,replyCount:e.replyCount||0,replies:(e.replies||[]).map(e=>{var t,a,s,l,r,n;return{id:(null===(t=e.id)||void 0===t?void 0:t.toString())||"",slug:e.slug,userId:(null===(s=e.user)||void 0===s?void 0:null===(a=s.id)||void 0===a?void 0:a.toString())||"",userSlug:(null===(l=e.user)||void 0===l?void 0:l.slug)||"",userName:(null===(r=e.user)||void 0===r?void 0:r.name)||"",userAvatar:null===(n=e.user)||void 0===n?void 0:n.avatar,title:e.title||"",content:e.content,timestamp:new Date(e.createdAt),likes:e.likes||0,likedByMe:e.likedByMe||!1}}),media:e.media||[],videoEmbed:iz(e.content),channelName:e.channelName,channelSlug:e.channelSlug,groupName:e.groupName,groupSlug:e.groupSlug};return(0,s.jsx)(l.Fragment,{children:cl({message:c,showChannelContext:!0,allowInteractions:cd,context:"board"})},e.id)}),(null==eb?void 0:eb.isBot)?r():(0,s.jsxs)(s.Fragment,{children:[a5&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{ref:iN,className:"h-4 w-full"}),a3&&(0,s.jsx)("div",{className:"flex justify-center py-4",children:(0,s.jsx)(w.Z,{className:"w-6 h-6 text-purple-500 animate-spin"})})]}),(0,s.jsx)("noscript",{children:r()})]})]})]})}),ci()]})]})}if("search"===t$&&ss){let e=eS({locale:eN,title:"".concat(ew("common.search"),": ").concat(ss)});return(0,s.jsxs)("div",{className:"min-h-screen bg-black text-white",children:[(0,s.jsxs)(i(),{children:[(0,s.jsx)("title",{children:e.title}),(0,s.jsx)("meta",{property:"og:title",content:e.title},"og:title")]}),(0,s.jsx)("style",{children:cr}),cn(),(0,s.jsxs)("main",{children:[(0,s.jsx)("div",{className:"bg-gray-800 border-b border-gray-700 py-4",children:(0,s.jsx)("div",{className:"max-w-5xl mx-auto w-full px-6 flex items-center justify-between",children:(0,s.jsxs)("h1",{className:"text-xl font-bold",children:["#",ss]})})}),(0,s.jsx)("div",{className:"py-6",children:(0,s.jsx)("div",{className:"max-w-5xl mx-auto w-full px-6",children:su&&0===si?(0,s.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,s.jsx)(w.Z,{className:"w-8 h-8 text-purple-500 animate-spin"})}):0===sr.length?(0,s.jsxs)("div",{className:"text-center text-gray-500 py-12",children:[(0,s.jsx)(e0.Z,{className:"w-16 h-16 mx-auto mb-4 opacity-50"}),(0,s.jsx)("p",{children:ew("search.noPostsHashtag")})]}):(0,s.jsxs)("div",{className:"space-y-6",children:[sr.map(e=>{var t,a,r,n,i,o;let c={id:(null===(t=e.id)||void 0===t?void 0:t.toString())||"",slug:e.slug,userId:(null===(r=e.user)||void 0===r?void 0:null===(a=r.id)||void 0===a?void 0:a.toString())||"",userSlug:(null===(n=e.user)||void 0===n?void 0:n.slug)||"",userName:(null===(i=e.user)||void 0===i?void 0:i.name)||"",userAvatar:null===(o=e.user)||void 0===o?void 0:o.avatar,title:e.title||"",content:e.content,timestamp:new Date(e.createdAt),likes:e.likes||0,likedByMe:e.likedByMe||!1,replyCount:e.replyCount||0,replies:(e.replies||[]).map(e=>{var t,a,s,l,r,n;return{id:(null===(t=e.id)||void 0===t?void 0:t.toString())||"",slug:e.slug,userId:(null===(s=e.user)||void 0===s?void 0:null===(a=s.id)||void 0===a?void 0:a.toString())||"",userSlug:(null===(l=e.user)||void 0===l?void 0:l.slug)||"",userName:(null===(r=e.user)||void 0===r?void 0:r.name)||"",userAvatar:null===(n=e.user)||void 0===n?void 0:n.avatar,title:e.title||"",content:e.content,timestamp:new Date(e.createdAt),likes:e.likes||0,likedByMe:e.likedByMe||!1}}),media:e.media||[],videoEmbed:iz(e.content),channelName:e.channelName,channelSlug:e.channelSlug,groupName:e.groupName,groupSlug:e.groupSlug};return(0,s.jsx)(l.Fragment,{children:cl({message:c,showChannelContext:!0,allowInteractions:cd,context:"board"})},e.id)}),sc&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{ref:ik,className:"h-4 w-full"}),su&&(0,s.jsx)("div",{className:"flex justify-center py-4",children:(0,s.jsx)(w.Z,{className:"w-6 h-6 text-purple-500 animate-spin"})}),(0,s.jsx)("noscript",{children:(0,s.jsx)("a",{href:"/search/".concat(ss,"?page=").concat(si+1),className:"block text-center mt-4 px-6 py-2 bg-purple-600 hover:bg-purple-700 rounded-lg text-white mx-auto w-max",style:{display:"block",margin:"1rem auto"},children:ew("common.loadMore")||"Next Page"})})]})]})})}),ci()]})]})}return null}},8924:function(){},5024:function(){}}]);

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.