1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3555],{10512:e=>{e.exports={gifEmoji:"ComposePost_gifEmoji__enykF",emoji:"ComposePost_emoji__3IIil",galleryEmoji:"ComposePost_galleryEmoji___TYEu"}},15234:(e,t,l)=>{"use strict";l.d(t,{A:()=>a});var s=l(37876),n=l(14232),r=l(96145);function a(e){let{isOpen:t=!1,onClose:l=()=>{},children:a,header:i,headerClass:o,customWidth:c,childControlsWidth:d=!1,customWidthData:u="max-w-3xl w-full",gifModal:m=!1}=e,[x,h]=(0,n.useState)(!1);return((0,n.useEffect)(()=>{if(t){let e=window.scrollY;document.body.style.position="fixed",document.body.style.top="-".concat(e,"px"),document.body.style.width="100%"}else{let e=document.body.style.top;document.body.style.position="",document.body.style.top="",document.body.style.width="",window.scrollTo(0,-1*parseInt(e||"0"))}return()=>{document.body.style.position="",document.body.style.top="",document.body.style.width=""}},[t]),(0,n.useEffect)(()=>{let e;return t?h(!0):e=setTimeout(()=>h(!1),200),()=>clearTimeout(e)},[t]),t||x)?(0,s.jsx)("div",{onClick:e=>e.stopPropagation(),className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 transition-opacity duration-200",children:(0,s.jsxs)("div",{className:"bg-white rounded-[5px] shadow-lg p-8 relative transform transition-all duration-200\n ".concat(t?"scale-100 opacity-100":"scale-95 opacity-0","\n ").concat(d?"w-auto max-w-full":c?u:"max-w-md w-full"),children:[(0,s.jsx)(r.$n,{onClick:l,className:"absolute right-5 text-gray-500 hover:text-black text-xl ".concat(m?"top-[10px]":"top-7"),children:(0,s.jsx)(r.In,{id:"close-cross-icn",className:"inline-block text-primary"})}),i&&(0,s.jsx)(r.DZ,{type:"h2",text:i,className:o||"text-[40px]"}),(0,s.jsx)("div",{children:a})]})}):null}},23555:(e,t,l)=>{"use strict";l.d(t,{A:()=>h});var s=l(37876),n=l(14232),r=l(96145),a=l(23290);function i(e){var t,l,n,i;let{userDetails:o,session:c,handleComposeModal:d,setPreviewImage:u}=e,{userDetails:m}=(0,a.o)(),x=m||o,h=null==x?void 0:x.user,p=null==x?void 0:x.stats,{first_name:f,last_name:v,username:g}=h||{},{followers_count:j,following_count:w}=p||{},y="".concat(f," ").concat(v),b=(null==c||null==(l=c.user)||null==(t=l.userData)?void 0:t.cover_image)||"/images/leftCardBg.png",N=(null==c||null==(i=c.user)||null==(n=i.userData)?void 0:n.profile_pic)||"/images/profile-image.jpg";return(0,s.jsx)("aside",{className:"lg:flex flex-col w-full min-h-screen border-r px-4 py-6",children:x?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"bg-white rounded-lg shadow pb-4 mb-8",children:[(0,s.jsx)("div",{className:"relative w-full h-24 rounded-t-[5px] overflow-hidden",children:(0,s.jsx)("div",{className:"absolute inset-0 cursor-pointer",onClick:()=>u({src:b,type:"cover"}),children:(0,s.jsx)(r.Zc,{src:b,alt:"Profile background",fill:!0,className:"object-cover"})})}),(0,s.jsxs)("div",{className:"flex flex-col items-center mt-[-1.5rem]",children:[(0,s.jsx)("div",{className:"cursor-pointer",onClick:()=>u({src:N,type:"profile"}),children:(0,s.jsx)(r.Zc,{src:N,alt:"avatar",width:56,height:56,className:"w-14 z-10 h-14 rounded-full object-cover transform translate-x-1"})}),(0,s.jsxs)(r.N_,{href:"/profile-details",className:"cursor-pointer",children:[(0,s.jsx)(r.DZ,{type:"h4",text:y||"-",className:"mt-2 capitalize text-black text-14 text-center"}),(0,s.jsx)("p",{className:"text-12 text-black text-center",children:"@".concat(g)||0})]}),(0,s.jsxs)("div",{className:"flex justify-center gap-6 mt-5 text-sm",children:[(0,s.jsxs)(r.N_,{href:"/my-followers",className:"flex flex-col items-center cursor-pointer",children:[(0,s.jsx)("span",{className:"text-black text-14",children:j}),(0,s.jsx)("span",{className:"text-black text-12",children:" followers"})]}),(0,s.jsxs)(r.N_,{href:"/my-following",className:"flex flex-col items-center cursor-pointer",children:[(0,s.jsx)("span",{className:"text-black text-14",children:w}),(0,s.jsx)("span",{className:"text-black text-12",children:" following"})]})]})]})]}),(0,s.jsx)(r.$n,{onClick:d,className:"w-full bg-primary hover:bg-blue-700 transition text-white py-2 rounded-md text-14 shadow",children:"New Post"}),(0,s.jsxs)("div",{className:"hidden sm:block mt-4",children:[(0,s.jsxs)("div",{className:"flex gap-6 text-14 text-black",children:[(0,s.jsx)(r.N_,{href:"/settings/about/",className:"hover:cursor-pointer",children:"About us"}),(0,s.jsx)(r.N_,{href:"/settings/help/",className:"hover:cursor-pointer",children:"Contact us"}),(0,s.jsx)(r.N_,{href:"/settings/faq",className:"hover:cursor-pointer",children:"FAQ"})]}),(0,s.jsxs)("div",{className:"flex flex-row justify-normal gap-5 text-14 mt-1 text-black",children:[(0,s.jsx)(r.N_,{href:"/settings/about/privacy-policy",className:"hover:cursor-pointer",children:"Privacy policy"}),(0,s.jsx)(r.N_,{href:"/settings/about/terms-of-services",className:"hover:cursor-pointer",children:"Terms of service"})]})]}),(0,s.jsxs)("div",{className:"flex flex-col text-[14px] sm:hidden mt-4 gap-2",children:[(0,s.jsx)(r.N_,{href:"/settings/about/",className:"hover:cursor-pointer",children:"About us"}),(0,s.jsx)(r.N_,{href:"/settings/help/",className:"hover:cursor-pointer",children:"Contact us"}),(0,s.jsx)(r.N_,{href:"/settings/faq",className:"hover:cursor-pointer",children:"FAQ"}),(0,s.jsx)(r.N_,{href:"/settings/about/privacy-policy",className:"hover:cursor-pointer",children:"Privacy policy"}),(0,s.jsx)(r.N_,{href:"/settings/about/terms-of-services",className:"hover:cursor-pointer",children:"Terms of service"})]})]}):(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("div",{className:"bg-white rounded-lg shadow pb-4 mb-8",children:(0,s.jsxs)("div",{className:"flex flex-col items-center mt-5",children:[(0,s.jsx)(r.Zc,{src:"/images/velaflow-filled-blue.jpg",alt:"avatar",className:"w-14 h-14"}),(0,s.jsx)(r.DZ,{type:"h4",text:"Join the Conversation",className:"mt-2 text-black text-14"}),(0,s.jsxs)("div",{className:"flex justify-between mt-5",children:[(0,s.jsx)(r.N_,{href:"/signup",className:"hover:cursor-pointer bg-primary text-white px-3 py-1 text-14 rounded-md",children:"Create account"}),(0,s.jsx)(r.N_,{href:"/login",className:"ml-3 hover:cursor-pointer bg-grey text-greyLight px-3 py-1 text-14 rounded-md",children:"Sign in"})]})]})})})})}var o=l(81220);function c(e){var t,l;let{suggestionList:i={},tagsList:c={}}=e,d=(null==i||null==(t=i.content)?void 0:t.suggestions)||[],u=(null==c||null==(l=c.content)?void 0:l.tags)||[],[m,x]=(0,n.use
1State)(""),[h,p]=(0,n.useState)([]),[f,v]=(0,n.useState)(!1),[g,j]=(0,n.useState)(!1),[w,y]=(0,n.useState)(d),[b,N]=(0,n.useState)({}),{handleFollow:C,isLoading:k}=(0,a.o)(),_=async()=>{let e=await (0,o.ge)({limit:10,offset:0});if(!e.error){var t;y(null==e||null==(t=e.content)?void 0:t.suggestions)}},S=async e=>{let t=null==e?void 0:e.id;N(e),(await C(t)).success&&(y(e=>e.filter(e=>e.id!==t)),_())};return(0,n.useEffect)(()=>{if((null==m?void 0:m.length)<3){v(!1),p([]);return}(async()=>{j(!0),v(!0);try{let t=await (0,o.x5)({limit:10,offset:0,search:m});if(!(null==t?void 0:t.error)){var e;p((null==t||null==(e=t.content)?void 0:e.users)||[])}}finally{j(!1)}})()},[m]),(0,s.jsxs)("aside",{className:"xl:flex flex-col px-4 py-6",children:[(0,s.jsxs)("div",{className:"flex items-center w-full px-3 py-2 rounded-[10px] bg-gray-100 border transition-all duration-200 text-black placeholder-black",children:[(0,s.jsx)(r.In,{id:"search-icn",width:16,height:16,className:"text-gray-500 mr-2"}),(0,s.jsx)("input",{type:"text",value:m,onChange:e=>{let{value:t}=e.target;x(t.replace(/\s+/g," "))},placeholder:"Search",className:"bg-gray-100 focus:outline-none focus:border-[#2755FF] "}),m&&(0,s.jsx)(r.$n,{type:"button",onClick:()=>x(""),className:"absolute right-3 top-1/2 -translate-y-1/2 ",children:"â"})]}),f&&!g&&(0,s.jsx)("div",{className:"bg-[#F8F8F8] rounded-[10px] mt-2",children:(null==h?void 0:h.length)>0?null==h?void 0:h.map(e=>(0,s.jsxs)(r.N_,{href:"/profile-details/".concat(null==e?void 0:e.username),className:"flex px-3 items-center text-black pt-2 pb-2 cursor-pointer hover:bg-secondaryNavy hover:text-white hover:rounded-[10px]",children:[(0,s.jsx)(r.Zc,{className:"w-12 h-12 object-cover rounded-full",src:e.profile_pic}),(0,s.jsx)("p",{className:"pl-4 text-12",children:"".concat(e.first_name," ").concat(e.last_name)})]},"id-".concat(e.id))):(0,s.jsx)("h4",{class:"font-normal text-black text-[14px] p-2 ",children:"No accounts found"})}),(0,s.jsxs)("div",{className:"mt-6",children:[(0,s.jsx)(r.DZ,{type:"h4",text:"Trending",className:"font-normal text-black text-[14px] mb-2"}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[null==u?void 0:u.map((e,t)=>{var l;return(0,s.jsx)(r.N_,{href:"/trending/".concat((l=null==e?void 0:e.name)?l.trim().replace(/^#/,""):""),className:"bg-secondaryNavy text-white text-12 px-5 py-2 rounded-[10px]",children:null==e?void 0:e.name},t)}),(null==u?void 0:u.length)===0&&(0,s.jsx)("div",{className:"flex justify-center text-center text-grey text-12",children:"Follow people to see trending tags"})]})]}),(0,s.jsxs)("div",{className:"mt-6",children:[(0,s.jsx)(r.DZ,{type:"h4",text:"You might know",className:"font-normal text-black text-[14px] mb-2"}),(0,s.jsx)("ul",{className:"space-y-3 text-sm",children:null==w?void 0:w.map((e,t)=>(0,s.jsxs)("li",{className:"flex items-center justify-between mt-2",children:[(0,s.jsxs)(r.N_,{href:"/profile-details/".concat(null==e?void 0:e.username),className:"flex items-center gap-3 cursor-pointer",children:[(0,s.jsx)(r.Zc,{src:null==e?void 0:e.profile_pic,alt:null==e?void 0:e.first_name,className:"rounded-full w-8 h-8 object-cover shadow-sm"}),(0,s.jsxs)("span",{className:"text-[14px] text-black",children:[null==e?void 0:e.first_name," ",null==e?void 0:e.last_name]})]}),(0,s.jsx)(r.$n,{onClick:()=>S(e),className:"pr-5",children:(null==b?void 0:b.id)===(null==e?void 0:e.id)&&k?(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsx)(r.aH,{className:"text-primary"})}):(0,s.jsx)(r.In,{id:"add-follower-icn",className:"text-primary"})})]},t))})]})]})}var d=l(10553),u=l(87704),m=l(54587),x=l.n(m);function h(e){var t;let{children:l,userDetails:o,suggestionList:m={},hideRightSection:h=!1,tagsList:p={}}=e,{data:f}=(0,d.useSession)(),{updateUserDetails:v}=(0,a.o)(),[g,j]=(0,n.useState)(!1),[w,y]=(0,n.useState)(!1),[b,N]=(0,n.useState)(!0),[C,k]=(0,n.useState)(!1),[_,S]=(0,n.useState)(null),E=()=>{k(!C)},A=(0,n.useRef)(0),L=(0,n.useRef)(null);return(0,n.useEffect)(()=>{o&&v(o)},[o,v]),(0,n.useEffect)(()=>(g||w||_?document.body.classList.add("overflow-hidden"):document.body.classList.remove("overflow-hidden"),()=>document.body.classList.remove("overflow-hidden")),[g,w,_]),(0,n.useEffect)(()=>{let e=()=>{let e=window.scrollY;L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{e>A.current&&e>80?N(!1):N(!0),A.current=e},20)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e),clearTimeout(L.current)}},[]),(0,s.jsxs)("div",{className:"min-h-screen bg-greyLight flex flex-col relative",children:[(0,s.jsxs)("div",{className:"fixed top-0 left-0 w-full z-50 bg-white shadow-md px-4 py-3 flex items-center justify-between md:hidden transition-transform duration-300 ".concat(b?"translate-y-0":"-translate-y-full"),children:[(0,s.jsx)(r.$n,{onClick:()=>void(y(!1),j(!g)),className:"text-gray-700 focus:outline-none",children:(0,s.jsx)(r.In,{id:"hamburger-icn",width:22,height:22})}),(0,s.jsx)(r.N_,{href:"/",className:"flex items-center",children:(0,s.jsx)(r.Zc,{src:"/images/headerLogo.jpg",alt:"
1Velaflow Logo",width:120,height:30,className:"object-contain"})}),(0,s.jsx)(r.$n,{onClick:()=>void(j(!1),y(!w)),className:"text-gray-700 focus:outline-none",children:(0,s.jsx)(r.Zc,{src:(null==o||null==(t=o.user)?void 0:t.profile_pic)||"/images/profile-image.jpg",alt:"User avatar",className:"w-10 h-10 rounded-full"})})]}),(0,s.jsxs)("div",{className:"flex flex-1 relative pt-[60px] md:pt-0",children:[(0,s.jsx)("div",{className:"\n fixed inset-y-0 left-0 z-40 bg-white shadow-md w-64 transform transition-transform duration-300 ease-in-out\n ".concat(g?"translate-x-0":"-translate-x-full","\n md:translate-x-0 md:static md:shadow-none md:w-1/4 lg:w-1/4\n "),children:(0,s.jsx)("div",{className:"h-full overflow-y-auto mt-[50px] md:mt-0",children:(0,s.jsx)(i,{userDetails:o,session:f,handleComposeModal:E,previewImage:_,setPreviewImage:S})})}),g&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-30 z-30 md:hidden",onClick:()=>j(!1)}),(0,s.jsx)("div",{className:"\n flex-1 w-full overflow-x-hidden transition-all duration-300\n ".concat(h?"md:w-3/4 lg:w-4/5":"md:w-3/4 lg:w-2/4","\n "),children:l}),!h&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"\n fixed inset-y-0 right-0 z-40 bg-white shadow-md w-64 transform transition-transform duration-300 ease-in-out\n ".concat(w?"translate-x-0":"translate-x-full","\n md:translate-x-0 md:static md:shadow-none md:w-1/4 lg:w-1/4\n "),children:(0,s.jsx)("div",{className:"h-full overflow-y-auto mt-[75px] md:mt-0",children:(0,s.jsx)(c,{suggestionList:m,tagsList:p})})}),w&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-30 z-30 md:hidden",onClick:()=>y(!1)})]})]}),(0,s.jsx)(u.A,{isOpen:C,onClose:E}),_&&(0,s.jsxs)("div",{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center",onClick:()=>S(null),children:[(0,s.jsx)("button",{onClick:()=>S(null),className:" absolute top-4 right-4 w-10 h-10 rounded-full border border-[#2755FF] flex items-center justify-center text-white text-xl bg-black/40 hover:bg-black/60 transition",children:"â"}),(0,s.jsx)(x(),{src:_.src,alt:"Preview",width:300,height:300,onClick:e=>e.stopPropagation(),className:"\n ".concat("profile"===_.type?"rounded-full w-72 h-72 object-cover":"rounded-lg object-contain w-2/4 h-2/4","\n ")})]})]})}},61939:(e,t,l)=>{"use strict";l.d(t,{CZ:()=>s,D6:()=>n,k3:()=>a,t$:()=>r});let s=e=>{if(!e)return null;let t=e.match(/v=([^&]+)/);if(t)return"https://www.youtube.com/embed/".concat(t[1]);let l=e.match(/youtu\.be\/([^?]+)/);if(l)return"https://www.youtube.com/embed/".concat(l[1]);let s=e.match(/shorts\/([^?]+)/);if(s)return"https://www.youtube.com/embed/".concat(s[1]);let n=e.match(/embed\/([^?]+)/);return n?"https://www.youtube.com/embed/".concat(n[1]):null},n=e=>{if(!e)return null;let t=e.match(/instagram\.com\/(?:p|reel|tv)\/([^/?]+)/);if(t){let e=t[1];return"https://www.instagram.com/p/".concat(e,"/embed")}return null},r=e=>!!e&&/^(https?:\/\/)?(www\.)?(youtube\.com|m\.youtube\.com|youtu\.be)\/(watch\?v=|shorts\/)?[A-Za-z0-9_\-]+/.test(e),a=e=>!!e&&/^(https?:\/\/)?(www\.)?(instagram\.com|instagr\.am)\/(p|reel|tv)\/[A-Za-z0-9_\-]+/.test(e)},87704:(e,t,l)=>{"use strict";l.d(t,{A:()=>S});var s=l(37876),n=l(14232),r=l(15234),a=l(96145),i=l(10553),o=l(81220),c=l(12227);let d=e=>{let{aiModal:t,handleAIModal:l,getAIGeneratedData:i}
1=e,[d,u]=(0,n.useState)(""),[m,x]=(0,n.useState)(!1),[h,p]=(0,n.useState)(""),f=async()=>{x(!0);let e=new FormData;e.append("prompt",d);let t=await (0,o.Kp)(e);if(!t.error){var l;x(!1),p(null==t||null==(l=t.content)?void 0:l.generated_content)}};return(0,n.useEffect)(()=>(t?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[t]),(0,s.jsxs)(r.A,{isOpen:t,onClose:l,customWidth:!0,children:[(0,s.jsx)(a.DZ,{type:"h4",text:"Generate your post through our AI Assistant",className:"text-14 flex justify-center"}),(0,s.jsx)(a.JU,{className:"mt-6 block text-14 text-black font-medium",children:"Prompt"}),(0,s.jsx)(a.pd,{name:"prompt",value:d,onChange:e=>u(e.target.value),placeholder:"Enter your prompt here",className:"mt-2 w-full px-3 py-2 text-12 border border-grey rounded-[5px] focus:outline-none focus:ring-2 focus:ring-blue-500"}),h&&(0,s.jsx)("div",{className:"relative w-full max-w-2xl bg-white rounded-lg shadow-lg p-5 max-h-[50vh] overflow-y-auto",children:(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsx)(a.JU,{className:"block text-14 text-black font-medium",children:"Generated Content"}),(0,s.jsx)("div",{className:"mt-2 p-3 bg-gray-100 rounded-[5px] text-12",dangerouslySetInnerHTML:{__html:c.A.sanitize(h)}}),(0,s.jsx)("div",{className:"flex justify-end",children:(0,s.jsx)(a.$n,{onClick:()=>{u(""),i(h)},className:"text-12 bg-primary px-6 py-3 text-white rounded-[5px] mt-5 ml-2",children:"Use this content"})})]})}),(0,s.jsx)("div",{className:"flex justify-end",children:(0,s.jsx)(a.$n,{onClick:f,className:"text-12 bg-primary px-6 py-3 text-white rounded-[5px] mt-5",disabled:m,children:m?(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsx)(a.aH,{})}):"Generate"})})]})};var u=l(18847),m=l.n(u),x=l(49006);function h(e){let{onGifClick:t}=e;return(0,s.jsx)(x.hP,{apiKey:"C0itnBUQAp2G6P6o6HQzjliZOeK9NDPU",children:(0,s.jsx)(p,{onGifClick:t})})}let p=e=>{let{onGifClick:t}=e,{fetchGifs:l,term:r,channelSearch:a,activeChannel:i}
1=(0,n.useContext)(x.o7),[o,c]=(0,n.useState)(3),[d,u]=(0,n.useState)(500);return(0,n.useEffect)(()=>{let e=()=>{let e=window.innerWidth;e<400?(c(2),u(e-32)):e<768?(c(3),u(e-64)):(c(4),u(500))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,s.jsxs)("div",{className:"bg-white max-h-[80vh] overflow-y-auto p-2 rounded-lg shadow-lg w-full sm:max-w-[520px]",children:[(0,s.jsx)("div",{className:"mb-2 px-2",children:(0,s.jsx)(x.IW,{})}),(0,s.jsx)(x.S3,{}),(0,s.jsx)(x.xA,{columns:o,width:d,fetchGifs:l,onGifClick:t,gutter:8},"".concat(a,"-").concat(r,"-").concat(null==i?void 0:i.user.username))]})};var f=l(10512),v=l.n(f),g=l(95062),j=l.n(g);let w=(0,n.forwardRef)((e,t)=>{let{textValue:l,setTextValue:r,isCommentOnPost:a,isCommentOnComment:i,linkPreviewJSX:o}=e,c=(0,n.useRef)(null),d=(0,n.useRef)(null);(0,n.useEffect)(()=>{let e=c.current;e&&e.innerHTML!==l&&(e.innerHTML=l||"")},[l]);let u=()=>{let e=window.getSelection();e&&e.rangeCount>0&&(d.current=e.getRangeAt(0))};return(0,n.useImperativeHandle)(t,()=>({insertEmoji(e){let t=c.current;t.focus();let l=window.getSelection(),s=d.current;s||((s=document.createRange()).selectNodeContents(t),s.collapse(!1)),l.removeAllRanges(),l.addRange(s);let n=document.createTextNode(e);s.insertNode(n),s.setStartAfter(n),s.collapse(!0),l.removeAllRanges(),l.addRange(s),d.current=s,r(t.innerHTML)}})),(0,s.jsxs)("div",{className:"max-h-64 overflow-y-auto modern-scroll",children:[(0,s.jsx)("div",{ref:c,contentEditable:!0,suppressContentEditableWarning:!0,onInput:e=>{r(e.currentTarget.innerHTML),u()},onKeyDown:e=>{if("Enter"===e.key&&!e.shiftKey){e.preventDefault();let t=window.getSelection(),l=t.getRangeAt(0),s=document.createElement("br");l.insertNode(s),l.setStartAfter(s),l.collapse(!0),t.removeAllRanges(),t.addRange(l),r(e.currentTarget.innerHTML)}},onKeyUp:()=>u(),onMouseUp:()=>u(),className:"w-full p-3 text-12 text-black rounded focus:outline-none ".concat(a||i?"":"min-h-64 border"),"data-placeholder":a||i?"Post your reply":"Enter your thoughts here..."}),o]})});w.displayName="EditableTextarea",w.propTypes={textValue:j().string.isRequired,setTextValue:j().func.isRequired,isCommentOnPost:j().bool,isCommentOnComment:j().bool};var y=l(61939),b=l(97685),N=l(54587),C=l.n(N);let k=m()(()=>Promise.all([l.e(504),l.e(67)]).then(l.bind(l,90067)),{loadableGenerated:{webpack:()=>[90067]},ssr:!1}),_={title:"",description:"",image:"",url:"",isLinkAdded:!1},S=e=>{var t,l;let{isOpen:c=!1,onClose:u=()=>{},selectedPost:m={},commentOn:x="",isEditPost:p=!1,post:f={},handleEditSuccess:g=()=>{}}=e,j="post"===x,N="comment"===x,{data:S}=(0,i.useSession)(),E=null==S||null==(t=S.user)?void 0:t.userData,A=(0,n.useRef)(null),[L,T]=(0,n.use
1State)([]),[D,R]=(0,n.useState)([]),[Z,I]=(0,n.useState)(""),[P,F]=(0,n.useState)(!1),z=(0,n.useRef)(null),[H,$]=(0,n.useState)(!1),[M,U]=(0,n.useState)(!1),[V,O]=(0,n.useState)([]),[G,W]=(0,n.useState)(!1),[Y,K]=(0,n.useState)(_),[q,B]=(0,n.useState)(!1),[J,Q]=(0,n.useState)([]),[X,ee]=(0,n.useState)(0),[et,el]=(0,n.useState)(!1),es=e=>{T([]),R([]),I(""),K(_),F(!1),u(e)};(0,n.useEffect)(()=>{if(c){let e=window.scrollY;document.body.style.position="fixed",document.body.style.top="-".concat(e,"px"),document.body.style.left="0",document.body.style.right="0",document.body.style.overflow="hidden",document.body.style.width="100%"}else{let e=document.body.style.top;document.body.style.position="",document.body.style.top="",document.body.style.left="",document.body.style.right="",document.body.style.overflow="",document.body.style.width="",window.scrollTo(0,-1*parseInt(e||"0"))}return()=>{document.body.style.position="",document.body.style.top="",document.body.style.left="",document.body.style.right="",document.body.style.overflow="",document.body.style.width=""}},[c]);let en=n.useCallback(async(e,t)=>{try{let a=await (0,o.Yw)({url:e});if(!a.error){var l,s,n,r;K({url:null==a||null==(l=a.content)?void 0:l.url,title:null==a||null==(s=a.content)?void 0:s.title,description:null==a||null==(n=a.content)?void 0:n.description,image:null==a||null==(r=a.content)?void 0:r.image,isLinkAdded:!0,isYoutubeOrInstaLink:t}),Q([])}}catch(e){Q(["Failed to fetch link preview"])}finally{B(!1)}},[]);(0,n.useEffect)(()=>{if(Y.isLinkAdded)return;let e=(e=>{if(!e)return null;let t="string"==typeof e?e:String(e);if(!t.includes("http"))return null;let l=t.replace(/<[^>]*>/g,"").match(/(https?:\/\/[^\s]+)/);return l?l[0]:null})(Z);if(!e)return void K(_);let t=(0,y.t$)(e)||(0,y.k3)(e);B(!0),en(e,t)},[Z,Y.isLinkAdded,en]),(0,n.useEffect)(()=>{if(p&&f){var e;I(f.content||""),O(f.media||[]),R((null==(e=f.media)?void 0:e.map(e=>e.url))||[]),T([]),K((null==f?void 0:f.link_url)?{title:null==f?void 0:f.link_title,description:null==f?void 0:f.link_description,image:null==f?void 0:f.link_image,url:null==f?void 0:f.url,isLinkAdded:!0}:_)}},[p,f]);let er=e=>{let t=Array.from(e.target.files).filter(e=>!(e.size>0x40000000)||(alert("".concat(e.name," exceeds the 1GB limit.")),!1));T(e=>[...e,...t])},ea=()=>{A.current.click()},ei=()=>{U(!M)},eo=async()=>{let e;el(!0),ee(0),F(!0);let t=new FormData;if(t.append("".concat(j||N?"comment":"content"),Z),t.append("title",(e=>e.length<=50?e:e.slice(0,50))(Z)),Y.isLinkAdded&&(t.append("link_title",Y.title),t.append("link_description",Y.description),t.append("link_image",Y.image),t.append("link_url",Y.url)),j&&(e=null==m?void 0:m.id,t.delete("title")),N&&(e=null==m?void 0:m.post_id,t.append("parent_comment_id",null==m?void 0:m.id)),p&&(e=null==f?void 0:f.id),(null==L?void 0:L.length)>0&&L.forEach(e=>{t.append("media[]",e)}),p)(await (0,o.lD)(t,e)).error?F(!1):(F(!1),g());else{var l,s,n,r,a,i,c,d,u;try{let r=j||N?await (0,o.tP)(t,e,ee):await (0,o.pD)(t,ee);el(!1),ee(100),(null==r||null==(l=r.data)?void 0:l.error)?(F(!1),b.Ay.error(null==r||null==(n=r.data)?void 0:n.message)):(b.Ay.success(null==r||null==(s=r.data)?void 0:s.message),F(!1),es("added"))}catch(e){F(!1),(null==e||null==(a=e.response)||null==(r=a.data)?void 0:r.errors)?Object.values(e.response.data.errors).forEach(e=>{e.forEach(e=>b.Ay.error(e))}):(null==e||null==(c=e.response)||null==(i=c.data)?void 0:i.message)&&b.Ay.error(null==e||null==(u=e.response)||null==(d=u.data)?void 0:d.message),el(!1),ee(0),console.error("Upload failed:",e)}}};(0,n.useEffect)(()=>{let e=e=>{z.current&&!z.current.contains(e.target)&&$(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);let ec=e=>{ep.current&&ep.current.insertEmoji(e.native||e),$(!1)},ed=async(e,t)=>{t.preventDefault();let l=e.images.original.url,s=await fetch(l),n=new File([await s.blob()],"giphy-".concat(Date.now(),".gif"),{type:"image/gif"});T(e=>[...e,n]),U(!1)},eu=()=>{W(!G)},em=e=>{I(e),W(!1)};(0,n.useEffect)(()=>{if(!L.length)return void R([]);let e=L.map(e=>URL.createObjectURL(e));return R(e),()=>
1{e.forEach(e=>URL.revokeObjectURL(e))}},[L]);let ex=(0,s.jsxs)(s.Fragment,{children:[q&&(0,s.jsx)("div",{className:"mt-3 text-grey flex justify-center",children:(0,s.jsx)(a.aH,{className:"text-grey"})}),(null==Y?void 0:Y.isLinkAdded)&&(0,s.jsxs)("div",{className:"relative mt-3 border rounded-lg overflow-hidden shadow-sm hover:shadow-md transition",children:[(0,s.jsx)(a.$n,{onClick:()=>K(_),className:"absolute right-2 top-2 bg-black/50 text-white text-xs p-1 rounded-full hover:bg-black/70 transition",children:"â"}),(0,s.jsxs)("a",{href:null==Y?void 0:Y.url,target:"_blank",rel:"noopener noreferrer",className:"block",children:[(null==Y?void 0:Y.image)&&!(0,y.t$)(null==Y?void 0:Y.url)&&(0,s.jsx)(C(),{width:300,height:300,src:null==Y?void 0:Y.image,alt:"preview",className:"object-cover w-full h-72 rounded-t-lg"}),(null==Y?void 0:Y.isYoutubeOrInstaLink)&&(0,s.jsx)("iframe",{width:(0,y.t$)(null==Y?void 0:Y.url)?"560":"100%",height:(0,y.t$)(null==Y?void 0:Y.url)?"315":"15",src:(0,y.CZ)(null==Y?void 0:Y.url),title:"YouTube video player",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:!0}),(0,s.jsxs)("div",{className:"p-3",children:[(0,s.jsx)("div",{className:"text-sm font-semibold",children:null==Y?void 0:Y.title}),(0,s.jsx)("div",{className:"text-xs text-gray-600 mt-1 line-clamp-2",children:null==Y?void 0:Y.description})]})]})]})]}),eh=(null==Z||null==(l=Z.trim())?void 0:l.length)===0&&(null==L?void 0:L.length)===0,ep=(0,n.useRef)(null),ef=()=>(0,s.jsxs)("div",{className:"flex",children:[(0,s.jsx)("div",{children:(0,s.jsx)(a.Zc,{src:(null==E?void 0:E.profile_pic)||"/image/profile-image.jpg",alt:null==E?void 0:E.first_name,className:"h-12 w-12 rounded-full object-cover"})}),(0,s.jsxs)("div",{className:"w-full p-3",children:[(0,s.jsx)(w,{ref:ep,textValue:Z,setTextValue:I,isCommentOnPost:j,isCommentOnComment:N,linkPreviewJSX:ex}),et&&(null==L?void 0:L.length)>0&&(0,s.jsxs)("div",{className:"mt-3 w-full",children:[(0,s.jsxs)("div",{className:"text-sm mb-1 text-gray-700",children:["Uploading ",(null==L?void 0:L.length)>1?"files":"file","..."," ",X,"%"]}),(0,s.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2 overflow-hidden",children:(0,s.jsx)("div",{className:"bg-primary h-full transition-all duration-150",style:{width:"".concat(X,"%")}})})]}),(null==J?void 0:J.length)>0?(0,s.jsx)("div",{className:"text-red text-12",children:null==J?void 0:J.map((e,t)=>(0,s.jsx)("p",{children:e},"x-".concat(t)))}):null,(0,s.jsxs)("div",{className:"flex flex-wrap gap-4 mt-4 max-h-20 overflow-y-auto modern-scroll",children:[p&&V.length>0&&V.map((e,t)=>"video"===e.media_type?(0,s.jsx)("video",{src:e.url,controls:!0,className:"w-32 h-32 rounded border shadow object-cover"},"existing-video-".concat(e.id)):(0,s.jsx)(a.Zc,{src:e.url,alt:"Existing ".concat(t),className:"w-32 h-32 object-cover rounded border shadow"},"existing-image-".concat(e.id))),L.map((e,t)=>{let l=e.type.startsWith("video/"),n=D[t+V.length];return(0,s.jsxs)("div",{className:"relative w-32 h-32",children:[l?(0,s.jsx)("video",{src:n,controls:!0,className:"w-full h-full rounded border shadow object-cover"}):(0,s.jsx)(a.Zc,{src:n,alt:"New ".concat(t),className:"w-full h-full object-cover rounded border shadow"}),(0,s.jsx)("button",{onClick:()=>(e=>{T(t=>t.filter((t,l)=>l!==e)),R(t=>t.filter((t,l)=>l!==V.length+e))})(t),className:"absolute top-1 right-1 bg-black/60 hover:bg-black/80 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs",title:"Remove",children:"â"})]},"preview-".concat(t))})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4 mt-6",children:[(0,s.jsxs)("div",{className:"flex text-center justify-center items-center align-middle gap-x-3",children:[(0,s.jsxs)("span",{children:[(0,s.jsx)(a.pd,{type:"file",accept:"image/*, video/*",multiple:!0,ref:A,onChange:er,className:"hidden"}),(0,s.jsx)(a.In,{id:"gallery-icn",onClick:ea,className:"cursor-pointer ".concat(v().galleryEmoji)})]}),(0,s.jsxs)("span",{children:[(0,s.jsx)(a.pd,{type:"file",accept:"image/*, video/*",multiple:!0,ref:A,onCh
1ange:er,className:"hidden"}),(0,s.jsx)(a.In,{id:"video-icn",onClick:ea,className:"cursor-pointer w-[24px] h-[24px]"})]}),(0,s.jsxs)("span",{className:"relative inline-block",ref:z,children:[(0,s.jsx)(a.In,{onClick:()=>$(e=>!e),id:"emoji-icn",className:"cursor-pointer ".concat(v().emoji)}),H&&(0,s.jsx)("div",{className:"absolute z-50 left-0 max-w-[full] w-screen bottom-full mb-2",children:(0,s.jsx)(k,{onEmojiSelect:ec})})]}),(0,s.jsx)("span",{onClick:ei,className:"cursor-pointer",children:(0,s.jsx)("svg",{width:"29",height:"17",viewBox:"0 0 29 17",fill:"none",children:(0,s.jsx)("path",{d:"M15.9216 0.566667V16.4333C15.9216 16.5836 15.8617 16.7278 15.755 16.834C15.6484 16.9403 15.5038 17 15.3529 17C15.2021 17 15.0575 16.9403 14.9509 16.834C14.8442 16.7278 14.7843 16.5836 14.7843 16.4333V0.566667C14.7843 0.416377 14.8442 0.272243 14.9509 0.165972C15.0575 0.0597018 15.2021 0 15.3529 0C15.5038 0 15.6484 0.0597018 15.755 0.165972C15.8617 0.272243 15.9216 0.416377 15.9216 0.566667ZM28.4314 0H21.6078C21.457 7.51379e-06 21.3124 0.0597121 21.2058 0.165981C21.0991 0.27225 21.0392 0.41638 21.0392 0.566667V16.4333C21.0392 16.5836 21.0991 16.7278 21.2058 16.834C21.3124 16.9403 21.457 17 21.6078 17C21.7587 17 21.9033 16.9403 22.0099 16.834C22.1166 16.7278 22.1765 16.5836 22.1765 16.4333V9.06667H26.7255C26.8763 9.06667 27.0209 9.00696 27.1276 8.90069C27.2342 8.79442 27.2941 8.65029 27.2941 8.5C27.2941 8.34971 27.2342 8.20558 27.1276 8.09931C27.0209 7.99304 26.8763 7.93333 26.7255 7.93333H22.1765V1.13333H28.4314C28.5822 1.13333 28.7268 1.07363 28.8335 0.967361C28.9401 0.86109 29 0.716956 29 0.566667C29 0.416377 28.9401 0.272243 28.8335 0.165972C28.7268 0.0597018 28.5822 0 28.4314 0ZM9.66667 7.93333H6.2549C6.10409 7.93333 5.95946 7.99304 5.85282 8.09931C5.74618 8.20558 5.68627 8.34971 5.68627 8.5C5.68627 8.65029 5.74618 8.79442 5.85282 8.90069C5.95946 9.00696 6.10409 9.06667 6.2549 9.06667H9.09804V11.9C9.09804 12.952 8.67868 13.961 7.93221 14.7049C7.18574 15.4488 6.17331 15.8667 5.11765 15.8667C4.06198 15.8667 3.04955 15.4488 2.30309 14.7049C1.55662 13.961 1.13725 12.952 1.13725 11.9V5.1C1.13741 4.13452 1.49085 3.20223 2.13135 2.47783C2.77184 1.75344 3.65543 1.28666 4.61652 1.16497C5.57762 1.04329 6.55026 1.27504 7.35218 1.8168C8.1541 2.35856 8.73025 3.17315 8.97268 4.10792C9.01072 4.25299 9.10489 4.37712 9.23458 4.45314C9.36427 4.52915 9.51891 4.55085 9.66462 4.51347C9.81033 4.4761 9.93524 4.38271 10.012 4.25374C10.0887 4.12478 10.1111 3.97076 10.0741 3.82542C9.76266 2.62344 9.02203 1.57592 7.99104 0.879175C6.96005 0.182431 5.70947 -0.115705 4.47369 0.0406468C3.23792 0.196998 2.10177 0.797103 1.27821 1.72849C0.454636 2.65987 0.000174911 3.8586 0 5.1V11.9C0 13.2526 0.539179 14.5498 1.49892 15.5062C2.45867 16.4627 3.76036 17 5.11765 17C6.47493 17 7.77662 16.4627 8.73637 15.5062C9.69611 14.5498 10.2353 13.2526 10.2353 11.9V8.5C10.2353 8.34971 10.1754 8.20558 10.0687 8.09931C9.9621 7.99305 9.81747 7.93334 9.66667 7.93333Z",fill:"black"})})}),(0,s.jsx)(r.A,{isOpen:M,onClose:ei,customWidth:!0,customWidthData:"",gifModal:!0,children:M&&(0,s.jsx)("div",{className:"z-50 w-screen sm:w-auto max-w-[90vw] sm:max-w-[520px]",children:(0,s.jsx)(h,{onGifClick:ed})})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(a.$n,{onClick:eo,disabled:eh||P,className:"text-14 bg-primary px-6 py-2 text-white rounded-[5px] disabled:cursor-not-allowed",children:P?(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsx)(a.aH,{})}):"Post"}),""===x&&(0,s.jsx)(a.$n,{disabled:P,onClick:eu,className:"rounded-[5px] disabled:cursor-not-allowed disabled:text-grey px-2 py-2 text-12",children:"Generate with AI"})]}),G&&(0,s.jsx)(d,{aiModal:G,handleAIModal:eu,getAIGeneratedData:em})]})]})]});return j||N?(0,s.jsx)("div",{children:ef()}):(0,s.jsx)(r.A,{isOpen:c,onClose:P?()=>{}:es,customWidth:!0,className:"overscroll-contain",children:(0,s.jsx)("div",{className:"min-h-64 mt-6",children:ef()})})}}}]);
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.