PageSourceSearch

https://cness.io/_next/static/chunks/33574.48cd91214c53e2dd.js

js cness.io collected 2026-10-09 23:00:40 UTC 8,129 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[33574],{44676:(e,t,s)=>{s.r(t),s.d(t,{default:()=>u});var r=s(95155),n=s(12115),a=s(20063),l=s(99919);let i={fontFamily:"Poppins, sans-serif"},o="linear-gradient(90deg, #7077FE 0%, #F07EFF 100%)";function d(e){return new Date(e).toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function c(e){return e&&"".concat(e.first_name||""," ").concat(e.last_name||"").trim()||"them"}function u(e){let{inquiryId:t}=e,s=(0,a.useRouter)(),u=(0,a.useSearchParams)(),x=(null==u?void 0:u.get("from"))==="my-space"?"/dashboard/directory/my-space":"/dashboard/directory/client-inquiries",[m,p]=(0,n.useState)(null),[h,f]=(0,n.useState)([]),[g,y]=(0,n.useState)({}),[b,v]=(0,n.useState)(null),[j,w]=(0,n.useState)(!0),[N,k]=(0,n.useState)(""),[F,_]=(0,n.useState)(""),[A,C]=(0,n.useState)(!1),[S,U]=(0,n.useState)(""),D=(0,n.useRef)(null),E=(0,n.useRef)(null),R=async()=>{var e,s,r,n;if(t){w(!0),k("");try{let s=await (0,l.qp3)(t),r=null==s||null==(e=s.data)?void 0:e.data;p((null==r?void 0:r.inquiry)||null),f((null==r?void 0:r.rows)||[]),y((null==r?void 0:r.participants)||{}),v((null==r?void 0:r.current_user_id)||null)}catch(e){k((null==e||null==(n=e.response)||null==(r=n.data)||null==(s=r.error)?void 0:s.message)||"Failed to load conversation. Please try again.")}finally{w(!1)}}};(0,n.useEffect)(()=>{R()},[t]),(0,n.useEffect)(()=>{let e=D.current;e&&(e.scrollTop=e.scrollHeight)},[h]);let L=async()=>{var e,s,r,n,a;let i=F.trim();if(!i)return void U("Please enter a message.");if(i.length>2e3)return void U("Message must be ".concat(2e3," characters or fewer."));if(!A){U(""),C(!0);try{let s=await (0,l.B0J)({directory_inquiry_id:t,message:i}),r=null==s||null==(e=s.data)?void 0:e.data;r&&(f(e=>[...e,r]),_(""))}catch(e){U((null==e||null==(n=e.response)||null==(r=n.data)||null==(s=r.error)?void 0:s.message)||"Failed to send message. Please try again.")}finally{C(!1),null==(a=E.current)||a.focus()}}},B=Object.values(g).find(e=>e.user_id!==b);return j?(0,r.jsx)("div",{className:"min-h-screen bg-[#FAFAFA] flex items-center justify-center",children:(0,r.jsx)("div",{className:"w-8 h-8 rounded-full border-4 border-indigo-200 border-t-indigo-500 animate-spin"})}):N||!m?(0,r.jsxs)("div",{className:"min-h-screen bg-[#FAFAFA] px-6 py-10",style:i,children:[(0,r.jsxs)("button",{onClick:()=>s.push(x),className:"flex items-center gap-1.5 text-sm font-semibold text-gray-500 hover:text-indigo-600 transition-colors mb-6",children:[(0,r.jsxs)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("line",{x1:"19",y1:"12",x2:"5",y2:"12"}),(0,r.jsx)("polyline",{points:"12 19 5 12 12 5"})]}),"Back"]}),(0,r.jsxs)("div",{className:"bg-white border border-[#e2e8f0] rounded-xl flex flex-col items-center gap-4 py-16 px-6 w-full",children:[(0,r.jsx)("p",{className:"text-sm text-[#ef4444]",children:N||"Inquiry not found."}),(0,r.jsx)("button",{onClick:R,className:"px-5 py-2.5 rounded-full text-sm font-semibold text-white transition-opacity hover:opacity-90",style:{background:o},children:"Retry"})]})]}):(0,r.jsxs)("div",{className:"flex flex-col bg-[#FAFAFA] px-6 pt-10",style:{height:"calc(100dvh - 80px)",maxHeight:"calc(100dvh - 80px)",fontFamily:"Poppins, sans-serif",overflow:"hidden"},children:[(0,r.jsx)("div",{className:"flex items-start justify-between gap-4 mb-5 shrink-0",children:(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsxs)("button",{onClick:()=>s.push(x),className:"flex items-center gap-1.5 text-sm font-semibold text-gray-500 hover:text-indigo-600 transition-colors shrink-0",children:[(0,r.jsxs)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("line",{x1:"19",y1:"12",x2:"5",y2:"12"}),(0,r.jsx)("polyline",{points:"12 19 5 12 12 5"})]}),"Back"]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("h1",{className:"text-2xl font-bold text-[#19295C]",children:["Chat with ",c(B)]}),m.service_name?(0,r.jsxs)("p",{className:"text-sm text-gray-500 mt-1",children:["Regarding: ",m.service_name]}):null]})]})}),(0,r.jsxs)("div",{ref:D,className:"flex-1 overflow-y-auto space-y-4 pr-1 min-h-0",children:[0===h.length&&(0,r.jsx)("p",{className:"text-sm text-gray-400 text-center mt-8",children:"No messages yet. Say hello!"}),h.map(e=>{let t=e.sender_user_id===b,s=t?"You":c(g[e.sender_user_id]);return t?(0,r.jsxs)("div",{className:"bg-white border border-gray-200 rounded-xl px-5 py-4 ml-auto max-w-[85%] sm:max-w-[70%]",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-4 mb-2",children:[(0,r.jsx)("span",{className:"text-[11px] font-bold uppercase tracking-wider text-gray-500",children:s}),(0,r.jsx)("span",{className:"text-xs text-gray-400",children:d(e.createdAt)})]}),(0,r.jsx)("p",{className:"text-sm text-gray-700 leading-relaxed whitespace-pre-wrap break-words",children:e.message})]},e.id):(0,r.jsxs)("div",{className:"border border-indigo-100 rounded-xl px-5 py-4 mr-auto max-w-[85%] sm:max-w-[70%]",style:{background:"#575FFF0D"},children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-4 mb-2",children:[(0,r.jsx)("span",{className:"text-[11px] font-bold uppercase tracking-wider text-indigo-500",children:s}),(0,r.jsx)("span",{className:"text-xs text-gray-400",children:d(e.createdAt)})]}),(0,r.jsx)("p",{className:"text-sm text-gray-700 leading-relaxed whitespace-pre-wrap break-words",children:e.message})]},e.id)}),(0,r.jsx)("div",{})]}),(0,r.jsxs)("div",{className:"shrink-0 relative pt-3 pb-8 bg-[#FAFAFA]",children:[S?(0,r.jsx)("p",{className:"text-xs text-[#ef4444] mb-2",children:S}):null,(0,r.jsx)("textarea",{ref:E,rows:5,value:F,onChange:e=>{_(e.target.value),S&&U("")},onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),L())},placeholder:"Type a message…",maxLength:2e3,className:"w-full resize-none rounded-xl border border-gray-200 bg-white px-4 py-3 pr-16 text-sm text-gray-800 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-300 leading-5",style:{fontFamily:"Poppins, sans-serif",minHeight:"120px"}}),(0,r.jsx)("button",{onClick:L,disabled:!F.trim()||A,className:"absolute right-3 bottom-11 w-10 h-10 rounded-xl flex items-center justify-center text-white transition-all disabled:opacity-40",style:{background:o},children:A?(0,r.jsxs)("svg",{className:"w-4 h-4 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8z"})]}):(0,r.jsxs)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),(0,r.jsx)("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]})]})}},49675:(e,t,s)=>{let r;s.d(t,{A:()=>i});let n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},a=new Uint8Array(16),l=[];for(let e=0;e<256;++e)l.push((e+256).toString(16).slice(1));let i=function(e,t,s){if(n.randomUUID&&!t&&!e)return n.randomUUID();var i=e,o=s;let d=(i=i||{}).random??i.rng?.()??function(){if(!r){if("undefined"==typeof crypto||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");r=crypto.getRandomValues.bind(crypto)}return r(a)}();if(d.length<16)throw Error("Random bytes length must be >= 16");if(d[6]=15&d[6]|64,d[8]=63&d[8]|128,t){if((o=o||0)<0||o+16>t.length)throw RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[o+e]=d[e];return t}return function(e,t=0){return(l[e[t+0]]+l[e[t+1]]+l[e[t+2]]+l[e[t+3]]+"-"+l[e[t+4]]+l[e[t+5]]+"-"+l[e[t+6]]+l[e[t+7]]+"-"+l[e[t+8]]+l[e[t+9]]+"-"+l[e[t+10]]+l[e[t+11]]+l[e[t+12]]+l[e[t+13]]+l[e[t+14]]+l[e[t+15]]).toLowerCase()}(d)}}}]);

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.