PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB` import store from '@/Store' import componentStore from '../Store' import { getCsrfToken } from '@/util' export default class Connection { constructor() { this.headers = {} } onMessage(message, payload) { message.component.receiveMessage(message, payload) } onError(message, status, response) { message.component.messageSendFailed() return componentStore.onErrorCallback(status, response) } showExpiredMessage(response, message) { if (store.sessionHasExpiredCallback) { store.sessionHasExpiredCallback(response, message) } else { confirm( 'This page has expired.\nWould you like to refresh the page?' ) && window.location.reload() } } sendMessage(message) { let payload = message.payload() let csrfToken = getCsrfToken() let socketId = this.getSocketId() if (window.__testing_request_interceptor) { return window.__testing_request_interceptor(payload, this) } // Forward the query string for the ajax requests. fetch( `${window.livewire_app_url}/livewire/message/${payload.fingerprint.name}`, { method: 'POST', body: JSON.stringify(payload), // This enables "cookies". credentials: 'same-origin', headers: { 'Content-Type': 'application/json', 'Accept': 'text/html, application/xhtml+xml', 'X-Livewire': true, // set Custom Headers ...(this.headers), // We'll set this explicitly to mitigate potential interference from ad-blockers/etc. 'Referer': window.location.href, ...(csrfToken && { 'X-CSRF-TOKEN': csrfToken }), ...(socketId && { 'X-Socket-ID': socketId }) }, } ) .then(response => { if (response.ok) { response.text().then(response => { if (this.isOutputFromDump(response)) { this.onError(message) this.showHtmlModal(response) } else { this.onMessage(message, JSON.parse(response)) } }) } else { if (this.onError(message, response.status, response) === false) return if (response.status === 419) { if (store.sessionHasExpired) return store.sessionHasExpired = true this.showExpiredMessage(response, message) } else { response.text().then(response => { this.showHtmlModal(response) }) } } }) .catch(() => { this.onError(message) }) } isOutputFromDump(output) { return !!output.match(/