PageSourceSearch

https://salsafy.de/assets/ChatConversationPage-GnwSGNGy.js

js salsafy.de collected 2026-10-09 03:14:35 UTC 16,667 bytes, 1 lines download raw bytes

1import{j as e,r as a,b as Ne}from"./vendor-react-BLd8mmr6.js";import{b0 as ke,ea as F,u as ve,dW as _e,cX as Se,eO as Ce,eP as Ie,eN as Re,eQ as Ae,eR as Ee,d_ as De,i as Te,aL as Le,cD as We,ag as q,bt as Me,es as Oe,d2 as J,d3 as ze,eL as Z,o as Be,n as Fe,T as Ue,Q as $e,B as Ke,m as He,I as Pe,cG as Ve,eS as Ge,af as Xe,eT as Qe,eU as Ye,eq as qe,eM as ee,eV as Je}from"./index-mLNDsTZ4.js";import{g as Ze,G as te,R as et}from"./supportContextService-9b3-lHle.js";import{M as tt}from"./MiniProfileSheet-D_DNhXmf.js";import{C as st}from"./ConfirmDialog-PEbC80Id.js";import{u as ae}from"./vendor-i18n-BGWH4Q58.js";import{d as at,c as rt,u as nt,L as ot}from"./vendor-react-router-B43bhDT7.js";import{L as lt}from"./lock-Dxolwynh.js";import{L as ct}from"./lightbulb-B0g-cTJX.js";import{c as N}from"./vendor-sentry-CC1TO5EG.js";import"./vendor-firebase-wcAle6Yt.js";import"./user-round-DUbXV2Vv.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"bce9c8c0728bbe85a671ee648a55aabf815267c0"};var o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="dcb5e430-f137-4cad-abb3-2451c17be4f8",t._sentryDebugIdIdentifier="sentry-dbid-dcb5e430-f137-4cad-abb3-2451c17be4f8")}catch{}})();const it=500;function dt(t){return t.open?e.jsx(xt,{...t}):null}function xt({title:t,prompt:o,submitLabel:f,busy:c=!1,onSubmit:R,onCancel:u}){const{t:p}=ae(),k=a.useId(),b=a.useId(),[A,r]=a.useState(""),E=a.useRef(null),d=a.useRef(null);return ke(d,!0,u,{startFokus:E}),Ne.createPortal(e.jsxs("div",{ref:d,className:"fixed inset-0 z-[110] flex items-end justify-center sm:items-center sm:p-4",children:[e.jsx("button",{type:"button",tabIndex:-1,"aria-label":p("common.cancel"),onClick:u,className:"absolute inset-0 cursor-default bg-black/70 backdrop-blur-sm"}),e.jsxs("form",{role:"dialog","aria-modal":"true","aria-labelledby":k,onSubmit:v=>{v.preventDefault(),!c&&R(A.trim()||void 0)},className:"relative w-full max-w-md rounded-t-3xl border border-white/10 bg-zinc-900 p-6 pb-[max(1.5rem,env(safe-area-inset-bottom,1.5rem))] shadow-2xl sm:rounded-3xl sm:pb-6",children:[e.jsx("div",{className:"mx-auto mb-4 h-1 w-10 rounded-full bg-white/20 sm:hidden","aria-hidden":!0}),e.jsx("h2",{id:k,className:"text-lg font-bold text-white",children:t}),e.jsx("label",{htmlFor:b,className:"mt-3 block text-sm text-zinc-300",children:o}),e.jsx("textarea",{id:b,ref:E,value:A,maxLength:it,onChange:v=>r(v.target.value),rows:4,className:"mt-2 w-full resize-none rounded-xl border border-feld-rahmen bg-black/40 px-3 py-2.5 text-sm text-white placeholder:text-zinc-400 focus:border-terracotta focus:outline-none focus:ring-1 focus:ring-terracotta"}),e.jsxs("div",{className:"mt-5 flex justify-end gap-3",children:[e.jsx("button",{type:"button",onClick:u,disabled:c,className:"min-h-[44px] rounded-xl border border-white/15 px-4 py-2 text-sm font-semibold text-white transition-colors hover:bg-white/10 disabled:opacity-50",children:p("common.cancel")}),e.jsxs("button",{type:"submit",disabled:c,className:"inline-flex min-h-[44px] items-center gap-2 rounded-xl bg-red-600 px-5 py-2 text-sm font-bold text-white shadow-card transition-colors hover:bg-red-700 disabled:opacity-50",children:[e.jsx(F,{className:"h-4 w-4",strokeWidth:2,"aria-hidden":!0}),f]})]})]})]}),document.body)}const se="salsafy_chat_safety_hint_seen",ht=[{key:"bug",Icon:Ue},{key:"event",Icon:$e},{key:"idea",Icon:ct},{key:"organizer",Icon:Ke},{key:"artist",Icon:He},{key:"other",Icon:Pe}];function _t(){var Y;const{t}=ae(),{user:o,isAdmin:f}=ve(),{convId:c}=at(),[R]=rt(),u=R.get("with"),p=R.get("rel"),k=nt(),[b,A]=a.useState([]),[r,E]=a.useState(null),[d,v]=a.useState(""),re=_e(o==null?void 0:o.uid),[x,ne]=a.useState(null),[L,D]=a.useState(""),[U,$]=a.useState(!1),[oe,_]=a.useState(!0),[le,S]=a.useState(!1),[ce,ie]=a.useState(0),[de,C]=a.useState(!1),[I,g]=a.useState(null),[xe,W]=a.useState(!1),[K,y]=a.useState(!1),{showToast:j}=Se(),[he,T]=a.useState(!1),[n,ue]=a.useState(null),[me,fe]=a.useState(()=>{try{return typeof window<"u"&&window.localStorage.getItem(se)==="1"}catch{return!0}}),H=a.useRef(null);if(a.useEffect(()=>{if(!o||!c)return;let s=!1,l=()=>{};return(async()=>{try{u&&(p==="partner"||p==="friend")&&await Ce(o.uid,u,p);const i=await Ie(c);if(s)return;ne(i);const m=u||(i==null?void 0:i.participants.find(h=>h!==o.uid))||"";if(s||v(m),m){const h=await Re(m).catch(()=>null);s||E(h)}l=Ae(c,(h,B)=>
1{if(h.length===0&&(B!=null&&B.fromCache)){s||(S(!0),_(!1));return}A(h),_(!1),S(!1),Ee(c,o.uid).catch(()=>{})},void 0,h=>{console.error("[chat] Verlauf laden fehlgeschlagen",h),N(h,{tags:{feature:"chat",action:"listen"}}),s||(S(!0),_(!1))})}catch(i){console.error("[chat] Konversation laden fehlgeschlagen",i),N(i,{tags:{feature:"chat",action:"open"}}),s||(S(!0),_(!1))}})(),()=>{s=!0,l()}},[o,c,u,p,ce]),a.useEffect(()=>{var s;(s=H.current)==null||s.scrollIntoView({behavior:"smooth"})},[b]),a.useEffect(()=>{if(!f||!d||(x==null?void 0:x.relationship)!=="support")return;let s=!1;return Ze(d).then(l=>{s||ue(l)}).catch(()=>{}),()=>{s=!0}},[f,d,x==null?void 0:x.relationship]),!o||!c)return null;const P=!!(x!=null&&x.lockedAt),M=(x==null?void 0:x.relationship)==="support",O=M&&!f,w=O?t("support_chat.team_name"):(n==null?void 0:n.fullName)||(r==null?void 0:r.fullName)||t("profile_visibility.not_public"),z=De(r,re.has(d)),pe=(r==null?void 0:r.danceRole)==="leader"?t("partner_search.role_leader"):(r==null?void 0:r.danceRole)==="follower"?t("partner_search.role_follower"):(r==null?void 0:r.danceRole)==="both"?t("partner_search.role_both"):"",V=[r==null?void 0:r.city,pe].filter(Boolean).join(", "),G=async s=>{s.preventDefault();const l=L.trim();if(!(!l||U||P)){$(!0),D("");try{await Qe(c,o.uid,l)}catch(i){D(l),i instanceof Ye?j(t("chat.blocked_content"),"error"):(console.error("[chat] Senden fehlgeschlagen",i),N(i,{tags:{feature:"chat",action:"send"}}),j(t("chat.send_error"),"error"))}finally{$(!1)}}},be=()=>{fe(!0);try{window.localStorage.setItem(se,"1")}catch{}},X=()=>{d&&(C(!1),g("block"))},ge=async()=>{if(d){y(!0);try{await qe(o.uid,d),await ee(c,o.uid).catch(()=>{}),g(null),k("/mein-bereich/nachrichten")}catch(s){console.error("[chat] Blockieren fehlgeschlagen",s),N(s,{tags:{feature:"chat",action:"block"}}),g(null),j(t("chat.action_error"),"error")}finally{y(!1)}}},ye=()=>{C(!1),g("delete")},je=async()=>{y(!0);try{await ee(c,o.uid),g(null),k("/mein-bereich/nachrichten")}catch(s){console.error("[chat] Löschen fehlgeschlagen",s),N(s,{tags:{feature:"chat",action:"delete"}}),g(null),j(t("chat.action_error"),"error")}finally{y(!1)}},Q=()=>{d&&(C(!1),W(!0))},we=async s=>{if(d){y(!0);try{await Je(c,o.uid,d,s),W(!1),j(t("chat.report_done"),"success")}catch(l){console.error("[chat] Melden fehlgeschlagen",l),N(l,{tags:{feature:"chat",action:"report"}}),j(t("chat.action_error"),"error")}finally{y(!1)}}};return e.jsxs("div",{className:"mx-auto max-w-2xl px-3 py-4 md:px-4",children:[e.jsx(Te,{title:t("chat.seo_title"),noindex:!0}),e.jsxs("div",{className:"flex h-[calc(100vh-176px)] flex-col overflow-hidden rounded-3xl border border-zinc-200 bg-white shadow-card",children:[e.jsxs("div",{className:"flex items-center gap-3 border-b border-gray-100 px-4 py-3",children:[e.jsx(ot,{to:"/mein-bereich/nachrichten",className:"rounded-full p-1.5 text-gray-500 hover:bg-gray-100","aria-label":t("chat.back"),children:e.jsx(Le,{className:"h-5 w-5",strokeWidth:2})}),O?e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-terracotta text-lg font-black text-white",children:"S"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("p",{className:"flex items-center gap-1.5 truncate font-semibold text-gray-900",children:[w,e.jsx(We,{className:"h-4 w-4 flex-shrink-0 text-terracotta",strokeWidth:2})]}),e.jsxs("p",{className:"flex items-center gap-1 truncate text-xs text-gray-500",children:[e.jsx(q,{className:"h-3 w-3 flex-shrink-0",strokeWidth:2}),t("support_chat.response_time")]})]})]}):r?e.jsxs("button",{type:"button",onClick:()=>T(!0),"aria-label":t("chat.open_profile",{name:w}),className:"flex min-w-0 flex-1 items-center gap-3 rounded-xl px-1 py-0.5 text-left transition-colors hover:bg-gray-50",children:[e.jsx("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center overflow-hidden rounded-full bg-pink-50 text-lg",children:z?e.jsx("img",{src:z,alt:w,className:"h-full w-full object-cover object-top"}):e.jsx(te,{gender:r.gender,className:"h-5 w-5"})}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate font-semibold text-gray-900",children:w}),V&&e.jsx("span",{className:"block truncate text-xs text-gray-500",children:V})]}),e.jsx(Me,{className:"h-4 w-4 flex-shrink-0 text-terracotta",strokeWidth:2})]}):e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center overflow-hidden rounded-full bg-gray-100 text-lg",children:e.jsx(te,{gender:void 0,className:"h-5 w-5"})}),e.jsx("p",{className:`min-w-0 flex-1 truncate font-semibold ${n!=null&&n.fullName?"text-gray-900":"text-gray-500"}`,children:w})]}),e.jsxs("div",{className:"relative flex-shrink-0",children:[e.jsx("button",{type:"button",onClick:()=>C(s=>!s),"aria-label":t("chat.menu_label"),className:"rounded-full p-1.5 text-gray-500 hover:bg-gray-100",children:e.jsx(Oe,{className:"h-5 w-5",strokeWidth:2})}),de&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>C(!1)}
1),e.jsxs("div",{className:"absolute right-0 top-9 z-20 w-44 overflow-hidden rounded-lg border border-gray-100 bg-white shadow-lg",children:[!M&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:Q,className:"flex w-full items-center gap-2 px-4 py-2.5 text-left text-sm text-gray-700 hover:bg-gray-50",children:[e.jsx(F,{className:"h-4 w-4",strokeWidth:2})," ",t("chat.report")]}),e.jsxs("button",{onClick:X,className:"flex w-full items-center gap-2 px-4 py-2.5 text-left text-sm text-red-600 hover:bg-red-50",children:[e.jsx(J,{className:"h-4 w-4",strokeWidth:2})," ",t("chat.block")]}),e.jsx("div",{className:"h-px bg-gray-100"})]}),e.jsxs("button",{onClick:ye,className:"flex w-full items-center gap-2 px-4 py-2.5 text-left text-sm text-gray-700 hover:bg-gray-50",children:[e.jsx(ze,{className:"h-4 w-4",strokeWidth:2})," ",t("chat.delete")]})]})]})]})]}),f&&n&&e.jsxs("div",{className:"mx-4 mt-3 flex flex-wrap items-center gap-x-3 gap-y-1.5 rounded-xl border border-gray-200 bg-gray-50 px-3 py-2.5 text-xs text-gray-700",children:[e.jsx(et,{role:n.role,isArtist:n.isArtist}),n.organizerName&&e.jsx("span",{className:"font-semibold text-gray-900",children:n.organizerName}),n.plan&&e.jsxs("span",{children:[t("support_inbox.ctx_plan"),": ",e.jsx("b",{className:"text-gray-900",children:n.plan})]}),n.subscriptionStatus&&e.jsxs("span",{children:[t("support_inbox.ctx_status"),": ",e.jsx("b",{className:"text-gray-900",children:n.subscriptionStatus})]}),n.eventCount!==null&&e.jsxs("span",{children:[t("support_inbox.ctx_events"),": ",e.jsx("b",{className:"text-gray-900",children:n.eventCount})]}),n.city&&e.jsxs("span",{children:[t("support_inbox.ctx_city"),": ",e.jsx("b",{className:"text-gray-900",children:n.city})]}),((Y=n.createdAt)==null?void 0:Y.toDate)&&e.jsxs("span",{children:[t("support_inbox.ctx_since"),": ",e.jsx("b",{className:"text-gray-900",children:Z(n.createdAt.toDate())})]}),e.jsxs("span",{className:"ml-auto inline-flex items-center gap-1 text-[10px] font-bold uppercase tracking-wider text-gray-400",children:[e.jsx(lt,{className:"h-3 w-3",strokeWidth:2.5}),t("support_inbox.ctx_admin_only")]})]}),!me&&!M&&e.jsxs("div",{className:"mx-4 mt-3 flex items-start justify-between gap-3 rounded-lg border border-sand/40 bg-sand/10 px-3 py-2 text-xs text-gray-600",children:[e.jsx("span",{children:t("chat.safety_hint")}),e.jsx("button",{onClick:be,className:"flex-shrink-0 font-semibold text-terracotta hover:text-terracotta-dark",children:t("chat.safety_hint_ok")})]}),e.jsxs("div",{className:"flex-1 space-y-2 overflow-y-auto px-4 py-4",children:[le?e.jsx(Be,{tone:"light",message:t("load_error.conversation"),onRetry:()=>{S(!1),_(!0),ie(s=>s+1)}}):oe?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(Fe,{className:"h-6 w-6 border-2 border-terracotta border-t-transparent"})}):b.length===0&&O?e.jsxs("div",{className:"py-6",children:[e.jsxs("div",{className:"rounded-2xl border border-gray-100 bg-gray-50 p-5 text-center",children:[e.jsx("div",{className:"mx-auto flex h-14 w-14 items-center justify-center rounded-full bg-terracotta text-2xl font-black text-white",children:"S"}),e.jsx("p",{className:"mt-3 font-bold text-gray-900",children:t("support_chat.welcome_title")}),e.jsx("p",{className:"mt-1.5 text-sm leading-relaxed text-gray-600",children:t("support_chat.welcome_body")}),e.jsxs("p",{className:"mt-3 inline-flex items-center gap-1.5 rounded-full border border-gray-200 px-3 py-1 text-xs text-gray-500",children:[e.jsx(q,{className:"h-3 w-3",strokeWidth:2}),t("support_chat.response_time")]})]}),e.jsx("p",{className:"mt-5 text-xs font-bold uppercase tracking-wider text-gray-400",children:t("support_chat.topics_label")}),e.jsx("div",{className:"mt-2.5 flex flex-wrap gap-2",children:ht.map(({key:s,Icon:l})=>e.jsxs("button",{type:"button",onClick:()=>D(`${t(`support_chat.topic_${s}`)}: `),className:"inline-flex items-center gap-1.5 rounded-full border border-gray-200 bg-white px-3 py-2 text-xs font-semibold text-gray-700 transition-colors hover:border-terracotta hover:text-terracotta",children:[e.jsx(l,{className:"h-3.5 w-3.5 text-terracotta",strokeWidth:2}),t(`support_chat.topic_${s}`)]}
1,s))}),e.jsxs("p",{className:"mt-4 flex items-start gap-2 text-xs text-gray-500",children:[e.jsx(Ve,{className:"mt-0.5 h-3.5 w-3.5 flex-shrink-0 text-terracotta",strokeWidth:2}),t("support_chat.privacy_hint")]})]}):b.length===0?e.jsx("p",{className:"py-12 text-center text-sm text-gray-400",children:t("chat.conversation_empty")}):b.map(s=>{var m,h;const l=s.senderUid===o.uid,i=(h=(m=s.createdAt)==null?void 0:m.toDate)==null?void 0:h.call(m);return e.jsx("div",{className:`flex ${l?"justify-end":"justify-start"}`,children:e.jsxs("div",{className:`max-w-[78%] rounded-2xl px-3.5 py-2 ${l?"bg-terracotta text-white":"bg-gray-100 text-gray-900"}`,children:[e.jsx("p",{className:"whitespace-pre-wrap break-words text-sm",children:s.text}),i&&e.jsx("p",{className:`mt-0.5 text-[10px] ${l?"text-white/70":"text-gray-400"}`,children:Z(i)})]})},s.id)}),e.jsx("div",{ref:H})]}),P?e.jsx("div",{className:"m-4 rounded-xl border border-gray-200 bg-gray-50 px-4 py-3 text-center text-sm text-gray-500",children:t("chat.locked_hint")}):e.jsxs("form",{onSubmit:G,className:"flex items-end gap-2 border-t border-gray-100 px-4 py-3",children:[e.jsx("textarea",{value:L,onChange:s=>D(s.target.value.slice(0,Ge)),onKeyDown:s=>{s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),G(s))},rows:1,placeholder:t("chat.composer_placeholder"),className:"max-h-32 flex-1 resize-none rounded-2xl border border-gray-300 px-4 py-2.5 text-sm focus:border-terracotta focus:outline-none focus:ring-1 focus:ring-terracotta"}),e.jsx("button",{type:"submit",disabled:U||!L.trim(),"aria-label":t("chat.send"),className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full bg-terracotta text-white transition-colors hover:bg-terracotta-dark disabled:opacity-40",children:e.jsx(Xe,{className:"h-5 w-5",strokeWidth:2})})]})]}),he&&r&&e.jsx(tt,{profile:r,showPhoto:!!z,onClose:()=>T(!1),secondaryActions:e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:()=>{T(!1),Q()},className:"inline-flex items-center gap-1.5 transition-colors hover:text-white",children:[e.jsx(F,{className:"h-3.5 w-3.5",strokeWidth:2})," ",t("chat.report")]}),e.jsxs("button",{type:"button",onClick:()=>{T(!1),X()},className:"inline-flex items-center gap-1.5 text-red-400 transition-colors hover:text-red-300",children:[e.jsx(J,{className:"h-3.5 w-3.5",strokeWidth:2})," ",t("chat.block")]})]})}),e.jsx(st,{open:I!==null,title:t(I==="block"?"chat.block":"chat.delete"),body:I==="block"?t("chat.block_confirm",{name:w}):t("chat.delete_confirm"),confirmLabel:t(I==="block"?"chat.block":"chat.delete"),destructive:!0,busy:K,onConfirm:()=>void(I==="block"?ge():je()),onCancel:()=>g(null)}),e.jsx(dt,{open:xe,title:t("chat.report"),prompt:t("chat.report_prompt"),submitLabel:t("chat.report"),busy:K,onSubmit:s=>void we(s),onCancel:()=>W(!1)})]})}export{_t as ChatConversationPage};

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.