1import{b1 as Ms,A as Hs,_ as qs,x as zs,l as Bs,Q as Fs,y as $s,f as Xs,am as Js,o as O,c as U,h as fe,i as Ws,L as Vs,e as Y,a as l,z as Gs,B as Ys,b0 as Ks,d as Qs,t as F,p as Zs,w as bt,F as ae,v as er,r as Ce,J as tr,K as nr,aG as sr,b2 as rr,D as ir,k as ge,O as or,j as ar,W as cr,H as ce}from"./index.BcDC3AA6.js";import{u as hr}from"./complaintStore.jeVq5Yam.js";const _t="/assets/[email protected]";class qe{constructor(){this.notificationCreatedEvent=".Illuminate\\Notifications\\Events\\BroadcastNotificationCreated"}listenForWhisper(i,a){return this.listen(".client-"+i,a)}notification(i){return this.listen(this.notificationCreatedEvent,i)}stopListeningForNotification(i){return this.stopListening(this.notificationCreatedEvent,i)}stopListeningForWhisper(i,a){return this.stopListening(".client-"+i,a)}}class St{constructor(i){this.namespace=i}format(i){return[".","\\"].includes(i.charAt(0))?i.substring(1):(this.namespace&&(i=this.namespace+"."+i),i.replace(/\./g,"\\"))}setNamespace(i){this.namespace=i}}function ur(j){try{return Reflect.construct(String,[],j),!0}catch{return!1}}class ze extends qe{constructor(i,a,u){super(),this.name=a,this.pusher=i,this.options=u,this.eventFormatter=new St(this.options.namespace),this.subscribe()}subscribe(){this.subscription=this.pusher.subscribe(this.name)}unsubscribe(){this.pusher.unsubscribe(this.name)}listen(i,a){return this.on(this.eventFormatter.format(i),a),this}listenToAll(i){return this.subscription.bind_global((a,u)=>{if(a.startsWith("pusher:"))return;let k=String(this.options.namespace??"").replace(/\./g,"\\"),J=a.startsWith(k)?a.substring(k.length+1):"."+a;i(J,u)}),this}stopListening(i,a){return a?this.subscription.unbind(this.eventFormatter.format(i),a):this.subscription.unbind(this.eventFormatter.format(i)),this}stopListeningToAll(i){return i?this.subscription.unbind_global(i):this.subscription.unbind_global(),this}subscribed(i){return this.on("pusher:subscription_succeeded",()=>{i()}),this}error(i){return this.on("pusher:subscription_error",a=>{i(a)}),this}on(i,a){return this.subscription.bind(i,a),this}}class Ct extends ze{whisper(i,a){return this.pusher.channels.channels[this.name].trigger(`client-${i}`,a),this}}class lr extends ze{whisper(i,a){return this.pusher.channels.channels[this.name].trigger(`client-${i}`,a),this}}class dr extends Ct{here(i){return this.on("pusher:subscription_succeeded",a=>{i(Object.keys(a.members).map(u=>a.members[u]))}),this}joining(i){return this.on("pusher:member_added",a=>{i(a.info)}),this}whisper(i,a){return this.pusher.channels.channels[this.name].trigger(`client-${i}`,a),this}leaving(i){return this.on("pusher:member_removed",a=>{i(a.info)}),this}}class kt extends qe{constructor(i,a,u){super(),this.events={},this.listeners={},this.name=a,this.socket=i,this.options=u,this.eventFormatter=new St(this.options.namespace),this.subscribe()}subscribe(){this.socket.emit("subscribe",{channel:this.name,auth:this.options.auth||{}})}unsubscribe(){this.unbind(),this.socket.emit("unsubscribe",{channel:this.name,auth:this.options.auth||{}})}listen(i,a){return this.on(this.eventFormatter.format(i),a),this}stopListening(i,a){return this.unbindEvent(this.eventFormatter.format(i),a),this}subscribed(i){return this.on("connect",a=>{i(a)}),this}error(i){return this}on(i,a){return this.listeners[i]=this.listeners[i]||[],this.events[i]||(this.events[i]=(u,k)=>
1{this.name===u&&this.listeners[i]&&this.listeners[i].forEach(J=>J(k))},this.socket.on(i,this.events[i])),this.listeners[i].push(a),this}unbind(){Object.keys(this.events).forEach(i=>{this.unbindEvent(i)})}unbindEvent(i,a){this.listeners[i]=this.listeners[i]||[],a&&(this.listeners[i]=this.listeners[i].filter(u=>u!==a)),(!a||this.listeners[i].length===0)&&(this.events[i]&&(this.socket.removeListener(i,this.events[i]),delete this.events[i]),delete this.listeners[i])}}class Tt extends kt{whisper(i,a){return this.socket.emit("client event",{channel:this.name,event:`client-${i}`,data:a}),this}}class pr extends Tt{here(i){return this.on("presence:subscribed",a=>{i(a.map(u=>u.user_info))}),this}joining(i){return this.on("presence:joining",a=>i(a.user_info)),this}whisper(i,a){return this.socket.emit("client event",{channel:this.name,event:`client-${i}`,data:a}),this}leaving(i){return this.on("presence:leaving",a=>i(a.user_info)),this}}class Te extends qe{subscribe(){}unsubscribe(){}listen(i,a){return this}listenToAll(i){return this}stopListening(i,a){return this}subscribed(i){return this}error(i){return this}on(i,a){return this}}class xt extends Te{whisper(i,a){return this}}class fr extends Te{whisper(i,a){return this}}class gr extends xt{here(i){return this}joining(i){return this}whisper(i,a){return this}leaving(i){return this}}const Pt=class Lt{constructor(i){this.setOptions(i),this.connect()}setOptions(i){this.options={...Lt._defaultOptions,...i,broadcaster:i.broadcaster};let a=this.csrfToken();a&&(this.options.auth.headers["X-CSRF-TOKEN"]=a,this.options.userAuthentication.headers["X-CSRF-TOKEN"]=a),a=this.options.bearerToken,a&&(this.options.auth.headers.Authorization="Bearer "+a,this.options.userAuthentication.headers.Authorization="Bearer "+a)}csrfToken(){var i,a;return typeof window<"u"&&(i=window.Laravel)!=null&&i.csrfToken?window.Laravel.csrfToken:this.options.csrfToken?this.options.csrfToken:typeof document<"u"&&typeof document.querySelector=="function"?((a=document.querySelector('meta[name="csrf-token"]'))==null?void 0:a.getAttribute("content"))??null:null}};Pt._defaultOptions={auth:{headers:{}},authEndpoint:"/broadcasting/auth",userAuthentication:{endpoint:"/broadcasting/user-auth",headers:{}},csrfToken:null,bearerToken:null,host:null,key:null,namespace:"App.Events"};let Be=Pt;class ke extends Be{constructor(){super(...arguments),this.channels={}}connect(){if(typeof this.options.client<"u")this.pusher=this.options.client;else if(this.options.Pusher)this.pusher=new this.options.Pusher(this.options.key,this.options);else if(typeof window<"u"&&typeof window.Pusher<"u")this.pusher=new window.Pusher(this.options.key,this.options);else throw new Error("Pusher client not found. Should be globally available or passed via options.client")}signin(){this.pusher.signin()}listen(i,a,u){return this.channel(i).listen(a,u)}channel(i){return this.channels[i]||(this.channels[i]=new ze(this.pusher,i,this.options)),this.channels[i]}privateChannel(i){return this.channels["private-"+i]||(this.channels["private-"+i]=new Ct(this.pusher,"private-"+i,this.options)),this.channels["private-"+i]}encryptedPrivateChannel(i){return this.channels["private-encrypted-"+i]||(this.channels["private-encrypted-"+i]=new lr(this.pusher,"private-encrypted-"+i,this.options)),this.channels["private-encrypted-"+i]}presenceChannel(i){return this.channels["presence-"+i]||(this.channels["presence-"+i]=new dr(this.pusher,"presence-"+i,this.options)),this.channels["presence-"+i]}leave(i){[i,"private-"+i,"private-encrypted-"+i,"presence-"+i].forEach(a=>{this.leaveChannel(a)})}leaveChannel(i){this.channels[i]&&(this.channels[i].unsubscribe(),delete this.channels[i])}socketId(){return this.pusher.connection.socket_id}connectionStatus(){const i=this.pusher.connection.state;switch(i){case"connected":case"connecting":return i;case"failed":case"unavailable":return"failed";default:return"disconnected"}}onConnectionChange(i){const a=()=>{i(this.connectionStatus())},u=["state_change","connected","disconnected"];return u.forEach(k=>{this.pusher.connection.bind(k,a)}),()=>{u.forEach(k=>{this.pusher.connection.unbind(k,a)})}}disconnect(){this.pusher.disconnect()}}class mr extends Be{constructor(){super(...arguments),this.channels={}}connect(){let i=this.getSocketIO();this.socket=i(this.options.host??void 0,this.options),this.socket.io.on("reconnect",()=>
1{Object.values(this.channels).forEach(a=>{a.subscribe()})})}getSocketIO(){if(typeof this.options.client<"u")return this.options.client;if(typeof window<"u"&&typeof window.io<"u")return window.io;throw new Error("Socket.io client not found. Should be globally available or passed via options.client")}listen(i,a,u){return this.channel(i).listen(a,u)}channel(i){return this.channels[i]||(this.channels[i]=new kt(this.socket,i,this.options)),this.channels[i]}privateChannel(i){return this.channels["private-"+i]||(this.channels["private-"+i]=new Tt(this.socket,"private-"+i,this.options)),this.channels["private-"+i]}presenceChannel(i){return this.channels["presence-"+i]||(this.channels["presence-"+i]=new pr(this.socket,"presence-"+i,this.options)),this.channels["presence-"+i]}leave(i){[i,"private-"+i,"presence-"+i].forEach(a=>{this.leaveChannel(a)})}leaveChannel(i){this.channels[i]&&(this.channels[i].unsubscribe(),delete this.channels[i])}socketId(){return this.socket.id}connectionStatus(){return this.socket.connected?"connected":this.socket.io._reconnecting?"reconnecting":this.socket.id!==void 0?"disconnected":"connecting"}onConnectionChange(i){const a=()=>{i(this.connectionStatus())},u=["connect","disconnect","connect_error","reconnect_attempt","reconnect","reconnect_error","reconnect_failed"];return u.forEach(k=>{this.socket.on(k,a)}),()=>{u.forEach(k=>{this.socket.off(k,a)})}}disconnect(){this.socket.disconnect()}}class yt extends Be{constructor(){super(...arguments),this.channels={}}connect(){}listen(i,a,u){return new Te}channel(i){return new Te}privateChannel(i){return new xt}encryptedPrivateChannel(i){return new fr}presenceChannel(i){return new gr}leave(i){}leaveChannel(i){}socketId(){return"fake-socket-id"}connectionStatus(){return"connected"}onConnectionChange(i){return()=>{}}disconnect(){}}class vr{constructor(i){this.options=i,this.connect(),this.options.withoutInterceptors||this.registerInterceptors()}channel(i){return this.connector.channel(i)}connect(){if(this.options.broadcaster==="reverb")this.connector=new ke({...this.options,cluster:""});else if(this.options.broadcaster==="pusher")this.connector=new ke(this.options);else if(this.options.broadcaster==="ably")this.connector=new ke({...this.options,cluster:"",broadcaster:"pusher"});else if(this.options.broadcaster==="socket.io")this.connector=new mr(this.options);else if(this.options.broadcaster==="null")this.connector=new yt(this.options);else if(typeof this.options.broadcaster=="function"&&ur(this.options.broadcaster))this.connector=new this.options.broadcaster(this.options);else throw new Error(`Broadcaster ${typeof this.options.broadcaster} ${String(this.options.broadcaster)} is not supported.`)}disconnect(){this.connector.disconnect()}join(i){return this.connector.presenceChannel(i)}leave(i){this.connector.leave(i)}leaveChannel(i){this.connector.leaveChannel(i)}leaveAllChannels(){for(const i in this.connector.channels)this.leaveChannel(i)}listen(i,a,u){return this.connector.listen(i,a,u)}private(i){return this.connector.privateChannel(i)}encryptedPrivate(i){if(this.connectorSupportsEncryptedPrivateChannels(this.connector))return this.connector.encryptedPrivateChannel(i);throw new Error(`Broadcaster ${typeof this.options.broadcaster} ${String(this.options.broadcaster)} does not support encrypted private channels.`)}connectorSupportsEncryptedPrivateChannels(i){return i instanceof ke||i instanceof yt}socketId(){return this.connector.socketId()}connectionStatus(){return this.connector.connectionStatus()}registerInterceptors(){typeof Vue<"u"&&Vue!=null&&Vue.http&&this.registerVueRequestInterceptor(),typeof axios=="function"&&this.registerAxiosRequestInterceptor(),typeof jQuery=="function"&&this.registerjQueryAjaxSetup(),typeof Turbo=="object"&&this.registerTurboRequestInterceptor()}registerVueRequestInterceptor(){Vue.http.interceptors.push((i,a)=>{this.socketId()&&i.headers.set("X-Socket-ID",this.socketId()),a()})}registerAxiosRequestInterceptor(){axios.interceptors.request.use(i=>(this.socketId()&&(i.headers["X-Socket-Id"]=this.socketId()),i))}registerjQueryAjaxSetup(){typeof jQuery.ajax<"u"&&jQuery.ajaxPrefilter((i,a,u)=>{this.socketId()&&u.setRequestHeader("X-Socket-Id",this.socketId())})}registerTurboRequestInterceptor(){document.addEventListener("turbo:before-fetch-request",i=>{i.detail.fetchOptions.headers["X-Socket-Id"]=this.socketId()})}}
1var He={exports:{}};/*! 2 * Pusher JavaScript Library v8.5.0 3 * https://pusher.com/ 4 * 5 * Copyright 2020, Pusher 6 * Released under the MIT licence. 7 */var wt;function br(){return wt||(wt=1,(function(j,i){(function(u,k){j.exports=k()})(self,()=>(()=>{var a={594(M,x){var S=this&&this.__extends||(function(){var w=function(h,p){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,A){m.__proto__=A}||function(m,A){for(var q in A)A.hasOwnProperty(q)&&(m[q]=A[q])},w(h,p)};return function(h,p){w(h,p);function m(){this.constructor=h}h.prototype=p===null?Object.create(p):(m.prototype=p.prototype,new m)}})();Object.defineProperty(x,"__esModule",{value:!0});var E=256,N=(function(){function w(h){h===void 0&&(h="="),this._paddingCharacter=h}return w.prototype.encodedLength=function(h){return this._paddingCharacter?(h+2)/3*4|0:(h*8+5)/6|0},w.prototype.encode=function(h){for(var p="",m=0;m<h.length-2;m+=3){var A=h[m]<<16|h[m+1]<<8|h[m+2];p+=this._encodeByte(A>>>18&63),p+=this._encodeByte(A>>>12&63),p+=this._encodeByte(A>>>6&63),p+=this._encodeByte(A>>>0&63)}var q=h.length-m;if(q>0){var A=h[m]<<16|(q===2?h[m+1]<<8:0);p+=this._encodeByte(A>>>18&63),p+=this._encodeByte(A>>>12&63),q===2?p+=this._encodeByte(A>>>6&63):p+=this._paddingCharacter||"",p+=this._paddingCharacter||""}return p},w.prototype.maxDecodedLength=function(h){return this._paddingCharacter?h/4*3|0:(h*6+7)/8|0},w.prototype.decodedLength=function(h){return this.maxDecodedLength(h.length-this._getPaddingLength(h))},w.prototype.decode=function(h){if(h.length===0)return new Uint8Array(0);for(var p=this._getPaddingLength(h),m=h.length-p,A=new Uint8Array(this.maxDecodedLength(m)),q=0,z=0,g=0,d=0,v=0,C=0,L=0;z<m-4;z+=4)d=this._decodeChar(h.charCodeAt(z+0)),v=this._decodeChar(h.charCodeAt(z+1)),C=this._decodeChar(h.charCodeAt(z+2)),L=this._decodeChar(h.charCodeAt(z+3)),A[q++]=d<<2|v>>>4,A[q++]=v<<4|C>>>2,A[q++]=C<<6|L,g|=d&E,g|=v&E,g|=C&E,g|=L&E;if(z<m-1&&(d=this._decodeChar(h.charCodeAt(z)),v=this._decodeChar(h.charCodeAt(z+1)),A[q++]=d<<2|v>>>4,g|=d&E,g|=v&E),z<m-2&&(C=this._decodeChar(h.charCodeAt(z+2)),A[q++]=v<<4|C>>>2,g|=C&E),z<m-3&&(L=this._decodeChar(h.charCodeAt(z+3)),A[q++]=C<<6|L,g|=L&E),g!==0)throw new Error("Base64Coder: incorrect characters for decoding");return A},w.prototype._encodeByte=function(h){var p=h;return p+=65,p+=25-h>>>8&6,p+=51-h>>>8&-75,p+=61-h>>>8&-15,p+=62-h>>>8&3,String.fromCharCode(p)},w.prototype._decodeChar=function(h){var p=E;return p+=(42-h&h-44)>>>8&-E+h-43+62,p+=(46-h&h-48)>>>8&-E+h-47+63,p+=(47-h&h-58)>>>8&-E+h-48+52,p+=(64-h&h-91)>>>8&-E+h-65+0,p+=(96-h&h-123)>>>8&-E+h-97+26,p},w.prototype._getPaddingLength=function(h){var p=0;if(this._paddingCharacter){for(var m=h.length-1;m>=0&&h[m]===this._paddingCharacter;m--)p++;if(h.length<4||p>2)throw new Error("Base64Coder: incorrect padding")}return p},w})();x.Coder=N;var V=new N;function y(w){return V.encode(w)}x.encode=y;function I(w){return V.decode(w)}x.decode=I;var X=(function(w){S(h,w);function h(){return w!==null&&w.apply(this,arguments)||this}return h.prototype._encodeByte=function(p){var m=p;return m+=65,m+=25-p>>>8&6,m+=51-p>>>8&-75,m+=61-p>>>8&-13,m+=62-p>>>8&49,String.fromCharCode(m)},h.prototype._decodeChar=function(p){var m=E;return m+=(44-p&p-46)>>>8&-E+p-45+62,m+=(94-p&p-96)>>>8&-E+p-95+63,m+=(47-p&p-58)>>>8&-E+p-48+52,m+=(64-p&p-91)>>>8&-E+p-65+0,m+=(96-p&p-123)>>>8&-E+p-97+26,m},h})(N);x.URLSafeCoder=X;var H=new X;function G(w){return H.encode(w)}x.encodeURLSafe=G;function te(w){return H.decode(w)}x.decodeURLSafe=te,x.encodedLength=function(w){return V.encodedLength(w)},x.maxDecodedLength=function(w){return V.maxDecodedLength(w)},x.decodedLength=function(w){return V.decodedLength(w)}},978(M,x){var S="utf8: invalid source encoding";function E(N){for(var V=[],y=0;y<N.length;y++){var I=N[y];if(I&128){var X=void 0;if(I<224){if(y>=N.length)throw new Error(S);var H=N[++y];if((H&192)!==128)throw new Error(S);I=(I&31)<<6|H&63,X=128}else if(I<240){if(y>=N.length-1)throw new Error(S);var H=N[++y],G=N[++y];if((H&192)!==128||(G&192)!==128)throw new Error(S);I=(I&15)<<12|(H&63)<<6|G&63,X=2048}else if(I<248){if(y>=N.length-2)throw new Error(S);var H=N[++y],G=N[++y],te=N[++y];if((H&192)!==128||(G&192)!==128||(te&192)!==128)throw new Error(S);I=(I&15)<<18|(H&63)<<12|(G&63)<<6|te&63,X=65536}else throw new Error(S);if(I<X||I>=55296&&I<=57343)throw new Error(S);if(I>
7=65536){if(I>1114111)throw new Error(S);I-=65536,V.push(String.fromCharCode(55296|I>>10)),I=56320|I&1023}}V.push(String.fromCharCode(I))}return V.join("")}x.D4=E},721(M,x,S){M.exports=S(207).default},207(M,x,S){S.d(x,{default:()=>we});class E{constructor(e,t){this.lastId=0,this.prefix=e,this.name=t}create(e){this.lastId++;var t=this.lastId,s=this.prefix+t,r=this.name+"["+t+"]",o=!1,c=function(){o||(e.apply(null,arguments),o=!0)};return this[t]=c,{number:t,id:s,name:r,callback:c}}remove(e){delete this[e.number]}}var N=new E("_pusher_script_","Pusher.ScriptReceivers"),V={VERSION:"8.5.0",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""};const y=V;class I{constructor(e){this.options=e,this.receivers=e.receivers||N,this.loading={}}load(e,t,s){var r=this;if(r.loading[e]&&r.loading[e].length>0)r.loading[e].push(s);else{r.loading[e]=[s];var o=_.createScriptRequest(r.getPath(e,t)),c=r.receivers.create(function(f){if(r.receivers.remove(c),r.loading[e]){var b=r.loading[e];delete r.loading[e];for(var T=function(D){D||o.cleanup()},P=0;P<b.length;P++)b[P](f,T)}});o.send(c)}}getRoot(e){var t,s=_.getDocument().location.protocol;return e&&e.useTLS||s==="https:"?t=this.options.cdn_https:t=this.options.cdn_http,t.replace(/\/*$/,"")+"/"+this.options.version}getPath(e,t){return this.getRoot(t)+"/"+e+this.options.suffix+".js"}}var X=new E("_pusher_dependencies","Pusher.DependenciesReceivers"),H=new I({cdn_http:y.cdn_http,cdn_https:y.cdn_https,version:y.VERSION,suffix:y.dependency_suffix,receivers:X});const G={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}},w={buildLogSuffix:function(n){const e="See:",t=G.urls[n];if(!t)return"";let s;return t.fullUrl?s=t.fullUrl:t.path&&(s=G.baseUrl+t.path),s?`${e} ${s}`:""}};var h;(function(n){n.UserAuthentication="user-authentication",n.ChannelAuthorization="channel-authorization"})(h||(h={}));
7class p extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class m extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class A extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class q extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class z extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class g extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class d extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class v extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class C extends Error{constructor(e,t){super(t),this.status=e,Object.setPrototypeOf(this,new.target.prototype)}}const he=function(n,e,t,s,r){const o=_.createXHR();o.open("POST",t.endpoint,!0),o.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var c in t.headers)o.setRequestHeader(c,t.headers[c]);if(t.headersProvider!=null){let f=t.headersProvider();for(var c in f)o.setRequestHeader(c,f[c])}return o.onreadystatechange=function(){if(o.readyState===4)if(o.status===200){let f,b=!1;try{f=JSON.parse(o.responseText),b=!0}catch{r(new C(200,`JSON returned from ${s.toString()}
7 endpoint was invalid, yet status code was 200. Data was: ${o.responseText}`),null)}b&&r(null,f)}else{let f="";switch(s){case h.UserAuthentication:f=w.buildLogSuffix("authenticationEndpoint");break;case h.ChannelAuthorization:f=`Clients must be authorized to join private or presence channels. ${w.buildLogSuffix("authorizationEndpoint")}`;break}r(new C(o.status,`Unable to retrieve auth string from ${s.toString()} endpoint - received status: ${o.status} from ${t.endpoint}. ${f}`),null)}},o.send(e),o};function xe(n){return Ot(It(n))}var ue=String.fromCharCode,me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",At=function(n){var e=n.charCodeAt(0);return e<128?n:e<2048?ue(192|e>>>6)+ue(128|e&63):ue(224|e>>>12&15)+ue(128|e>>>6&63)+ue(128|e&63)},It=function(n){return n.replace(/[^\x00-\x7F]/g,At)},Rt=function(n){var e=[0,2,1][n.length%3],t=n.charCodeAt(0)<<16|(n.length>1?n.charCodeAt(1):0)<<8|(n.length>2?n.charCodeAt(2):0),s=[me.charAt(t>>>18),me.charAt(t>>>12&63),e>=2?"=":me.charAt(t>>>6&63),e>=1?"=":me.charAt(t&63)];return s.join("")},Ot=window.btoa||function(n){return n.replace(/[\s\S]{1,3}/g,Rt)};class jt{constructor(e,t,s,r){this.clear=t,this.timer=e(()=>{this.timer&&(this.timer=r(this.timer))},s)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}const Fe=jt;function Nt(n){window.clearTimeout(n)}function Ut(n){window.clearInterval(n)}class ne extends Fe{constructor(e,t){super(setTimeout,Nt,e,function(s){return t(),null})}}class Dt extends Fe{constructor(e,t){super(setInterval,Ut,e,function(s){return t(),s})}}var Mt={now(){return Date.now?Date.now():new Date().valueOf()},defer(n){return new ne(0,n)},method(n,...e){var t=Array.prototype.slice.call(arguments,1);return function(s){return s[n].apply(s,t.concat(arguments))}}};const $=Mt;function W(n,...e){for(var t=0;t<e.length;t++){var s=e[t];for(var r in s)s[r]&&s[r].constructor&&s[r].constructor===Object?n[r]=W(n[r]||{},s[r]):n[r]=s[r]}return n}function Ht(){for(var n=["Pusher"],e=0;e<arguments.length;e++)typeof arguments[e]=="string"?n.push(arguments[e]):n.push(ve(arguments[e]));return n.join(" : ")}function $e(n,e){var t=Array.prototype.indexOf;if(n===null)return-1;if(t&&n.indexOf===t)return n.indexOf(e);for(var s=0,r=n.length;s<r;s++)if(n[s]===e)return s;return-1}function K(n,e){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&e(n[t],t,n)}function Xe(n){var e=[];return K(n,function(t,s){e.push(s)}),e}function qt(n){var e=[];return K(n,function(t){e.push(t)}),e}function le(n,e,t){for(var s=0;s<n.length;s++)e.call(t||window,n[s],s,n)}function Je(n,e){for(var t=[],s=0;s<n.length;s++)t.push(e(n[s],s,n,t));return t}function zt(n,e){var t={};return K(n,function(s,r){t[r]=e(s)}),t}function We(n,e){e=e||function(r){return!!r};for(var t=[],s=0;s<n.length;s++)e(n[s],s,n,t)&&t.push(n[s]);return t}function Ve(n,e){var t={};return K(n,function(s,r){(e&&e(s,r,n,t)||s)&&(t[r]=s)}),t}function Bt(n){var e=[];return K(n,function(t,s){e.push([s,t])}),e}function Ge(n,e){for(var t=0;t<n.length;t++)if(e(n[t],t,n))return!0;return!1}function Ft(n,e){for(var t=0;t<n.length;t++)if(!e(n[t],t,n))return!1;return!0}function $t(n){return zt(n,function(e){return typeof e=="object"&&(e=ve(e)),encodeURIComponent(xe(e.toString()))})}function Xt(n){var e=Ve(n,function(s){return s!==void 0}),t=Je(Bt($t(e)),$.method("join","=")).join("&");return t}function Jt(n){var e=[],t=[];return(function s(r,o){var c,f,b;switch(typeof r){case"object":if(!r)return null;for(c=0;c<e.length;c+=1)if(e[c]===r)return{$ref:t[c]};if(e.push(r),t.push(o),Object.prototype.toString.apply(r)==="[object Array]")for(b=[],c=0;c<r.length;c+=1)b[c]=s(r[c],o+"["+c+"]");else{b={};for(f in r)Object.prototype.hasOwnProperty.call(r,f)&&(b[f]=s(r[f],o+"["+JSON.stringify(f)+"]"))}return b;case"number":case"string":case"boolean":return r}})(n,"$")}function ve(n){try{return JSON.stringify(n)}catch{return JSON.stringify(Jt(n))}}class Wt{constructor(){this.globalLog=e=>{window.console&&window.console.log&&window.console.log(e)}}debug(...e){this.log(this.globalLog,e)}warn(...e){this.log(this.globalLogWarn,e)}error(...e){this.log(this.globalLogError,e)}globalLogWarn(e){window.console&&window.console.warn?window.console.warn(e):this.globalLog(e)}globalLogError(e){window.console&&window.console.error?window.console.error(e):this.globalLogWarn(e)}log(e,...t){var s=Ht.apply(this,arguments);we.log?we.log(s):we.logToConsole&&e.bind(this)(s)}}const R=new Wt;var Vt=function(n,e,t,s,r){(t.headers!==void 0||t.headersProvider!=null)&&R.warn(`To send headers with the ${s.toString()} request, you must use AJAX, rather than JSONP.`);var o=n.nextAuthCallbackID.toString();n.nextAuthCallbackID++;var c=n.getDocument(),f=c.createElement("script");n.auth_callbacks[o]=function(P){r(null,P)};var b="Pusher.auth_callbacks['"+o+"']";f.src=t.endpoint+"?callback="+encodeURIComponent(b)+"&"+e;var T=c.getElementsByTagName("head")[0]||c.documentElement;T.insertBefore(f,T.firstChild)};const Gt=Vt;
7class Yt{constructor(e){this.src=e}send(e){var t=this,s="Error loading "+t.src;t.script=document.createElement("script"),t.script.id=e.id,t.script.src=t.src,t.script.type="text/javascript",t.script.charset="UTF-8",t.script.addEventListener?(t.script.onerror=function(){e.callback(s)},t.script.onload=function(){e.callback(null)}):t.script.onreadystatechange=function(){(t.script.readyState==="loaded"||t.script.readyState==="complete")&&e.callback(null)},t.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(t.errorScript=document.createElement("script"),t.errorScript.id=e.id+"_error",t.errorScript.text=e.name+"('"+s+"');",t.script.async=t.errorScript.async=!1):t.script.async=!0;var r=document.getElementsByTagName("head")[0];r.insertBefore(t.script,r.firstChild),t.errorScript&&r.insertBefore(t.errorScript,t.script.nextSibling)}cleanup(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null}}class Kt{constructor(e,t){this.url=e,this.data=t}send(e){if(!this.request){var t=Xt(this.data),s=this.url+"/"+e.number+"?"+t;this.request=_.createScriptRequest(s),this.request.send(e)}}cleanup(){this.request&&this.request.cleanup()}}var Qt=function(n,e){return function(t,s){var r="http"+(e?"s":"")+"://",o=r+(n.host||n.options.host)+n.options.path,c=_.createJSONPRequest(o,t),f=_.ScriptReceivers.create(function(b,T){N.remove(f),c.cleanup(),T&&T.host&&(n.host=T.host),s&&s(b,T)});c.send(f)}},Zt={name:"jsonp",getAgent:Qt};const en=Zt;function Pe(n,e,t){var s=n+(e.useTLS?"s":""),r=e.useTLS?e.hostTLS:e.hostNonTLS;return s+"://"+r+t}function Le(n,e){var t="/app/"+n,s="?protocol="+y.PROTOCOL+"&client=js&version="+y.VERSION+(e?"&"+e:"");return t+s}var tn={getInitial:function(n,e){var t=(e.httpPath||"")+Le(n,"flash=false");return Pe("ws",e,t)}},nn={getInitial:function(n,e){var t=(e.httpPath||"/pusher")+Le(n);return Pe("http",e,t)}},sn={getInitial:function(n,e){return Pe("http",e,e.httpPath||"/pusher")},getPath:function(n,e){return Le(n)}};class rn{constructor(){this._callbacks={}}get(e){return this._callbacks[Ee(e)]}add(e,t,s){var r=Ee(e);this._callbacks[r]=this._callbacks[r]||[],this._callbacks[r].push({fn:t,context:s})}remove(e,t,s){if(!e&&!t&&!s){this._callbacks={};return}var r=e?[Ee(e)]:Xe(this._callbacks);t||s?this.removeCallback(r,t,s):this.removeAllCallbacks(r)}removeCallback(e,t,s){le(e,function(r){this._callbacks[r]=We(this._callbacks[r]||[],function(o){return t&&t!==o.fn||s&&s!==o.context}),this._callbacks[r].length===0&&delete this._callbacks[r]},this)}removeAllCallbacks(e){le(e,function(t){delete this._callbacks[t]},this)}}function Ee(n){return"_"+n}class Q{constructor(e){this.callbacks=new rn,this.global_callbacks=[],this.failThrough=e}bind(e,t,s){return this.callbacks.add(e,t,s),this}bind_global(e){return this.global_callbacks.push(e),this}unbind(e,t,s){return this.callbacks.remove(e,t,s),this}unbind_global(e){return e?(this.global_callbacks=We(this.global_callbacks||[],t=>t!==e),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(e,t,s){for(var r=0;r<this.global_callbacks.length;r++)this.global_callbacks[r](e,t);var o=this.callbacks.get(e),c=[];if(s?c.push(t,s):t&&c.push(t),o&&o.length>0)for(var r=0;r<o.length;r++)o[r].fn.apply(o[r].context||window,c);else this.failThrough&&this.failThrough(e,t);return this}}class on extends Q{constructor(e,t,s,r,o){super(),this.initialize=_.transportConnectionInitializer,this.hooks=e,this.name=t,this.priority=s,this.key=r,this.options=o,this.state="new",this.timeline=o.timeline,this.activityTimeout=o.activityTimeout,this.id=this.timeline.generateUniqueID()}handlesActivityChecks(){return!!this.hooks.handlesActivityChecks}supportsPing(){return!!this.hooks.supportsPing}connect(){if(this.socket||this.state!=="initialized")return!1;var e=this.hooks.urls.getInitial(this.key,this.options);
7try{this.socket=this.hooks.getSocket(e,this.options)}catch(t){return $.defer(()=>{this.onError(t),this.changeState("closed")}),!1}return this.bindListeners(),R.debug("Connecting",{transport:this.name,url:e}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(e){return this.state==="open"?($.defer(()=>{this.socket&&this.socket.send(e)}),!0):!1}ping(){this.state==="open"&&this.supportsPing()&&this.socket.ping()}onOpen(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0}onError(e){this.emit("error",{type:"WebSocketError",error:e}),this.timeline.error(this.buildTimelineMessage({error:e.toString()}))}onClose(e){e?this.changeState("closed",{code:e.code,reason:e.reason,wasClean:e.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(e){this.emit("message",e)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=e=>{this.onError(e)},this.socket.onclose=e=>{this.onClose(e)},this.socket.onmessage=e=>{this.onMessage(e)},this.supportsPing()&&(this.socket.onactivity=()=>{this.onActivity()})}unbindListeners(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))}changeState(e,t){this.state=e,this.timeline.info(this.buildTimelineMessage({state:e,params:t})),this.emit(e,t)}buildTimelineMessage(e){return W({cid:this.id},e)}}class oe{constructor(e){this.hooks=e}isSupported(e){return this.hooks.isSupported(e)}createConnection(e,t,s,r){return new on(this.hooks,e,t,s,r)}}var an=new oe({urls:tn,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!_.getWebSocketAPI()},isSupported:function(){return!!_.getWebSocketAPI()},getSocket:function(n){return _.createWebSocket(n)}}),Ye={urls:nn,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},Ke=W({getSocket:function(n){return _.HTTPFactory.createStreamingSocket(n)}},Ye),Qe=W({getSocket:function(n){return _.HTTPFactory.createPollingSocket(n)}},Ye),Ze={isSupported:function(){return _.isXHRSupported()}},cn=new oe(W({},Ke,Ze)),hn=new oe(W({},Qe,Ze)),un={ws:an,xhr_streaming:cn,xhr_polling:hn};const be=un;var ln=new oe({file:"sockjs",urls:sn,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(n,e){return new window.SockJS(n,null,{js_path:H.getPath("sockjs",{useTLS:e.useTLS}),ignore_null_origin:e.ignoreNullOrigin})},beforeOpen:function(n,e){n.send(JSON.stringify({path:e}))}}),et={isSupported:function(n){var e=_.isXDRSupported(n.useTLS);return e}},dn=new oe(W({},Ke,et)),pn=new oe(W({},Qe,et));be.xdr_streaming=dn,be.xdr_polling=pn,be.sockjs=ln;const fn=be;class gn extends Q{constructor(){super();var e=this;window.addEventListener!==void 0&&(window.addEventListener("online",function(){e.emit("online")},!1),window.addEventListener("offline",function(){e.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var mn=new gn;class vn{constructor(e,t,s){this.manager=e,this.transport=t,this.minPingDelay=s.minPingDelay,this.maxPingDelay=s.maxPingDelay,this.pingDelay=void 0}createConnection(e,t,s,r){r=W({},r,{activityTimeout:this.pingDelay});var o=this.transport.createConnection(e,t,s,r),c=null,f=function(){o.unbind("open",f),o.bind("closed",b),c=$.now()},b=T=>{if(o.unbind("closed",b),T.code===1002||T.code===1003)this.manager.reportDeath();else if(!T.wasClean&&c){var P=$.now()-c;P<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(P/2,this.minPingDelay))}};return o.bind("open",f),o}isSupported(e){return this.manager.isAlive()&&this.transport.isSupported(e)}}const tt={decodeMessage:function(n){try{var e=JSON.parse(n.data),t=e.data;if(typeof t=="string")try{t=JSON.parse(e.data)}catch{}var s={event:e.event,channel:e.channel,data:t};return e.user_id&&(s.user_id=e.user_id),s}catch(r){throw{type:"MessageParseError",error:r,data:n.data}}},encodeMessage:function(n){return JSON.stringify(n)},processHandshake:function(n){var e=tt.decodeMessage(n);if(e.event==="pusher:connection_established"){if(!e.data.activity_timeout)throw"No activity timeout specified in handshake";
7return{action:"connected",id:e.data.socket_id,activityTimeout:e.data.activity_timeout*1e3}}else{if(e.event==="pusher:error")return{action:this.getCloseAction(e.data),error:this.getCloseError(e.data)};throw"Invalid handshake"}},getCloseAction:function(n){return n.code<4e3?n.code>=1002&&n.code<=1004?"backoff":null:n.code===4e3?"tls_only":n.code<4100?"refused":n.code<4200?"backoff":n.code<4300?"retry":"refused"},getCloseError:function(n){return n.code!==1e3&&n.code!==1001?{type:"PusherError",data:{code:n.code,message:n.reason||n.message}}:null}},se=tt;class bn extends Q{constructor(e,t){super(),this.id=e,this.transport=t,this.activityTimeout=t.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(e){return this.transport.send(e)}send_event(e,t,s){var r={event:e,data:t};return s&&(r.channel=s),R.debug("Event sent",r),this.send(se.encodeMessage(r))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var e={message:s=>{var r;try{r=se.decodeMessage(s)}catch(o){this.emit("error",{type:"MessageParseError",error:o,data:s.data})}if(r!==void 0){switch(R.debug("Event recd",r),r.event){case"pusher:error":this.emit
7("error",{type:"PusherError",data:r.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",r)}},activity:()=>{this.emit("activity")},error:s=>{this.emit("error",s)},closed:s=>{t(),s&&s.code&&this.handleCloseEvent(s),this.transport=null,this.emit("closed")}},t=()=>{K(e,(s,r)=>{this.transport.unbind(r,s)})};K(e,(s,r)=>{this.transport.bind(r,s)})}handleCloseEvent(e){var t=se.getCloseAction(e),s=se.getCloseError(e);s&&this.emit("error",s),t&&this.emit(t,{action:t,error:s})}}class _n{constructor(e,t){this.transport=e,this.callback=t,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=e=>{this.unbindListeners();var t;try{t=se.processHandshake(e)}catch(s){this.finish("error",{error:s}),this.transport.close();return}t.action==="connected"?this.finish("connected",{connection:new bn(t.id,this.transport),activityTimeout:t.activityTimeout}):(this.finish(t.action,{error:t.error}),this.transport.close())},this.onClosed=e=>{this.unbindListeners();var t=se.getCloseAction(e)||"backoff",s=se.getCloseError(e);this.finish(t,{error:s})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}unbindListeners(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}finish(e,t){this.callback(W({transport:this.transport,action:e},t))}}class yn{constructor(e,t){this.timeline=e,this.options=t||{}}send(e,t){this.timeline.isEmpty()||this.timeline.send(_.TimelineTransport.getAgent(this,e),t)}}class Ae extends Q{constructor(e,t){super(function(s,r){R.debug("No callbacks on "+e+" for "+s)}),this.name=e,this.pusher=t,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(e,t){return t(null,{auth:""})}trigger(e,t){if(e.indexOf("client-")!==0)throw new p("Event '"+e+"' does not start with 'client-'");if(!this.subscribed){var s=w.buildLogSuffix("triggeringClientEvents");R.warn(`Client event triggered before channel 'subscription_succeeded' event . ${s}`)}return this.pusher.send_event(e,t,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(e){var t=e.event,s=e.data;if(t==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(e);else if(t==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(e);else if(t.indexOf("pusher_internal:")!==0){var r={};this.emit(t,s,r)}}handleSubscriptionSucceededEvent(e){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",e.data)}handleSubscriptionCountEvent(e){e.data.subscription_count&&(this.subscriptionCount=e.data.subscription_count),this.emit("pusher:subscription_count",e.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(e,t)=>{e?(this.subscriptionPending=!1,R.error(e.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:e.message},e instanceof C?{status:e.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:t.auth,channel_data:t.channel_data,channel:this.name})}))}unsubscribe(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})}cancelSubscription(){this.subscriptionCancelled=!0}reinstateSubscription(){this.subscriptionCancelled=!1}}class Ie extends Ae{authorize(e,t){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:e},t)}}class wn{constructor(){this.reset()}get(e){return Object.prototype.hasOwnProperty.call(this.members,e)?{id:e,info:this.members[e]}:null}each(e){K(this.members,(t,s)=>{e(this.get(s))})}setMyID(e){this.myID=e}onSubscription(e){this.members=e.presence.hash,this.count=e.presence.count,this.me=this.get(this.myID)}addMember(e){return this.get(e.user_id)===null&&this.count++,this.members[e.user_id]=e.user_info,this.get(e.user_id)}removeMember(e){var t=this.get(e.user_id);return t&&(delete this.members[e.user_id],this.count--),t}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var Sn=function(n,e,t,s){function r(o){return o instanceof t?o:new t(function(c){c(o)})}return new(t||(t=Promise))(function(o,c){function f(P){try{T(s.next(P))}catch(D){c(D)}}function b(P){try{T(s.throw(P))}catch(D){c(D)}}function T(P){P.done?o(P.value):r(P.value).then(f,b)}T((s=s.apply(n,e||[])).next())})};class Cn extends Ie{constructor(e,t){super(e,t),this.members=new wn}authorize(e,t){super.authorize(e,(s,r)=>Sn(this,void 0,void 0,function*(){if(!s)if(r=r,r.channel_data!=null){var o=JSON.parse(r.channel_data);
7this.members.setMyID(o.user_id)}else if(yield this.pusher.user.signinDonePromise,this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else{let c=w.buildLogSuffix("authorizationEndpoint");R.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${c}, or the user should be signed in.`),t("Invalid auth response");return}t(s,r)}))}handleEvent(e){var t=e.event;if(t.indexOf("pusher_internal:")===0)this.handleInternalEvent(e);else{var s=e.data,r={};e.user_id&&(r.user_id=e.user_id),this.emit(t,s,r)}}handleInternalEvent(e){var t=e.event,s=e.data;switch(t){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(e);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(e);break;case"pusher_internal:member_added":var r=this.members.addMember(s);this.emit("pusher:member_added",r);break;case"pusher_internal:member_removed":var o=this.members.removeMember(s);o&&this.emit("pusher:member_removed",o);break}}handleSubscriptionSucceededEvent(e){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(e.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var kn=S(978),Re=S(594);class Tn extends Ie{constructor(e,t,s){super(e,t),this.key=null,this.nacl=s}authorize(e,t){super.authorize(e,(s,r)=>{if(s){t(s,r);return}let o=r.shared_secret;if(!o){t(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=(0,Re.decode)(o),delete r.shared_secret,t(null,r)})}trigger(e,t){throw new g("Client events are not currently supported for encrypted channels")}handleEvent(e){var t=e.event,s=e.data;if(t.indexOf("pusher_internal:")===0||t.indexOf("pusher:")===0){super.handleEvent(e);return}this.handleEncryptedEvent(t,s)}handleEncryptedEvent(e,t){if(!this.key){R.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!t.ciphertext||!t.nonce){R.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+t);return}let s=(0,Re.decode)(t.ciphertext);if(s.length<this.nacl.secretbox.overheadLength){R.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${s.length}`);return}let r=(0,Re.decode)(t.nonce);if(r.length<this.nacl.secretbox.nonceLength){R.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${r.length}`);return}let o=this.nacl.secretbox.open(s,r,this.key);if(o===null){R.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),this.authorize(this.pusher.connection.socket_id,(c,f)=>{if(c){R.error(`Failed to make a request to the authEndpoint: ${f}. Unable to fetch new key, so dropping encrypted event`);return}if(o=this.nacl.secretbox.open(s,r,this.key),o===null){R.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(e,this.getDataToEmit(o))});return}this.emit(e,this.getDataToEmit(o))}getDataToEmit(e){let t=(0,kn.D4)(e);try{return JSON.parse(t)}catch{return t}}}class xn extends Q{constructor(e,t){super(),this.state="initialized",this.connection=null,this.key=e,this.options=t,this.timeline=this.options.timeline,this.usingTLS=this.options.useTLS,this.errorCallbacks=this.buildErrorCallbacks(),this.connectionCallbacks=this.buildConnectionCallbacks(this.errorCallbacks),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var s=_.getNetwork();s.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),s.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}switchCluster(e){this.key=e,this.updateStrategy(),this.retryIn(0)}connect(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(e){return this.connection?this.connection.send(e):!1}send_event(e,t,s){return this.connection?this.connection.send_event(e,t,s):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var e=(t,s)=>{t?this.runner=this.strategy.connect(0,e):s.action==="error"?(this.emit
7("error",{type:"HandshakeError",error:s.error}),this.timeline.error({handshakeError:s.error})):(this.abortConnecting(),this.handshakeCallbacks[s.action](s))};this.runner=this.strategy.connect(0,e)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var e=this.abandonConnection();e.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(e){this.timeline.info({action:"retry",delay:e}),e>0&&this.emit("connecting_in",Math.round(e/1e3)),this.retryTimer=new ne(e||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new ne(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new ne(this.options.pongTimeout,()=>{this.timeline.error({pong_timed_out:this.options.pongTimeout}),this.retryIn(0)})}resetActivityCheck(){this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new ne(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(e){return W({},e,{message:t=>{this.resetActivityCheck(),this.emit("message",t)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:t=>{this.emit("error",t)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(e){return W({},e,{connected:t=>{this.activityTimeout=Math.min(this.options.activityTimeout,t.activityTimeout,t.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(t.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let e=t=>s=>{s.error&&this.emit("error",{type:"WebSocketError",error:s.error}),t(s)};return{tls_only:e(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:e(()=>{this.disconnect()}),backoff:e(()=>{this.retryIn(1e3)}),retry:e(()=>{this.retryIn(0)})}}setConnection(e){this.connection=e;for(var t in this.connectionCallbacks)this.connection.bind(t,this.connectionCallbacks[t]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var e in this.connectionCallbacks)this.connection.unbind(e,this.connectionCallbacks[e]);var t=this.connection;return this.connection=null,t}}updateState(e,t){var s=this.state;if(this.state=e,s!==e){var r=e;r==="connected"&&(r+=" with new socket ID "+t.socket_id),R.debug("State changed",s+" -> "+r),this.timeline.info({state:e,params:t}),this.emit("state_change",{previous:s,current:e}),this.emit(e,t)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class Pn{constructor(){this.channels={}}add(e,t){return this.channels[e]||(this.channels[e]=Ln(e,t)),this.channels[e]}all(){return qt(this.channels)}find(e){return this.channels[e]}remove(e){var t=this.channels[e];return delete this.channels[e],t}disconnect(){K(this.channels,function(e){e.disconnect()})}}function Ln(n,e){if(n.indexOf("private-encrypted-")===0){if(e.config.nacl)return Z.createEncryptedChannel(n,e,e.config.nacl);let t="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",s=w.buildLogSuffix("encryptedChannelSupport");throw new g(`${t}. ${s}`)}else{if(n.indexOf("private-")===0)return Z.createPrivateChannel(n,e);if(n.indexOf("presence-")===0)return Z.createPresenceChannel(n,e);if(n.indexOf("#")===0)throw new m('Cannot create a channel with name "'+n+'".');return Z.createChannel(n,e)}}var En={createChannels(){return new Pn},createConnectionManager(n,e){return new xn(n,e)},createChannel(n,e){return new Ae(n,e)},createPrivateChannel(n,e){return new Ie(n,e)},createPresenceChannel(n,e){return new Cn(n,e)}
7,createEncryptedChannel(n,e,t){return new Tn(n,e,t)},createTimelineSender(n,e){return new yn(n,e)},createHandshake(n,e){return new _n(n,e)},createAssistantToTheTransportManager(n,e,t){return new vn(n,e,t)}};const Z=En;class nt{constructor(e){this.options=e||{},this.livesLeft=this.options.lives||1/0}getAssistant(e){return Z.createAssistantToTheTransportManager(this,e,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class re{constructor(e,t){this.strategies=e,this.loop=!!t.loop,this.failFast=!!t.failFast,this.timeout=t.timeout,this.timeoutLimit=t.timeoutLimit}isSupported(){return Ge(this.strategies,$.method("isSupported"))}connect(e,t){var s=this.strategies,r=0,o=this.timeout,c=null,f=(b,T)=>{T?t(null,T):(r=r+1,this.loop&&(r=r%s.length),r<s.length?(o&&(o=o*2,this.timeoutLimit&&(o=Math.min(o,this.timeoutLimit))),c=this.tryStrategy(s[r],e,{timeout:o,failFast:this.failFast},f)):t(!0))};return c=this.tryStrategy(s[r],e,{timeout:o,failFast:this.failFast},f),{abort:function(){c.abort()},forceMinPriority:function(b){e=b,c&&c.forceMinPriority(b)}}}tryStrategy(e,t,s,r){var o=null,c=null;return s.timeout>0&&(o=new ne(s.timeout,function(){c.abort(),r(!0)})),c=e.connect(t,function(f,b){f&&o&&o.isRunning()&&!s.failFast||(o&&o.ensureAborted(),r(f,b))}),{abort:function(){o&&o.ensureAborted(),c.abort()},forceMinPriority:function(f){c.forceMinPriority(f)}}}}class Oe{constructor(e){this.strategies=e}isSupported(){return Ge(this.strategies,$.method("isSupported"))}connect(e,t){return An(this.strategies,e,function(s,r){return function(o,c){if(r[s].error=o,o){In(r)&&t(!0);return}le(r,function(f){f.forceMinPriority(c.transport.priority)}),t(null,c)}})}}function An(n,e,t){var s=Je(n,function(r,o,c,f){return r.connect(e,t(o,f))});return{abort:function(){le(s,Rn)},forceMinPriority:function(r){le(s,function(o){o.forceMinPriority(r)})}}}function In(n){return Ft(n,function(e){return!!e.error})}function Rn(n){!n.error&&!n.aborted&&(n.abort(),n.aborted=!0)}class On{constructor(e,t,s){this.strategy=e,this.transports=t,this.ttl=s.ttl||18e5,this.usingTLS=s.useTLS,this.timeline=s.timeline}isSupported(){return this.strategy.isSupported()}connect(e,t){var s=this.usingTLS,r=jn(s),o=r&&r.cacheSkipCount?r.cacheSkipCount:0,c=[this.strategy];if(r&&r.timestamp+this.ttl>=$.now()){var f=this.transports[r.transport];f&&(["ws","wss"].includes(r.transport)||o>3?(this.timeline.info({cached:!0,transport:r.transport,latency:r.latency}),c.push(new re([f],{timeout:r.latency*2+1e3,failFast:!0}))):o++)}var b=$.now(),T=c.pop().connect(e,function P(D,Se){D?(st(s),c.length>0?(b=$.now(),T=c.pop().connect(e,P)):t(D)):(Nn(s,Se.transport.name,$.now()-b,o),t(null,Se))});return{abort:function(){T.abort()},forceMinPriority:function(P){e=P,T&&T.forceMinPriority(P)}}}}function je(n){return"pusherTransport"+(n?"TLS":"NonTLS")}function jn(n){var e=_.getLocalStorage();if(e)try{var t=e[je(n)];if(t)return JSON.parse(t)}catch{st(n)}return null}function Nn(n,e,t,s){var r=_.getLocalStorage();if(r)try{r[je(n)]=ve({timestamp:$.now(),transport:e,latency:t,cacheSkipCount:s})}catch{}}function st(n){var e=_.getLocalStorage();if(e)try{delete e[je(n)]}catch{}}class _e{constructor(e,{delay:t}){this.strategy=e,this.options={delay:t}}isSupported(){return this.strategy.isSupported()}connect(e,t){var s=this.strategy,r,o=new ne(this.options.delay,function(){r=s.connect(e,t)});return{abort:function(){o.ensureAborted(),r&&r.abort()},forceMinPriority:function(c){e=c,r&&r.forceMinPriority(c)}}}}class de{constructor(e,t,s){this.test=e,this.trueBranch=t,this.falseBranch=s}isSupported(){var e=this.test()?this.trueBranch:this.falseBranch;return e.isSupported()}connect(e,t){var s=this.test()?this.trueBranch:this.falseBranch;return s.connect(e,t)}}class Un{constructor(e){this.strategy=e}isSupported(){return this.strategy.isSupported()}connect(e,t){var s=this.strategy.connect(e,function(r,o){o&&s.abort(),t(r,o)});return s}}function pe(n){return function(){return n.isSupported()}}var Dn=function(n,e,t){var s={};function r(mt,js,Ns,Us,Ds){var vt=t(n,mt,js,Ns,Us,Ds);return s[mt]=vt,vt}var o=Object.assign({},e,{hostNonTLS:n.wsHost+":"+n.wsPort,hostTLS:n.wsHost+":"+n.wssPort,httpPath:n.wsPath}),c=Object.assign({},o,{useTLS:!0}),f=Object.assign({},e,{hostNonTLS:n.httpHost+":"+n.httpPort,hostTLS:n.httpHost+":"+n.httpsPort,httpPath:n.httpPath}),b={loop:!0,timeout:15e3,timeoutLimit:6e4},T=new nt({minPingDelay:1e4,maxPingDelay:n.activityTimeout}),P=new nt({lives:2,minPingDelay:1e4,maxPingDelay:n.activityTimeout}),D=r("ws","ws",3,o,T),Se=r("wss","ws",3,c,T),Es=r("sockjs","sockjs",1,f),ut=r("xhr_streaming","xhr_streaming",1,f,P),As=r("xdr_streaming","xdr_streaming",1,f,P),lt=r("xhr_polling","xhr_polling",1,f),Is=r("xdr_polling","xdr_polling",1,f),dt=new re([D],b),Rs=new re([Se],b),Os=new re([Es],b),pt=new re([new de(pe(ut),ut,As)],b),ft=new re([new de(pe(lt),lt,Is)],b),gt=new re([new de(pe(pt),new Oe([pt,new _e(ft,{delay:4e3})]),ft)],b),De=new de(pe(gt),gt,Os),Me;return e.useTLS?Me=new Oe([dt,new _e(De,{delay:2e3})]):Me=new Oe([dt,new _e(Rs,{delay:2e3}),new _e(De,{delay:5e3})]),new On(new Un(new de(pe(D),Me,De)),s,{ttl:18e5,timeline:e.timeline,useTLS:e.useTLS})};const Mn=Dn;function Hn(){var n=this;n.timeline.info(n.buildTimelineMessage({transport:n.name+(n.options.useTLS?"s":"")})),n.hooks.isInitialized()?n.changeState("initialized"):n.hooks.file?(n.changeState("initializing"),H.load(n.hooks.file,{useTLS:n.options.useTLS},function(e,t){n.hooks.isInitialized()?(n.changeState("initialized"),t(!0)):(e&&n.onError(e),n.onClose(),t(!1))})):n.onClose()}var qn={getRequest:function(n){var e=new window.XDomainRequest;return e.ontimeout=function(){n.emit("error",new A),n.close()},e.onerror=function(t){n.emit("error",t),n.close()}
7,e.onprogress=function(){e.responseText&&e.responseText.length>0&&n.onChunk(200,e.responseText)},e.onload=function(){e.responseText&&e.responseText.length>0&&n.onChunk(200,e.responseText),n.emit("finished",200),n.close()},e},abortRequest:function(n){n.ontimeout=n.onerror=n.onprogress=n.onload=null,n.abort()}};const zn=qn,Bn=256*1024;class Fn extends Q{constructor(e,t,s){super(),this.hooks=e,this.method=t,this.url=s}start(e){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},_.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(e)}close(){this.unloader&&(_.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(e,t){for(;;){var s=this.advanceBuffer(t);if(s)this.emit("chunk",{status:e,data:s});else break}this.isBufferTooLong(t)&&this.emit("buffer_too_long")}advanceBuffer(e){var t=e.slice(this.position),s=t.indexOf(` 8`);return s!==-1?(this.position+=s+1,t.slice(0,s)):null}isBufferTooLong(e){return this.position===e.length&&e.length>Bn}}var Ne;(function(n){n[n.CONNECTING=0]="CONNECTING",n[n.OPEN=1]="OPEN",n[n.CLOSED=3]="CLOSED"})(Ne||(Ne={}));const ie=Ne;var $n=1;class Xn{constructor(e,t){this.hooks=e,this.session=it(1e3)+"/"+Gn(8),this.location=Jn(t),this.readyState=ie.CONNECTING,this.openStream()}send(e){return this.sendRaw(JSON.stringify([e]))}ping(){this.hooks.sendHeartbeat(this)}close(e,t){this.onClose(e,t,!0)}sendRaw(e){if(this.readyState===ie.OPEN)try{return _.createSocketRequest("POST",rt(Wn(this.location,this.session))).start(e),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(e,t,s){this.closeStream(),this.readyState=ie.CLOSED,this.onclose&&this.onclose({code:e,reason:t,wasClean:s})}onChunk(e){if(e.status===200){this.readyState===ie.OPEN&&this.onActivity();var t,s=e.data.slice(0,1);switch(s){case"o":t=JSON.parse(e.data.slice(1)||"{}"),this.onOpen(t);break;case"a":t=JSON.parse(e.data.slice(1)||"[]");for(var r=0;r<t.length;r++)this.onEvent(t[r]);break;case"m":t=JSON.parse(e.data.slice(1)||"null"),this.onEvent(t);break;case"h":this.hooks.onHeartbeat(this);break;case"c":t=JSON.parse(e.data.slice(1)||"[]"),this.onClose(t[0],t[1],!0);break}}}onOpen(e){this.readyState===ie.CONNECTING?(e&&e.hostname&&(this.location.base=Vn(this.location.base,e.hostname)),this.readyState=ie.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(e){this.readyState===ie.OPEN&&this.onmessage&&this.onmessage({data:e})}onActivity(){this.onactivity&&this.onactivity()}onError(e){this.onerror&&this.onerror(e)}openStream(){this.stream=_.createSocketRequest("POST",rt(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",e=>{this.onChunk(e)}),this.stream.bind("finished",e=>{this.hooks.onFinished(this,e)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(e){$.defer(()=>{this.onError(e),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function Jn(n){var e=/([^\?]*)\/*(\??.*)/.exec(n);return{base:e[1],queryString:e[2]}}function Wn(n,e){return n.base+"/"+e+"/xhr_send"}function rt(n){var e=n.indexOf("?")===-1?"?":"&";return n+e+"t="+ +new Date+"&n="+$n++}function Vn(n,e){var t=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(n);return t[1]+e+t[3]}function it(n){return _.randomInt(n)}function Gn(n){for(var e=[],t=0;t<n;t++)e.push(it(32).toString(32));return e.join("")}const Yn=Xn;var Kn={getReceiveURL:function(n,e){return n.base+"/"+e+"/xhr_streaming"+n.queryString},onHeartbeat:function(n){n.sendRaw("[]")},sendHeartbeat:function(n){n.sendRaw("[]")},onFinished:function(n,e){n.onClose(1006,"Connection interrupted ("+e+")",!1)}};const Qn=Kn;var Zn={getReceiveURL:function(n,e){return n.base+"/"+e+"/xhr"+n.queryString},onHeartbeat:function(){},sendHeartbeat:function(n){n.sendRaw("[]")},onFinished:function(n,e){e===200?n.reconnect():n.onClose(1006,"Connection interrupted ("+e+")",!1)}};const es=Zn;var ts={getRequest:function(n){var e=_.getXHRAPI(),t=new e;return t.onreadystatechange=t.onprogress=function(){switch(t.readyState){case 3:t.responseText&&t.responseText.length>0&&n.onChunk(t.status,t.responseText);break;case 4:t.responseText&&t.responseText.length>0&&n.onChunk(t.status,t.responseText),n.emit("finished",t.status),n.close();break}},t},abortRequest:function(n){n.onreadystatechange=null,n.abort()}};const ns=ts;var ss={createStreamingSocket(n){return this.createSocket(Qn,n)},createPollingSocket(n){return this.createSocket(es,n)},createSocket(n,e){return new Yn(n,e)},createXHR(n,e){return this.createRequest(ns,n,e)},createRequest(n,e,t){return new Fn(n,e,t)}};const ot=ss;ot.createXDR=function(n,e){return this.createRequest(zn,n,e)};var rs={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:N,DependenciesReceivers:X,getDefaultStrategy:Mn,Trans
8ports:fn,transportConnectionInitializer:Hn,HTTPFactory:ot,TimelineTransport:en,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(n){window.Pusher=n;var e=()=>{this.onDocumentBody(n.ready)};window.JSON?e():H.load("json2",{},e)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:he,jsonp:Gt}},onDocumentBody(n){document.body?n():setTimeout(()=>{this.onDocumentBody(n)},0)},createJSONPRequest(n,e){return new Kt(n,e)},createScriptRequest(n){return new Yt(n)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var n=this.getXHRAPI();return new n},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return mn},createWebSocket(n){var e=this.getWebSocketAPI();return new e(n)},createSocketRequest(n,e){if(this.isXHRSupported())return this.HTTPFactory.createXHR(n,e);if(this.isXDRSupported(e.indexOf("https:")===0))return this.HTTPFactory.createXDR(n,e);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var n=this.getXHRAPI();return!!n&&new n().withCredentials!==void 0},isXDRSupported(n){var e=n?"https:":"http:",t=this.getProtocol();return!!window.XDomainRequest&&t===e},addUnloadListener(n){window.addEventListener!==void 0?window.addEventListener("unload",n,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",n)},removeUnloadListener(n){window.addEventListener!==void 0?window.removeEventListener("unload",n,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",n)},randomInt(n){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)}()*n)}};const _=rs;var Ue;(function(n){n[n.ERROR=3]="ERROR",n[n.INFO=6]="INFO",n[n.DEBUG=7]="DEBUG"})(Ue||(Ue={}));const ye=Ue;class is{constructor(e,t,s){this.key=e,this.session=t,this.events=[],this.options=s||{},this.sent=0,this.uniqueID=0}log(e,t){e<=this.options.level&&(this.events.push(W({},t,{timestamp:$.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(e){this.log(ye.ERROR,e)}info(e){this.log(ye.INFO,e)}debug(e){this.log(ye.DEBUG,e)}isEmpty(){return this.events.length===0}send(e,t){var s=W({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],e(s,(r,o)=>{r||this.sent++,t&&t(r,o)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class os{constructor(e,t,s,r){this.name=e,this.priority=t,this.transport=s,this.options=r||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(e,t){if(this.isSupported()){if(this.priority<e)return at(new q,t)}else return at(new v,t);var s=!1,r=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),o=null,c=function(){r.unbind("initialized",c),r.connect()},f=function(){o=Z.createHandshake(r,function(D){s=!0,P(),t(null,D)})},b=function(D){P(),t(D)},T=function(){P();var D;D=ve(r),t(new z(D))},P=function(){r.unbind("initialized",c),r.unbind("open",f),r.unbind("error",b),r.unbind("closed",T)};return r.bind("initialized",c),r.bind("open",f),r.bind("error",b),r.bind("closed",T),r.initialize(),{abort:()=>{s||(P(),o?o.close():r.close())},forceMinPriority:D=>{s||this.priority<D&&(o?o.close():r.close())}}}}function at(n,e){return $.defer(function(){e(n)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:as}=_;var cs=function(n,e,t,s,r,o){var c=as[t];if(!c)throw new d(t);var f=(!n.enabledTransports||$e(n.enabledTransports,e)!==-1)&&(!n.disabledTransports||$e(n.disabledTransports,e)===-1),b;return f?(r=Object.assign({ignoreNullOrigin:n.ignoreNullOrigin},r),b=new os(e,s,o?o.getAssistant(c):c,r)):b=hs,b},hs={isSupported:function(){return!1},connect:function(n,e){var t=$.defer(function(){e(new v)});return{abort:function(){t.ensureAborted()},forceMinPriority:function(){}}}};function us(n){if(n==null)throw"You must pass an options object";if(n.cluster==null)throw"Options object must provide a cluster";"disableStats"in n&&R.warn("The disableStats option is deprecated
8in favor of enableStats")}const ls=(n,e)=>{var t="socket_id="+encodeURIComponent(n.socketId);for(var s in e.params)t+="&"+encodeURIComponent(s)+"="+encodeURIComponent(e.params[s]);if(e.paramsProvider!=null){let r=e.paramsProvider();for(var s in r)t+="&"+encodeURIComponent(s)+"="+encodeURIComponent(r[s])}return t},ds=n=>{if(typeof _.getAuthorizers()[n.transport]>"u")throw`'${n.transport}' is not a recognized auth transport`;return(e,t)=>{const s=ls(e,n);_.getAuthorizers()[n.transport](_,s,n,h.UserAuthentication,t)}},ps=(n,e)=>{var t="socket_id="+encodeURIComponent(n.socketId);t+="&channel_name="+encodeURIComponent(n.channelName);for(var s in e.params)t+="&"+encodeURIComponent(s)+"="+encodeURIComponent(e.params[s]);if(e.paramsProvider!=null){let r=e.paramsProvider();for(var s in r)t+="&"+encodeURIComponent(s)+"="+encodeURIComponent(r[s])}return t},fs=n=>{if(typeof _.getAuthorizers()[n.transport]>"u")throw`'${n.transport}' is not a recognized auth transport`;return(e,t)=>{const s=ps(e,n);_.getAuthorizers()[n.transport](_,s,n,h.ChannelAuthorization,t)}},gs=(n,e,t)=>{const s={authTransport:e.transport,authEndpoint:e.endpoint,auth:{params:e.params,headers:e.headers}};return(r,o)=>{const c=n.channel(r.channelName);t(c,s).authorize(r.socketId,o)}};function ct(n,e){let t={activityTimeout:n.activityTimeout||y.activityTimeout,cluster:n.cluster,httpPath:n.httpPath||y.httpPath,httpPort:n.httpPort||y.httpPort,httpsPort:n.httpsPort||y.httpsPort,pongTimeout:n.pongTimeout||y.pongTimeout,statsHost:n.statsHost||y.stats_host,unavailableTimeout:n.unavailableTimeout||y.unavailableTimeout,wsPath:n.wsPath||y.wsPath,wsPort:n.wsPort||y.wsPort,wssPort:n.wssPort||y.wssPort,enableStats:ys(n),httpHost:ms(n),useTLS:_s(n),wsHost:vs(n),userAuthenticator:ws(n),channelAuthorizer:Cs(n,e)};return"disabledTransports"in n&&(t.disabledTransports=n.disabledTransports),"enabledTransports"in n&&(t.enabledTransports=n.enabledTransports),"ignoreNullOrigin"in n&&(t.ignoreNullOrigin=n.ignoreNullOrigin),"timelineParams"in n&&(t.timelineParams=n.timelineParams),"nacl"in n&&(t.nacl=n.nacl),t}function ms(n){return n.httpHost?n.httpHost:n.cluster?`sockjs-${n.cluster}.pusher.com`:y.httpHost}function vs(n){return n.wsHost?n.wsHost:bs(n.cluster)}function bs(n){return`ws-${n}.pusher.com`}function _s(n){return _.getProtocol()==="https:"?!0:n.forceTLS!==!1}function ys(n){return"enableStats"in n?n.enableStats:"disableStats"in n?!n.disableStats:!1}const ht=n=>"customHandler"in n&&n.customHandler!=null;function ws(n){const e=Object.assign(Object.assign({},y.userAuthentication),n.userAuthentication);return ht(e)?e.customHandler:ds(e)}function Ss(n,e){let t;if("channelAuthorization"in n)t=Object.assign(Object.assign({},y.channelAuthorization),n.channelAuthorization);else if(t={transport:n.authTransport||y.authTransport,endpoint:n.authEndpoint||y.authEndpoint},"auth"in n&&("params"in n.auth&&(t.params=n.auth.params),"headers"in n.auth&&(t.headers=n.auth.headers)),"authorizer"in n)return{customHandler:gs(e,t,n.authorizer)};return t}function Cs(n,e){const t=Ss(n,e);return ht(t)?t.customHandler:fs(t)}class ks extends Q{constructor(e){super(function(t,s){R.debug(`No callbacks on watchlist events for ${t}`)}),this.pusher=e,this.bindWatchlistInternalEvent()}handleEvent(e){e.data.events.forEach(t=>{this.emit(t.name,t)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",e=>{var t=e.event;t==="pusher_internal:watchlist_events"&&this.handleEvent(e)})}}function Ts(){let n,e;return{promise:new Promise((s,r)=>{n=s,e=r}),resolve:n,reject:e}}const xs=Ts;class Ps extends Q{constructor(e){super(function(t,s){R.debug("No callbacks on user for "+t)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(t,s)=>{if(t){R.warn(`Error during signin: ${t}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:s.auth,user_data:s.user_data})},this.pusher=e,this.pusher.connection.bind("state_change",({previous:t,current:s})=>{t!=="connected"&&s==="connected"&&this._signin(),t==="connected"&&s!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new ks(e),this.pusher.connection.bind("message",t=>{var s=t.event;s==="pusher:signin_success"&&this._onSigninSuccess(t.data),this.serverToUserChannel&&this.serverToUserChannel.name===t.channel&&this.serverToUserChannel.handleEvent(t)})}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(e){try{this.user_data=JSON.parse(e.user_data)}catch{R.error(`Failed parsing user data after signin: ${e.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){R.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const e=t=>{t.subscriptionPending&&t.subscriptionCancelled?t.reinstateSubscription():!t.subscriptionPending&&this.pusher.connection.state==="connected"&&t.subscribe()};this.serverToUserChannel=new Ae(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((t,s)=>{t.indexOf("pusher_internal:")===0||t.indexOf("pusher:")===0||this.emit
8(t,s)}),e(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested||this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:e,resolve:t}=xs();e.done=!1;const s=()=>{e.done=!0};e.then(s).catch(s),this.signinDonePromise=e,this._signinDoneResolve=t}}class B{static ready(){B.isReady=!0;for(var e=0,t=B.instances.length;e<t;e++)B.instances[e].connect()}static getClientFeatures(){return Xe(Ve({ws:_.Transports.ws},function(e){return e.isSupported({})}))}constructor(e,t){Ls(e),us(t),this.key=e,this.options=t,this.config=ct(this.options,this),this.channels=Z.createChannels(),this.global_emitter=new Q,this.sessionID=_.randomInt(1e9),this.timeline=new is(this.key,this.sessionID,{cluster:this.config.cluster,features:B.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:ye.INFO,version:y.VERSION}),this.config.enableStats&&(this.timelineSender=Z.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+_.TimelineTransport.name}));var s=r=>_.getDefaultStrategy(this.config,r,cs);this.connection=Z.createConnectionManager(this.key,{getStrategy:s,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())}),this.connection.bind("message",r=>{var o=r.event,c=o.indexOf("pusher_internal:")===0;if(r.channel){var f=this.channel(r.channel);f&&f.handleEvent(r)}c||this.global_emitter.emit(r.event,r.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",r=>{R.warn(r)}),B.instances.push(this),this.timeline.info({instances:B.instances.length}),this.user=new Ps(this),B.isReady&&this.connect()}switchCluster(e){const{appKey:t,cluster:s}=e;this.key=t,this.options=Object.assign(Object.assign({},this.options),{cluster:s}),this.config=ct(this.options,this),this.connection.switchCluster(this.key)}channel(e){return this.channels.find(e)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var e=this.connection.isUsingTLS(),t=this.timelineSender;this.timelineSenderTimer=new Dt(6e4,function(){t.send(e)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(e,t,s){return this.global_emitter.bind(e,t,s),this}unbind(e,t,s){return this.global_emitter.unbind(e,t,s),this}bind_global(e){return this.global_emitter.bind_global(e),this}unbind_global(e){return this.global_emitter.unbind_global(e),this}unbind_all(e){return this.global_emitter.unbind_all(),this}subscribeAll(){var e;for(e in this.channels.channels)this.channels.channels.hasOwnProperty(e)&&this.subscribe(e)}subscribe(e){var t=this.channels.add(e,this);return t.subscriptionPending&&t.subscriptionCancelled?t.reinstateSubscription():!t.subscriptionPending&&this.connection.state==="connected"&&t.subscribe(),t}unsubscribe(e){var t=this.channels.find(e);t&&t.subscriptionPending?t.cancelSubscription():(t=this.channels.remove(e),t&&t.subscribed&&t.unsubscribe())}send_event(e,t,s){return this.connection.send_event(e,t,s)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}B.instances=[],B.isReady=!1,B.logToConsole=!1,B.Runtime=_,B.ScriptReceivers=_.ScriptReceivers,B.DependenciesReceivers=_.DependenciesReceivers,B.auth_callbacks=_.auth_callbacks;const we=B;function Ls(n){if(n==null)throw"You must pass your app key when you instantiate Pusher."}_.setup(B)}},u={};function k(M){var x=u[M];if(x!==void 0)return x.exports;var S=u[M]={exports:{}};return a[M].call(S.exports,S,S.exports,k),S.exports}k.d=(M,x)=>{for(var S in x)k.o(x,S)&&!k.o(M,S)&&Object.defineProperty(M,S,{enumerable:!0,get:x[S]})},k.o=(M,x)=>Object.prototype.hasOwnProperty.call(M,x);var J=k(721);return J})())})(He)),He.exports}var _r=br();const yr=Ms(_r);window.Pusher=yr;let ee=null;
8function wr(j){return ee&&Et(),ee=new vr({broadcaster:"reverb",key:"dyhcbyqnytrcxz04rbnz",wsHost:"jforceadmin.jubileeinsurance.com",wsPort:443,wssPort:443,forceTLS:!0,enabledTransports:["ws","wss"],authorizer:i=>({authorize:(a,u)=>{Hs.post("api/broadcasting/auth",{socket_id:a,channel:i.name}).then(k=>{u(null,k.data)}).catch(k=>{console.error("[Echo] Auth error:",k),u(k)})}})}),ee}function Et(){ee&&(ee.disconnect(),ee=null)}function Sr(){if(!ee)throw new Error("[echo] Not connected. Call echoService.connect(token) after login.");return ee}const Cr={class:"container"},kr={class:"container d2c-box mt-5"},Tr={class:"dashed_box_theme row mx-1 align-items-center mt-2",style:{border:"none"}},xr={class:"col-md-4 pl-3"},Pr={class:"portfolio d-flex align-items-center"},Lr={class:"name",style:{"font-family":"'Futura PT Medium'"}},Er={class:"small_info"},Ar={class:"small_info"},Ir={class:"small_info"},Rr={class:"small_info"},Or={class:"col-md-4 px-0"},jr={class:"portfolio d-flex align-items-center"},Nr={class:"small_info"},Ur={class:"small_info"},Dr={key:0,class:"small_info"},Mr={key:1,class:"small_info"},Hr={key:0,class:"col-md-2 align-items-end px-0 float-right"},qr={class:"container d2c-box mt-4"},zr={class:"row"},Br={class:"col-md-12",style:{height:"auto",width:"100%"}},Fr={class:"complaint_detail mb-5",style:{height:"auto",width:"100%","word-wrap":"break-word","overflow-wrap":"break-word","white-space":"normal"}},$r={key:0,class:"receive_message d-flex flex-row align-items-start"},Xr={class:"d-flex flex-column ml-3"},Jr={key:0,class:"message",style:{width:"50%"}},Wr={key:1,class:"chat_images_grid mt-2"},Vr=["src","alt","onClick"],Gr={class:"message-time"},Yr={key:1,class:"receive_message d-flex flex-row align-items-start justify-content-end"},Kr={class:"d-flex flex-column align-items-end"},Qr={key:0,class:"message",style:{width:"500px !important"}},Zr={key:1,class:"chat_images_grid mt-2"},ei=["src","alt","onClick"],ti={class:"message-time"},ni={class:"input_send_message"},si={class:"input_wrapper"},ri={key:0,class:"images_preview_grid"},ii=["src"],oi=["onClick"],ai={class:"input_row"},ci=["placeholder","disabled"],hi={__name:"ComplaintScreen",setup(j){const i=zs(),a=hr();Bs();const u=ge(null),k=ge(""),J=ir([]),M=ge(null),x=ge(null),S=ge([]),{fullName:E}=or(),{showTime:N}=ar(),V=["image/png","image/jpeg","image/jpg","image/gif","image/webp","image/bmp"],y=cr(()=>[...J]);Fs(u,g=>{if(g&&g.messages){const d=[...g.messages].reverse();J.splice(0,J.length,...d)}else J.splice(0,J.length)},{immediate:!0});function I(g){return g?g.toLowerCase().replace(/_/g," ").replace(/\b\w/g,d=>d.toUpperCase()):""}$s(async()=>{a.loader=!0;const g=await a.complaintDetail(i.params.id);if(g.data&&g.data.code==200){u.value=g.data.data;const d=[...g.data.data.messages||[]].reverse();J.splice(0,J.length,...d),setTimeout(H,200)}a.loader=!1});let X=null;Xs(async()=>{if(!(localStorage.getItem("TOKEN")?JSON.parse(localStorage.getItem("TOKEN")):null))return;wr();const d=Sr();X=d.private(`complaint.${i.params.id}`).subscribed(()=>{X.listenForWhisper("new_message",C=>{G(C)}),d.connector.pusher.channel(`private-complaint.${i.params.id}`).bind_global((C,L)=>{(C==="message.sent"||C==="new_message"||C==="MessageCreated"||C==="client-message.sent")&&G(L),(C==="ComplaintUpdated"||C==="complaint_update")&&te(L)})}).error(v=>{console.error("[Echo] Channel error:",v)})}),Js(()=>{X&&(X=null),Et()});const H=()=>{M.value&&setTimeout(()=>{M.value.scrollTop=M.value.scrollHeight},100)},G=g=>{g.complaint_id==i.params.id&&(J.push(g),H())},te=g=>{g.id==i.params.id&&u.value&&Object.assign(u.value,g)},w=()=>{x.value&&x.value.click()},h=g=>{const d=g.target.files;if(!d||d.length===0)return;const v=5*1024*1024;for(let C=0;C<d.length;C++){const L=d[C];if(!V.includes(L.type)){ce(`${L.name}: Invalid image format. Use PNG, JPG, JPEG, GIF, WEBP, BMP`);continue}if(L.size>v){ce(`${L.name}: Image size should be less than 5MB`);continue}S.value.push({file:L,preview:URL.createObjectURL(L)})}g.target.value=""},p=g=>{S.value[g]?.preview&&URL.revokeObjectURL(S.value[g].preview),S.value.splice(g,1)},m=()=>{S.value.forEach(g=>{g.preview&&URL.revokeObjectURL(g.preview)}),S.value=[],x.value&&(x.value.value="")},A=async()=>
8{if(u.value?.status.toLowerCase()!=="in_progress"){ce("Complaint is not in process!");return}const g=k.value.trim(),d=S.value.length>0;if(!g&&!d){ce("Please enter a message or attach an image!");return}try{const v={id:u.value.id,message:g?k.value.trim():"",files:d?S.value.map(L=>L.file):[]},C=await a.inquire(v);C.data&&C.data.status?(k.value="",m()):ce(C.data?.message||"Failed to send message")}catch(v){console.error("Error sending message:",v),ce("Failed to send message")}},q=g=>{window.open(g,"_blank")},z=g=>{window.open(g,"_blank")};return(g,d)=>(O(),U(ae,null,[fe(a).loader?(O(),Ws(Vs,{key:0})):Y("",!0),l("div",Cr,[Gs(Ys),l("div",kr,[l("div",Tr,[l("div",xr,[l("div",Pr,[d[8]||(d[8]=l("div",{class:"mb-1 mr-2"},[l("img",{class:"img-fluid",src:Ks,alt:"Hero Image"})],-1)),l("div",null,[l("div",Lr,[d[4]||(d[4]=l("span",{style:{color:"#ba0c2f"}},"Ticket No:",-1)),Qs(" "+F(u.value?.ticket_no),1)]),l("div",Er,[d[5]||(d[5]=l("span",null,"Admin: ",-1)),l("span",null,F(fe(E)(u.value?.insurer?.first_name,u.value?.insurer?.middle_name,u.value?.insurer?.last_name)),1)]),l("div",Ar,[d[6]||(d[6]=l("span",null,"Category: ",-1)),l("span",null,F(u.value?.category),1)]),l("div",Ir,[l("span",null,F(u.value?.category?.replace("_"," ")?.charAt(0).toUpperCase()+u.value?.category?.replace("_"," ")?.slice(1))+" No: ",1),l("span",null,F(u.value?.category_value),1)]),l("div",Rr,[d[7]||(d[7]=l("span",null,"Generated Time: ",-1)),l("span",null,F(fe(Zs)(u.value?.created_at,"YYYY-MM-DD").format("DD MMM YYYY")),1)])])])]),l("div",Or,[l("div",jr,[l("div",null,[l("div",null,[l("div",Nr,[d[9]||(d[9]=l("span",null,"Subject: ",-1)),l("span",null,F(u.value?.subject),1)]),l("div",Ur,[l("span",null,F(u.value?.category?.replace("_"," ")?.charAt(0).toUpperCase()+u.value?.category?.replace("_"," ")?.slice(1))+" No: ",1),l("span",null,F(u.value?.category_value),1)]),u.value?.lead_id?(O(),U("div",Dr,[d[10]||(d[10]=l("span",null,"Customer ID No: ",-1)),l("span",null,F(u.value?.lead_id),1)])):Y("",!0),u.value?.quotation_no?(O(),U("div",Mr,[d[11]||(d[11]=l("span",null,"Illustration No: ",-1)),l("span",null,F(u.value?.quotation_no),1)])):Y("",!0)])])])]),u.value?.status?(O(),U("div",Hr,[d[12]||(d[12]=l("div",{style:{"font-size":"12px",color:"#ba0c2f"}},"Status",-1)),l("div",{class:bt({pending_info:["uw_pending","customer_acceptance_pending","pending"].includes(u.value?.status),info_status:["approved","forward_to_customer","resolved","in_progress","acceptance_letter_issued","customer_correction_requested","additional_requirement"].includes(u.value?.status),declined:["discarded","closed","declined_by_customer","customer_rejected"].includes(u.value?.status)})},F(u.value?.status.replace(/_/g," ").toUpperCase()),3)])):Y("",!0)])]),l("div",qr,[l("div",zr,[l("div",Br,[d[17]||(d[17]=l("div",{class:"unit_heading mt-2 mb-3"},"Complaint Detail",-1)),l("div",Fr,F(I(u.value?.description)),1),u.value?.documents.length?(O(),U(ae,{key:0},[d[14]||(d[14]=l("div",{class:"black_heading mt-2 mb-3"},"Attachment",-1)),l("div",{style:{background:"#fff"},class:"bg_add_box mt-3",onClick:d[0]||(d[0]=v=>q(u.value?.documents[0].url))},[...d[13]||(d[13]=[l("img",{class:"",src:er,alt:"Hero Image"},null,-1),l("div",null,"Application Form PDF",-1)])])],64)):Y("",!0),l("div",{class:"chat_container",ref_key:"chatContainer",ref:M,style:{"max-height":"400px","overflow-y":"auto"}},[(O(!0),U(ae,null,Ce(y.value,(v,C)=>(O(),U("div",{class:bt(["message-wrapper mt-3 d-flex",{"justify-content-start":v.sender_role=="admin","justify-content-end":v.sender_role=="agent"}]),key:C},[v.sender_role=="admin"?(O(),U("div",$r,[d[15]||(d[15]=l("span",{class:"profile_message user-thumbnail",style:{height:"35px",width:"35px"}},[l("img",{src:_t,style:{height:"100%",width:"100%"}})],-1)),l("div",Xr,[v.message?(O(),U("div",Jr,F(v.message),1)):Y("",!0),v.files&&v.files.length>0?(O(),U("div",Wr,[(O(!0),U(ae,null,Ce(v.files,(L,he)=>(O(),U("img",{key:he,src:L.file_url,alt:L.file_name,class:"chat_image",onClick:xe=>z(L.file_url)},null,8,Vr))),128))])):Y("",!0),l("div",Gr,F(fe(N)(v.created_at)),1)])])):(O(),U("div",Yr,[l("div",Kr,[v.message?(O(),U("div",Qr,F(v.message),1)):Y("",!0),v.files&&v.files.length>0?(O(),U("div",Zr,[(O(!0),U(ae,null,Ce(v.files,(L,he)=>(O(),U("img",{key:he,src:L.file_url,alt:L.file_name,class:"chat_image",onClick:xe=>z(L.file_url)},null,8,ei))),128))])):Y("",!0),l("div",ti,F(fe(N)(v.created_at)),1)]),d[16]||(d[16]=l("span",{class:"profile_message user-thumbnail ml-3",style:{height:"35px",width:"35px"}},[l("img",{src:_t,style:{height:"100%",width:"100%"}})],-1))]))],2))),128))],512)]),l("div",ni,[l("div",si,[S.value.length>0?(O(),U("div",ri,[(O(!0),U(ae,null,Ce(S.value,(v,C)=>(O(),U("div",{key:C,class:"image_preview_item"},[l("img",{src:v.preview,class:"image_preview",alt:"Selected Image"},null,8,ii),l("button",{class:"remove_image_btn",onClick:L=>p(C),type:"button"},"Ã",8,oi)]))),128))])):Y("",!0),l("div",ai,[tr(l("input",{class:"input_message","onUpdate:modelValue":d[1]||(d[1]=v=>k.value=v),placeholder:y.value.length==0?"Start Chat":"Continue Chat",type:"text",disabled:u.value?.status.toLowerCase()!=="in_progress",onKeyup:d[2]||(d[2]=sr(v=>A(),["enter"]))},null,40,ci),[[nr,k.value]]),u.value?.status.toLowerCase()==="in_progress"?(O(),U("button",{key:0,class:"attach_btn",onClick:w,type:"button",title:"Attach Images"},[...d[18]||(d[18]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[l("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})],-1)])])):Y("",!0),u.value?.status.toLowerCase()==="in_progress"?(O(),U("img",{key:1,class:"",src:rr,alt:"Send",onClick:d[3]||(d[3]=v=>A())})):Y("",!0)])]),l("input",{type:"file",style:{display:"none"},ref_key:"fileInput",ref:x,accept:"image/png,image/jpeg,image/jpg,image/gif,image/webp,image/bmp",multiple:"",onChange:h},null,544)])])])])],64))}},gi=qs(hi,[["__scopeId","data-v-826f1592"]]);export{gi as default};
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.