1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[531],{3906:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/workspaces/[slug]/[boardId]",function(){return a(8007)}])},8007:function(e,t,a){"use strict";a.r(t),a.d(t,{__N_SSP:function(){return T},default:function(){return P}});var n=a(5893),o=a(7294),s=a(7940),r=a(7856),l=a.n(r),d=a(4443),i=a.n(d),c=a(7250),u=a(1444),p=a(1240),h=a(381),_=a.n(h);function m(e){let{post:t,updatePostModalOpen:a,setUpdatePostModalOpen:r}=e,[d,h]=(0,o.useState)(t.content),[m,x]=(0,o.useState)(t.color),[C,g]=(0,o.useState)(t.deadline?_()(t.deadline).format("YYYY-MM-DDTHH:mm"):""),{trigger:j}=(0,s.jy)(),b=(0,o.useRef)(null),[f,v]=(0,o.useState)("");(0,o.useEffect)(()=>{if(a){var e;null===(e=b.current)||void 0===e||e.focus()}},[a]),(0,o.useEffect)(()=>{h(t.content),x(t.color),g(t.deadline?_()(t.deadline).format("YYYY-MM-DDTHH:mm"):"")},[t]);let k=()=>{if(""===d.trim()){v("Note cannot be empty");return}j({data:{content:l().sanitize(d,{ALLOWED_TAGS:[]}),color:m,deadline:C?new Date(C):void 0},where:{id:t.id}}),r(!1),h("")};return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(p.Z,{modalOpen:a,setModalOpen:r,children:(0,n.jsxs)("div",{className:i().updatePostModal,children:[(0,n.jsx)(c.FB,{className:i().cancelIcon,onClick:()=>r(!1)}),(0,n.jsxs)("div",{className:i().deadlineInput,children:[(0,n.jsx)("span",{className:i().postLabel,children:"Set deadline: "}),(0,n.jsx)("input",{type:"datetime-local",id:"deadline",name:"deadline",value:C,onChange:e=>g(e.target.value)})]}),(0,n.jsx)("textarea",{placeholder:"Text",className:i().postText,value:d,ref:b,onKeyDown:e=>{if("Tab"===e.key){e.preventDefault();let t=e.currentTarget.selectionStart,a=e.currentTarget.selectionEnd;h(d.substring(0,t)+" "+d.substring(a)),setTimeout(()=>{b.current&&(b.current.selectionStart=b.current.selectionEnd=t+1)},0)}},onChange:e=>{h(e.currentTarget.value)}}),(0,n.jsxs)("div",{className:i().postColorContainer,children:[(0,n.jsx)("span",{className:i().postLabel,children:"Color"}
1),(0,n.jsxs)("div",{className:i().createPostBackground,children:[(0,n.jsx)("input",{type:"radio",name:"postColor",checked:"postColor1"===m,value:"postColor1",id:"postColor1",className:i().postColor1,onChange:e=>x(e.target.value)}),(0,n.jsx)("label",{htmlFor:"postColor1",children:(0,n.jsx)("span",{children:(0,n.jsx)(c.nQ,{})})}),(0,n.jsx)("input",{type:"radio",name:"postColor",checked:"postColor2"===m,value:"postColor2",id:"postColor2",className:i().postColor2,onChange:e=>x(e.target.value)}),(0,n.jsx)("label",{htmlFor:"postColor2",children:(0,n.jsx)("span",{children:(0,n.jsx)(c.nQ,{})})}),(0,n.jsx)("input",{type:"radio",name:"postColor",checked:"postColor3"===m,value:"postColor3",id:"postColor3",className:i().postColor3,onChange:e=>x(e.target.value)}),(0,n.jsx)("label",{htmlFor:"postColor3",children:(0,n.jsx)("span",{children:(0,n.jsx)(c.nQ,{})})})]})]}),(0,n.jsx)(u.pd,{message:f}),(0,n.jsx)("div",{className:i().modalButtons,children:(0,n.jsx)("button",{className:i().submitModalBtn,onClick:()=>k(),children:(0,n.jsx)("span",{children:"Update"})})})]})})})}var x=a(49);function C(e){let t=(0,x.$_)(),a=(0,x.xJ)(),[r,d]=(0,o.useState)(""),[h,_]=(0,o.useState)("postColor1"),[m,C]=(0,o.useState)(""),{trigger:g}=(0,s.fj)({optimisticUpdate:!0}),[j,b]=(0,o.useState)(!1),f=(0,o.useRef)(null),[v,k]=(0,o.useState)("");(0,o.useEffect)(()=>{if(j){var e;null===(e=f.current)||void 0===e||e.focus()}},[j]);let N=()=>{if(""===r.trim()){k("Note cannot be empty");return}g({data:{content:l().sanitize(r,{ALLOWED_TAGS:[]}),color:h,deadline:m?new Date(m):void 0,owner:{connect:{id:a.id}},board:{connect:{id:e.board.id}}}}).catch(e=>{console.error("Error creating post:",e)}),b(!1),d("")};return t&&e.board?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.K6,{className:i().createPostBtn,onClick:()=>b(!0)}),(0,n.jsxs)("div",{className:"".concat(i().createWorkspaceBoardBtnSmall," ").concat(i().createPostBtnSmall),onClick:()=>b(!0),children:[(0,n.jsx)(c.dt,{}),(0,n.jsx)("span",{children:"New note"})]}),(0,n.jsx)(p.Z,{modalOpen:j,setModalOpen:b,children:(0,n.jsxs)("div",{className:i().createPostModal,children:[(0,n.jsx)(c.FB,{className:i().cancelIcon,onClick:()=>b(!1)}),(0,n.jsxs)("div",{className:i().deadlineInput,children:[(0,n.jsx)("span",{className:i().postLabel,children:"Set deadline: "}),(0,n.jsx)("input",{type:"datetime-local",id:"deadline",name:"deadline",value:m,onChange:e=>C(e.target.value)})]}),(0,n.jsx)("textarea",{placeholder:"Text",className:i().postText,value:r,ref:f,onKeyDown:e=>{if("Tab"===e.key){e.preventDefault();let t=e.currentTarget.selectionStart,a=e.currentTarget.selectionEnd;d(r.substring(0,t)+" "+r.substring(a)),setTimeout(()=>{f.current&&(f.current.selectionStart=f.current.selectionEnd=t+1)},0)}},onChange:e=>{d(e.currentTarget.value)}}),(0,n.jsxs)("div",{className:i().postColorContainer,children:[(0,n.jsx)("span",{className:i().postLabel,children:"Color:"}
1),(0,n.jsxs)("div",{className:i().createPostBackground,children:[(0,n.jsx)("input",{type:"radio",name:"postColor",defaultChecked:!0,value:"postColor1",id:"postColor1",className:i().postColor1,onChange:e=>_(e.target.value)}),(0,n.jsx)("label",{htmlFor:"postColor1",children:(0,n.jsx)("span",{children:(0,n.jsx)(c.nQ,{})})}),(0,n.jsx)("input",{type:"radio",name:"postColor",value:"postColor2",id:"postColor2",className:i().postColor2,onChange:e=>_(e.target.value)}),(0,n.jsx)("label",{htmlFor:"postColor2",children:(0,n.jsx)("span",{children:(0,n.jsx)(c.nQ,{})})}),(0,n.jsx)("input",{type:"radio",name:"postColor",value:"postColor3",id:"postColor3",className:i().postColor3,onChange:e=>_(e.target.value)}),(0,n.jsx)("label",{htmlFor:"postColor3",children:(0,n.jsx)("span",{children:(0,n.jsx)(c.nQ,{})})})]})]}),(0,n.jsx)(u.pd,{message:v}),(0,n.jsx)("div",{className:i().modalButtons,children:(0,n.jsx)("button",{className:i().submitModalBtn,onClick:()=>N(),children:(0,n.jsx)("span",{children:"+ Add"})})})]})})]}):(0,n.jsx)(n.Fragment,{})}let g=(0,o.createContext)(void 0),j=e=>{let{children:t}=e,[a,s]=(0,o.useState)(_()());return(0,o.useEffect)(()=>{let e=setTimeout(()=>{s(_()());let e=setInterval(()=>{s(_()())},6e4);return()=>clearInterval(e)},1e3*(60-_()().seconds()));return()=>clearTimeout(e)},[]),(0,n.jsx)(g.Provider,{value:{now:a},children:t})};var b=a(2529),f=a.n(b),v=a(7957),k=a.n(v),N=function(e){var t;let a,{post:r,onEdit:l,optimistic:d}=e,{trigger:i}=(0,s.ZL)(),[u,p]=(0,o.useState)(!1),{trigger:h}=(0,s.jy)({optimisticUpdate:!0}),m=_()(r.deadline),C=(0,o.useContext)(g),j=C?C.now:_()(),b=_().duration(m.diff(j)),v="";v=Math.abs(b.asDays())>1?"".concat(Math.floor(Math.abs(b.asDays()))," days "):Math.abs(b.asHours())>1?"".concat(Math.floor(Math.abs(b.asHours()))," hours "):"".concat(Math.floor(Math.abs(b.asMinutes()))," minutes ");let N=!!j&&j.isAfter(m),w=null===(t=r.owner)||void 0===t?void 0:t.name,B=_()(r.updatedAt).format("lll"),A=_()(r.createdAt).format("lll"),S=_()(r.deadline).format("lll"),I=_()(r.completedAt).format("lll"),y=(0,x.$_)(),T=(0,x.xJ)(),P=null==y?void 0:y.id,G=null==T?void 0:T.id,{data:M}=(0,s.gQ)({where:{workspaceId:P,userId:G},include:{user:!0}});y&&T&&(a=M);let E=e=>{!!r.completedAt!==e&&h({where:{id:r.id},data:{completedAt:e?new Date:null}})};return(0,n.jsx)("div",{className:"".concat(f().parent),children:(0,n.jsxs)("div",{className:"".concat(f().flipBoxInner," ").concat(r.color&&k()[r.color]," ").concat(u?f().flip:""),children:[(0,n.jsxs)("div",{className:f().front,children:[(0,n.jsxs)("div",{className:f().top,children:[r.completedAt?(0,n.jsxs)("span",{className:f().deadline,children:["Completed at: ",I]}):(0,n.jsx)(n.Fragment,{children:r.deadline?N?(0,n.jsxs)("span",{className:f().lateDeadline,children:[v," late"]}):(0,n.jsxs)("span",{className:f().deadline,children:[v,"left"]}):(0,n.jsx)("span",{})}),(0,n.jsx)(c.sz,{className:f().openInfo,onClick:()=>p(!0)})]}),(0,n.jsx)("div",{className:f().content,dangerouslySetInnerHTML:{__html:r.content}}),(null==a?void 0:a.workspaceUserRole)==="ADMIN"||(null==a?void 0:a.workspaceUserRole)==="USER"?(0,n.jsxs)("div",{className:f().footer,children:[(0,n.jsx)(c.dY,{onClick:l,className:f().editPostBtn}),(0,n.jsxs)("label",{className:f().checkboxContainer,children:[(0,n.jsx)("input",{type:"checkbox",checked:!!r.completedAt,disabled:d,onChange:e=>E(e.currentTarget.checked)}),(0,n.jsx)("svg",{viewBox:"0 0 64 64",height:"2em",width:"2em",children:(0,n.jsx)("path",{d:"M 0 16 V 56 A 8 8 90 0 0 8 64 H 56 A 8 8 90 0 0 64 56 V 8 A 8 8 90 0 0 56 0 H 8 A 8 8 90 0 0 0 8 V 16 L 32 48 L 64 16 V 8 A 8 8 90 0 0 56 0 H 8 A 8 8 90 0 0 0 8 V 56 A 8 8 90 0 0 8 64 H 56 A 8 8 90 0 0 64 56 V 16",pathLength:"575.0541381835938",className:f().path})})]}),(0,n.jsx)(c.pJ,{className:f().deleteIcon,onClick:()=>{confirm("Are you sure you want to delete this board?")&&i({where:{id:r.id}})}})]}):null]}),(0,n.jsxs)("div",{className:f().back,children:[(0,n.jsx)(c.FB,{className:f().closeInfo,onClick:()=>p(!1)}),(0,n.jsxs)("div",{className:f().backContent,children:[(0,n.jsxs)("span",{className:f().lateDeadline,children:["Created By: ",w]}),(0,n.jsxs)("span",{children:["Created at: ",A]}),(0,n.jsxs)("span",{children:["Updated at: ",B]}),r.deadline?(0,n.jsxs)("span",{children:["Deadline: ",S]}):(0,n.jsx)("span",{children:"No deadline set"}),r.completedAt?(0,n.jsxs)("span",{children:["Completed at: ",I]}):null]})]})]})})},w=a(6681);class B{constructor(){this.componentControls=new Set}subscribe(e){return this.componentControls.add(e),()=>this.componentControls.delete(e)}
1start(e,t){this.componentControls.forEach(a=>{a.start(e.nativeEvent||e,t)})}}let A=()=>new B;var S=a(6039),I=a(4545),y=a.n(I),T=!0;function P(e){let t,{workspace:a,board:r}=e,l=(0,x.xJ)(),d=(0,x.IW)(),[i,u]=(0,o.useState)(!1),[p,h]=(0,o.useState)(null),{data:_}=(0,s.qt)({where:{boardId:r.id},include:{owner:!0},orderBy:{createdAt:"desc"}},{keepPreviousData:!0}),[g,b]=(0,o.useState)(!1);(0,o.useEffect)(()=>{b(window.innerWidth<940)},[]);let f=(0,w.h)(A),v=null==a?void 0:a.id,B=null==l?void 0:l.id,{data:I}=(0,s.gQ)({where:{workspaceId:v,userId:B},include:{user:!0}});return((0,o.useEffect)(()=>{p&&u(!0)},[p]),a&&r)?(a&&l&&(t=I),(0,n.jsxs)("div",{className:"".concat(y().parent," ").concat(r.background&&k()[r.background]),children:[(0,n.jsxs)("div",{className:y().workspaceBoardTitle,children:[(0,n.jsx)("h1",{children:null==d?void 0:d.name}),(0,n.jsx)(c.EP,{className:y().highlight})]}),(0,n.jsxs)("section",{children:[(null==t?void 0:t.workspaceUserRole)==="ADMIN"||(null==t?void 0:t.workspaceUserRole)==="USER"?(0,n.jsx)(C,{board:r,workspace:a}):null,(0,n.jsx)(j,{children:(0,n.jsx)(S.E.ul,{children:null==_?void 0:_.map(e=>(0,n.jsx)(S.E.li,{drag:!g,dragControls:f,dragSnapToOrigin:!0,children:(0,n.jsx)(N,{post:e,onEdit:()=>{h(e),u(!0)}})},e.id))})}),p&&(0,n.jsx)(m,{post:p,updatePostModalOpen:i,setUpdatePostModalOpen:u})]})]})):(0,n.jsx)(n.Fragment,{})}},7957:function(e){e.exports={themeColor1:"background_themeColor1__uZjGC",themeColor2:"background_themeColor2__j1xs6",themeColor3:"background_themeColor3__x1Twj",themeColor4:"background_themeColor4__cjQ1Y",themeColor5:"background_themeColor5__OXOWP",themeColor6:"background_themeColor6__3kYhW",themeGradient1:"background_themeGradient1__c_VVj",themeGradient2:"background_themeGradient2__Bc_Oa",themeGradient3:"background_themeGradient3__63QC9",themeGradient4:"background_themeGradient4__NRHvN",themeGradient5:"background_themeGradient5__gVnfT",themeGradient6:"background_themeGradient6___yK0l",themeAnimatedGradient1:"background_themeAnimatedGradient1___nNq2",gradient:"background_gradient__qPNvq",themeAnimatedGradient2:"background_themeAnimatedGradient2__MC2ji",themeAnimatedGradient3:"background_themeAnimatedGradient3__GCZyk",themeAnimatedGradient4:"background_themeAnimatedGradient4__ur8hx",themeAnimatedGradient5:"background_themeAnimatedGradient5__hIyI4",themeAnimatedGradient6:"background_themeAnimatedGradient6__qIqf9",postColor1:"background_postColor1__oX9My",postColor2:"background_postColor2__8sq0s",postColor3:"background_postColor3__x4vQq",dribble:"background_dribble__6hqn4"}},2529:function(e){e.exports={parent:"postCard_parent__R11lu",flipBoxInner:"postCard_flipBoxInner__yztGC",flip:"postCard_flip__8uI_I",front:"postCard_front__9cBSS",back:"postCard_back__YMSzT",top:"postCard_top__Pj0JN",deadline:"postCard_deadline__uZkYN",lateDeadline:"postCard_lateDeadline__SV6ae",openInfo:"postCard_openInfo__P6ikx",closeInfo:"postCard_closeInfo___eLHn",content:"postCard_content__CUxiF",backContent:"postCard_backContent__Mz3l7",footer:"postCard_footer__w_ry8",deleteIcon:"postCard_deleteIcon__56WiS",editPostBtn:"postCard_editPostBtn__onYek",checkboxContainer:"postCard_checkboxContainer__xxiBV",path:"postCard_path__g9fkw",gradient:"postCard_gradient__yUfsg",dribble:"postCard_dribble__hWHO3"}},4545:function(e){e.exports={parent:"BoardPage_parent__DCmIL",workspaceBoardTitle:"BoardPage_workspaceBoardTitle__ewRX2",highlight:"BoardPage_highlight__P6YHC",createPostBtn:"BoardPage_createPostBtn__08nbg",boardSettingsBtn:"BoardPage_boardSettingsBtn__yr0uT",gradient:"BoardPage_gradient__UWgqI",dribble:"BoardPage_dribble__7Xt2l"}}},function(e){e.O(0,[39,888,774,179],function(){return e(e.s=3906)}),_N_E=e.O()}]);
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.