PageSourceSearch

https://hou.la/chunk-ZYBN4EMI.js

js hou.la collected 2026-09-25 03:33:15 UTC 13,446 bytes, 1 lines download raw bytes

1import{d as X}from"./chunk-3WRK7X32.js";import{b as K}from"./chunk-VBH7BJNM.js";import{a as P}from"./chunk-GYEAK6A2.js";import"./chunk-VZDUNVSE.js";import{a as J}from"./chunk-DGH55HEQ.js";import"./chunk-BYXBJQAS.js";import"./chunk-VYULK3Y3.js";import"./chunk-IJ2PWAPC.js";import"./chunk-IKQR3USM.js";import"./chunk-4ABKOVHO.js";import"./chunk-DQRROS2B.js";import"./chunk-Z2TVBXTG.js";import{g as Q,i as q}from"./chunk-ZV7NG4F4.js";import"./chunk-DJ5AJG3T.js";import"./chunk-6EF6RNOO.js";import"./chunk-T3DWPM4S.js";import"./chunk-K6QYQNRN.js";import"./chunk-ZNR7QNVV.js";import"./chunk-N3YFX76I.js";import"./chunk-JS6LICOA.js";import"./chunk-WF4KZOYP.js";import{a as H}from"./chunk-EB6TJ75L.js";import"./chunk-FOJCKIWO.js";import"./chunk-3AIY57KH.js";import"./chunk-AB6CKZTE.js";import"./chunk-Z64D265S.js";import"./chunk-K5O3OQFW.js";import"./chunk-2DRXLVRR.js";import"./chunk-QHMYZ6SM.js";import"./chunk-PJPLTBJX.js";import"./chunk-DLIVM562.js";import"./chunk-CV2ZWZQE.js";import"./chunk-H4HD3LNW.js";import"./chunk-AQEWHUN5.js";import{d as U,e as G}from"./chunk-YQZAETCE.js";import{o as z,r as F,x as j}from"./chunk-EO42E46J.js";import"./chunk-3QVSKJ3X.js";import{I as B,c as A,m as N,s as L}from"./chunk-ERUCNOOT.js";import{$b as M,Fa as O,Jb as c,Kb as W,Lb as I,Qc as x,Rc as b,Vb as o,Wb as l,Xb as C,Yb as w,Zb as T,da as p,db as a,fc as f,gc as d,la as g,ma as _,mc as R,nc as V,oc as D,sb as E,tc as m,uc as S,vc as k,yb as v}from"./chunk-DBE7WQEG.js";import{g as u}from"./chunk-W7GRJBO5.js";function $(r,e){r&1&&(o(0,"div",5),C(1,"i",6),l())}function ee(r,e){r&1&&(o(0,"p",7),m(1),x(2,"translate"),l()),r&2&&(a(),k(" ",b(2,1,"MESSAGES_DM.NOT_FOUND")," "))}function te(r,e){if(r&1&&(w(0),m(1),T()),r&2){let t=d(2);a(),S(t.interlocutorInitial)}}function ie(r,e){r&1&&C(0,"app-verified-badge")}function ne(r,e){r&1&&(o(0,"span",18),m(1,"LIVE"),l())}function re(r,e){if(r&1){let t=M();o(0,"div",19)(1,"p"),m(2),x(3,"translate"),l(),o(4,"div",20)(5,"button",21),f("click",function(){g(t);let n=d(2);return _(n.accept())}),m(6),x(7,"translate"),l(),o(8,"button",22),f("click",function(){g(t);let n=d(2);return _(n.decline())}),m(9),x(10,"translate"),l()()()}if(r&2){let t=d(2);a(2),S(b(3,5,"MESSAGES_DM.INVITE_PROMPT")),a(3),c("disabled",t.busy),a(),k(" ",b(7,7,"MESSAGES_DM.ACCEPT")," "),a(2),c("disabled",t.busy),a(),k(" ",b(10,9,"MESSAGES_DM.DECLINE")," ")}}function ae(r,e){if(r&1){let t=M();w(0),o(1,"header",8)(2,"button",9),f("click",function(){g(t);let n=d();return _(n.back())}),C(3,"i",10),l(),o(4,"button",11),f("click",function(){g(t);let n=d();return _(n.openProfile())}),o(5,"span",12),v(6,te,2,1,"ng-container",4),l(),o(7,"span",13),m(8),v(9,ie,1,0,"app-verified-badge",4)(10,ne,2,0,"span",14),l()()(),v(11,re,11,11,"div",15),o(12,"div",16)(13,"app-widget-chat",17),f("messageSent",function(n){g(t);let s=d();return _(s.onMessageSent(n))})("voiceRecorded",function(n){g(t);let s=d();return _(s.onVoiceRecorded(n))})("reactionToggled",function(n){g(t);let s=d();return _(s.onReactionToggled(n))}),l()(),T()}if(r&2){let t=e.ngIf,i=d();a(4),I("is-link",i.profileHandle),a(),W("background-image",i.interlocutorAvatar?"url("+i.interlocutorAvatar+")":""),I("is-live",t.interlocutor==null?null:t.interlocutor.isLive),a(),c("ngIf",!i.interlocutorAvatar),a(2),k(" ",i.interlocutorName," "),a(),c("ngIf",t.interlocutor==null?null:t.interlocutor.isVerified),a(),c("ngIf",t.interlocutor==null?null:t.interlocutor.isLive),a(),c("ngIf",i.isPendingInbound),a(2),c("ticket",t)("loading",!1)("dark",!0)("canReply",!i.isPendingInbound)("showReactions",!0)("showReadReceipts",!0)}}var Y=class r{route=p(z);router=p(F);location=p(N);ticketService=p(J);loginService=p(q);workspaceService=p(Q);toast=p(H);platformId=p(O);chatWidget;loading=!0;notFound=!1;ticket=null;busy=!1;ticketId="";myWs=null;sub=null;ngOnInit(){if(A(this.platformId)){if(!this.loginService.isLoggedIn){this.router.navigate(["/login"],{queryParams:{returnUrl:this.router.url}});return}if(this.ticketId=this.route.snapshot.paramMap.get("id")||"",!this.ticketId){this.notFound=!0,this.loading=!1;return}this.load(),this.sub=this.ticketService.connectStream(e=>{e.ticketId!==this.ticketId||!this.ticket||(e.type==="new_message"&&e.message?this.appendMessage(e.message):e.type==="reaction_toggled"&&e.messageId?this.applyReactions(e.messageId,e.reactions||{}):e.type==="link_preview_update"&&e.messageId?this.applyLinkPreviews(e.messageId,e.linkPreviews||[]):e.type==="status_changed"&&e.newStatus&&(this.ticket.status=e.newStatus))})}}ngOnDestroy(){this.sub?.close()}load(){return u(this,null,function*(){this.loading=!0;let e=[];
1try{e=yield this.workspaceService.listWorkspaces()}catch{}this.myWs=this.workspaceService.activeWorkspaceId;try{let t=yield this.ticketService.findOne(this.ticketId);this.ticket=t.ticket;let n=[this.ticket?.senderWorkspaceId,this.ticket?.recipientWorkspaceId].filter(Boolean).find(s=>e.some(h=>h.id===s));n&&n!==this.workspaceService.activeWorkspaceId&&(this.workspaceService.setActiveWorkspace(n),this.myWs=n),setTimeout(()=>this.chatWidget?.scrollToLatest(),50)}catch{this.notFound=!0}finally{this.loading=!1}})}get isPendingInbound(){let e=this.ticket;return!e||e.dmStatus!=="pending"?!1:this.myWs&&e.recipientWorkspaceId?e.recipientWorkspaceId===this.myWs:e.lastMessage?!e.lastMessage.isOwn:!1}get interlocutorName(){return this.ticket?.interlocutor?.name||this.ticket?.authorName||this.ticket?.subject||"\u2014"}get interlocutorAvatar(){return this.ticket?.interlocutor?.avatarUrl||null}get interlocutorInitial(){return(this.interlocutorName||"?").charAt(0).toUpperCase()}get profileHandle(){return this.ticket?.interlocutor?.slug||this.ticket?.interlocutor?.workspaceId||null}back(){this.location.back()}openProfile(){this.profileHandle&&this.router.navigate(["/@"+this.profileHandle])}appendMessage(e){this.ticket&&(this.ticket.messages||(this.ticket.messages=[]),!this.ticket.messages.some(t=>t.id===e.id)&&(this.ticket.messages.push(e),this.ticket.messageCount=(this.ticket.messageCount||0)+1,setTimeout(()=>this.chatWidget?.scrollToLatest(),30)))}applyReactions(e,t){let i=this.ticket?.messages?.find(n=>n.id===e);i&&(i.reactions=t)}applyLinkPreviews(e,t){let i=this.ticket?.messages?.find(n=>n.id===e);i&&(i.linkPreviews=t)}onMessageSent(e){return u(this,null,function*(){if(!this.ticket)return;let t=this.chatWidget?.detachSelectedImages()??{files:[],previews:[]},i="__temp_"+this.ticketId+"_"+e.message.length,n={id:i,ticketId:this.ticketId,senderType:"user",senderName:"Toi",content:e.message,attachments:t.previews,isInternal:!1,isOwn:!0,createdAt:new Date().toISOString()};this.ticket.messages||(this.ticket.messages=[]),this.ticket.messages.push(n),setTimeout(()=>this.chatWidget?.scrollToLatest(),20);try{let s=[];t.files.length&&(s=yield this.ticketService.uploadImages(this.ticketId,t.files));let h=yield this.ticketService.reply(this.ticketId,{message:e.message,attachments:s}),y=this.ticket.messages.findIndex(Z=>Z.id===i);y!==-1&&h.message&&(this.ticket.messages[y]=h.message),this.chatWidget?.markSendingDone(),this.chatWidget?.resetForm()}catch{this.ticket.messages=this.ticket.messages.filter(s=>s.id!==i),this.toast.error("Envoi impossible"),this.chatWidget?.markSendingDone()}finally{t.previews.forEach(s=>{try{URL.revokeObjectURL(s)}catch{}})}})}onVoiceRecorded(e){return u(this,null,function*(){if(!this.ticket)return;let t="__temp_voice_"+this.ticketId+"_"+Date.now(),i={id:t,ticketId:this.ticketId,senderType:"user",senderName:"Toi",content:"\u{1F3A4} Message vocal",messageType:"voice",voiceNote:{url:"",durationMs:e.durationMs,waveform:[]},isInternal:!1,isOwn:!0,createdAt:new Date().toISOString()};this.ticket.messages||(this.ticket.messages=[]),this.ticket.messages.push(i),setTimeout(()=>this.chatWidget?.scrollToLatest(),20);try{let n=yield this.ticketService.uploadVoice(this.ticketId,e.blob),s=yield this.ticketService.reply(this.ticketId,{message:"",voiceNote:n}),h=this.ticket.messages.findIndex(y=>y.id===t);h!==-1&&s.message&&(this.ticket.messages[h]=s.message)}catch{this.ticket.messages=this.ticket.messages.filter(n=>n.id!==t),this.toast.error("Envoi impossible")}})}onReactionToggled(e){return u(this,null,function*(){try{let t=yield this.ticketService.toggleReaction(this.ticketId,e.messageId,e.emoji);this.applyReactions(e.messageId,t.reactions)}catch{}})}accept(){return u(this,null,function*(){if(!(!this.ticket||this.busy)){this.busy=!0;try{yield this.ticketService.acceptDm(this.ticket.id),this.ticket.dmStatus="accepted"}catch{this.toast.error("Action impossible")}finally{this.busy=!1}}})}decline(){return u(this,null,function*(){if(!(!this.ticket||this.busy)){this.busy=!0;try{yield this.ticketService.declineDm(this.ticket.id),this.router.navigate(["/a","messages"])}catch{this.toast.error("Action impossible")}finally{this.busy=!1}}})}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=E({type:r,selectors:[["app-chat-thread"]],viewQuery:function(t,i){if(t&1&&R(P,5),t&2){let n;V(n=D())&&(i.chatWidget=n.first)}},decls:5,vars:4,consts:[[3,"scroll"],[1,"ct"],["class","ct__loading",4,"ngIf"],["class","ct__empty",4,"ngIf"],[4,"ngIf"],[1,"ct__loading"],[1,"pi","pi-spin","pi-spinner"],[1,"ct__empty"],[1,"ct__head"],["type","button","aria-label","Back",1,"ct__back",3,"click"],[1,"pi","pi-arrow-left"],["type","button",1,"ct__peer",3,"click"],[1,"ct__av"],[1,"ct__peername"],["class","ct__livetag",4,"ngIf"],["class","ct__invite",4,"ngIf"],[1,"ct__chat"],[3,"messageSent","voiceRecorded","reactionToggled","ticket","loading","dark","canReply","showReactions","showReadReceipts"],[1,"ct__livetag"],[1,"ct__invite"],[1,"ct__invite-actions"],["type","button",1,"ct__accept",3,"click","disabled"],["type","button",1,"ct__decline",3,"click","disabled"]],template:function(t,i){t&1&&(o(0,"app-shell",0)(1,"div",1),v(2,$,2,0,"div",2)(3,ee,3,3,"p",3)(4,ae,14,17,"ng-container",4),l()()),t&2&&(c("scroll",!1),a(2),c("ngIf",i.loading),a(),c("ngIf",!i.loading&&i.notFound),a(),c("ngIf",!i.loading&&i.ticket))},dependencies:[K,B,L,j,G,U,X,P],styles:["[_nghost-%COMP%]{--paper: #0a0a14;--surface: #12121e;--surface-2: #1a1a2e;--ink: #ffffff;--ink-soft: rgba(255, 255, 255, .66);--ink-muted: rgba(255, 255, 255, .45);--accent: #2f8eef;--accent-bright: #54a6f6;--live: #ff3b30;--error: #ef4444;--border: rgba(255, 255, 255, .1);--border-soft: rgba(255, 255, 255, .06);--topbar: 64px;--story-ring-a: #ffc83a;--story-ring-b: #ff7a1a;--story-ring-seen: rgba(255, 255, 255, .22);display:block;height:100%;color:var(--ink);font-family:Inter,system-ui,sans-serif}*[_ngcontent-%COMP%]{box-sizing:border-box}button[_ngcontent-%COMP%]{font-family:inherit;cursor:pointer}
1.ct[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;max-width:720px;margin:0 auto}.ct__loading[_ngcontent-%COMP%], .ct__empty[_ngcontent-%COMP%]{text-align:center;padding:60px 20px;color:var(--ink-muted)}.ct__loading[_ngcontent-%COMP%]   .pi[_ngcontent-%COMP%], .ct__empty[_ngcontent-%COMP%]   .pi[_ngcontent-%COMP%]{font-size:28px}.ct__head[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:6px;height:56px;padding:0 8px;border-bottom:1px solid var(--border);background:#0f0f1aeb;backdrop-filter:blur(12px)}.ct__back[_ngcontent-%COMP%]{width:38px;height:38px;border-radius:50%;background:none;border:none;color:var(--ink);display:flex;align-items:center;justify-content:center}.ct__back[_ngcontent-%COMP%]:hover{background:var(--surface-2)}.ct__peer[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;align-items:center;gap:10px;background:none;border:none;color:var(--ink);padding:4px 6px;border-radius:10px;text-align:left}.ct__peer.is-link[_ngcontent-%COMP%]:hover{background:var(--surface-2)}.ct__av[_ngcontent-%COMP%]{flex-shrink:0;width:38px;height:38px;border-radius:50%;background:var(--surface-2) center/cover no-repeat;display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:800}.ct__av.is-live[_ngcontent-%COMP%]{box-shadow:0 0 0 2px var(--paper),0 0 0 4px var(--live)}.ct__peername[_ngcontent-%COMP%]{font-weight:700;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-flex;align-items:center;gap:6px}.ct__peername[_ngcontent-%COMP%]   .pi-verified[_ngcontent-%COMP%]{color:var(--accent-bright);font-size:13px}.ct__livetag[_ngcontent-%COMP%]{background:var(--live);color:#fff;font-size:9px;font-weight:800;letter-spacing:.4px;padding:2px 6px;border-radius:999px}.ct__invite[_ngcontent-%COMP%]{flex-shrink:0;padding:12px 16px;border-bottom:1px solid var(--border);background:var(--surface-2)}.ct__invite[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0 0 10px;font-size:13px;color:var(--ink-soft)}.ct__invite-actions[_ngcontent-%COMP%]{display:flex;gap:8px}.ct__accept[_ngcontent-%COMP%], .ct__decline[_ngcontent-%COMP%]{height:36px;padding:0 18px;border-radius:8px;font-weight:700;font-size:13px;border:1px solid var(--border)}.ct__accept[_ngcontent-%COMP%]:disabled, .ct__decline[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:default}.ct__accept[_ngcontent-%COMP%]{background:var(--accent);border-color:var(--accent);color:#fff}.ct__accept[_ngcontent-%COMP%]:hover{background:var(--accent-bright)}.ct__decline[_ngcontent-%COMP%]{background:transparent;color:var(--ink-soft)}.ct__chat[_ngcontent-%COMP%]{flex:1;min-height:0;display:flex;flex-direction:column}.ct__chat[_ngcontent-%COMP%]   app-widget-chat[_ngcontent-%COMP%]{flex:1;min-height:0;display:flex;flex-direction:column}"]})};export{Y as ChatThreadComponent};

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.