`;connection.invoke("SendMessage",adminCustomerId,t).catch(function(n){console.error("SignalR SendImage Error:",n.toString())})}else alert(n.message||"Upload failed.")},error:function(n){alert("Error uploading image.");console.error("AJAX error:",n)}}));$("#imageUpload").val("")});$("#sendButton").on("click",function(){var n=$messageInput.val().trim(),t=adminCustomerId;n&&(connection.state!=="Connected"&&connection.start(),connection.invoke("SendMessage",t,n).catch(function(i){connection.start();connection.invoke("SendMessage",t,n);console.error("SignalR Send Error:",i.toString())}),$messageInput.val(""))})