1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7604],{46795:(e,l,s)=>{"use strict";s.d(l,{A:()=>d,v:()=>c});var t=s(6029),a=s(65403),r=s(39794),i=s(49769),n=s(48942);function c(e){let{className:l,inputClassName:s,onChangeText:c,onChange:d,onReset:o,defaultValue:x,...u}=e;return(0,t.jsx)("div",{className:(0,r.cn)("min-w-40",l),children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:"pointer-events-none absolute inset-y-0 start-1 flex items-center ps-3",children:(0,t.jsx)(i.e,{size:20,alt:"Rechercher"})}),(0,t.jsx)("input",{type:"search",id:"default-search",className:(0,r.cn)("block w-full rounded-lg border-gray-300 bg-gray-100 p-3.5 ps-10 text-sm text-gray-900 focus:border-blue-500 focus:ring-blue-500",{"no-input-cross":!!o},s),placeholder:"Rechercher",...u,onChange:e=>{d&&d(e),c&&c(e.target.value)},defaultValue:x}),o&&(0,t.jsx)(a.$,{variant:"ghost",className:"absolute inset-y-0 right-1 my-auto p-1 text-gray-500",size:"fit",onClick:o,children:(0,t.jsx)(n.J,{size:20,alt:"Supprimer le texte"})})]})})}let d=c},48942:(e,l,s)=>{"use strict";s.d(l,{J:()=>n});var t=s(55729),a=s(11211);let r=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M168.49,104.49,145,128l23.52,23.51a12,12,0,0,1-17,17L128,145l-23.51,23.52a12,12,0,0,1-17-17L111,128,87.51,104.49a12,12,0,0,1,17-17L128,111l23.51-23.52a12,12,0,0,1,17,17ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),t.createElement("path",{d:"M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,130.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M164.24,100.24,136.48,128l27.76,27.76a6,6,0,1,1-8.48,8.48L128,136.48l-27.76,27.76a6,6,0,0,1-8.48-8.48L119.52,128,91.76,100.24a6,6,0,0,1,8.48-8.48L128,119.52l27.76-27.76a6,6,0,0,1,8.48,8.48ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M162.83,98.83,133.66,128l29.17,29.17a4,4,0,0,1-5.66,5.66L128,133.66,98.83,162.83a4,4,0,0,1-5.66-5.66L122.34,128,93.17,98.83a4,4,0,0,1,5.66-5.66L128,122.34l29.17-29.17a4,4,0,1,1,5.66,5.66ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),i=t.forwardRef((e,l)=>t.createElement(a.A,{ref:l,...e,weights:r}));i.displayName="XCircleIcon";let n=i},52378:(e,l,s)=>{"use strict";s.r(l),s.d(l,{default:()=>A});var t=s(6029),a=s(55729),r=s(39794),i=s(7885),n=s(46795),c=s(17325),d=s(37511),o=s(65403),x=s(34759);let u=e=>{let{confirmText:l,children:s,...r}=e,{onClick:i,...n}=r,[c,d]=(0,a.useState)(!1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.$,{...n,onClick:e=>{e.preventDefault(),d(!0)},children:s}),(0,t.jsx)(x.lG,{open:c,onOpenChange:d,children:(0,t.jsxs)(x.Cf,{children:[(0,t.jsx)(x.L3,{children:"Confirmer l'action"}),(0,t.jsx)("p",{className:"text-sm",children:l}),(0,t.jsxs)(x.Es,{children:[(0,t.jsx)(o.$,{variant:"ghost-blue",className:"border-none outline-none",onClick:()=>{d(!1)},children:"Annuler"}),(0,t.jsx)(o.$,{variant:"destructive-filled",onClick:e=>{e.preventDefault(),null==i||i(e),d(!1)},children:"Confirmer"})]})]})})]})};function h(e){var l;let{id:s,lastMessage:a,with:i,active:n,pictureUrl:o,archive:x}=e;return(0,t.jsx)("div",{className:(0,r.cn)("border-b p-4",n&&"border-r-[5px] border-r-blue-500 bg-blue-50"),children:(0,t.jsxs)("div",{className:"flex gap-4",children:[(0,t.jsx)("img",{src:o||"/images/anonymous_avatar.svg",alt:"profile",className:"aspect-square size-10 rounded-full"}),(0,t.jsxs)("div",{className:"flex w-full flex-col gap-1",children:[(0,t.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,t.jsxs)("p",{className:"text-sm font-bold",children:[i.firstName," ",i.lastName]}),(0,t.jsx)("p",{className:(0,r.cn)("w-min rounded-full border px-2 text-xs font-semibold",{"bg-blue-500 text-white":!(null==a?void 0:a.isRead),"bg-white text-black":null==a?void 0:a.isRead}),children:(0,c.Smb)(null==a?void 0:a.sentAt)})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-1",children:[(0,t.jsx)("div",{className:"no-scrollbar mr-4 flex flex-wrap gap-1 overflow-hidden",children:i.roles&&i.roles.map((e,l)=>(0,t.jsx)("p",{className:"min-w-max overflow-hidden whitespace-nowrap rounded-full border bg-white px-2 text-xs",children:(0,c.d9G)(e.role)},l))}),(0,t.jsx)("p",{className:"text-left text-xs",children:(null!=(l=null==a?void 0:a.content.substring(0,45))?l:"")+"..."})]}),void 0!==x?(0,t.jsx)(u,{variant:"null",confirmText:"Voulez-vous archiver cette c
1onversation ?",className:"px-1",onClick:()=>x(s),children:(0,t.jsx)(d.T,{size:22,className:"text-amber-600"})}):null]})]})]})})}let m=function(e){let{participant:l,pictureUrl:s,fromBackoffice:a}=e;return(0,t.jsxs)("div",{className:"flex items-center gap-4 border-b p-4",children:[(0,t.jsx)("img",{src:s||"/images/anonymous_avatar.svg",alt:"profile",className:"aspect-square size-12 rounded-full"}),(0,t.jsxs)("div",{className:"flex w-full justify-between",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("p",{className:"text-sm font-bold",children:"AC-EXPO"===l.id?"Connect'Events":"".concat(l.firstName," ").concat(l.lastName)}),(0,t.jsx)("p",{className:"max-w-40 truncate text-sm font-semibold",children:l.businessName})]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:l.roles&&l.roles.map(e=>(0,t.jsx)("p",{className:(0,r.cn)("h-fit w-min text-nowrap rounded-full border bg-slate-200 px-2 text-xs",{"bg-white":a}),children:"acExpo"===e.role?"SAV":(0,c.d9G)(e.role)},e.role))})]})]})};var f=s(30616),p=s(91625);function v(e){let{conversation:l,sendMessage:s,pictureUrl:i,withHeader:n=!0,fromBackoffice:c,cannotSendMessage:d}=e,o=(0,a.useRef)(null),x=(0,a.useRef)(null);(0,a.useEffect)(()=>{o.current&&x.current&&(x.current.scrollTo({top:x.current.scrollHeight,behavior:"smooth"}),o.current.scrollTo({behavior:"smooth"}))},[null==l?void 0:l.with.id,null==l?void 0:l.messages.length]);let[u,h]=(0,a.useState)(""),v=(0,a.useCallback)(async()=>{if(u.trim())try{var e;s({toUserId:null!=(e=null==l?void 0:l.with.id)?e:"",messageContent:u}),h(""),x.current&&x.current.scrollTo({top:x.current.scrollHeight,behavior:"smooth"})}catch(e){console.error("Failed to send message:",e)}},[u,s,null==l?void 0:l.with.id]);if(!l)return(0,t.jsxs)("div",{className:"flex w-full flex-col",children:[(0,t.jsx)("div",{className:"flex h-[84px] w-full items-center gap-4 border-b bg-white p-4"}),(0,t.jsxs)("div",{className:"flex size-full flex-col items-center justify-center gap-4 bg-gray-50",children:[(0,t.jsx)(f.x,{size:24,fill:"#287BB9"}),(0,t.jsx)("p",{className:"text-base text-gray-500",children:"Aucune discussion pour le moment"})]})]});let{messages:g,with:j}=l;return(0,t.jsxs)("div",{className:"flex size-full flex-col ",children:[n&&(0,t.jsx)(m,{participant:j,pictureUrl:i,fromBackoffice:c}),(0,t.jsxs)("div",{className:"flex h-full flex-col space-y-2 overflow-auto bg-gray-50 px-6 pt-6",ref:x,children:[g.slice().reverse().map(e=>(0,t.jsx)("div",{className:(0,r.cn)("flex w-full",{"justify-start":e.senderId===j.id,"justify-end pl-10":e.senderId!==j.id}),children:(0,t.jsx)("div",{className:(0,r.cn)("max-w-full text-wrap break-words rounded-b-lg px-4 py-2 text-sm",{"rounded-tr-lg border bg-white text-black":e.senderId===j.id,"rounded-tl-lg bg-blue-700 text-white":e.senderId!==j.id}),children:e.content})},e.id)),(0,t.jsx)("div",{ref:o})," "]}),!d&&(0,t.jsxs)("div",{className:"flex items-center gap-3 border-t px-6 py-3",children:[(0,t.jsx)("input",{type:"text",placeholder:"Message",className:"w-full rounded-lg border border-gray-200 p-4",value:u,onChange:e=>h(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),v())}}),(0,t.jsx)("button",{onClick:()=>v(),children:(0,t.jsx)(p.M,{size:21,fill:"#287BB9",weight:"fill"})})]})]})}let g=["acExpo","exhibitor","exhibitorCommercial","organiser","tourismOperator","placeManager"];function j(e){var l,s,a;let{participant:n,setParticipant:d,conversation:o,pictureUrl:u,roleColorClassname:h,fromBackoffice:m,cannotSendMessage:f,...p}=e,{with:j}=null!=o?o:{};(null==j?void 0:j.id)==="AC-EXPO"&&(j.roles=[{role:"acExpo"}]);let w=null!=(l=null==j?void 0:j.roles)?l:[],b=null!=(s=w.sort((e,l)=>g.indexOf(e.role)-g.indexOf(l.role)).slice(0,2))?s:[];return(0,t.jsx)(x.lG,{open:""!==n,onOpenChange:e=>{e||d("")},children:(0,t.jsxs)(x.Cf,{className:"flex h-full max-h-full max-w-full flex-col gap-0 bg-white p-0 sm:rounded-none",withCloseButton:!1,children:[j&&(0,t.jsxs)(x.c7,{className:(0,r.cn)("flex h-fit flex-row items-center justify-between gap-2 p-4",h,{"text-white":h}),children:[(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,t.jsx)(x.HM,{asChild:!0,children:(0,t.jsx)(i.A,{svgType:"arrowLeft",svgProps:{color:h?"white":"black",size:24},variant:"hidden"})}),(0,t.jsx)("img",{src:u||"/images/anonymous_avatar.svg",alt:"profile",className:"aspect-square size-12 rounded-full"}),(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)(x.L3,{className:"text-sm font-bold",children:"AC-EXPO"===j.id?"Connect'Events":(0,
1c.mG7)(j)}),(0,t.jsx)("p",{className:"max-w-40 truncate text-sm font-semibold",children:null!=(a=j.businessName)?a:null})]})]}),(0,t.jsxs)("div",{className:"flex flex-col items-end gap-1.5",children:[b.map(e=>(0,t.jsx)("p",{className:(0,r.cn)("h-fit w-min text-nowrap rounded-full border border-white bg-slate-200 px-2 text-xs",h),children:"acExpo"===e.role?"SAV":(0,c.d9G)(e.role)},e.role)),w.length>b.length&&(0,t.jsxs)("p",{className:(0,r.cn)("h-fit w-min text-nowrap rounded-full border border-white px-2 text-xs",h),children:["+",w.length-b.length]},"additional")]})]}),(0,t.jsx)("div",{className:"h-full overflow-y-auto",children:(0,t.jsx)(v,{conversation:o,withHeader:!1,pictureUrl:u,fromBackoffice:m,cannotSendMessage:f,...p})})]})})}var w=s(90198),b=s(35077);function N(e){let{filter:l,setFilter:s}=e,n=(0,r.al)(),[c,d]=(0,a.useState)(!1);return(0,t.jsxs)(b.AM,{children:[(0,t.jsx)(b.Wv,{asChild:!0,children:(0,t.jsx)(i.A,{svgType:"funnel",svgProps:{size:24,className:"text-primary-500 md:text-gray-500"},variant:n?"outline-white":"hidden",onClick:()=>d(!c)})}),(0,t.jsxs)(b.hl,{className:"flex flex-col gap-2 p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between rounded-lg border px-4 py-3",children:[(0,t.jsx)("label",{htmlFor:"exposants",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Exposants"}),(0,t.jsx)(w.S,{id:"exposants",checked:l.exponent,onCheckedChange:()=>s({...l,exponent:!l.exponent})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between rounded-lg border px-4 py-3",children:[(0,t.jsx)("label",{htmlFor:"organizers",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Organisateurs"}),(0,t.jsx)(w.S,{id:"organizers",checked:l.organizer,onCheckedChange:()=>s({...l,organizer:!l.organizer})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between rounded-lg border px-4 py-3",children:[(0,t.jsx)("label",{htmlFor:"visitors",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Visiteurs"}),(0,t.jsx)(w.S,{id:"visitors",checked:l.visitor,onCheckedChange:()=>s({...l,visitor:!l.visitor})})]})]})]})}var y=s(4516),C=s(40334),k=s(73492),E=s(81278);let A=function(){var e,l,s;let d=(0,E.useRouter)(),{participantId:x}=d.query,u=(0,r.al)(),[m,f]=(0,a.useState)(null!=x?x:null),[p,g]=(0,a.useState)(""),[w,b]=(0,a.useState)({}),{data:A,refetch:M}=(0,k.Owu)(w),{data:L,isLoading:z,refetch:Z}=(0,k.ZBb)(null!=m?m:"ac-expo-admin"),{mutate:S}=(0,k.EQi)(),{mutate:_}=(0,k.Q0s)(),O=e=>{_(e,{onSuccess:()=>{M(),Z()}})};(0,a.useEffect)(()=>{Z(),M()},[M,Z,m]);let F=null==A?void 0:A.filter(e=>{let{with:{firstName:l,lastName:s}}=e;return(0,c.Cd)(p,"".concat(l," ").concat(s))});(0,a.useEffect)(()=>{!1===u&&(x?f(x):A&&A.length>0&&f(A[0].with.id))},[A,x,u]);let T=(0,a.useCallback)(()=>{f("AC-EXPO")},[]),B=(0,a.useCallback)(e=>{f(e),Z(),d.replace({pathname:d.pathname,query:{participantId:e}},void 0,{shallow:!0})},[m]);return u?(0,t.jsxs)("div",{className:"flex h-full flex-col",children:[(0,t.jsx)("div",{children:(0,t.jsxs)("div",{className:"flex items-center justify-between p-6",children:[(0,t.jsx)("h1",{className:"text-2xl font-extrabold",children:"Messagerie"}),(0,t.jsx)(i.K,{svgType:"lifeBuoy",svgProps:{className:"text-primary-500"},variant:"hidden",onClick:T})]})}),(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 md:border",children:[(0,t.jsxs)("div",{className:"flex w-full min-w-64 flex-col border border-t-0 md:w-3/12",children:[(0,t.jsx)("div",{className:"flex items-center gap-4 border-b px-[14px] py-4",children:(0,t.jsx)("div",{className:"grow",children:(0,t.jsx)(n.v,{onChangeText:g,value:p})})}),(0,t.jsx)("div",{className:"relative size-full h-full overflow-y-auto",children:F&&F.length?null==F?void 0:F.map(e=>{var l;return(0,t.jsx)("button",{onClick:()=>B(e.with.id),className:"w-full",children:(0,t.jsx)(h,{...e,archive:O,active:m===e.with.id,pictureUrl:(0,C.w8)(null==(l=e.with.picture)?void 0:l.key,"media")})},e.with.id)}):(0,t.jsxs)("div",{className:"flex size-full flex-col items-center justify-center gap-4 bg-gray-50 py-4",children:[(0,t.jsx)(y.gy,{width:20,height:20,fill:"#287BB9"}),(0,t.jsx)("p",{className:"text-base text-gray-500",children:"Aucune discussion pour le moment"})]})})]}),(0,t.jsx)(j,{participant:null!=m?m:"",setParticipant:f,conversation:L,sendMessage:S,pictureUrl:(0,C.w8)(null==L||null==(s=L.with.picture)?void 0:s.key,"media")})]})]}):(0,t.jsxs)("div",{className:"bg-white px-20 py-10",children:[(0,t.jsxs)("div",{className:"flex justify-between pb-6",children:[(0,t.jsx)("h1",{className:"text-4xl font-bold",children:"Messagerie"}),(0,t.jsx)(o.$,{className:"border shadow-none",onClick:T,children:"Contacter Connect'Events"})]}),(0,t.jsxs)("div",{className:"flex h-[625px] border",children:[(0,t.jsxs)("div",{className:"h-full w-1/3 border",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 border-b px-[14px] py-4",children:[(0,t.jsx)("div",{className:"grow",children:(0,t.jsx)(n.v,{onChangeText:g,value:p})}),(0,t.jsx)(N,{filter:w,setFilter:b})]}),(0,t.jsxs)("div",{className:"no-scrollbar h-[546px] overflow-y-auto",children:[L&&!L.messages.length?(0,t.jsx)("button",{onClick:()=>{var e;
1return B(null!=(e=L.with.id)?e:"")},className:"w-full",children:(0,t.jsx)(h,{archive:e=>O(e),id:L.id,lastMessage:null,with:L.with,active:m===L.with.id,pictureUrl:(0,C.w8)(null==(e=L.with.picture)?void 0:e.key,"media")})},L.with.id):null,null==F?void 0:F.map(e=>{var l;return(0,t.jsx)("button",{onClick:()=>{var l;return B(null!=(l=e.with.id)?l:"")},className:"w-full",children:(0,t.jsx)(h,{id:e.id,archive:e=>O(e),lastMessage:e.lastMessage,with:e.with,active:m===e.with.id,pictureUrl:(0,C.w8)(null==(l=e.with.picture)?void 0:l.key,"media")})},e.with.id)})]})]}),(0,t.jsx)("div",{className:"flex h-full w-4/5",children:z?(0,t.jsx)("div",{className:"h-full"}):(0,t.jsx)(v,{conversation:L,sendMessage:S,pictureUrl:(0,C.w8)(null==L||null==(l=L.with.picture)?void 0:l.key,"media")})})]})]})}},82996:(e,l,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/conversations",function(){return s(52378)}])}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=82996)),_N_E=e.O()}]); 2//# sourceMappingURL=conversations-b7dbdf4edcc9c9ad.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.