PageSourceSearch

https://www.ra-mietrecht-muenchen.de/_nuxt/BJ21rurS.js

js ra-mietrecht-muenchen.de collected 2026-10-07 03:53:32 UTC 77,631 bytes, 2 lines download raw bytes

1import{g as xs}from"./DaWZu8wl.js";import{q as ot,L as Ps,a as As}from"./UB03tw8e.js";var xe={exports:{}};var at;function Es(){return at||(at=1,(function(x,i){(function(d,y){x.exports=y()})(self,()=>(()=>{var a={594(N,C){var w=this&&this.__extends||(function(){var b=function(h,u){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,T){g.__proto__=T}||function(g,T){for(var L in T)T.hasOwnProperty(L)&&(g[L]=T[L])},b(h,u)};return function(h,u){b(h,u);function g(){this.constructor=h}h.prototype=u===null?Object.create(u):(g.prototype=u.prototype,new g)}})();Object.defineProperty(C,"__esModule",{value:!0});var _=256,E=(function(){function b(h){h===void 0&&(h="="),this._paddingCharacter=h}return b.prototype.encodedLength=function(h){return this._paddingCharacter?(h+2)/3*4|0:(h*8+5)/6|0},b.prototype.encode=function(h){for(var u="",g=0;g<h.length-2;g+=3){var T=h[g]<<16|h[g+1]<<8|h[g+2];u+=this._encodeByte(T>>>18&63),u+=this._encodeByte(T>>>12&63),u+=this._encodeByte(T>>>6&63),u+=this._encodeByte(T>>>0&63)}var L=h.length-g;if(L>0){var T=h[g]<<16|(L===2?h[g+1]<<8:0);u+=this._encodeByte(T>>>18&63),u+=this._encodeByte(T>>>12&63),L===2?u+=this._encodeByte(T>>>6&63):u+=this._paddingCharacter||"",u+=this._paddingCharacter||""}return u},b.prototype.maxDecodedLength=function(h){return this._paddingCharacter?h/4*3|0:(h*6+7)/8|0},b.prototype.decodedLength=function(h){return this.maxDecodedLength(h.length-this._getPaddingLength(h))},b.prototype.decode=function(h){if(h.length===0)return new Uint8Array(0);for(var u=this._getPaddingLength(h),g=h.length-u,T=new Uint8Array(this.maxDecodedLength(g)),L=0,j=0,U=0,X=0,z=0,q=0,V=0;j<g-4;j+=4)X=this._decodeChar(h.charCodeAt(j+0)),z=this._decodeChar(h.charCodeAt(j+1)),q=this._decodeChar(h.charCodeAt(j+2)),V=this._decodeChar(h.charCodeAt(j+3)),T[L++]=X<<2|z>>>4,T[L++]=z<<4|q>>>2,T[L++]=q<<6|V,U|=X&_,U|=z&_,U|=q&_,U|=V&_;if(j<g-1&&(X=this._decodeChar(h.charCodeAt(j)),z=this._decodeChar(h.charCodeAt(j+1)),T[L++]=X<<2|z>>>4,U|=X&_,U|=z&_),j<g-2&&(q=this._decodeChar(h.charCodeAt(j+2)),T[L++]=z<<4|q>>>2,U|=q&_),j<g-3&&(V=this._decodeChar(h.charCodeAt(j+3)),T[L++]=q<<6|V,U|=V&_),U!==0)throw new Error("Base64Coder: incorrect characters for decoding");return T},b.prototype._encodeByte=function(h){var u=h;return u+=65,u+=25-h>>>8&6,u+=51-h>>>8&-75,u+=61-h>>>8&-15,u+=62-h>>>8&3,String.fromCharCode(u)},b.prototype._decodeChar=function(h){var u=_;return u+=(42-h&h-44)>>>8&-_+h-43+62,u+=(46-h&h-48)>>>8&-_+h-47+63,u+=(47-h&h-58)>>>8&-_+h-48+52,u+=(64-h&h-91)>>>8&-_+h-65+0,u+=(96-h&h-123)>>>8&-_+h-97+26,u},b.prototype._getPaddingLength=function(h){var u=0;if(this._paddingCharacter){for(var g=h.length-1;g>=0&&h[g]===this._paddingCharacter;g--)u++;if(h.length<4||u>2)throw new Error("Base64Coder: incorrect padding")}return u},b})();C.Coder=E;var H=new E;function v(b){return H.encode(b)}C.encode=v;function k(b){return H.decode(b)}C.decode=k;var M=(function(b){w(h,b);function h(){return b!==null&&b.apply(this,arguments)||this}return h.prototype._encodeByte=function(u){var g=u;return g+=65,g+=25-u>>>8&6,g+=51-u>>>8&-75,g+=61-u>>>8&-13,g+=62-u>>>8&49,String.fromCharCode(g)},h.prototype._decodeChar=function(u){var g=_;return g+=(44-u&u-46)>>>8&-_+u-45+62,g+=(94-u&u-96)>>>8&-_+u-95+63,g+=(47-u&u-58)>>>8&-_+u-48+52,g+=(64-u&u-91)>>>8&-_+u-65+0,g+=(96-u&u-123)>>>8&-_+u-97+26,g},h})(E);C.URLSafeCoder=M;var O=new M;function F(b){return O.encode(b)}C.encodeURLSafe=F;function ee(b){return O.decode(b)}C.decodeURLSafe=ee,C.encodedLength=function(b){return H.encodedLength(b)},C.maxDecodedLength=function(b){return H.maxDecodedLength(b)},C.decodedLength=function(b){return H.decodedLength(b)}},978(N,C){var w="utf8: invalid source encoding";function _(E){for(var H=[],v=0;v<E.length;v++){var k=E[v];if(k&128){var M=void 0;if(k<224){if(v>=E.length)throw new Error(w);var O=E[++v];if((O&192)!==128)throw new Error(w);k=(k&31)<<6|O&63,M=128}else if(k<240){if(v>=E.length-1)throw new Error(w);var O=E[++v],F=E[++v];if((O&192)!==128||(F&192)!==128)throw new Error(w);k=(k&15)<<12|(O&63)<<6|F&63,M=2048}else if(k<248){if(v>=E.length-2)throw new Error(w);var O=E[++v],F=E[++v],ee=E[++v];if((O&192)!==128||(F&192)!==128||(ee&192)!==128)throw new Error(w);k=(k&15)<<18|(O&63)<<12|(F&63)<<6|ee&63,M=65536}else throw new Error(w);if(k<M||k>=55296&&k<=57343)throw new Error(w);if(k>
1=65536){if(k>1114111)throw new Error(w);k-=65536,H.push(String.fromCharCode(55296|k>>10)),k=56320|k&1023}}H.push(String.fromCharCode(k))}return H.join("")}C.D4=_},721(N,C,w){N.exports=w(207).default},207(N,C,w){w.d(C,{default:()=>ue});class _{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 E=new _("_pusher_script_","Pusher.ScriptReceivers"),H={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 v=H;class k{constructor(e){this.options=e,this.receivers=e.receivers||E,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=f.createScriptRequest(r.getPath(e,t)),c=r.receivers.create(function(l){if(r.receivers.remove(c),r.loading[e]){var p=r.loading[e];delete r.loading[e];for(var m=function(A){A||o.cleanup()},S=0;S<p.length;S++)p[S](l,m)}});o.send(c)}}getRoot(e){var t,s=f.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 M=new _("_pusher_dependencies","Pusher.DependenciesReceivers"),O=new k({cdn_http:v.cdn_http,cdn_https:v.cdn_https,version:v.VERSION,suffix:v.dependency_suffix,receivers:M});const F={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"}}},b={buildLogSuffix:function(n){const e="See:",t=F.urls[n];if(!t)return"";let s;return t.fullUrl?s=t.fullUrl:t.path&&(s=F.baseUrl+t.path),s?`${e} ${s}`:""}};var h;(function(n){n.UserAuthentication="user-authentication",n.ChannelAuthorization="channel-authorization"})(h||(h={}));class u 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 T extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class L extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class j extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class U extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class X 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 q extends Error{constructor(e,t){super(t),this.status=e,Object.setPrototypeOf(this,new.target.prototype)}}const vt=function(n,e,t,s,r){const o=f.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 l=t.headersProvider();for(var c in l)o.setRequestHeader(c,l[c])}return o.onreadystatechange=function(){if(o.readyState===4)if(o.status===200){let l,p=!1;try{l=JSON.parse(o.responseText),p=!0}catch{r(new q(200,`JSON returned from ${s.toString()}
1 endpoint was invalid, yet status code was 200. Data was: ${o.responseText}`),null)}p&&r(null,l)}else{let l="";switch(s){case h.UserAuthentication:l=b.buildLogSuffix("authenticationEndpoint");break;case h.ChannelAuthorization:l=`Clients must be authorized to join private or presence channels. ${b.buildLogSuffix("authorizationEndpoint")}`;break}r(new q(o.status,`Unable to retrieve auth string from ${s.toString()} endpoint - received status: ${o.status} from ${t.endpoint}. ${l}`),null)}},o.send(e),o};function bt(n){return wt(St(n))}var te=String.fromCharCode,re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",mt=function(n){var e=n.charCodeAt(0);return e<128?n:e<2048?te(192|e>>>6)+te(128|e&63):te(224|e>>>12&15)+te(128|e>>>6&63)+te(128|e&63)},St=function(n){return n.replace(/[^\x00-\x7F]/g,mt)},yt=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=[re.charAt(t>>>18),re.charAt(t>>>12&63),e>=2?"=":re.charAt(t>>>6&63),e>=1?"=":re.charAt(t&63)];return s.join("")},wt=window.btoa||function(n){return n.replace(/[\s\S]{1,3}/g,yt)};class _t{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 Le=_t;function Ct(n){window.clearTimeout(n)}function kt(n){window.clearInterval(n)}class G extends Le{constructor(e,t){super(setTimeout,Ct,e,function(s){return t(),null})}}class Tt extends Le{constructor(e,t){super(setInterval,kt,e,function(s){return t(),s})}}var xt={now(){return Date.now?Date.now():new Date().valueOf()},defer(n){return new G(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 R=xt;function D(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]=D(n[r]||{},s[r]):n[r]=s[r]}return n}function Pt(){for(var n=["Pusher"],e=0;e<arguments.length;e++)typeof arguments[e]=="string"?n.push(arguments[e]):n.push(oe(arguments[e]));return n.join(" : ")}function Re(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 B(n,e){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&e(n[t],t,n)}function Oe(n){var e=[];return B(n,function(t,s){e.push(s)}),e}function At(n){var e=[];return B(n,function(t){e.push(t)}),e}function ne(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 Et(n,e){var t={};return B(n,function(s,r){t[r]=e(s)}),t}function De(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 Ne(n,e){var t={};return B(n,function(s,r){(e&&e(s,r,n,t)||s)&&(t[r]=s)}),t}function It(n){var e=[];return B(n,function(t,s){e.push([s,t])}),e}function Ue(n,e){for(var t=0;t<n.length;t++)if(e(n[t],t,n))return!0;return!1}function Lt(n,e){for(var t=0;t<n.length;t++)if(!e(n[t],t,n))return!1;return!0}function Rt(n){return Et(n,function(e){return typeof e=="object"&&(e=oe(e)),encodeURIComponent(bt(e.toString()))})}function Ot(n){var e=Ne(n,function(s){return s!==void 0}),t=je(It(Rt(e)),R.method("join","=")).join("&");return t}function jt(n){var e=[],t=[];return(function s(r,o){var c,l,p;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(p=[],c=0;c<r.length;c+=1)p[c]=s(r[c],o+"["+c+"]");else{p={};for(l in r)Object.prototype.hasOwnProperty.call(r,l)&&(p[l]=s(r[l],o+"["+JSON.stringify(l)+"]"))}return p;case"number":case"string":case"boolean":return r}})(n,"$")}function oe(n){try{return JSON.stringify(n)}catch{return JSON.stringify(jt(n))}}class Dt{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=Pt.apply(this,arguments);ue.log?ue.log(s):ue.logToConsole&&e.bind(this)(s)}}const P=new Dt;var Nt=function(n,e,t,s,r){(t.headers!==void 0||t.headersProvider!=null)&&P.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(),l=c.createElement("script");n.auth_callbacks[o]=function(S){r(null,S)};var p="Pusher.auth_callbacks['"+o+"']";l.src=t.endpoint+"?callback="+encodeURIComponent(p)+"&"+e;var m=c.getElementsByTagName("head")[0]||c.documentElement;m.insertBefore(l,m.firstChild)};const Ut=Nt;class qt{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 Ht{constructor(e,t){this.url=e,this.data=t}send(e){if(!this.request){var t=Ot(this.data),s=this.url+"/"+e.number+"?"+t;this.request=f.createScriptRequest(s),this.request.send(e)}}cleanup(){this.request&&this.request.cleanup()}}var zt=function(n,e){return function(t,s){var r="http"+(e?"s":"")+"://",o=r+(n.host||n.options.host)+n.options.path,c=f.createJSONPRequest(o,t),l=f.ScriptReceivers.create(function(p,m){E.remove(l),c.cleanup(),m&&m.host&&(n.host=m.host),s&&s(p,m)});c.send(l)}},Mt={name:"jsonp",getAgent:zt};const Ft=Mt;function fe(n,e,t){var s=n+(e.useTLS?"s":""),r=e.useTLS?e.hostTLS:e.hostNonTLS;return s+"://"+r+t}function ge(n,e){var t="/app/"+n,s="?protocol="+v.PROTOCOL+"&client=js&ver
1sion="+v.VERSION+(e?"&"+e:"");return t+s}var Bt={getInitial:function(n,e){var t=(e.httpPath||"")+ge(n,"flash=false");return fe("ws",e,t)}},$t={getInitial:function(n,e){var t=(e.httpPath||"/pusher")+ge(n);return fe("http",e,t)}},Wt={getInitial:function(n,e){return fe("http",e,e.httpPath||"/pusher")},getPath:function(n,e){return ge(n)}};class Xt{constructor(){this._callbacks={}}get(e){return this._callbacks[ve(e)]}add(e,t,s){var r=ve(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?[ve(e)]:Oe(this._callbacks);t||s?this.removeCallback(r,t,s):this.removeAllCallbacks(r)}removeCallback(e,t,s){ne(e,function(r){this._callbacks[r]=De(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){ne(e,function(t){delete this._callbacks[t]},this)}}function ve(n){return"_"+n}class ${constructor(e){this.callbacks=new Xt,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=De(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 Jt extends ${constructor(e,t,s,r,o){super(),this.initialize=f.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);try{this.socket=this.hooks.getSocket(e,this.options)}catch(t){return R.defer(()=>{this.onError(t),this.changeState("closed")}),!1}return this.bindListeners(),P.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"?(R.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 D({cid:this.id},e)}}class Z{constructor(e){this.hooks=e}isSupported(e){return this.hooks.isSupported(e)}createConnection(e,t,s,r){return new Jt(this.hooks,e,t,s,r)}}var Vt=new Z({urls:Bt,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!f.getWebSocketAPI()},isSupported:function(){return!!f.getWebSocketAPI()},getSocket:function(n){return f.createWebSocket(n)}}),qe={urls:$t,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},He=D({getSocket:function(n){return f.HTTPFactory.createStreamingSocket(n)}},qe),ze=D({getSocket:function(n){return f.HTTPFactory.createPollingSocket(n)}},qe),Me={isSupported:function(){return f.isXHRSupported()}},Gt=new Z(D({},He,Me)),Qt=new Z(D({},ze,Me)),Kt={ws:Vt,xhr_streaming:Gt,xhr_polling:Qt};const ae=Kt;var Yt=new Z({file:"sockjs",urls:Wt,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:O.getPath("sockjs",{useTLS:e.useTLS}),ignore_null_origin:e.ignoreNullOrigin})},beforeOpen:function(n,e){n.send(JSON.stringify({path:e}))}}),Fe={isSupported:function(n){var e=f.isXDRSupported(n.useTLS);return e}},Zt=new Z(D({},He,Fe)),en=new Z(D({},ze,Fe));ae.xdr_streaming=Zt,ae.xdr_polling=en,ae.sockjs=Yt;const tn=ae;class nn extends ${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 sn=new nn;class rn{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=D({},r,{activityTimeout:this.pingDelay});var o=this.transport.createConnection(e,t,s,r),c=null,l=function(){o.unbind("open",l),o.bind("closed",p),c=R.now()},p=m=>{if(o.unbind("closed",p),m.code===1002||m.code===1003)this.manager.reportDeath();else if(!m.wasClean&&c){var S=R.now()-c;S<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(S/2,this.minPingDelay))}};return o.bind("open",l),o}isSupported(e){return this.manager.isAlive()&&this.transport.isSupported(e)}}const Be={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=Be.decodeMessage(n);if(e.event==="pusher:connection_established"){if(!e.data.activity_timeout)throw"No activity timeout specified in handshake";
1return{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}},Q=Be;class on extends ${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),P.debug("Event sent",r),this.send(Q.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=Q.decodeMessage(s)}catch(o){this.emit("error",{type:"MessageParseError",error:o,data:s.data})}if(r!==void 0){switch(P.debug("Event recd",r),r.event){case"pusher:error":this.emit
1("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=()=>{B(e,(s,r)=>{this.transport.unbind(r,s)})};B(e,(s,r)=>{this.transport.bind(r,s)})}handleCloseEvent(e){var t=Q.getCloseAction(e),s=Q.getCloseError(e);s&&this.emit("error",s),t&&this.emit(t,{action:t,error:s})}}class an{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=Q.processHandshake(e)}catch(s){this.finish("error",{error:s}),this.transport.close();return}t.action==="connected"?this.finish("connected",{connection:new on(t.id,this.transport),activityTimeout:t.activityTimeout}):(this.finish(t.action,{error:t.error}),this.transport.close())},this.onClosed=e=>{this.unbindListeners();var t=Q.getCloseAction(e)||"backoff",s=Q.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(D({transport:this.transport,action:e},t))}}class cn{constructor(e,t){this.timeline=e,this.options=t||{}}send(e,t){this.timeline.isEmpty()||this.timeline.send(f.TimelineTransport.getAgent(this,e),t)}}class be extends ${constructor(e,t){super(function(s,r){P.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 u("Event '"+e+"' does not start with 'client-'");if(!this.subscribed){var s=b.buildLogSuffix("triggeringClientEvents");P.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,P.error(e.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:e.message},e instanceof q?{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 me extends be{authorize(e,t){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:e},t)}}class hn{constructor(){this.reset()}get(e){return Object.prototype.hasOwnProperty.call(this.members,e)?{id:e,info:this.members[e]}:null}each(e){B(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 un=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 l(S){try{m(s.next(S))}catch(A){c(A)}}function p(S){try{m(s.throw(S))}catch(A){c(A)}}function m(S){S.done?o(S.value):r(S.value).then(l,p)}m((s=s.apply(n,e||[])).next())})};class ln extends me{constructor(e,t){super(e,t),this.members=new hn}authorize(e,t){super.authorize(e,(s,r)=>un(this,void 0,void 0,function*(){if(!s)if(r=r,r.channel_data!=null){var o=JSON.parse(r.channel_data);
1this.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=b.buildLogSuffix("authorizationEndpoint");P.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 dn=w(978),Se=w(594);class pn extends me{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,Se.decode)(o),delete r.shared_secret,t(null,r)})}trigger(e,t){throw new U("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){P.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!t.ciphertext||!t.nonce){P.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+t);return}let s=(0,Se.decode)(t.ciphertext);if(s.length<this.nacl.secretbox.overheadLength){P.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${s.length}`);return}let r=(0,Se.decode)(t.nonce);if(r.length<this.nacl.secretbox.nonceLength){P.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){P.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,l)=>{if(c){P.error(`Failed to make a request to the authEndpoint: ${l}. Unable to fetch new key, so dropping encrypted event`);return}if(o=this.nacl.secretbox.open(s,r,this.key),o===null){P.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,dn.D4)(e);try{return JSON.parse(t)}catch{return t}}}class fn extends ${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=f.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
1("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 G(e||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new G(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new G(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 G(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(e){return D({},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 D({},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),P.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 gn{constructor(){this.channels={}}add(e,t){return this.channels[e]||(this.channels[e]=vn(e,t)),this.channels[e]}all(){return At(this.channels)}find(e){return this.channels[e]}remove(e){var t=this.channels[e];return delete this.channels[e],t}disconnect(){B(this.channels,function(e){e.disconnect()})}}function vn(n,e){if(n.indexOf("private-encrypted-")===0){if(e.config.nacl)return W.createEncryptedChannel(n,e,e.config.nacl);let t="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",s=b.buildLogSuffix("encryptedChannelSupport");throw new U(`${t}. ${s}`)}else{if(n.indexOf("private-")===0)return W.createPrivateChannel(n,e);if(n.indexOf("presence-")===0)return W.createPresenceChannel(n,e);if(n.indexOf("#")===0)throw new g('Cannot create a channel with name "'+n+'".');return W.createChannel(n,e)}}var bn={createChannels(){return new gn},createConnectionManager(n,e){return new fn(n,e)},createChannel(n,e){return new be(n,e)},createPrivateChannel(n,e){return new me(n,e)},createPresenceChannel(n,e){return new ln(n,e)}
1,createEncryptedChannel(n,e,t){return new pn(n,e,t)},createTimelineSender(n,e){return new cn(n,e)},createHandshake(n,e){return new an(n,e)},createAssistantToTheTransportManager(n,e,t){return new rn(n,e,t)}};const W=bn;class $e{constructor(e){this.options=e||{},this.livesLeft=this.options.lives||1/0}getAssistant(e){return W.createAssistantToTheTransportManager(this,e,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class K{constructor(e,t){this.strategies=e,this.loop=!!t.loop,this.failFast=!!t.failFast,this.timeout=t.timeout,this.timeoutLimit=t.timeoutLimit}isSupported(){return Ue(this.strategies,R.method("isSupported"))}connect(e,t){var s=this.strategies,r=0,o=this.timeout,c=null,l=(p,m)=>{m?t(null,m):(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},l)):t(!0))};return c=this.tryStrategy(s[r],e,{timeout:o,failFast:this.failFast},l),{abort:function(){c.abort()},forceMinPriority:function(p){e=p,c&&c.forceMinPriority(p)}}}tryStrategy(e,t,s,r){var o=null,c=null;return s.timeout>0&&(o=new G(s.timeout,function(){c.abort(),r(!0)})),c=e.connect(t,function(l,p){l&&o&&o.isRunning()&&!s.failFast||(o&&o.ensureAborted(),r(l,p))}),{abort:function(){o&&o.ensureAborted(),c.abort()},forceMinPriority:function(l){c.forceMinPriority(l)}}}}class ye{constructor(e){this.strategies=e}isSupported(){return Ue(this.strategies,R.method("isSupported"))}connect(e,t){return mn(this.strategies,e,function(s,r){return function(o,c){if(r[s].error=o,o){Sn(r)&&t(!0);return}ne(r,function(l){l.forceMinPriority(c.transport.priority)}),t(null,c)}})}}function mn(n,e,t){var s=je(n,function(r,o,c,l){return r.connect(e,t(o,l))});return{abort:function(){ne(s,yn)},forceMinPriority:function(r){ne(s,function(o){o.forceMinPriority(r)})}}}function Sn(n){return Lt(n,function(e){return!!e.error})}function yn(n){!n.error&&!n.aborted&&(n.abort(),n.aborted=!0)}class wn{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=_n(s),o=r&&r.cacheSkipCount?r.cacheSkipCount:0,c=[this.strategy];if(r&&r.timestamp+this.ttl>=R.now()){var l=this.transports[r.transport];l&&(["ws","wss"].includes(r.transport)||o>3?(this.timeline.info({cached:!0,transport:r.transport,latency:r.latency}),c.push(new K([l],{timeout:r.latency*2+1e3,failFast:!0}))):o++)}var p=R.now(),m=c.pop().connect(e,function S(A,le){A?(We(s),c.length>0?(p=R.now(),m=c.pop().connect(e,S)):t(A)):(Cn(s,le.transport.name,R.now()-p,o),t(null,le))});return{abort:function(){m.abort()},forceMinPriority:function(S){e=S,m&&m.forceMinPriority(S)}}}}function we(n){return"pusherTransport"+(n?"TLS":"NonTLS")}function _n(n){var e=f.getLocalStorage();if(e)try{var t=e[we(n)];if(t)return JSON.parse(t)}catch{We(n)}return null}function Cn(n,e,t,s){var r=f.getLocalStorage();if(r)try{r[we(n)]=oe({timestamp:R.now(),transport:e,latency:t,cacheSkipCount:s})}catch{}}function We(n){var e=f.getLocalStorage();if(e)try{delete e[we(n)]}catch{}}class ce{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 G(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 se{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 kn{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 ie(n){return function(){return n.isSupported()}}var Tn=function(n,e,t){var s={};function r(it,_s,Cs,ks,Ts){var rt=t(n,it,_s,Cs,ks,Ts);return s[it]=rt,rt}var o=Object.assign({},e,{hostNonTLS:n.wsHost+":"+n.wsPort,hostTLS:n.wsHost+":"+n.wssPort,httpPath:n.wsPath}),c=Object.assign({},o,{useTLS:!0}),l=Object.assign({},e,{hostNonTLS:n.httpHost+":"+n.httpPort,hostTLS:n.httpHost+":"+n.httpsPort,httpPath:n.httpPath}),p={loop:!0,timeout:15e3,timeoutLimit:6e4},m=new $e({minPingDelay:1e4,maxPingDelay:n.activityTimeout}),S=new $e({lives:2,minPingDelay:1e4,maxPingDelay:n.activityTimeout}),A=r("ws","ws",3,o,m),le=r("wss","ws",3,c,m),bs=r("sockjs","sockjs",1,l),Ye=r("xhr_streaming","xhr_streaming",1,l,S),ms=r("xdr_streaming","xdr_streaming",1,l,S),Ze=r("xhr_polling","xhr_polling",1,l),Ss=r("xdr_polling","xdr_polling",1,l),et=new K([A],p),ys=new K([le],p),ws=new K([bs],p),tt=new K([new se(ie(Ye),Ye,ms)],p),nt=new K([new se(ie(Ze),Ze,Ss)],p),st=new K([new se(ie(tt),new ye([tt,new ce(nt,{delay:4e3})]),nt)],p),ke=new se(ie(st),st,ws),Te;return e.useTLS?Te=new ye([et,new ce(ke,{delay:2e3})]):Te=new ye([et,new ce(ys,{delay:2e3}),new ce(ke,{delay:5e3})]),new wn(new kn(new se(ie(A),Te,ke)),s,{ttl:18e5,timeline:e.timeline,useTLS:e.useTLS})};const xn=Tn;function Pn(){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"),O.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 An={getRequest:function(n){var e=new window.XDomainRequest;return e.ontimeout=function(){n.emit("error",new T),n.close()},e.onerror=function(t){n.emit("error",t),n.close()}
1,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 En=An,In=256*1024;class Ln extends ${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()},f.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&&(f.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(`
2`);return s!==-1?(this.position+=s+1,t.slice(0,s)):null}isBufferTooLong(e){return this.position===e.length&&e.length>In}}var _e;(function(n){n[n.CONNECTING=0]="CONNECTING",n[n.OPEN=1]="OPEN",n[n.CLOSED=3]="CLOSED"})(_e||(_e={}));const Y=_e;var Rn=1;class On{constructor(e,t){this.hooks=e,this.session=Je(1e3)+"/"+Un(8),this.location=jn(t),this.readyState=Y.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===Y.OPEN)try{return f.createSocketRequest("POST",Xe(Dn(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=Y.CLOSED,this.onclose&&this.onclose({code:e,reason:t,wasClean:s})}onChunk(e){if(e.status===200){this.readyState===Y.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===Y.CONNECTING?(e&&e.hostname&&(this.location.base=Nn(this.location.base,e.hostname)),this.readyState=Y.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(e){this.readyState===Y.OPEN&&this.onmessage&&this.onmessage({data:e})}onActivity(){this.onactivity&&this.onactivity()}onError(e){this.onerror&&this.onerror(e)}openStream(){this.stream=f.createSocketRequest("POST",Xe(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){R.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 Dn(n,e){return n.base+"/"+e+"/xhr_send"}function Xe(n){var e=n.indexOf("?")===-1?"?":"&";return n+e+"t="+ +new Date+"&n="+Rn++}function Nn(n,e){var t=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(n);return t[1]+e+t[3]}function Je(n){return f.randomInt(n)}function Un(n){for(var e=[],t=0;t<n;t++)e.push(Je(32).toString(32));return e.join("")}const qn=On;var Hn={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 zn=Hn;var Mn={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 Fn=Mn;var Bn={getRequest:function(n){var e=f.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 $n=Bn;var Wn={createStreamingSocket(n){return this.createSocket(zn,n)},createPollingSocket(n){return this.createSocket(Fn,n)},createSocket(n,e){return new qn(n,e)},createXHR(n,e){return this.createRequest($n,n,e)},createRequest(n,e,t){return new Ln(n,e,t)}};const Ve=Wn;Ve.createXDR=function(n,e){return this.createRequest(En,n,e)};var Xn={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:E,DependenciesReceivers:M,getDefaultStrategy:xn,Trans
2ports:tn,transportConnectionInitializer:Pn,HTTPFactory:Ve,TimelineTransport:Ft,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(n){window.Pusher=n;var e=()=>{this.onDocumentBody(n.ready)};window.JSON?e():O.load("json2",{},e)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:vt,jsonp:Ut}},onDocumentBody(n){document.body?n():setTimeout(()=>{this.onDocumentBody(n)},0)},createJSONPRequest(n,e){return new Ht(n,e)},createScriptRequest(n){return new qt(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 sn},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 f=Xn;var Ce;(function(n){n[n.ERROR=3]="ERROR",n[n.INFO=6]="INFO",n[n.DEBUG=7]="DEBUG"})(Ce||(Ce={}));const he=Ce;class Jn{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(D({},t,{timestamp:R.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(e){this.log(he.ERROR,e)}info(e){this.log(he.INFO,e)}debug(e){this.log(he.DEBUG,e)}isEmpty(){return this.events.length===0}send(e,t){var s=D({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 Vn{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 Ge(new L,t)}else return Ge(new z,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()},l=function(){o=W.createHandshake(r,function(A){s=!0,S(),t(null,A)})},p=function(A){S(),t(A)},m=function(){S();var A;A=oe(r),t(new j(A))},S=function(){r.unbind("initialized",c),r.unbind("open",l),r.unbind("error",p),r.unbind("closed",m)};return r.bind("initialized",c),r.bind("open",l),r.bind("error",p),r.bind("closed",m),r.initialize(),{abort:()=>{s||(S(),o?o.close():r.close())},forceMinPriority:A=>{s||this.priority<A&&(o?o.close():r.close())}}}}function Ge(n,e){return R.defer(function(){e(n)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:Gn}=f;var Qn=function(n,e,t,s,r,o){var c=Gn[t];if(!c)throw new X(t);var l=(!n.enabledTransports||Re(n.enabledTransports,e)!==-1)&&(!n.disabledTransports||Re(n.disabledTransports,e)===-1),p;return l?(r=Object.assign({ignoreNullOrigin:n.ignoreNullOrigin},r),p=new Vn(e,s,o?o.getAssistant(c):c,r)):p=Kn,p},Kn={isSupported:function(){return!1},connect:function(n,e){var t=R.defer(function(){e(new z)});return{abort:function(){t.ensureAborted()},forceMinPriority:function(){}}}};function Yn(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&&P.warn("The disableStats option is deprecated 
2in favor of enableStats")}const Zn=(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},es=n=>{if(typeof f.getAuthorizers()[n.transport]>"u")throw`'${n.transport}' is not a recognized auth transport`;return(e,t)=>{const s=Zn(e,n);f.getAuthorizers()[n.transport](f,s,n,h.UserAuthentication,t)}},ts=(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},ns=n=>{if(typeof f.getAuthorizers()[n.transport]>"u")throw`'${n.transport}' is not a recognized auth transport`;return(e,t)=>{const s=ts(e,n);f.getAuthorizers()[n.transport](f,s,n,h.ChannelAuthorization,t)}},ss=(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 Qe(n,e){let t={activityTimeout:n.activityTimeout||v.activityTimeout,cluster:n.cluster,httpPath:n.httpPath||v.httpPath,httpPort:n.httpPort||v.httpPort,httpsPort:n.httpsPort||v.httpsPort,pongTimeout:n.pongTimeout||v.pongTimeout,statsHost:n.statsHost||v.stats_host,unavailableTimeout:n.unavailableTimeout||v.unavailableTimeout,wsPath:n.wsPath||v.wsPath,wsPort:n.wsPort||v.wsPort,wssPort:n.wssPort||v.wssPort,enableStats:cs(n),httpHost:is(n),useTLS:as(n),wsHost:rs(n),userAuthenticator:hs(n),channelAuthorizer:ls(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 is(n){return n.httpHost?n.httpHost:n.cluster?`sockjs-${n.cluster}.pusher.com`:v.httpHost}function rs(n){return n.wsHost?n.wsHost:os(n.cluster)}function os(n){return`ws-${n}.pusher.com`}function as(n){return f.getProtocol()==="https:"?!0:n.forceTLS!==!1}function cs(n){return"enableStats"in n?n.enableStats:"disableStats"in n?!n.disableStats:!1}const Ke=n=>"customHandler"in n&&n.customHandler!=null;function hs(n){const e=Object.assign(Object.assign({},v.userAuthentication),n.userAuthentication);return Ke(e)?e.customHandler:es(e)}function us(n,e){let t;if("channelAuthorization"in n)t=Object.assign(Object.assign({},v.channelAuthorization),n.channelAuthorization);else if(t={transport:n.authTransport||v.authTransport,endpoint:n.authEndpoint||v.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:ss(e,t,n.authorizer)};return t}function ls(n,e){const t=us(n,e);return Ke(t)?t.customHandler:ns(t)}class ds extends ${constructor(e){super(function(t,s){P.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 ps(){let n,e;return{promise:new Promise((s,r)=>{n=s,e=r}),resolve:n,reject:e}}const fs=ps;class gs extends ${constructor(e){super(function(t,s){P.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){P.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 ds(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{P.error(`Failed parsing user data after signin: ${e.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){P.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 be(`#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
2(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}=fs();e.done=!1;const s=()=>{e.done=!0};e.then(s).catch(s),this.signinDonePromise=e,this._signinDoneResolve=t}}class I{static ready(){I.isReady=!0;for(var e=0,t=I.instances.length;e<t;e++)I.instances[e].connect()}static getClientFeatures(){return Oe(Ne({ws:f.Transports.ws},function(e){return e.isSupported({})}))}constructor(e,t){vs(e),Yn(t),this.key=e,this.options=t,this.config=Qe(this.options,this),this.channels=W.createChannels(),this.global_emitter=new $,this.sessionID=f.randomInt(1e9),this.timeline=new Jn(this.key,this.sessionID,{cluster:this.config.cluster,features:I.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:he.INFO,version:v.VERSION}),this.config.enableStats&&(this.timelineSender=W.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+f.TimelineTransport.name}));var s=r=>f.getDefaultStrategy(this.config,r,Qn);this.connection=W.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 l=this.channel(r.channel);l&&l.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=>{P.warn(r)}),I.instances.push(this),this.timeline.info({instances:I.instances.length}),this.user=new gs(this),I.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=Qe(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 Tt(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()}}I.instances=[],I.isReady=!1,I.logToConsole=!1,I.Runtime=f,I.ScriptReceivers=f.ScriptReceivers,I.DependenciesReceivers=f.DependenciesReceivers,I.auth_callbacks=f.auth_callbacks;const ue=I;function vs(n){if(n==null)throw"You must pass your app key when you instantiate Pusher."}f.setup(I)}},d={};function y(N){var C=d[N];if(C!==void 0)return C.exports;var w=d[N]={exports:{}};return a[N].call(w.exports,w,w.exports,y),w.exports}y.d=(N,C)=>{for(var w in C)y.o(C,w)&&!y.o(N,w)&&Object.defineProperty(N,w,{enumerable:!0,get:C[w]})},y.o=(N,C)=>Object.prototype.hasOwnProperty.call(N,C);var J=y(721);return J})())})(xe)),xe.exports}var Is=Es();const Ls=xs(Is);class Ae{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 ht{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 Rs(x){try{return Reflect.construct(String,[],x),!0}catch{return!1}}class Ee extends Ae{constructor(i,a,d){super(),this.name=a,this.pusher=i,this.options=d,this.eventFormatter=new ht(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,d)=>
2{if(a.startsWith("pusher:"))return;let y=String(this.options.namespace??"").replace(/\./g,"\\"),J=a.startsWith(y)?a.substring(y.length+1):"."+a;i(J,d)}),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 ut extends Ee{whisper(i,a){return this.pusher.channels.channels[this.name].trigger(`client-${i}`,a),this}}class Os extends Ee{whisper(i,a){return this.pusher.channels.channels[this.name].trigger(`client-${i}`,a),this}}class js extends ut{here(i){return this.on("pusher:subscription_succeeded",a=>{i(Object.keys(a.members).map(d=>a.members[d]))}),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 lt extends Ae{constructor(i,a,d){super(),this.events={},this.listeners={},this.name=a,this.socket=i,this.options=d,this.eventFormatter=new ht(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]=(d,y)=>
2{this.name===d&&this.listeners[i]&&this.listeners[i].forEach(J=>J(y))},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(d=>d!==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 dt extends lt{whisper(i,a){return this.socket.emit("client event",{channel:this.name,event:`client-${i}`,data:a}),this}}class Ds extends dt{here(i){return this.on("presence:subscribed",a=>{i(a.map(d=>d.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 pe extends Ae{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 pt extends pe{whisper(i,a){return this}}class Ns extends pe{whisper(i,a){return this}}class Us extends pt{here(i){return this}joining(i){return this}whisper(i,a){return this}leaving(i){return this}}const ft=class gt{constructor(i){this.setOptions(i),this.connect()}setOptions(i){this.options={...gt._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}};ft._defaultOptions={auth:{headers:{}},authEndpoint:"/broadcasting/auth",userAuthentication:{endpoint:"/broadcasting/user-auth",headers:{}},csrfToken:null,bearerToken:null,host:null,key:null,namespace:"App.Events"};let Ie=ft;class de extends Ie{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,d){return this.channel(i).listen(a,d)}channel(i){return this.channels[i]||(this.channels[i]=new Ee(this.pusher,i,this.options)),this.channels[i]}privateChannel(i){return this.channels["private-"+i]||(this.channels["private-"+i]=new ut(this.pusher,"private-"+i,this.options)),this.channels["private-"+i]}encryptedPrivateChannel(i){return this.channels["private-encrypted-"+i]||(this.channels["private-encrypted-"+i]=new Os(this.pusher,"private-encrypted-"+i,this.options)),this.channels["private-encrypted-"+i]}presenceChannel(i){return this.channels["presence-"+i]||(this.channels["presence-"+i]=new js(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())},d=["state_change","connected","disconnected"];return d.forEach(y=>{this.pusher.connection.bind(y,a)}),()=>{d.forEach(y=>{this.pusher.connection.unbind(y,a)})}}disconnect(){this.pusher.disconnect()}}class qs extends Ie{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",()=>
2{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,d){return this.channel(i).listen(a,d)}channel(i){return this.channels[i]||(this.channels[i]=new lt(this.socket,i,this.options)),this.channels[i]}privateChannel(i){return this.channels["private-"+i]||(this.channels["private-"+i]=new dt(this.socket,"private-"+i,this.options)),this.channels["private-"+i]}presenceChannel(i){return this.channels["presence-"+i]||(this.channels["presence-"+i]=new Ds(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())},d=["connect","disconnect","connect_error","reconnect_attempt","reconnect","reconnect_error","reconnect_failed"];return d.forEach(y=>{this.socket.on(y,a)}),()=>{d.forEach(y=>{this.socket.off(y,a)})}}disconnect(){this.socket.disconnect()}}class ct extends Ie{constructor(){super(...arguments),this.channels={}}connect(){}listen(i,a,d){return new pe}channel(i){return new pe}privateChannel(i){return new pt}encryptedPrivateChannel(i){return new Ns}presenceChannel(i){return new Us}leave(i){}leaveChannel(i){}socketId(){return"fake-socket-id"}connectionStatus(){return"connected"}onConnectionChange(i){return()=>{}}disconnect(){}}class Hs{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 de({...this.options,cluster:""});else if(this.options.broadcaster==="pusher")this.connector=new de(this.options);else if(this.options.broadcaster==="ably")this.connector=new de({...this.options,cluster:"",broadcaster:"pusher"});else if(this.options.broadcaster==="socket.io")this.connector=new qs(this.options);else if(this.options.broadcaster==="null")this.connector=new ct(this.options);else if(typeof this.options.broadcaster=="function"&&Rs(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,d){return this.connector.listen(i,a,d)}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 de||i instanceof ct}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,d)=>{this.socketId()&&d.setRequestHeader("X-Socket-Id",this.socketId())})}registerTurboRequestInterceptor(){document.addEventListener("turbo:before-fetch-request",i=>{i.detail.fetchOptions.headers["X-Socket-Id"]=this.socketId()})}}class zs{referencesStore;pagesStore;echo;echoConnectionPromise;websiteChannel;customerChannel;designsetChannel;currentSectionSetIds=[];connected=!1;isFirstChannelJoin=!0;syncTimestampsBySectionSet={};isSectionsSyncFrozen=!1;currentEditorIds={};latestMutationIds={};onRootDataChanged;constructor(i){const a={wsHost:ot().public.SOKETI_HOST,cluster:"",forceTLS:!1,enabledTransports:["ws","wss"],channelAuthorization:{transport:"ajax",endpoint:`${ot().public.RENDERER_API_BASE_URL}/api/broadcasting/auth`}};this.echo=new Hs({broadcaster:"pusher",client:new Ls("wsk",a),namespace:"App\\Domains\\Wsk\\Events"}),this.echoConnectionPromise=new Promise(d=>{this.echo.connector.pusher.connection.bind("connected",d)}),this.referencesStore=Ps(i),this.pagesStore=As(i)}connect(i,a,d){if(this.connected)throw new Error("Tried to connect again to live sync. The connection is already established");return this.echoConnectionPromise.then(()=>new Promise(y=>{this.joinDesignsetChannel(d),this.customerChannel=this.echo.join(`App.Domains.Wsk.Preview.Customer.${a}`),this.customerChannel.listen(".App\\Domains\\Wsk\\Events\\CmsDataChanged",()=>{this.onRootDataChanged&&this.onRootDataChanged()}),this.websiteChannel=this.echo.join(`App.Domains.Wsk.Preview.Website.${i}`),this.websiteChannel.listen(".App\\Domains\\Wsk\\Events\\WebsiteDataChanged",()=>{this.onRootDataChanged&&this.onRootDataChanged()}),this.websiteChannel.here(()=>{this.connected=!0,this.isFirstChannelJoin?(this.isFirstChannelJoin=!1,y()):this.currentSectionSetIds.forEach(J=>this.requestSectionSetState(J))})}))}joinDesignsetChannel(i){this.designsetChannel=this.echo.join(`App.Domains.Wsk.Preview.Designset.${i}`),this.designsetChannel.listenForWhisper("referencesUpdated",a=>{this.referencesStore.addReferences(a)}),this.designsetChannel.here(()=>{this.designsetChannel.whisper("requestState")})}leaveDesignsetChannel(i){this.echo.leave(`App.Domains.Wsk.Preview.Designset.${i}`),this.designsetChannel=void 0}followSectionSets(i,a){i.filter(y=>
2!this.currentSectionSetIds.includes(y)).forEach(y=>{this.subscribeSectionSetChanges(y,a),this.requestSectionSetState(y)})}requestSectionSetState(i){if(this.isSectionsSyncFrozen)return;this.websiteChannel.whisper("requestSectionSetSections",{sectionSetId:i}),Array.isArray(this.syncTimestampsBySectionSet[i])||(this.syncTimestampsBySectionSet[i]=[]),this.syncTimestampsBySectionSet[i].push(Date.now()),this.syncTimestampsBySectionSet[i].filter(d=>d>=Date.now()-5e3).length>=5&&(this.isSectionsSyncFrozen=!0,alert("Leider gibt es aktuell technische Probleme mit dem Live-Sync. Bitte laden Sie die Seite neu oder wenden sich an den Support."))}subscribeSectionSetChanges(i,a){this.websiteChannel.listenForWhisper(`sectionSetState.${i}`,d=>{this.currentEditorIds[d.sectionSetId]=d.editorId,this.latestMutationIds[d.editorId]=d.latestMutationId,this.setSectionSetSections(d),a&&a(d)}),this.websiteChannel.listenForWhisper(`sectionDataMutation.${i}`,d=>this.handleAttributeChange(d)),this.currentSectionSetIds.push(i)}handleAttributeChange(i){if(this.currentSectionSetIds.includes(i.sectionSetId)&&this.currentEditorIds[i.sectionSetId]===i.editorId)try{if(this.latestMutationIds[i.editorId]!==i.mutationId-1)throw new Error("Es gibt keine vorhergehende MutationId oder die vorhergehende MutationId entspricht nicht dem erwarteten Wert");this.latestMutationIds[i.editorId]=i.mutationId,this.runMutation(i)}catch(a){console.error(a),this.requestSectionSetState(i.sectionSetId)}}runMutation(i){switch(i.mutationName){case"updateSectionAttribute":this.updateSectionAttribute(i);break;case"pushIntoSectionAttribute":this.pushIntoSectionAttribute(i);break;case"deleteSectionAttribute":this.deleteSectionAttribute(i);break}}setSectionSetSections(i){this.pagesStore.setSectionSetSections(i.sectionSetId,i.sections)}updateSectionAttribute(i){this.currentSectionSetIds.includes(i.sectionSetId)&&this.pagesStore.updateSectionAttribute(i.sectionSetId,i.path,i.value)}pushIntoSectionAttribute(i){this.currentSectionSetIds.includes(i.sectionSetId)&&this.pagesStore.pushIntoSectionAttribute(i.sectionSetId,i.path,i.value)}deleteSectionAttribute(i){this.currentSectionSetIds.includes(i.sectionSetId)&&this.pagesStore.deleteSectionAttribute(i.sectionSetId,i.path)}}let Pe;const Xs=x=>(Pe||(Pe=new zs(x)),Pe);export{zs as LiveSync,Xs as getLiveSyncSingleton};

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.