Files
appco_dist/.output/public/_nuxt/zwKv7OGi.js
T

2 lines
6.7 KiB
JavaScript
Raw Normal View History

2025-07-27 10:51:22 +03:30
import{d as w,C as d,dv as V,a2 as M,G as D,J as j,r as _,k as q,a1 as G,dF as J,y as k,z as h,a3 as K,dG as Q,N as X,a4 as W,A as o,B as A,u as Y,o as Z,d5 as ee,dH as te,dI as ae,S as se,H as g,F as T,D as re,aj as ne,U as oe,dJ as ie}from"./vNwORUzZ.js";import{b as C,c as B,h as F,w as N,m as H,f as le,t as L,l as ue}from"./DmeoQcPT.js";import{B as U}from"./DSh6TMV1.js";import{U as de}from"./Cp4vHarM.js";import{_ as ce}from"./DYK3k91P.js";import{_ as E}from"./DlAUqK2U.js";import"./BqtpcZoZ.js";import"./DWEdiVkG.js";/* empty css */import"./DEYQXqOP.js";import"./C1A0Ol0M.js";import"./CBmaeoJK.js";import"./Bx0AlLRd.js";import"./CW2jPw-_.js";import"./BwA8VTN1.js";import"./y7aiIjb0.js";import"./DsBtkfRw.js";import"./B1PUzC5B.js";import"./BwPyxH4J.js";const[ve,me]=B("skeleton-title"),he={round:Boolean,titleWidth:C};var fe=w({name:ve,props:he,setup(e){return()=>d("h3",{class:me([{round:e.round}]),style:{width:F(e.titleWidth)}},null)}});const _e=N(fe);var pe=_e;const[ge,we]=B("skeleton-avatar"),ye={avatarSize:C,avatarShape:H("round")};var ke=w({name:ge,props:ye,setup(e){return()=>d("div",{class:we([e.avatarShape]),style:le(e.avatarSize)},null)}});const Se=N(ke);var xe=Se;const R="100%",be={round:Boolean,rowWidth:{type:C,default:R}},[Ie,$e]=B("skeleton-paragraph");var Ce=w({name:Ie,props:be,setup(e){return()=>d("div",{class:$e([{round:e.round}]),style:{width:e.rowWidth}},null)}});const Pe=N(Ce);var We=Pe;const[Te,z]=B("skeleton"),Ae="60%",Be={row:ue(0),round:Boolean,title:Boolean,titleWidth:C,avatar:Boolean,avatarSize:C,avatarShape:H("round"),loading:L,animate:L,rowWidth:{type:[Number,String,Array],default:R}};var Ne=w({name:Te,inheritAttrs:!1,props:Be,setup(e,{slots:n,attrs:i}){const f=()=>{if(e.avatar)return d(xe,{avatarShape:e.avatarShape,avatarSize:e.avatarSize},null)},c=()=>{if(e.title)return d(pe,{round:e.round,titleWidth:e.titleWidth},null)},l=t=>{const{rowWidth:m}=e;return m===R&&t===+e.row-1?Ae:Array.isArray(m)?m[t]:m},v=()=>Array(+e.row).fill("").map((t,m)=>d(We,{key:m,round:e.round,rowWidth:F(l(m))},null)),y=()=>n.template?n.template():d(M,null,[f(),d("div",{class:z("content")},[c(),v()])]);return()=>{var t;return e.loading?d("div",V({class:z({animate:e.animate,round:e.round})},i),[y()]):(t=n.default)==null?void 0:t.call(n)}}});const Re="data:image/svg+xml,%3csvg%20width='22'%20height='20'%20viewBox='0%200%2022%2020'%20fill='white'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.0031%201H1.00311L8.50311%208.5M21.0031%201L10.5031%2018.5L8.50311%208.5M21.0031%201L8.50311%208.5'%20stroke='%23733af9'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3c/svg%3e",Le={class:"chat-container"},Ue={class:"message-bubble"},ze={class:"time"},Me=w({__name:"Conversation",props:{chatId:{}},setup(e){D();const n=j();_(!1);const i=_(0),f=_(10),c=_([]),l=q(()=>n.user),v=e,y=a=>new Date(a).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),t=async()=>{if(v.chatId){const a=await Q(v.chatId,++i.value,f.value);console.log("res ===>",a),c.value=a}},m=()=>{X.channel("realtime:chat_messages").on("postgres_changes",{event:"INSERT",schema:"public",table:"chat_messages"},a=>{var s;((s=a.new)==null?void 0:s.chat_id)==v.chatId&&c.value.push(a.new)}).subscribe()};return G(()=>v.chatId,()=>{v.chatId&&(t(),m(),J(v.chatId,n.user.id))},{immediate:!0}),(a,s)=>(h(),k("div",Le,[(h(!0),k(M,null,K(c.value,u=>(h(),k("div",{key:u.id,class:W(["message",{sent:u.sender_id===l.value.id,received:u.sender_id!==l.value.id}])},[o("div",Ue,[o("p",null,A(u.text),1),o("span",ze,A(y(u.created_at)),1)])],2))),128))]))}}),De=E(Me,[["__scopeId","data-v-d14597e8"]]),je={class:"flex justify-between items-center w-full p4"},qe={class:"flex items-center gap-5"},Fe={key:0,class:"flex gap-24px items-center"},He={class:"font-semibold flex items-center"},Ee={class:"flex font-200 text-xs items-center"},Oe={dir:"ltr",class:"h-96vh pt-8vh overflow-y-auto pb-20"},Ve=["alt"],Ge=w({__name:"index",setup(e){const n=Y(),i=D(),f=j(),c=_(""),l=_(void 0);q(()=>{var a,s,u,p;return((s=(a=i.sellerConfig)==null?void 0:a.store)==null?void 0:s.main)&&f.user.id!==((p=(u=i.sellerC