PageSourceSearch

https://www.idcolab.com/_next/static/chunks/53859-15da020772c6f12d.js

js idcolab.com collected 2026-10-01 14:29:02 UTC 274,674 bytes, 6 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3ca3a2e2-e8f2-4566-8513-37a100ab5028",e._sentryDebugIdIdentifier="sentry-dbid-3ca3a2e2-e8f2-4566-8513-37a100ab5028")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[53859],{3804:(e,t,l)=>{"use strict";l.d(t,{A:()=>ep});var a=l(95155),r=l(12115),s=l(1213),i=l(15593),n=l(67909),o=l(4087),d=l(41123),c=l(85883),m=l(68959),u=l(58752),p=l(97412),h=l(97721),x=l(32605);let f=e=>(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"currentColor",viewBox:"0 0 18 18",...e,children:[(0,a.jsx)("g",{clipPath:"url(#clip0_2623_10949)",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M9.188 2.126c-.346-.059-.817-.063-1.666-.063-1.437 0-2.46.001-3.234.104-.759.102-1.194.293-1.512.61-.317.316-.507.752-.608 1.506-.104.771-.106 1.787-.106 3.218v3c0 1.43.002 2.445.106 3.216.1.754.291 1.19.608 1.507.318.317.753.507 1.507.608.771.105 1.787.105 3.217.105h3c1.43 0 2.447-.001 3.217-.104.754-.102 1.19-.292 1.506-.61.318-.317.508-.752.61-1.506.103-.77.104-1.787.104-3.217v-.328c0-1.152-.007-1.698-.13-2.11H13.46c-.85 0-1.544 0-2.093-.073-.572-.077-1.069-.244-1.466-.64-.396-.397-.563-.893-.64-1.467-.073-.547-.073-1.242-.073-2.092zm1.124.582V3.75c0 .9.002 1.518.064 1.982.06.449.168.668.321.82.153.153.372.262.82.322.465.062 1.083.064 1.983.064h1.515q-.432-.412-.878-.808l-2.969-2.672q-.42-.384-.855-.75M7.633.938c1.038 0 1.71 0 2.327.236.617.237 1.113.684 1.882 1.376l.08.072 2.969 2.672.093.084c.888.799 1.463 1.316 1.771 2.009s.31 1.465.308 2.66v.495c0 1.379 0 2.47-.114 3.325-.119.879-.368 1.59-.929 2.152-.561.561-1.273.81-2.152.929-.855.114-1.947.114-3.325.114H7.458c-1.378 0-2.47 0-3.325-.114-.879-.119-1.59-.368-2.152-.929-.561-.561-.81-1.273-.929-2.152-.115-.855-.115-1.947-.115-3.325V7.459c0-1.379 0-2.47.115-3.325.119-.879.368-1.59.929-2.153.562-.561 1.275-.81 2.158-.928C4.997.938 6.094.938 7.481.938z",clipRule:"evenodd"})}),(0,a.jsx)("defs",{children:(0,a.jsx)("clipPath",{id:"clip0_2623_10949",children:(0,a.jsx)("path",{fill:"#fff",d:"M0 0h18v18H0z"})})})]}),g=e=>(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"currentColor",viewBox:"0 0 18 18",...e,children:[(0,a.jsxs)("g",{clipPath:"url(#clip0_2623_18384)",children:[(0,a.jsx)("path",{d:"M11.797 2.913c1.075-1.08 2.649-1.103 3.52-.228.873.876.85 2.46-.228 3.54L13.272 8.05a.563.563 0 0 0 .797.794l1.818-1.825c1.433-1.44 1.613-3.736.227-5.128-1.388-1.393-3.68-1.212-5.115.228l-3.635 3.65c-1.433 1.439-1.613 3.736-.227 5.127a.561.561 0 0 0 .923-.61.6.6 0 0 0-.126-.183c-.873-.876-.849-2.46.228-3.54z"}),(0,a.jsx)("path",{d:"M10.864 7.102a.563.563 0 1 0-.798.795c.873.876.85 2.46-.227 3.54l-3.635 3.65c-1.076 1.08-2.65 1.102-3.52.228-.874-.876-.85-2.46.227-3.54L4.729 9.95a.563.563 0 0 0-.798-.794l-1.818 1.825C.68 12.42.5 14.717 1.886 16.109c1.388 1.394 3.68 1.211 5.115-.228l3.635-3.65c1.434-1.438 1.614-3.737.228-5.129"})]}),(0,a.jsx)("defs",{children:(0,a.jsx)("clipPath",{id:"clip0_2623_18384",children:(0,a.jsx)("path",{fill:"#fff",d:"M0 0h18v18H0z"})})})]});var b=l(83021),j=l(6172),w=l(48242),y=l(28079),v=l(36652),k=l(64269),N=l(60642),A=l(49438),I=l(71155);let S=0,C=()=>{let{selectedProject:e}=(0,s.d4)(e=>e.project),{activeCategory:t}=(0,s.d4)(e=>e.fileExplorer),[l,{data:i,error:n,isLoading:o}]=(0,v.OD)(),[d]=(0,v.gl)(),c=(0,s.wA)(),{errorNotify:C}=(0,y.A)(),{activeParentFolderId:E,user:D}=(0,x.A)(),P=(0,s.d4)(e=>e?.projects?.userDetails),T=(0,k.dS)(P),[$,F]=(0,r.useState)(null),R=(0,r.useRef)(null);(0,m.A)(R,()=>c((0,w.lR)()));let L=e=>{c((0,w.lR)()),c((0,w.ll)(e)),c((0,w.ob)(!0))},M=async(a,r)=>{c((0,w.lR)());let s={projectId:e?.guid,parentFolderId:E,userId:D?.userId,displayName:T,category:t,docType:a,docTypeDesc:r,newDoc:!0};try{let e=await l(s);if(e){let t=e?.data?e.data:e;F(t.document_url);let l=t.document_url;window.open(l,"_blank")}n&&console.log("handleSubmit err",n)}catch(e){console.log("handleSubmit err",e)}finally{console.log("Published data",i),console.log("Published error",n)}},O=async l=>{let a=++S;c((0,w.lR)()),c((0,w.hl)(null));try{let r=await d({projectId:e?.guid,parentFolderId:E,userId:D?.userId,displayName:T,category:t,docKind:l}).unwrap(),s=r?.fileId;if(!s)throw Error("create returned no fileId");if(a!==S)return;c((0,w.dF)(s))}catch(e){if(console.log("create univer doc err",e),a!==S)return;c((0,w.zt)()),C("Could not create the document. Please try again.")}},U=async()=>
1{try{c((0,w.lR)()),c((0,w.$j)(null)),c((0,w.L$)(!0))}catch(e){console.log(e)}};return(0,a.jsxs)("div",{ref:R,"data-ignore-outside-click":!0,className:`fixed top-28 right-2 md:right-5 xl:right-7 z-20 flex flex-col p-1 gap-1 dark:text-light-0 ${u.X}`,children:[(0,a.jsxs)("div",{className:"cursor-pointer flex items-center text-sm rounded px-4 hover:bg-light-1  dark:hover:bg-dark-4 font-medium  ",onClick:()=>L(p.NL.FILES),children:[(0,a.jsx)(f,{className:"w-4.5 h-4.5 text-dark-2 dark:text-light-0"}),"  ",(0,a.jsx)("span",{className:"block rounded-sm p-2 text-sm font-semibold  text-dark-2 dark:text-light-0",children:"Files Upload"})]}),(0,a.jsxs)("div",{className:"cursor-pointer flex items-center text-sm rounded-sm px-4  hover:bg-light-1 dark:hover:bg-dark-4 font-medium ",onClick:()=>L(p.NL.FOLDER),children:[(0,a.jsx)(N.A,{className:"w-4.5 h-4.5 text-dark-2 dark:text-light-0"}),(0,a.jsx)("span",{className:"block rounded-sm  p-2 text-sm font-semibold  text-dark-2 dark:text-light-0",children:"New Folder"})]}),(0,a.jsxs)("div",{className:"cursor-pointer flex items-center text-sm rounded-sm px-4  hover:bg-light-1 dark:hover:bg-dark-4 font-medium ",onClick:()=>L(p.NL.LINK),children:[(0,a.jsx)(g,{className:"w-4.5 h-4.5 text-dark-2 dark:text-light-0"})," ",(0,a.jsx)("span",{className:"block rounded-sm p-2 text-sm font-semibold  text-dark-2 dark:text-light-0",children:"Link Upload"})]}),t===p.b7.FILES&&(0,a.jsxs)("div",{className:"cursor-pointer flex items-center text-sm rounded-sm px-4  hover:bg-light-1 dark:hover:bg-dark-4 font-medium ",onClick:()=>h.qu?O("slide"):M(p.xQ.PPTTYPE,p.xQ.PPTTYPEDESC),children:[(0,a.jsx)(j.Uyc,{className:"w-4.5 h-4.5 text-dark-2 dark:text-light-0"})," ",(0,a.jsx)("span",{className:"block rounded-sm p-2 text-sm font-semibold  text-dark-2 dark:text-light-0   ",children:"Create Show"})]}),t===p.b7.MOODBOARD&&(0,a.jsxs)("div",{className:"cursor-pointer flex items-center text-sm rounded-sm px-4  hover:bg-light-1 dark:hover:bg-dark-4 font-medium ",onClick:U,children:[(0,a.jsx)(A.A,{className:"w-4.5 h-4.5 text-dark-2 dark:text-light-0"})," ",(0,a.jsx)("span",{className:"block rounded-sm p-2 text-sm font-semibold  text-dark-2 dark:text-light-0   ",children:"Create Mood Board"})]}),t===p.b7.FILES&&(0,a.jsxs)("div",{className:"cursor-pointer flex items-center text-sm rounded-sm px-4  hover:bg-light-1 dark:hover:bg-dark-4 font-medium ",onClick:()=>O("sheet"),children:[(0,a.jsx)(b.A,{className:"w-4.5 h-4.5 text-dark-2 dark:text-light-0"})," ",(0,a.jsx)("span",{className:"block rounded-sm p-2 text-sm font-semibold  text-dark-2 dark:text-light-0  ",children:"Create Table"})]}),t===p.b7.FILES&&(0,a.jsxs)("div",{className:"cursor-pointer flex items-center text-sm rounded-sm px-4  hover:bg-light-1 dark:hover:bg-dark-4  font-medium ",onClick:()=>O("doc"),children:[(0,a.jsx)(I.A,{className:"w-4.5 h-4.5 text-dark-2 dark:text-light-0"})," ",(0,a.jsx)("span",{className:"block rounded-sm p-2 text-sm font-semibold  text-dark-2 dark:text-light-0   ",children:"Create Document"})]})]})};var E=l(20063),D=l(98734),P=l(42302),T=l(66788),$=l(66137),F=l(17815),R=l(51575),L=l(3750),M=l(5016),O=l(52106),U=l(39670);let B=D.Ik({fileName:D.Yj().min(2,{message:"Must be at least 2 characters long"})}),z=e=>{let{urlNavigation:t=!0}=e,l=(0,s.wA)(),i=(0,E.usePathname)(),{selectedProject:n}=(0,s.d4)(e=>e.project),{parentFolderId:o}=(0,s.d4)(e=>e.projects),{activeCategory:d}=(0,s.d4)(e=>e.fileExplorer),{successNotify:c,errorNotify:m}=(0,y.A)(),{userDetails:u}=(0,F.A)(),{refetch:h}=(0,R.A)(d||""),[x,f]=(0,r.useState)({fileName:"",userId:u?.id,projectId:n?.guid,category:d,parentFolderId:o}),[g,b]=(0,r.useState)({}),[j]=(0,L.qu)(),[v,k]=(0,r.useState)(!1),N=(0,r.useRef)(!0);(0,r.useEffect)(()=>(N.current=!0,()=>{N.current=!1}),[]);let A=()=>{l((0,w.ll)("")),l((0,w.ob)(!1)),l((0,w.$j)(""))},I=async e=>{e.preventDefault(),k(!0);try{if(await j(x).unwrap()){let{data:e}=await h(),a=(0,$.xP)(e,x.parentFolderId),r="ROOT"===x.parentFolderId?e:a?.[a.length-1]?.children,s=(Array.isArray(r)?r:[]).filter(e=>e?.fileCategory===p.NL.FOLDER&&e.fileName===x.fileName).sort((e,t)=>
1e.createdAt<t.createdAt?1:-1)[0],n=N.current;l((0,w.ll)("")),c("Folder Created Successfully"),s&&n&&(e=>{if((0,$.JG)(i)){let l=(0,$.EE)((0,$.hp)(i),e.fileId);t?window.history.pushState(null,"",l):window.history.replaceState(null,"",l)}l((0,w.V)(!1)),l((0,T.AA)(e.fileId)),l((0,w.$j)(e)),l((0,P.X6)(e?.children||[])),l((0,P.bt)(e)),l((0,w.qc)([]))})(s)}}catch(t){let e=t.data||t;e&&m(e.message||e.error||"Folder creation failed. Please try again.")}finally{k(!1)}};return(0,a.jsx)(U.A,{open:!0,onClose:A,title:"New Folder",size:"md",dirty:!!x.fileName,footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(M.Ay,{variant:"outline",type:"button",className:"md:w-22 w-full",onClick:A,children:"Cancel"}),(0,a.jsx)(M.Ay,{variant:"yellow",type:"submit",form:"folder-creation-form",className:"md:w-22 w-full",title:"Create",loading:v,disabled:v||!x.fileName||!!g.fileName})]}),children:(0,a.jsx)("form",{id:"folder-creation-form",onSubmit:e=>I(e),children:(0,a.jsx)(O.Ay,{label:"Folder Name",autoFocus:!0,onChange:e=>(e=>{f(t=>({...t,fileName:e}));try{B.parse({fileName:e}),b({})}catch(e){b({fileName:e.errors[0]?.message})}})(e.target.value),value:x?.fileName,type:"text",id:"fileName",placeholder:"Enter Folder name",required:!0,error:g?.fileName})})})};var q=l(96663),V=l(45193),G=l(87778),_=l(21980),Q=l(9779),H=l(10195),W=l(3914),X=l(41286),J=l(83430),Y=l(95157),K=l(64030),Z=l(15720),ee=l(56690),et=l(67528),el=l(34806);let ea={urlLink:"",name:"",thumbnail:"",attention:""},er=e=>{let t=(e||"").trim();if(!t||/\s/.test(t))return null;let l=/^[a-z][a-z\d+.-]*:\/\//i.test(t)?t:`https://${t}`,a=l.match(/^https?:\/\/([^/?#:@\s]+)(?::\d{1,5})?(?:[/?#]\S*)?$/i);if(!a)return null;let r=a[1].toLowerCase();return"localhost"===r||/^[^.]+(\.[^.]+)+$/.test(r)?l:null},es=e=>{let{message:t}=e;return t?(0,a.jsxs)("p",{className:"mt-1.5 text-sm text-red-1 dark:text-red-2",children:[(0,a.jsx)("span",{className:"font-medium",children:"Oh, snap!"})," ",t,"."]}):null},ei=()=>{let e=(0,s.wA)(),{selectedProject:t}=(0,s.d4)(e=>e.project),{activeCategory:l}=(0,s.d4)(e=>e.fileExplorer),{fetchBlockerCount:i}=(0,et.A)(),{refetch:n}=(0,R.A)(l),[o]=(0,L.YL)(),[d]=(0,L.oQ)(),{successNotify:c,errorNotify:m}=(0,y.A)(),{activeParentFolderId:u}=(0,x.A)(),{userDetails:h}=(0,F.A)(),{selectedFileOrFolder:f,isEditPost:g,postViewModal:b}=(0,s.d4)(e=>e.contextMenu),j=g&&f?.fileCategory===p.NL.LINK?f:null,[v,k]=(0,r.useState)(()=>j?.thumbnailS3Id?{src:`${_.mn}${j.thumbnailS3Id}`,source:"existing"}:null),[N,A]=(0,r.useState)(null),[I,S]=(0,r.useState)(!1),[C,E]=(0,r.useState)(!1),[D,P]=(0,r.useState)(ea),T=t?.guid,$=h?.id,[B,z]=(0,r.useState)([]),q=t?.teamMembers.filter(e=>e?.status!=="inactive"),{currentPost:ei,navigationPath:en}=(0,s.d4)(e=>e.category),[eo,ed]=(0,r.useState)("ROOT");(0,r.useEffect)(()=>{let e="ROOT";ei.posts&&ei.posts.length>0?e=ei.posts[0].parentFolderId||"ROOT":f?e=f.fileCategory===p.NL.FOLDER?f.fileId||"ROOT":f.parentFolderId||"ROOT":en&&en.length>0&&(e=en[en.length-1].fileId||"ROOT"),ed(e)},[ei,f,en]);let[ec]=(0,r.useState)({fileId:j?.fileId||null,name:j?.fileName||"",urlLink:j?.fileLink||"",isFeed:j?j.isFeed||0:1,isBlocker:j?.isBlocker||0,postDescription:j?.postDescription||"",taggedEmails:j?.taggedEmails||[],thumbnailS3Id:j?.thumbnailS3Id||null}),[em,eu]=(0,r.useState)({name:ec.name,urlLink:ec.urlLink,isFeed:ec.isFeed,isBlocker:ec.isBlocker,postDescription:ec.postDescription,taggedEmails:ec.taggedEmails,parentPostId:""}),ep=(0,r.useRef)(!!j),eh=I&&!ep.current,ex=(0,r.useRef)(null),ef=e=>
1P(t=>t[e]?{...t,[e]:""}:t),{data:eg,refetch:eb}=(0,L.m5)({projectId:t?.guid,isBlocker:!1},{skip:!t?.guid}),ej=(0,r.useRef)(null),ew=(0,r.useCallback)(t=>{ej.current?.blur(),e((0,w.J)({isOpen:!0,postId:t}))},[e]),ey=(0,r.useMemo)(()=>(Array.isArray(eg)?eg:[]).filter(e=>e?.postId&&e?.postNumber&&!e?.parentPostId&&e?.category!==p.b7.DISCUSSION).sort((e,t)=>(e.postNumber||0)-(t.postNumber||0)).map(e=>({value:e.postId,label:`#${e.postNumber}-${J.r[e.category]||e.category||""}`,description:(e.postDescription||"").trim(),onView:ew})),[eg,ew]),ev=ey.find(e=>e.value===em.parentPostId)||null,ek=v?.source!==(ec.thumbnailS3Id?"existing":void 0),eN=()=>em.name!==ec.name||em.urlLink!==ec.urlLink||em.isFeed!==ec.isFeed||em.isBlocker!==ec.isBlocker||em.postDescription!==ec.postDescription||JSON.stringify(em.taggedEmails)!==JSON.stringify(ec.taggedEmails)||ek||!!em.parentPostId,eA=async e=>{let t=await fetch("/api/seo/url-to-base64",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({imageUrl:e})});if(!t.ok)return null;let l=await t.json();return"string"==typeof l?.base64?l.base64:null},eI=async e=>{ex.current=e,S(!0);let t=null,l=null;try{let a=await fetch("/api/seo/fetch-og-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})});for(let e of(a.ok&&(t=await a.json()),[t?.ogImage,t?.faviconUrl]))if(e&&(l=await eA(e)))break}catch(e){console.error("Error fetching OG image:",e)}if(ex.current!==e)return;S(!1);let a=String(t?.title||"").trim();a&&"Untitled"!==a&&a!==e&&!ep.current&&(eu(e=>({...e,name:a})),ef("name")),A(l),k(e=>e&&"og"!==e.source?e:l?{src:l,source:"og"}:null),l&&ef("thumbnail")},eS=((e,t)=>{let[l,a]=(0,r.useState)(e);return(0,r.useEffect)(()=>{let l=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(l)}},[e,t]),l})(em.urlLink,1e3),eC=e=>{e.preventDefault();let{name:t,value:l}=e.target;"name"===t&&(ep.current=!0),eu(e=>({...e,[t]:l})),ef(t)};(0,r.useEffect)(()=>{let e=er(eS);if(!e){ex.current=null,S(!1);return}j&&eS===ec.urlLink&&v||eI(e)},[eS]);let eE=e=>{(e=>{e.preventDefault();let t=e.target.files&&e.target.files[0];if(!t)return m("Please select a file.");if(!t.type.match("image/jpeg")&&!t.type.match("image/png"))return m("Please select a JPEG or PNG image.");if(t.size>2097152)return m("File size exceeds 2MB.");let l=new FileReader;l.onload=()=>{k({src:l.result,source:"user"}),ef("thumbnail")},l.onerror=()=>{m("Failed to read the file. Please try again.")},l.readAsDataURL(t)})({preventDefault:()=>{},target:{files:[e]}})},eD=async()=>{try{if(!navigator.clipboard?.read)return void m("Clipboard paste isn't supported here — press Ctrl + V or upload a file.");for(let e of(await navigator.clipboard.read())){let t=e.types.find(e=>e.startsWith("image/"));if(t){let l=await e.getType(t),a="image/png"===l.type?"png":"jpg";eE(new File([l],`pasted-image.${a}`,{type:l.type}));return}}m("No image found in your clipboard.")}catch{m("Couldn't read the clipboard. Check browser permissions or press Ctrl + V.")}},eP=(0,r.useRef)(eE);eP.current=eE,(0,r.useEffect)(()=>{let e=e=>{let t=e.clipboardData?.items;if(t){for(let l of Array.from(t))if(l.type.startsWith("image/")){let t=l.getAsFile();if(t){e.preventDefault(),eP.current(t);return}}}};return window.addEventListener("paste",e),()=>window.removeEventListener("paste",e)},[]);let eT=!!(v&&"og"!==v.source),e$=async()=>{if(C)return;let{url:e,linkChanged:t,errors:a,firstError:r}=(()=>{let e=String(em?.urlLink||""),t=er(e),l=e!==ec.urlLink,a=em.isBlocker!==ec.isBlocker,r=1===em.isBlocker&&0===em.taggedEmails.length&&(a||0===ec.taggedEmails.length),s={urlLink:e.trim()?t||j&&!l?"":"Please enter a valid link":"Please enter a link",name:String(em?.name||"").trim()?"":eh?"Please wait for the name to finish loading":"Please enter a name",thumbnail:v?"":I?"Please wait for the thumbnail to finish loading":"Please upload a thumbnail",attention:r?"Please select attention when blocker is enabled":""},i=s.urlLink||s.name||s.thumbnail||s.attention;return{url:t,linkChanged:l,errors:s,firstError:i}})();if(P(a),r)return void m(r);let s=String(em.name).trim(),u=v&&"existing"!==v.source?v.src:null,p={userId:$,projectId:T,fileName:s,urlLink:e,thumbnailImageData:u,category:l,parentFolderId:eo||"ROOT",postDescription:em?.postDescription||"",isFeed:em?.parentPostId?0:em?.isFeed,isBlocker:em?.isBlocker,taggedEmails:em?.taggedEmails||[],mentionedUserIds:B,...em?.parentPostId&&{parentPostId:em.parentPostId}},h={userId:$,fileId:ec?.fileId,projectId:T,createdAt:j?.createdAt};if(s!==ec.name&&(h.fileName=s),t&&(h.fileLink=e),em.isFeed!==ec.isFeed&&(h.isFeed=em.isFeed),em.isBlocker!==ec.isBlocker&&(h.isBlocker=em.isBlocker),em.postDescription!==ec.postDescription&&(h.postDescription=em.postDescription),JSON.stringify(em.taggedEmails)!==JSON.stringify(ec.taggedEmails)&&
1(h.taggedEmails=em.taggedEmails),u&&(h.thumbnailImageData=u),j&&Object.keys(h).length<=4)return void m("No changes to update");E(!0);try{j?(h={...h,fileName:s,fileLink:t?e:ec.urlLink,isFeed:em?.isFeed,isBlocker:em?.isBlocker},await d(h).unwrap()&&(console.log("Update successful, refetching data for category:",l),await n(),console.log("Refetch completed"),eR(),c("Updated Successfully"))):await o(p).unwrap()&&(console.log("Create successful, refetching data for category:",l),await n(),console.log("Refetch completed"),p.parentPostId&&eb(),eR(),c("Link Created Successfully")),(1===p.isBlocker||1===h.isBlocker)&&i(T)}catch(t){console.error("Error in handleSubmit:",t);let e=t.data||t;if(e){let t=e.message||e.error;m(String(t).includes("Validation")?"Required fields are missing.":t||"Link operation failed. Please try again.")}}finally{E(!1)}},eF=async e=>{e.preventDefault(),await e$()},eR=()=>{e((0,w.ll)("")),e((0,w.ob)(!1)),e((0,w.fd)(!1)),e((0,w.$j)(""))},eL=document.documentElement.classList.contains("dark"),eM={container:e=>({...e,width:"100%"}),control:e=>({...e,backgroundColor:"transparent",border:"none",boxShadow:"none",padding:"0",minHeight:"auto"}),valueContainer:e=>({...e,padding:"8px 12px"}),input:e=>({...e,color:eL?"var(--color-light-0)":"var(--color-dark-3)",margin:"0",padding:"0"}),singleValue:e=>({...e,color:eL?"var(--color-light-0)":"var(--color-dark-3)",fontSize:"14px"}),placeholder:e=>({...e,color:eL?"var(--color-light-0)":"var(--color-light-5)",fontSize:"14px"}),menu:(e,t)=>({...H.M.menu(e,t),marginTop:"4px",zIndex:9999}),menuPortal:H.M.menuPortal,menuList:(e,t)=>({...H.M.menuList(e,t),padding:"4px 0",maxHeight:"200px"}),option:(e,t)=>({...H.M.option(e,t),padding:"8px 12px",cursor:"pointer"}),indicatorSeparator:e=>({...e,display:"none"}),dropdownIndicator:e=>({...e,color:eL?"var(--color-light-5)":"var(--color-dark-6)",padding:"0 8px","&:hover":{color:eL?"var(--color-light-4)":"var(--color-dark-4)"}})};return(0,r.useEffect)(()=>{f&&console.log("selectedFileOrFolder",f)},[f]),(0,a.jsxs)(U.A,{open:!0,onClose:eR,title:"Upload link",size:"lg",closable:!b?.isOpen,dirty:eN(),footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(M.Ay,{variant:"outline",type:"button",onClick:eR,className:"h-9.5 md:w-22 w-full",children:"Cancel"}),(0,a.jsx)(M.Ay,{variant:"yellow",type:"button",className:"h-9.5 md:w-22 w-full",loading:C,disabled:C||!!(j&&!eN()),onClick:e$,title:"Upload"})]}),children:[(0,a.jsx)(G.A,{className:"mb-4",ownerUserId:t?.userId}),(0,a.jsxs)("form",{className:"space-y-4 flex flex-col gap-5",action:"#",noValidate:!0,onSubmit:eF,children:[(0,a.jsx)("div",{className:"mb-0!",children:(0,a.jsx)(O.Ay,{label:"Link",type:"text",name:"urlLink",id:"urlLink",placeholder:"Enter link",value:em?.urlLink||"",onChange:eC,error:D.urlLink,required:!0})}),(0,a.jsx)("div",{className:"mb-0!",children:eh?(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:O.I8,children:["Name",(0,a.jsx)("span",{className:"ml-0.5 text-red-2",children:"*"})]}),(0,a.jsx)("div",{role:"status","aria-label":"Loading name",className:"flex h-10 items-center",children:(0,a.jsx)(ee.A,{className:"h-5 w-5"})}),(0,a.jsx)(es,{message:D.name})]}):(0,a.jsx)(O.Ay,{label:"Name",type:"text",name:"name",id:"name",placeholder:"Enter name",value:em?.name||"",onChange:eC,error:D.name,required:!0})}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 !mb-0",children:[(0,a.jsxs)("label",{className:O.I8,children:["Thumbnail ",(0,a.jsx)("span",{className:"text-red-2",children:"*"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)(Z.A,{shape:"square",size:120,value:v?.src??null,loading:I,onFileSelected:eE,onRemove:eT?()=>{if(N)return void k({src:N,source:"og"});k(null);let e=er(em.urlLink);e&&eI(e)}:void 0,onError:e=>m(e)}),(0,a.jsxs)("div",{className:"flex flex-col items-start gap-1.5",children:[(0,a.jsx)(M.Ay,{variant:"outline",size:"sm",type:"button",onClick:eD,icon:(0,a.jsx)(el.A,{className:"h-4 w-4"}),iconPosition:"left",children:"Paste from clipboard"}),(0,a.jsx)("p",{className:"text-xs text-dark-6 dark:text-light-5",children:"Or press Ctrl + V to paste a copied image."})]})]}),(0,a.jsx)(es,{message:D.thumbnail})]}),(0,a.jsx)("div",{className:"!mb-0",children:(0,a.jsx)(K.A,{label:"Post Description (Optional)",id:"postDescription",name:"postDescription",rows:4,value:em?.postDescription||"",onChange:e=>{eu(t=>({...t,postDescription:e}))},members:q||[],onMentionsChange:e=>{z(e.map(e=>
1e?.id!=null?String(e.id):"").filter(Boolean))},placeholder:"Enter description here \xb7 type @ to mention"})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 !mb-0",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:O.I8,children:"Attention (Optional)"}),(0,a.jsx)(W.A,{teamMembers:q||[],value:em?.taggedEmails||[],onChange:e=>{eu(t=>({...t,taggedEmails:e})),ef("attention")},isClearable:!0,name:"colors",placeholder:"Select audience"}),(0,a.jsx)(es,{message:D.attention})]}),!g&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"linkToPost",className:O.I8,children:"Link to Post (Optional)"}),(0,a.jsx)("div",{className:"dark:bg-dark-3 dark:border-dark-5 text-base dark:!text-light-0   rounded-xl bg-light-2  focus-within:ring-purple/50 focus-within:border-purple/50   border-2 border-light-3",children:(0,a.jsx)(Q.Ay,{ref:ej,styles:eM,isMulti:!1,isClearable:!0,name:"linkToPost",inputId:"linkToPost",value:ev,options:ey,onChange:e=>{eu(t=>({...t,parentPostId:e?.value||""}))},className:"basic-single-select",classNamePrefix:"select",placeholder:"Select a post",components:{Option:X.A},noOptionsMessage:()=>"No posts found",menuPortalTarget:"undefined"!=typeof document?document.body:void 0,menuPosition:"fixed"})})]})]}),(0,a.jsxs)("div",{className:"border p-2  h-9.5  border-light-2 dark:border-dark-4  flex flex-row items-center gap-4 roun
1ded-xl bg-light-2  dark:bg-dark-2 !mb-0",children:[(0,a.jsx)("div",{className:"w-[181px] h-9.5",children:(0,a.jsxs)("label",{className:" h-10 gap-2 flex items-center cursor-pointer select-none text-dark-2 dark:text-light-0",children:[(0,a.jsx)(Y.A,{checked:1===em.isBlocker,onChange:()=>{eu(e=>({...e,isBlocker:+(1!==e.isBlocker)})),ef("attention")}}),(0,a.jsx)("div",{className:"text-dark-2 text-sm font-semibold dark:text-light-0",children:"Blocker"})]})}),(0,a.jsx)("span",{className:"h-5 w-0.5 bg-light-3"}),(0,a.jsx)("div",{className:"w-[181px] h-9.5 flex  justify-start",children:(0,a.jsxs)("label",{className:" gap-2 h-10 flex items-center cursor-pointer select-none text-dark-2 dark:text-light-0 ",children:[(0,a.jsx)(Y.A,{disabled:g,checked:1===em.isFeed,onChange:()=>{eu(e=>({...e,isFeed:+(1!==e.isFeed)}))}}),(0,a.jsx)("div",{className:"text-dark-2 text-sm font-semibold dark:text-light-0",children:"Feeds"})]})})]})]}),(0,a.jsx)(V.default,{})]})};var en=l(31972),eo=l(42108),ed=l(48878),ec=l(29545);l(70631);let em=(0,n.default)(()=>Promise.all([l.e(78882),l.e(6327),l.e(81857),l.e(93048)]).then(l.bind(l,81857)),{loadableGenerated:{webpack:()=>[81857]},ssr:!1}),eu=(0,n.default)(()=>Promise.resolve().then(l.bind(l,45193)),{loadableGenerated:{webpack:()=>[45193]},ssr:!1}),ep=e=>{let{sideBySide:t,hideCheckBox:l=!1,hideContextMenu:n=!1,urlNavigation:m=!0}=e,u=(0,s.wA)(),h=(0,r.useRef)(null),{isPublicSharing:x}=(0,ec.A)(),[f,g]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e=()=>{g(window.innerWidth<=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let{selectedFileOrFolder:b,contextMenuData:j,viewerModal:y,imageIndex:v,selectedIds:k}=(0,s.d4)(e=>e.contextMenu),N=(0,s.d4)(e=>e?.category?.categoryData),A=(0,s.d4)(e=>e?.category?.isLoading),{openCreation:I,uploadType:S,isAddEditModalOpen:E}=(0,ed.A)(),D=Array.isArray(N)?N:[],P=D.filter(e=>e?.fileCategory===p.NL.FOLDER).sort((e,t)=>new Date(t.updatedAt||t.createdAt).getTime()-new Date(e.updatedAt||e.createdAt).getTime()),T=D.filter(e=>e?.fileCategory===p.NL.FILES).sort((e,t)=>new Date(t.updatedAt||t.createdAt).getTime()-new Date(e.updatedAt||e.createdAt).getTime()),$=["jpg","jpeg","png","gif","bmp","webp"];T.filter(e=>{if(e?.fileType&&e?.fileType?.startsWith("image/"))return!["panorama","sidebyside"].includes(e?.category);let t=e?.fileName?.split(".").pop().toLowerCase();return!!$?.includes(t)&&!["panorama","sidebyside"].includes(e?.category)});let F=D.filter(e=>e?.fileCategory===p.NL.LINK).sort((e,t)=>new Date(t.updatedAt||t.createdAt).getTime()-new Date(e.updatedAt||e.createdAt).getTime()),R=(e,t,l)=>{let a,r;e.preventDefault();let s=window.innerWidth,i=window.innerHeight,n=e.clientY,o=i-e.clientY,d=e.clientX,c=s-e.clientX;if(a=o>=300?e.clientY:n>=300?e.clientY-300:Math.max(10,Math.min(e.clientY,i-300-10)),r=c>=200?e.clientX:d>=200?e.clientX-200:Math.max(10,Math.min(e.clientX,s-200-10)),u((0,w.$7)({x:r,y:a,item:t,type:l})),u((0,w.$j)(t)),u((0,w.ll)(l)),!k.some(e=>e.fileId===t.fileId)){let e={fileId:t.fileId,fileName:t.fileName,parentFolderId:t.parentFolderId};u((0,w.qc)([e]))}};return(Array.isArray(T)?T:[]).map(e=>({src:(0,_.dE)(e?.fileS3Id),alt:"Checking"})),(0,r.useEffect)(()=>{(0,i.initLightboxJS)("Key","License_Type")}),(0,r.useEffect)(()=>{let e=e=>{let t=e.target,l=t.closest('[data-item-type="folder"]')||t.closest('[data-item-type="file"]')||t.closest('[data-item-type="link"]'),a=t.closest("[data-ignore-outside-click]");h.current&&h.current.contains(t)&&!l&&!a&&(u((0,w.$j)(null)),u((0,w.qc)([])),u((0,w.V)(!1)),u((0,w.lR)()))};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[u,b]),(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{ref:h,className:"flex flex-col gap-4 px-2 md:px-1 py-1 overflow-y-auto rounded-lg md:rounded-2xl h-full w-full dark:bg-transparent max-h-[75dvh] md:max-h-full",children:[A&&(0,a.jsx)(en.A,{}),(0,a.jsx)("section",{className:`py-0 dark:bg-transparent w-full ${0===P.length?"hidden":"grid"} md:grid-cols-2 grid-cols-1 gap-5 max-lg:gap-2.5`,children:P.length>0&&P.map((e,t)=>(0,a.jsx)("div",{"data-item-type":"folder",className:"group hover:text-dark-2",onContextMenu:t=>R(t,e,"Folder"),children:(0,a.jsx)(o.A,{item:e,hideCheckBox:l,urlNavigation:m},t)},e?.fileId??t))}),(0,a.jsx)("section",{className:` w-full   ${x?"pt-8":""}  dark:bg-transparent `,children:(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 xl:grid-cols-4 justify-between gap-5 max-lg:gap-2.5",children:T.length>0&&T.map((e,r)=>(0,a.jsx)("div",{"data-item-type":"file",onContextMenu:t=>R(t,e,"Files"),children:(0,a.jsx)(d.A,{hideCheckBox:l,data:e,selectedIndex:r,sideBySide:t,imageList:T})},e?.fileId??r))})}),(0,a.jsx)("section",{className:`w-full ${x?"pt-8":""}  dark:bg-transparent `,children:(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 xl:grid-cols-4 justify-between gap-5 max-lg:gap-2.5",children:F.length>0&&F.map((e,t)=>(0,a.jsx)("div",{"data-item-type":"link",onContextMenu:t=>R(t,e,"Link"),children:(0,a.jsx)(c.A,{hideCheckBox:l,index:t,data:e},t)},e?.fileId??t))})}),!n&&j&&(0,a.jsx)(eo.A,{type:j?.type,x:j?.x,y:j?.y,data:j?.item}),I&&(0,a.jsx)(C,{}),S===p.NL.FOLDER&&E&&(0,a.jsx)(z,{urlNavigation:m}),(0,a.jsx)(q.A,{folders:P,files:T,links:F}),S===p.NL.LINK&&E&&(0,a.jsx)(ei,{}),y&&b?.fileId&&(0,a.jsx)(em,{}),(0,a.jsx)(eu,{})]})})}},4068:(e,t,l)=>{"use strict";l.d(t,{DC:()=>i,SO:()=>r,Vk:()=>n});var a=l(97412);let r=[a.b7.DISCUSSION,a.b7.SURVEY,a.b7.MOODBOARD],s=new Set(["show","writer","sheet","zdoc","zsheet","zppt","doc","docx","odt","rtf","txt","html","htm","word","documents","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.oasis.opendocument.text","xls","xlsx","csv","tsv","ods","excel","spreadsheet","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/csv","ppt","pptx","pps","ppsx","odp","presentation","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/ppt","application/pptx"].map(e=>e.toLowerCase())),i=e=>!(!e||r.includes(e.category||""))&&e.fileCategory!==a.NL.LINK&&!((e,t)=>{if((0,a.uA)(e))return!0;let l=(e||"").toLowerCase();if(l&&s.has(l))return!0;let r=(t||"").toLowerCase(),i=r.includes(".")&&r.split(".").pop()||"";return!!i&&s.has(i)})(e.fileType,e.fileName),n=e=>`R${e||1}`},4087:(e,t,l)=>{"use strict";l.d(t,{A:()=>N});var a=l(95155),r=l(1213),s=l(15239),i=l(12115),n=l(20063),o=l(66137),d=l(64269),c=l(70631),m=l(21980),u=l(42302),p=l(66788),h=l(29545),x=l(48242),f=l(97412),g=l(95157),b=l(10610),j=l(71155),w=l(44512),y=l(32509),v=l(80675);let k=e=>{let{thumbnailS3Id:t,file:l,index:r}=e,[n,o]=(0,i.useState)(!1),[d,c]=(0,i.useState)(!0),u=l?.fileType||l?.posts?.[0]?.fileType||"",p=l?.fileName||"",h=l?.category||"",x=l?.fileS3Id||l?.posts?.[0]?.fileS3Id||"",g="application/pdf"===u||p.toLowerCase().endsWith(".pdf"),j=u.startsWith("image/")||p.match(/\.(jpg|jpeg|png|gif|webp|svg)$/i),y=u.startsWith("video/")||p.match(/\.(mp4|avi|mov|webm)$/i)||h===f.b7.Videos,k=h===f.b7.ThreeDModels||u.
1includes("model/"),N=t?(0,m.dE)(t):(0,m.Wm)(x,"thumbnail.jpg"),A=y&&x?N:String(t).includes("http")?t:t?(0,m.dE)(t):null;return(0,a.jsx)("div",{className:"w-full h-auto overflow-hidden rounded-xl border border-light-3 dark:border-dark-4 bg-light-2 dark:bg-dark-3 relative min-h-25",children:A&&!n?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{show:d,scrim:"light",rounded:"xl",spinnerClassName:"w-6 h-6"}),(0,a.jsx)(s.default,{src:A,alt:`Preview of ${p||"file"}`,className:"object-cover w-full h-full",width:250,height:250,onLoad:()=>c(!1),onError:()=>{console.warn(`Failed to load thumbnail for: ${p||r}`,{thumbnailUrl:A,fileId:l?.fileId,thumbnailS3Id:t}),o(!0),c(!1)},unoptimized:!0})]}):(0,a.jsx)("div",{className:"w-full h-full min-h-25 flex items-center justify-center bg-light-3 dark:bg-dark-3",children:g?(0,a.jsx)(w.D0,{className:"w-10 h-12"}):k?(0,a.jsx)(w.G$,{className:"w-12 h-12"}):j?(0,a.jsx)("div",{className:"text-xs text-dark-5",children:"Image"}):y?(0,a.jsx)("div",{className:"text-xs text-dark-5",children:"Video"}):(0,a.jsx)(b.A,{className:"w-12 h-12 text-dark-5"})})})},N=e=>{let{item:t,hideCheckBox:l=!0,urlNavigation:s=!0}=e,m=(0,r.wA)(),{isPublicSharing:f}=(0,h.A)(),w=(0,n.useRouter)(),v=(0,n.usePathname)(),N=(0,d.dS)(t?.userDetails),{selectedIds:A}=(0,r.d4)(e=>e.contextMenu),I=Array.isArray(A)&&A.some(e=>e.fileId===t.fileId),[S,C]=(0,i.useState)(null),[E,D]=(0,i.useState)(!1),[P,T]=(0,i.useState)(!1);(0,i.useEffect)(()=>{let e=()=>{D(window.innerWidth<=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,i.useEffect)(()=>{T(I)},[I]);let $=async e=>{e.preventDefault(),f||(s&&(0,o.JG)(v)?w.push((0,o.EE)((0,o.hp)(v),t.fileId)):(0,o.Dl)(w,v,t.fileId)),m((0,x.V)(!1)),m((0,p.AA)(t.fileId)),m((0,x.ob)(!1)),m((0,x.$j)(t)),m((0,u.X6)(t?.children||[])),m((0,u.bt)(t)),m((0,x.qc)([]))},F=e=>{let l=e.currentTarget.checked;T(l);let a={fileId:t.fileId,fileName:t.fileName,parentFolderId:t.parentFolderId};l?(m((0,x.$j)(t)),m((0,x.V)(!0)),A.some(e=>e.fileId===t.fileId)||m((0,x.RG)(a))):(m((0,x.RG)(a)),0===(Array.isArray(A)?A.filter(e=>e.fileId!==t.fileId).length:0)&&(m((0,x.$j)(null)),m((0,x.V)(!1))))},R=t.children.filter(e=>"Files"===e.fileCategory||"Link"===e.fileCategory).sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime());return(0,a.jsx)("div",{onDoubleClick:E?void 0:$,onClick:E?$:e=>{e.preventDefault(),e.stopPropagation();let l={fileId:t.fileId,fileName:t.fileName,parentFolderId:t.parentFolderId};m((0,x.$j)(t)),m((0,x.V)(!0)),e.ctrlKey||e.metaKey?m((0,x.RG)(l)):m((0,x.qc)([l]))},onTouchStart:e=>{let t=Date.now();S&&t-S<300&&$(e),C(t)},className:`group flex w-full h-75 md:aspect-square justify-between rounded-xl shadow-sm border-light-3 dark:border-dark-4 border-[1.5px] bg-light-0 dark:bg-dark-3 transition-shadow hover:shadow-md
2                   ${I?"ring-2 ring-light-4 dark:ring-light-6 ring-offset-0 border-light-4 dark:border-light-6 bg-light-2/60 dark:bg-dark-4/50":""}`,children:0===R.length?(0,a.jsxs)("div",{className:"flex flex-col justify-between w-full gap-2 max-lg:gap-1.5 border-light-3 dark:border-dark-4 p-2.5 max-lg:p-2 rounded-xl",children:[(0,a.jsx)("div",{className:"flex w-full h-full",children:(0,a.jsxs)("div",{className:"flex justify-center items-center bg-light-2 dark:bg-dark-4 w-full h-full rounded-xl relative group",children:[!l&&(0,a.jsx)(y.A,{selected:!!P,cardSelector:".group",checkbox:(0,a.jsx)(g.A,{"aria-label":`Select ${t?.fileName||"folder"}`,checked:!!P,onChange:F,onClick:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),className:"transition-opacity duration-300"})}),(0,a.jsx)("div",{className:"flex mr-1 h-6 w-6 md:h-11 md:w-14 items-center justify-center rounded-md",children:(0,a.jsx)(j.A,{className:"stroke-1 text-dark-5 dark:text-light-5"})})]})}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 col-span-full max-lg:gap-0",children:[(0,a.jsxs)("div",{className:"cursor-default flex flex-col justify-between md:gap-3 gap-2.5 h-full",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(b.A,{className:"w-6 h-6 text-dark-2 dark:text-light-0"}),(0,a.jsx)("span",{className:"text-sm md:text-base font-semibold text-dark-2 dark:text-light-0 wrap-break-word truncate max-xl:max-w-25",title:t.fileName,children:t.fileName})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-dark-5 dark:text-light-5 max-lg:text-xs",children:"Author"}),(0,a.jsx)("p",{className:"text-dark-2 dark:text-light-0 text-xs font-semibold max-xl:text-xs max-md:max-w-25 max-lg:truncate max-xl:truncate max-lg:max-w-25 max-sm:max-w-32.5",children:N})]})]}),(0,a.jsxs)("div",{className:"cursor-default flex flex-col justify-between md:gap-3 gap-2.5 h-full ",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1 text-dark-2 dark:text-light-0",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-dark-5 dark:text-light-0",children:"Created date:"}),(0,a.jsx)("p",{className:"font-semibold text-xs max-lg:text-xs max-lg:truncate max-w-25",children:(0,c.d$)(t?.createdAt)})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 text-xs text-dark-2 dark:text-light-0",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-dark-5 dark:text-light-0",children:"Last Modified:"}),(0,a.jsx)("p",{className:"font-semibold text-xs max-lg:text-xs max-lg:truncate max-w-25",children:(0,c.d$)(t?.updatedAt||t?.createdAt)})]})]})]})]}):(0,a.jsx)(a.Fragment,{children:R.length>0&&(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:`w-full grid gap-2 relative p-2.5 max-lg:p-2 rounded-xl border-light-3 dark:border-dark-4 ${1===R.length?"grid-cols-1 grid-rows-1":2===R.length?"grid-cols-2 grid-rows-1":3===R.length?"grid-cols-3 grid-rows-1":"grid-cols-2 grid-rows-1"}`,children:[!l&&(0,a.jsx)(y.A,{selected:!!P,cardSelector:".group",checkbox:(0,a.jsx)(g.A,{"aria-label":`Select ${t?.fileName||"folder"}`,checked:!!P,onChange:F,onClick:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),className:"transition-opacity duration-300"})}),(0,a.jsx)("div",{className:`col-span-full grid gap-2 ${1===R.length?"grid-cols-1":2===R.length?"grid-cols-2":3===R.length?"grid-cols-3":"grid-cols-2"}`,children:R.slice(0,4).map((e,t)=>{let l=e?.thumbnailS3Id||e?.posts?.[0]?.thumbnailS3Id||null,r=l&&""!==String(l).trim()&&"undefined"!==l&&"null"!==l;return(0,a.jsx)(k,{thumbnailS3Id:r?l:null,file:e,index:t},`${e?.fileId||t}-${e?.fileName||t}`)})}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 col-span-full max-lg:gap-0",children:[(0,a.jsxs)("div",{className:"cursor-default flex flex-col justify-between md:gap-3 gap-2.5 h-full",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(b.A,{className:"w-6 h-6 text-dark-2 dark:text-light-0"}),(0,a.jsx)("span",{className:"text-sm md:text-base font-bold text-dark-2 dark:text-light-0 wrap-break-word truncate max-xl:max-w-25",children:t.fileName})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-dark-2 dark:text-light-0 max-lg:text-xs",children:"Author"}),(0,a.jsx)("p",{className:"text-dark-2 dark:text-light-0 text-xs font-semibold max-xl:text-xs max-md:max-w-25 max-lg:truncate max-xl:truncate max-lg:max-w-25 max-sm:max-w-32.5",children:N})]})]}),(0,a.jsxs)("div",{className:"cursor-default flex flex-col justify-between md:gap-3 gap-2.5 h-full",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1 text-dark-2 dark:text-light-0",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-dark-5 dark:text-light-0",children:"Created date:"}),(0,a.jsx)("p",{className:"font-semibold text-xs max-lg:text-xs dar
2k:text-light-0 max-lg:truncate max-w-25",children:(0,c.d$)(t?.createdAt)})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 text-xs text-dark-2 dark:text-light-0",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-dark-5 dark:text-light-0",children:"Last Modified:"}),(0,a.jsx)("p",{className:"font-semibold text-xs max-lg:text-xs dark:text-light-0 max-lg:truncate max-w-25",children:(0,c.d$)(t?.updatedAt||t?.createdAt)})]})]})]})]})})})})}},9970:(e,t,l)=>{"use strict";l.d(t,{EK:()=>r,RL:()=>n,RO:()=>c,Vz:()=>d,Y9:()=>i,ct:()=>m,fL:()=>o,jk:()=>s});let a="0.25.1",r=(e,t)=>({format:"univer-snapshot",formatVersion:1,univerVersion:a,docKind:e,snapshot:t}),s=(e,t)=>{if(null==e||"object"!=typeof e)throw Error("Stored document is not valid snapshot JSON");return"univer-snapshot"===e.format?{format:"univer-snapshot",formatVersion:e.formatVersion??1,univerVersion:e.univerVersion??null,docKind:e.docKind??t,snapshot:e.snapshot&&"object"==typeof e.snapshot?e.snapshot:null}:{format:"univer-snapshot",formatVersion:1,univerVersion:null,docKind:t,snapshot:e}},i=e=>{let t=document.createElement("div");return t.style.width="100%",t.style.height="100%",e.appendChild(t),t},n=()=>"undefined"!=typeof document&&document.documentElement.classList.contains("dark"),o=e=>{let t=t=>{let l=t.detail;e("boolean"==typeof l?.isDark?l.isDark:n())};return window.addEventListener("themechange",t),()=>window.removeEventListener("themechange",t)},d=()=>{"undefined"!=typeof document&&document.documentElement.classList.remove("univer-dark")},c=e=>{let t=e instanceof Error?e.message:"string"==typeof e?e:"";return t?t.slice(0,300):void 0},m=(e,t)=>({message:(e=>e.univerVersion&&e.univerVersion!==a?`This document was saved with a different editor version (${e.univerVersion}, current ${a}) and could not be loaded. The stored file has not been changed.`:"This document could not be loaded. The stored file has not been changed.")(e),detail:c(t)})},11910:(e,t,l)=>{"use strict";l.d(t,{A:()=>j});var a=l(95155),r=l(12115),s=l(28079),i=l(39670),n=l(69268),o=l(70631),d=l(99553),c=l(33922),m=l(64269),u=l(93952),p=l(1213),h=l(48376),x=l(99857),f=l(5016),g=l(52106),b=l(62940);let j=e=>{let{toggleAddUserModal:t,isEdit:l,values:j,onChange:w}=e,y=(0,p.wA)(),{selectedProjectId:v}=(0,p.d4)(e=>e.project),{userDetails:k}=(0,p.d4)(e=>e.projects),N=(0,o._S)(k?.plan),[A,I]=(0,r.useState)(!1),{successNotify:S,errorNotify:C}=(0,s.A)(),[E,{isLoading:D,isError:P}]=(0,u.nR)(),[T]=(0,h.RG)(),$=async()=>{let e={sharingProject:1,email:j?.email,projectId:v||"",projectOrFileId:v||"",category:"project",role:j?.role||"-",accessRights:j?.accessRights};return await E(e).unwrap()},[F,{isLoading:R}]=(0,c.cz)(),L=(e,t)=>{w({...j,[t]:e})};(0,r.useEffect)(()=>{!N||l||j?.accessRights||L("edit","accessRights")},[]);let M=async e=>{e.preventDefault();let a=async e=>{if(e){let l=await T(v??""),a=e?.body||e,{message:r}="string"==typeof a?JSON.parse(a):a;S(r||"User added successfully."),y((0,x.NR)(l?.data)),t()}else C("Adding collaborator failed.")};try{let e;if(l){if(!j?.publicAccessId)return void C("Project owner details cannot be updated from here. Please use Profile Settings.");e=await F({newAccessRights:j?.accessRights,...j}).unwrap()}else e=await $();await a(e)}catch(t){let e=t?.data||t?.error||t;C((0,m.hO)(e?.errors)||e?.message||e?.error||(P?"Adding collaborator failed.":"Update failed. Please try again."))}};return(0,a.jsxs)(i.A,{open:!0,onClose:()=>t(),title:l?"Edit User":"Add New User",size:"md",dirty:!l&&!!j?.email,footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(f.Ay,{variant:"outline",type:"button",className:"md:w-22 w-full",onClick:()=>t(),children:"Cancel"}),(0,a.jsx)(f.Ay,{variant:"yellow",type:"submit",form:"add-user-form",className:"md:w-22 w-full",loading:D||R,title:l?"Update":"Create"})]}),children:[(0,a.jsxs)("form",{id:"add-user-form",className:"space-y-5",onSubmit:M,children:[(0,a.jsx)(g.Ay,{label:"Email",type:"email",name:"email",id:"email",value:j?.email,placeholder:"Enter email address",onChange:e=>{let{name:t,value:l}=e.target;w({...j,[t]:l})},required:!0,disabled:l}),(0,a.jsx)(b.A,{id:"accessRights",label:"Access",value:j?.accessRights||"",disabled:l&&!j?.publicAccessId,onChange:e=>{if(N&&"edit"!==e)return void I(!0);L(e,"accessRights")},placeholder:"Select access",options:d.Xo})]}),(0,a.jsx)(n.A,{show:A,onClose:()=>I(!1),currentPlan:k?.plan,limitType:"permissions"})]})}},13853:(e,t,l)=>{"use strict";l.d(t,{A:()=>s,B:()=>r});var a=l(95155);l(12115);let r="inline-flex items-center justify-center text-xs font-semibold rounded-md px-2 h-7 bg-light-2 dark:bg-dark-3 text-dark-3 dark:text-light-0 border border-light-3 dark:border-dark-4",s=e=>{let{version:t}=e;return(0,a.jsx)("span",{className:r,children:t})}},14054:(e,t,l)=>{"use strict";l.d(t,{V:()=>n});var a=l(1213),r=l(29545);let s=e=>String(e?.emailAddress??e?.email??""),i=e=>e?.userId??e?.id??e?._id??e?.user?.id??e?.user?._id,n=()=>{let{selectedProject:e}=(0,a.d4)(e=>e.project),{projects:t}=(0,a.d4)(e=>e.projects),{isFeed:l}=(0,r.A)(),n=Object.values((l?t||[]:e?[e]:[]).reduce((e,t)=>
2((t?.teamMembers||[]).forEach(t=>{if(t?.status==="inactive")return;let l=s(t).toLowerCase()||i(t);l&&(!e[l]||!i(e[l])&&i(t))&&(e[l]=t)}),e),{})).sort((e,t)=>((e.firstName||"")+(e.lastName||"")).localeCompare((t.firstName||"")+(t.lastName||""))),o=n.map(e=>{let t=i(e)??s(e);return{label:s(e),value:null!=t?String(t):void 0,icon:e?.fileS3Id,showIcon:!0,firstName:e?.firstName,lastName:e?.lastName,email:s(e)}}).filter(e=>null!=e.value),d=n.map(e=>({label:[e?.firstName,e?.lastName].filter(Boolean).join(" ").trim()||s(e),value:s(e)||void 0,icon:e?.fileS3Id,showIcon:!0,firstName:e?.firstName,lastName:e?.lastName,email:s(e)})).filter(e=>!!e.value);return{members:n,postedByOptions:o,attentionOptions:d}}},14178:(e,t,l)=>{"use strict";l.d(t,{A:()=>m});var a=l(95155),r=l(12115),s=l(61210),i=l(34699),n=l(64269),o=l(27107);let d=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=e=>{let t=(0,n.dS)(e);return t&&"unknown"!==t?t:e?.emailAddress||e?.email||"user"},m=e=>{let{text:t,showPreview:l=!0,className:n="",members:m=[]}=e,[u,p]=(0,r.useState)(null),h=(0,r.useMemo)(()=>{let e=(m||[]).map(c).filter(Boolean).sort((e,t)=>t.length-e.length);return e.length?RegExp("@("+e.map(d).join("|")+")(?!\\w)","g"):null},[m]);if(!t)return null;let x=(e=>{let t,l=[],a=new RegExp(o._t),r=0;for(;null!==(t=a.exec(e));)t.index>r&&l.push({type:"text",value:e.slice(r,t.index)}),l.push({type:"url",value:t[0]}),r=t.index+t[0].length;return r<e.length&&l.push({type:"text",value:e.slice(r)}),l})(t),f=x.filter(e=>"url"===e.type).map(e=>(0,o.rK)(e.value))[0],g=0;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:`whitespace-pre-wrap wrap-break-word ${n}`,children:x.map((e,t)=>"url"===e.type?(0,a.jsx)("a",{href:(0,o.rK)(e.value),target:"_blank",rel:"noopener noreferrer",className:"break-all text-purple underline underline-offset-2 hover:opacity-80 dark:text-yellow",children:e.value},t):(0,a.jsx)(r.Fragment,{children:(e=>{let t;if(!h)return e;let l=[],s=new RegExp(h),i=0;for(;null!==(t=s.exec(e));){t.index>i&&l.push((0,a.jsx)(r.Fragment,{children:e.slice(i,t.index)},g++));let s=(m||[]).find(e=>c(e)===t[1]);l.push((0,a.jsx)("button",{type:"button",onClick:()=>s&&p(s),className:"cursor-pointer rounded bg-purple/10 px-1 font-medium text-purple transition-colors hover:bg-purple/20 dark:bg-yellow/10 dark:text-yellow dark:hover:bg-yellow/20",children:t[0]},g++)),i=t.index+t[0].length}return i<e.length&&l.push((0,a.jsx)(r.Fragment,{children:e.slice(i)},g++)),l})(e.value)},t))}),l&&f&&(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)(s.A,{url:f})}),u&&(0,a.jsx)(i.A,{member:u,onClose:()=>p(null)})]})}},14303:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});var a=l(95155),r=l(15239),s=l(21980),i=l(44512);let n=e=>{let{currentImage:t,isPostView:l=!1}=e;return t?.thumbnailS3Id?(0,a.jsx)("div",{className:"h-full w-full",children:(0,a.jsx)(r.default,{src:(0,s.dE)(t.thumbnailS3Id),width:550,height:550,alt:"IDcolab Thumbnail",className:"h-full w-full object-cover",unoptimized:!0})}):(0,a.jsx)("div",{className:"h-full w-full min-h-40 flex items-center justify-center bg-light-2 dark:bg-dark-4",children:(0,a.jsx)(i.D0,{className:l?"w-18 h-20":"w-14 h-16"})})}},15720:(e,t,l)=>{"use strict";l.d(t,{A:()=>y});var a=l(95155),r=l(12115),s=l(15239),i=l(11636),n=l(46696),o=l(95221),d=l(43569),c=l(80675),m=l(22020);l(88108);var u=l(39670),p=l(5016);async function h(e,t){let{maxSize:l,mimeType:a="image/jpeg",quality:r=.92,fileName:s="image"}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=await new Promise((t,l)=>{let a=new Image;a.addEventListener("load",()=>t(a)),a.addEventListener("error",e=>l(e)),a.crossOrigin="anonymous",a.src=e}),n=document.createElement("canvas"),o=n.getContext("2d");if(!o)throw Error("Could not get canvas context");let{width:d,height:c}=t;if(l&&Math.max(d,c)>l){let e=l/Math.max(d,c);d=Math.round(d*e),c=Math.round(c*e)}n.width=d,n.height=c,o.drawImage(i,t.x,t.y,t.width,t.height,0,0,d,c);let m=await new Promise(e=>n.toBlob(e,a,r));if(!m)throw Error("Failed to render cropped image");let u="image/png"===a?"png":"jpg",p=s.replace(/\.[^.]+$/,"")||"image";return new File([m],`${p}.${u}`,{type:a})}let x=[{key:"free",label:"Free",aspect:null},{key:"original",label:"Original",aspect:null},{key:"square",label:"Square",aspect:1},{key:"16:9",label:"16:9",aspect:16/9},{key:"4:3",label:"4:3",aspect:4/3},{key:"3:4",label:"3:4",aspect:3/4}],f={"--rc-border-color":"rgba(255, 255, 255, 0.9)","--rc-drag-handle-bg-colour":"var(--color-purple)","--rc-focus-color":"var(--color-yellow)"},g={unit:"%",x:0,y:0,width:100,height:100},b=(e,t,l)=>e?(0,m.ge)((0,m.dS)({unit:"%",width:100},e,t,l),t,l):g,j=e=>{let{open:t,file:l,onCancel:s,onCropped:i,defaultRatio:n,cropShape:o="rect",maxOutputSize:d=1024,title:c="Crop image"}=e,g=(0,r.useRef)(null),[j,w]=(0,r.useState)(""),[y,v]=(0,r.useState)(),[k,N]=(0,r.useState)(null),[A,I]=(0,r.useState)(!1),S=n??("round"===o?"square":"free"),[C,E]=(0,r.useState)(S),D=(0,r.useCallback)((e,t)=>{if("free"!==e)return"original"===e?t??void 0:x.find(t=>t.key===e)?.aspect??void 0},[]);(0,r.useEffect)(()=>
2{if(!l)return void w("");let e=URL.createObjectURL(l);return w(e),v(void 0),N(null),E(S),()=>URL.revokeObjectURL(e)},[l,S]);let P=(e,t)=>{let l=(0,m.$P)(e,t.width,t.height),a=t.naturalWidth/t.width,r=t.naturalHeight/t.height,s=Math.max(0,Math.round(l.x*a)),i=Math.max(0,Math.round(l.y*r));return{x:s,y:i,width:Math.min(Math.round(l.width*a),t.naturalWidth-s),height:Math.min(Math.round(l.height*r),t.naturalHeight-i)}},T=(()=>{let e=g.current;if(!e||!y||y.width<=0||y.height<=0)return null;let t=P(y,e);if(t.width<1||t.height<1)return null;let l=Math.max(t.width,t.height),a=l>d?d/l:1;return{width:Math.round(t.width*a),height:Math.round(t.height*a)}})(),$=async()=>{let e=g.current;if(!l||!e||!y)return;let t=P(y,e);if(!(t.width<1)&&!(t.height<1))try{I(!0);let e=await h(j,t,{maxSize:d,mimeType:"image/png"===l.type?"image/png":"image/jpeg",fileName:l.name});i(e)}finally{I(!1)}};return(0,a.jsx)(u.A,{open:t,onClose:s,title:c,size:"lg",footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p.Ay,{variant:"outline",type:"button",onClick:s,disabled:A,children:"Cancel"}),(0,a.jsx)(p.Ay,{variant:"yellow",type:"button",title:"Apply",loading:A,disabled:!T,onClick:$})]}),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[x.map(e=>(0,a.jsx)(p.Ay,{type:"button",size:"sm",variant:C===e.key?"purple":"outline","aria-pressed":C===e.key,onClick:()=>(e=>{E(e);let t=g.current;if(!t)return;let l=D(e,k);(l||!y)&&v(b(l,t.width,t.height))})(e.key),children:e.label},e.key)),(0,a.jsx)(p.Ay,{type:"button",size:"sm",variant:"ghost",className:"ml-auto",onClick:()=>{let e=g.current;e&&v(b(D(C,k),e.width,e.height))},children:"Reset"})]}),(0,a.jsx)("div",{className:"flex w-full items-center justify-center overflow-hidden rounded-xl bg-dark-1 p-4",children:j&&(0,a.jsx)(m.Ay,{crop:y,onChange:(e,t)=>
2v(t),aspect:D(C,k),circularCrop:"round"===o,ruleOfThirds:!0,keepSelection:!0,minWidth:24,minHeight:24,style:f,className:"max-h-[45dvh] sm:max-h-[55dvh]",children:(0,a.jsx)("img",{ref:g,src:j,alt:"Crop preview",onLoad:e=>{let{naturalWidth:t,naturalHeight:l,width:a,height:r}=e.currentTarget,s=l>0?t/l:null;N(s),v(b(D(C,s),a,r))}})})}),(0,a.jsxs)("p",{className:"text-xs text-dark-6 dark:text-light-5",children:["Drag inside the box to move it, drag an edge or corner to resize.",T?` Output ${T.width} x ${T.height} px.`:""]})]})})},w={"image/png":[".png"],"image/jpeg":[".jpeg",".jpg"]},y=e=>{let{value:t,onFileSelected:l,onRemove:m,onError:u,shape:p="circle",label:h,disabled:x=!1,loading:f=!1,placeholderInitials:g,size:b=112,sizeClassName:y,contain:v=!1,className:k,enableCrop:N=!1,cropDefaultRatio:A,cropShape:I,cropMaxOutputSize:S=1024}=e,[C,E]=(0,r.useState)(null),D=(0,r.useCallback)((e,t)=>{if(t.length>0)return void u?.("Please select a PNG or JPG image.");e.length>0&&(N?E(e[0]):l(e[0]))},[l,u,N]),{getRootProps:P,getInputProps:T,isDragActive:$,open:F}=(0,i.VB)({onDrop:D,disabled:x||f,multiple:!1,noKeyboard:!1,accept:w}),R=!!t,L=!x&&!f;return(0,a.jsxs)("div",{className:`flex flex-col items-center gap-2${k?` ${k}`:""}`,children:[h&&(0,a.jsx)("span",{className:"text-xs font-medium text-dark-4 dark:text-light-4",children:h}),(0,a.jsxs)("div",{className:`relative${y?` ${y}`:""}`,style:y?void 0:{width:b,height:b},children:[(0,a.jsxs)("div",{...P(),role:"button","aria-label":h?`Upload ${h}`:"Upload image","aria-disabled":!L,className:["group relative flex h-full w-full items-center justify-center overflow-hidden","circle"===p?"rounded-full":"rounded-xl","border border-light-3 dark:border-dark-4 bg-light-2 dark:bg-dark-2",L?"cursor-pointer":"cursor-default",$?"ring-2 ring-purple ring-offset-2 ring-offset-light-0 dark:ring-offset-dark-3":""].join(" "),children:[(0,a.jsx)("input",{...T()}),R?(0,a.jsx)(s.default,{src:t,alt:h??"avatar",width:2*b,height:2*b,className:`h-full w-full ${v?"object-contain":"object-cover"} object-center`}):g?(0,a.jsx)("span",{className:"select-none px-2 text-center text-2xl font-bold uppercase tracking-wider text-dark-3 dark:text-light-2",children:g}):(0,a.jsx)(n.A,{className:"h-8 w-8 text-dark-5 dark:text-light-3"}),L&&(0,a.jsxs)("div",{className:"pointer-events-none absolute inset-0 flex flex-col items-center justify-center gap-1 bg-dark-0/45 opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:[(0,a.jsx)(o.A,{className:"h-6 w-6 text-light-0"}),(0,a.jsx)("span",{className:"text-xs font-medium text-light-0",children:"Change"})]}),(0,a.jsx)(c.A,{show:f,scrim:"dark",spinnerClassName:"h-6 w-6"})]}),R&&L&&m&&(0,a.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),m()},"aria-label":"Remove image",className:"absolute -right-1 -top-1 z-10 flex h-6 w-6 items-center justify-center rounded-full border border-light-3 bg-light-0 text-red-1 shadow-sm transition-colors hover:bg-red-1 hover:text-light-0 dark:border-dark-4 dark:bg-dark-2 dark:text-red-2 dark:hover:bg-red-2 dark:hover:text-dark-2",children:(0,a.jsx)(d.A,{className:"h-4 w-4"})})]}),L&&(0,a.jsx)("button",{type:"button",onClick:F,className:"text-xs font-medium text-purple transition-colors hover:underline dark:text-yellow",children:R?"Change":"Upload"}),N&&(0,a.jsx)(j,{open:!!C,file:C,defaultRatio:A,cropShape:I??("circle"===p?"round":"rect"),maxOutputSize:S,title:h?`Crop ${h}`:"Crop image",onCancel:()=>E(null),onCropped:e=>{E(null),l(e)}})]})}},17640:()=>{},23237:()=>{},24420:(e,t,l)=>{"use strict";l.d(t,{A:()=>eX});var a=l(95155),r=l(12115),s=l(1213),i=l(67909),n=l(96663),o=l(76731),d=l(70631),c=l(32605),m=l(64269),u=l(69268),p=l(15826),h=l(1362),x=l(56414),f=l(5016),g=l(74923),b=l(11910);let j={email:"",accessRights:"",role:"",publicAccessId:""},w=e=>{let{variant:t="footer"}=e,{projectsLoading:l}=(0,c.A)(),{selectedProject:i}=(0,s.d4)(e=>e.project),{userDetails:n}=(0,s.d4)(e=>e.projects),{canManageProject:o}=(0,g.A)(),[w,y]=(0,r.useState)(!1),[v,k]=(0,r.useState)(!1),[N,A]=(0,r.useState)(j),I=n?.plan&&String(n.plan).toUpperCase()||"FREE",S=(i?.teamMembers??[]).filter(e=>e?.status!=="inactive"),C=(0,d.Gc)(I,S.length),E=(0,m.dS)(i?.teamMembers[0]),D=(0,d.d$)(i?.createdAt),P=i?.projectName;return"empty"===t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{hidden:l,className:"flex max-w-md flex-col items-center px-6 py-10 text-center",children:[(0,a.jsxs)("div",{className:"relative mb-5 flex h-16 w-16 items-center justify-center",children:[(0,a.jsx)("span",{className:"absolute inset-0 rounded-full bg-purple/10"}),(0,a.jsx)("span",{className:"absolute inset-2 rounded-full bg-purple/15"}),(0,a.jsx)("span",{className:"relative flex h-12 w-12 items-center justify-center rounded-full bg-linear-to-br from-purple to-purple/70 shadow-[0_8px_24px_rgba(109,40,217,0.35)]",children:(0,a.jsx)(p.A,{className:"h-6 w-6 text-light-0"})})]}
2),(0,a.jsx)("h3",{className:"text-xl font-bold text-dark-1 dark:text-light-0",children:P?`Welcome to ${P}`:"Your project is ready"}),(0,a.jsx)("p",{className:"mt-2 text-sm leading-relaxed text-dark-5 dark:text-light-4",children:"This is where your project activity will appear. Upload a file, start a discussion, or invite your team to get things moving."}),o&&(0,a.jsx)(f.Ay,{variant:"yellow",type:"button",title:"Add collaborator",icon:(0,a.jsx)(h.A,{className:"h-4 w-4"}),iconPosition:"left",onClick:()=>{if(C)return void k(!0);A(j),y(!0)},className:"mt-6"}),(0,a.jsxs)("div",{className:"mt-5 inline-flex items-center gap-1.5 rounded-full border border-light-3 bg-light-1 px-3 py-1.5 text-xs font-medium text-dark-5 dark:border-dark-4 dark:bg-dark-2 dark:text-light-4",children:[(0,a.jsx)(x.A,{className:"h-4 w-4 text-green-1"}),"Created by ",E," \xb7 ",D]})]}),w&&(0,a.jsx)(b.A,{values:N,onChange:A,toggleAddUserModal:()=>y(!1),isEdit:!1}),(0,a.jsx)(u.A,{show:v,onClose:()=>k(!1),currentPlan:n?.plan,limitType:"users"})]}):(0,a.jsxs)("div",{hidden:l,className:"flex w-full items-center gap-3 py-1",children:[(0,a.jsx)("span",{className:"h-px flex-1 bg-light-3 dark:bg-dark-4"}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-light-3 bg-light-1 px-3 py-1.5 text-xs font-medium text-dark-5 dark:border-dark-4 dark:bg-dark-2 dark:text-light-4",children:[(0,a.jsx)(x.A,{className:"h-4 w-4 shrink-0 text-green-1"}),"Project created by ",E," \xb7 ",D]}),(0,a.jsx)("span",{className:"h-px flex-1 bg-light-3 dark:bg-dark-4"})]})};var y=l(64034),v=l(21980),k=l(59963),N=l(95157),A=l(70763),I=l(68959),S=l(58752);let C=e=>{let{id:t,options:l,selected:s,title:i,onChange:n,isMulti:o,useRadio:d=!1,customStyles:c,icon:m,showImages:u=!1,customDropdownStyles:p=""}=e,[h,x]=(0,r.useState)(!1),g=(0,r.useRef)(null);(0,I.A)(g,()=>x(!1),h);let b=(e,t)=>{e.stopPropagation(),o?n(t):d&&(n(t?.value),setTimeout(()=>{x(!1)},500))},j=e=>o?!!Array.isArray(s)&&s.some(t=>String(t&&"object"==typeof t?t.value:t)===String(e?.value)):String(s)===String(e?.value),w=o?l.filter(e=>j(e)).length:0,C=w>0;return(0,a.jsxs)("div",{id:t,className:"relative",ref:g,children:[(0,a.jsxs)(f.Ay,{"aria-pressed":C,className:`flex h-9 items-center gap-1.5 text-sm font-semibold px-2.5 rounded-lg border backdrop-blur-lg backdrop-saturate-150 whitespace-nowrap transition-colors ${C?"border-purple bg-purple/10 text-dark-1 dark:bg-purple/25 dark:text-light-0":"border-light-3 dark:border-dark-4 bg-light-0/60 dark:bg-dark-3 text-dark-3 dark:text-light-0"} ${c??""}`,onClick:()=>x(!h),children:[i,C&&(0,a.jsx)("span",{className:"inline-flex h-4.5 min-w-4.5 items-center justify-center rounded-full bg-purple px-1 text-[11px] font-bold leading-none text-light-0",children:w}),(0,a.jsx)("span",{className:C?"text-purple dark:text-light-0":"text-dark-3 dark:text-light-0",children:m||(0,a.jsx)(y.A,{className:"w-3.5 h-3.5"})})]}),h&&(0,a.jsx)("div",{className:`absolute top-full ${p||"left-0"} mt-1 w-max min-w-full max-w-65 z-50 overflow-hidden py-2 ${S.X}`,children:l.map((e,t)=>((e,t)=>{let l=u&&e.icon&&e.showIcon,r=l?String(e.icon).includes("http")?e.icon:`${v.mn}${e.icon}`:null;return(0,a.jsxs)("div",{onClick:()=>(e=>{o?n(e):(n(e?.value),x(!1))})(e),className:"flex items-center gap-3 cursor-pointer px-4 py-2 hover:bg-light-4 dark:hover:bg-dark-3 transition-colors",children:[o&&!d&&(0,a.jsx)(N.A,{checked:j(e),onChange:t=>b(t,e),onClick:e=>e.stopPropagation()}),d&&(0,a.jsx)(A.A,{checked:j(e),onChange:t=>b(t,e),onClick:e=>e.stopPropagation()}),u&&(0,a.jsx)("div",{className:"shrink-0",children:(0,a.jsx)(k.Ay,{user:e,src:l&&r?r:void 0,name:e.firstName?void 0:e.label||e.name||"U",size:"xs",alt:"member avatar"})}),(0,a.jsx)("div",{className:"min-w-0",children:(0,a.jsx)("div",{className:"text-sm font-semibold text-dark-4 dark:text-light-0 truncate",children:e.firstName&&e.lastName?`${e.firstName} ${e.lastName}`:e.label||e.name||e.title||`Option ${t+1}`})})]},t)})(e,t))})]})};var E=l(42302),D=l(14054);let P=()=>{let e=(0,s.wA)(),{filters:t}=(0,s.d4)(e=>e.category),{postedByOptions:l}=(0,D.V)();return(0,a.jsx)("div",{className:"flex items-center justify-center",children:(0,a.jsx)(C,{onChange:l=>(l=>{let a=t?.postedBy||[];if(a.includes(l)){let r=a.filter(e=>e!==l);e((0,E._F)({...t,postedBy:r}))}else e((0,E._F)({...t,postedBy:[...a,l]}))}
2)(l?.value),title:"Published by",options:l??[],selected:t?.postedBy,showImages:!0,isMulti:!0})})};var T=l(20063),$=l(99553);let F=e=>{let{}=e,t=(0,s.wA)(),l=(0,T.usePathname)(),{filters:r}=(0,s.d4)(e=>e?.category),{attentionOptions:i}=(0,D.V)(),n=(0,d.XA)(),o=l?.includes("activities"),c=l?.includes("decisions"),m=(e,l)=>{let a=r[e];if(a.includes(l)){let s=a.filter(e=>e!==l);t((0,E._F)({...r,[e]:s}))}else t((0,E._F)({...r,[e]:[...a,l]}))};return(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(o||c)&&(0,a.jsx)(C,{title:"Category",onChange:e=>m("category",e?.value),options:n,selected:r?.category||[],isMulti:!0}),(0,a.jsx)(C,{title:"Attention",onChange:e=>m("tags",e?.value),options:i,selected:r?.tags||[],showImages:!0,isMulti:!0}),(0,a.jsx)(C,{title:"Status",onChange:e=>m("status",e?.value),options:$.FJ,selected:r?.status||[],isMulti:!0})]})};var R=l(10874),L=l(37129),M=l(2371);let O=e=>{let{}=e,t=(0,s.wA)(),{filters:l}=(0,s.d4)(e=>e.category),r=e=>{t((0,E._F)({...l,sortOrder:e}))},i=(l?.postedBy?.length||0)+(l?.category?.length||0)+(l?.tags?.length||0)+(l?.status?.length||0);return(0,a.jsxs)("div",{className:"flex items-center gap-1 md:gap-2",children:[(0,a.jsx)("div",{className:"hidden xl:block",children:(0,a.jsx)(C,{title:"Sort by",onChange:r,options:$.QB,selected:l?.sortOrder,isMulti:!1,useRadio:!0,icon:(0,a.jsx)(L.A,{className:"w-4 h-4"}),customDropdownStyles:"left-[-2rem]",customStyles:"gap-2 flex-row-reverse! bg-transparent! active:scale-95 transition-all duration-75"})}),(0,a.jsx)("div",{className:"block xl:hidden",children:(0,a.jsx)(C,{onChange:r,options:$.QB,selected:l?.sortOrder,isMulti:!1,useRadio:!0,icon:(0,a.jsx)(L.A,{className:"w-4 h-4"}),customDropdownStyles:"left-[-5rem]",customStyles:"flex-row-reverse! bg-transparent! active:scale-95 transition-all duration-75"})}),i>0?(0,a.jsxs)("button",{type:"button",onClick:()=>t((0,E.dr)()),"aria-label":`Reset ${i} active filter${i>1?"s":""}`,className:"mr-0.5 md:mr-2 inline-flex h-9 cursor-pointer items-center gap-1.5 rounded-lg border border-purple bg-purple/10 px-2.5 text-sm font-semibold text-purple transition-colors hover:bg-purple/20 dark:bg-purple/25 dark:text-light-0 dark:hover:bg-purple/40",children:[(0,a.jsx)(R.A,{className:"w-4 h-4 shrink-0"}),(0,a.jsx)("span",{className:"hidden lg:inline",children:"Reset"}),(0,a.jsx)("span",{className:"inline-flex h-4.5 min-w-4.5 items-center justify-center rounded-full bg-purple px-1 text-[11px] font-bold leading-none text-light-0",children:i})]}):(0,a.jsx)(M.Ay,{variant:"nav",onClick:()=>t((0,E.dr)()),className:"mr-0.5 md:mr-2",icon:(0,a.jsx)(R.A,{className:"w-4 h-4"}),"aria-label":"Reset filters"})]})},U=e=>{let{hideOnLg:t=!1}=e;return(0,a.jsxs)("div",{className:`${t?"hidden md:flex lg:hidden":"hidden md:flex"} items-center justify-between px-4 py-1 text-center bg-light-0 border shadow-sm rounded-t-md text-sm md:text-base dark:bg-dark-3 text-dark-6 border-light-3 dark:border-dark-4`,children:[(0,a.jsx)(P,{}),(0,a.jsx)(F,{}),(0,a.jsx)(O,{})]})};var B=l(91275),z=l(29545),q=l(17918),V=l(3750),G=l(86999),_=l(97412),Q=l(48878),H=l(97708),W=l(97473),X=l(28079),J=l(48242),Y=l(95343);let K=e=>{let{data:t,subPosts:l,isEditAllowed:r,handleRemovePost:i,size:n}=e,o=(0,s.wA)(),{loginStatus:d}=(0,c.A)(),{selectedProject:m}=(0,s.d4)(e=>e.project),{canEdit:u}=(0,g.A)(),p=m?.currentUserAccess,h=[...(p?.isExternal?"edit"===(0,G.nL)(p,t?.postId):u)?[{key:"share",label:(0,a.jsx)("span",{className:"text-dark-2 dark:text-light-0",children:"Share"}),onClick:()=>{o((0,J.Ll)(!0)),o((0,J.mG)(t))}}]:[],...r?[{key:"moveToTrash",label:(0,a.jsx)("span",{className:"text-dark-2 dark:text-light-0",children:"Move to Trash"}),onClick:()=>i(t.postId)}]:[]];return 0===h.length?null:(0,a.jsx)("div",{hidden:!d,children:(0,a.jsx)(S.A,{items:h,trigger:(0,a.jsx)(M.Ay,{variant:"nav",size:n,className:"!rounded-md","aria-label":"More options",icon:(0,a.jsx)(Y.A,{className:"w-4 h-4"})}),anchor:"bottom end"})})};var Z=l(12103);let ee=e=>(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"31",fill:"none",viewBox:"0 0 30 31",...e,children:(0,a.jsxs)("g",{"data-figma-bg-blur-radius":"24",children:[(0,a.jsx)("rect",{width:"30",height:"30",x:"30",y:"30.541",fill:"#333",fillOpacity:"0.4",rx:"15",transform:"rotate(-180 30 30.54)"}),(0,a.jsx)("rect",{width:"29",height:"29",x:"29.5",y:"30.041",stroke:"var(--color-light-3)",strokeOpacity:"0.4",rx:"14.5",transform:"rotate(-180 29.5 30.04)"}),(0,a.jsx)("path",{fill:"#F7F7F7",fillRule:"evenodd",d:"M17.035 19.957a.437.437 0 0 1-.617-.048l-3.5-4.084a.44.44 0 0 1 0-.569l3.5-4.083a.438.438 0 0 1 .664.569l-3.256 3.799 3.256 3.798a.44.44 0 0 1-.047.617",clipRule:"evenodd"})]})}),et=e=>(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"31",fill:"none",viewBox:"0 0 30 31",...e,children:(0,a.jsxs)("g",{"data-figma-bg-blur-radius":"24",children:[(0,a.jsx)("rect",{width:"30",height:"30",y:"0.541",fill:"#333",fillOpacity:"0.4",rx:"15"}),(0,a.jsx)("rect",{width:"29",height:"29",x:"0.5",y:"1.041",stroke:"var(--color-light-3)",strokeOpacity:"0.4",rx:"14.5"}),(0,a.jsx)("path",{fill:"#F7F7F7",fillRule:"evenodd",d:"M12.965 11.125a.437.437 0 0 1 .617.048l3.5 4.083a.44.44 0 0 1 0 .57l-3.5 4.083a.438.438 0 0 1-.664-.57l3.256-3.798-3.256-3.799a.44.44 0 0 1 .047-.617",clipRule:"evenodd"})]})});l(74062);var el=l(56204),ea=l(15239),er=l(14303),es=l(2057),ei=l(87324),en=l(30537),eo=l(92439),ed=l(1856),ec=l(30457),em=l(83021),eu=l(6172),ep=l(27804),eh=l(31079),ex=l(10088);let ef=e=>!!e&&""!==String(e).trim()&&"undefined"!==e&&"null"!==e,eg=e=>{let{onClick:t,data:l}=e,s=l?.category===_.b7.Videos,i=ef(l?.thumbnailS3Id),n=(0,v.Wm)(l?.fileS3Id,"preview.webp"),o=i?(0,v.dE)(l.thumbnailS3Id):(0,v.Wm)(l?.fileS3Id,"thumbnail.jpg"),d=(0,v.dE)(l?.thumbnailS3Id),c=s?o:d,[u,p]=(0,r.useState)(c),[h,x]=(0,r.useState)(!1),[f,g]=(0,r.useState)({}),b=e=>g(t=>t[e]?t:{...t,[e]:!0}),j=s||i;(0,r.useEffect)(()=>{p(c),g({})},[c]);let w=l?.fileCategory===_.NL.LINK,y=l?.category===_.b7.ThreeDModels,k=l?.fileDescription||(w||y?l?.fileName:""),N=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"w-4 h-4 shrink-0",t=l?.fileType||"",r=t.includes("pdf")||"pdf"===(0,m.QC)(l?.fileName);return w?(0,a.jsx)(es.A,{className:e}):y?(0,a.jsx)(ei.A,{className:e}):l?.category===_.b7.Videos?(0,a.jsx)(en.A,{className:e}):l?.category===_.b7.SideBySide?(0,a.jsx)(ep.A,{className:e}):l?.category===_.b7.PANORAMA?(0,a.jsx)(eh.A,{className:e}):r?(0,a.jsx)(eo.A,{className:e}):t===_.xQ.SHEET||t===_.$H.SHEET?(0,a.jsx)(em.A,{className:e}):t===_.$H.SLIDE?(0,a.jsx)(eu.Uyc,{className:e}):t===_.xQ.PPT?(0,a.jsx)(ed.A,{className:e}):t===_.xQ.DOC||t===_.$H.DOC?(0,a.jsx)(eo.A,{className:e}):(0,a.jsx)(ec.A,{className:e})},A=()=>(0,a.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 bg-light-2 dark:bg-dark-4 text-dark-4 dark:text-light-4",children:[N("w-12 h-12 shrink-0"),!k&&l?.fileName&&(0,a.jsx)("span",{className:"max-w-4/5 truncate text-xs font-medium",children:l.fileName})]}),I=(e,t)=>(0,a.jsx)("div",{className:"relative w-1/2 h-full",children:!ef(t)||f[e]?A():(0,a.jsx)(ea.default,{src:e,alt:l?.fileName,fill:!0,unoptimized:!0,style:{objectFit:h?"contain":"cover",objectPosition:"center",transition:"all 0.3s ease"},sizes:"50vw",onError:()=>b(e),onMouseOver:S,onMouseOut:C})}),S=()=>{w||(s&&!f[n]&&p(n),x(!0))},C=()=>{w||(s&&p(o),x(!1))},E=()=>{s&&u===n?(b(n),p(o)):b(u)};return(0,a.jsx)("div",{onClick:t,hidden:l?.category==="discussions"||l?.fileCategory==="discussion",className:"w-full h-full bg-transparent",children:(0,a.jsx)("div",{className:"group w-full drop-shadow-md overflow-hidden dark:bg-dark-2 border border-transparent hover:border-dark-5 dark:hover:border-light-6 transition-all duration-300 ease-in-out rounded-lg",onMouseOver:S,onMouseOut:C,children:(0,a.jsxs)("div",{className:"aspect-video w-full h-full overflow-hidden flex items-stretch rounded-lg relative",children:[(()=>{if(l?.category===_.b7.ThreeDModels){let e=(0,v.dE)(l?.thumbnailS3Id);return i&&!f[e]?(0,a.jsx)("div",{className:"w-full h-full relative",children:(0,a.jsx)(ea.default,{src:e,fill:!0,alt:l?.fileName,unoptimized:!0,style:{objectFit:"contain",objectPosition:"center",transition:"all 0.3s ease"},onError:()=>b(e),onMouseOver:S,onMouseOut:C})}):(0,a.jsx)("div",{className:"flex justify-center items-center w-full h-full bg-light-2 dark:bg-dark-4",children:(0,a.jsx)(ex.A,{className:"w-20 h-20"})})}return l?.fileType?.includes("pdf")||"pdf"===(0,m.QC)(l?.fileName)?(0,a.jsx)(er.A,{isPostView:!0,currentImage:l}):l?.category===_.b7.SideBySide?(0,a.jsxs)("div",{className:"w-full h-full flex",children:[I(u,l?.thumbnailS3Id),I((0,v.dE)(l?.afterthumbnailS3Id),l?.afterthumbnailS3Id)]}):!j||f[u]?A():(0,a.jsx)("div",{className:"w-full h-full relative",children:(0,a.jsx)(ea.default,{src:u,fill:!0,alt:l?.fileName,unoptimized:!0,style:{objectFit:h?"contain":"cover",objectPosition:"center",transition:"all 0.3s ease"},onError:E,onMouseOver:S,onMouseOut:C,sizes:"100vw"})})})(),l?.category===_.b7.Videos&&(0,a.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:(0,a.jsx)("span",{className:"flex h-14 w-14 items-center justify-center rounded-full bg-dark-0/55 backdrop-blur-sm transition-transform duration-300 group-hover:scale-110",children:(0,a.jsx)("svg",{width:"26",height:"26",viewBox:"0 0 24 24",fill:"
2currentColor",className:"ml-1 text-light-0","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M8 5v14l11-7z"})})})}),k&&(0,a.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 bg-dark-0/50 backdrop-blur-sm text-light-2 text-sm font-semibold p-2 flex items-center gap-1.5",children:[N(),(0,a.jsx)("span",{className:"truncate",children:k})]})]})})})};var eb=l(87521),ej=l(56645),ew=l(60615),ey=l(12356),ev=l(13853),ek=l(4068);let eN=e=>{let{originalFile:t,revisionPost:l,projectId:i,userDetails:n,galleryFor:o,onFileResolved:d}=e,c=(0,s.wA)(),{isPublicSharing:m}=(0,z.A)(),{data:u,refetch:p}=(0,V.wZ)((0,V.rf)(l?.postId,m),{skip:!l?.postId,refetchOnMountOrArgChange:120}),h=u?.subposts?.[0],x=(0,r.useRef)(null);h&&(x.current=h);let f=h||x.current||t,g=(0,r.useRef)(0);return(0,r.useEffect)(()=>{g.current=0},[l?.postId]),(0,r.useEffect)(()=>{if(!u||h?.fileId||g.current>=10)return;let e=setTimeout(()=>{g.current+=1,p()},2e3);return()=>clearTimeout(e)},[u,h,p,l?.postId]),(0,r.useEffect)(()=>{h&&t?.fileId&&d?.(t.fileId,h)},[h,t?.fileId,d]),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(eg,{onClick:()=>{let{gallery:e,originals:a}=o(t),r=a.findIndex(e=>e?.fileId===t?.fileId);c((0,J.q5)(!0)),c((0,J.Fo)(1===e.length)),c((0,J.gz)(r>=0?r:0)),c((0,J.$j)({...f,projectId:f?.projectId||i,userDetails:n,imageList:e,isRevisionView:!0,postDescription:l?.postDescription||""}))},data:f}),(0,a.jsx)("span",{className:`${ev.B} absolute top-2 right-2 z-10 shadow-sm`,children:(0,ek.Vk)(l?.version)})]})},eA=e=>{let{data:t,mainpost:l}=e,i=(0,s.wA)(),{user:n}=(0,c.A)(),{selectedProject:o}=(0,s.d4)(e=>e.project),m=(0,r.useRef)(null),u=t?.subposts||[],p=Array.isArray(l?.fileRevisions)?l.fileRevisions:[],h=(0,r.useMemo)(()=>{let e={};for(let t of p){if(!t?.revisedFileId)continue;let l=e[t.revisedFileId];(!l||(t.version||0)>(l.version||0))&&(e[t.revisedFileId]=t)}return e},[p]),x=(0,r.useMemo)(()=>{let e=u.filter(e=>h[e.fileId]);return e.length?(e.sort((e,t)=>String(h[t.fileId]?.createdAt||"").localeCompare(String(h[e.fileId]?.createdAt||""))),[...e,...u.filter(e=>!h[e.fileId])]):u},[u,h]),g=l?.category===_.b7.SURVEY,b=l?.projectId||t?.projectId,{data:j}=(0,V.kL)(b,{skip:!g||!b}),w=r.useMemo(()=>{let e=Array.isArray(j)?j:j?.data||j?.surveys;return Array.isArray(e)?e.find(e=>e?.postId===l?.postId):void 0},[j,l?.postId]),y=(0,r.useCallback)(()=>{m.current?.slidePrev()},[]),v=(0,r.useCallback)(()=>{m.current?.slideNext()},[]),[k,N]=(0,r.useState)({}),A=(0,r.useCallback)((e,t)=>{N(l=>l[e]===t?l:{...l,[e]:t})},[]),I=e=>{let t=(e=>e?.category===_.b7.Videos?x.filter(e=>e?.category===_.b7.Videos):e?.category===_.b7.ThreeDModels?x.filter(e=>e?.category===_.b7.ThreeDModels):e?.category===_.b7.PANORAMA?x.filter(e=>e?.category===_.b7.PANORAMA):e?.category===_.b7.SideBySide?x.filter(e=>e?.category===_.b7.SideBySide):x.filter(d.u))(e);return{gallery:t.map(e=>{let t=k[e?.fileId];return t?{...t,isRevisionView:!0,projectId:t.projectId||e?.projectId}:e}),originals:t}};if(l?.category===_.b7.SURVEY&&l?.surveyQuestion&&Array.isArray(l.surveyQuestion.pages)&&l.surveyQuestion.pages.length>0){let e=w?{...l,...w}:l,r=(0,ew.yS)(e.surveyQuestion).length,s=(0,ey.t)(e?.postData),d=s.length,c=!!(0,ey.xG)(s,n?.userId),m=(0,ew.fZ)(e.surveyQuestion),p=c||m.closed,h=()=>((e,l)=>{i((0,J.q5)(!0)),i((0,J.Fo)(1===u.length)),i((0,J.xJ)(!l)),i((0,J.Wo)(l)),i((0,J.$j)({...e,userDetails:t?.userDetails}))})(e,p);return(0,a.jsx)("div",{className:"w-full pt-2 mx-auto",role:"button",tabIndex:0,onClick:h,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),h())},children:(0,a.jsxs)("div",{className:"overflow-hidden rounded-2xl border border-light-3 dark:border-dark-4 bg-light-0 dark:bg-dark-3 transition-colors hover:border-dark-5 dark:hover:border-light-6",children:[(0,a.jsxs)("div",{className:"relative max-h-64 overflow-hidden px-4 pt-3 pb-2",children:[(0,a.jsx)("div",{className:"pointer-events-none",children:p?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"text-base font-bold text-dark-1 dark:text-light-0",children:(0,ew.hQ)(e.surveyQuestion)}),(0,a.jsx)(ej.A,{definition:e.surveyQuestion,entries:(0,ey.TR)(s,o?.teamMembers),compact:!0,className:"mt-2"})]}):(0,a.jsx)(eb.default,{definition:e.surveyQuestion,mode:"inline",readOnly:!0})}),(0,a.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-14 bg-linear-to-t from-light-0 dark:from-dark-3 to-transparent"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 border-t border-light-2 dark:border-dark-4 px-4 py-2.5",children:[(0,a.jsxs)("span",{className:"text-xs font-medium text-dark-4 dark:text-light-4",children:[r," ",1===r?"question":"questions",","," ",d," ",1===d?"response":"responses",m.closed?", Ended":m.dueDate?`, Due ${(0,ew.Mx)(m.dueDate)}`:""]}),(0,a.jsx)("span",{className:(0,f.V7)("purple-outline","sm"),children:p?"View results":"Take survey"})]})]})})}return u.length?(0,a.jsx)("div",{className:"w-full pt-2 mx-auto rounded-lg md:overflow-hidden relative",children:(0,a.jsxs)(el.RC,{slidesPerView:"auto",spaceBetween:20,onSwiper:e=>m.current=e,className:"w-full overflow-visible",children:[x.map((e,r)=>(0,a.jsx)(el.qr,{className:u.length>1?"w-[85%]!":"w-full!",children:h[e?.fileId]?(0,a.jsx)(eN,{originalFile:e,revisionPost:h[e.fileId],projectId:e?.projectId||l?.projectId,userDetails:t?.userDetails,galleryFor:I,onFileResolved:A}):(0,a.jsx)(eg,{onClick:()=>((e,a)=>{let{gallery:r}=I(e);i((0,J.q5)(!0)),i((0,J.Fo)(1===u.length)),i((0,J.gz)(a)),i((0,J.$j)({...e,projectId:e?.projectId||l?.projectId,userDetails:t?.userDetails,imageList:r,postDescription:l?.postDescription||""}))})(e,r),data:e})},e?.fileId||r)),u.length>1&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"absolute z-50 left-2 top-1/2 -translate-y-1/2",children:(0,a.jsx)(M.Ay,{"aria-label":"Previous slide",className:"prev-arrow",icon:(0,a.jsx)(ee,{}),onClick:y}
2)}),(0,a.jsx)("div",{className:"absolute z-50 right-2 top-1/2 -translate-y-1/2",children:(0,a.jsx)(M.Ay,{"aria-label":"Next slide",className:"next-arrow",icon:(0,a.jsx)(et,{}),onClick:v})})]})]})}):null};var eI=l(34699),eS=l(14178),eC=l(17815),eE=l(88839),eD=l(75550),eP=l(20704),eT=l(54722);let e$=e=>{let{isBlockerValid:t,data:l,user:r,handleBlocker:s}=e,i=Array.isArray(l.taggedEmails)&&l.taggedEmails.includes(r?.emailAddress),n=r?.userId!==l?.userId&&!i,o=!!l?.isBlocker,d="group flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-sm text-dark-2 dark:text-light-0 text-left hover:bg-light-2 dark:hover:bg-dark-5 transition-colors",c=e=>(0,a.jsx)("span",{className:`ml-auto flex h-4 w-4 shrink-0 items-center justify-center rounded-full border ${e?"border-purple":"border-light-4 dark:border-dark-5"}`,children:e&&(0,a.jsx)("span",{className:"h-2 w-2 rounded-full bg-purple"})});return(0,a.jsx)("div",{className:"relative",children:t&&(0,a.jsxs)(eT.W1,{as:"div",className:"relative inline-block",children:[(0,a.jsxs)(eT.IU,{disabled:n,"aria-label":"Change blocker status",className:`inline-flex items-center gap-1.5 h-7 px-2.5 rounded-md border text-sm font-medium text-dark-2 dark:text-light-0 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-purple disabled:opacity-50 disabled:cursor-not-allowed ${o?"bg-red-1/10 border-red-1/30":"bg-green-1/15 border-green-1/40"}`,children:[(0,a.jsx)(eE.A,{className:`w-4 h-4 shrink-0 ${o?"text-red-1":"text-green-1"}`}),(0,a.jsx)("span",{children:o?"Blocker":"Resolved"}),(0,a.jsx)(eD.A,{className:"w-3 h-3 shrink-0 opacity-60"})]}),(0,a.jsxs)(eT.c,{anchor:"bottom end",className:`z-2000 mt-1 w-40 origin-top-right ${S.X} focus:outline-none transition duration-100 ease-out data-closed:scale-95 data-closed:opacity-0 p-1`,children:[(0,a.jsx)(eT.Dr,{children:(0,a.jsxs)("button",{type:"button",onClick:e=>s(e,!0,l),className:d,children:[(0,a.jsx)(eE.A,{className:"w-4 h-4 shrink-0 text-red-1"}),(0,a.jsx)("span",{children:"Blocker"}),c(o)]})}),(0,a.jsx)(eT.Dr,{children:(0,a.jsxs)("button",{type:"button",onClick:e=>s(e,!1,l),className:d,children:[(0,a.jsx)(eE.A,{className:"w-4 h-4 shrink-0 text-green-1"}),(0,a.jsx)("span",{children:"Resolved"}),c(!o)]})}),(0,a.jsx)(eT.Dr,{children:(0,a.jsxs)("button",{type:"button",onClick:e=>s(e,null,l),className:d,children:[(0,a.jsx)(eP.A,{className:"w-4 h-4 shrink-0 text-dark-5 dark:text-light-5"}),(0,a.jsx)("span",{children:"Clear status"})]})})]})]})})};var eF=l(65314);let eR=e=>{let{postNumber:t}=e;return(0,a.jsxs)("span",{className:ev.B,children:["#",t]})},eL=e=>{let{isBlockerValid:t,data:l,user:r,handleBlocker:s,subPosts:i,isEditAllowed:n,handleRemovePost:o,child:d,publicPost:c=!1}=e,m=l.version?(0,ek.Vk)(l.version):d?(0,ek.Vk)(1):null,u=i?.subposts,p=Array.isArray(u)&&1===u.length&&(0,ek.DC)({...u[0],category:l.category});return(0,a.jsxs)("div",{className:"flex flex-row items-center gap-2 lg:gap-1.5 lg:justify-start",children:[!d&&!c&&(0,a.jsx)(e$,{isBlockerValid:t,data:l,user:r,handleBlocker:s}),m&&!["discussions","survey"].includes(l.category)&&(0,a.jsx)(ev.A,{version:m}),!d&&!!l.postNumber&&(0,a.jsx)(eR,{postNumber:l.postNumber}),!d&&p&&!c&&(0,a.jsx)(eF.A,{data:l,subPosts:i}),!d&&!c&&(0,a.jsxs)("div",{className:"hidden md:block",children:[" ",(0,a.jsx)(K,{data:l,subPosts:i,isEditAllowed:n,handleRemovePost:o,size:"sm"})]})]})};var eM=l(78028),eO=l(66137),eU=l(99857),eB=l(48376),ez=l(49537),eq=l(67528);let eV=e=>{let{data:t,handleRemovePost:l,child:i=!1,refetchActivities:n}=e,o=(0,T.useParams)(),c=(0,s.wA)(),u=(0,T.useRouter)(),{isDiscussion:p,isActivities:h,isFeed:x,isPublicSharing:f}=(0,z.A)(),{fetchBlockerCount:b}=(0,eq.A)(),{selectedProject:j,selectedProjectId:w,projectList:y}=(0,s.d4)(e=>e.project),{projects:v}=(0,s.d4)(e=>e.projects),N=v.find(e=>e.guid==t?.projectId),A=p?j?.teamMembers||[]:N?.teamMembers||j?.teamMembers||t?.taggedUsers||[],[I]=(0,eB.RG)(),{userDetails:S}=(0,eC.A)(),C=(e,l)=>{if(!e||!l)return null;let a=e.find(e=>e.id===l)||e.find(e=>e.userId===l);if(a)return a;let r=t?.user?.emailAddress||t?.user?.email||t?.emailAddress||t?.email;return r?e.find(e=>e.emailAddress===r||e.email===r):null},D=t?.user||t.userDetails||C(A,t?.userId)||{},{data:P,isLoading:$}=(0,V.wZ)((0,V.rf)(t?.postId,f),{skip:p}),{user:F}=(0,eM.A)(e=>[e.user]),R=(S?.emailAddress||S?.email||"").toLowerCase(),L=(D?.emailAddress||D?.email||"").toLowerCase(),M=t?.userId!=null&&S?.id!=null&&String(t.userId)===String(S.id)||!!R&&R===L,{isAdmin:O,canEdit:U}=(0,g.A)(t?.projectId),B=O||U&&M,q=t?.isBlocker!==null&&t?.isBlocker!==void 0,{successNotify:G,errorNotify:_}=(0,X.A)(),[Q]=(0,V.y6)(),[H,W]=(0,r.useState)(!1),[J,Y]=(0,r.useState)(!1),ee=C(A,t?.userId)||D,et=(0,r.useMemo)(()=>{let e=t?.taggedEmails?.[0];return e?A?.find(t=>t.emailAddress===e)??null:null},[t?.taggedEmails,A]),el=(0,m.dS)(D),ea="unknown"===el?D?.emailAddress||D?.email||t?.user?.emailAddress||t?.user?.email||"Unknown User":el,er=async(e,t,l)=>{e.preventDefault();let a={postId:l.postId,createdAt:l.createdAt,updateField:"isBlocker",value:t};try{await Q(a).unwrap()?(G("Blocker status updated Successfully"),n&&await n(),(l?.projectId||j?.guid)&&await b(l?.projectId||j?.guid)):_("Blocker status update failed. Please try again.")}catch(e){console.error("Error updating blocker status:",e),_("Blocker status update failed. Please try again.")}},es=e=>{let l=P?.subposts?.[0]?.location||[],a=l.length>1?l[l.length-1]:null;u.push((0,eO.EE)(`/dashboard/${o?.slug||e}/${t?.category}`,a?.id))},ei=async e=>{e.stopPropagation();let l=y.find(e=>e.guid===t?.projectId);if(l){if(l.guid===w)return void es(l.projectName);try{c((0,eU.Qo)(`${l.projectNumber||""}${l.projectName||""}`)),c((0,eU.eP)(l.guid)),c((0,eU.SH)(!0)),await Promise.all([I(l.guid).unwrap().then(e=>{c((0,eU.NR)(e)),c((0,E.G7)([]))}),c((0,eU.SH)(!1))]).then(async()=>{es(l.projectName)})}catch(e){console.error("Failed to load project details",e)}}},en=r.useMemo(()=>{let e=P?.subposts?.[0]?.location||[];return 0===e.length?(0,a.jsx)("span",{children:(0,d.Zr)(t?.category)}):e.length<=3?e.map((l,r)=>(0,a.jsxs)("span",{className:"inline-flex items-center min-w-0",children:[(0,a.jsx)("span",{className:"truncate max-w-36",children:0===r?(0,d.Zr)(t?.category):l.name}),r<e.length-1&&(0,a.jsx)("span",{className:"mx-1 shrink-0",children:(0,a.jsx)(ez.A,{className:"w-3 h-3 text-dark-4 dark:text-light-5"})})]},l.id)):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{className:"inline-flex items-center min-w-0",children:[(0,a.jsx)("span",{className:"truncate max-w-36",children:(0,d.Zr)(t?.category)}),(0,a.jsx)("span",{className:"mx-1 shrink-0",children:(0,a.jsx)(ez.A,{className:"w-3 h-3 text-dark-4 dark:text-light-5"})})]}),(0,a.jsx)("span",{className:"text-dark-5 dark:text-light-5",children:"[...]"}),(0,a.jsx)("span",{className:"mx-1 shrink-0",children:(0,a.jsx)(ez.A,{className:"w-3 h-3 text-dark-4 dark:text-light-5"})}),e.slice(-2).map((e,t)=>(0,a.jsxs)("span",{className:"inline-flex items-center min-w-0",children:[(0,a.jsx)("span",{className:"truncate max-w-36",children:e.name}),0===t&&(0,a.jsx)("span",{className:"mx-1 shrink-0",children:(0,a.jsx)(ez.A,{className:"w-3 h-3 text-dark-4 dark:text-light-5"})})]},e.id))]})},[P,t?.category]),eo=y.find(e=>e.guid===t?.projectId)?.projectName;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:`flex gap-3 lg:gap-2 items-start md:items-center ${f?"flex-row justify-between":"flex-col md:flex-row justify-start md:justify-between"}`,children:[(0,a.jsxs)("div",{className:`flex items-center gap-3 min-w-0 ${f?"flex-1":"w-full"}`,children:[(0,a.jsx)(k.Ay,{user:D,size:"xl",className:"md:hidden"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1 min-w-0",children:[(0,a.jsx)("button",{type:"button",onClick:()=>Y(!0),className:`text-left text-dark-2 text-base font-semibold dark:text-light-0 cursor-pointer transition-colors hover:text-purple dark:hover:text-yellow ${f?"w-full truncate":"w-62.5 lg:w-full max-lg:truncate"}`,title:"View user details",children:(0,d.Zr)(ea)}),(0,a.jsx)("span",{className:"text-xs italic font-medium text-dark-5 dark:text-light-5",children:(0,d.bU)(t?.createdAt)}),t?.revisedAt&&(0,a.jsxs)("span",{className:"text-xs italic font-semibold text-purple dark:text-yellow",children:["Updated ",(0,d.bU)(t.revisedAt)]})]}),!f&&(0,a.jsx)("div",{className:"md:hidden ml-auto",children:(0,a.jsx)(K,{data:t,subPosts:P,isEditAllowed:B,handleRemovePost:l})})]}),(0,a.jsx)(eL,{isBlockerValid:q,data:t,user:{...S,...F}
2,handleBlocker:er,subPosts:P,isEditAllowed:B,handleRemovePost:l,child:i,publicPost:f})]}),(0,a.jsx)("div",{className:"pp-meta lg:py-2 py-3 dark:text-light-5 text-base flex flex-col gap-4",children:(0,a.jsxs)("div",{className:"flex items-center justify-between flex-wrap gap-y-2 gap-x-4",children:[t?.taggedEmails?.length>0&&(0,a.jsxs)("div",{className:"capitalize flex items-center gap-2 shrink-0",children:[(0,a.jsx)("span",{className:"font-semibold text-sm text-dark-6 dark:text-light-5",children:"Attention:"}),et?(0,a.jsx)(Z.A,{user:et,name:(e=>{let t=(0,m.dS)({firstName:e?.firstName,lastName:e?.lastName});return"unknown"===t?e?.email||e?.emailAddress:t})(et),title:"View user details",onClick:()=>W(!0)}):(0,a.jsx)(Z.A,{name:t?.taggedEmails?.[0],className:"lowercase"})]}),H&&et&&(0,a.jsx)(eI.A,{member:et,onClose:()=>W(!1)}),J&&ee&&(0,a.jsx)(eI.A,{member:ee,onClose:()=>Y(!1)}),!p&&!h&&x&&(0,a.jsxs)("div",{className:"capitalize flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-semibold text-sm text-dark-6 dark:text-light-5",children:"Project Name:"}),(0,a.jsx)("span",{className:"inline-flex items-center rounded-md border border-light-3 dark:border-dark-4 bg-light-2 dark:bg-dark-2 px-2.5 py-0.5 text-sm font-semibold text-dark-3 dark:text-light-2",children:eo})]}),!p&&(0,a.jsxs)("div",{className:"capitalize flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"shrink-0 font-semibold text-sm text-dark-6 dark:text-light-5",children:"Category:"}),(0,a.jsx)("button",{type:"button",title:"Go to folder",onClick:ei,className:"inline-flex flex-nowrap items-center min-w-0 max-w-full overflow-hidden rounded-md border border-light-3 dark:border-dark-4 bg-light-2 dark:bg-dark-2 px-2.5 py-0.5 text-sm font-semibold text-dark-3 dark:text-light-2 cursor-pointer hover:border-purple hover:text-purple dark:hover:border-yellow dark:hover:text-yellow transition-colors",children:en})]})]})}),(0,a.jsx)(eS.A,{text:t?.postDescription,className:`dark:text-light-0 pt-1 text-dark-3 text-sm ${f?"font-normal":"font-semibold"}`,members:A})]}),(0,a.jsx)(a.Fragment,{children:!p&&($?(0,a.jsx)("div",{className:"w-full pt-2 mx-auto",children:(0,a.jsx)("div",{className:"w-full aspect-video rounded-lg bg-light-2 dark:bg-dark-3 animate-pulse"})}):(0,a.jsx)(eA,{mainpost:t,data:{...P,userDetails:D}},`Post-${t?.postId}`))})]})};var eG=l(17857),e_=l(44512);let eQ=e=>{let{data:t,child:l,handleRemovePost:r,refetchActivities:s,DiscussionLabel:i,singlePostView:n}=e;return(0,a.jsxs)("div",{className:"flex flex-col flex-1 gap-2 w-100",children:[(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(eV,{data:t,handleRemovePost:r,child:l,refetchActivities:s})}),(0,a.jsx)("div",{className:"flex gap-4",children:(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(eG.A,{discussionLabel:i,urlId:t?.postId,singlePostView:n,post:t,enableViews:t?.category===_.b7.Videos,videoFileThreadIds:t?.category===_.b7.Videos?(Array.isArray(t?.subposts)?t.subposts:[]).filter(e=>e?.category===_.b7.Videos&&e?.fileId).map(e=>e.fileId).slice(0,10):void 0})})})]})},eH=e=>{let{item:t,handleRemovePost:l,DiscussionLabel:i,isDiscussion:n,isDecision:o,className:d,refetchActivities:c,singlePostView:m=!1}=e,[u,p]=(0,r.useState)(!1),[h,x]=(0,r.useState)([]),{selectedProject:f}=(0,s.d4)(e=>e.project),{projects:g}=(0,s.d4)(e=>e.projects),b=(0,r.useMemo)(()=>t?.taggedUsers||(Array.isArray(g)?g.find(e=>e.guid===t?.projectId):void 0)?.teamMembers||f?.teamMembers||[],[t?.taggedUsers,t?.projectId,g,f?.teamMembers]),j=(0,r.useMemo)(()=>t?.userDetails||b?.find(e=>e.id===t?.userId),[t?.userDetails,t?.userId,b]),w=(0,r.useMemo)(()=>{let e=t?.taggedEmails;return Array.isArray(e)?b.filter(t=>e.includes(t.emailAddress)):[]},[t?.taggedEmails,b]);return t?(0,a.jsxs)("div",{className:`${n||o?"w-full md:w-full":d||"w-full mx-auto"} ${m?"bg-light-0 dark:bg-dark-3 border border-light-3 dark:border-dark-4 rounded-xl":"bg-light-0/60 dark:bg-dark-3/20 backdrop-blur-md border-x border-x-light-3/50 dark:border-x-dark-4/30"} shadow-[0_4px_24px_0_rgba(0,0,0,0.08)] dark:shadow-[0_4px_24px_0_rgba(0,0,0,0.3)] 2xl:mb-0 relative h-fit transition-all mt-0`,children:[(0,a.jsxs)("div",{className:"flex gap-4 p-2 pb-0 xl:px-4",children:[(0,a.jsxs)("div",{className:"relative shrink-0 hidden md:flex",children:[!m&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:`absolute hidden md:block left-6.25 top-12.5 
2w-0.5 bg-light-4 dark:bg-dark-4 ${t.repliesChilds?"bottom-11.25":"bottom-17.5"}`}),(0,a.jsx)("div",{className:`absolute hidden md:block left-6.25 bottom-0 w-0.5 ${t.repliesChilds?"h-11.25":"h-17.5"} border-l-2 border-dashed border-light-4 dark:border-dark-4`})]}),(0,a.jsx)(k.Ay,{user:j,size:"xl"})]}),(0,a.jsx)(eQ,{data:t.taggedUsers?{...t,taggedUsers:t.taggedUsers.map(e=>({...e.userDetails}))}:{...t,taggedUsers:w},handleRemovePost:l,refetchActivities:c,DiscussionLabel:i,singlePostView:m})]}),u&&(0,a.jsx)("div",{className:"mt-2 ",children:h.map((e,t)=>(0,a.jsxs)("div",{className:"p-2 border-b xl:px-4 border-light-3 dark:border-dark-4 last:border-b-0",children:[(0,a.jsxs)("div",{className:"mb-1 text-xs text-dark-5 dark:text-light-5",children:["Older revision: R",e.version||1]}),(0,a.jsxs)("div",{className:"flex gap-4 p-2 pb-0 xl:px-4",children:[(0,a.jsxs)("div",{className:"relative shrink-0",children:[(0,a.jsx)("div",{className:`absolute left-6.25 top-15 w-0.5 bg-light-4 dark:bg-dark-4 ${t===h.length-1?"bottom-12.5":"bottom-17.5"}`}),(0,a.jsx)("div",{className:`absolute hidden md:block left-6.25 bottom-0 w-0.5 ${t===h.length-1?"h-12.5":"h-17.5"} border-l-2 border-dashed border-light-4 dark:border-dark-4`}),(0,a.jsx)(k.Ay,{user:j,size:"xl"})]}),(0,a.jsx)(eQ,{data:e,child:!0,handleRemovePost:l,refetchActivities:c,DiscussionLabel:i,singlePostView:m})]})]},`older-${t}`))}),t.repliesChilds&&(0,a.jsxs)("button",{type:"button",className:"group flex w-full items-start justify-start gap-1 p-1 pt-0 cursor-pointer select-none rounded-md transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-purple/40",onClick:()=>{0===h.length&&x(t?.repliesChilds||[]),p(!u)},children:[(0,a.jsx)("div",{className:`absolute hidden md:block ${u?"left-14.25 bottom-6.25 h-8.75":"left-10.25 bottom-2.5 h-8.5"} w-0.5 border-l-2 border-dashed border-light-4 dark:border-dark-4`}),(0,a.jsxs)("span",{className:"text-sm font-semibold text-dark-5 dark:text-light-5 pl-2 lg:pl-20 py-3 flex items-center gap-1",children:[(0,a.jsx)(e_.RO,{}),u?"Hide Older Revisions":"View Older Revisions"]})]})]}):null},eW=(0,i.default)(()=>Promise.all([l.e(78882),l.e(6327),l.e(81857),l.e(93048)]).then(l.bind(l,81857)),{loadableGenerated:{webpack:()=>[81857]},ssr:!1}),eX=e=>{let{className:t,postId:l,isRightPanelVisible:i=!1,singlePostView:c=!1}=e,m=(0,s.wA)(),{successNotify:u,errorNotify:p,loadingNotify:h}=(0,X.A)(),{uploadType:x,isEditPost:g}=(0,Q.A)(),{isDiscussion:b,isActivities:j,isPublicSharing:y,isFeed:v,isDecision:k}=(0,z.A)(),{projectIds:N}=(0,s.d4)(e=>e.projects),{selectedProject:A,isFetchingProjectDetails:I,projectList:S}=(0,s.d4)(e=>e.project),{data:C,error:D,isLoading:P,isFetching:T,refetch:$}=(0,V.m5)({projectId:j||k?A?.guid:N,isBlocker:!!k},{skip:y||c||b||(j||k?!A?.guid:!N||0===N.length)}),{data:F,error:R,isLoading:L,isFetching:M,refetch:O}=(0,V.mt)(A?.guid,{skip:y||c||!b||!A?.guid}),J=j||k||b,Y=b?M:T,[K,Z]=(0,r.useState)(void 0);(0,r.useEffect)(()=>{J&&A?.guid&&!Y&&Z(A.guid)},[J,Y,A?.guid]);let ee=J&&!!A?.guid&&K!==A?.guid;(0,H.A)((0,r.useCallback)(()=>{b?O():$()},[b,O,$]));let et=(0,s.d4)(e=>e.category.filters),el=A?.currentUserAccess,ea=(0,r.useCallback)(e=>Array.isArray(e)?e.filter(e=>{let t=(S||[]).find(t=>t?.guid===e?.projectId)?.currentUserAccess;return!t?.isExternal||!!e?.postId&&(0,G.bx)(t).has(e.postId)}):e,[S]);(0,r.useEffect)(()=>{if(y||c)return;let e=(0,G.x3)(C,el),t=(0,G.x3)(F,el);if((j||k)&&(m((0,E.Y4)((0,d.W5)(e,et))),m((0,E.Pz)(e))),k&&(m((0,E.Mu)((0,d.W5)(e,et))),m((0,E.PJ)(e))),v){let e=ea(C);m((0,E.qE)((0,d.W5)(e,et))),m((0,E.dG)(e))}b&&(m((0,E.r6)(t)),m((0,E.dG)(t)))},[C,F,et,m,j,k,b,v,y,c,el,ea]);let{data:er,error:es,isLoading:ei,refetch:en}=(0,V.G8)(l,{skip:y||!c||!l}),{data:eo,error:ed,isLoading:ec,refetch:em}=(0,V.Fe)(l,{skip:!y||!l}),eu=y?eo:er,ep=y?ec:ei,eh=Array.isArray(eu)?eu[0]:void 0,{data:ex}=(0,V.m5)({projectId:eh?.projectId,isBlocker:!1},{skip:!c||y||!eh?.projectId}),ef=(0,r.useMemo)(()=>Array.isArray(eu)?eu.map(e=>{if(!e?.postId||e?.repliesChilds)return e;let t=e.parentPostId||e.postId;return(Array.isArray(ex)?ex.find(e=>e?.postId===t||e?.parentPostId===t):void 0)||e}):eu,[eu,ex]),eg=(0,s.d4)(e=>e?.contextMenu?.viewerModal),eb=(0,s.d4)(e=>!!e?.contextMenu?.selectedFileOrFolder?.fileId),ej=(0,s.d4)(e=>e.category.activitiesList,(e,t)=>e===t),ew=(0,s.d4)(e=>e.category.feedsList,(e,t)=>e===t),ey=(0,s.d4)(e=>e.category.insightsList,(e,t)=>e===t),ev=(0,s.d4)(e=>e.category.discussionList,(e,t)=>
2e===t),ek=(et?.postedBy?.length||0)+(et?.tags?.length||0)+(et?.status?.length||0)+(et?.category?.length||0)>0||!!et?.decision,eN=y||c?ef:b?ev:j?ej:k?ey:ew,{isQRModalOpen:eA}=(0,s.d4)(e=>e.contextMenu),[eI,eS]=(0,r.useState)(8);(0,r.useEffect)(()=>{eS(8)},[eN]);let eC=(0,r.useMemo)(()=>Array.isArray(eN)?eN.filter(Boolean):[],[eN]),eE=eC.slice(0,eI),eD=eI<eC.length,eP=eE.map(e=>e?.postId).join(",");((e,t,l)=>{let a=(0,s.wA)(),i=(0,r.useMemo)(()=>e.join(","),[e]);(0,r.useEffect)(()=>{if(l||!i)return;let e=i.split(",").map(e=>a(V.BP.endpoints.getSubPostData.initiate((0,V.rf)(e,t))));return()=>e.forEach(e=>e.unsubscribe())},[i,t,l,a])})((0,r.useMemo)(()=>eC.slice(0,eI+8).map(e=>e?.postId).filter(Boolean),[eC,eI]),y,b);let eT=(0,r.useCallback)(()=>{eS(e=>e+8)},[]),e$=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=e$.current;if(!e)return;let t=()=>{eD&&0!==e.clientHeight&&e.scrollHeight<=e.clientHeight&&eT()},l=new ResizeObserver(t);return l.observe(e),Array.from(e.children).forEach(e=>l.observe(e)),t(),()=>l.disconnect()},[eD,eP,eT]);let[eF]=(0,W.hS)(),eR=async e=>{let t=h("Moving post to Trash…");try{await eF({fileIds:[e]}).unwrap()}catch(l){let{data:e}=l;p(`${e?.error||e?.message||"Failed to remove post. Please try again."}`,{id:t});return}try{b?await O():await $()}catch(e){console.error("Post removed, but refreshing the list failed:",e)}u("Post moved to Trash",{id:t})},eL=(j||k||b)&&I||ee||T&&!C||M&&!F,eM="pb-4 w-full mx-auto flex flex-col overflow-auto no-scrollbar px-2 md:px-0 h-full bg-light-0 dark:bg-dark-3",eO=y||c,eU=!(ep||!c&&!y&&eL)&&eN?.length===0&&!ek;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col w-full h-full mx-auto overflow-hidden",children:[!y&&!c&&!eU&&(0,a.jsx)(U,{isRightPanelVisible:i,hideOnLg:v}),ep||!c&&!y&&eL?(0,a.jsx)(B.A,{}):eN?.length===0?(0,a.jsx)("div",{"data-activities-scroll":!0,className:`${eM} items-center justify-center`,children:ek?(0,a.jsxs)("div",{className:"flex flex-col items-center px-6 text-center",children:[(0,a.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-full bg-light-2 dark:bg-dark-3",children:(0,a.jsx)(q.A,{className:"h-7 w-7 text-dark-4 dark:text-light-4"})}),(0,a.jsx)("h3",{className:"mt-4 text-base font-semibold text-dark-1 dark:text-light-0",children:"No posts match your filters"}),(0,a.jsx)("p",{className:"mt-1 max-w-xs text-sm text-dark-4 dark:text-light-4",children:"Try adjusting or clearing your filters to see more."}),(0,a.jsx)("button",{type:"button",onClick:()=>m((0,E.dr)()),className:(0,f.V7)("outline","sm","mt-4"),children:"Clear filters"})]}):(0,a.jsx)(w,{variant:"empty"})}):(0,a.jsxs)("div",{ref:e$,"data-activities-scroll":!0,onScroll:e=>{let{scrollTop:t,scrollHeight:l,clientHeight:a}=e.target;t+a>=l-5&&eD&&eT()},className:eO?"pb-6 pt-2 w-full mx-auto flex flex-col overflow-auto no-scrollbar px-2 md:px-0 h-full":`${eM} gap-2`,children:[eE.map((e,l)=>(0,a.jsx)(eH,{item:e,handleRemovePost:eR,DiscussionLabel:"IDColab User",isDiscussion:b,isDecision:k,className:t,refetchActivities:b?O:$,singlePostView:y||c},`item-${e?.postId}-${l}`)),j&&(!eD||Array.isArray(eN)&&0===eN.length||!eN)&&!y&&!c&&(0,a.jsx)("div",{className:"flex flex-col items-center px-4",children:(0,a.jsx)(w,{})})]})]}),eA&&!eg&&(0,a.jsx)(o.A,{}),x===_.NL.FILES&&!(c&&!g)&&(0,a.jsx)(n.A,{}),eg&&eb&&(0,a.jsx)(eW,{})]})}},27185:(e,t,l)=>{"use strict";l.d(t,{E:()=>a,q:()=>r});let a=e=>{let t=e.name.split(".").pop()?.toLowerCase()??"";return"image/heic"===e.type||"image/heif"===e.type||"heic"===t||"heif"===t},r=async e=>{let t=e.name.replace(/\.(heic|heif)$/i,".jpg"),l=new FormData;l.append("file",e);let a=await fetch("/api/convert-heic",{method:"POST",body:l});if(!a.ok){let t=`Server returned ${a.status}`;try{let e=await a.json();e?.error&&(t=e.error)}catch{}throw Error(`Failed to convert "${e.name}": ${t}`)}return new File([await a.blob()],t,{type:"image/jpeg"})}},27800:(e,t,l)=>{"use strict";l.d(t,{A:()=>r});var a=l(95155);l(12115);let r=e=>{let{className:t="",...l}=e;return(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20",className:t,...l,children:(0,a.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.952 1.042h.095c1.924 0 3.432 0 4.608.158 1.204.161 2.154.5 2.9 1.245.745.746 1.083 1.696 1.244 2.9.159 1.176.159 2.683.159 4.607v.095l-.001 1.067v.082c-.006 1.389-.032 2.528-.158 3.459-.161 1.204-.5 2.154-1.244 2.9-.746.746-1.696 1.083-2.9 1.245-.615.083-1.32.122-2.128.142a.6.6 0 0 1-.267.005c-.668.011-1.404.011-2.212.011h-.096c-1.924 0-3.432 0-4.608-.158-1.204-.162-2.154-.5-2.9-1.245-.745-.746-1.083-1.696-1.245-2.9-.158-1.176-.158
2-2.683-.158-4.608v-.095q0-.758.003-1.43a1 1 0 0 1 0-.13c.01-1.205.042-2.21.155-3.047.162-1.204.5-2.154 1.245-2.9S4.14 1.362 5.344 1.2c1.176-.158 2.684-.158 4.608-.158m-7.66 7.961V10c0 1.982 0 3.405.145 4.488.143 1.066.417 1.709.89 2.184.476.474 1.117.746 2.183.89 1.084.144 2.507.146 4.489.146.67 0 1.276 0 1.827-.006.453-5.16-4.034-9.489-9.255-8.74zm10.79 8.67q.706-.023 1.406-.111c1.065-.144 1.707-.417 2.182-.891s.747-1.117.89-2.183c.1-.745.132-1.652.142-2.79l-.267-.037a4.99 4.99 0 0 0-4.866 2.202 9.3 9.3 0 0 1 .514 3.81m-1.094-5.111c-1.784-3.298-5.494-5.425-9.594-4.836l-.092.012c.017-.88.052-1.608.135-2.227.143-1.065.417-1.708.89-2.183.476-.474 1.117-.746 2.183-.89 1.084-.145 2.507-.147 4.489-.147s3.406.002 4.489.147c1.065.143 1.707.417 2.182.891s.747 1.117.89 2.182c.145 1.084.147 2.507.147 4.489v.437l-.1-.015a6.22 6.22 0 0 0-5.618 2.14m1.344-6.937a1.042 1.042 0 1 0 0 2.083 1.042 1.042 0 0 0 0-2.083M11.04 6.667a2.292 2.292 0 1 1 4.583 0 2.292 2.292 0 0 1-4.583 0",clipRule:"evenodd"})})}},28815:(e,t,l)=>{"use strict";l.d(t,{A:()=>o});var a=l(95155),r=l(85828),s=l(71781),i=l(11636),n=l(1213);let o=e=>{let{acceptAttribute:t,handleImageUpload:l,uploadData:o,tempThumbnail:d,isRWFFileUpload:c}=e,{activeCategory:m}=(0,n.d4)(e=>e.fileExplorer),{getRootProps:u,getInputProps:p}=(0,i.VB)({onDrop:e=>{l({target:{files:e}},{category:m,imageType:o.posts[0]?.thumbnailRen?.url&&o.posts[0]?.afterThumbnailRe
2n?.url?"beforeImage":o.posts[0]?.thumbnailRen?.url?"afterImages":"beforeImage"})},multiple:!0,accept:t,noClick:!0});return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{...u(),className:"col-span-9 flex w-full flex-col gap-3 relative",children:[(0,a.jsx)("div",{className:"flex w-full flex-col border-2 border-light-3 dark:border-dark-5 rounded-xl overflow-hidden h-[38vh] max-h-95",children:(0,a.jsxs)("div",{className:"w-full h-full",children:[(0,a.jsx)(r.EW,{className:"h-full",style:{height:"100%"},itemOne:(0,a.jsx)(r.D4,{className:"bg-light-0 dark:bg-dark-2 rounded-xl object-contain",style:{height:"100%",maxHeight:"44vh",borderTopLeftRadius:"8px",borderTopRightRadius:"8px"},src:d?.[0]?.thumbnailFile?.url||o.posts[0]?.thumbnailRen?.url||"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",alt:""}),itemTwo:(0,a.jsx)(r.D4,{className:"bg-light-0 dark:bg-dark-2 rounded-xl object-contain",style:{height:"100%",maxHeight:"44vh",borderTopLeftRadius:"8px",borderTopRightRadius:"8px"},src:d?.[0]?.afterThumbnail?.url||o.posts[0]?.afterThumbnailRe
2n?.url||"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",alt:""}),handle:(0,a.jsx)(r.UL,{style:{color:"var(--color-dark-6)"},buttonStyle:{borderColor:"var(--color-dark-6)"}})}),(0,a.jsx)("input",{...p()})]})}),(0,a.jsx)("div",{className:"flex w-full shrink-0 flex-col gap-3 bg-transparent sm:flex-row sm:gap-5",children:[1,2].map((e,r)=>(0,a.jsxs)("div",{className:"flex flex-1 flex-col gap-2 border-dashed border-light-3",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-dark-2 dark:text-light-0",children:`Image ${r+1}`}),(0,a.jsx)("div",{className:"flex h-22.5 w-full items-center justify-end rounded-xl border-2 border-dashed border-light-3 dark:border-dark-5",children:(0,a.jsx)(s.A,{labelStyle:"min-h-full",id:`upload-input-${r}`,multiple:!1,acceptAttribute:t,dragDropCardInputChange:e=>{l(e,{category:m,imageType:1===r?"afterImages":"beforeImage"})},hiddenText:!1,index:r,customStyle:"p-0! h-full! w-full!",isRWFFileUpload:c},r)})]},r))})]})})}},31815:()=>{},32184:(e,t,l)=>{"use strict";l.d(t,{A:()=>o});var a=l(95155),r=l(12834),s=l(34065),i=l(29545),n=l(5016);let o=e=>{let{baseUrl:t,hideActionButtons:l=!1}=e,{isActivities:o}=(0,i.A)();return(0,a.jsxs)("div",{className:`${o&&!l?"hidden":"flex "} bg-light-2 dark:bg-dark-3 rounded-2xl p-2 gap-6 md:flex-row flex-col w-full`,children:[!l&&(0,a.jsxs)("div",{className:"flex flex-col justify-center gap-4 flex-1",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("div",{className:"font-semibold text-base text-dark-2 dark:text-light-0",children:"Share via QR Code"}),(0,a.jsx)("div",{className:"text-xs font-medium text-dark-5 dark:text-light-0",children:"Scan the QR code to access this project instantly"})]}),(0,a.jsx)("div",{className:"flex md:justify-end  md:mt-[5rem] ",children:(0,a.jsxs)(n.Ay,{variant:"outline",size:"sm",type:"button",onClick:()=>{let e=document.getElementById("qr_code_main");if(e instanceof HTMLCanvasElement){let t=e.toDataURL("image/png").replace("image/png","image/octet-stream"),l=document.createElement("a");l.href=t,l.download="QR_Code.png",document.body.appendChild(l),l.click(),document.body.removeChild(l)}else console.error("QR code element is not a canvas or not found")},className:"h-10 gap-2",children:[(0,a.jsx)(s.A,{className:"w-5 h-5"}),"Download QR Code"]})})]}),(0,a.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,a.jsx)("div",{className:"flex flex-col items-center gap-3  bg-light-0 rounded-xl p-3 max-sm:w-full ",children:(0,a.jsx)(r.Xe,{id:"qr_code_main",value:t,size:1024,level:"M",includeMargin:!0,className:"!h-75 !w-75 md:!w-37.5 md:!h-37.5  "})}),!l&&(0,a.jsx)("div",{className:"text-xs font-medium text-dark-5 dark:text-light-0 text-center",children:"Scan here"})]})]})}},32605:(e,t,l)=>{"use strict";l.d(t,{A:()=>o});var a=l(12115),r=l(1213),s=l(78028),i=l(36652),n=l(66788);let o=()=>{let e=(0,r.wA)(),{currentProject:t,projectCount:l,projects:o,parentFolderId:d}=(0,r.d4)(e=>e.projects),{authStatus:c}=(0,s.A)(e=>[e.authStatus]),{user:m,signOut:u}=(0,s.A)(e=>[e.user]),{userDetails:p}=(0,r.d4)(e=>e.projects),h="authenticated"===c,x=`${m?.userId}/${p?.emailAddress||m?.signInDetails?.loginId}`,{data:f,error:g,isLoading:b,refetch:j,isFetching:w}=(0,i.Fn)(x,{skip:!h,refetchOnMountOrArgChange:60}),y=Array.isArray(f)&&f.map(e=>e.guid).filter((e,t,l)=>l.indexOf(e)===t),v=(0,a.useRef)(null),k=(0,a.useRef)(null),N=(0,a.useRef)(null);return(0,a.useEffect)(()=>{if(f&&f.length>0){let l=JSON.stringify(v.current)!==JSON.stringify(f),a=JSON.stringify(k.current)!==JSON.stringify(y),r=JSON.stringify(N.current)!==JSON.stringify(t?.guid);if(l&&(e((0,n.r$)(f)),e((0,n.$0)(f.length)),v.current=f),a&&(e((0,n.s6)(y)),k.current=y),r&&t?.guid){let l=f.find(e=>e?.guid===t?.guid);l&&(e((0,n.lK)(l)),N.current=t?.guid)}}},[f,y,t?.guid,e]),{currentProject:t,projectLength:l,refetchProject:j,projects:o,fetchedProjects:f,projectsError:g,projectsLoading:b,projectsFetching:w,user:m,userIdAndEmail:x,signOut:u,loginStatus:h,activeParentFolderId:d}}},41123:(e,t,l)=>{"use strict";l.d(t,{A:()=>T});var a=l(95155),r=l(12115),s=l(1213),i=l(15239),n=l(14303),o=l(44512),d=l(61962),c=l(44265),m=l(80675),u=l(71155),p=l(6172),h=l(99553),x=l(70631),f=l(64269),g=l(21980),b=l(48242),j=l(36652),w=l(97412),y=l(95157),v=l(41112),k=l(49438),N=l(12511),A=l(63909),I=l(32509),S=l(27800),C=l(28079),E=l(17815);let D=new Set([w.xQ.PPT,w.xQ.SHEET,w.xQ.DOC,"application/json",w.$H.SHEET,w.$H.DOC,w.$H.SLIDE]),P=new Set(["pptx","ppt","docx","doc","xlsx","xls","json"]),T=e=>{let{hideCheckBox:t=!0,data:l,selectedIndex:T,isMoveFlow:$,imageViewer:F=!1,sideBySide:R=!1,imageList:L=null,heightClass:M="h-75",borderlessMedia:O=!1}=e,U=(0,s.wA)(),{userDetails:B}=(0,E.A)(),z=(0,c.A)(),[q,V]=(0,r.useState)(!1),[G,_]=(0,r.useState)(null),[Q,H]=(0,r.useState)(!1),{errorNotify:W}=(0,C.A)(),{selectedFileOrFolder:X,selectedIds:J}=(0,s.d4)(e=>e.contextMenu),Y=Array.isArray(J)&&J.some(e=>e.fileId===l.fileId),K=(0,f.dS)(l?.userDetails),Z=(0,s.d4)(e=>e?.projects?.userDetails);(0,f.dS)(Z);let[ee,{error:et}]=(0,j.OD)();X?.fileType===w.xQ.PPT?w.xQ.PPTTYPEDESC:X?.fileType===w.xQ.SHEET?w.xQ.SHEETTYPEDESC:w.xQ.DOCTYPEDESC,X?.fileType===w.xQ.PPT?w.xQ.PPTTYPE:X?.f
2ileType===w.xQ.SHEET?w.xQ.SHEETTYPE:w.xQ.DOCTYPE,X?.projectId,X?.parentFolderId,X?.userId,X?.category,X?.fileName,X?.fileS3Id;let[el,ea]=(0,r.useState)(!1),er=()=>{!$&&(G&&(clearTimeout(G),_(null)),z(l)||(U((0,b.V)(!1)),F&&U((0,b.JD)(!0)),U((0,b.$j)({...l,imageList:L||[l]})),U((0,b.gz)(T)),U((0,b.ZX)(!1)),U((0,b.qc)([])),U((0,b.q5)(!0))))};return(0,r.useEffect)(()=>{let e=()=>{V(window.innerWidth<=768)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e),G&&clearTimeout(G)}},[G]),(0,a.jsxs)("div",{onClick:q?er:e=>{if($)return;if(G){clearTimeout(G),_(null);return}let t=setTimeout(()=>{let t={fileId:l.fileId,fileName:l.fileName,parentFolderId:l.parentFolderId};U((0,b.$j)(l)),U((0,b.V)(!0)),e.ctrlKey||e.metaKey?U((0,b.RG)(t)):U((0,b.qc)([t])),_(null)},200);_(t)},onDoubleClick:q?void 0:er,className:`group ${M} lg:w-full rounded-xl shadow-sm border-light-3 dark:border-dark-4 border-[1.5px] p-2.5 max-lg:p-2 bg-light-0
3         overflow-hidden dark:bg-dark-3 relative transition-shadow hover:shadow-md
4        ${Y?"ring-2 ring-light-4 dark:ring-light-6 ring-offset-0 border-light-4 dark:border-light-6 bg-light-2/60 dark:bg-dark-4/50":""}`,children:[(0,a.jsx)(m.A,{show:el,scrim:"dark",rounded:"xl",label:"Opening file...",className:"z-50"}),(0,a.jsxs)("div",{className:"flex flex-col h-full",children:[(0,a.jsxs)("div",{className:`items-center justify-center relative rounded-xl overflow-hidden flex-1 min-h-0 flex ${O?"":"bg-light-2 dark:bg-dark-4"}`,children:[!t&&(0,a.jsx)(I.A,{selected:Y,cardSelector:".group",checkbox:(0,a.jsx)(y.A,{"aria-label":`Select ${l?.fileName||"file"}`,checked:Y,onChange:e=>{e.stopPropagation();let t={fileId:l.fileId,fileName:l.fileName,parentFolderId:l.parentFolderId};e.target.checked?(U((0,b.$j)(l)),U((0,b.V)(!0)),J.some(e=>e.fileId===l.fileId)||U((0,b.RG)(t))):(U((0,b.RG)(t)),0===J.filter(e=>e.fileId!==l.fileId).length&&(U((0,b.$j)(null)),U((0,b.V)(!1))))},onClick:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),className:"transition-opacity duration-300"})}),(0,d.fj)(l)?(0,a.jsxs)("div",{className:"h-full w-full flex flex-col items-center justify-center gap-2 bg-light-2 dark:bg-dark-4",children:[(0,a.jsx)(o.tx,{className:"w-10 h-10 text-dark-4 dark:text-light-3"}),(0,a.jsx)("span",{className:"px-2 py-0.5 rounded-md text-[10px] font-bold tracking-wide bg-light-0 dark:bg-dark-3 text-dark-2 dark:text-light-0 border border-light-3 dark:border-dark-5",children:(0,d.NY)(l?.fileName)})]}):l?.category==="3dmodels"||l?.fileType?.includes("model/")?l.thumbnailS3Id?(0,a.jsx)(i.default,{src:(0,g.dE)(l?.thumbnailS3Id),width:550,height:550,alt:"IDcolab",className:"h-full w-full max-h-full dark:border-dark-4 rounded-xl object-cover","data-lightboxjs":"lightbox1",unoptimized:!0}):(0,a.jsx)("div",{className:"h-full w-full flex items-center justify-center bg-light-2 dark:bg-dark-4",children:(0,a.jsx)(o.G$,{className:"w-16 h-16"})}):l?.fileType?.includes("pdf")||"pdf"===(0,f.QC)(l?.fileName)?(0,a.jsx)(n.A,{currentImage:l}):l.fileS3Id&&(0,a.jsx)(a.Fragment,{children:(0,w.uA)(l?.fileType)&&l?.thumbnailS3Id?(0,a.jsx)(i.default,{src:(0,g.dE)(l?.thumbnailS3Id),width:550,height:550,alt:"IDcolab",className:"h-full w-full max-h-full dark:border-dark-4 rounded-xl object-cover",unoptimized:!0}):l?.fileType===w.xQ.SHEET||l?.fileType===w.$H.SHEET?(0,a.jsx)(o.y5,{className:"h-35 w-full flex items-center justify-center bg-light-2 text-dark-3"}):l?.fileType===w.xQ.DOC||l?.fileType===w.$H.DOC?(0,a.jsx)(o.$i,{className:"h-35 w-full flex items-center justify-center bg-light-2 text-dark-3"}):l?.fileType===w.xQ.PPT||l?.fileType===w.$H.SLIDE?(0,a.jsx)(o.OM,{className:"w-auto h-auto"}):l?.category===w.b7.Videos?Q?(0,a.jsxs)("div",{className:"h-full w-full flex flex-col items-center justify-center gap-2 rounded-xl bg-light-2 dark:bg-dark-4",children:[(0,a.jsx)(v.A,{className:"w-10 h-10 text-dark-5 dark:text-light-3"}),(0,a.jsx)("span",{className:"text-xs text-dark-5 dark:text-light-3",children:"Thumbnail generating..."})]}):(0,a.jsx)(i.default,{src:l.thumbnailS3Id?(0,g.dE)(l.thumbnailS3Id):(0,g.Wm)(l?.fileS3Id,"thumbnail.jpg"),width:550,height:550,alt:"IDcolab",className:"h-full w-full object-center object-cover rounded-xl max-h-full",onError:()=>H(!0)}):(0,a.jsx)(i.default,{src:(0,g.dE)(l?.thumbnailS3Id),width:550,height:550,alt:"IDcolab",className:`h-full w-full max-h-full dark:border-dark-4 ${R?"rounded-l-xl rounded-r-none":"rounded-xl"} ${h.pA[6].category===l?.category?"max-w-[50%] object-cover":h.pA[12].category===l?.category?"object-contain":"object-cover"}`,"data-lightboxjs":"lightbox1",unoptimized:!0})}),h.pA[6].category===l?.category&&l?.afterthumbnailS3Id&&(0,a.jsx)(i.default,{src:(0,g.dE)(l?.afterthumbnailS3Id),width:550,height:550,alt:"IDcolab",className:`${h.pA[6].category===l?.category?"max-w-[50%]":""} h-full w-full max-h-full dark:border-dark-4 overflow-hidden object-center object-cover relative ${R?"rounded-r-xl":"rounded-xl"}`,unoptimized:!0})]}),(0,a.jsxs)("div",{className:"pt-2.5 rounded-b-md flex flex-col justify-between lg:gap-2 gap-2.5 flex-none",children:[(0,a.jsxs)("div",{className:"flex items-center overflow-hidden text-xs cursor-default xl:text-base text-dark-2 dark:text-light-0",children:[(0,a.jsx)("span",{className:"flex items-center mr-2 dark:text-light-0",children:h.pA[6].category===l?.category?(0,a.jsx)(o.D3,{className:"w-5 h-5 text-dark-5 dark:text-light-1"}):l?.category==="panorama"?(0,a.jsx)(p._2v,{className:"w-5 h-5 dark:text-light-0"}):l?.category==="videos"?(0,a.jsx)(v.A,{className:"w-5 h-5 dark:text-light-0"}):l?.category==="moodboard"&&l?.fileType===w.xQ.PPT?(0,a.jsx)(o.yr,{className:"w-6 h-6 dark:text-light-0"}):l?.category==="moodboard"&&l?.fileType==="application/json"?(0,a.jsx)(k.A,{className:"w-5 h-5 dark:text-light-0"}):l?.category==="3dmodels"?(0,a.jsx)(N.A,{className:"w-5 h-5 dark:text-light-0"}):l?.fileType==="zsheet"||l?.fileType===w.$H.SHEET||l?.fileType?.includes("sheet")||l?.fileType?.includes("excel")||["xls","xlsx"].includes((0,f.QC)(l?.fileName)??"")?(0,a.jsx)(o.GE,{className:"w-5 h-5 dark:text-light-0"}):l?.fileType==="zdoc"||l?.fileType===w.$H.DOC||l?.fileType?.includes("word")||["doc","docx"].includes((0,f.QC)(l?.fileName)??"")?(0,a.jsx)(u.A,{className:"w-5 h-5 dark:text-light-0"}):l?.fileType===w.$H.SLIDE||l?.fileType?.includes("powerpoint")||l?.fileType?.includes("presentation")||["ppt","pptx"].includes((0,f.QC)(l?.fileName)??"")?(0,a.jsx)(p.Uyc,{className:"w-5 h-5 dark:text-light-0"}):l?.fileType?.includes("pdf")||"pdf"===(0,f.QC)(l?.fileName)?(0,a.jsx)(o.sT,{className:"w-5 h-5 dark:text-light-0"}):(0,a.jsx)(S.A,{className:"w-5 h-5 dark:text-light-0"})}),(0,a.jsx)("div",{className:"w-full max-w-75 truncate tracking-tight text-dark-2 font-bold text-base dark:text-light-0 lg:max-w-50 lg:text-sm",children:l?.fileName})]}),(0,a.jsxs)("p",{className:"font-medium tracking-tighter cursor-default text-xs text-dark-5 dark:text-light-0",children:["Created on: ",(0,x.d$)(l?.createdAt)," by ",K]})]})]}),l?.isPublished===!1&&((e,t)=>{if(D.has(e))return!0;let l=t?.split(".").pop()?.toLowerCase();return P.has(l??"")})(l?.fileType,l?.fileName)&&(0,a.jsxs)("span",{className:"absolute bottom-2 right-2 z-10 inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-bold bg-light-3 text-dark-2 border border-light-4 dark:bg-dark-4 dark:text-light-2 dark:border-dark-5",children:[(0,a.jsx)(A.A,{className:"w-3 h-3"}),"Private"]})]},T)}},41286:(e,t,l)=>{"use strict";l.d(t,{A:()=>i});var a=l(95155);l(12115);var r=l(45953),s=l(13853);let i=e=>{let t=e.data||{},l=!!(t.authorName||t.dateLabel);return(0,a.jsx)(r.c.Option,{...e,children:(0,a.jsxs)("div",{className:"flex items-center gap-2.5 min-w-0",children:[(0,a.jsx)("span",{className:`${s.B} shrink-0`,children:t.label}),t.revisionTag&&(0,a.jsx)("span",{className:`${s.B} shrink-0`,children:t.revisionTag}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[l&&(0,a.jsxs)("div",{className:"flex items-baseline gap-2 min-w-0",children:[t.authorName&&(0,a.jsx)("span",{className:"truncate text-sm font-semibold text-dark-2 dark:text-light-0",children:t.authorName}),t.dateLabel&&(0,a.jsx)("span",{className:"shrink-0 text-xs text-dark-6 dark:text-light-5",children:t.dateLabel})]}),t.description&&(0,a.jsx)("div",{className:`truncate text-dark-6 dark:text-light-5 ${l?"text-xs":"text-sm"}`,children:t.description})]}),(0,a.jsx)("button",{type:"button",className:"ml-auto shrink-0 text-xs font-semibold text-purple hover:underline",onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:e=>{e.preventDefault(),e.stopPropagation(),t.onView?.(t.value)},children:"View"})]})})}},42108:(e,t,l)=>{"use strict";l.d(t,{A:()=>R});var a=l(95155),r=l(12115),s=l(68959),i=l(8068),n=l(58752),o=l(1213),d=l(20063),c=l(52704),m=l(34065),u=l(38688),p=l(58998),h=l(9252),x=l(92302),f=l(9554),g=l(53866),b=l(95108),j=l(64269),w=l(21980),y=l(48242),v=l(42302),k=l(38197),N=l(3750),A=l(97473),I=l(97412),S=l(28079),C=l(51575),E=l(74923),D=l(86999),P=l(36989),T=l(56846),$=l(66137);let F=new Set(["Edit","Move","Share","Delete"]),R=e=>{let{x:t,y:l,type:R,data:L}=e,M=(0,o.wA)(),{guard:O}=(0,i.A)(),U=(0,d.useRouter)(),B=(0,r.useRef)(null);(0,d.usePathname)();let z=(0,o.d4)(e=>e?.projects?.userDetails?.id),{contextMenuData:q,selectedIds:V,uploadModalType:G,selectedFileOrFolder:_}=(0,o.d4)(e=>e.contextMenu),{navigationPath:Q,rootData:H}=(0,o.d4)(e=>e.category),{activeCategory:W}=(0,o.d4)(e=>e.fileExplorer),{selectedProject:X}=(0,o.d4)(e=>e.project),{successNotify:J,errorNotify:Y}=(0,S.A)(),[K]=(0,A.hS)(),{canEdit:Z,canDelete:ee}=(0,E.A)(),et=`${w.iQ}${q?.item?.fileS3Id}?filename=${q?.item?.fileName}&v=${Date.now()}`,el=q?.item?.fileName,{refetch:ea}=(0,C.A)(W??""),er=async()=>
4{try{let e="survey"===R,t=e?[_?.postId].filter(Boolean):V.map(e=>"string"==typeof e?e:e.fileId);if(!t.length)return void Y("Please select at least one item to delete");if(await K({fileIds:t}).unwrap()){if(J("Moved to Trash"),e){let e=_?.projectId;e&&M(N.BP.util.invalidateTags([{type:"Survey",id:e}])),M((0,y.SN)()),M((0,y.wr)());return}let{isSuccess:t,data:l}=await ea();if(M((0,v.De)(l)),0===Q.length){M((0,y.SN)()),M((0,v.X6)(l));return}if(t&&l){let e=l,t=null;for(let l=0;l<Q.length;l++){let a=Q[l].fileId;if((t=e.find(e=>e.fileId===a))&&Array.isArray(t.children))e=t.children;else{e=[];break}}M((0,v.X6)(e))}else Y("Failed to fetch updated data. Please try again.");M((0,y.SN)()),M((0,y.wr)())}}catch(e){Y(e?.data?.message||e?.message||"Failed to delete. Please try again.")}},es=[{label:"Open in new tab",icon:(0,a.jsx)(c.A,{className:"w-4 h-4 text-dark-4 dark:text-light-0"}),onClick:()=>{let e=q?.item??_;e?.fileCategory===I.NL.FOLDER?window.open((0,$.EE)((0,$.hp)(window.location.pathname),e.fileId),"_blank"):((0,T.LS)({file:e}),window.open(window.location.pathname+window.location.search,"_blank"),(0,T.Ht)()),M((0,y.SN)())}},{label:"Download",icon:(0,a.jsx)(m.A,{className:"w-4 h-4 text-dark-4 dark:text-light-0"}),onClick:()=>{q?.item?.fileCategory===I.NL.FOLDER?(0,j.qm)(q?.item):(0,j.SN)(q?.item)?(0,j._r)(q?.item?.fileS3Id,el):(0,j.PE)(et,el),M((0,y.SN)())}},{label:"Edit",icon:(0,a.jsx)(u.A,{className:"w-4 h-4 text-dark-4 dark:text-light-0"}),onClick:()=>{G===I.NL.LINK?(M((0,y.ob)(!0)),M((0,y.fd)(!0))):M((0,y.oZ)()),M((0,y.lR)()),M((0,y.ll)(G)),M((0,y.SN)())}},{label:"Move",icon:(0,a.jsx)(p.A,{className:"w-4 h-4 text-dark-4 dark:text-light-0"}),onClick:()=>{M((0,P.S$)({fileId:L?.fileId,fileName:L?.fileName,parentFolderId:L?.parentFolderId})),M((0,y.SN)());let e=H.filter(e=>e.fileId!==_?.fileId);M((0,v.zm)(e)),M((0,k._1)({name:"moveModal",toggle:!0}))}},{label:"Share",icon:(0,a.jsx)(h.A,{className:"w-4 h-4 text-dark-4 dark:text-light-0"}),onClick:()=>{M((0,y.Ll)(!0)),M((0,y.SN)())}},{label:"Information",icon:(0,a.jsx)(x.A,{className:"w-4 h-4 text-dark-4 dark:text-light-0"}),onClick:()=>{M((0,y.M4)())}},{label:"Delete",icon:(0,a.jsx)(f.A,{className:"w-4 h-4 text-dark-4 dark:text-light-0"}),onClick:()=>{er()}}],ei=[{label:"Edit",icon:(0,a.jsx)(u.A,{className:"w-4 h-4 text-dark-4 dark:text-light-0"}),onClick:()=>{_&&sessionStorage.setItem("editSurveyData",JSON.stringify(_)),M((0,y.SN)()),U.push("/survey?isEdit=true")}},{label:"Open in new tab",icon:(0,a.jsx)(c.A,{className:"w-4 h-4 text-dark-4 dark:text-light-0"}),onClick:()=>{_&&sessionStorage.setItem("editSurveyData",JSON.stringify(_));let e=new URL(`${origin}/survey`);e.searchParams.append("isEdit","true"),window.open(e.toString(),"_blank"),M((0,y.SN)())}},{label:"Copy",icon:(0,a.jsx)(g.A,{className:"w-4 h-4 text-dark-4 dark:text-light-0"}),onClick:()=>M((0,y.SN)())},{label:"Share",icon:(0,a.jsx)(h.A,{className:"w-4 h-4 text-dark-4 dark:text-light-0"}),onClick:()=>{M((0,y.Ll)(!0)),M((0,y.SN)())}},{label:"Delete",icon:(0,a.jsx)(f.A,{className:"w-4 h-4 text-dark-4 dark:text-light-0"}),onClick:()=>{er()}},{label:"Result",icon:(0,a.jsx)(b.A,{className:"w-4 h-4 text-dark-4 dark:text-light-0"}),onClick:()=>{M((0,y.Wo)(!0)),M((0,y.q5)(!0))}}];(0,s.A)(B,()=>M((0,y.SN)()));let en=q?.item?.userId??L?.userId??_?.userId,eo=X?.currentUserAccess,ed=!!eo?.isExternal,ec=q?.item?.fileId??L?.fileId??_?.fileId,em=(Array.isArray(Q)?Q:[]).map(e=>e?.fileId),eu=(0,D.nL)(eo,ec,em),ep=!!en&&en===z;return(0,a.jsx)("div",{ref:B,"data-ignore-outside-click":!0,"data-context-menu":"true",style:{top:`${l}px`,left:`${t}px`,position:"fixed",zIndex:10},className:`w-50 p-1 ${n.X}`,children:("survey"===R?ei:es).filter(e=>{let{label:t}=e;return"survey"===R?!["Edit","Open in new tab","Copy","Share","Delete"].includes(t)||!!en&&en===z:(e=>ed?"Download"===e||"Share"===e?"edit"===eu:"Edit"===e?"edit"===eu&&ep:"Delete"===e?"edit"===eu&&ep&&!(0,D.HF)(eo,ec):"Move"!==e&&"Copy"!==e:"Move"===e||"Download"===e||"Share"===e||"Edit"===e?Z:"Delete"!==e||ee(en))(t)}).map((e,t)=>{let{label:l,icon:r,onClick:s}=e;return(0,a.jsxs)("button",{type:"button",className:"flex items-center gap-2 w-full rounded px-4 py-2 text-base font-medium text-dark-2 dark:text-light-0 active:text-dark-2 hover:bg-light-1 dark:hover:bg-dark-4 cursor-pointer",onClick:()=>
4{if(F.has(l)&&O(l.toLowerCase()))return void M((0,y.SN)());s?.()},children:[r,(0,a.jsx)("span",{className:"ml-3 text-sm",children:l})]},t)})})}},43466:(e,t,l)=>{"use strict";l.d(t,{A:()=>f});var a=l(95155),r=l(11636),s=l(15239),i=l(20704),n=l(71781),o=l(21980),d=l(48878),c=l(71155),m=l(52106),u=l(27800),p=l(44512),h=l(61962),x=l(6172);let f=e=>{let{acceptAttribute:t,handleImageUpload:l,category:f,handleDescriptionChange:g,uploadData:b,tempThumbnail:j,handleRemovePost:w,updatePost:y,isRWFFileUpload:v,disableAddMore:k=!1}=e,{isEditPost:N}=(0,d.A)(),{getRootProps:A,getInputProps:I}=(0,r.VB)({onDrop:e=>{l({target:{files:e}},{category:f})},multiple:!v,accept:t,noClick:!0,disabled:k}),S=N?y?.posts:j;f=N?y?.category:f;let C=()=>S?.length>0&&S?.map((e,t)=>{let l=N?e?.fileName:e?.name,r=((e,t)=>{let l=e?.split(".").pop()?.toLowerCase()??"",a=t?.toLowerCase()??"";return a.includes("sheet")||a.includes("excel")||"xls"===l||"xlsx"===l?"sheet":a.includes("word")||"doc"===l||"docx"===l?"doc":a.includes("powerpoint")||a.includes("presentation")||"ppt"===l||"pptx"===l?"show":a.includes("pdf")||"pdf"===l?"pdf":(0,h.w4)(e)?"cad":"other"})(l,e?.fileType??e?.type);return(0,a.jsxs)("div",{className:`${k?"w-full max-w-170 relative":"xl:w-47.75 relative lg:w-42.5 md:h-full w-42.5 h-66.25"} bg-light-0 dark:bg-dark-2 border border-light-3 dark:border-dark-4 rounded-xl shadow-sm overflow-hidden flex flex-col justify-between shrink-0`,children:[(0,a.jsx)("button",{type:"button","aria-label":"Remove file",onClick:()=>w(t),className:"absolute top-2 right-2 bg-light-0 dark:bg-dark-3 rounded-md z-20 border border-light-3 dark:border-dark-4 shadow cursor-pointer hover:bg-light-5 dark:hover:bg-dark-4",children:(0,a.jsx)(i.A,{className:"w-4 h-4 text-dark-2 dark:text-light-0"})}),"cad"===r?(0,a.jsxs)("div",{className:`w-full ${k?"h-80 xl:h-110":"h-33.5"} bg-light-5 dark:bg-dark-3 flex flex-col items-center justify-center gap-2`,children:[(0,a.jsx)(p.tx,{className:"w-10 h-10 text-dark-5 dark:text-light-5"}),(0,a.jsx)("span",{className:"px-2 py-0.5 rounded-md text-[10px] font-bold tracking-wide bg-light-0 dark:bg-dark-2 text-dark-2 dark:text-light-0 border border-light-3 dark:border-dark-4",children:(0,h.NY)(l)})]}):"application/pdf"===e.fileType||"application/pdf"===e.type?(0,a.jsx)("div",{className:"w-full h-33.5 bg-light-5 dark:bg-dark-3 flex items-center justify-center relative",children:!N&&e?.url&&""!==e.url.trim()?e.url.startsWith("data:")?(0,a.jsx)("img",{className:"w-full h-full object-cover",src:e.url,alt:`PDF thumbnail ${t}`,onError:t=>{console.error("Failed to load PDF thumbnail:",e.url?.substring(0,50)),t.currentTarget.style.display="none"}}):(0,a.jsx)(s.default,{className:"w-full h-full object-cover",src:e.url,alt:`PDF thumbnail ${t}`,width:220,height:140,unoptimized:!0,onError:()=>{console.error("Failed to load PDF thumbnail image")}}):y?.posts?.[t]?.newPost&&y?.posts?.[t]?.thumbnail?.url&&y?.posts?.[t]?.thumbnail?.url.trim()!==""?y?.posts?.[t]?.thumbnail?.url.startsWith("data:")?(0,a.jsx)("img",{className:"w-full h-full object-cover",src:y?.posts?.[t]?.thumbnail?.url,alt:y?.posts?.[t]?.fileName,onError:e=>{console.error("Failed to load PDF thumbnail from updatePost"),e.currentTarget.style.display="none"}}):(0,a.jsx)(s.default,{className:"w-full h-full object-cover",src:y?.posts?.[t]?.thumbnail?.url,alt:y?.posts?.[t]?.fileName,width:220,height:140,unoptimized:!0}):y?.posts?.[t]?.thumbnailS3Id?(0,a.jsx)(s.default,{className:"w-full h-full object-cover",src:`${o.mn}${y?.posts?.[t]?.thumbnailS3Id}`,alt:y?.posts?.[t]?.fileName,width:220,height:140}):(0,a.jsx)(c.A,{className:"w-12 h-12 text-dark-5 dark:text-light-5"})}):(0,a.jsx)(s.default,{className:k?"w-full h-80 xl:h-110 object-contain bg-light-2 dark:bg-dark-3":"w-full h-33.5 object-cover",src:N?y?.posts?.[t]?.newPost?y?.posts?.[t]?.thumbnail?.url:`${o.mn}${y?.posts?.[t]?.thumbnailS3Id}`:e?.url,alt:N?y?.posts?.[t]?.fileName:`Uploaded image ${t}`,width:k?880:220,height:k?560:140,unoptimized:!0}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 p-2 justify-between border-t border-light-3 dark:border-dark-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1 text-base text-dark-3 dark:text-light-1",children:["sheet"===r?(0,a.jsx)(p.GE,{className:"w-5 h-5 dark:text-light-0"}):"doc"===r?(0,a.jsx)(c.A,{className:"w-5 h-5 dark:text-light-0"}):"show"===r?(0,a.jsx)(x.Uyc,{className:"w-5 h-5 dark:text-light-0"}):"pdf"===r?(0,a.jsx)(p.sT,{className:"w-5 h-5 dark:text-light-0"}):"cad"===r?(0,a.jsx)(p.tx,{className:"w-5 h-5 dark:text-light-0"}):(0,a.jsx)(u.A,{className:"w-5 h-5 dark:text-light-0"}),(0,a.jsx)("span",{className:"truncate font-bold text-sm",children:l})]}),"sheet"!==r&&"doc"!==r&&"show"!==r&&(0,a.jsx)("textarea",{onChange:e=>{g(e,{category:f,index:t})},placeholder:"Description (optional)",className:m.vr,rows:2,value:N?y?.posts?.[t]?.fileDescription:b?.posts?.[t]?.fileDescription})]})]},t)});return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{...A(),className:`flex flex-col justify-between border ${v?"h-full":"xl:w-160.25  lg:h-135.5 w-full h-75 "}  border-light-3  rounded-xl border-2 border-dashed dark:border-dark-5 relative `,children:C()?.length>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"flex-1 overflow-auto p-2.5 ",children:(0,a.jsxs)("div",{className:v||k?"flex justify-center py-4":" flex flex-row gap-4 scrollbar-none overflow-x-auto pb-0.5 md:pb-0 md:grid md:justify-between md:overflow-x-visible lg:grid-cols-[1fr_1fr_1fr]",children:[C()?.length<6&&!v&&!k&&(0,a.jsxs)("div",{className:"xl:w-47.75 xl:h-62.5 lg:w-42.5 w-42.5 h-66.25 md:flex hidden flex-col items-center justify-center shrink-0",children:[(0,a.jsx)("input",{...I()}),(0,a.jsx)("div",{className:"w-full h-full flex flex-col items-center justify-center border-2 border-dashed border-light-3 dark:border-dark-5 rounded-lg cursor-pointer p-2",children:(0,a.jsx)(n.A,{acceptAttribute:t,dragDropCardInputChange:e=>{l(e,{category:f})},cardLength:C()?.length,multiple:!v,hiddenText:!0})})]}),C()]})}),C()?.length>=6&&!v&&!k&&(0,a.jsxs)("div",{className:"border-t border-light-3 hidden md:flex items-center justify-center p-4",children:[(0,a.jsx)("input",{...I()}),(0,a.jsx)(n.A,{acceptAttribute:t,dragDropCardInputChange:e=>{l(e,{category:f})},multiple:!v,hiddenText:!0})]}),C()?.length>0&&!v&&!k&&(0,a.jsxs)("div",{className:"border-t border-light-3 flex md:hidden items-center justify-center p-4",children:[(0,a.jsx)("input",{...I()}),(0,a.jsx)(n.A,{acceptAttribute:t,dragDropCardInputChange:e=>{l(e,{category:f})},multiple:!v,hiddenText:!0})]})]}):(0,a.jsxs)("div",{className:"flex flex-1 items-center justify-center p-4 ",children:[(0,a.jsx)("input",{...I()}),(0,a.jsx)(n.A,{acceptAttribute:t,dragDropCardInputChange:e=>{l(e,{category:f})},multiple:!v,hiddenText:!0})]})})})}},43656:(e,t,l)=>{"use strict";l.d(t,{Ay:()=>s,sT:()=>r});let a=(0,l(26286).Z0)({name:"postNew",initialState:{decisionCount:null},reducers:{setDecisionCount:(e,t)=>
4{e.decisionCount=t.payload}}}),{setDecisionCount:r}=a.actions,s=a.reducer},45193:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>c});var a=l(95155),r=l(43569),s=l(2371),i=l(1213),n=l(12115),o=l(48242),d=l(24420);let c=()=>{let e=(0,i.wA)(),{postViewModal:t}=(0,i.d4)(e=>e.contextMenu);return((0,n.useEffect)(()=>{let l=t=>{"Escape"===t.key&&e((0,o.J)({isOpen:!1,postId:null}))};return t?.isOpen&&t?.postId&&(document.addEventListener("keydown",l),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",l),document.body.style.overflow="unset"}},[t?.isOpen,t?.postId,e]),t?.isOpen&&t?.postId)?(0,a.jsx)("div",{className:"fixed inset-0 z-9999 flex justify-center items-center backdrop-blur-sm bg-dark-2/50",onClick:t=>{t.target===t.currentTarget&&e((0,o.J)({isOpen:!1,postId:null}))},children:(0,a.jsxs)("div",{className:"relative bg-light-0 dark:bg-dark-2 w-full lg:w-3/4 2xl:w-1/2 lg:h-[90vh] h-full md:rounded-lg md:shadow-lg flex flex-col",children:[(0,a.jsxs)("div",{className:"flex items-center justify-end h-12 px-6 border-b border-light-3 dark:border-dark-4 bg-light-0 dark:bg-dark-3 md:rounded-t-lg",children:[(0,a.jsx)("p",{className:"absolute left-6 font-semibold text-2xl text-dark-2 dark:text-light-0",children:"Post"}),(0,a.jsx)(s.Ay,{variant:"nav",onClick:()=>e((0,o.J)({isOpen:!1,postId:null})),icon:(0,a.jsx)(r.A,{className:"w-5 h-5"}),"aria-label":"Close"})]}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto bg-light-1 dark:bg-dark-5 flex justify-center items-start py-2 rounded-b-lg",children:(0,a.jsx)("div",{className:"w-full h-full px-4",children:(0,a.jsx)(d.A,{className:"dark:bg-dark-2",postId:t.postId,singlePostView:!0})})})]})}):null}},48878:(e,t,l)=>{"use strict";l.d(t,{A:()=>r});var a=l(1213);let r=()=>{let{contextMenuData:e,openCreationList:t,uploadModalCard:l,uploadModalType:r,isEditPost:s,isAddEditModalOpen:i,selectedFileOrFolder:n}=(0,a.d4)(e=>e.contextMenu);return{contextMenu:e,openCreation:t,uploadModal:l,uploadType:r,isEditPost:s,isAddEditModalOpen:i,selectedFileOrFolder:n}}},51884:(e,t,l)=>{"use strict";l.d(t,{u:()=>x});var a=l(7496),r=l.n(a);function s(e){return e.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'")}function i(e,t,l){let a=t.split(" "),r=[],s="";for(let t=0;t<a.length;t++){let i=s?`${s} ${a[t]}`:a[t];e.measureText(i).width>l&&s?(r.push(s),s=a[t]):s=i}return s&&r.push(s),r}async function n(e){let t=["docProps/thumbnail.jpeg","docProps/thumbnail.jpg","docProps/thumbnail.png"];for(let l=0;l<t.length;l++){let a=e.file(t[l]);if(a){let e=await a.async("blob");return URL.createObjectURL(e)}}return null}async function o(e){try{let t,l=e.file("ppt/slides/slide1.xml");if(!l)return null;let a=960,r=540,n=e.file("ppt/presentation.xml");if(n){let e=(await n.async("string")).match(/p:sldSz[^>]+cx="(\d+)"[^>]+cy="(\d+)"/);e&&(a=Math.round(parseInt(e[1])/9144),r=Math.round(parseInt(e[2])/9144))}let o=800/a,d=Math.round(r*o),c=document.createElement("canvas");c.width=800,c.height=d;let m=c.getContext("2d");if(!m)return null;m.fillStyle="#ffffff",m.fillRect(0,0,800,d);let u=await l.async("string"),p=u.match(/<p:bg>[\s\S]*?<a:srgbClr val="([0-9A-Fa-f]{6})"/);p&&(m.fillStyle=`#${p[1]}`,m.fillRect(0,0,800,d));let h=/<p:sp>([\s\S]*?)<\/p:sp>/g;for(;null!==(t=h.exec(u));){let e,l=t[1],a=l.match(/<a:off x="(\d+)" y="(\d+)"/),r=l.match(/<a:ext cx="(\d+)" cy="(\d+)"/);if(!a||!r)continue;let n=Math.round(parseInt(a[1])/9144*o),c=Math.round(parseInt(a[2])/9144*o),u=Math.round(parseInt(r[1])/9144*o),p=/<p:ph(?:\s[^>]*)?\s+type="(?:title|ctrTitle)"/.test(l),h=/<a:p>([\s\S]*?)<\/a:p>/g,x=c+Math.round((p?28:18)*o);for(;null!==(e=h.exec(l));){let t=e[1],l=t.match(/<a:sz val="(\d+)"/),a=l?parseInt(l[1])/100:p?28:16,r=Math.max(10,Math.round(a*o*1.33)),c=t.match(/<a:srgbClr val="([0-9A-Fa-f]{6})"/);m.fillStyle=c?`#${c[1]}`:p?"#1a1a1a":"#0f172a";let h=/<a:b\/>/.test(t)||/<a:b w:val="true"/.test(t)||p;m.font=`${h?"bold ":""}${r}px Arial, sans-serif`;let f=Array.from(t.matchAll(/<a:t[^>]*>([\s\S]*?)<\/a:t>/g)).map(function(e){return s(e[1])}).join("").trim();if(!f){x+=Math.round(.5*r);continue}let g=i(m,f,u);for(let e=0;e<g.length&&!(x>d-10);e++)m.fillText(g[e],n,x,u),x+=Math.round(1.4*r)}}return c.toDataURL("image/jpeg",.88)}catch{return null}}async function d(e){try{let t,l=e.file("word/document.xml");
4if(!l)return null;let a=await l.async("string"),r=[],n=/<w:p[ >]([\s\S]*?)<\/w:p>/g;for(;null!==(t=n.exec(a))&&r.length<40;){let e=t[1],l=Array.from(e.matchAll(/<w:t[^>]*>([\s\S]*?)<\/w:t>/g)).map(function(e){return s(e[1])}).join("").trim();if(!l)continue;let a=e.match(/<w:pStyle w:val="([^"]+)"/),i=(a?a[1]:"").toLowerCase(),n=i.startsWith("heading")||i.startsWith("title")||"h1"===i||"h2"===i,o=n||/<w:b\/>/.test(e)||/<w:b w:val="1"/.test(e);r.push({text:l,isHeading:n,isBold:o})}if(0===r.length)return null;let o=document.createElement("canvas");o.width=794,o.height=600;let d=o.getContext("2d");if(!d)return null;d.fillStyle="#f0f0f0",d.fillRect(0,0,794,600),d.fillStyle="#ffffff",d.fillRect(30,20,734,560);let c=70,m=!1;for(let e=0;e<r.length&&c<570;e++){let{text:t,isHeading:l,isBold:a}=r[e],s=0===e,n=l?20:s?18:13,o=Math.round(1.55*n);d.font=`${a||s?"bold ":""}${n}px Georgia, serif`,d.fillStyle=l||s?"#111111":"#444444";let u=i(d,t,634);for(let e=0;e<u.length&&!(c>570);e++)d.fillText(u[e],80,c),c+=o,m=!0;c+=l||s?10:3}if(!m)return null;return o.toDataURL("image/jpeg",.88)}catch{return null}}async function c(e){try{let t=e.file("xl/worksheets/sheet1.xml")||e.file("xl/worksheets/Sheet1.xml")||Object.values(e.files).find(function(e){return/xl\/worksheets\/.*\.xml$/.test(e.name)&&!e.dir})||null;if(!t)return null;let l=[],a=e.file("xl/sharedStrings.xml");
4if(a){let e=await a.async("string"),t=Array.from(e.matchAll(/<si>([\s\S]*?)<\/si>/g));for(let e=0;e<t.length;e++){let a=Array.from(t[e][1].matchAll(/<t[^>]*>([\s\S]*?)<\/t>/g));l.push(a.map(function(e){return s(e[1])}).join(""))}}let r=await t.async("string"),i=[],n=0,o=Array.from(r.matchAll(/<row\b[^>]*>([\s\S]*?)<\/row>/g));for(let e=0;e<o.length&&i.length<20;e++){let t=o[e][1],a=[],r=Array.from(t.matchAll(/<c\b[^>]*r="([A-Z]+\d+)"[^>]*>([\s\S]*?)<\/c>/g));for(let e=0;e<r.length;e++){let i=r[e][1],o=r[e][2],d=t.match(RegExp('<c\\b[^>]*r="'+i+'"[^>]*>')),c=d?d[0].match(/\bt="([^"]*)"/):null,m=c?c[1]:"",u=o.match(/<v>([\s\S]*?)<\/v>/),p=o.match(/<is>[\s\S]*?<t[^>]*>([\s\S]*?)<\/t>/);if(!u&&!p)continue;let h="";if(p?h=s(p[1]):u&&(h=u[1],"s"===m?h=l[parseInt(h)]||h:("str"===m||"inlineStr"===m)&&(h=s(h))),!h.trim())continue;let x=function(e){let t=e.replace(/[0-9]/g,""),l=0;for(let e=0;e<t.length;e++)l=26*l+(t.charCodeAt(e)-64);return l-1}(i);x>n&&(n=x),a.push({col:x,value:h.substring(0,22)})}a.length>0&&i.push(a)}if(0===i.length)return null;let d=document.createElement("canvas");d.width=800,d.height=560;let c=d.getContext("2d");if(!c)return null;let m=Math.min(n+1,10),u=Math.floor(760/m);c.fillStyle="#f5f5f5",c.fillRect(0,0,800,560);for(let e=0;e<i.length;e++){let t=20+26*e;if(t+26>540)break;c.fillStyle=0===e?"#1a73e8":e%2==0?"#ffffff":"#f8f9fa",c.fillRect(20,t,760,26),c.strokeStyle="#d0d0d0",c.lineWidth=.5;for(let e=0;e<m;e++)c.strokeRect(20+e*u,t,u,26);c.font=0===e?"bold 12px Arial":"12px Arial",c.fillStyle=0===e?"#ffffff":"#202124";let l={};for(let t=0;t<i[e].length;t++)l[i[e][t].col]=i[e][t].value;for(let e=0;e<m;e++){let a=l[e]||"";a&&c.fillText(a,20+e*u+6,t+17,u-10)}}return d.toDataURL("image/jpeg",.88)}catch{return null}}let m={doc:{bg:"#2b579a",label:"DOC"},docx:{bg:"#2b579a",label:"DOCX"},xls:{bg:"#217346",label:"XLS"},xlsx:{bg:"#217346",label:"XLSX"},ppt:{bg:"#d24726",label:"PPT"},pptx:{bg:"#d24726",label:"PPTX"}};async function u(e){let t=(e.name.split(".").pop()||"").toLowerCase();if(-1===["ppt","pptx","doc","docx","xls","xlsx"].indexOf(t))return{url:"",blob:null};let l=null;try{l=await r().loadAsync(e)}catch{}if(l){let e=await n(l);if(e){let t=await fetch(e).then(function(e){return e.blob()});return{url:e,blob:t}}}let a=null;return(l&&("pptx"===t?a=await o(l):"docx"===t?a=await d(l):"xlsx"===t&&(a=await c(l))),a||(a=function(e){let t=m[e];if(!t)return null;let l=document.createElement("canvas");l.width=800,l.height=600;let a=l.getContext("2d");return a?(a.fillStyle="#f0f0f0",a.fillRect(0,0,800,600),a.fillStyle="#ffffff",a.fillRect(30,20,740,560),a.fillStyle=t.bg,a.beginPath(),a.moveTo(286,225),a.arcTo(530,225,530,375,16),a.arcTo(530,375,270,375,16),a.arcTo(270,375,270,225,16),a.arcTo(270,225,530,225,16),a.closePath(),a.fill(),a.fillStyle="#ffffff",a.font="bold 44px Arial, sans-serif",a.textAlign="center",a.textBaseline="middle",a.fillText(t.label,400,300),a.textAlign="start",a.textBaseline="alphabetic",l.toDataURL("image/jpeg",.88)):null}(t)),a)?{url:a,blob:function(e){let t=e.split(","),l=t[0].match(/:(.*?);/),a=l?l[1]:"image/jpeg",r=atob(t[1]),s=new Uint8Array(r.length);for(let e=0;e<r.length;e++)s[e]=r.charCodeAt(e);return new Blob([s],{type:a})}(a)}:{url:"",blob:null}}let p=null;p=l(2762);let h=async e=>{if("pdf"===e.name.split(".").pop()?.toLowerCase())try{p&&!p.GlobalWorkerOptions.workerSrc&&(p.GlobalWorkerOptions.workerSrc="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.worker.min.js");let t=new FileReader;return new Promise((l,a)=>{t.onload=async e=>{try{let t=e.target?.result,r=await p.getDocument({data:t}).promise,s=await r.getPage(1),i=s.getViewport({scale:1.2}),n=document.createElement("canvas"),o=n.getContext("2d",{alpha:!1});o?(n.height=i.height,n.width=i.width,o.fillStyle="#ffffff",o.fillRect(0,0,n.width,n.height),await s.render({canvasContext:o,viewport:i}).promise,n.toBlob(e=>{if(e){let t=new FileReader;t.onload=t=>{let a=t.target?.result;l({url:a,blob:e})},t.readAsDataURL(e)}else l({url:"",blob:null})},"image/jpeg",.85)):a(Error("Failed to get canvas context"))}catch(e){a(e)}},t.onerror=()=>a(Error("Error reading file")),t.readAsArrayBuffer(e)})}catch(e){return console.error("Error generating PDF thumbnail:",e),{url:"",blob:null}}},x=async(e,t)=>{let l=e.name.split(".").pop()?.toLowerCase();if("pdf"===l)return await h(e);if("doc"===l||"docx"===l||"xls"===l||"xlsx"===l||"ppt"===l||"pptx"===l)try{let t=await u(e);if(t.url)return console.log(`✓ ${e.name} thumbnail generated in browser`),t}catch(t){console.warn(`Browser thumbnail generation failed for ${e.name}:`,t)}return{url:"",blob:null}}},53351:(e,t,l)=>{"use strict";l.d(t,{RG:()=>c,d_:()=>n});var a=l(21980),r=l(61321),s=l(36317),i=l(14012);let n=(0,r.xP)({reducerPath:"postApi",baseQuery:(0,s.cw)({baseUrl:`${a.Mw}/posts`,prepareHeaders:i.GO}),endpoints:e=>
4({updateFeedFlag:e.mutation({query:e=>({url:"/feed-flag",method:"PUT",body:e})}),getBlockerCount:e.query({query:e=>{let{projectId:t}=e;return{url:"/blocker-count",method:"GET",params:{projectId:t}}}})})}),{useUpdateFeedFlagMutation:o,useGetBlockerCountQuery:d,useLazyGetBlockerCountQuery:c}=n},56645:(e,t,l)=>{"use strict";l.d(t,{A:()=>S});var a=l(95155),r=l(12115),s=l(77540),i=l(8768),n=l(12356),o=l(26487),d=l(60615);function c(e){return null==e||""===String(e).trim()}function m(e,t){return 0===t?0:Math.round(e/t*100)}function u(e,t,l){let a=(0,d.iA)(e.choices),r=new Map,s=new Map,i=[],n=[],u=0,p=!1,h=(e,t)=>{if(c(e))return;let l=String(e);if(l===o.LK&&(p=!0),l===o.LK||a.some(e=>e.value===l)||i.includes(l)||i.push(l),r.set(l,(r.get(l)||0)+1),t.userName||t.userAvatar){let e=s.get(l)||[];e.push({name:t.userName,avatar:t.userAvatar}),s.set(l,e)}};for(let a of t){let t=a.data[e.name];if(l){if(!Array.isArray(t)||0===t.length)continue;u++,t.forEach(e=>h(e,a))}else{if(c(t)||"object"==typeof t)continue;u++,h(t,a)}let r=a.data[(0,o.Td)(e.name)];c(r)||n.push({text:String(r),author:a.userName,avatar:a.userAvatar})}let x=(e,t,l)=>({value:e,text:t,count:r.get(e)||0,percent:m(r.get(e)||0,u),voters:s.get(e)||[],...l?{imageLink:l}:{}}),f=a.map(e=>x(e.value,e.text,e.imageLink));for(let t of((e.showOtherItem||p)&&f.push(x(o.LK,(0,d.WY)(e.otherText,"Other"))),i))f.push(x(t,t));return{kind:"choice",question:e,multi:l,answered:u,counts:f,otherTexts:n}}var p=l(21980);let h={sm:"h-5 w-5 text-[9px]",xs:"h-4 w-4 text-[8px]"},x=e=>{let{name:t,avatar:l,size:r="sm",className:s}=e,i=l?String(l).startsWith("http")?l:`${p.mn}${l}`:"";return i?(0,a.jsx)("img",{src:i,alt:t||"Respondent",title:t,referrerPolicy:"no-referrer",className:`${h[r]} shrink-0 rounded-full object-cover ${s??""}`}):(0,a.jsx)("span",{title:t,className:`${h[r]} flex shrink-0 items-center justify-center rounded-full bg-purple/15 font-bold text-purple ${s??""}`,children:(e=>{let t=(e||"").trim().split(/\s+/).filter(Boolean);if(0===t.length)return"?";let l=t[0][0]||"",a=t.length>1&&t[t.length-1][0]||"";return`${l}${a}`.toUpperCase()})(t)})},f=e=>{let{voters:t,max:l=5,size:r="sm",className:s}=e;if(!t||0===t.length)return null;let i=t.length-l;return(0,a.jsxs)("span",{className:`flex shrink-0 items-center -space-x-1.5 ${s??""}`,children:[t.slice(0,l).map((e,t)=>(0,a.jsx)(x,{name:e.name,avatar:e.avatar,size:r,className:"ring-2 ring-light-0 dark:ring-dark-3"},t)),i>0&&(0,a.jsxs)("span",{className:`flex items-center justify-center rounded-full bg-light-2 dark:bg-dark-4 font-bold text-dark-4 dark:text-light-4 ring-2 ring-light-0 dark:ring-dark-3 ${"xs"===r?"h-4 w-4 text-[8px]":"h-5 w-5 text-[9px]"}`,children:["+",i]})]})},g=["var(--color-purple)","var(--color-yellow)","var(--color-green-1)","var(--color-red-1)","var(--color-dark-5)","var(--color-light-4)"],b=e=>g[e%g.length],j=e=>{let{result:t,showAuthors:l}=e,{counts:r,multi:s,answered:i}=t,n=r.reduce((e,t)=>e+t.count,0),o=Math.max(0,...r.map(e=>e.count)),d=0,c=r.filter(e=>e.count>0).map(e=>{let t=r.indexOf(e),l=d/n*100,a=(d+=e.count)/n*100;return`${b(t)} ${l}% ${a}%`});return(0,a.jsxs)("div",{className:"flex flex-col gap-6 sm:flex-row sm:items-start",children:[!s&&n>0&&(0,a.jsxs)("div",{className:"relative mx-auto h-32 w-32 shrink-0 sm:mx-0",children:[(0,a.jsx)("div",{className:"h-full w-full rounded-full",style:{background:`conic-gradient(${c.join(", ")})`},role:"img","aria-label":"Answer share"}),(0,a.jsxs)("div",{className:"absolute inset-4 flex flex-col items-center justify-center rounded-full bg-light-0 dark:bg-dark-3",children:[(0,a.jsx)("span",{className:"text-xl font-bold text-dark-1 dark:text-light-0",children:i}),(0,a.jsx)("span",{className:"text-[10px] text-dark-4 dark:text-light-4",children:"answered"})]})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-3",children:[r.map((e,t)=>{let r=e.count>0&&e.count===o;return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 text-sm",children:[(0,a.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,a.jsx)("span",{className:"h-2.5 w-2.5 shrink-0 rounded-full",style:{backgroundColor:b(t)}}
4),e.imageLink&&(0,a.jsx)("img",{src:e.imageLink,alt:e.text,className:"h-8 w-11 shrink-0 rounded-md border border-light-3 dark:border-dark-4 object-cover"}),(0,a.jsx)("span",{className:`truncate ${r?"font-semibold text-dark-1 dark:text-light-0":"text-dark-2 dark:text-light-1"}`,children:e.text}),l&&(0,a.jsx)(f,{voters:e.voters,max:5})]}),(0,a.jsxs)("span",{className:`shrink-0 ${r?"font-bold text-dark-1 dark:text-light-0":"font-medium text-dark-3 dark:text-light-3"}`,children:[e.percent,"%"," ",(0,a.jsxs)("span",{className:"text-xs font-normal text-dark-4 dark:text-light-4",children:["(",e.count," ",1===e.count?"vote":"votes",")"]})]})]}),(0,a.jsx)("div",{className:"mt-1.5 h-2 w-full rounded-full bg-light-2 dark:bg-dark-4",children:(0,a.jsx)("div",{className:"h-2 rounded-full transition-[width]",style:{width:`${e.percent}%`,backgroundColor:b(t)}})})]},e.value)}),t.otherTexts.length>0&&(0,a.jsxs)("details",{className:"mt-1",children:[(0,a.jsxs)("summary",{className:"cursor-pointer select-none text-sm font-medium text-purple dark:text-yellow",children:["Other answers (",t.otherTexts.length,")"]}),(0,a.jsx)("div",{className:"mt-2 flex max-h-40 flex-col gap-1.5 overflow-y-auto pr-1",children:t.otherTexts.map((e,t)=>(0,a.jsxs)("div",{className:"rounded-lg bg-light-1 dark:bg-dark-2 px-3 py-2",children:[l&&(e.author||e.avatar)&&(0,a.jsxs)("div",{className:"mb-1 flex items-center gap-1.5",children:[(0,a.jsx)(x,{name:e.author,avatar:e.avatar}),e.author&&(0,a.jsx)("p",{className:"text-xs font-medium text-purple dark:text-yellow",children:e.author})]}),(0,a.jsx)("p",{className:"text-sm text-dark-2 dark:text-light-1 wrap-break-word",children:e.text})]},t))})]})]})]})};var w=l(76414),y=l(54289);let v=e=>{let{result:t,showAuthors:l}=e,{average:r,answered:s,distribution:i}=t,n=i.length>0?i[i.length-1].rate:5,o=Math.round(r);return(0,a.jsxs)("div",{className:"flex flex-col gap-5 sm:flex-row sm:items-center",children:[(0,a.jsxs)("div",{className:"flex shrink-0 flex-col items-center gap-1 rounded-2xl bg-light-1 dark:bg-dark-2 px-6 py-4 sm:w-44",children:[(0,a.jsx)("p",{className:"text-5xl font-bold text-dark-1 dark:text-light-0",children:0===s?"0":r}),(0,a.jsx)("div",{className:"flex items-center gap-0.5",children:i.map(e=>{let t=e.rate<=o&&s>0?y.A:w.A;return(0,a.jsx)(t,{className:`h-5 w-5 ${e.rate<=o&&s>0?"text-yellow":"text-light-4 dark:text-dark-5"}`},e.rate)})}),(0,a.jsxs)("p",{className:"text-xs text-dark-4 dark:text-light-4",children:[s," ",1===s?"rating":"ratings"]})]}),(0,a.jsx)("div",{className:"flex flex-1 flex-col gap-1.5",children:[...i].reverse().map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("span",{className:"w-8 shrink-0 text-right text-xs font-medium text-dark-4 dark:text-light-4",children:[e.rate,"/",n]}),(0,a.jsx)("div",{className:"h-2 flex-1 rounded-full bg-light-2 dark:bg-dark-4",children:(0,a.jsx)("div",{className:"h-2 rounded-full bg-yellow",style:{width:`${e.percent}%`}})}),(0,a.jsx)("span",{className:"w-6 shrink-0 text-xs text-dark-4 dark:text-light-4",children:e.count}),l&&(0,a.jsx)(f,{voters:e.voters,max:3,size:"xs"})]},e.rate))})]})},k=e=>{let{result:t,showAuthors:l}=e,{rows:r,columns:s,cells:i,cellVoters:n}=t;return(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full min-w-max border-separate border-spacing-1",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"p-1"}),s.map(e=>(0,a.jsx)("th",{className:"px-3 pb-1 text-center text-xs font-medium text-dark-4 dark:text-light-4",children:e.text},e.value))]})}),(0,a.jsx)("tbody",{children:r.map(e=>{let t=i[e.value]||{},r=Math.max(0,...s.map(e=>t[e.value]||0));return(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"whitespace-nowrap py-1 pr-3 text-sm text-dark-2 dark:text-light-1",children:e.text}),s.map(s=>{let i=t[s.value]||0,o=i>0&&i===r,d=n?.[e.value]?.[s.value]||[];return(0,a.jsx)("td",{className:"p-0.5",children:(0,a.jsxs)("div",{className:"relative flex h-9 min-w-20 items-center justify-center gap-1.5 overflow-hidden rounded-lg border border-light-2 dark:border-dark-4 px-1.5",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-purple",style:{opacity:0===r||0===i?0:.14+i/r*.5}}),(0,a.jsx)("span",{className:`relative text-sm ${o?"font-bold text-dark-1 dar
4k:text-light-0":i>0?"text-dark-2 dark:text-light-2":"text-dark-5 dark:text-light-5"}`,children:i}),l&&d.length>0&&(0,a.jsx)(f,{voters:d,max:2,size:"xs",className:"relative"})]})},s.value)})]},e.value)})})]})})},N=e=>{let{answers:t,showAuthors:l}=e;return 0===t.length?(0,a.jsx)("p",{className:"text-sm text-dark-4 dark:text-light-4",children:"No answers yet."}):(0,a.jsx)("div",{className:"flex max-h-64 flex-col gap-1.5 overflow-y-auto pr-1",children:t.map((e,t)=>(0,a.jsxs)("div",{className:"rounded-lg bg-light-1 dark:bg-dark-2 px-3 py-2",children:[l&&(e.author||e.avatar)&&(0,a.jsxs)("div",{className:"mb-1 flex items-center gap-1.5",children:[(0,a.jsx)(x,{name:e.author,avatar:e.avatar}),e.author&&(0,a.jsx)("p",{className:"text-xs font-medium text-purple dark:text-yellow",children:e.author})]}),(0,a.jsx)("p",{className:"text-sm text-dark-2 dark:text-light-1 wrap-break-word",children:e.text})]},t))})},A=e=>{let{result:t,showAuthors:l}=e;return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[t.items.map(e=>(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"mb-1.5 text-sm font-medium text-dark-4 dark:text-light-4",children:e.title}),(0,a.jsx)(N,{answers:e.answers,showAuthors:l})]},e.name)),0===t.items.length&&(0,a.jsx)("p",{className:"text-sm text-dark-4 dark:text-light-4",children:"No answers yet."})]})},I={text:"Short answer",comment:"Paragraph",radiogroup:"Multiple choice",checkbox:"Checkboxes",dropdown:"Dropdown",imagepicker:"Image choice",rating:"Star rating",matrix:"Grid",multipletext:"Multiple short answers"},S=e=>{let{definition:t,entries:l,responses:o,compact:p=!1,hideHeader:h=!1,className:x}=e,f=t?.anonymousResponses===!0,g=(0,r.useMemo)(()=>(function(e,t){let l=(t||[]).filter(e=>!!e&&!!e.data&&"object"==typeof e.data&&!Array.isArray(e.data)),a=(0,d.yS)(e).map(e=>{if(!(0,d.$n)(e.type))return{kind:"unsupported",question:e};switch(e.type){case"radiogroup":case"dropdown":return u(e,l,!1);case"checkbox":return u(e,l,!0);case"imagepicker":return u(e,l,!0===e.multiSelect);case"rating":return function(e,t){let l=[],a=new Map;for(let r of t){let t=r.data[e.name];if(c(t))continue;let s=Number(t);if(Number.isFinite(s)&&(l.push(s),r.userName||r.userAvatar)){let e=a.get(s)||[];e.push({name:r.userName,avatar:r.userAvatar}),a.set(s,e)}}let r=l.length,s=0===r?0:Math.round(l.reduce((e,t)=>e+t,0)/r*10)/10,i=new Set((0,d.CF)(e));l.forEach(e=>i.add(e));let n=[...i].sort((e,t)=>e-t).map(e=>{let t=l.filter(t=>t===e).length;return{rate:e,count:t,percent:m(t,r),voters:a.get(e)||[]}});return{kind:"rating",question:e,answered:r,average:s,distribution:n}}(e,l);case"matrix":return function(e,t){let l=(0,d.iA)(e.rows),a=(0,d.iA)(e.columns),r={},s={},i=0,n=e=>{l.some(t=>t.value===e)||l.push({value:e,text:e,raw:e})},o=e=>{a.some(t=>t.value===e)||a.push({value:e,text:e,raw:e})};for(let l of t){let t=l.data[e.name];if(!t||"object"!=typeof t||Array.isArray(t))continue;let a=Object.entries(t).filter(e=>{let[,t]=e;return!c(t)});if(0!==a.length)for(let[e,t]of(i++,a)){let a=String(t);n(e),o(a),r[e]||(r[e]={}),r[e][a]=(r[e][a]||0)+1,(l.userName||l.userAvatar)&&(s[e]||(s[e]={}),s[e][a]||(s[e][a]=[]),s[e][a].push({name:l.userName,avatar:l.userAvatar}))}}return{kind:"matrix",question:e,answered:i,rows:l,columns:a,cells:r,cellVoters:s}}(e,l);case"multipletext":return function(e,t){let l=(e.items||[]).filter(e=>e&&"string"==typeof e.name).map(e=>({name:e.name,title:(0,d.WY)(e.title,e.name),answers:[]})),a=0;for(let r of t){let t=r.data[e.name];if(!t||"object"!=typeof t||Array.isArray(t))continue;let s=!1;for(let[e,a]of Object.entries(t)){if(c(a))continue;s=!0;let t=l.find(t=>t.name===e);t||(t={name:e,title:e,answers:[]},l.push(t)),t.answers.push({text:String(a),author:r.userName,avatar:r.userAvatar})}s&&a++}return{kind:"multipletext",question:e,answered:a,items:l}}(e,l);default:var t=e,a=l;let r=[];for(let e of a){let l=e.data[t.name];c(l)||"object"==typeof l||r.push({text:String(l),author:e.userName,avatar:e.userAvatar})}return{kind:"text",question:t,answered:r.length,answers:r}}});return{total:l.length,results:a}})(t,l?(0,n.F5)(l):(o??[]).map(e=>e&&"object"==typeof e&&!Array.isArray(e)?{data:e}
4:null)),[t,l,o]),b=(0,d.hQ)(t),w=(0,d.Re)(t);return(0,a.jsxs)("div",{"data-testid":"survey-results",className:`flex flex-col ${p?"gap-2":"gap-4"} ${x??""}`,children:[!p&&!h&&(0,a.jsxs)("div",{className:"rounded-2xl border border-light-3 dark:border-dark-4 border-t-4 border-t-purple bg-light-0 dark:bg-dark-3 p-5",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[b&&(0,a.jsx)("h2",{className:"text-2xl font-bold text-dark-1 dark:text-light-0",children:b}),w&&(0,a.jsx)("p",{className:"mt-1 text-sm text-dark-4 dark:text-light-4",children:w})]}),f&&(0,a.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5 rounded-full bg-purple/10 px-3 py-1 text-xs font-medium text-purple dark:text-yellow dark:bg-yellow/10",children:[(0,a.jsx)(s.A,{className:"h-3.5 w-3.5"}),"Anonymous"]})]}),(0,a.jsxs)("div",{className:"mt-4 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-purple/10 text-purple",children:(0,a.jsx)(i.A,{className:"h-5 w-5"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{"data-testid":"survey-results-count",className:"text-xl font-bold leading-tight text-dark-1 dark:text-light-0",children:g.total}),(0,a.jsx)("p",{className:"text-xs text-dark-4 dark:text-light-4",children:1===g.total?"response":"responses"})]})]})]}),0===g.total?(0,a.jsx)("div",{className:"rounded-2xl border border-light-3 dark:border-dark-4 bg-light-0 dark:bg-dark-3 px-6 py-12 text-center",children:(0,a.jsx)("p",{className:"text-sm text-dark-4 dark:text-light-4",children:"No responses yet."})}):g.results.map((e,t)=>(0,a.jsxs)("div",{"data-testid":`results-question-${e.question.name}`,className:`rounded-2xl border border-light-3 dark:border-dark-4 bg-light-0 dark:bg-dark-3 ${p?"p-4":"p-5"}`,children:[(0,a.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-baseline gap-2.5",children:[(0,a.jsx)("span",{className:"flex h-6 w-6 shrink-0 translate-y-0.5 items-center justify-center rounded-lg bg-purple/10 text-xs font-bold text-purple",children:t+1}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"font-semibold text-dark-1 dark:text-light-0",children:(0,d.HN)(e.question,t)}),(0,a.jsx)("p",{className:"text-xs text-dark-4 dark:text-light-4",children:I[e.question.type]||e.question.type})]})]}),"answered"in e&&(0,a.jsxs)("span",{className:"shrink-0 rounded-full bg-light-1 dark:bg-dark-2 px-2.5 py-1 text-xs font-medium text-dark-4 dark:text-light-4",children:[e.answered," answered"]})]}),((e,t)=>{switch(e.kind){case"choice":return(0,a.jsx)(j,{result:e,showAuthors:t});case"rating":return(0,a.jsx)(v,{result:e,showAuthors:t});case"matrix":return(0,a.jsx)(k,{result:e,showAuthors:t});case"multipletext":return(0,a.jsx)(A,{result:e,showAuthors:t});case"text":return(0,a.jsx)(N,{answers:e.answers,showAuthors:t});default:return(0,a.jsx)("p",{className:"text-sm text-dark-4 dark:text-light-4",children:"This question type is not shown in results."})}})(e,!f)]},`${e.question.name||"question"}-${t}`))]})}},61330:(e,t,l)=>{"use strict";l.d(t,{G:()=>s,S:()=>i});var a=l(21980);async function r(e){let t={};if(e)return t.Authorization=`Bearer ${e}`,t;try{let{fetchAuthSession:e}=await l.e(64848).then(l.bind(l,64848)),a=await e(),r=a.tokens?.accessToken?.toString(),s=a.tokens?.idToken?.payload?.email;r&&(t.Authorization=`Bearer ${r}`),s&&(t.useremail=String(s))}catch{}return t}async function s(e,t){let l=await r(t),s=await fetch(`${a.mN}/partners/univer/session?fileId=${encodeURIComponent(e)}`,{headers:l});if(!s.ok)throw Error(`Univer session request failed: ${s.status}`);return await s.json()}async function i(e){let t=await fetch(e);if(!t.ok)throw Error(`Snapshot download failed: ${t.status}`);let l=await t.text();return l?JSON.parse(l):null}},65314:(e,t,l)=>{"use strict";l.d(t,{A:()=>er});var a=l(95155),r=l(12115),s=l(51575),i=l(1213),n=l(42302),o=l(48242),d=l(36989),c=l(20063),m=l(66137),u=l(64269),p=l(27185),h=l(97412),x=l(11929),f=l(3914),g=l(43466),b=l(28815),j=l(3804),w=l(66788),y=l(83430),v=l(23207),k=l(2106),N=l(8068);let A=e=>{let{category:t,showUpload:l}=e,r=(0,i.wA)(),{guard:s}=(0,N.A)(),d=(0,c.usePathname)(),u=(0,c.useRouter)(),{navigationPath:p,rootData:x}=(0,i.d4)(e=>e.category),f=e=>{if(r((0,o.qc)([])),"ROOT"===e)(0,m.Dl)(u,d,null),r((0,n.G7)([])),r((0,n.X6)(x)),r((0,w.AA)("ROOT"));else{let t=p.findIndex(t=>t.fileId===e?.fileId);if(-1!==t){let l=p.slice(0,t+1);(0,m.Dl)(u,d,e?.fileId),r((0,n.X6)(e?.children)),r((0,w.AA)(e?.fileId)),r((0,n.G7)(l))}}},g=p?.map(e=>({id:e?.fileId,label:e?.fileName,onClick:()=>f(e)}))??[];return(0,a.jsx)("section",{className:"sm:ml-0 ml-2 w-full sticky z-10",children:(0,a.jsxs)("div",{className:"items-center border-light-3 dark:border-dark-3 flex justify-between px-2",children:[(0,a.jsx)("div",{className:"items-center flex gap-2",children:(0,a.jsx)(k.A,{root:{label:t?y.r[t]:"",onClick:()=>f("ROOT")},items:g,separator:"caret",maxVisible:3,className:"text-base md:text-xl font-semibold"})}),!l&&(0,a.jsx)("button",{type:"button","aria-label":"Upload",onClick:()=>{var e;return e=h.NL.FOLDER,void(!s("upload")&&(r((0,o.lR)()),r((0,o.ll)(e)),r((0,o.ob)(!0))))},className:"p-2 rounded-lg hover:bg-light-2 dark:hover:bg-dark-4 transition-colors",children:(0,a.jsx)(v.A,{className:"md:w-6 md:h-6 w-4 h-4 text-dark-2 dark:text-light-0"})})]})})};var I=l(43569),S=l(29632);let C=e=>(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"12",fill:"none",viewBox:"0 0 16 12",...e,children:(0,a.jsx)("path",{fill:"#909090",fillRule:"evenodd",d:"M9.225.558a.625.625 0 0 1 .883 0l5 5a.625.625 0 0 1 0 .884l-5 5a.624.624 0 1 1-.883-.884l3.934-3.933H1.334a.625.625 0 1 1 0-1.25h11.824L9.226 1.442a.625.625 0 0 1 0-.884",clipRule:"evenodd"})});var E=l(32605),D=l(48878),P=l(9084),T=l(28079),$=l(17815),F=l(70631),R=l(69268),L=l(87778),M=l(11636),O=l(56690),U=l(66716),B=l(15239),z=l(5016),q=l(2371),V=l(52106),G=l(95157);let _=(0,l(67909).default)(()=>Promise.all([l.e(61831),l.e(89367),l.e(90315),l.e(19323),l.e(63316),l.e(94431)]).then(l.bind(l,94431)),{loadableGenerated:{webpack:()=>[94431]},ssr:!1}),Q=e=>{let{teamMembers:t,acceptAttribute:l,handleImageUpload:s,uploadData:n,handleTag
4Change:o,handlePostDescriptionChange:d,setUploadData:c,updatePost:m,handleFeedCheckBox:u,handleBlockerCheckBox:p,taggedEmails:x,handleRemovePost:g,navigationPath:b,setShowLocationBrowser:j,attentionError:w}=e,{isEditPost:v}=(0,D.A)(),{activeCategory:k}=(0,i.d4)(e=>e.fileExplorer),N=v?m?.category:k,A=r.useRef(null),S=(0,r.useRef)(null),C=(0,r.useRef)(null),[E,P]=(0,r.useState)(null),[T,$]=(0,r.useState)(!1);(0,r.useEffect)(()=>{P(null),c(e=>({...e,postDescription:"",thumbnail:null,isBlocker:0,isFeed:1,posts:[],taggedUser:[]}))},[]),(0,r.useEffect)(()=>{C.current=n?.thumbnail},[n?.thumbnail]),(0,r.useEffect)(()=>()=>{E&&URL.revokeObjectURL(E)},[E]);let F=(0,r.useCallback)(()=>{let e=S.current;e&&($(!0),(async()=>{try{e.updateComplete&&await e.updateComplete,await new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(()=>e())));let t=null;if("function"==typeof e.toBlob&&(t=await e.toBlob({mimeType:"image/png",idealAspect:!0})),!t){let l=e.toDataURL();if(!l||"data:,"===l)return;let a=l.split(","),r=a[0].match(/:(.*?);/)?.[1]||"image/png",s=atob(a[1]),i=s.length,n=new Uint8Array(i);for(let e=0;e<i;e++)n[e]=s.charCodeAt(e);t=new Blob([n],{type:r})}c(e=>({...e,thumbnail:{file:t,fileName:"model-thumbnail.png",fileType:"image/png"}}))}catch(e){console.error("Failed to capture model thumbnail:",e)}finally{$(!1)}})())},[c]);(0,r.useEffect)(()=>{if(!E)return;let e=S.current;if(!e)return;let t=()=>{C.current||requestAnimationFrame(()=>F())};return e.addEventListener("load",t),()=>e.removeEventListener("load",t)},[E,F]);let R=(0,r.useCallback)(e=>{g(e),P(null)},[g]),{getRootProps:L,getInputProps:Q}=(0,M.VB)({onDrop:e=>{(e=>{if(s(e,{category:N}),e.target.files){let t=Array.from(e.target.files)[0];n.postDescription||c(e=>({...e,postDescription:t?.name?.replace(/\.[^/.]+$/,"")||""})),(e=>{let t=e.split(".").pop()?.toLowerCase();return"glb"===t||"gltf"===t})(t?.name||"")?(E&&URL.revokeObjectURL(E),P(URL.createObjectURL(t))):P(null)}})({target:{files:e}})},multiple:!1,accept:l}),H=v?m:n,W=(0,r.useCallback)(e=>{let t=e.target.files?.[0];t&&c(e=>({...e,thumbnail:{file:t,fileName:t.name,fileType:t.type}}))},[c]),X=(0,r.useMemo)(()=>n?.thumbnail?.file?URL.createObjectURL(n.thumbnail.file):null,[n?.thumbnail?.file]);(0,r.useEffect)(()=>()=>{X&&URL.revokeObjectURL(X)},[X]);let J=(0,r.useCallback)(()=>{c(e=>({...e,thumbnail:null})),A.current&&(A.current.value="")},[c]),Y=N?y.r[N]:"ROOT";return(0,a.jsx)("div",{className:"flex w-full h-full flex-col items-center justify-center",children:(0,a.jsx)("div",{className:"w-full xl:w-270 h-full lg:h-145  lg:w-[95%] justify-items-stretch md:justify-center   flex flex-col  bg-light-0 md:rounded-xl rounded-none  dark:bg-dark-3",children:(0,a.jsx)("div",{className:"w-full  flex flex-col gap-4",children:(0,a.jsxs)("div",{className:"w-full h-full  gap-5   flex md:flex-row flex-col  p-5",children:[(0,a.jsxs)("div",{...N!==h.b7.ThreeDModels||N===h.b7.ThreeDModels&&!E?L():{},className:"flex flex-col xl:w-160.25 max-xl:w-full md:h-135.5 h-46.25 justify-center items-center dark:bg-dark-3 bg-light-0 border-2 border-dashed border-light-3 dark:border-dark-5 rounded-lg overflow-hidden",children:[!(N===h.b7.ThreeDModels&&E)&&(0,a.jsx)("input",{...Q()}),E?(0,a.jsxs)("div",{className:"flex flex-col w-full h-full",children:[(0,a.jsx)(_,{}),(0,a.jsx)("div",{className:"flex-1 relative overflow-hidden min-h-0",children:(0,a.jsx)("model-viewer",{ref:S,src:E,"camera-controls":!0,"camera-orbit":"0deg 75deg auto",bounds:"tight","environment-image":"neutral",exposure:"1","shadow-intensity":"1",style:{width:"100%",height:"100%"}})}),(0,a.jsx)("div",{className:"flex justify-center pb-2 shrink-0",children:(0,a.jsx)(z.Ay,{variant:"yellow",size:"sm",type:"button",title:"Update Thumbnail",onClick:e=>{e.stopPropagation(),F()},className:"h-9"})}),(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 px-3 py-2 text-dark-2 dark:text-light-1 shrink-0",children:[(0,a.jsx)("span",{className:"text-base truncate",children:H.posts[0]?.fileName}),(0,a.jsx)(q.Ay,{"aria-label":"Remove file",onClick:e=>{e.stopPropagation(),R(0)},className:"h-6! w-6! shrink-0",icon:(0,a.jsx)(I.A,{className:"w-4 h-4"})})]})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-3.5 items-center justify-center",children:[(0,a.jsxs)("div",{className:"flex gap-3.5 items-center",children:[(0,a.jsxs)("div",{className:(0,z.V7)("outline","sm","h-9.5 gap-2"),children:[(0,a.jsx)(U.A,{className:"w-4 h-4"}),(0,a.jsx)("span",{children:"Upload File"})]}),(0,a.jsx)("span",{className:"cursor-pointer font-semibold text-dark-2 dark:text-light-0 hidden md:block",children:"Or Drag and Drop here"})]}),H.posts.length>0?H.posts.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 text-dark-2 dark:text-light-1",children:[(0,a.jsx)("span",{className:"text-center flex-1",children:e?.fileName}),(0,a.jsx)(q.Ay,{"aria-label":"Remove file",onClick:e=>{e.stopPropagation(),R(t)},className:"h-6! w-6! shrink-0",icon:(0,a.jsx)(I.A,{className:"w-4 h-4"})})]},t)):(0,a.jsx)("div",{className:"hidden md:flex text-xs content-center text-dark-5 dark:text-light-1 justify-center items-center text-center w-100 lg:w-110.25 max-w-full",children:N===h.b7.ThreeDModels?"Supported: glTf and glb":"Supported: mp4, mkv, webm, flv, vod, avi, mov, wmv, amv, m4p, mpeg, mpg, 4mv, ts, mp3, m4v, ogg, wav"})]})]}),(0,a.jsxs)("div",{className:" xl:w-94.75 xl:h-135.5 flex flex-col justify-start  gap-5 lg:w-[35%] w-full h-full max-h-[60vh] overflow-y-auto scrollbar-none md:max-h-none md:overflow-visible ",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 mb-0",children:[(0,a.jsx)("h3",{className:V.I8,children:"Thumbnail (Optional)"}),(0,a.jsxs)("div",{className:"flex flex-col items-start max-xl:items-center w-full rounded-xl border-2 border-dashed text-sm border-light-3 dark:border-dark-5 dark:bg-dark-3 bg-light-0 relative overflow-hidden",children:[(0,a.jsx)("input",{type:"file",accept:"image/*",id:"thumbnail-upload",className:"hidden",onChange:W,ref:A}),(0,a.jsx)("div",{className:"relative w-full  h-35 flex items-center justify-center overflow-hidden rounded-xl",children:T?(0,a.jsx)("div",{className:"flex items-center justify-center w-full h-full",children:(0,a.jsx)(O.A,{})}):n?.thumbnail&&X?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(B.default,{src:X,fill:!0,unoptimized:!0,sizes:"400px",alt:"Thumbn
4ail Preview",className:"object-contain"}),(0,a.jsx)(q.Ay,{variant:"nav","aria-label":"Remove thumbnail",title:"Remove",onClick:J,className:"absolute bottom-3 right-3 shadow-md text-red-1! dark:text-red-2!",icon:(0,a.jsx)(I.A,{className:"w-4 h-4"})})]}):(0,a.jsx)("label",{htmlFor:"thumbnail-upload",className:"flex flex-col items-center justify-center cursor-pointer gap-2",children:(0,a.jsxs)("div",{className:(0,z.V7)("outline","sm","h-9.5 gap-2"),children:[(0,a.jsx)(U.A,{className:"w-4 h-4"}),(0,a.jsx)("span",{children:"Upload Image"})]})})})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 mb-0",children:[(0,a.jsx)("label",{htmlFor:"postDescription",className:V.I8,children:"Post Description (Optional)"}),(0,a.jsx)("textarea",{id:"postDescription",rows:3,value:H?.postDescription,onChange:d,className:V.vr,placeholder:"Enter description here"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 mb-0",children:[(0,a.jsx)("label",{className:V.I8,children:"Attention (Optional)"}),(0,a.jsx)(f.A,{name:"colors",teamMembers:t,value:x,onChange:o,isClearable:!0,maxMenuHeight:180,placeholder:"Select audience"}),w&&(0,a.jsx)("p",{className:"text-red-2 text-sm font-medium m-0 p-0",children:w})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 mb-0",children:[(0,a.jsx)("label",{className:V.I8,children:"File Location"}),(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsxs)("div",{className:(0,V.jp)("default","md","flex flex-1 justify-between items-center pr-1 min-w-0 truncate"),children:[(0,a.jsx)("span",{children:b&&b.length>0?`${Y} > ${b.map(e=>e.fileName||e.fileId).join(" > ")}`:Y}),(0,a.jsx)(z.Ay,{variant:"outline",size:"sm",onClick:()=>{j(!0)},className:"h-8.5 w-25 shrink-0",children:"Browse"})]})})]}),(0,a.jsx)("div",{className:"border p-3   h-9.5  border-light-2 dark:border-dark-4  flex flex-row items-center gap-4 roun
4ded-xl bg-light-2  dark:bg-dark-2",children:(0,a.jsx)("div",{className:"w-45.25 h-9.5",children:(0,a.jsxs)("label",{className:"h-10 gap-2 flex items-center cursor-pointer select-none text-dark-2 dark:text-light-0",children:[(0,a.jsx)(G.A,{checked:H?.isBlocker===1,onChange:p}),(0,a.jsx)("div",{className:"text-dark-2 text-sm font-semibold dark:text-light-0",children:"Blocker"})]})})})]})]})})})})};var H=l(3750),W=l(29545),X=l(64030),J=l(67528),Y=l(51884),K=l(80675);let Z=(0,r.forwardRef)((e,t)=>{let{uploadType:l,isEditPost:d}=(0,D.A)(),{fetchBlockerCount:v}=(0,J.A)(),{selectedFileOrFolder:k}=(0,i.d4)(e=>e.contextMenu),{selectedProject:N}=(0,i.d4)(e=>e.project),{activeCategory:M}=(0,i.d4)(e=>e.fileExplorer),O=r.useMemo(()=>N?.teamMembers.filter(e=>e?.status!=="inactive"),[N?.teamMembers]),{currentPost:U,navigationPath:B,rootData:_,filters:Z}=(0,i.d4)(e=>e.category),{activeParentFolderId:ee}=(0,E.A)(),[et,el]=(0,r.useState)(d?U?.category:M),[ea,er]=(0,r.useState)("ROOT");(0,r.useEffect)(()=>{el(d?U?.category:M)},[d,U?.category,M]),(0,r.useEffect)(()=>{let t="ROOT";U?.posts?.[0]?.parentFolderId?t=U.posts[0].parentFolderId:k?t=k.fileCategory===h.NL.FOLDER?k.fileId:k.parentFolderId||e?.defaultParentFolderId||"ROOT":ee?t=ee:e?.defaultParentFolderId&&(t=e.defaultParentFolderId),er(t)},[U,k,ee,e?.defaultParentFolderId]);let es={...U,parentFolderId:ea,parentPostId:e?.parentPostId||"",isBlocker:U?.isBlocker??0,isFeed:U?.isFeed??1},[ei,en]=(0,r.useState)(es),[eo,ed]=(0,r.useState)([]),[ec,em]=(0,r.useState)([]),[eu,ep]=(0,r.useState)(!1),{successNotify:eh,errorNotify:ex}=(0,T.A)(),{refetch:ef}=(0,s.A)(M??""),{userDetails:eg}=(0,$.A)(),eb=(0,i.wA)(),ej=String(N?.guid),ew=eg?.id,ey=(e?.defaultTaggedEmails||[]).filter(e=>O?.some(t=>t.emailAddress===e)),ev={userId:ew,projectId:ej,category:et,fileCategory:h.NL.FILES,postId:(0,x.A)(),postDescription:"",isBlocker:0,isFeed:1,posts:[],taggedUser:ey,parentFolderId:ee,parentPostId:e?.parentPostId||""},ek=et==h.b7.ThreeDModels?{"application/gzip":[".gltf",".glb"]}:et==h.b7.Videos?{"video/*":[".mp4",".mpeg",".avi"]}:et==h.b7.DRAWINGS||et===h.b7.SPECIFICATION||et===h.b7.RENDERINGS?{"application/pdf":[".pdf"],"image/*":[]}:et===h.b7.FILES?{"application/pdf":[".pdf"],"image/*":[],"application/msword":[".doc"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/vnd.ms-excel":[".xls"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":[".xlsx"]}:et===h.b7.MOODBOARD?{"application/pdf":[".pdf"],"image/*":[],"application/msword":[".doc"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/vnd.ms-excel":[".xls"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":[".xlsx"],"application/vnd.ms-powerpoint":[".ppt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":[".pptx"]}:{"image/*":[]};et===h.b7.Videos||h.b7.ThreeDModels;let[eN,eA]=(0,r.useState)(ev),[eI,eS]=(0,r.useState)("");(0,F.ik)(U,ei);let eC=d?ei?.taggedEmails||[]:eN?.taggedUser||[],[eE,eD]=(0,r.useState)([]),[eP,eT]=(0,r.useState)(!1),e$=N?.userId===eg?.id,eF=(e,t)=>e$&&(0,F.lR)(eg?.plan,eg?.totalStorageUsed??0,(0,F.b3)(eE,e,t)),[eR,eL]=(0,r.useState)(),[eM,eO]=(0,r.useState)(!1),[eU,eB]=(0,r.useState)([]),[ez,eq]=(0,r.useState)(B),eV=(0,c.useRouter)(),eG=(0,c.usePathname)(),e_=e=>{eq(e);let t=e||[];if(eB(e||[]),0===t.length)(0,m.Dl)(eV,eG,null),eb((0,n.X6)(_)),eb((0,w.AA)("ROOT")),eb((0,n.G7)([]));else{let e=t[t.length-1];(0,m.Dl)(eV,eG,e?.fileId),eb((0,n.X6)(e?.children||[])),eb((0,w.AA)(e?.fileId)),eb((0,n.G7)(t))}};(0,r.useEffect)(()=>{!0===eM&&e_(B)},[eM]);let[eQ,{isLoading:eH,error:eW,data:eX}]=(0,P.U5)(),[eJ,{isLoading:eY,error:eK,data:eZ}]=(0,P.Ne)(),{isDiscussion:e0,isActivities:e1,isPublicSharing:e2,isFeed:e5,isDecision:e4}=(0,W.A)(),{projectIds:e3}=(0,i.d4)(e=>e.projects),{refetch:e6}=(0,H.m5)({projectId:e1||e4?N?.guid:e3,isBlocker:!!e4},{skip:e0||(e1||e4?!N?.guid:!e3||0===e3.length)}),{refetch:e7}=(0,H.mt)(N?.guid,{skip:!e0||!N?.guid}),e8=()=>{if(!e?.parentPostId||!eN?.postId)return;let t=eN.posts?.[0],l=new Date().toISOString(),a={postId:eN.postId,parentPostId:e.parentPostId,...e.revisedFileId&&{revisedFileId:e.revisedFileId},postDescription:eN.postDescription||"",taggedEmails:eN.taggedUser||[],isBlocker:eN.isBlocker||0,userId:ew,projectId:N?.guid,category:et,createdAt:l,updatedAt:l},r=e=>e.sort((e,t)=>
4new Date(t?.revisedAt||t?.createdAt).getTime()-new Date(e?.revisedAt||e?.createdAt).getTime()),s=e.revisedFileId?t=>{if(!Array.isArray(t))return;let s=e.parentPostId,i=t.find(e=>e?.postId===s||e?.parentPostId===s);if(i){if(Array.isArray(i.fileRevisions)||(i.fileRevisions=[]),!i.fileRevisions.some(e=>e?.postId===a.postId)){let t=i.fileRevisions.filter(t=>t?.revisedFileId===e.revisedFileId).reduce((e,t)=>Math.max(e,t?.version||1),1);i.fileRevisions.push({...a,version:t+1})}(!i.revisedAt||i.revisedAt<l)&&(i.revisedAt=l),r(t)}}:t=>{if(!Array.isArray(t))return;let l=e.parentPostId,s=t.findIndex(e=>e?.postId===l||e?.parentPostId===l);if(s<0)return;let i=t[s];if(i?.postId===a.postId)return;let{repliesChilds:n,fileRevisions:o,revisedAt:d,...c}=i||{};t[s]={...a,version:(i?.version||1)+1,postNumber:i?.postNumber,repliesChilds:[c,...n||[]],...o?{fileRevisions:o}:{},...d?{revisedAt:d}:{}},r(t)};[{projectId:N?.guid,isBlocker:!1},{projectId:e3,isBlocker:!1},{projectId:N?.guid,isBlocker:!0}].forEach(e=>eb(H.BP.util.updateQueryData("getPostData",e,s))),t?.fileS3Id&&eb(H.BP.util.upsertQueryData("getSubPostData",eN.postId,{subposts:[{postId:eN.postId,fileName:t.fileName,fileType:t.fileType,fileS3Id:t.fileS3Id,thumbnailS3Id:t.thumbnailS3Id,fileDescription:t.fileDescription||"",...t.afterfileS3Id?{afterfileS3Id:t.afterfileS3Id}:{},...t.afterthumbnailS3Id?{afterthumbnailS3Id:t.afterthumbnailS3Id}:{},fileCategory:h.NL.FILES,category:et,parentFolderId:ea,projectId:N?.guid,userId:ew,createdAt:l,updatedAt:l}]}))},e9=async()=>{try{if(e0){let{data:e}=await e7();eb((0,n.r6)(e)),eb((0,n.dG)(e))}else{let{data:e}=await e6();(e1||e4)&&(eb((0,n.Y4)((0,F.W5)(e,Z))),eb((0,n.Pz)(e))),e4&&(eb((0,n.Mu)((0,F.W5)(e,Z))),eb((0,n.PJ)(e))),e5&&(eb((0,n.qE)((0,F.W5)(e,Z))),eb((0,n.dG)(e))),e8()}}catch(e){console.error("Error updating feeds:",e)}e?.onUploaded?.(),eb((0,o.ll)("")),eb((0,o.ob)(!1)),e?.preserveSelection||eb((0,o.$j)("")),eb((0,n.e9)({})),ed([]),eb((0,o.fd)(!1)),eL(null),en(null),eD([]),eA(ev)},te=async(t,l,a)=>{t?.preventDefault&&t.preventDefault();let r=eN?.taggedUser;if(1===eN.isBlocker&&(!r||0===r.length)){eS("Please select attention when blocker is enabled"),a?.(!1);return}if(0===eN.posts.length){ex("Please add a file to upload."),a?.(!1);return}if(eF(eN.posts,eN.thumbnail)){eT(!0),a?.(!1);return}try{let t=await eQ({uploadData:{...eN,projectId:N?.guid,parentFolderId:ea,category:et,...e?.parentPostId&&{isFeed:0},...e?.revisedFileId&&{revisedFileId:e.revisedFileId}},presignedUploadData:eE}).unwrap();if(t){e8();let e=t.body||t;eh(e.message||e||"Upload successful!");let{data:l,isSuccess:a}=await ef();if(eb((0,n.De)(l)),1===eN.isBlocker&&v(N?.guid),0===B.length){eb((0,n.X6)(l)),e9();return}if(a&&l){let e=l,t=null;for(let l=0;l<B.length;l++){let a=B[l].fileId;if((t=e.find(e=>e.fileId===a))&&Array.isArray(t.children))e=t.children;else{e=[];break}}eb((0,n.X6)(e))}else ex("Failed to fetch updated data. Please try again.");e9()}}catch(e){if(e?.data?.code==="STORAGE_LIMIT_EXCEEDED")return void eT(!0);ex("Upload failed. Please try again."),console.error("Upload failed:",e)}finally{l?.(),a?.(!1)}},tt=e=>{d?en(t=>({...t,taggedEmails:e})):eA(t=>({...t,taggedUser:e})),eS("")},tl=(e,t)=>{let l=e.target.value,a=(e,a)=>{let r=[...e?.posts];if(t.category===h.b7.SideBySide){let e=r[0],a={...e,[t.descriptionType]:l,fileS3Id:"",fileName:e?.fileName||"",fileType:e?.fileType||""};r[0]=a}else if([h.b7.DRAWINGS,h.b7.PANORAMA,h.b7.RENDERINGS,h.b7.Images,h.b7.Videos,h.b7.SPECIFICATION,h.b7.MOODBOARD,h.b7.ThreeDModels,h.b7.FILES].includes(t.category))r[t.index]={...r[t.index],fileDescription:l};else throw Error("Unhandled category");return{...e,posts:r}};d?en(e=>a(e,!1)):eA(e=>a(e,!0))};function ta(e,t){return(0,x.A)(),{fileDescription:"",uploadFile:t,fileName:e.name,fileType:e.type}}let tr=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=e.name.toLowerCase(),r=(e.type||"").toLowerCase(),s=a.split(".").pop()||"";return t.length&&t.includes(s)||l.length&&l.some(e=>r.includes(e))},ts=async(e,t)=>{try{if(ep(!0),!e.target.files||0===e.target.files.length)return void console.warn("No files selected");let l=Array.from(e.target.files);if(console.log("Files to upload:",l.map(e=>({name:e.name,type:e.type}))),(l=(l=await Promise.all(l.map(async e=>
4{if((0,p.E)(e))try{console.log(`Converting HEIC/HEIF file to JPEG: ${e.name}`);let t=await (0,p.q)(e);return console.log(`✓ Converted ${e.name} → ${t.name}`),t}catch(t){return console.error(`Failed to convert HEIC file ${e.name}:`,t),ex(`Failed to convert ${e.name}. Please convert it to JPEG manually.`),null}return e}))).filter(Boolean)).length+eN.posts.length>10){alert("You can only upload a maximum of 10 images."),ep(!1);return}if(l.filter(e=>tr({name:e.fileName??e.name,type:e.fileType??e.type},["pdf","doc","docx","xls","xlsx","ppt","pptx"],["pdf","word","excel","spreadsheet","powerpoint","presentation"])).length>1){alert("Only one PDF, Document, Table, or Show file can be added per upload. Please upload each of these files separately."),ep(!1);return}if(t.category!==h.b7.SideBySide&&l.length+eN.posts.length>1){ex("A revision is a single file. Remove the added file first to pick a different one."),ep(!1);return}let a=await Promise.all(l.map(async e=>{let l,a,r,s,i=e.type,n=e.name.split(".").pop()?.toLowerCase(),o=tr(e,["pdf"],["pdf"]),c=tr(e,["ppt","pptx"],["presentation"]),m=tr(e,["xls","xlsx"],["excel","spreadsheet"]),p=tr(e,["doc","docx"],["word"]),f=tr(e,[],["image"]),g=tr(e,[],["video"]),b=tr(e,["zip"],["model"]);if("pdf"===n&&(i="application/pdf"),("xlsx"===n||"xls"===n)&&(i=i||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),("ppt"===n||"pptx"===n)&&(i=i||"application/vnd.openxmlformats-officedocument.presentationml.presentation"),"doc"===n||"docx"===n)i=i||"application/msword";else if(!i||""===i)switch(n){case"glb":i="model/gltf-binary";break;case"gltf":i="model/gltf";break;default:i="application/octet-stream"}console.log(`File: ${e.name}, detected type: ${i}, original type: ${e.type}`);let j={url:URL.createObjectURL(e),name:e.name,size:e.size,type:e.type||i};if(await (0,u.YF)(e),"afterImages"===t.imageType){await (0,u.YF)(e);let t=await (0,u.pL)(e);await (0,u.YF)(t),l={url:t?URL.createObjectURL(t):"",name:e.name,size:t?t.size:0,type:e.type}}if(e.type.includes("image/")&&(r=await (0,u.pL)(e),await (0,u.YF)(r),a={url:r?URL.createObjectURL(r):"",name:e.name,size:r?r.size:0,type:e.type}),t.category===h.b7.SideBySide){let s,i=eN.posts[0];if("beforeImage"===t.imageType){let t=(0,x.A)(),l=(0,x.A)();eD(i=>{let n=Array.isArray(i)?[...i]:[];return n[0]={...n[0],originalFile:{file:e,fileName:t,fileType:s.fileType},thumbnail:{file:r,fileName:l,fileType:a?.type}},n}),eL(e=>{let t=Array.isArray(e)?[...e]:[];return t[0]={...t[0],thumbnailFile:a},t}),s={...i,beforeFilesDescription:"",fileS3Id:t,thumbnailS3Id:l,fileName:j.name,fileType:j.type}}else if("afterImages"===t.imageType){let t=(0,x.A)(),a=(0,x.A)();eD(i=>{let n=Array.isArray(i)?[...i]:[];return n[0]={...n[0],afterOriginalFile:{file:e,fileName:t,fileType:s.fileType},afterThumbnail:{file:r,fileName:a,fileType:l?.type}},n}),eL(e=>{let t=Array.isArray(e)?[...e]:[];return t[0]={...t[0],afterThumbnail:l},t}),s={filesDescription:"",...i,afterfileS3Id:t,afterthumbnailS3Id:a,fileName:j.name,fileType:j.type}}else throw Error("Unhandled imageType for sideBySide category");return s}if(f){let t=(0,x.A)(),l=(0,x.A)();return s={fileDescription:j.name?.split(".")[0],fileS3Id:t,fileName:j.name,fileType:j.type,thumbnailS3Id:l,newPost:!0},d&&(s.thumbnail=a),eD(s=>[...s||[],{originalFile:{file:e,fileName:t,fileType:e.type},thumbnail:{file:r,fileName:l,fileType:a?.type}}]),eL(e=>[...e||[],a]),s}if(g)return ta(j,e);if(b)return ta(j,e);if(o||m||p||c){let t=(0,x.A)(),l=!1,r=null;try{console.log(`Generating thumbnail for ${e.name} (type: ${e.type})...`);let t=await (0,Y.u)(e);t?.blob?(r=t.blob,a={url:t.url||"",name:e.name,size:r.size||0,type:"image/png",fileType:"image/png"},console.log(`✓ Thumbnail generated successfully for ${e.name}
4`),l=!0):console.warn(`generateFileThumbnail returned empty data for ${e.name}`)}catch(t){console.error(`Failed to generate thumbnail for ${e.name}:`,t)}let s=function(e,t,l,a){let r=(0,x.A)();return eD(t=>[...t||[],{originalFile:{file:e,fileName:r,fileType:e.type},...l&&a&&{thumbnail:{file:a,fileName:l,fileType:"image/png"}}}]),{fileDescription:e.name?.split(".")[0],fileName:e.name,fileType:e.type,fileS3Id:r,...l&&{thumbnailS3Id:l}}}(e,0,l?t:void 0,r||void 0);if(a)eL(e=>[...e||[],a]);else{let t={"application/pdf":"application/pdf","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel":"application/vnd.ms-excel","application/msword":"application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation":"application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.ms-powerpoint":"application/vnd.ms-powerpoint","application/ppt":"application/ppt"};eL(l=>[...l||[],{url:"",name:e.name,size:e.size,type:e.type||i,fileType:t[e.type]||i||"application/octet-stream"}])}return s}else throw console.error("Unhandled file type:",{name:e.name,type:e.type,detectedType:i,extension:e.name.split(".").pop()?.toLowerCase()}),Error(`Unhandled category: ${e.name} (type: ${e.type||i})`)})),r=t.category===h.b7.SideBySide||t.category===h.b7.Videos;if(d?en(e=>({...e,posts:[...e.posts,...a]})):eA(e=>({...e,parentFolderId:ee,posts:r?[a[0]]:[...e.posts,...a]})),a.length>0){let e=a.length,t=1===e?"1 file processed successfully!":`${e} files processed successfully!`;eh(t)}else eh("No files required processing.");ep(!1)}catch(e){console.error("Error in handleImageUpload:",e),ex(e?.message||"An error occurred while processing files"),ep(!1)}},ti=e=>{if(d){let t=ei.posts[e],l=ei.posts.filter((t,l)=>l!==e);t?.fileId&&(ed(e=>[...e,t.fileId]),em(e=>[...e,t.fileS3Id])),en({...ei,posts:l})}else eA(t=>{let l=t.posts.filter((t,l)=>l!==e);return{...t,posts:l}}),eL(eR?.filter((t,l)=>l!==e))},tn=()=>{d?en(e=>({...e,isBlocker:+(1!==e.isBlocker)})):eA(e=>({...e,isBlocker:+(1!==e.isBlocker)})),eS("")},to=async()=>{let e=ei.posts.map(e=>{let{thumbnail:t,...l}=e;return l}),t={...ei,projectId:N?.guid,parentFolderId:ea,posts:e,removedSubPostFileIds:eo,removedSubPostFileS3Ids:ec};if(eF(ei.posts,ei?.thumbnail))return void eT(!0);try{let e=await eJ({sanitizedUpdatePost:t,presignedUploadData:eE}).unwrap();if(e){let t=e.body||e;"string"==typeof t&&(t=JSON.parse(t)),eh(t?.message||t||"Updated successful!"),1===ei.isBlocker&&v(N?.guid),ef(),e9()}else ex("Error uploading file")}catch(e){if(e?.data?.code==="STORAGE_LIMIT_EXCEEDED")return void eT(!0);console.error("Error during file upload:",e)}};(0,r.useImperativeHandle)(t,()=>({triggerSubmit:(e,t)=>te(void 0,e,t)}));let td=(0,r.useCallback)(()=>{if(!B||0===B.length)return;let e=B.slice(0,-1),t=B[B.length-1];if(eB(e=>[...e,t]),0===e.length)(0,m.Dl)(eV,eG,null),eb((0,n.X6)(_)),eb((0,w.AA)("ROOT")),eb((0,n.G7)([]));else{let t=e[e.length-1];(0,m.Dl)(eV,eG,t?.fileId),eb((0,n.X6)(t?.children||[])),eb((0,w.AA)(t?.fileId)),eb((0,n.G7)(e))}},[eb,B,_,eV,eG]),tc=(0,r.useCallback)(()=>{if(0===eU.length)return;let e=eU[eU.length-1];eB(e=>e.slice(0,-1));let t=[...B||[],e];(0,m.Dl)(eV,eG,e?.fileId),eb((0,n.X6)(e?.children||[])),eb((0,w.AA)(e?.fileId)),eb((0,n.G7)(t))},[eb,eU,B,eV,eG]),tm=et?y.r[et]:"ROOT";return(0,a.jsxs)("div",{className:`${"Link"===l||null===l?"hidden":""} relative w-full`,children:[(0,a.jsx)(R.A,{show:eP,onClose:()=>eT(!1),currentPlan:eg?.plan,limitType:"storage"}),(0,a.jsx)(L.A,{className:"mb-3",ownerUserId:N?.userId}),(0,a.jsx)(K.A,{show:eu,scrim:"dark",rounded:"xl",label:"Processing files...",className:"z-50"}),(0,a.jsx)("div",{className:"relative w-full",children:et===h.b7.Videos||et===h.b7.ThreeDModels?(0,a.jsx)(Q,{loader:eH||eY,acceptAttribute:ek,teamMembers:O,handleImageUpload:ts,handleDescriptionChange:tl,uploadData:eN,setUploadData:eA,handleTag
4Change:tt,handlePostDescriptionChange:e=>{let t=e.target.value;d?en(e=>({...e,postDescription:t})):eA(e=>({...e,postDescription:t}))},newHandleSubmit:te,updatePost:ei,handleFeedCheckBox:()=>{d?en(e=>({...e,isFeed:+(1!==e.isFeed)})):eA(e=>({...e,isFeed:+(1!==e.isFeed)}))},handleBlockerCheckBox:tn,taggedEmails:eC,handleRemovePost:ti,updateSubmit:to,navigationPath:B,setShowLocationBrowser:eO,attentionError:eI||""}):(0,a.jsx)("div",{className:"relative",children:(0,a.jsxs)("div",{className:"w-full flex flex-col lg:flex-row",children:[(0,a.jsx)("div",{className:"flex-1 md:pl-6 p-3 md:py-6",children:et===h.b7.SideBySide?(0,a.jsx)(b.A,{acceptAttribute:ek,handleImageUpload:ts,handleDescriptionChange:tl,uploadData:eN,tempThumbnail:eR,isRWFFileUpload:!0}):(0,a.jsx)(g.A,{acceptAttribute:ek,category:et,handleImageUpload:ts,handleDescriptionChange:tl,uploadData:eN,updatePost:ei,tempThumbnail:eR,handleRemovePost:ti,isRWFFileUpload:!0})}),(0,a.jsx)("div",{className:"w-full md:w-100 p-5 flex flex-col",children:(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"postDescription",className:V.I8,children:"Post Description (Optional)"}),(0,a.jsx)(X.A,{id:"postDescription",name:"postDescription",rows:5,value:d?ei.postDescription:eN.postDescription,onChange:e=>{d?en(t=>({...t,postDescription:e})):eA(t=>({...t,postDescription:e}))},members:O||[],placeholder:"Enter description here \xb7 type @ to mention"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:V.I8,children:"Attention (Optional)"}),(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)(f.A,{name:"colors",teamMembers:O||[],value:eC,onChange:tt,isClearable:!0,placeholder:"Select audience"})}),eI&&(0,a.jsx)("p",{className:"text-red-2 text-sm font-medium mt-2",children:eI})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:V.I8,children:"File Location"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:(0,V.jp)("default","md","flex flex-1 items-center min-w-0"),children:(0,a.jsx)("span",{className:"flex-1 truncate",children:B&&B.length>0?`${tm} > ${B.map(e=>e.fileName||e.fileId).join(" > ")}`:tm})}),(0,a.jsx)(z.Ay,{variant:"outline",size:"sm",onClick:()=>{eO(!0)},className:"h-10 shrink-0",children:"Browse"})]})]}),(0,a.jsx)("div",{className:"border p-2  h-9.5  border-light-2 dark:border-dark-4  flex flex-row items-center gap-4 roun
4ded-xl bg-light-2  dark:bg-dark-2",children:(0,a.jsx)("div",{className:"w-45.25 h-9.5",children:(0,a.jsxs)("label",{className:" h-10 gap-2 flex items-center cursor-pointer select-none text-dark-2 dark:text-light-0",children:[(0,a.jsx)(G.A,{checked:d?1===ei.isBlocker:1===eN.isBlocker,onChange:tn}),(0,a.jsx)("div",{className:"text-dark-2 text-sm font-semibold dark:text-light-0",children:"Blocker"})]})})})]})})]})})}),eM&&(0,a.jsx)("div",{className:"fixed inset-0 z-2000 flex items-center justify-center h-full bg-dark-2/40 backdrop-blur-sm lg:p-4 p-0",children:(0,a.jsxs)("div",{className:"w-full h-full lg:w-full xl:max-w-6xl lg:h-[80vh] lg:max-h-225 lg:rounded-lg lg:shadow-lg overflow-hidden bg-light-0 dark:bg-dark-3 flex flex-col",children:[(0,a.jsxs)("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between px-4 lg:px-6 py-4 lg:h-17.5 w-full bg-light-0 dark:bg-dark-3 border-b border-light-3 dark:border-dark-4",children:[(0,a.jsx)("div",{className:"mb-3 lg:mb-0 lg:flex lg:items-center",children:(0,a.jsx)("span",{className:"text-dark-3 dark:text-light-2 font-bold text-2xl",children:"Select a Location"})}),(0,a.jsx)("div",{className:"w-full lg:w-112.5 mb-3 lg:mb-0",children:(0,a.jsxs)("div",{className:"bg-light-2 dark:bg-dark-2 text-dark-3 font-jakarta h-10 flex items-center gap-2 py-6 md:py-0 px-3 rounded-xl overflow-x-auto whitespace-nowrap scrollbar-none",children:[(0,a.jsx)(z.Ay,{variant:"ghost",size:"sm","aria-label":"Back",className:"h-8 w-8 p-1! shrink-0",onClick:td,disabled:!B||0===B.length,children:(0,a.jsx)(S.A,{className:"w-5 h-5"})}),(0,a.jsx)(z.Ay,{variant:"ghost",size:"sm","aria-label":"Forward",className:"h-8 w-8 p-1! shrink-0",onClick:tc,disabled:0===eU.length,children:(0,a.jsx)(C,{className:"shrink-0"})}),(0,a.jsx)(A,{category:et})]})}),(0,a.jsx)(q.Ay,{variant:"nav","aria-label":"Close location browser",onClick:()=>{e_(ez),eO(!1)},icon:(0,a.jsx)(I.A,{className:"h-5 w-5"})})]}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:(0,a.jsx)(j.A,{hideCheckBox:!0,hideContextMenu:!0,urlNavigation:!1})}),(0,a.jsxs)("div",{className:"flex flex-row  md:gap-2 gap-4 items-center justify-end   py-3 px-5  border-t border-light-3 max-xl:pb-3 ",children:[(0,a.jsx)(z.Ay,{variant:"outline",onClick:()=>{e_(ez),eO(!1),eb((0,o.ll)(""))},className:"h-9.5 w-22","data-modal-hide":"default-modal",children:"Cancel"}),(0,a.jsx)(z.Ay,{variant:"yellow",type:"button",onClick:()=>eO(!1),className:"h-9.5 w-22","data-modal-hide":"default-modal",children:"Choose"})]})]})})]})});Z.displayName="ChildComponent";var ee=l(39670),et=l(99857),el=l(48376),ea=l(74923);let er=r.memo(e=>{let{data:t,subPosts:l,renderTrigger:c,modalZClassName:m,onUploaded:u,onOpenChange:p,revisedFileId:h}=e,[x,f]=(0,r.useState)(!1),[g,b]=(0,r.useState)(!1),j=(0,i.wA)(),w=(0,i.Pj)(),y=!!c,v=(0,r.useRef)(null),{isDiscussion:k}=(0,W.A)(),{canEdit:N}=(0,ea.A)(t?.projectId),{projectList:A,selectedProjectId:I}=(0,i.d4)(e=>e.project),{data:S,error:C,isLoading:E,refetch:D}=(0,s.A)(t?.category),[P,T]=(0,r.useState)(S),[$,F]=(0,r.useState)(!1),R=(0,r.useMemo)(()=>A,[A]),[L,{isFetching:M}]=(0,el.RG)();(0,r.useEffect)(()=>{T(S)},[S]);let U=(0,r.useRef)(null),B=(0,r.useCallback)(()=>{f(!1),p?.(!1);let e=v.current;e?(v.current=null,j((0,d.Fb)(e.activeCategory)),j((0,n.X6)(e.categoryData)),j((0,n.De)(e.rootData)),j((0,n.G7)(e.navigationPath||[])),j((0,o.$j)(e.selection))):j((0,n.G7)([])),j((0,o.ll)(""))},[j,p]),q=(0,r.useCallback)(()=>{g||(b(!0),U.current?.triggerSubmit(B,b))},[g,B]),V=(0,r.useCallback)(e=>{let t=l?.subposts?.[0]?.location||[];if(!t?.length)return;let a=[],r=e||[];for(let e=1;e<t.length;e++){let l=t[e],s=r?.find(e=>e.fileId===l.id||e.id===l.id);if(s)a.push({...s,fileId:s.fileId||s.id,fileName:s.fileName||s.name,children:s.children||[]}),r=s.children||[];else{console.warn(`Location not found in category data: ${l.id}`);break}}if(a.length>0){j((0,n.G7)(a));let e=a[a.length-1];Array.isArray(e.children)&&(j((0,n.X6)(e.children)),y||j((0,o.$j)(e)))}else j((0,n.G7)([])),j((0,n.X6)(e))},[j,t?.category,l?.subposts,y]);(0,r.useEffect)(()=>{!E&&!C&&S&&t?.category&&$&&(e=>{j((0,d.Fb)(t?.category)),j((0,n.X6)(e)),j((0,n.De)(e)),V(e),j((0,et.SH)(!1)),f(!0),p?.(!0),F(!1)})(S)},[E,S,t?.category,$,C,j,V,p]);let G=(0,r.useCallback)(e=>{b(!1);let l=R.find(t=>t.guid===e);if(l){if(l.guid===I){j((0,d.Fb)(t?.category)),j((0,n.X6)(P)),j((0,n.De)(P)),V(P),f(!0),p?.(!0);return}j((0,et.Qo)(`${l.projectNumber||""}${l.projectName||""}
4`)),j((0,et.eP)(l.guid)),j((0,et.SH)(!0)),L(l.guid).unwrap().then(e=>{j((0,et.NR)(e)),F(!0)}).catch(e=>{console.error("Failed to load project details:",e),j((0,et.SH)(!1)),f(!1),p?.(!1)})}},[R,I,t?.category,P,j,L,V]),_=()=>{if(y){let e=w.getState();v.current={categoryData:e?.category?.categoryData,rootData:e?.category?.rootData,navigationPath:e?.category?.navigationPath,activeCategory:e?.fileExplorer?.activeCategory,selection:e?.contextMenu?.selectedFileOrFolder}}G(t?.projectId)};return(0,a.jsxs)(a.Fragment,{children:[!k&&N&&(c?c(_):(0,a.jsx)(z.Ay,{variant:"outline",size:"sm",onClick:_,children:"Upload Revision"})),x&&(0,a.jsx)(ee.A,{open:!0,onClose:B,maxWidthClassName:"max-w-6xl",noBodyPadding:!0,dirty:g,...m&&{zClassName:m},title:E||M?(0,a.jsxs)("span",{className:"flex items-center space-x-2",children:[(0,a.jsx)(O.A,{}),(0,a.jsx)("span",{className:"text-dark-2 dark:text-light-2 font-semibold",children:"Loading..."})]}):"Upload Revision",footer:!E&&!M&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(z.Ay,{variant:"outline",size:"sm",onClick:()=>{B()},"data-modal-hide":"default-modal",children:"Cancel"}),(0,a.jsx)(z.Ay,{variant:"yellow",size:"sm",type:"button","data-modal-hide":"default-modal",onClick:q,loading:g,children:"Upload"})]}),children:P&&(0,a.jsx)(Z,{ref:U,parentPostId:t.parentPostId||t.postId,defaultTaggedEmails:t?.taggedEmails||[],defaultParentFolderId:l?.subposts?.[0]?.parentFolderId,revisedFileId:h,preserveSelection:y,onUploaded:u})})]})})},67528:(e,t,l)=>{"use strict";l.d(t,{A:()=>m});var a=l(48376),r=l(1213),s=l(99857),i=l(53351),n=l(43656),o=l(32605),d=l(20063),c=l(66137);let m=()=>{let e=(0,r.wA)(),t=(0,d.useRouter)(),[l]=(0,a.FS)(),[m,{isFetching:u,isLoading:p}]=(0,a.g0)(),[h]=(0,i.RG)(),{fetchedProjects:x}=(0,o.A)(),{selectedProjectId:f}=(0,r.d4)(e=>e.project),{activeCategory:g}=(0,r.d4)(e=>e.fileExplorer),b=async t=>{try{let l=await h({projectId:t}).unwrap();l&&e((0,n.sT)(l))}catch(e){console.error("Error fetching blocker count:",e)}};return{fetchProjects:async a=>{try{if((await l().unwrap()).totalCount>0){let l=await m().unwrap(),r=l.projects?.[0];if(e((0,s.MZ)(l.projects||[])),a&&Array.isArray(x)&&x.length>0){let l=[...x].sort((e,t)=>t.createdAt-e.createdAt)[0]||null;if(l){let a=`${l.projectNumber||""}${l.projectName||""}`;if(e((0,s.Qo)(a)),e((0,s.eP)(l.guid)),b(l.guid),l.projectName){let e=encodeURIComponent(a.replace(/\s+/g,"-"));t.push(`/dashboard/${e}/${g||"activities"}`)}return}}if(r){let a=window.location.pathname,i=(0,c.rF)(a),n=i?l.projects.find(e=>(0,c.Az)(e,i)):null;if(n){n.guid!==f&&(e((0,s.Qo)(`${n.projectNumber||""}${n.projectName||""}`)),e((0,s.eP)(n.guid))),b(n.guid);return}let o=l.projects.find(e=>e.guid===f)||r;if(!f||!l.projects.some(e=>e.guid===f)){let t=`${r.projectNumber||""}${r.projectName||""}`;e((0,s.Qo)(t)),e((0,s.eP)(r.guid)),b(r.guid)}let d=o?.projectName||r.projectName||"";if(d){let l=`${o.projectNumber||""}${d}`,r=encodeURIComponent(l.replace(/\s+/g,"-"));a.includes("dashboard")&&!(0,c.x3)(a)&&(e((0,s.Qo)(l)),t.push(`/dashboard/${r}/${g||"activities"}`))}else t.push("/dashboard")}}else e((0,s.MZ)([])),e((0,s.Qo)("")),e((0,s.eP)(""))}catch(e){t.push("/dashboard")}},fetchBlockerCount:b,isProjectsFetching:u,isProjectsLoading:p}}},69454:(e,t,l)=>{"use strict";l.d(t,{Pz:()=>i,kg:()=>s,nW:()=>o});var a=l(21980);async function r(e){let t={};if(e)return t.Authorization=`Bearer ${e}`,t;try{let{fetchAuthSession:e}=await l.e(64848).then(l.bind(l,64848)),a=await e(),r=a.tokens?.accessToken?.toString(),s=a.tokens?.idToken?.payload?.email;r&&(t.Authorization=`Bearer ${r}`),s&&(t.useremail=String(s))}catch{}return t}async function s(e,t,l){let s=await r(l);s["Content-Type"]="application/json";let i=await fetch(`${a.mN}/partners/univer/save`,{method:"PUT",headers:s,body:JSON.stringify({fileId:e,...t})});if(!i.ok)throw Error(`Univer meta save failed: ${i.status}`);let n=await i.json().catch(()=>null);return{etag:n?.etag??null}}async function i(e,t){let{etag:l}=await s(e,{},t);return l}let n=new Map;async function o(e,t,l){let a=Date.now(),r=n.get(e);if(void 0===r||!(a-r<3e4)){n.set(e,a);try{await s(e,{fileSize:t},l)}catch{}}}},71781:(e,t,l)=>{"use strict";l.d(t,{A:()=>
4o});var a=l(95155),r=l(66716),s=l(5016),i=l(11636);l(12115);let n=e=>(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"81",height:"80",fill:"none",viewBox:"0 0 81 80",children:[(0,a.jsx)("path",{fill:"#E2E2E2",d:"M68.968 67.068a20.1 20.1 0 0 0 3.45-7.904c2.186-10.949-4.916-21.596-15.864-23.782s-21.595 4.916-23.782 15.864a20.1 20.1 0 0 0 .15 8.622z"}),(0,a.jsx)("path",{fill:"#CECECE",d:"M71.359 47.68c-1.804.135-4.36-.02-7.805-.954-6.76-1.834-14.184-7.412-20.508-9.338a20.18 20.18 0 0 0-9.871 12.203c2.27-1.234 5.47-2.416 9.614-2.645 9.234-.512 18.508 4.033 23.753 4.743 2.233.303 4.281.042 5.898-.357a20 20 0 0 0-1.081-3.651M67.04 60.014c-3.219-.792-13.482-8.93-23.229-8.51-5.449.233-9.16 1.268-11.372 2.134a20 20 0 0 0 .481 6.232l36.047 7.199a20.1 20.1 0 0 0 3.4-7.66c-1.702.552-3.761.99-5.327.605"}),(0,a.jsx)("path",{fill:"#BABABA",d:"M28.232 19.136v-.01l-.001.005-.002-.004v.01q-.188.682-.871.977.683.294.871.977v.01l.002-.005v.005-.01q.19-.683.872-.977-.682-.294-.871-.978m35.455-7.695v-.01l-.001.006-.001-.005v.01q-.188.683-.872.977.684.294.872.978v.01l.001-.006.001.005v-.01q.188-.683.872-.977-.684-.294-.872-.978m4.91 17.128v-.01l-.001.005-.001-.005v.01q-.189.684-.872.978.684.293.872.977v.01-.005l.002.005v-.01q.189-.684.871-.977-.683-.295-.87-.978M7.956 46.952v-.01l-.001.005-.002-.005v.01q-.188.684-.871.977.683.294.871.978v.01l.002-.005v.005-.01q.19-.684.872-.978-.682-.294-.871-.977M70.954 14.7v-.02l-.002.01-.003-.01v.02q-.377 1.368-1.742 1.956 1.364.588 1.742 1.955v.02q0-.006.003-.01l.002.01v-.02q.377-1.368 1.743-1.956-1.365-.588-1.743-1.955M25.976 40.02V40q0 .006-.003.01l-.002-.01v.02q-.377 1.367-1.743 1.955 1.365.588 1.743 1.955v.02l.002-.01.003.01v-.02q.377-1.367 1.742-1.955-1.364-.588-1.742-1.955m-4.65-29.556v-.02l-.002.01-.003-.01v.02q-.377 1.367-1.742 1.955 1.364.588 1.742 1.955v.02q0-.006.003-.01l.002.01v-.02q.377-1.367 1.743-1.955-1.365-.588-1.743-1.955"}),(0,a.jsx)("path",{fill:"#E2E2E2",d:"M50.073 22.348a7.426 7.426 0 1 0 0-14.852 7.426 7.426 0 0 0 0 14.852"}),(0,a.jsx)("path",{fill:"#BABABA",d:"M51.536 7.64c.044 1.116-.031 2.28-.403 3.065-.931 1.966-2.38 2.587-5.692 4.217-1.357.668-1.912 1.913-2.095 3.15a7.46 7.46 0 0 0 2.318 2.826c.223-.934.645-1.974 1.432-2.845 1.967-2.173 4.968-.103 8.44-1.863.92-.466 1.524-1.238 1.913-2.12a7.43 7.43 0 0 0-5.913-6.43M15.231 39.467a6.155 6.155 0 1 0 0-12.31 6.155 6.155 0 0 0 0 12.31"}),(0,a.jsx)("path",{fill:"#8C8C8C",d:"M5.912 38.778c-.546 0-.866-.12-.974-.367-.154-.35.176-.855 1.008-1.54.742-.61 1.869-1.348 3.26-2.134a.133.133 0 0 1 .13.232c-1.377.779-2.49 1.508-3.22 2.108-1.004.826-.968 1.148-.934 1.227.042.096.404.535 3.395-.254 2.09-.55 4.765-1.524 7.532-2.741s5.293-2.53 7.112-3.699c2.602-1.671 2.523-2.235 2.48-2.33-.034-.08-.244-.32-1.511-.145-.922.127-2.194.448-3.678.928a.133.133 0 1 1-.082-.254c1.5-.484 2.787-.809 3.723-.938 1.053-.146 1.64-.047 1.793.301.123.281-.061.656-.565 1.146-.443.432-1.122.942-2.016 1.516-1.83 1.176-4.37 2.497-7.148 3.72-2.78 1.222-5.469 2.2-7.572 2.754-1.029.271-1.863.427-2.48.462a5 5 0 0 1-.253.008"}),(0,a.jsx)("path",{fill:"#fff",d:"M77.167 72.06c-9.764-8.8-22.69-14.156-36.869-14.156S13.193 63.261 3.43 72.06"}),(0,a.jsx)("path",{fill:"#000",d:"M77.166 72.194a.13.13 0 0 1-.09-.035 55.3 55.3 0 0 0-7.866-5.91 54.705 54.705 0 0 0-28.912-8.211 54.7 54.7 0 0 0-28.913 8.212 55.3 55.3 0 0 0-7.867 5.91.133.133 0 0 1-.178-.199 55.171 55.171 0 0 1 16.82-10.403 55 55 0 0 1 20.138-3.786 54.97 54.97 0 0 1 29.053 8.251 55.6 55.6 0 0 1 7.905 5.938.134.134 0 0 1 .01.189.13.13 0 0 1-.1.044"}),(0,a.jsx)("path",{fill:"#fff",d:"M8.827 67.773v-2.247s2.99-3.26 6.576-5.271c6.158-3.452 9.317-3.036 9.317-3.036l4.381 1.825s-2.898 4.08-8.753 7.042c-4.272 2.16-7.883 2.985-7.883 2.985"}),(0,a.jsx)("path",{fill:"#000",d:"M12.465 69.204a.133.133 0 0 1-.03-.263c.036-.009 3.646-.847 7.853-2.975a27.7 27.7 0 0 0 6.534-4.603c1.131-1.08 1.825-1.942 2.07-2.263l-4.205-1.752c-.12-.011-.903-.07-2.31.229-2.556.54-5.167 1.818-6.908 2.794-3.32 1.861-6.162 4.838-6.508 5.207v2.194a.133.133 0 0 1-.267 0v-2.247q.001-.051.035-.09c.03-.033 3.046-3.3 6.61-5.297 1.763-.99 4.41-2.282 7.005-2.827 1.563-.328 2.36-.23 2.394-.225a.1.1 0 0 1 .034.009l4.38 1.825a.134.134 0 0 1 .058.2c-.007.01-.748 1.047-2.197 2.43a28 28 0 0 1-6.605 4.654c-4.237 2.143-7.877 2.988-7.913 2.996z"}),(0,a.jsx)("path",{fill:"#000",d:"M10.645 65.706a.134.134 0 0 1-.049-.257c.01-.004.943-.373 5.404-2.433 4.44-2.05 6.144-3.905 6.16-3.923a.134.134 0 0 1 .233.082.13.13 0 0 1-.034.096c-.018.02-.44.485-1.425 1.212-.904.668-2.475 1.691-4.822 2.775-4.477 2.067-5.382 2.425-5.418 2.439a.1.1 0 0 1-.05.009z"}),(0,a.jsx)("path",{fill:"#fff",d:"M50.283 58.81s3.283-.905 3.753-.905c1.385 0 3.576.252 8.586 2.576s7.998 4.873 7.998 4.873l1.787 2.871s-4.786.614-11.346-1.927-9.828-5.3-9.828-5.3"}),(0,a.jsx)("path",{fill:"#000",d:"M70.994 68.424c-.49 0-1.099-.02-1.81-.077-1.849-.15-4.767-.607-8.17-1.925-1.876-.727-4.682-1.944-7.396-3.614-1.627-1.001-2.462-1.702-2.47-1.709a.133.133 0 0 1 .075-.235.13.13 0 0 1 .097.031c.008.007.833.698 2.445 1.69 1.487.915 3.97 2.28 7.345 3.588 3.374 1.307 6.265 1.76 8.096 1.908 1.5.123 2.55.067 2.975.032l-1.662-2.67c-.24-.2-3.202-2.638-7.953-4.842-2.251-1.044-4.093-1.748-5.63-2.15-1.392-.366-2.28-.413-2.9-.413-.37 0-2.809.65-3.717.9a.133.133 0 0 1-.07-.257c.337-.093 3.313-.91 3.787-.91 1.514 0 3.725.308 8.642 2.588a43 43 0 0 1 5.897 3.319c1.364.922 2.125 1.568 2.132 1.575q.016.013.027.03l1.787 2.872a.133.133 0 0 1-.097.202c-.032.004-.536.067-1.43.067"}),(0,a.jsx)("path",{fill:"#000",d:"M68.596 65.465h-.015c-.037-.005-3.757-.425-7.859-2.246-1.182-.525-2.909-1.369-4.417-2.409-.907-.626-1.301-1.022-1.317-1.038a.133.133 0 1 1 .19-.187c.015.015 1.6 1.592 5.653 3.39 4.061 1.804 7.742 2.22 7.779 2.225a.133.133 0 0 1-.014.266"})]}),o=e=>{let{acceptAttribute:t,dragDropCardInputChange:l,customStyle:o,multiple:d=!0,isEmptyView:c,labelStyle:m,cardLength:u,hiddenText:p,isRWFFileUpload:h}=e,{getRootProps:x,getInputProps:f}=(0,i.VB)({onDrop:e=>{l({target:{files:e}})},multiple:d,accept:t});return(0,a.jsx)(a.Fragment,{children:c?(0,a.jsxs)("div",{className:`flex justify-center flex-col  h-full max-sm:mb-24 items-center  dark:bg-dark-1 ${o||""}`,children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{children:(0,a.jsx)(n,{className:"w-4 h-4"})}),(0,a.jsx)("span",{className:"text-base font-semibold text-dark-5 dark:text-light-5",children:"No Files Found"})]}
4),(0,a.jsxs)("div",{...x(),className:`cursor-pointer bg-light-0 md:bg-transparent w-full max-w-full md:w-125 h-34.5 px-2 mt-3 dark:bg-dark-2 flex justify-center gap-3 items-center border-2 border-light-3 dark:border-dark-5 border-dashed rounded-lg transition-colors ${m}`,children:[(0,a.jsx)("input",{...f()}),(0,a.jsxs)("div",{className:(0,s.V7)("outline","sm","h-9.5 gap-2"),children:[(0,a.jsx)(r.A,{className:"w-4 h-4"}),(0,a.jsx)("span",{children:"Upload File"})]}),(0,a.jsx)("span",{className:"hidden md:block font-semibold text-sm text-dark-2 dark:text-light-0",children:"Or Drag and Drop here"})]})]}):(0,a.jsxs)("div",{...x(),className:` dark:bg-dark-3 w-full rounded-md cursor-pointer ${h?"h-[10vh]":"h-full "} flex items-center ${0===u&&"flex-row"||u>5&&"flex-row"||u>=1&&"flex-col"||"justify-center"} justify-center text-center gap-2 tracking-tight `,children:[(0,a.jsx)("input",{...f()}),(0,a.jsxs)("div",{className:(0,s.V7)("outline","sm","h-9.5 gap-2 shrink-0 ml-5 md:ml-0 mx-4 md:mx-0"),children:[(0,a.jsx)(r.A,{className:"w-4 h-4"}),(0,a.jsx)("span",{children:"Upload File"})]}),(0,a.jsx)("span",{className:"font-semibold text-dark-2 dark:text-light-0 text-sm hidden md:block",children:p?" Or Drag and Drop here":""})]})})}},76731:(e,t,l)=>{"use strict";l.d(t,{A:()=>z});var a=l(95155),r=l(12115),s=l(1213),i=l(64269),n=l(9554),o=l(62940),d=l(59963),c=l(62843),m=l(5016);let u=e=>{let{data:t,options:l,handleUpdate:s,handleRemove:u}=e,p=(0,i.dS)({firstName:t?.firstName,lastName:t?.lastName}
4),h=t?.accessRights||t?.accessDetails?.accessRights||"",[x,f]=(0,r.useState)(null),[g,b]=(0,r.useState)(!1),[j,w]=(0,r.useState)(!1),y=x??h,v=null!==x&&x!==h,k=async()=>{if(s&&v){b(!0);try{await s(y,t),f(null)}catch{}finally{b(!1)}}},N=async()=>{if(u){w(!0);try{await u(t)}catch{}finally{w(!1)}}};return(0,a.jsxs)("div",{className:"flex items-center justify-between bg-light-2 dark:bg-dark-3 h-17.5 rounded-xl dark:text-light-0 text-base gap-2 p-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 md:w-[50%]  ",children:[(0,a.jsx)(d.Ay,{user:t,size:"md",alt:"User",className:"border-2 border-dark-2"}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("div",{className:"font-semibold text-base",children:p||t?.email}),(0,a.jsx)("div",{className:"text-xs font-medium",children:t?.email})]})]}),(0,a.jsx)("div",{className:"flex items-center justify-end gap-2 md:w-[30%] w-[45%]",children:t?.accessRights==="Owner"?(0,a.jsx)(c.A,{tone:"accent",size:"sm",shape:"rounded",children:"Owner"}):s?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.A,{size:"sm",value:y,onChange:e=>f(e),options:l??[]}),v&&(0,a.jsx)(m.Ay,{variant:"yellow",size:"sm",type:"button",title:"Update",loading:g,onClick:k,className:"shrink-0"}),u&&(0,a.jsx)("button",{type:"button","aria-label":`Remove file access for ${p||t?.email}`,title:"Remove file access",disabled:j,onClick:N,className:"p-1.5 rounded-lg shrink-0 text-dark-6 hover:text-red-1 hover:bg-red-1/10 dark:hover:text-red-2 dark:hover:bg-red-2/10 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:(0,a.jsx)(n.A,{className:"w-4.5 h-4.5"})})]}):(0,a.jsx)(c.A,{tone:"neutral",size:"sm",shape:"rounded",children:(0,a.jsx)("span",{className:"capitalize",children:h||"view"})})})]})};var p=l(32184),h=l(39670),x=l(24287),f=l(50090),g=l(10194),b=l(36834),j=l(76799),w=l(86302),y=l(99553),v=l(48242),k=l(28079),N=l(52106),A=l(95157),I=l(29545),S=l(33922),C=l(3750),E=l(70631),D=l(61962),P=l(21980),T=l(69268),$=l(93952),F=l(48376),R=l(99857),L=l(74923);let M=["png","jpg","jpeg","gif","webp","bmp","svg","avif"],O=e=>(e=>{if(String(e?.fileType||"").startsWith("image"))return!0;let t=String(e?.fileName||"").split(".").pop()?.toLowerCase();return!!t&&M.includes(t)})(e)&&e?.fileS3Id?`${P.mn}${e.fileS3Id}`:e?.thumbnailS3Id?`${P.mn}${e.thumbnailS3Id}`:"",U=e=>String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),B=(e,t,l)=>`<img src="${U(e)}" width="${t}" alt="" style="display:block;width:${t}px;height:${l}px;object-fit:cover;" />`,z=()=>{let e=(0,s.wA)(),{isActivities:t,isDecision:l,isFeed:n,isDiscussion:c}=(0,I.A)(),{canEdit:M,canManageProject:z}=(0,L.A)(),{isQRModalOpen:q,selectedFileOrFolder:V,selectedPost:G}=(0,s.d4)(e=>e.contextMenu),{selectedProject:_,selectedProjectId:Q}=(0,s.d4)(e=>e.project),H=!!_?.currentUserAccess?.isExternal,{userDetails:W}=(0,s.d4)(e=>e.projects),{plan:X}=W,{successNotify:J,errorNotify:Y}=(0,k.A)(),K=X&&String(X).toUpperCase()||"FREE",Z=(_?.externalUsers??[]).filter(e=>e?.status!=="inactive"&&e?.status!=="requested"&&e?.status!=="rejected").length,[ee,et]=(0,r.useState)(!1),el=(0,E._S)(K),[ea,er]=(0,r.useState)("users"),es=e=>{er(e),et(!0)},[ei,en]=(0,r.useState)(!1),[eo,ed]=(0,r.useState)(!1),[ec,em]=(0,r.useState)({email:"",access:""}),[eu,ep]=(0,r.useState)(!0),eh=!H&&!(0,D.fj)(V),[ex,ef]=(0,r.useState)({}),eg=!!(ec.email&&_?.externalUsers?.some(e=>e?.status!=="inactive"&&e?.status!=="requested"&&e?.status!=="rejected"&&e?.email?.toLowerCase()===ec.email.toLowerCase())),eb=!eg&&(0,E.sk)(K,Z),ej=!!G?.postId&&(t||l||n||c),ew=ej?`${G?.postId}?type=post`:V?.fileId??"",ey=window.location.origin,ev=`${ey}/publicSharing/${ew}`,ek=ej?G?.postId:V?.fileId,eN=ej?G?.category:V?.fileCategory,[eA,{isLoading:eI}]=(0,$.nR)(),[eS]=(0,F.RG)(),eC=!ej&&V?.fileCategory==="Folder",{data:eE}=(0,C.MZ)(ek,{skip:!eC||!ek}),eD=(0,r.useMemo)(()=>eC?((e,t)=>{let l=[],a=e=>{if(Array.isArray(e))for(let r of e){if(l.length>=t)return;if(r?.fileCategory==="Folder"){a(r.children);continue}let e=O(r);e&&l.push(e)}};return a(e?.children),l})(eE?.body,4):[],[eE,eC]),eP=!!(_&&ek&&eN),eT=eP?`${ek}/'[email protected]'/${eN}`:void 0,{data:e$,error:eF,isLoading:eR,refetch:eL}=(0,S.Q3)({path:eT,projectId:_?.guid},{skip:!eP,refetchOnMountOrArgChange:!0}),[eM]=(0,S.cz)(),[eO]=(0,$.Sm)(),[eU,{isLoading:eB}]=(0,$.VB)(),[ez,{isLoading:eq}]=(0,$.Ri)(),eV=`${ey}/request-access/${ek??""}`,{data:eG,refetch:e_}=(0,$.u4)(_?.guid??"",{skip:!M||!_?.guid||ej,refetchOnMountOrArgChange:!0}),eQ=(eG?.requests??[]).map(e=>({req:e,file:e.requestedFiles?.find(e=>e.fileId===ek)})).filter(e=>!!e.file),eH=async t=>{if(!_?.guid||!t?.email||!ek)return void Y("Failed to remove file access. Please try again.");try{let l=await eO({projectId:_.guid,email:t.email,fileId:ek}).unwrap();J(l?.revoked?"File removed - the user has no shared files left, so their access was revoked.":"File removed from the user's access."),await eL();let a=await eS(Q??"");a?.data&&e((0,R.NR)(a?.data))}catch(e){throw Y("Failed to remove file access. Please try again."),e}},eW=async t=>{if(!_?.guid||!ek)return;if(el)return void es("externalCollab");let l=ex[t.publicAccessId]||"view";try{await eU({publicAccessId:t.publicAccessId,email:t.email,fileId:ek,projectId:_.guid,accessLevel:l}).unwrap(),J("Access approved."),await Promise.all([e_(),eL()]);let a=await eS(Q??"");a?.data&&e((0,R.NR)(a?.data))}catch(e){Y(e?.data?.error||"Failed to approve. Please try again.")}},eX=async e=>{if(ek)try{await ez({publicAccessId:e.publicAccessId,email:e.email,fileId:ek}).unwrap(),J("Request declined."),await e_()}catch(e){Y(e?.data?.error||"Failed to decline. Please try again.")}},eJ=async t=>{if(t.preventDefault(),el)return void es("externalCollab");if(eb)return void es("users");let l=W?.lastName?`${W.firstName} ${W.lastName}`:W?.firstName||"Project Admin",a={sharingProject:0,email:ec.email.toLowerCase(),projectId:_?.guid??"",role:"Unassigned",projectName:_?.projectName??"",senderName:l,notify:eu,sharedDetail
4s:{limitedAccess:!0,category:eN,sharedFileIds:{fileId:ek,sharedBy:W?.id,expiresAt:"1m",accessLevel:ec.access}}};try{let t=await eA(a).unwrap();if(t){em({email:"",access:""}),J(t?.data?.message||t?.message||"File shared successfully."),await eL();let l=await eS(Q??"");l?.data&&e((0,R.NR)(l?.data)),e5()}else console.log("PROJECT SETTING - CHECK response",t),Y("Sharing failed. Please try again.")}catch(t){let e=t?.data||t?.error||t;Y((0,i.hO)(e?.errors)||e?.message||"Sharing failed. Please try again.")}},eY=async e=>{let t=(e=>{let t,l=ej?G?.postDescription||"Shared post":V?.fileName||"Shared file",a=_?.projectName||"IDColab",r=eC?"View folder":ej?"View post":"View file";if(eC&&eD.length)t=(e=>{let t=e.slice(0,4),l=e=>`<table role="presentation" cellpadding="0" cellspacing="0" style="width:210px;max-width:100%;border-collapse:collapse;">${e}</table>`,a=e=>`<td width="105" style="padding:0;">${e}</td>`;return 1===t.length?B(t[0],210,105):l(2===t.length?`<tr>${a(B(t[0],105,105))}${a(B(t[1],105,105))}</tr>`:3===t.length?`<tr>${a(B(t[0],105,105))}${a(B(t[1],105,52)+B(t[2],105,52))}</tr>`:`<tr>${a(B(t[0],105,52))}${a(B(t[1],105,52))}</tr><tr>${a(B(t[2],105,52))}${a(B(t[3],105,52))}</tr>`)})(eD);else{let e=(()=>{let e=ej?G:V,t=O(e);return t||(e?.fileS3Id?`${P.mn}${e.fileS3Id}`:"")})();t=e?`<img src="${U(e)}" width="210" alt="" style="display:block;width:210px;max-width:100%;height:105px;object-fit:cover;" />`:'<div style="width:210px;max-width:100%;height:55px;background:#6d28d9;"></div>'}return`<a href="${U(e)}" style="display:inline-block;width:210px;max-width:100%;text-decoration:none;color:#0f172a;font-family:Arial,Helvetica,sans-serif;border:1px solid #e2e8f0;border-radius:8px;overflow:hidden;background:#ffffff;">${t}<table role="presentation" cellpadding="0" cellspacing="0" style="width:100%;border-collapse:collapse;"><tr><td style="padding:8px 10px;"><div style="font-size:10px;font-weight:bold;letter-spacing:.04em;color:#7c3aed;text-transform:uppercase;">Shared on IDColab</div><div style="font-size:13px;font-weight:bold;color:#0f172a;margin-top:3px;">${U(l)}</div><div style="font-size:11px;color:#64748b;margin-top:2px;">${U(a)}</div><div style="margin-top:8px;"><span style="display:inline-block;background:#6d28d9;color:#ffffff;font-size:11px;font-weight:bold;padding:5px 12px;border-radius:6px;">${r}</span></div></td></tr></table></a>`})(e);try{let l=window.navigator.clipboard,a=window.ClipboardItem;return l?.write&&a?await l.write([new a({"text/html":new Blob([t],{type:"text/html"}),"text/plain":new Blob([e],{type:"text/plain"})})]):await l.writeText(e),!0}catch{try{return await window.navigator.clipboard.writeText(e),!0}catch{return!1}}},eK=async()=>{await eY(ev),en(!0),setTimeout(()=>en(!1),2e3)},eZ=async()=>{await eY(eV)&&(ed(!0),setTimeout(()=>ed(!1),2e3))},e0=()=>{if(ej||!ec.email)return!1;let e=ec.email.toLowerCase();return(Array.isArray(e$)?e$.map(e=>String(e?.email||"").toLowerCase()):[]).includes(e)||e===String(V?.userDetails?.emailAddress||"").toLowerCase()},e1=async(e,t)=>{if(el&&"edit"!==e)return void es("permissions");
4let l=t?.publicAccessId||t?.accessDetails?.publicAccessId;if(!l||!t?.email)return void Y("Failed to update access. Please try again.");try{await eM({publicAccessId:l,email:t.email,newAccessRights:e,...t?.isExternalUser&&ek?{fileId:ek}:{}}).unwrap(),await eL(),J("Access updated successfully")}catch(e){throw Y("Failed to update access. Please try again."),e}},e2=()=>"pdf"===(0,i.QC)(V?.fileName)||V?.fileType==="zdoc"?y.Xo:y.Xo.filter(e=>"editor"!==e.value),e5=()=>{e((0,v.Ll)(!1))},e4="overflow-hidden rounded-xl border border-light-3 divide-y divide-light-3 dark:border-dark-4 dark:divide-dark-4",e3="flex items-center gap-2 bg-light-2 px-4 py-2.5 text-sm font-bold text-dark-2 dark:bg-dark-3 dark:text-light-0",e6=V?.userDetails,e7=G?.userDetails||G?.user,e8=ej?e7?.emailAddress||e7?.email||G?.user?.emailAddress||G?.user?.email:e6?.emailAddress||e6?.email,e9=ej?e7?{...e7,email:e8,accessRights:"Owner"}:void 0:e6?{...e6,email:e8,accessRights:"Owner"}:void 0;return(0,a.jsx)(h.A,{open:!0,onClose:e5,title:"Share",size:"lg",noBodyPadding:!0,dirty:!!ec.email,zClassName:"z-[2147483647]",children:(0,a.jsxs)("form",{onSubmit:eJ,className:"space-y-0 no-scrollbar",children:[(0,a.jsx)(T.A,{show:ee,onClose:()=>et(!1),currentPlan:X,limitType:ea}),(0,a.jsxs)("section",{className:`m-5 ${e4}`,children:[(0,a.jsxs)("h3",{className:e3,children:[(0,a.jsx)(x.A,{className:"w-4 h-4"})," Private sharing"]}),z&&(0,a.jsxs)("div",{className:"flex flex-col gap-3 p-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-end",children:[(0,a.jsxs)("div",{className:"flex flex-1 flex-col gap-1",children:[(0,a.jsxs)("label",{className:"flex items-center gap-2 text-base font-bold text-dark-2 dark:text-light-0",children:[(0,a.jsx)(f.A,{className:"w-5 h-5"}),"Invite by email"]}),(0,a.jsx)(N.Ay,{type:"email",name:"email",id:"email",value:ec.email,placeholder:"Enter the email address here...",onChange:e=>{let{name:t,value:l}=e.target;em({...ec,[t]:l})},required:!0})]}),(0,a.jsxs)("div",{className:"flex flex-row gap-2 md:w-64",children:[(0,a.jsx)("div",{className:"relative flex-1",children:(0,a.jsx)(o.A,{value:ec.access||"",onChange:e=>em({...ec,access:e}),placeholder:"Select access",options:e2()})}),(0,a.jsx)(m.Ay,{variant:"yellow",title:"Share",disabled:e0()||!el&&!!ec.email&&eb,loading:eI,type:"submit",className:"h-10 px-8! whitespace-nowrap shrink-0"})]})]}),e0()&&(0,a.jsx)("div",{className:"text-sm text-red-1 dark:text-red-2",children:"You can't share file with already existing users. Please use a different email address."}),ec.email&&!e0()&&(el?(0,a.jsxs)("div",{className:"text-sm text-red-1 dark:text-red-2",children:["External collaborators require a paid plan."," ",(0,a.jsx)("button",{type:"button",className:"underline font-medium",onClick:()=>es("externalCollab"),children:"View plans"})]}):eg?(0,a.jsx)("div",{className:"text-sm text-dark-6 dark:text-light-6",children:"This user already has access - sharing will just add this file to their existing access."}):eb?(0,a.jsxs)("div",{className:"text-sm text-red-1 dark:text-red-2",children:["External user limit reached for your plan."," ",(0,a.jsx)("button",{type:"button",className:"underline font-medium",onClick:()=>es("users"),children:"View plans"})]}):null),(0,a.jsx)(A.A,{checked:eu,onChange:e=>ep(e.target.checked),label:"Notify by email",labelClassName:"text-dark-3 dark:text-light-2"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 p-4",children:[(0,a.jsxs)("h4",{className:"flex items-center gap-2 font-bold text-dark-3 dark:text-light-0",children:[(0,a.jsx)(g.A,{className:"w-5 h-5"})," People with access"]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 max-h-50 overflow-y-auto no-scrollbar",children:[e9&&(0,a.jsx)(u,{data:e9}),Array.isArray(e$)&&e$?.map((e,t)=>(0,a.jsx)(u,{data:e,options:e2(),handleUpdate:M?e1:void 0,handleRemove:M&&e?.isExternalUser?eH:void 0},t))]})]}),!ej&&z&&eQ.length>0&&(0,a.jsxs)("div",{className:"flex flex-col gap-3 p-4",children:[(0,a.jsxs)("h4",{className:"flex items-center gap-2 font-bold text-dark-3 dark:text-light-0",children:[(0,a.jsx)(b.A,{className:"w-5 h-5"})," Pending requests"]}),(0,a.jsx)("div",{className:"flex flex-col gap-3 max-h-60 overflow-y-auto no-scrollbar",children:eQ.map(e=>{let{req:t}=e;return(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,a.jsx)(d.Ay,{src:t.fileS3Id||void 0,name:t.name,size:"md"}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"truncate text-sm font-semibold text-dark-2 dark:text-light-0",children:t.name}),(0,a.jsx)("p",{className:"truncate text-xs text-dark-6 dark:text-light-6",children:t.email})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,a.jsx)("div",{className:"w-28",children:(0,a.jsx)(o.A,{value:ex[t.publicAccessId]||"view",onChange:e=>ef(l=>({...l,[t.publicAccessId]:e})),placeholder:"Access",options:e2()})}
4),(0,a.jsx)(m.Ay,{variant:"yellow",size:"sm",title:"Approve",loading:eB,type:"button",onClick:()=>eW(t),className:"h-10 whitespace-nowrap"}),(0,a.jsx)(m.Ay,{variant:"outline",size:"sm",title:"Reject",loading:eq,type:"button",onClick:()=>eX(t),className:"h-10 whitespace-nowrap"})]})]},t.publicAccessId)})})]}),!ej&&(0,a.jsxs)("div",{className:"space-y-3 p-4",children:[(0,a.jsxs)("h4",{className:"flex items-center gap-2 font-bold text-dark-3 dark:text-light-0",children:[(0,a.jsx)(x.A,{className:"w-5 h-5"})," Private Share Link"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:eV,readOnly:!0,className:(0,N.jp)()}),(0,a.jsxs)(m.Ay,{variant:"outline",size:"sm",onClick:eZ,type:"button",className:"h-10 gap-2 shrink-0",children:[(0,a.jsx)(j.A,{className:"w-5 h-5"}),(0,a.jsx)("span",{className:"hidden md:inline",children:eo?"Copied":"Copy"})]})]})]})]}),eh&&(0,a.jsxs)("section",{className:`mx-5 mb-5 ${e4}`,children:[(0,a.jsxs)("h3",{className:e3,children:[(0,a.jsx)(w.A,{className:"w-4 h-4"})," Public sharing"]}),(0,a.jsxs)("div",{className:"space-y-3 p-4",children:[(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:ev,readOnly:!0,className:(0,N.jp)()}),(0,a.jsxs)(m.Ay,{variant:"outline",size:"sm",onClick:eK,type:"button",className:"h-10 gap-2 shrink-0",children:[(0,a.jsx)(j.A,{className:"w-5 h-5"}),(0,a.jsx)("span",{className:"hidden md:inline",children:ei?"Copied":"Copy"})]})]}),(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsx)(p.A,{baseUrl:ev})})]})]})]})})}},80675:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});var a=l(95155);l(12115);var r=l(56690);let s={light:"bg-light-2/80 dark:bg-dark-2/80",dark:"bg-dark-0/40",subtle:"bg-transparent"},i={none:"",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"},n=e=>{let{show:t=!0,label:l,scrim:n="light",rounded:o="none",className:d="",spinnerClassName:c="w-8 h-8"}=e;return t?(0,a.jsxs)("div",{role:"status",className:`absolute inset-0 z-10 flex flex-col items-center justify-center gap-3 backdrop-blur-[1px] ${s[n]} ${i[o]} ${d}`,children:[(0,a.jsx)(r.A,{className:c}),l&&(0,a.jsx)("p",{className:"text-sm font-medium text-dark-5 dark:text-light-5",children:l})]}):null}},82787:()=>{},83430:(e,t,l)=>{"use strict";l.d(t,{r:()=>a});let a={activities:"Activities",decisions:"Insights",discussions:"Discussions",drawings:"Drawings",panorama:"Panorama",renderings:"Renderings",images:"Images",sidebyside:"Side by Side",videos:"Videos",specifications:"Specifications",moodboard:"Mood Board","3dmodels":"3d Models",survey:"Survey",files:"Files",settings:"Settings"}},85478:(e,t,l)=>{"use strict";l.d(t,{h6:()=>n,jd:()=>o});var a=l(21980),r=l(69454);let s=new Map;async function i(e){let t={};if(e)return t.Authorization=`Bearer ${e}`,t;try{let{fetchAuthSession:e}=await l.e(64848).then(l.bind(l,64848)),a=await e(),r=a.tokens?.accessToken?.toString(),s=a.tokens?.idToken?.payload?.email;r&&(t.Authorization=`Bearer ${r}`),s&&(t.useremail=String(s))}catch{}return t}async function n(e,t,l){try{let r=`thumbs/${t}/${crypto.randomUUID()}`,s=await i(l);s["Content-Type"]="application/json";let n=await fetch(`${a.Mw}/filesandfolders/uploadpresignedurl`,{method:"POST",headers:s,body:JSON.stringify({fileName:r,fileType:"image/png"})});if(!n.ok)return null;let o=await n.json(),d=o?.presignedurl;if(!d||!(await fetch(d,{method:"PUT",headers:{"Content-Type":"image/png"},body:e})).ok)return null;return r}catch{return null}}async function o(e,t,l){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},{force:i=!1,crop:o,aroundCapture:d}=a,c=Date.now(),m=s.get(e)??0;if(i||!(c-m<6e4)){s.set(e,c);try{let a=()=>new Promise(e=>{try{let l=Array.from(t.querySelectorAll("canvas")),a=null,r=0;for(let e of l){let t=e.width*e.height;t>r&&(r=t,a=e)}if(!a||0===r)return void e(null);let s=o&&o.width>=1&&o.height>=1,i=Math.min(s?Math.round(o.width):a.width,a.width),n=Math.min(s?Math.round(o.height):a.height,a.height),d=document.createElement("canvas");d.width=i,d.height=n;let c=d.getContext("2d");if(!c)return void a.toBlob(t=>e(t),"image/png",.8);c.fillStyle="#ffffff",c.fillRect(0,0,i,n),c.drawImage(a,0,0,i,n,0,0,i,n),d.toBlob(t=>e(t),"image/png",.8)}catch{e(null)}}),s=d?await d(a):await a();if(!s)return;let i=await n(s,e,l);if(!i)return;await (0,r.kg)(e,{thumbnailS3Id:i},l)}catch{}}}},85883:(e,t,l)=>{"use strict";l.d(t,{A:()=>x});var a=l(95155),r=l(15239),s=l(1213),i=l(95343),n=l(86302),o=l(48242),d=l(21980),c=l(70631),m=l(64269),u=l(95157),p=l(12115),h=l(58515);let x=e=>{let{data:t,isMoveFlow:l,hideCheckBox:x}=e,f=(0,s.wA)(),[g,b]=(0,p.useState)(!1),{selectedIds:j}=(0,s.d4)(e=>e.contextMenu),w=Array.isArray(j)&&j.some(e=>e.fileId===t?.fileId);(0,p.useEffect)(()=>{let e=()=>{b(window.innerWidth<=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let y=(0,m.dS)(t?.userDetails)||t?.userDetails?.email||"Unknown",v=t?.thumbnailS3Id?`${d.mn}${t?.thumbnailS3Id}`:h.r4,[k,N]=(0,p.useState)(v);(0,p.useEffect)(()=>{N(t?.thumbnailS3Id?`${d.mn}${t?.thumbnailS3Id}`:h.r4)},[t?.thumbnailS3Id]);let A=t?.fileName||t?.name||t?.title||t?.fileLink||"Untitled",I=()=>{l||(f((0,o.V)(!1)),f((0,o.$j)(t)),f((0,o.qc)([])),f((0,o.q5)(!0)))};return(0,a.jsx)("div",{onClick:g?I:e=>{if(l)return;let a={fileId:t.fileId,fileName:t.fileName,parentFolderId:t.parentFolderId};f((0,o.$j)(t)),f((0,o.V)(!0)),e.ctrlKey||e.metaKey?f((0,o.RG)(a)):f((0,o.qc)([a]))},onDoubleClick:g?void 0:I,className:`group h-75 lg:w-full rounded-xl shadow-sm border-light-3 dark:border-dark-4 border-[1.5px] p-2.5 gap-4 overflow-hidden ${w?"border-2 border-dark-4 dark:bg-dark-2 dark:border-dark-4":"dark:bg-dark-3"}`,children:(0,a.jsxs)("div",{className:"h-full flex flex-col justify-between relative",children:[!x&&(0,a.jsx)("div",{className:`bg-light-0 p-2 border-light-3 border-2 rounded-lg dark:bg-light-1 flex justify-center items-center absolute top-0 left-0 transition-opacity duration-300 ${w?"opacity-100":"xl:opacity-0 xl:group-hover:opacity-100 opacity-100"}`,children:(0,a.jsx)(u.A,{"aria-label":`Select ${A}`,checked:w,onChange:()=>{let e={fileId:t.fileId,fileName:t.fileName,parentFolderId:t.parentFolderId};Array.isArray(j)&&j.some(e=>e.fileId===t.fileId)?0==(j?.length||0)-1&&(f((0,o.$j)(null)),f((0,o.V)(!1))):(f((0,o.$j)(t)),f((0,o.V)(!0))),f((0,o.RG)(e))},onClick:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),className:"transition-opacity duration-300"})}),!x&&(0,a.jsx)("button",{type:"button","aria-label":"More options",onClick:e=>{e.stopPropagation();let t=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!0,clientX:e.clientX,clientY:e.clientY});e.currentTarget.closest(".group")?.dispatchEvent(t)},className:`bg-light-0 p-1 rounded-lg dark:bg-light-1 flex justify-center items-center absolute top-0 right-0 cursor-pointer transition-opacity duration-300 ${w?"opacity-100":"xl:opacity-0 xl:group-hover:opacity-100 opacity-100"}`,children:(0,a.jsx)(i.A,{className:"w-5 h-5 text-dark-4"})}),(0,a.jsx)("div",{className:"w-full flex-1 min-h-0 rounded-xl",children:(0,a.jsx)(r.default,{src:k,width:550,height:550,alt:"img",className:"h-full w-full object-center object-cover rounded-xl",unoptimized:!0,onError:()=>N(h.r4)})}),(0,a.jsxs)("div",{className:"pt-2.5 rounded-b-md flex flex-col gap-2.5",children:[(0,a.jsx)("div",{className:"cursor-default flex items-center gap-2 overflow-hidden text-xs xl:text-base text-dark-2 dark:text-light-0",children:(0,a.jsxs)("span",{className:"flex w-full max-w-75 items-center gap-1.5 tracking-tight text-dark-2 font-bold text-base dark:text-light-0 lg:max-w-50 lg:text-sm",children:[(0,a.jsx)(n.A,{className:"h-4 w-4 shrink-0"}),(0,a.jsx)("span",{className:"min-w-0 truncate",children:A})]})}),(0,a.jsxs)("p",{className:"cursor-default text-xs text-dark-2 dark:text-light-0 tracking-tighter",children:["Created on: ",(0,c.d$)(t?.createdAt)," by ",y]})]})]})})}},87778:(e,t,l)=>{"use strict";l.d(t,{A:()=>p});var a=l(95155);l(12115);var r=l(93292),s=l(75513),i=l(88125),n=l(92302),o=l(5016),d=l(17815),c=l(33922),m=l(70631);let u={FREE:"If you ever need extra room, check out our Studio and Design Pro plans for up to 500 GB of storage.",BASIC:"If you ever need extra room, check out our Design Pro plan for up to 500 GB of storage."},p=e=>{let{className:t="",ownerUserId:l}=e,{userDetails:p}=(0,d.A)(),{data:h}=(0,c.ff)(l,{skip:!l}),x=!l||l===p?.id,f=x?p:h,g=(0,m.Eq)(f?.plan),b=f?.totalStorageUsed??0,j=g>0?b/g*100:0,w=j>=90,y=f?.startDate,v=String(f?.planType??f?.plantype??"").toLowerCase(),k=null;if(y&&("monthly"===v||"yearly"===v)){let e=new Date(y);isNaN(e.getTime())||(k=Math.ceil((("yearly"===v?(0,r.e)(e,1):(0,s.P)(e,1)).getTime()-Date.now())/864e5))}let N=null!==k&&k>=0&&k<=5,A=null!==k&&k<0;if(!w&&!N&&!A)return null;let I=String(f?.plan??"FREE").toUpperCase(),S="PREMIUM"===I,C=S?"You're on our largest plan, Design Pro. Contact us if you ever need a customized plan.":u[I]??u.FREE,E=x?"Your":"The project owner's",D=A?"border-red-1/40 bg-red-1/10":N?"border-yellow/40 bg-yellow/10":"border-blue-1/30 bg-blue-1/10",P=A?"text-red-1":N?"text-yellow":"text-blue-1";return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:`flex items-center gap-3 rounded-xl border p-3 ${D} ${t}`,children:[A||N?(0,a.jsx)(i.A,{className:`h-5 w-5 shrink-0 ${P}`}):(0,a.jsx)(n.A,{className:`h-5 w-5 shrink-0 ${P}`}),(0,a.jsxs)("div",{className:"flex-1 text-xs text-dark-2 dark:text-light-0",children:[w&&(0,a.jsxs)("p",{children:["Just a heads up, ",x?"you're":"the project owner is"," at"," ",(0,a.jsxs)("span",{className:"font-semibold",children:[Math.min(j,100).toFixed(0),"% capacity"]})," ","(",(0,m.z3)(b)," of ",(0,m.z3)(g),")."]}),N&&(0,a.jsxs)("p",{children:[E," plan ends in"," ",(0,a.jsxs)("span",{className:"font-semibold",children:[k," day",1===k?"":"s"]}),"."]}),A&&(0,a.jsxs)("p",{children:[E," plan has"," ",(0,a.jsx)("span",{className:"font-semibold",children:"expired"}),"."," ",x?"Renew to keep full access.":"Uploads to this project may be blocked until it's renewed."]}),(0,a.jsx)("p",{className:"font-semibold",children:C})]}),x&&(S?(0,a.jsx)("a",{href:"/contactUs",className:(0,o.V7)("outline","sm"),children:"Contact us"}):(0,a.jsx)("a",{href:"/dashboard/billing",className:(0,o.V7)("yellow","sm"),children:"Upgrade"}))]})})}},91275:(e,t,l)=>{"use strict";l.d(t,{$:()=>i,A:()=>n});var a=l(95155),r=l(29545),s=l(6243);let i=e=>{let{showSubPost:t=!0}=e;return(0,a.jsxs)("div",{className:"w-full bg-light-0 dark:bg-dark-3 border-b border-light-3 dark:border-dark-5",children:[(0,a.jsxs)("div",{className:"flex gap-4 p-2 xl:px-4",children:[(0,a.jsx)("div",{className:"relative shrink-0",children:(0,a.jsx)(s.A,{className:"size-12.5 rounded-full"})}),(0,a.jsxs)("div",{className:"flex-1 space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-1 flex-1",children:[(0,a.jsx)(s.A,{className:"h-4 rounded w-36"}),(0,a.jsx)(s.A,{className:"h-3 rounded w-24"})]}),(0,a.jsx)(s.A,{className:"h-6 w-16 rounded"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(s.A,{className:"h-4 rounded w-full"}),(0,a.jsx)(s.A,{className:"h-6 rounded w-1/4"})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(s.A,{className:"h-4 rounded w-full"}),(0,a.jsx)(s.A,{className:"h-4 rounded w-full"}),(0,a.jsx)(s.A,{className:"h-4 rounded w-3/4"})]}),t&&(0,a.jsx)(s.A,{className:"h-20 rounded-lg w-full"})]})]}),(0,a.jsxs)("div",{className:"flex gap-4 px-2 xl:px-4 pb-4",children:[(0,a.jsx)("div",{className:"w-12.5 shrink-0"}),(0,a.jsxs)("div",{className:"flex-1 space-y-3",children:[(0,a.jsx)(s.A,{className:"h-10 rounded-lg w-full"}),Array.from({length:2}).map((e,t)=>(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsx)(s.A,{className:"w-8 h-8 rounded-full shrink-0"}),(0,a.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,a.jsx)(s.A,{className:"h-3 rounded w-28"}),(0,a.jsx)(s.A,{className:"h-4 rounded w-full"}),(0,a.jsx)(s.A,{className:"h-4 rounded w-5/6"})]})]},t))]})]})]})},n=()=>{let{isDiscussion:e}=(0,r.A)();return(0,a.jsx)("div",{className:"h-[calc(100dvh-76px)] w-full flex flex-col items-center gap-4 overflow-auto no-scrollbar",children:[,,,].fill(1).map((t,l)=>(0,a.jsx)(i,{showSubPost:!e},l))})}},93952:(e,t,l)=>{"use strict";l.d(t,{NC:()=>c,Nq:()=>n,Ri:()=>g,SK:()=>h,Sm:()=>m,VB:()=>f,WA:()=>p,nR:()=>o,u4:()=>x});var a=l(21980),r=l(14012),s=l(61321),i=l(36317);let n=(0,s.xP)({reducerPath:"projectsApi",baseQuery:(0,i.cw)({baseUrl:a.Mw,prepareHeaders:r.GO}),endpoints:e=>({shareProjectAccess:e.mutation({query:e=>({url:"/projects/share-project-access",method:"POST",body:e})}),acceptInvite:e.query({query:e=>{let{publicAccessId:t,verify:l}=e;return{url:`/projects/invite/${t}`+("boolean"==typeof l?`?verify=${l}`:""),method:"GET"}}}),revokeExternalAccess:e.mutation({query:e=>({url:"/projects/share-project-access",method:"DELETE",body:e})}),accessCheck:e.query({query:e=>({url:"/projects/access-check",params:{fileId:e}})}),createAccessRequest:e.mutation({query:e=>({url:"/projects/access-request",method:"POST",body:e})}),listAccessRequests:e.query({query:e=>({url:"/projects/access-request",params:{projectId:e}})}),approveAccessRequest:e.mutation({query:e=>({url:"/projects/access-request/approve",method:"POST",body:e})}),rejectAccessRequest:e.mutation({query:e=>({url:"/projects/access-request/reject",method:"POST",body:e})})})}),{useShareProjectAccessMutation:o,useAcceptInviteQuery:d,useLazyAcceptInviteQuery:c,useRevokeExternalAccessMutation:m,useAccessCheckQuery:u,useLazyAccessCheckQuery:p,useCreateAccessRequestMutation:h,useListAccessRequestsQuery:x,useApproveAccessRequestMutation:f,useRejectAccessRequestMutation:g}=n},96663:(e,t,l)=>{"use strict";l.d(t,{A:()=>ep});var a=l(95155),r=l(12115),s=l(1213),i=l(64269),n=l(97412),o=l(11929),d=l(9779),c=l(10195),m=l(3914),u=l(41286),p=l(71781),h=l(43466),x=l(28815),f=l(11636),g=l(56690),b=l(48878),j=l(43569),w=l(66716),y=l(15239),v=l(5016),k=l(52106),N=l(95157);let A=(0,l(67909).default)(()=>Promise.all([l.e(61831),l.e(89367),l.e(90315),l.e(19323),l.e(63316),l.e(94431)]).then(l.bind(l,94431)),{loadableGenerated:{webpack:()=>[94431]},ssr:!1}),I=e=>{let{teamMembers:t,acceptAttribute:l,handleImageUpload:i,uploadData:o,handleTag
4Change:d,handlePostDescriptionChange:c,setUploadData:u,updatePost:p,handleFeedCheckBox:h,handleBlockerCheckBox:x,attentionEmails:I,handleRemovePost:S,attentionError:C}=e,{isEditPost:E}=(0,b.A)(),{activeCategory:D}=(0,s.d4)(e=>e.fileExplorer),P=E?p?.category:D,T=(0,r.useRef)(null),$=(0,r.useRef)(null),F=(0,r.useRef)(null),[R,L]=(0,r.useState)(null),[M,O]=(0,r.useState)(!1);(0,r.useEffect)(()=>{L(null),u(e=>({...e,postDescription:"",thumbnail:null,isBlocker:0,isFeed:1,posts:[],taggedUser:[]}))},[]),(0,r.useEffect)(()=>{F.current=o?.thumbnail},[o?.thumbnail]),(0,r.useEffect)(()=>()=>{R&&URL.revokeObjectURL(R)},[R]);let U=(0,r.useCallback)(()=>{let e=$.current;e&&(O(!0),requestAnimationFrame(()=>{try{let t=e.toDataURL();if(!t||"data:,"===t)return;let l=t.split(","),a=l[0].match(/:(.*?);/)?.[1]||"image/png",r=atob(l[1]),s=r.length,i=new Uint8Array(s);for(let e=0;e<s;e++)i[e]=r.charCodeAt(e);let n=new Blob([i],{type:a});u(e=>({...e,thumbnail:{file:n,fileName:"model-thumbnail.png",fileType:"image/png"}}))}catch(e){console.error("Failed to capture model thumbnail:",e)}finally{O(!1)}}))},[u]);(0,r.useEffect)(()=>{if(!R)return;let e=$.current;if(!e)return;let t=()=>{F.current||requestAnimationFrame(()=>U())};return e.addEventListener("load",t),()=>e.removeEventListener("load",t)},[R,U]);let B=(0,r.useCallback)(e=>{S(e),L(null)},[S]),{getRootProps:z,getInputProps:q}=(0,f.VB)({onDrop:e=>{(e=>{if(i(e,{category:P}),e.target.files){let t=Array.from(e.target.files)[0];o.postDescription||u(e=>({...e,postDescription:t?.name?.replace(/\.[^/.]+$/,"")||""})),(e=>{let t=e.split(".").pop()?.toLowerCase();return"glb"===t||"gltf"===t})(t?.name||"")?(R&&URL.revokeObjectURL(R),L(URL.createObjectURL(t))):L(null)}})({target:{files:e}})},multiple:!1,accept:l}),V=E?p:o;return(0,a.jsx)("div",{className:"w-full  flex flex-col gap-4",children:(0,a.jsxs)("div",{className:"w-full h-full  gap-5   flex md:flex-row flex-col  p-5",children:[(0,a.jsxs)("div",{...P!==n.b7.ThreeDModels||P===n.b7.ThreeDModels&&!R?z():{},className:"flex flex-col xl:w-[641px] max-xl:w-full md:h-135.5 h-[185px] justify-center items-center dark:bg-dark-3 bg-light-0 border-2 border-dashed border-light-3 dark:border-dark-5 rounded-lg overflow-hidden",children:[!(P===n.b7.ThreeDModels&&R)&&(0,a.jsx)("input",{...q()}),R?(0,a.jsxs)("div",{className:"flex flex-col w-full h-full",children:[(0,a.jsx)(A,{}),(0,a.jsx)("div",{className:"flex-1 relative overflow-hidden min-h-0",children:(0,a.jsx)("model-viewer",{ref:$,src:R,"camera-controls":!0,"camera-orbit":"0deg 75deg auto",bounds:"tight","environment-image":"neutral",exposure:"1","shadow-intensity":"1",style:{width:"100%",height:"100%"}})}),(0,a.jsx)("div",{className:"flex justify-center pb-2 shrink-0",children:(0,a.jsx)(v.Ay,{variant:"yellow",size:"sm",type:"button",title:"Update Thumbnail",onClick:e=>{e.stopPropagation(),U()},className:"h-9"})}),(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 px-3 py-2 pb-4 text-dark-2 dark:text-light-1 shrink-0",children:[(0,a.jsx)("span",{className:"text-base truncate",children:V.posts[0]?.fileName}),(0,a.jsx)("button",{type:"button","aria-label":"Remove file",onClick:e=>{e.stopPropagation(),B(0)},className:"cursor-pointer shrink-0",children:(0,a.jsx)(j.A,{className:"w-5 h-5 rounded-full bg-light-6 text-light-0"})})]})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-3.5 items-center justify-center",children:[(0,a.jsxs)("div",{className:"flex gap-3.5 items-center",children:[(0,a.jsxs)("div",{className:(0,v.V7)("outline","sm","h-9.5 gap-2"),children:[(0,a.jsx)(w.A,{className:"w-4 h-4"}),(0,a.jsx)("span",{children:"Upload File"})]}),(0,a.jsx)("span",{className:"cursor-pointer font-semibold text-dark-2 dark:text-light-0 hidden md:block",children:"Or Drag and Drop here"})]}),V.posts.length>0?V.posts.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 text-dark-2 dark:text-light-1",children:[(0,a.jsx)("span",{className:"text-center flex-1",children:e?.fileName}),(0,a.jsx)("button",{type:"button","aria-label":"Remove file",onClick:()=>B(t),className:"cursor-pointer shrink-0",children:(0,a.jsx)(j.A,{className:"w-5 h-5 rounded-full bg-light-6 text-light-0"})})]},t)):(0,a.jsx)("div",{className:"hidden md:flex text-xs content-center text-dark-5 dark:text-light-1 justify-center items-center text-center w-100 lg:w-[441px] max-w-full",children:P===n.b7.ThreeDModels?"Supported: glTf and glb":`Supported: mp4, mkv, webm, flv, vod,
5                           avi, mov, wmv, amv, m4p, mpeg, mpg, 4mv, ts, mp3,
6                           m4v, ogg, wav`})]})]}),(0,a.jsxs)("div",{className:" xl:w-[379px] xl:h-135.5 flex flex-col justify-start  gap-5 lg:w-[35%] w-full h-full max-h-[60vh] overflow-y-auto scrollbar-none md:max-h-none md:overflow-visible ",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("h3",{className:k.I8,children:"Thumbnail (Optional)"}),(0,a.jsxs)("div",{className:"flex flex-col items-start max-xl:items-center w-full rounded-xl border-2 border-dashed text-sm border-light-3 dark:bg-dark-3 bg-light-0 relative overflow-hidden",children:[(0,a.jsx)("input",{type:"file",accept:"image/*",id:"thumbnail-upload",className:"hidden",onChange:e=>{let t=e.target.files?.[0];t&&u(e=>({...e,thumbnail:{file:t,fileName:t.name,fileType:t.type}}))},ref:T}),(0,a.jsx)("div",{className:"relative w-full  h-50 flex items-center justify-center overflow-hidden rounded-xl",children:M?(0,a.jsx)("div",{className:"flex items-center justify-center w-full h-full",children:(0,a.jsx)(g.A,{})}):o?.thumbnail?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(y.default,{src:URL.createObjectURL(o.thumbnail.file),width:400,height:200,alt:"Thumbn
6ail Preview",className:"w-full h-full object-cover"}),(0,a.jsx)("button",{type:"button","aria-label":"Remove thumbnail",title:"Remove",onClick:()=>{u(e=>({...e,thumbnail:null})),T.current&&(T.current.value="")},className:"absolute bottom-3 right-3 h-9 w-9 rounded-lg bg-light-0 text-red-1 border border-light-3 shadow-md flex items-center justify-center cursor-pointer",children:(0,a.jsx)(j.A,{className:"w-4 h-4"})})]}):(0,a.jsx)("label",{htmlFor:"thumbnail-upload",className:"flex flex-col items-center justify-center cursor-pointer gap-2",children:(0,a.jsxs)("div",{className:(0,v.V7)("outline","sm","h-9.5 gap-2"),children:[(0,a.jsx)(w.A,{className:"w-4 h-4"}),(0,a.jsx)("span",{children:"Upload Image"})]})})})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 mb-0",children:[(0,a.jsx)("label",{htmlFor:"postDescription",className:k.I8,children:"Post Description (Optional)"}),(0,a.jsx)("textarea",{id:"postDescription",rows:5,value:V?.postDescription,onChange:e=>{c(e)},className:(0,k.jp)("default","md","h-25 py-2 resize-none"),placeholder:"Enter description here"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 mb-0",children:[(0,a.jsx)("label",{htmlFor:"Select audience",className:k.I8,children:"Attention (Optional)"}),(0,a.jsx)(m.A,{teamMembers:t,value:I,onChange:d,name:"colors",isClearable:!0,maxMenuHeight:200,placeholder:"Select audience"}),C&&(0,a.jsx)("p",{className:"text-red-2 text-sm font-medium",children:C})]}),(0,a.jsxs)("div",{className:"border p-3 py-0 h-9.5  border-light-2 dark:border-dark-4  flex flex-row items-center gap-4 roun
6ded-xl bg-light-2  dark:bg-dark-2",children:[(0,a.jsx)("div",{className:"w-[181px] h-9.5",children:(0,a.jsxs)("label",{className:"h-10 gap-2 flex items-center cursor-pointer select-none text-dark-2 dark:text-light-0",children:[(0,a.jsx)(N.A,{checked:V?.isBlocker===1,onChange:x}),(0,a.jsx)("div",{className:"text-dark-2 text-sm font-semibold dark:text-light-0",children:"Blocker"})]})}),(0,a.jsx)("span",{className:"h-5 w-px bg-light-3 dark:bg-dark-4"}),(0,a.jsx)("div",{className:"w-[181px] h-9.5 flex  justify-start",children:(0,a.jsxs)("label",{className:"gap-2 h-10 flex items-center cursor-pointer select-none text-dark-2 dark:text-light-0",children:[(0,a.jsx)(N.A,{checked:V?.isFeed===1,onChange:h}),(0,a.jsx)("div",{className:"text-dark-2 text-sm font-semibold dark:text-light-0",children:"Feeds"})]})})]})]})]})})};var S=l(80675),C=l(48242),E=l(45193),D=l(9084),P=l(28079),T=l(17815),$=l(51575),F=l(42302),R=l(70631),L=l(61962),M=l(69268),O=l(87778),U=l(39670),B=l(64030),z=l(67528),q=l(51884),V=l(36652),G=l(7496),_=l.n(G);function Q(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#x([0-9a-fA-F]+);/g,(e,t)=>String.fromCodePoint(parseInt(t,16))).replace(/&#(\d+);/g,(e,t)=>String.fromCodePoint(parseInt(t,10))).replace(/&amp;/g,"&")}function H(e,t){let l=`${e}${t}`.split("/"),a=[];for(let e of l)""!==e&&"."!==e&&(".."===e?a.pop():a.push(e));return a.join("/")}async function W(e){let t,l=(await _().loadAsync(e)).file("word/document.xml");if(!l)throw Error("Not a valid .docx file (missing word/document.xml)");let a=await l.async("string"),r=/<w:p[ >]([\s\S]*?)<\/w:p>/g,s="",i=[],n=[],o=!1;for(;null!==(t=r.exec(a));){let e=t[1],l=Array.from(e.matchAll(/<w:r\b([^>]*?)(?:\/>|>([\s\S]*?)<\/w:r>)/g)).map(e=>e[2]??"").filter(e=>""!==e);for(let t of(0===l.length&&/<w:t\b/.test(e)&&(l=[e]),l)){let e=function(e){let t,l="",a=/<w:t[^>]*>([\s\S]*?)<\/w:t>|<w:br\b[^>]*\/>|<w:tab\b[^>]*\/>/g;for(;null!==(t=a.exec(e));)t[0].startsWith("<w:t")?l+=Q(t[1]??""):t[0].startsWith("<w:br")?l+="\n":l+="	";return l}(t);if(!e)continue;e.trim()&&(o=!0);let l=function(e){let t=e.match(/<w:rPr>([\s\S]*?)<\/w:rPr>/);if(!t)return null;let l=t[1],a=e=>{let t=l.match(RegExp(`<w:${e}\\b([^>]*)\\/>`));if(!t)return!1;let a=t[1].match(/\bw:val="([^"]*)"/);return!a||!/^(false|0|off)$/i.test(a[1])},r=l.match(/<w:u\b([^>]*)\/>/),s=!!r&&!/\bw:val="none"/i.test(r[1]??""),i={};return a("b")&&(i.bl=1),a("i")&&(i.it=1),s&&(i.ul={s:1}),Object.keys(i).length?i:null}(t),a=s.length;s+=e,l&&n.push({st:a,ed:s.length,ts:l})}i.push({startIndex:s.length}),s+="\r"}if(0===i.length||!o)throw Error("No extractable text found in document");return{body:{dataStream:s+="\n",paragraphs:i,...n.length?{textRuns:n}:{}},documentStyle:{pageSize:{width:595,height:842},documentFlavor:1,marginTop:72,marginBottom:72,marginLeft:90,marginRight:90}}}async function X(e){let t=e.file("xl/workbook.xml"),l=e.file("xl/_rels/workbook.xml.rels");if(!t||!l)return null;let[a,r]=await Promise.all([t.async("string"),l.async("string")]),s=new Map;for(let e of r.matchAll(/<Relationship\s+Id="([^"]+)"[^>]*Target="([^"]+)"/g))s.set(e[1],e[2]);let i=[];for(let e of a.matchAll(/<sheet\b[^>]*\/?>/g)){let t=e[0],l=t.match(/\bname="([^"]*)"/),a=t.match(/\br:id="([^"]*)"/);if(!l||!a)continue;let r=s.get(a[1]);if(!r)continue;let n=r.startsWith("/")?r.slice(1):H("xl/",r);/^xl\/worksheets\/[^/]+\.xml$/.test(n)&&i.push({name:Q(l[1]),path:n})}return i.length?i:null}let J={1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"mm-dd-yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0"};async function Y(e){let t=e.file("xl/styles.xml");if(!t)return[];let l=await t.async("string"),a=new Map;for(let e of l.matchAll(/<numFmt\b[^>]*numFmtId="(\d+)"[^>]*formatCode="([^"]*)"/g))a.set(parseInt(e[1],10),Q(e[2]));let r=l.match(/<cellXfs\b[^>]*>([\s\S]*?)<\/cellXfs>/);return r?Array.from(r[1].matchAll(/<xf\b([^>]*?)\/?>/g)).map(e=>{let t=e[1].match(/\bnumFmtId="(\d+)"/);var l=t?parseInt(t[1],10):0;if(0===l||49===l)return null;let r=a.get(l);return void 0!==r?r.trim()&&!/^general$/i.test(r.trim())?r:null:J[l]??null}):[]}async function K(e){let t=await _().loadAsync(e),l=[],a=t.file("xl/s
6haredStrings.xml");if(a)for(let e of Array.from((await a.async("string")).matchAll(/<si>([\s\S]*?)<\/si>/g))){let t=Array.from(e[1].matchAll(/<t[^>]*>([\s\S]*?)<\/t>/g));l.push(t.map(e=>Q(e[1])).join(""))}let r=await Y(t),s=await X(t);if(!s){let e=t.file("xl/worksheets/sheet1.xml")||t.file("xl/worksheets/Sheet1.xml")||Object.values(t.files).find(e=>/xl\/worksheets\/.*\.xml$/.test(e.name)&&!e.dir)||null;if(!e)throw Error("Not a valid .xlsx file (no worksheet found)");s=[{name:"Sheet1",path:e.name}]}let i=[],n={},o=0;for(let e=0;e<s.length;e++){let a=s[e],d=t.file(a.path);if(!d)continue;let c=function(e,t,l){let a={},r=0,s=0,i=0;for(let n of Array.from(e.matchAll(/<row\b[^>]*>([\s\S]*?)<\/row>/g)))for(let e of Array.from(n[1].matchAll(/<c\b([^>]*?)(?:\/>|>([\s\S]*?)<\/c>)/g))){let n=e[1],o=e[2]??"",d=n.match(/\br="([A-Z]+\d+)"/);if(!d)continue;let c=d[1],m=n.match(/\bt="([^"]*)"/),u=m?m[1]:"",p=n.match(/\bs="(\d+)"/),h=p?l[parseInt(p[1],10)]??null:null,x=o.match(/<v>([\s\S]*?)<\/v>/),f=o.match(/<is>[\s\S]*?<t[^>]*>([\s\S]*?)<\/t>/);if(!x&&!f)continue;let g="";if(f)g=Q(f[1]);else if(x){let e=x[1];if("s"===u)g=t[parseInt(e,10)]??e;else if("str"===u||"inlineStr"===u)g=Q(e);else{let t=Number(e);g=Number.isNaN(t)?Q(e):t}}if(""===g)continue;let b=Math.max(0,parseInt(c.replace(/[A-Za-z]/g,"")||"1",10)-1),j=function(e){let t=e.replace(/[0-9]/g,""),l=0;for(let e=0;e<t.length;e++)l=26*l+(t.charCodeAt(e)-64);return l-1}(c);b>r&&(r=b),j>s&&(s=j);let w=o.match(/<f(\s[^>]*)?\/?>/),y=o.match(/<f(?:\s[^>]*)?>([\s\S]*?)<\/f>/),v="normal"===(w?.[1]?.match(/\bt="([^"]*)"/)?.[1]??"normal")&&y?Q(y[1]).trim():"",k={v:g};v&&(k.f=v.startsWith("=")?v:`=${v}`),h&&(k.s={n:{pattern:h}}),a[b]||(a[b]={}),a[b][j]=k,i++}return{cellData:a,rowCount:Math.max(r+1,20),columnCount:Math.max(s+1,10),cellCount:i}}(await d.async("string"),l,r);o+=c.cellCount;let m=`sheet-${String(e+1).padStart(2,"0")}`;i.push(m),n[m]={id:m,name:a.name||`Sheet${e+1}`,cellData:c.cellData,rowCount:c.rowCount,columnCount:c.columnCount}}if(0===i.length)throw Error("Not a valid .xlsx file (no worksheet found)");if(0===o)throw Error("No extractable cell values found in workbook");return{sheetOrder:i,sheets:n}}var Z=l(97721);let ee={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp"};async function et(e){let t=await _().loadAsync(e),l=t.file("ppt/presentation.xml");if(!l)throw Error("Not a valid .pptx file (missing ppt/presentation.xml)");let a=await l.async("string"),r=960,s=540,i=a.match(/<p:sldSz[^>]+cx="(\d+)"[^>]+cy="(\d+)"/);i&&(r=Math.round(parseInt(i[1],10)/9144),s=Math.round(parseInt(i[2],10)/9144));let n=Z.Zg,o=Math.round(s/r*n),d=n/r,c=t.file("ppt/_rels/presentation.xml.rels"),m=c?await c.async("string"):"",u=new Map;for(let e of m.matchAll(/<Relationship\s+Id="([^"]+)"[^>]*Target="([^"]+)"/g))u.set(e[1],e[2]);let p=Array.from(a.matchAll(/<p:sldId[^>]+r:id="([^"]+)"/g)).map(e=>e[1]).map(e=>u.get(e)).filter(e=>!!e).map(e=>H("ppt/",e));if(0===p.length&&(p=Object.keys(t.files).filter(e=>/^ppt\/slides\/slide\d+\.xml$/.test(e)).sort((e,t)=>parseInt(e.match(/slide(\d+)\.xml/)[1],10)-parseInt(t.match(/slide(\d+)\.xml/)[1],10))),0===p.length)throw Error("No slides found in presentation");let h=[];for(let e of p){let l=t.file(e);if(!l)continue;let a=await l.async("string"),r=[];for(let e of a.matchAll(/<p:sp>([\s\S]*?)<\/p:sp>/g)){let t=e[1],l=t.match(/<a:off x="(-?\d+)" y="(-?\d+)"/),a=t.match(/<a:ext cx="(\d+)" cy="(\d+)"/);if(!l||!a)continue;let s=Math.round(parseInt(l[1],10)/9144*d),i=Math.round(parseInt(l[2],10)/9144*d),n=Math.round(parseInt(a[1],10)/9144*d),o=Math.round(parseInt(a[2],10)/9144*d),c=t.match(/<a:srgbClr val="([0-9A-Fa-f]{6})"/),m=Array.from(t.matchAll(/<a:p>([\s\S]*?)<\/a:p>/g)).map(e=>Array.from(e[1].matchAll(/<a:t\b[^>]*?(?:\/>|>([\s\S]*?)<\/a:t>)/g)).map(e=>Q(e[1]??"")).join("")).join("\n").trim();if(!m){r.push((0,Z.Au)("rect",{x:s,y:i,width:n,height:o,fill:c?`#${c[1]}`:"#e2e8f0",stroke:"#94a3b8",strokeWidth:2,cornerRadius:0}));continue}let u=t.match(/<a:sz val="(\d+)"/),p=u?Math.max(8,Math.round(parseInt(u[1],10)/100*d)):void 0,h=c?`#${c[1]}`:void 0,x=/<a:b\/>
6|<a:b\s+val="1"/.test(t);r.push((0,Z.cS)({x:s,y:i,width:n,height:o,text:m,...p?{fontSize:p}:{},...h?{fill:h}:{},...x?{fontStyle:"bold"}:{}}))}let s=e.slice(0,e.lastIndexOf("/")+1),i=`${s}_rels/${e.slice(s.length)}.rels`,n=t.file(i),o=n?await n.async("string"):"",c=new Map;for(let e of o.matchAll(/<Relationship\s+Id="([^"]+)"[^>]*Target="([^"]+)"/g))c.set(e[1],e[2]);for(let e of a.matchAll(/<p:pic>([\s\S]*?)<\/p:pic>/g)){let l=e[1],a=l.match(/<a:off x="(-?\d+)" y="(-?\d+)"/),i=l.match(/<a:ext cx="(\d+)" cy="(\d+)"/),n=l.match(/r:embed="([^"]+)"/);if(!a||!i||!n)continue;let o=c.get(n[1]);if(!o)continue;let m=H(s,o),u=t.file(m);if(!u)continue;let p=ee[(m.split(".").pop()||"").toLowerCase()];if(!p)continue;let h=await u.async("base64"),x=Math.round(parseInt(a[1],10)/9144*d),f=Math.round(parseInt(a[2],10)/9144*d),g=Math.round(parseInt(i[1],10)/9144*d),b=Math.round(parseInt(i[2],10)/9144*d);r.push((0,Z.g0)(`data:${p};base64,${h}`,{x,y:f,width:g,height:b}))}h.push({id:(0,Z.Si)("sl"),background:{type:"solid",color:"#ffffff"},elements:r})}if(0===h.length)throw Error("No slides could be imported");return{id:(0,Z.Si)("deck"),title:"Untitled",width:n,height:o,slides:h}}var el=l(9970),ea=l(61330),er=l(69454),es=l(85478);async function ei(e){let{createUniverDoc:t,docKind:l,content:a,projectId:r,parentFolderId:s,userId:i,displayName:n,category:o,fileName:d,thumbnailBlob:c}=e;try{let e=await t({projectId:r,parentFolderId:s,userId:i,displayName:n,category:o,docKind:l}).unwrap(),m=e?.fileId,u=e?.fileType;if(!m||!u)throw Error("create returned no fileId");let p=await (0,ea.G)(m);if(!p.putUrl)throw Error("create session returned no write url");let h=d.replace(/\.[^./]+$/,""),x="slide"===l?(0,Z.Q9)({...a,id:m,title:h}):(0,el.EK)(l,a),f=JSON.stringify(x),g=await fetch(p.putUrl,{method:"PUT",headers:{"Content-Type":"application/json"},body:f});if(!g.ok)throw Error(`Snapshot save failed: ${g.status}`);let b=c?await (0,es.h6)(c,m):null;return await (0,er.kg)(m,{fileName:h,fileSize:new Blob([f]).size,...b?{thumbnailS3Id:b}:{}}),{fileId:m,fileType:u}}catch(e){return console.error(`Office import: could not create ${d} as ${l}`,e),null}}let en={docx:"doc",xlsx:"sheet",pptx:"slide"},eo=async(e,t)=>{try{if("doc"===t)return{docKind:t,content:await W(e)};if("sheet"===t)return{docKind:t,content:await K(e)};if("slide"===t)return{docKind:t,content:await et(e)};return null}catch(l){return console.warn(`Office import: could not parse ${e.name} as ${t}`,l),null}};var ed=l(27185),ec=l(3750),em=l(4068);let eu=new Set(["pptx","ppt","docx","doc","xlsx","xls"]),ep=e=>{let{folders:t,files:l,links:f}=e,{uploadType:g,isEditPost:j,isAddEditModalOpen:w}=(0,b.A)(),{fetchBlockerCount:y}=(0,z.A)(),{selectedFileOrFolder:A,postViewModal:G}=(0,s.d4)(e=>e.contextMenu),{selectedProject:_}=(0,s.d4)(e=>e.project),{activeCategory:Q}=(0,s.d4)(e=>e.fileExplorer),H=_?.teamMembers.filter(e=>e?.status!=="inactive"),{currentPost:W,navigationPath:X}=(0,s.d4)(e=>e.category),[J,Y]=(0,r.useState)(j?W?.category:Q),[K,Z]=(0,r.useState)("ROOT");(0,r.useEffect)(()=>{Y(j?W?.category:Q)},[j,W,Q]),(0,r.useEffect)(()=>{let e="ROOT";W&&Object.keys(W).length>0?e=W.parentFolderId||"ROOT":A?e=A.fileCategory===n.NL.FOLDER?A.fileId:A.parentFolderId||"ROOT":X&&X.length>0&&(e=X[X.length-1]?.fileId),Z(e)},[W,A,X]);let ee={...W,parentFolderId:K,isBlocker:W?.isBlocker??0,isFeed:W?.isFeed??1},[et,el]=(0,r.useState)(ee),[ea,er]=(0,r.useState)([]),[es,ep]=(0,r.useState)([]),{successNotify:eh,errorNotify:ex,infoNotify:ef}=(0,P.A)(),{refetch:eg}=(0,$.A)(Q??""),{userDetails:eb}=(0,T.A)(),ej=(0,s.wA)(),ew=String(_?.guid),ey=eb?.id,ev={userId:ey,projectId:ew,category:J,fileCategory:n.NL.FILES,postId:(0,o.A)(),postDescription:"",isBlocker:0,isFeed:1,posts:[],taggedUser:[],mentionedUserIds:[],parentFolderId:K||"ROOT",parentPostId:""},ek=J==n.b7.ThreeDModels?{"application/gzip":[".gltf",".glb"]}:J==n.b7.Videos?{"video/*":[".mp4",".mpeg",".avi"]}:J==n.b7.DRAWINGS?{"application/pdf":[".pdf"],"image/*":[],...L.xn}:J===n.b7.SPECIFICATION||J===n.b7.RENDERINGS?{"application/pdf":[".pdf"],"image/*":[]}:J===n.b7.FILES?{"application/pdf":[".pdf"],"image/*":[],"application/msword":[".doc"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/vnd.ms-excel":[".xls"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":[".xlsx"],"application/vnd.ms-powerpoint":[".ppt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":[".pptx"]}:J===n.b7.MOODBOARD?{"application/pdf":[".pdf"],"image/*":[]}:{"image/*":[]},eN=()=>{ej((0,C.ll)("")),ej((0,C.ob)(!1)),ej((0,C.$j)("")),ej((0,F.e9)({})),er([]),ej((0,C.fd)(!1)),eJ(null),el(null),eW([]),eE(ev),ts.current.clear()},eA=J===n.b7.Videos||J===n.b7.ThreeDModels,eI=document.documentElement.classList.contains("dark"),eS={container:e=>({...e,width:"100%"}),control:e=>({...e,backgroundColor:"transparent",border:"none",boxShadow:"none",padding:"0",minHeight:"auto"}),valueContainer:e=>({...e,padding:"8px 12px"}),input:e=>({...e,color:eI?"var(--color-light-0)":"var(--color-dark-3)",margin:"0",padding:"0"}),singleValue:e=>({...e,color:eI?"var(--color-light-0)":"var(--color-dark-3)",fontSize:"14px"}),placeholder:e=>({...e,color:eI?"var(--color-light-0)":"var(--color-light-5)",fontSize:"14px"}),menu:(e,t)=>({...c.M.menu(e,t),marginTop:"4px",zIndex:9999}),menuList:(e,t)=>
6({...c.M.menuList(e,t),padding:"4px 0",maxHeight:"200px"}),menuPortal:c.M.menuPortal,option:(e,t)=>({...c.M.option(e,t),padding:"8px 12px",cursor:"pointer"}),indicatorSeparator:e=>({...e,display:"none"}),dropdownIndicator:e=>({...e,color:eI?"var(--color-light-5)":"var(--color-dark-6)",padding:"0 8px","&:hover":{color:eI?"var(--color-light-4)":"var(--color-dark-4)"}})},[eC,eE]=(0,r.useState)(ev),[eD,eP]=(0,r.useState)(""),{data:eT,refetch:e$}=(0,ec.m5)({projectId:_?.guid,isBlocker:!1},{skip:!_?.guid||!w}),eF=(0,r.useRef)(null),eR=(0,r.useCallback)(e=>{eF.current?.blur(),ej((0,C.J)({isOpen:!0,postId:e}))},[ej]),eL=!j&&!em.SO.includes(Q),eM=(0,r.useMemo)(()=>(Array.isArray(eT)?eT:[]).filter(e=>e?.postId&&e?.postNumber&&e?.category===Q).sort((e,t)=>(e.postNumber||0)-(t.postNumber||0)).map(e=>{let t=H?.find(t=>t.id===e.userId||t.userId===e.userId),l=(0,i.dS)(t);return{value:e.parentPostId||e.postId,label:`#${e.postNumber}`,description:(e.postDescription||"").trim(),authorName:"unknown"===l?t?.emailAddress||"":l,dateLabel:e.createdAt?(0,R.bU)(e.createdAt):"",revisionTag:e.version?(0,em.Vk)(e.version):"",onView:eR}}),[eT,eR,Q,H]),eO=eM.find(e=>e.value===eC.parentPostId)||null,eU=eC.posts.length>1,eB=eC.posts.some(e=>(e=>{let t=e?.split(".").pop()?.toLowerCase()??"";return eu.has(t)})(e.fileName)),ez=[...eC.posts||[],...j&&et?.posts||[]],eq=ez.some(e=>(0,L.w4)(e?.fileName)),eV=eq&&ez.some(e=>!(0,L.w4)(e?.fileName)),eG=eB||eq;(0,r.useEffect)(()=>{(eU||eG)&&eC.parentPostId&&eE(e=>({...e,parentPostId:""}))},[eU,eG,eC.parentPostId]);let e_=(0,R.ik)(W,et),eQ=j?et?.taggedEmails||[]:eC?.taggedUser||[],[eH,eW]=(0,r.useState)([]),[eX,eJ]=(0,r.useState)(),[eY,eK]=(0,r.useState)(!1),[eZ,e0]=(0,r.useState)(!1),e1=(0,r.useRef)(!1),[e2,e5]=(0,r.useState)(!1),e4=_?.userId===eb?.id,e3=(e,t)=>e4&&(0,R.lR)(eb?.plan,eb?.totalStorageUsed??0,(0,R.b3)(eH,e,t)),[e6,{isLoading:e7,error:e8,data:e9}]=(0,D.U5)(),[te,{isLoading:tt,error:tl,data:ta}]=(0,D.Ne)(),[tr]=(0,V.gl)(),ts=(0,r.useRef)(new Map),ti=async e=>{if(e.preventDefault(),e1.current)return;let t=eC?.taggedUser;if(1===eC.isBlocker&&(!t||0===t.length))return void eP("Please select attention when blocker is enabled");if(0===eC.posts.length)return void ex("Please add a file to upload.");if(e3(eC.posts,eC.thumbnail))return void e5(!0);let l=eC.posts.filter(e=>ts.current.has(e.fileS3Id)),a=eC.posts.filter(e=>!ts.current.has(e.fileS3Id)),r=async e=>{eh(e);let{data:t,isSuccess:l}=await eg();if(eC.parentPostId&&e$(),1===eC.isBlocker&&y(ew),ej((0,F.De)(t)),0===X.length){ej((0,F.X6)(t)),eN();return}if(l&&t){let e=t,l=null;for(let t=0;t<X.length;t++){let a=X[t].fileId;if((l=e.find(e=>e.fileId===a))&&Array.isArray(l.children))e=l.children;else{e=[];break}}ej((0,F.X6)(e))}else ex("Failed to fetch updated data. Please try again.");eN()};e1.current=!0,e0(!0);try{let e=0,t=new Set;if(l.length>0){let a=(0,i.dS)(eb);(await Promise.allSettled(l.map(e=>{let t=ts.current.get(e.fileS3Id);return ei({createUniverDoc:tr,docKind:t.docKind,content:t.content,projectId:_?.guid||"",parentFolderId:K||"ROOT",userId:ey,displayName:a,category:j?W?.category:Q,fileName:t.fileName,thumbnailBlob:t.thumbnailBlob})}))).forEach((a,r)=>{let s=l[r].fileS3Id;"rejected"!==a.status&&a.value||(e++,t.add(s),ex(`Could not import "${l[r].fileName}". Uploading the original file instead.`)),ts.current.delete(s)})}let s=l.filter(e=>t.has(e.fileS3Id)),n=[...a,...s],o=new Set(l.map(e=>e.fileS3Id).filter(e=>!t.has(e))),d=eH.filter(e=>!o.has(e?.originalFile?.fileName));n.length>0&&await e6({uploadData:{...eC,posts:n,projectId:_?.guid||"",category:j?W?.category:Q,mentionedUserIds:eC.mentionedUserIds||[],parentFolderId:K||"ROOT",...eC.parentPostId&&{isFeed:0},...eB&&{isBlocker:0,isFeed:0,taggedUser:[]},...eq&&{isBlocker:0,isFeed:0,taggedUser:[]}},presignedUploadData:d}).unwrap(),ts.current.clear(),await r(e>0?"Upload completed with some errors.":"Upload successful!")}catch(e){if(e?.data?.code==="STORAGE_LIMIT_EXCEEDED")return void e5(!0);ex("Upload failed. Please try again."),console.error("Upload failed:",e)}finally{e1.current=!1,e0(!1)}},tn=e=>{j?el(t=>({...t,taggedEmails:e})):eE(t=>({...t,taggedUser:e})),eP("")},to=(e,t)=>{let l=e.target.value,a=(e,a)=>{let r=[...e?.posts];if(t.category===n.b7.SideBySide){let e=r[0],a={...e,[t.descriptionType]:l,fileS3Id:"",fileName:e?.fileName||"",fileType:e?.fileType||""};r[0]=a}else if([n.b7.DRAWINGS,n.b7.PANORAMA,n.b7.RENDERINGS,n.b7.Images,n.b7.Videos,n.b7.SPECIFICATION,n.b7.MOODBOARD,n.b7.ThreeDModels,n.b7.FILES].includes(t.category))r[t.index]={...r[t.index],fileDescription:l};else throw Error("Unhandled category");return{...e,posts:r}};j?el(e=>a(e,!1)):eE(e=>a(e,!0))};function td(e,t){return(0,o.A)(),{fileDescription:"",uploadFile:t,fileName:e.name,fileType:e.type}}let tc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=e.name.toLowerCase(),r=(e.type||"").toLowerCase(),s=a.split(".").pop()||"";return t.length&&t.includes(s)||l.length&&l.some(e=>r.includes(e))},tm=async(e,t)=>{try{if(eK(!0),!e.target.files||0===e.target.files.length){console.warn("No files selected"),eK(!1);return}let l=Array.from(e.target.files);if(console.log("Files to upload:",l.map(e=>({name:e.name,type:e.type}))),(l=(l=await Promise.all(l.map(async e=>
6{if((0,ed.E)(e))try{console.log(`Converting HEIC/HEIF file to JPEG: ${e.name}`);let t=await (0,ed.q)(e);return console.log(`✓ Converted ${e.name} → ${t.name}`),t}catch(t){return console.error(`Failed to convert HEIC file ${e.name}:`,t),ex(`Failed to convert ${e.name}. Please convert it to JPEG manually.`),null}return e}))).filter(Boolean)).length+eC.posts.length>20){alert("You can only upload a maximum of 20 images."),eK(!1);return}let a=l.filter(e=>(0,L.w4)(e.name));if(a.length>0){let e=eC.posts.filter(e=>(0,L.w4)(e.fileName)).length;if(a.length+e>L.Kr){ex((0,L.GN)()),eK(!1);return}let t=(0,L.po)(e4,(0,R._S)(eb?.plan)),l=(0,L.X$)(t),r=a.find(e=>e.size>l);if(r){ex((0,L.z4)(r.name,t)),eK(!1);return}}let r=e=>e.filter(e=>tc({name:e.fileName??e.name,type:e.fileType??e.type},["pdf","doc","docx","xls","xlsx","ppt","pptx"],["pdf","word","excel","spreadsheet","powerpoint","presentation"])).length,s=j?et?.posts||[]:eC.posts;if(r(l)+r(s)>1){alert("Only one PDF, Document, Table, or Show file can be added per upload. Please upload each of these files separately."),eK(!1);return}let d=l.filter(e=>tc({name:e.fileName??e.name,type:e.fileType??e.type},["doc","docx","xls","xlsx","ppt","pptx"],["word","excel","spreadsheet","powerpoint","presentation"])).length;if(d>0&&(s.length>0||l.length>d)){alert("A Document, Table, or Show file must be uploaded on its own. Remove the other files first."),eK(!1);return}let c=await Promise.all(l.map(async e=>{let l,a,r,s,d=e.type,c=e.name.split(".").pop()?.toLowerCase(),m=tc(e,["pdf"],["pdf"]),u=tc(e,["ppt","pptx"],["presentation"]),p=tc(e,["xls","xlsx"],["excel","spreadsheet"]),h=tc(e,["doc","docx"],["word"]),x=tc(e,[],["image"]),f=tc(e,[],["video"]),g=tc(e,["zip"],["model"]),b=(0,L.w4)(e.name);if(b)d=(0,L.z3)(e.name);else if("pdf"===c)d="application/pdf";else if("xlsx"===c||"xls"===c)d=d||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";else if("ppt"===c||"pptx"===c)d=d||"application/vnd.openxmlformats-officedocument.presentationml.presentation";else if("doc"===c||"docx"===c)d=d||"application/msword";else if(!d||""===d)switch(c){case"glb":d="model/gltf-binary";break;case"gltf":d="model/gltf";break;default:d="application/octet-stream"}console.log(`File: ${e.name}, detected type: ${d}, original type: ${e.type}`);let w={url:URL.createObjectURL(e),name:e.name,size:e.size,type:b?d:e.type||d};if(b||await (0,i.YF)(e),"afterImages"===t.imageType){await (0,i.YF)(e);let t=await (0,i.pL)(e);t&&await (0,i.YF)(t),l={url:t?URL.createObjectURL(t):"",name:e.name,size:t?t.size:0,type:e.type}}if(!b&&e.type.includes("image/")&&((r=await (0,i.pL)(e))&&await (0,i.YF)(r),a={url:r?URL.createObjectURL(r):"",name:e.name,size:r?r.size:0,type:e.type}),t.category===n.b7.SideBySide){let s,i=eC.posts[0];if("beforeImage"===t.imageType){let t=(0,o.A)(),l=(0,o.A)();eW(i=>{let n=Array.isArray(i)?[...i]:[];return n[0]={...n[0],originalFile:{file:e,fileName:t,fileType:s.fileType},thumbnail:{file:r,fileName:l,fileType:a?.type}},n}),eJ(e=>{let t=Array.isArray(e)?[...e]:[];return t[0]={...t[0],thumbnailFile:a},t}),s={...i,beforeFilesDescription:"",fileS3Id:t,thumbnailS3Id:l,fileName:w.name,fileType:w.type}}else if("afterImages"===t.imageType){let t=(0,o.A)(),a=(0,o.A)();eW(i=>{let n=Array.isArray(i)?[...i]:[];return n[0]={...n[0],afterOriginalFile:{file:e,fileName:t,fileType:s.fileType},afterThumbnail:{file:r,fileName:a,fileType:l?.type}},n}),eJ(e=>{let t=Array.isArray(e)?[...e]:[];return t[0]={...t[0],afterThumbnail:l},t}),s={filesDescription:"",...i,afterfileS3Id:t,afterthumbnailS3Id:a,fileName:w.name,fileType:w.type}}else throw Error("Unhandled imageType for sideBySide category");return s}if(b){let t=(0,o.A)(),l={fileDescription:w.name?.split(".")[0],fileS3Id:t,fileName:w.name,fileType:d,newPost:!0};return eW(l=>[...l||[],{originalFile:{file:e,fileName:t,fileType:d}}]),eJ(t=>[...t||[],{url:"",name:e.name,size:e.size,type:d,fileType:d}]),l}if(x){let t=(0,o.A)(),l=(0,o.A)();return s={fileDescription:w.name?.split(".")[0],fileS3Id:t,fileName:w.name,fileType:w.type,thumbnailS3Id:l,newPost:!0},j&&(s.thumbnail=a),eW(s=>[...s||[],{originalFile:{file:e,fileName:t,fileType:e.type},thumbnail:{file:r,fileName:l,fileType:a?.type}}]),eJ(e=>[...e||[],a]),s}if(f)return td(w,e);if(g)return td(w,e);else if(m||p||h||u){let t=(0,o.A)(),l=!1,r=null,s=null;if(p||h||u){var y;let t=(y=e.name,en[y.split(".").pop()?.toLowerCase()??""]??null);if(t&&!(s=await eo(e,t))){let l="sheet"===t?"Table":"slide"===t?"
6Show":"Document";ef(`"${e.name}" was uploaded as a regular file because it couldn't be converted into an editable ${l}.`)}}try{console.log(`Generating thumbnail for ${e.name} (type: ${e.type})...`);let t=await (0,q.u)(e);t?.blob?(r=t.blob,a={url:t.url||"",name:e.name,size:r.size||0,type:"image/png",fileType:"image/png"},console.log(`✓ Thumbnail generated successfully for ${e.name}`),l=!0):console.warn(`generateFileThumbnail returned empty data for ${e.name}`)}catch(t){console.error(`Failed to generate thumbnail for ${e.name}:`,t)}let i=function(e,t,l,a){let r=(0,o.A)();return eW(t=>[...t||[],{originalFile:{file:e,fileName:r,fileType:e.type},...l&&a&&{thumbnail:{file:a,fileName:l,fileType:"image/png"}}}]),{fileDescription:e.name?.split(".")[0],fileName:e.name,fileType:e.type,fileS3Id:r,...l&&{thumbnailS3Id:l}}}(e,0,l?t:void 0,r||void 0);if(s&&ts.current.set(i.fileS3Id,{docKind:s.docKind,content:s.content,fileName:e.name,thumbnailBlob:r}),a)eJ(e=>[...e||[],a]);else{let t={"application/pdf":"application/pdf","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel":"application/vnd.ms-excel","application/msword":"application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation":"application/vnd.openxmlformats-officedocument.presentationml.presentation","application/ppt":"application/ppt"};eJ(l=>[...l||[],{url:"",name:e.name,size:e.size,type:e.type||d,fileType:t[e.type]||d||"application/octet-stream"}])}return i}else throw console.error("Unhandled file type:",{name:e.name,type:e.type,detectedType:d,extension:e.name.split(".").pop()?.toLowerCase()}),Error(`Unhandled category: ${e.name} (type: ${e.type||d})`)})),m=t.category===n.b7.SideBySide||t.category===n.b7.Videos;j?el(e=>({...e,posts:[...e.posts,...c]})):eE(e=>({...e,parentFolderId:K||"ROOT",posts:m?[c[0]]:[...e.posts,...c]})),eh("Files processed successfully!"),eK(!1)}catch(e){console.error("Error in handleImageUpload:",e),ex(e?.message||"An error occurred while processing files"),eK(!1)}},tu=e=>{if(j){let t=et.posts[e],l=et.posts.filter((t,l)=>l!==e);t?.fileId&&(er(e=>[...e,t.fileId]),ep(e=>[...e,t.fileS3Id])),el({...et,posts:l})}else eE(t=>{let l=t.posts.filter((t,l)=>l!==e);return{...t,posts:l}}),eJ(eX?.filter((t,l)=>l!==e))},tp=()=>{j?el(e=>({...e,isFeed:+(1!==e.isFeed)})):eE(e=>({...e,isFeed:+(1!==e.isFeed)}))},th=()=>{j?el(e=>({...e,isBlocker:+(1!==e.isBlocker)})):eE(e=>({...e,isBlocker:+(1!==e.isBlocker)})),eP("")},tx=async()=>{let e=et.posts.map(e=>{let{thumbnail:t,...l}=e;return l}),t={...et,projectId:_?.guid,posts:e,removedSubPostFileIds:ea,removedSubPostFileS3Ids:es},l=et?.taggedUser;if(1===et.isBlocker&&(!l||0===l.length))return void eP("Please select attention when blocker is enabled");if(e3(et.posts,et?.thumbnail))return void e5(!0);try{let e=await te({sanitizedUpdatePost:t,presignedUploadData:eH}).unwrap();if(e){let t=e.body||e;"string"==typeof t&&(t=JSON.parse(t)),eh(t?.message||t||"Updated successful!"),eg(),1===et.isBlocker&&y(ew),eN()}}catch(e){if(e?.data?.code==="STORAGE_LIMIT_EXCEEDED")return void e5(!0);console.error("Error during file upload:",e)}},tf=()=>t?.length<=0&&l?.length<=0&&f?.length<=0;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(M.A,{show:e2,onClose:()=>e5(!1),currentPlan:eb?.plan,limitType:"storage"}),tf()&&!w?(0,a.jsx)(p.A,{acceptAttribute:ek,dragDropCardInputChange:e=>{ej((0,C.lR)()),ej((0,C.ll)(n.NL.FILES)),ej((0,C.ob)(!0)),tm(e,{category:J,imageType:"beforeImage"})},isEmptyView:tf()}):g===n.NL.FILES&&w?(0,a.jsx)(U.A,{open:!0,onClose:eN,title:"File Upload",maxWidthClassName:"max-w-270",noBodyPadding:!0,closable:!G?.isOpen,dirty:eC.posts.length>0||!!eC.parentPostId||eY||j&&e_||!!(j?et.postDescription:eC.postDescription)?.trim()||((j?et.taggedEmails:eC.taggedUser)?.length??0)>0,footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.Ay,{variant:"outline",size:"sm",type:"button",title:"Cancel",onClick:eN,className:"w-22 h-9.5"}),eA?(0,a.jsx)(v.Ay,{variant:"yellow",size:"sm",type:"button",title:"Upload",loading:e7||tt||eZ,onClick:j?tx:ti,disabled:e7||tt||eZ||_?.guid===null,className:"w-22 h-9.5"}):(0,a.jsx)(v.Ay,{variant:"yellow",size:"sm",type:"button",title:j?"Save":"Upload",loading:e7||tt||eZ,onClick:j?tx:ti,disabled:e7||tt||eZ||(j?!e_:null===ew),className:"w-22 h-9.5"})]}),children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(S.A,{show:eY,scrim:"dark",label:"Processing files..."}),(0,a.jsx)(O.A,{className:"mx-5 mt-4",ownerUserId:_?.userId}),eA?(0,a.jsx)(I,{acceptAttribute:ek,teamMembers:H||[],handleImageUpload:tm,handleDescriptionChange:to,uploadData:eC,setUploadData:eE,handleTag
6Change:tn,handlePostDescriptionChange:e=>{let t=e.target.value;j?el(e=>({...e,postDescription:t})):eE(e=>({...e,postDescription:t}))},updatePost:et,handleFeedCheckBox:tp,handleBlockerCheckBox:th,attentionEmails:eQ,handleRemovePost:tu,attentionError:eD}):(0,a.jsxs)("div",{className:"flex p-5 gap-5 md:flex-row flex-col",children:[(0,a.jsx)("div",{className:"xl:w-160.25 xl:h-135.5 w-full h-full ",children:J===n.b7.SideBySide?(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(x.A,{acceptAttribute:ek,handleImageUpload:tm,handleDescriptionChange:to,uploadData:eC,tempThumbnail:eX})}):(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(h.A,{acceptAttribute:ek,category:J,handleImageUpload:tm,handleDescriptionChange:to,uploadData:eC,updatePost:et,tempThumbnail:eX,handleRemovePost:tu,disableAddMore:eB})})}),(0,a.jsx)("div",{className:" xl:w-94.75 xl:h-135.5 lg:w-[35%] w-full max-h-[46vh] overflow-y-auto scrollbar-none md:max-h-none md:overflow-visible  ",children:(0,a.jsxs)("div",{className:" flex flex-col gap-5 ",children:[!eG&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"postDescription",className:k.I8,children:"Post Description (Optional)"}),(0,a.jsx)(B.A,{id:"postDescription",name:"postDescription",rows:5,value:j?et.postDescription:eC.postDescription,onChange:e=>{j?el(t=>({...t,postDescription:e})):eE(t=>({...t,postDescription:e}))},members:H||[],onMentionsChange:e=>{let t=e.map(e=>e?.id!=null?String(e.id):"").filter(Boolean);j?el(e=>({...e,mentionedUserIds:t})):eE(e=>({...e,mentionedUserIds:t}))},placeholder:"Enter description here \xb7 type @ to mention",className:"min-h-41.25"})]}),!eG&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"Select audience",className:k.I8,children:"Attention (Optional)"}),(0,a.jsx)(m.A,{teamMembers:H||[],value:eQ,onChange:tn,name:"colors",isClearable:!0,placeholder:"Select audience"}),eD&&(0,a.jsx)("p",{className:"text-red-2 text-sm font-medium",children:eD})]}),!eG&&eL&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"linkToPost",className:k.I8,children:"Upload as Revision (Optional)"}),(0,a.jsx)("div",{className:"dark:bg-dark-3 dark:border-dark-5 text-base dark:text-light-0 rounded-xl bg-light-2 border-2 border-light-3",children:(0,a.jsx)(d.Ay,{ref:eF,styles:eS,isMulti:!1,isClearable:!0,isDisabled:eU,name:"linkToPost",inputId:"linkToPost",value:eO,options:eM,onChange:e=>{eE(t=>({...t,parentPostId:e?.value||""}))},className:"basic-single-select",classNamePrefix:"select",placeholder:eU?"Single file uploads only":"Select the post this revises",components:{Option:u.A},noOptionsMessage:()=>"No posts in this category",menuPortalTarget:"undefined"!=typeof document?document.body:void 0,menuPosition:"fixed"})})]}),eB?(0,a.jsxs)("div",{className:"border p-2 border-red-2/30 flex flex-row items-center gap-2 rounded-xl bg-red-2/10 dark:bg-red-2/20",children:[(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-red-2 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),(0,a.jsxs)("p",{className:"text-xs font-medium text-red-2",children:["All uploaded documents, tables, and files start as ",(0,a.jsx)("strong",{children:"private"}),". Publish them anytime to make them available to your team."]})]}):eq?(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"border p-2 border-red-2/30 flex flex-row items-center gap-2 rounded-xl bg-red-2/10 dark:bg-red-2/20",children:[(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-red-2 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),(0,a.jsx)("p",{className:"text-xs font-medium text-red-2",children:L.sg})]}),eV&&(0,a.jsx)("div",{className:"border p-2 border-light-3 dark:border-dark-4 roun
6ded-xl bg-light-2 dark:bg-dark-2",children:(0,a.jsx)("p",{className:"text-xs font-medium text-dark-2 dark:text-light-0",children:L.Vw})})]}):(0,a.jsxs)("div",{className:"border p-2  h-9.5  border-light-2 dark:border-dark-4  flex flex-row items-center gap-4 rounded-xl bg-light-2  dark:bg-dark-2",children:[(0,a.jsx)("div",{className:"w-45.25 h-9.5",children:(0,a.jsxs)("label",{className:"h-10 gap-2 flex items-center cursor-pointer select-none text-dark-2 dark:text-light-0",children:[(0,a.jsx)(N.A,{checked:j?1===et.isBlocker:1===eC.isBlocker,onChange:th}),(0,a.jsx)("div",{className:"text-dark-2 text-sm font-semibold dark:text-light-0",children:"Blocker"})]})}),(0,a.jsx)("span",{className:"h-5 w-0.5 bg-light-3"}),(0,a.jsx)("div",{className:"w-45.25 h-9.5 flex  justify-start",children:(0,a.jsxs)("label",{className:"gap-2 h-10 flex items-center cursor-pointer select-none text-dark-2 dark:text-light-0",children:[(0,a.jsx)(N.A,{disabled:j,checked:j?1===et.isFeed:1===eC.isFeed,onChange:tp}),(0,a.jsx)("div",{className:"text-dark-2 text-sm font-semibold dark:text-light-0",children:"Feeds"})]})})]})]})})]}),(0,a.jsx)(E.default,{})]})}):null]})}},97492:()=>{},97721:(e,t,l)=>{"use strict";l.d(t,{Au:()=>p,CD:()=>g,D0:()=>y,Gh:()=>c,Q9:()=>n,Si:()=>o,Ty:()=>b,Zg:()=>i,cS:()=>u,g0:()=>x,gD:()=>f,jp:()=>h,qu:()=>s,t2:()=>w,u3:()=>j,xu:()=>k});var a=l(21980);let r="idc-deck",s=!0,i=1920,n=(e,t)=>({format:r,formatVersion:1,docKind:"slide",deck:e,...t?{migratedFrom:t}:{}}),o=e=>{let t="undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():`${Date.now().toString(36)}${Math.random().toString(36).slice(2,10)}`;return`${e}_${t}`},d={fontFamily:"Plus Jakarta Sans",fontSize:48,fontStyle:"normal",textDecoration:"",align:"left",verticalAlign:"top",lineHeight:1.3,letterSpacing:0,fill:"#0f172a",padding:8},c=e=>({id:o("sl"),background:e??{type:"solid",color:"#ffffff"},elements:[]}),m=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Untitled";return{id:e,title:t,width:i,height:1080,slides:[c()]}},u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{id:o("el"),type:"text",x:160,y:160,width:800,height:120,rotation:0,opacity:1,text:"Text",...d,...e}},p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{id:o("el"),type:"shape",shape:e,x:660,y:390,width:600,height:300,rotation:0,opacity:1,fill:"#6d28d9",stroke:null,strokeWidth:0,cornerRadius:12*("rect"===e),..."star"===e?{points:5,innerRadiusRatio:.45}:{},...t}},h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{id:o("el"),type:"line",x:560,y:540,width:800,height:0,rotation:0,opacity:1,points:[0,0,800,0],stroke:"#0f172a",strokeWidth:6,fill:null,lineCap:"round",arrowEnd:!1,...e}},x=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{id:o("el"),type:"image",x:460,y:240,width:1e3,height:600,rotation:0,opacity:1,src:e,crop:null,...t}},f=function(e){let t,l=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return"";if(e.startsWith("data:image/"))return e;if(/^[a-z][a-z0-9+.-]*:/i.test(e)){let l;try{l=new URL(e)}catch{return""}if("https:"!==l.protocol&&"http:"!==l.protocol||!(e=>{let t=a.mn.replace(/^https?:\/\//,"").replace(/\/.*$/,"");return!!t&&e.host===t||/(^|\.)idcolab\.com$/.test(e.host)||e.host.endsWith(".amazonaws.com")})(l))return"";t=l.toString()}else t=`${a.mn}${e}`;return l?t.includes("?")?`${t}&idccors=1`:`${t}?idccors=1`:t},g=e=>"line"===e.type||"draw"===e.type,b=(e,t)=>e.slides.find(e=>e.id===t),j=e=>{if(!e.length)return null;let t=1/0,l=1/0,a=-1/0,r=-1/0;for(let s of e)t=Math.min(t,s.x),l=Math.min(l,s.y),a=Math.max(a,s.x+s.width),r=Math.max(r,s.y+s.height);return{x:t,y:l,width:a-t,height:r-l}},w=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1.6,l=e.length/2;if(l<3)return e.slice();let a=new Uint8Array(l);a[0]=1,a[l-1]=1;let r=[[0,l-1]],s=t*t;for(;r.length;){let[t,l]=r.pop();if(l-t<2)continue;let i=e[2*t],n=e[2*t+1],o=e[2*l],d=e[2*l+1],c=o-i,m=d-n,u=c*c+m*m,p=-1,h=t;for(let a=t+1;a<l;a++){let t=e[2*a],l=e[2*a+1],r=0===u?0:((t-i)*c+(l-n)*m)/u,s=i+(r=r<0?0:r>1?1:r)*c,o=n+r*m,d=(t-s)*(t-s)+(l-o)*(l-o);d>p&&(p=d,h=a)}p>s&&(a[h]=1,r.push([t,h],[h,l]))}let i=[];for(let t=0;t<l;t++)a[t]&&i.push(e[2*t],e[2*t+1]);return i},y=e=>{let t=1/0,l=1/0,a=-1/0,r=-1/0;for(let s=0;s<e.length;s+=2)t=Math.min(t,e[s]),a=Math.max(a,e[s]),l=Math.min(l,e[s+1]),r=Math.max(r,e[s+1]);return isFinite(t)?{x:t,y:l,width:a-t,height:r-l}:{x:0,y:0,width:0,height:0}},v=e=>{if(!e)return null;for(let t of[e.source,e.base64Cache,e.image?.source,e.image?.base64Cache,e.imageProperties?.source,e.imageProperties?.base64Cache,e.imageProperties?.image?.source,e.imageProperties?.image?.base64Cache])if("string"==typeof t&&t.trim())return t;return null},k=(e,t)=>{let l={deck:m(t),migratedFrom:null,migratedFromUniver:!1,importStats:{imported:0,skipped:0}};if(null==e||"object"!=typeof e)return l;if(e.format===r&&e.deck){let l=e.deck;return{deck:{id:l.id||t,title:l.title||"Untitled",width:l.width||i,height:l.height||1080,slides:Array.isArray(l.slides)&&l.slides.length?l.slides:[c()]},migratedFrom:e.migratedFrom??null,migratedFromUniver:!1,importStats:{imported:0,skipped:0}}}let a=e.snapshot;if(null==a||"object"!=typeof a||!a.body?.pageOrder?.length)return l;let s=null;try{JSON.stringify(a).length<=262144&&(s={format:"univer-snapshot",snapshot:a})}catch{}let n={imported:0,skipped:0};return{deck:((e,t,l)=>{let a=e.pageSize?.width?2*e.pageSize.width:i,r=e.pageSize?.height?2*e.pageSize.height:1080,s=e.pageSize?.width?a/e.pageSize.width:1,n=e.body?.pageOrder??[],m=e.body?.pages??{},h=n.map(e=>m[e]).filter(e=>!!e).map(e=>{let t=[];for(let a of Object.values(e.pageElements??{})){let e=(a.left??0)*s,r=(a.top??0)*s,i=(a.width??200)*s,n=(a.height??100)*s,o=a.angle??a.rotate??0,c=v(a.image);if(c){t.push(x(c,{x:e,y:r,width:i,height:n,rotation:o}
6)),l.imported++;continue}let m=a.richText?.text??a.shape?.text;if(m){t.push(u({x:e,y:r,width:i,height:n,rotation:o,text:m,fontSize:(a.richText?.fs??24)*s,fill:a.richText?.cl?.rgb??d.fill})),l.imported++;continue}if(a.shape){t.push(p("rect",{x:e,y:r,width:i,height:n,rotation:o,fill:"#e2e8f0",stroke:"#94a3b8",strokeWidth:2,cornerRadius:0})),l.imported++;continue}(a.image||a.richText||null!=a.type)&&l.skipped++}return{id:o("sl"),name:e.title,background:{type:"solid",color:e.pageBackgroundFill?.rgb||"#ffffff"},elements:t}});return{id:t,title:e.title||"Untitled",width:a,height:r,slides:h.length?h:[c()]}})(a,t,n),migratedFrom:s,migratedFromUniver:!0,importStats:n}}},99857:(e,t,l)=>{"use strict";l.d(t,{Ay:()=>c,JP:()=>s,MZ:()=>i,NR:()=>r,Qo:()=>d,SH:()=>o,eP:()=>n});let a=(0,l(26286).Z0)({name:"projectNew",initialState:{selectedProject:null,projectList:[],selectedProjectId:"",currentProjectName:"",isFetchingProjectDetails:!1},reducers:{setSelectedProject:(e,t)=>{e.selectedProject=t.payload},setSelectedProjectId:(e,t)=>{e.selectedProjectId=t.payload},setProjectList:(e,t)=>{e.projectList=t.payload},clearProject:e=>{e.selectedProject=null},setFetchingProjectDetails(e,t){e.isFetchingProjectDetails=t.payload},setCurrentProjectName:(e,t)=>{e.currentProjectName=t.payload}}}),{setSelectedProject:r,clearProject:s,setProjectList:i,setSelectedProjectId:n,setFetchingProjectDetails:o,setCurrentProjectName:d}=a.actions,c=a.reducer}}]);

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.