1import{a as es}from"./index-B8_nURbH.js";import{g as ts}from"./react-vendor-Dqf5Je5X.js";import{g as Ne,s as ns}from"./cookie-ClyuUHhq.js";import"./banner-carousel-DJJM4Lde.js";import"./companion-profile-BmMkoiYW.js";import{s as ue,i as rs,H as ce,c as ss,d as is}from"./videoHelpers-DmLHKwjl.js";class Fe{constructor(){this.notificationCreatedEvent=".Illuminate\\Notifications\\Events\\BroadcastNotificationCreated"}listenForWhisper(t,s){return this.listen(".client-"+t,s)}notification(t){return this.listen(this.notificationCreatedEvent,t)}stopListeningForNotification(t){return this.stopListening(this.notificationCreatedEvent,t)}stopListeningForWhisper(t,s){return this.stopListening(".client-"+t,s)}}class Pt{constructor(t){this.namespace=t}format(t){return[".","\\"].includes(t.charAt(0))?t.substring(1):(this.namespace&&(t=this.namespace+"."+t),t.replace(/\./g,"\\"))}setNamespace(t){this.namespace=t}}function os(i){try{return Reflect.construct(String,[],i),!0}catch{return!1}}class ze extends Fe{constructor(t,s,c){super(),this.name=s,this.pusher=t,this.options=c,this.eventFormatter=new Pt(this.options.namespace),this.subscribe()}subscribe(){this.subscription=this.pusher.subscribe(this.name)}unsubscribe(){this.pusher.unsubscribe(this.name)}listen(t,s){return this.on(this.eventFormatter.format(t),s),this}listenToAll(t){return this.subscription.bind_global((s,c)=>{if(s.startsWith("pusher:"))return;let l=String(this.options.namespace??"").replace(/\./g,"\\"),f=s.startsWith(l)?s.substring(l.length+1):"."+s;t(f,c)}),this}stopListening(t,s){return s?this.subscription.unbind(this.eventFormatter.format(t),s):this.subscription.unbind(this.eventFormatter.format(t)),this}stopListeningToAll(t){return t?this.subscription.unbind_global(t):this.subscription.unbind_global(),this}subscribed(t){return this.on("pusher:subscription_succeeded",()=>{t()}),this}error(t){return this.on("pusher:subscription_error",s=>{t(s)}),this}on(t,s){return this.subscription.bind(t,s),this}}class It extends ze{whisper(t,s){return this.pusher.channels.channels[this.name].trigger(`client-${t}`,s),this}}class as extends ze{whisper(t,s){return this.pusher.channels.channels[this.name].trigger(`client-${t}`,s),this}}class cs extends It{here(t){return this.on("pusher:subscription_succeeded",s=>{t(Object.keys(s.members).map(c=>s.members[c]))}),this}joining(t){return this.on("pusher:member_added",s=>{t(s.info)}),this}whisper(t,s){return this.pusher.channels.channels[this.name].trigger(`client-${t}`,s),this}leaving(t){return this.on("pusher:member_removed",s=>{t(s.info)}),this}}class Ot extends Fe{constructor(t,s,c){super(),this.events={},this.listeners={},this.name=s,this.socket=t,this.options=c,this.eventFormatter=new Pt(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(t,s){return this.on(this.eventFormatter.format(t),s),this}stopListening(t,s){return this.unbindEvent(this.eventFormatter.format(t),s),this}subscribed(t){return this.on("connect",s=>{t(s)}),this}error(t){return this}on(t,s){return this.listeners[t]=this.listeners[t]||[],this.events[t]||(this.events[t]=(c,l)=>{this.name===c&&this.listeners[t]&&this.listeners[t].forEach(f=>f(l))},this.socket.on(t,this.events[t])),this.listeners[t].push(s),this}unbind(){Object.keys(this.events).forEach(t=>{this.unbindEvent(t)})}unbindEvent(t,s){this.listeners[t]=this.listeners[t]||[],s&&(this.listeners[t]=this.listeners[t].filter(c=>c!==s)),(!s||this.listeners[t].length===0)&&(this.events[t]&&(this.socket.removeListener(t,this.events[t]),delete this.events[t]),delete this.listeners[t])}}class Rt extends Ot{whisper(t,s){return this.socket.emit("client event",{channel:this.name,event:`client-${t}`,data:s}),this}}class ls extends Rt{here(t){return this.on("presence:subscribed",s=>{t(s.map(c=>c.user_info))}),this}joining(t){return this.on("presence:joining",s=>t(s.user_info)),this}whisper(t,s){return this.socket.emit("client event",{channel:this.name,event:`client-${t}`,data:s}),this}leaving(t){return this.on("presence:leaving",s=>t(s.user_info)),this}}class ke extends Fe{subscribe(){}unsubscribe(){}listen(t,s){return this}listenToAll(t){return this}stopListening(t,s){return this}subscribed(t){return this}error(t){return this}on(t,s){return this}}class Mt extends ke{whisper(t,s){return this}}class us extends ke{whisper(t,s){return this}}class hs extends Mt{here(t){return this}joining(t){return this}whisper(t,s){return this}leaving(t){return this}}const qt=class Dt{constructor(t){this.setOptions(t),this.connect()}setOptions(t){this.options={...Dt._defaultOptions,...t,broadcaster:t.broadcaster};let s=this.csrfToken();s&&(this.options.auth.headers["X-CSRF-TOKEN"]=s,this.options.userAuthentication.headers["X-CSRF-TOKEN"]=s),s=this.options.bearerToken,s&&(this.options.auth.headers.Authorization="Bearer "+s,this.options.userAuthentication.headers.Authorization="Bearer "+s)}csrfToken(){var t,s;return typeof window<"u"&&(t=window.Laravel)!=null&&t.csrfToken?window.Laravel.csrfToken:this.options.csrfToken?this.options.csrfToken:typeof document<"u"&&typeof document.querySelector=="function"?((s=document.querySelector('meta[name="csrf-token"]'))==null?void 0:s.getAttribute("content"))??null:null}};qt._defaultOptions={auth:{headers:{}},authEndpoint:"/broadcasting/auth",userAuthentication:{endpoint:"/broadcasting/user-auth",headers:{}},csrfToken:null,bearerToken:null,host:null,key:null,namespace:"App.Events"};let $e=qt;class ve extends $e{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(t,s,c){return this.channel(t).listen(s,c)}channel(t){return this.channels[t]||(this.channels[t]=new ze(this.pusher,t,this.options)),this.channels[t]}privateChannel(t){return this.channels["private-"+t]||(this.channels["private-"+t]=new It(this.pusher,"private-"+t,this.options)),this.channels["private-"+t]}encryptedPrivateChannel(t){return this.channels["private-encrypted-"+t]||(this.channels["private-encrypted-"+t]=new as(this.pusher,"private-encrypted-"+t,this.options)),this.channels["private-encrypted-"+t]}presenceChannel(t){return this.channels["presence-"+t]||(this.channels["presence-"+t]=new cs(this.pusher,"presence-"+t,this.options)),this.channels["presence-"+t]}leave(t){[t,"private-"+t,"private-encrypted-"+t,"presence-"+t].forEach(s=>{this.leaveChannel(s)})}leaveChannel(t){this.channels[t]&&(this.channels[t].unsubscribe(),delete this.channels[t])}socketId(){return this.pusher.connection.socket_id}connectionStatus(){const t=this.pusher.connection.state;switch(t){case"connected":case"connecting":return t;case"failed":case"unavailable":return"failed";default:return"disconnected"}}onConnectionChange(t){const s=()=>{t(this.connectionStatus())},c=["state_change","connected","disconnected"];
1return c.forEach(l=>{this.pusher.connection.bind(l,s)}),()=>{c.forEach(l=>{this.pusher.connection.unbind(l,s)})}}disconnect(){this.pusher.disconnect()}}class ds extends $e{constructor(){super(...arguments),this.channels={}}connect(){let t=this.getSocketIO();this.socket=t(this.options.host??void 0,this.options),this.socket.io.on("reconnect",()=>{Object.values(this.channels).forEach(s=>{s.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(t,s,c){return this.channel(t).listen(s,c)}channel(t){return this.channels[t]||(this.channels[t]=new Ot(this.socket,t,this.options)),this.channels[t]}privateChannel(t){return this.channels["private-"+t]||(this.channels["private-"+t]=new Rt(this.socket,"private-"+t,this.options)),this.channels["private-"+t]}presenceChannel(t){return this.channels["presence-"+t]||(this.channels["presence-"+t]=new ls(this.socket,"presence-"+t,this.options)),this.channels["presence-"+t]}leave(t){[t,"private-"+t,"presence-"+t].forEach(s=>{this.leaveChannel(s)})}leaveChannel(t){this.channels[t]&&(this.channels[t].unsubscribe(),delete this.channels[t])}socketId(){return this.socket.id}connectionStatus(){return this.socket.connected?"connected":this.socket.io._reconnecting?"reconnecting":this.socket.id!==void 0?"disconnected":"connecting"}onConnectionChange(t){const s=()=>{t(this.connectionStatus())},c=["connect","disconnect","connect_error","reconnect_attempt","reconnect","reconnect_error","reconnect_failed"];return c.forEach(l=>{this.socket.on(l,s)}),()=>{c.forEach(l=>{this.socket.off(l,s)})}}disconnect(){this.socket.disconnect()}}class _t extends $e{constructor(){super(...arguments),this.channels={}}connect(){}listen(t,s,c){return new ke}channel(t){return new ke}privateChannel(t){return new Mt}encryptedPrivateChannel(t){return new us}presenceChannel(t){return new hs}leave(t){}leaveChannel(t){}socketId(){return"fake-socket-id"}connectionStatus(){return"connected"}onConnectionChange(t){return()=>{}}disconnect(){}}class fs{constructor(t){this.options=t,this.connect(),this.options.withoutInterceptors||this.registerInterceptors()}channel(t){return this.connector.channel(t)}connect(){if(this.options.broadcaster==="reverb")this.connector=new ve({...this.options,cluster:""});else if(this.options.broadcaster==="pusher")this.connector=new ve(this.options);else if(this.options.broadcaster==="ably")this.connector=new ve({...this.options,cluster:"",broadcaster:"pusher"});else if(this.options.broadcaster==="socket.io")this.connector=new ds(this.options);else if(this.options.broadcaster==="null")this.connector=new _t(this.options);else if(typeof this.options.broadcaster=="function"&&os(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(t){return this.connector.presenceChannel(t)}leave(t){this.connector.leave(t)}leaveChannel(t){this.connector.leaveChannel(t)}leaveAllChannels(){for(const t in this.connector.channels)this.leaveChannel(t)}listen(t,s,c){return this.connector.listen(t,s,c)}private(t){return this.connector.privateChannel(t)}encryptedPrivate(t){if(this.connectorSupportsEncryptedPrivateChannels(this.connector))return this.connector.encryptedPrivateChannel(t);throw new Error(`Broadcaster ${typeof this.options.broadcaster} ${String(this.options.broadcaster)} does not support encrypted private channels.`)}connectorSupportsEncryptedPrivateChannels(t){return t instanceof ve||t instanceof _t}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((t,s)=>{this.socketId()&&t.headers.set("X-Socket-ID",this.socketId()),s()})}registerAxiosRequestInterceptor(){axios.interceptors.request.use(t=>(this.socketId()&&(t.headers["X-Socket-Id"]=this.socketId()),t))}registerjQueryAjaxSetup(){typeof jQuery.ajax<"u"&&jQuery.ajaxPrefilter((t,s,c)=>{this.socketId()&&c.setRequestHeader("X-Socket-Id",this.socketId())})}registerTurboRequestInterceptor(){document.addEventListener("turbo:before-fetch-request",t
1=>{t.detail.fetchOptions.headers["X-Socket-Id"]=this.socketId()})}}var Me={exports:{}};var Et;function ps(){return Et||(Et=1,(function(i,t){(function(c,l){i.exports=l()})(self,()=>(()=>{var s={594(S,L){var k=this&&this.__extends||(function(){var y=function(d,p){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,I){m.__proto__=I}||function(m,I){for(var q in I)I.hasOwnProperty(q)&&(m[q]=I[q])},y(d,p)};return function(d,p){y(d,p);function m(){this.constructor=d}d.prototype=p===null?Object.create(p):(m.prototype=p.prototype,new m)}})();Object.defineProperty(L,"__esModule",{value:!0});var E=256,A=(function(){function y(d){d===void 0&&(d="="),this._paddingCharacter=d}return y.prototype.encodedLength=function(d){return this._paddingCharacter?(d+2)/3*4|0:(d*8+5)/6|0},y.prototype.encode=function(d){for(var p="",m=0;m<d.length-2;m+=3){var I=d[m]<<16|d[m+1]<<8|d[m+2];p+=this._encodeByte(I>>>18&63),p+=this._encodeByte(I>>>12&63),p+=this._encodeByte(I>>>6&63),p+=this._encodeByte(I>>>0&63)}var q=d.length-m;if(q>0){var I=d[m]<<16|(q===2?d[m+1]<<8:0);p+=this._encodeByte(I>>>18&63),p+=this._encodeByte(I>>>12&63),q===2?p+=this._encodeByte(I>>>6&63):p+=this._paddingCharacter||"",p+=this._paddingCharacter||""}return p},y.prototype.maxDecodedLength=function(d){return this._paddingCharacter?d/4*3|0:(d*6+7)/8|0},y.prototype.decodedLength=function(d){return this.maxDecodedLength(d.length-this._getPaddingLength(d))},y.prototype.decode=function(d){if(d.length===0)return new Uint8Array(0);for(var p=this._getPaddingLength(d),m=d.length-p,I=new Uint8Array(this.maxDecodedLength(m)),q=0,D=0,$=0,X=0,B=0,U=0,W=0;D<m-4;D+=4)X=this._decodeChar(d.charCodeAt(D+0)),B=this._decodeChar(d.charCodeAt(D+1)),U=this._decodeChar(d.charCodeAt(D+2)),W=this._decodeChar(d.charCodeAt(D+3)),I[q++]=X<<2|B>>>4,I[q++]=B<<4|U>>>2,I[q++]=U<<6|W,$|=X&E,$|=B&E,$|=U&E,$|=W&E;if(D<m-1&&(X=this._decodeChar(d.charCodeAt(D)),B=this._decodeChar(d.charCodeAt(D+1)),I[q++]=X<<2|B>>>4,$|=X&E,$|=B&E),D<m-2&&(U=this._decodeChar(d.charCodeAt(D+2)),I[q++]=B<<4|U>>>2,$|=U&E),D<m-3&&(W=this._decodeChar(d.charCodeAt(D+3)),I[q++]=U<<6|W,$|=W&E),$!==0)throw new Error("Base64Coder: incorrect characters for decoding");return I},y.prototype._encodeByte=function(d){var p=d;return p+=65,p+=25-d>>>8&6,p+=51-d>>>8&-75,p+=61-d>>>8&-15,p+=62-d>>>8&3,String.fromCharCode(p)},y.prototype._decodeChar=function(d){var p=E;return p+=(42-d&d-44)>>>8&-E+d-43+62,p+=(46-d&d-48)>>>8&-E+d-47+63,p+=(47-d&d-58)>>>8&-E+d-48+52,p+=(64-d&d-91)>>>8&-E+d-65+0,p+=(96-d&d-123)>>>8&-E+d-97+26,p},y.prototype._getPaddingLength=function(d){var p=0;if(this._paddingCharacter){for(var m=d.length-1;m>=0&&d[m]===this._paddingCharacter;m--)p++;if(d.length<4||p>2)throw new Error("Base64Coder: incorrect padding")}return p},y})();L.Coder=A;var F=new A;function w(y){return F.encode(y)}L.encode=w;function x(y){return F.decode(y)}L.decode=x;var C=(function(y){k(d,y);function d(){return y!==null&&y.apply(this,arguments)||this}return d.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)},d.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},d})(A);L.URLSafeCoder=C;var _=new C;function R(y){return _.encode(y)}L.encodeURLSafe=R;function z(y){return _.decode(y)}L.decodeURLSafe=z,L.encodedLength=function(y){return F.encodedLength(y)},L.maxDecodedLength=function(y){return F.maxDecodedLength(y)},L.decodedLength=function(y){return F.decodedLength(y)}},978(S,L){var k="utf8: invalid source encoding";function E(A){for(var F=[],w=0;w<A.length;w++){var x=A[w];if(x&128){var C=void 0;if(x<224){if(w>=A.length)throw new Error(k);var _=A[++w];if((_&192)!==128)throw new Error(k);x=(x&31)<<6|_&63,C=128}else if(x<240){if(w>=A.length-1)throw new Error(k);var _=A[++w],R=A[++w];if((_&192)!==128||(R&192)!==128)throw new Error(k);x=(x&15)<<12|(_&63)<<6|R&63,C=2048}else if(x<248){if(w>=A.length-2)throw new Error(k);var _=A[++w],R=A[++w],z=A[++w];if((_&192)!==128||(R&192)!==128||(z&192)!==128)throw new Error(k);x=(x&15)<<18|(_&63)<<12|(R&63)<<6|z&63,C=65536}else throw new Error(k);if(x<C||x>=55296&&x<=57343)throw new Error(k);if(x>
1=65536){if(x>1114111)throw new Error(k);x-=65536,F.push(String.fromCharCode(55296|x>>10)),x=56320|x&1023}}F.push(String.fromCharCode(x))}return F.join("")}L.D4=E},721(S,L,k){S.exports=k(207).default},207(S,L,k){k.d(L,{default:()=>be});class E{constructor(e,n){this.lastId=0,this.prefix=e,this.name=n}create(e){this.lastId++;var n=this.lastId,o=this.prefix+n,a=this.name+"["+n+"]",u=!1,h=function(){u||(e.apply(null,arguments),u=!0)};return this[n]=h,{number:n,id:o,name:a,callback:h}}remove(e){delete this[e.number]}}var A=new E("_pusher_script_","Pusher.ScriptReceivers"),F={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 w=F;class x{constructor(e){this.options=e,this.receivers=e.receivers||A,this.loading={}}load(e,n,o){var a=this;if(a.loading[e]&&a.loading[e].length>0)a.loading[e].push(o);else{a.loading[e]=[o];var u=v.createScriptRequest(a.getPath(e,n)),h=a.receivers.create(function(g){if(a.receivers.remove(h),a.loading[e]){var b=a.loading[e];delete a.loading[e];for(var T=function(M){M||u.cleanup()},P=0;P<b.length;P++)b[P](g,T)}});u.send(h)}}getRoot(e){var n,o=v.getDocument().location.protocol;return e&&e.useTLS||o==="https:"?n=this.options.cdn_https:n=this.options.cdn_http,n.replace(/\/*$/,"")+"/"+this.options.version}getPath(e,n){return this.getRoot(n)+"/"+e+this.options.suffix+".js"}}var C=new E("_pusher_dependencies","Pusher.DependenciesReceivers"),_=new x({cdn_http:w.cdn_http,cdn_https:w.cdn_https,version:w.VERSION,suffix:w.dependency_suffix,receivers:C});const R={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"}}},y={buildLogSuffix:function(r){const e="See:",n=R.urls[r];if(!n)return"";let o;return n.fullUrl?o=n.fullUrl:n.path&&(o=R.baseUrl+n.path),o?`${e} ${o}`:""}};var d;(function(r){r.UserAuthentication="user-authentication",r.ChannelAuthorization="channel-authorization"})(d||(d={}));
1class 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 I 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 D extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class $ 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 B extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class U extends Error{constructor(e,n){super(n),this.status=e,Object.setPrototypeOf(this,new.target.prototype)}}const $t=function(r,e,n,o,a){const u=v.createXHR();u.open("POST",n.endpoint,!0),u.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var h in n.headers)u.setRequestHeader(h,n.headers[h]);if(n.headersProvider!=null){let g=n.headersProvider();for(var h in g)u.setRequestHeader(h,g[h])}return u.onreadystatechange=function(){if(u.readyState===4)if(u.status===200){let g,b=!1;try{g=JSON.parse(u.responseText),b=!0}catch{a(new U(200,`JSON returned from ${o.toString()}
1 endpoint was invalid, yet status code was 200. Data was: ${u.responseText}`),null)}b&&a(null,g)}else{let g="";switch(o){case d.UserAuthentication:g=y.buildLogSuffix("authenticationEndpoint");break;case d.ChannelAuthorization:g=`Clients must be authorized to join private or presence channels. ${y.buildLogSuffix("authorizationEndpoint")}`;break}a(new U(u.status,`Unable to retrieve auth string from ${o.toString()} endpoint - received status: ${u.status} from ${n.endpoint}. ${g}`),null)}},u.send(e),u};function Wt(r){return Gt(Vt(r))}var se=String.fromCharCode,de="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xt=function(r){var e=r.charCodeAt(0);return e<128?r:e<2048?se(192|e>>>6)+se(128|e&63):se(224|e>>>12&15)+se(128|e>>>6&63)+se(128|e&63)},Vt=function(r){return r.replace(/[^\x00-\x7F]/g,Xt)},Jt=function(r){var e=[0,2,1][r.length%3],n=r.charCodeAt(0)<<16|(r.length>1?r.charCodeAt(1):0)<<8|(r.length>2?r.charCodeAt(2):0),o=[de.charAt(n>>>18),de.charAt(n>>>12&63),e>=2?"=":de.charAt(n>>>6&63),e>=1?"=":de.charAt(n&63)];return o.join("")},Gt=window.btoa||function(r){return r.replace(/[\s\S]{1,3}/g,Jt)};class Kt{constructor(e,n,o,a){this.clear=n,this.timer=e(()=>{this.timer&&(this.timer=a(this.timer))},o)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}const Ge=Kt;function Yt(r){window.clearTimeout(r)}function Qt(r){window.clearInterval(r)}class Q extends Ge{constructor(e,n){super(setTimeout,Yt,e,function(o){return n(),null})}}class Zt extends Ge{constructor(e,n){super(setInterval,Qt,e,function(o){return n(),o})}}var en={now(){return Date.now?Date.now():new Date().valueOf()},defer(r){return new Q(0,r)},method(r,...e){var n=Array.prototype.slice.call(arguments,1);return function(o){return o[r].apply(o,n.concat(arguments))}}};const j=en;function H(r,...e){for(var n=0;n<e.length;n++){var o=e[n];for(var a in o)o[a]&&o[a].constructor&&o[a].constructor===Object?r[a]=H(r[a]||{},o[a]):r[a]=o[a]}return r}function tn(){for(var r=["Pusher"],e=0;e<arguments.length;e++)typeof arguments[e]=="string"?r.push(arguments[e]):r.push(fe(arguments[e]));return r.join(" : ")}function Ke(r,e){var n=Array.prototype.indexOf;if(r===null)return-1;if(n&&r.indexOf===n)return r.indexOf(e);for(var o=0,a=r.length;o<a;o++)if(r[o]===e)return o;return-1}function V(r,e){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e(r[n],n,r)}function Ye(r){var e=[];return V(r,function(n,o){e.push(o)}),e}function nn(r){var e=[];return V(r,function(n){e.push(n)}),e}function ie(r,e,n){for(var o=0;o<r.length;o++)e.call(n||window,r[o],o,r)}function Qe(r,e){for(var n=[],o=0;o<r.length;o++)n.push(e(r[o],o,r,n));return n}function rn(r,e){var n={};return V(r,function(o,a){n[a]=e(o)}),n}function Ze(r,e){e=e||function(a){return!!a};for(var n=[],o=0;o<r.length;o++)e(r[o],o,r,n)&&n.push(r[o]);return n}function et(r,e){var n={};return V(r,function(o,a){(e&&e(o,a,r,n)||o)&&(n[a]=o)}),n}function sn(r){var e=[];return V(r,function(n,o){e.push([o,n])}),e}function tt(r,e){for(var n=0;n<r.length;n++)if(e(r[n],n,r))return!0;return!1}function on(r,e){for(var n=0;n<r.length;n++)if(!e(r[n],n,r))return!1;return!0}function an(r){return rn(r,function(e){return typeof e=="object"&&(e=fe(e)),encodeURIComponent(Wt(e.toString()))})}function cn(r){var e=et(r,function(o){return o!==void 0}),n=Qe(sn(an(e)),j.method("join","=")).join("&");return n}function ln(r){var e=[],n=[];return(function o(a,u){var h,g,b;switch(typeof a){case"object":if(!a)return null;for(h=0;h<e.length;h+=1)if(e[h]===a)return{$ref:n[h]};if(e.push(a),n.push(u),Object.prototype.toString.apply(a)==="[object Array]")for(b=[],h=0;h<a.length;h+=1)b[h]=o(a[h],u+"["+h+"]");else{b={};for(g in a)Object.prototype.hasOwnProperty.call(a,g)&&(b[g]=o(a[g],u+"["+JSON.stringify(g)+"]"))}return b;case"number":case"string":case"boolean":return a}})(r,"$")}function fe(r){try{return JSON.stringify(r)}catch{return JSON.stringify(ln(r))}}class un{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,...n){var o=tn.apply(this,arguments);be.log?be.log(o):be.logToConsole&&e.bind(this)(o)}}const O=new un;var hn=function(r,e,n,o,a){(n.headers!==void 0||n.headersProvider!=null)&&O.warn(`To send headers with the ${o.toString()} request, you must use AJAX, rather than JSONP.`);var u=r.nextAuthCallbackID.toString();r.nextAuthCallbackID++;var h=r.getDocument(),g=h.createElement("script");r.auth_callbacks[u]=function(P){a(null,P)};var b="Pusher.auth_callbacks['"+u+"']";g.src=n.endpoint+"?callback="+encodeURIComponent(b)+"&"+e;var T=h.getElementsByTagName("head")[0]||h.documentElement;T.insertBefore(g,T.firstChild)};const dn=hn;class fn{constructor(e){this.src=e}send(e){var n=this,o="Error loading "+n.src;n.script=document.createElement("script"),n.script.id=e.id,n.script.src=n.src,n.script.type="text/javascript",n.script.charset="UTF-8",n.script.addEventListener?(n.script.onerror=function(){e.callback(o)},n.script.onload=function(){e.callback(null)}):n.script.onreadystatechange=function(){(n.script.readyState==="loaded"||n.script.readyState==="complete")&&e.callback(null)},n.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(n.errorScript=document.createElement("script"),n.errorScript.id=e.id+"_error",n.errorScript.text=e.name+"('"+o+"');",n.script.async=n.errorScript.async=!1):n.script.async=!0;var a=document.getElementsByTagName("head")[0];a.insertBefore(n.script,a.firstChild),n.errorScript&&a.insertBefore(n.errorScript,n.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 pn{constructor(e,n){this.url=e,this.data=n}send(e){if(!this.request){var n=cn(this.data),o=this.url+"/"+e.number+"?"+n;this.request=v.createScriptRequest(o),this.request.send(e)}}cleanup(){this.request&&this.request.cleanup()}}var gn=function(r,e){return function(n,o){var a="http"+(e?"s":"")+"://",u=a+(r.host||r.options.host)+r.options.path,h=v.createJSONPRequest(u,n),g=v.ScriptReceivers.create(function(b,T){A.remove(g),h.cleanup(),T&&T.host&&(r.host=T.host),o&&o(b,T)});h.send(g)}},mn={name:"jsonp",getAgent:gn};const bn=mn;function Se(r,e,n){var o=r+(e.useTLS?"s":""),a=e.useTLS?e.hostTLS:e.hostNonTLS;return o+"://"+a+n}function Ce(r,e){var n="/app/"+r,o="?protocol="+w.PROTOCOL+"&client=js&ver
1sion="+w.VERSION+(e?"&"+e:"");return n+o}var yn={getInitial:function(r,e){var n=(e.httpPath||"")+Ce(r,"flash=false");return Se("ws",e,n)}},vn={getInitial:function(r,e){var n=(e.httpPath||"/pusher")+Ce(r);return Se("http",e,n)}},wn={getInitial:function(r,e){return Se("http",e,e.httpPath||"/pusher")},getPath:function(r,e){return Ce(r)}};class kn{constructor(){this._callbacks={}}get(e){return this._callbacks[_e(e)]}add(e,n,o){var a=_e(e);this._callbacks[a]=this._callbacks[a]||[],this._callbacks[a].push({fn:n,context:o})}remove(e,n,o){if(!e&&!n&&!o){this._callbacks={};return}var a=e?[_e(e)]:Ye(this._callbacks);n||o?this.removeCallback(a,n,o):this.removeAllCallbacks(a)}removeCallback(e,n,o){ie(e,function(a){this._callbacks[a]=Ze(this._callbacks[a]||[],function(u){return n&&n!==u.fn||o&&o!==u.context}),this._callbacks[a].length===0&&delete this._callbacks[a]},this)}removeAllCallbacks(e){ie(e,function(n){delete this._callbacks[n]},this)}}function _e(r){return"_"+r}class J{constructor(e){this.callbacks=new kn,this.global_callbacks=[],this.failThrough=e}bind(e,n,o){return this.callbacks.add(e,n,o),this}bind_global(e){return this.global_callbacks.push(e),this}unbind(e,n,o){return this.callbacks.remove(e,n,o),this}unbind_global(e){return e?(this.global_callbacks=Ze(this.global_callbacks||[],n=>n!==e),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(e,n,o){for(var a=0;a<this.global_callbacks.length;a++)this.global_callbacks[a](e,n);var u=this.callbacks.get(e),h=[];if(o?h.push(n,o):n&&h.push(n),u&&u.length>0)for(var a=0;a<u.length;a++)u[a].fn.apply(u[a].context||window,h);else this.failThrough&&this.failThrough(e,n);return this}}class Sn extends J{constructor(e,n,o,a,u){super(),this.initialize=v.transportConnectionInitializer,this.hooks=e,this.name=n,this.priority=o,this.key=a,this.options=u,this.state="new",this.timeline=u.timeline,this.activityTimeout=u.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(n){return j.defer(()=>{this.onError(n),this.changeState("closed")}),!1}return this.bindListeners(),O.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"?(j.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,n){this.state=e,this.timeline.info(this.buildTimelineMessage({state:e,params:n})),this.emit(e,n)}buildTimelineMessage(e){return H({cid:this.id},e)}}class re{constructor(e){this.hooks=e}isSupported(e){return this.hooks.isSupported(e)}createConnection(e,n,o,a){return new Sn(this.hooks,e,n,o,a)}}var Cn=new re({urls:yn,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!v.getWebSocketAPI()},isSupported:function(){return!!v.getWebSocketAPI()},getSocket:function(r){return v.createWebSocket(r)}}),nt={urls:vn,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},rt=H({getSocket:function(r){return v.HTTPFactory.createStreamingSocket(r)}},nt),st=H({getSocket:function(r){return v.HTTPFactory.createPollingSocket(r)}},nt),it={isSupported:function(){return v.isXHRSupported()}},_n=new re(H({},rt,it)),En=new re(H({},st,it)),An={ws:Cn,xhr_streaming:_n,xhr_polling:En};const pe=An;var Tn=new re({file:"sockjs",urls:wn,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(r,e){return new window.SockJS(r,null,{js_path:_.getPath("sockjs",{useTLS:e.useTLS}),ignore_null_origin:e.ignoreNullOrigin})},beforeOpen:function(r,e){r.send(JSON.stringify({path:e}))}}),ot={isSupported:function(r){var e=v.isXDRSupported(r.useTLS);return e}},Ln=new re(H({},rt,ot)),xn=new re(H({},st,ot));pe.xdr_streaming=Ln,pe.xdr_polling=xn,pe.sockjs=Tn;const Pn=pe;class In extends J{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 On=new In;class Rn{constructor(e,n,o){this.manager=e,this.transport=n,this.minPingDelay=o.minPingDelay,this.maxPingDelay=o.maxPingDelay,this.pingDelay=void 0}createConnection(e,n,o,a){a=H({},a,{activityTimeout:this.pingDelay});var u=this.transport.createConnection(e,n,o,a),h=null,g=function(){u.unbind("open",g),u.bind("closed",b),h=j.now()},b=T=>{if(u.unbind("closed",b),T.code===1002||T.code===1003)this.manager.reportDeath();else if(!T.wasClean&&h){var P=j.now()-h;P<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(P/2,this.minPingDelay))}};return u.bind("open",g),u}isSupported(e){return this.manager.isAlive()&&this.transport.isSupported(e)}}const at={decodeMessage:function(r){try{var e=JSON.parse(r.data),n=e.data;if(typeof n=="string")try{n=JSON.parse(e.data)}catch{}var o={event:e.event,channel:e.channel,data:n};return e.user_id&&(o.user_id=e.user_id),o}catch(a){throw{type:"MessageParseError",error:a,data:r.data}}},encodeMessage:function(r){return JSON.stringify(r)},processHandshake:function(r){var e=at.decodeMessage(r);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(r){return r.code<4e3?r.code>=1002&&r.code<=1004?"backoff":null:r.code===4e3?"tls_only":r.code<4100?"refused":r.code<4200?"backoff":r.code<4300?"retry":"refused"},getCloseError:function(r){return r.code!==1e3&&r.code!==1001?{type:"PusherError",data:{code:r.code,message:r.reason||r.message}}:null}},Z=at;class Mn extends J{constructor(e,n){super(),this.id=e,this.transport=n,this.activityTimeout=n.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(e){return this.transport.send(e)}send_event(e,n,o){var a={event:e,data:n};return o&&(a.channel=o),O.debug("Event sent",a),this.send(Z.encodeMessage(a))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var e={message:o=>{var a;try{a=Z.decodeMessage(o)}catch(u){this.emit("error",{type:"MessageParseError",error:u,data:o.data})}if(a!==void 0){switch(O.debug("Event recd",a),a.event){case"pusher:error":this.emit
1("error",{type:"PusherError",data:a.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",a)}},activity:()=>{this.emit("activity")},error:o=>{this.emit("error",o)},closed:o=>{n(),o&&o.code&&this.handleCloseEvent(o),this.transport=null,this.emit("closed")}},n=()=>{V(e,(o,a)=>{this.transport.unbind(a,o)})};V(e,(o,a)=>{this.transport.bind(a,o)})}handleCloseEvent(e){var n=Z.getCloseAction(e),o=Z.getCloseError(e);o&&this.emit("error",o),n&&this.emit(n,{action:n,error:o})}}class qn{constructor(e,n){this.transport=e,this.callback=n,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=e=>{this.unbindListeners();var n;try{n=Z.processHandshake(e)}catch(o){this.finish("error",{error:o}),this.transport.close();return}n.action==="connected"?this.finish("connected",{connection:new Mn(n.id,this.transport),activityTimeout:n.activityTimeout}):(this.finish(n.action,{error:n.error}),this.transport.close())},this.onClosed=e=>{this.unbindListeners();var n=Z.getCloseAction(e)||"backoff",o=Z.getCloseError(e);this.finish(n,{error:o})},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,n){this.callback(H({transport:this.transport,action:e},n))}}class Dn{constructor(e,n){this.timeline=e,this.options=n||{}}send(e,n){this.timeline.isEmpty()||this.timeline.send(v.TimelineTransport.getAgent(this,e),n)}}class Ee extends J{constructor(e,n){super(function(o,a){O.debug("No callbacks on "+e+" for "+o)}),this.name=e,this.pusher=n,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(e,n){return n(null,{auth:""})}trigger(e,n){if(e.indexOf("client-")!==0)throw new p("Event '"+e+"' does not start with 'client-'");if(!this.subscribed){var o=y.buildLogSuffix("triggeringClientEvents");O.warn(`Client event triggered before channel 'subscription_succeeded' event . ${o}`)}return this.pusher.send_event(e,n,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(e){var n=e.event,o=e.data;if(n==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(e);else if(n==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(e);else if(n.indexOf("pusher_internal:")!==0){var a={};this.emit(n,o,a)}}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,n)=>{e?(this.subscriptionPending=!1,O.error(e.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:e.message},e instanceof U?{status:e.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:n.auth,channel_data:n.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 Ae extends Ee{authorize(e,n){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:e},n)}}class Nn{constructor(){this.reset()}get(e){return Object.prototype.hasOwnProperty.call(this.members,e)?{id:e,info:this.members[e]}:null}each(e){V(this.members,(n,o)=>{e(this.get(o))})}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 n=this.get(e.user_id);return n&&(delete this.members[e.user_id],this.count--),n}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var jn=function(r,e,n,o){function a(u){return u instanceof n?u:new n(function(h){h(u)})}
1return new(n||(n=Promise))(function(u,h){function g(P){try{T(o.next(P))}catch(M){h(M)}}function b(P){try{T(o.throw(P))}catch(M){h(M)}}function T(P){P.done?u(P.value):a(P.value).then(g,b)}T((o=o.apply(r,e||[])).next())})};class Bn extends Ae{constructor(e,n){super(e,n),this.members=new Nn}authorize(e,n){super.authorize(e,(o,a)=>jn(this,void 0,void 0,function*(){if(!o)if(a=a,a.channel_data!=null){var u=JSON.parse(a.channel_data);this.members.setMyID(u.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 h=y.buildLogSuffix("authorizationEndpoint");O.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${h}, or the user should be signed in.`),n("Invalid auth response");return}n(o,a)}))}handleEvent(e){var n=e.event;if(n.indexOf("pusher_internal:")===0)this.handleInternalEvent(e);else{var o=e.data,a={};e.user_id&&(a.user_id=e.user_id),this.emit(n,o,a)}}handleInternalEvent(e){var n=e.event,o=e.data;switch(n){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(e);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(e);break;case"pusher_internal:member_added":var a=this.members.addMember(o);this.emit("pusher:member_added",a);break;case"pusher_internal:member_removed":var u=this.members.removeMember(o);u&&this.emit("pusher:member_removed",u);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 Un=k(978),Te=k(594);class Hn extends Ae{constructor(e,n,o){super(e,n),this.key=null,this.nacl=o}authorize(e,n){super.authorize(e,(o,a)=>{if(o){n(o,a);return}let u=a.shared_secret;if(!u){n(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=(0,Te.decode)(u),delete a.shared_secret,n(null,a)})}trigger(e,n){throw new $("Client events are not currently supported for encrypted channels")}handleEvent(e){var n=e.event,o=e.data;if(n.indexOf("pusher_internal:")===0||n.indexOf("pusher:")===0){super.handleEvent(e);return}this.handleEncryptedEvent(n,o)}handleEncryptedEvent(e,n){if(!this.key){O.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!n.ciphertext||!n.nonce){O.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+n);return}let o=(0,Te.decode)(n.ciphertext);if(o.length<this.nacl.secretbox.overheadLength){O.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${o.length}`);return}let a=(0,Te.decode)(n.nonce);if(a.length<this.nacl.secretbox.nonceLength){O.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${a.length}`);return}let u=this.nacl.secretbox.open(o,a,this.key);if(u===null){O.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,(h,g)=>{if(h){O.error(`Failed to make a request to the authEndpoint: ${g}. Unable to fetch new key, so dropping encrypted event`);return}if(u=this.nacl.secretbox.open(o,a,this.key),u===null){O.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(e,this.getDataToEmit(u))});return}this.emit(e,this.getDataToEmit(u))}getDataToEmit(e){let n=(0,Un.D4)(e);try{return JSON.parse(n)}catch{return n}}}class Fn extends J{constructor(e,n){super(),this.state="initialized",this.connection=null,this.key=e,this.options=n,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 o=v.getNetwork();o.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),o.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,n,o){return this.connection?this.connection.send_event(e,n,o):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var e=(n,o)=>{n?this.runner=this.strategy.connect(0,e):o.action==="error"?(this.emit
1("error",{type:"HandshakeError",error:o.error}),this.timeline.error({handshakeError:o.error})):(this.abortConnecting(),this.handshakeCallbacks[o.action](o))};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 Q(e||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new Q(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new Q(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 Q(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(e){return H({},e,{message:n=>{this.resetActivityCheck(),this.emit("message",n)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:n=>{this.emit("error",n)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(e){return H({},e,{connected:n=>{this.activityTimeout=Math.min(this.options.activityTimeout,n.activityTimeout,n.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(n.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let e=n=>o=>{o.error&&this.emit("error",{type:"WebSocketError",error:o.error}),n(o)};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 n in this.connectionCallbacks)this.connection.bind(n,this.connectionCallbacks[n]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var e in this.connectionCallbacks)this.connection.unbind(e,this.connectionCallbacks[e]);var n=this.connection;return this.connection=null,n}}updateState(e,n){var o=this.state;if(this.state=e,o!==e){var a=e;a==="connected"&&(a+=" with new socket ID "+n.socket_id),O.debug("State changed",o+" -> "+a),this.timeline.info({state:e,params:n}),this.emit("state_change",{previous:o,current:e}),this.emit(e,n)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class zn{constructor(){this.channels={}}add(e,n){return this.channels[e]||(this.channels[e]=$n(e,n)),this.channels[e]}all(){return nn(this.channels)}find(e){return this.channels[e]}remove(e){var n=this.channels[e];return delete this.channels[e],n}disconnect(){V(this.channels,function(e){e.disconnect()})}}function $n(r,e){if(r.indexOf("private-encrypted-")===0){if(e.config.nacl)return G.createEncryptedChannel(r,e,e.config.nacl);let n="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",o=y.buildLogSuffix("encryptedChannelSupport");throw new $(`${n}. ${o}`)}else{if(r.indexOf("private-")===0)return G.createPrivateChannel(r,e);if(r.indexOf("presence-")===0)return G.createPresenceChannel(r,e);if(r.indexOf("#")===0)throw new m('Cannot create a channel with name "'+r+'".');return G.createChannel(r,e)}}var Wn={createChannels(){return new zn},createConnectionManager(r,e){return new Fn(r,e)},createChannel(r,e){return new Ee(r,e)},createPrivateChannel(r,e){return new Ae(r,e)},createPresenceChannel(r,e){return new Bn(r,e)}
1,createEncryptedChannel(r,e,n){return new Hn(r,e,n)},createTimelineSender(r,e){return new Dn(r,e)},createHandshake(r,e){return new qn(r,e)},createAssistantToTheTransportManager(r,e,n){return new Rn(r,e,n)}};const G=Wn;class ct{constructor(e){this.options=e||{},this.livesLeft=this.options.lives||1/0}getAssistant(e){return G.createAssistantToTheTransportManager(this,e,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class ee{constructor(e,n){this.strategies=e,this.loop=!!n.loop,this.failFast=!!n.failFast,this.timeout=n.timeout,this.timeoutLimit=n.timeoutLimit}isSupported(){return tt(this.strategies,j.method("isSupported"))}connect(e,n){var o=this.strategies,a=0,u=this.timeout,h=null,g=(b,T)=>{T?n(null,T):(a=a+1,this.loop&&(a=a%o.length),a<o.length?(u&&(u=u*2,this.timeoutLimit&&(u=Math.min(u,this.timeoutLimit))),h=this.tryStrategy(o[a],e,{timeout:u,failFast:this.failFast},g)):n(!0))};return h=this.tryStrategy(o[a],e,{timeout:u,failFast:this.failFast},g),{abort:function(){h.abort()},forceMinPriority:function(b){e=b,h&&h.forceMinPriority(b)}}}tryStrategy(e,n,o,a){var u=null,h=null;return o.timeout>0&&(u=new Q(o.timeout,function(){h.abort(),a(!0)})),h=e.connect(n,function(g,b){g&&u&&u.isRunning()&&!o.failFast||(u&&u.ensureAborted(),a(g,b))}),{abort:function(){u&&u.ensureAborted(),h.abort()},forceMinPriority:function(g){h.forceMinPriority(g)}}}}class Le{constructor(e){this.strategies=e}isSupported(){return tt(this.strategies,j.method("isSupported"))}connect(e,n){return Xn(this.strategies,e,function(o,a){return function(u,h){if(a[o].error=u,u){Vn(a)&&n(!0);return}ie(a,function(g){g.forceMinPriority(h.transport.priority)}),n(null,h)}})}}function Xn(r,e,n){var o=Qe(r,function(a,u,h,g){return a.connect(e,n(u,g))});return{abort:function(){ie(o,Jn)},forceMinPriority:function(a){ie(o,function(u){u.forceMinPriority(a)})}}}function Vn(r){return on(r,function(e){return!!e.error})}function Jn(r){!r.error&&!r.aborted&&(r.abort(),r.aborted=!0)}class Gn{constructor(e,n,o){this.strategy=e,this.transports=n,this.ttl=o.ttl||18e5,this.usingTLS=o.useTLS,this.timeline=o.timeline}isSupported(){return this.strategy.isSupported()}connect(e,n){var o=this.usingTLS,a=Kn(o),u=a&&a.cacheSkipCount?a.cacheSkipCount:0,h=[this.strategy];if(a&&a.timestamp+this.ttl>=j.now()){var g=this.transports[a.transport];g&&(["ws","wss"].includes(a.transport)||u>3?(this.timeline.info({cached:!0,transport:a.transport,latency:a.latency}),h.push(new ee([g],{timeout:a.latency*2+1e3,failFast:!0}))):u++)}var b=j.now(),T=h.pop().connect(e,function P(M,ye){M?(lt(o),h.length>0?(b=j.now(),T=h.pop().connect(e,P)):n(M)):(Yn(o,ye.transport.name,j.now()-b,u),n(null,ye))});return{abort:function(){T.abort()},forceMinPriority:function(P){e=P,T&&T.forceMinPriority(P)}}}}function xe(r){return"pusherTransport"+(r?"TLS":"NonTLS")}function Kn(r){var e=v.getLocalStorage();if(e)try{var n=e[xe(r)];if(n)return JSON.parse(n)}catch{lt(r)}return null}function Yn(r,e,n,o){var a=v.getLocalStorage();if(a)try{a[xe(r)]=fe({timestamp:j.now(),transport:e,latency:n,cacheSkipCount:o})}catch{}}function lt(r){var e=v.getLocalStorage();if(e)try{delete e[xe(r)]}catch{}}class ge{constructor(e,{delay:n}){this.strategy=e,this.options={delay:n}}isSupported(){return this.strategy.isSupported()}connect(e,n){var o=this.strategy,a,u=new Q(this.options.delay,function(){a=o.connect(e,n)});return{abort:function(){u.ensureAborted(),a&&a.abort()},forceMinPriority:function(h){e=h,a&&a.forceMinPriority(h)}}}}class oe{constructor(e,n,o){this.test=e,this.trueBranch=n,this.falseBranch=o}isSupported(){var e=this.test()?this.trueBranch:this.falseBranch;return e.isSupported()}connect(e,n){var o=this.test()?this.trueBranch:this.falseBranch;return o.connect(e,n)}}class Qn{constructor(e){this.strategy=e}isSupported(){return this.strategy.isSupported()}connect(e,n){var o=this.strategy.connect(e,function(a,u){u&&o.abort(),n(a,u)});return o}}function ae(r){return function(){return r.isSupported()}}var Zn=function(r,e,n){var o={};function a(St,Kr,Yr,Qr,Zr){var Ct=n(r,St,Kr,Yr,Qr,Zr);return o[St]=Ct,Ct}var u=Object.assign({},e,{hostNonTLS:r.wsHost+":"+r.wsPort,hostTLS:r.wsHost+":"+r.wssPort,httpPath:r.wsPath}),h=Object.assign({},u,{useTLS:!0}),g=Object.assign({},e,{hostNonTLS:r.httpHost+":"+r.httpPort,hostTLS:r.httpHost+":"+r.httpsPort,httpPath:r.httpPath}),b={loop:!0,timeout:15e3,timeoutLimit:6e4},T=new ct({minPingDelay:1e4,maxPingDelay:r.activityTimeout}),P=new ct({lives:2,minPingDelay:1e4,maxPingDelay:r.activityTimeout}),M=a("ws","ws",3,u,T),ye=a("wss","ws",3,h,T),Wr=a("sockjs","sockjs",1,g),mt=a("xhr_streaming","xhr_streaming",1,g,P),Xr=a("xdr_streaming","xdr_streaming",1,g,P),bt=a("xhr_polling","xhr_polling",1,g),Vr=a("xdr_polling","xdr_polling",1,g),yt=new ee([M],b),Jr=new ee([ye],b),Gr=new ee([Wr],b),vt=new ee([new oe(ae(mt),mt,Xr)],b),wt=ne
1w ee([new oe(ae(bt),bt,Vr)],b),kt=new ee([new oe(ae(vt),new Le([vt,new ge(wt,{delay:4e3})]),wt)],b),Oe=new oe(ae(kt),kt,Gr),Re;return e.useTLS?Re=new Le([yt,new ge(Oe,{delay:2e3})]):Re=new Le([yt,new ge(Jr,{delay:2e3}),new ge(Oe,{delay:5e3})]),new Gn(new Qn(new oe(ae(M),Re,Oe)),o,{ttl:18e5,timeline:e.timeline,useTLS:e.useTLS})};const er=Zn;function tr(){var r=this;r.timeline.info(r.buildTimelineMessage({transport:r.name+(r.options.useTLS?"s":"")})),r.hooks.isInitialized()?r.changeState("initialized"):r.hooks.file?(r.changeState("initializing"),_.load(r.hooks.file,{useTLS:r.options.useTLS},function(e,n){r.hooks.isInitialized()?(r.changeState("initialized"),n(!0)):(e&&r.onError(e),r.onClose(),n(!1))})):r.onClose()}var nr={getRequest:function(r){var e=new window.XDomainRequest;return e.ontimeout=function(){r.emit("error",new I),r.close()},e.onerror=function(n){r.emit("error",n),r.close()},e.onprogress=function(){e.responseText&&e.responseText.length>0&&r.onChunk(200,e.responseText)},e.onload=function(){e.responseText&&e.responseText.length>0&&r.onChunk(200,e.responseText),r.emit("finished",200),r.close()},e},abortRequest:function(r){r.ontimeout=r.onerror=r.onprogress=r.onload=null,r.abort()}};const rr=nr,sr=256*1024;class ir extends J{constructor(e,n,o){super(),this.hooks=e,this.method=n,this.url=o}start(e){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},v.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&&(v.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(e,n){for(;;){var o=this.advanceBuffer(n);if(o)this.emit("chunk",{status:e,data:o});else break}this.isBufferTooLong(n)&&this.emit("buffer_too_long")}advanceBuffer(e){var n=e.slice(this.position),o=n.indexOf(` 2`);return o!==-1?(this.position+=o+1,n.slice(0,o)):null}isBufferTooLong(e){return this.position===e.length&&e.length>sr}}var Pe;(function(r){r[r.CONNECTING=0]="CONNECTING",r[r.OPEN=1]="OPEN",r[r.CLOSED=3]="CLOSED"})(Pe||(Pe={}));const te=Pe;var or=1;class ar{constructor(e,n){this.hooks=e,this.session=ht(1e3)+"/"+hr(8),this.location=cr(n),this.readyState=te.CONNECTING,this.openStream()}send(e){return this.sendRaw(JSON.stringify([e]))}ping(){this.hooks.sendHeartbeat(this)}close(e,n){this.onClose(e,n,!0)}sendRaw(e){if(this.readyState===te.OPEN)try{return v.createSocketRequest("POST",ut(lr(this.location,this.session))).start(e),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(e,n,o){this.closeStream(),this.readyState=te.CLOSED,this.onclose&&this.onclose({code:e,reason:n,wasClean:o})}onChunk(e){if(e.status===200){this.readyState===te.OPEN&&this.onActivity();var n,o=e.data.slice(0,1);switch(o){case"o":n=JSON.parse(e.data.slice(1)||"{}"),this.onOpen(n);break;case"a":n=JSON.parse(e.data.slice(1)||"[]");for(var a=0;a<n.length;a++)this.onEvent(n[a]);break;case"m":n=JSON.parse(e.data.slice(1)||"null"),this.onEvent(n);break;case"h":this.hooks.onHeartbeat(this);break;case"c":n=JSON.parse(e.data.slice(1)||"[]"),this.onClose(n[0],n[1],!0);break}}}onOpen(e){this.readyState===te.CONNECTING?(e&&e.hostname&&(this.location.base=ur(this.location.base,e.hostname)),this.readyState=te.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(e){this.readyState===te.OPEN&&this.onmessage&&this.onmessage({data:e})}onActivity(){this.onactivity&&this.onactivity()}onError(e){this.onerror&&this.onerror(e)}openStream(){this.stream=v.createSocketRequest("POST",ut(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){j.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 cr(r){var e=/([^\?]*)\/*(\??.*)/.exec(r);return{base:e[1],queryString:e[2]}}function lr(r,e){return r.base+"/"+e+"/xhr_send"}function ut(r){var e=r.indexOf("?")===-1?"?":"&";return r+e+"t="+ +new Date+"&n="+or++}function ur(r,e){var n=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(r);return n[1]+e+n[3]}function ht(r){return v.randomInt(r)}function hr(r){for(var e=[],n=0;n<r;n++)e.push(ht(32).toString(32));return e.join("")}const dr=ar;var fr={getReceiveURL:function(r,e){return r.base+"/"+e+"/xhr_streaming"+r.queryString}
2,onHeartbeat:function(r){r.sendRaw("[]")},sendHeartbeat:function(r){r.sendRaw("[]")},onFinished:function(r,e){r.onClose(1006,"Connection interrupted ("+e+")",!1)}};const pr=fr;var gr={getReceiveURL:function(r,e){return r.base+"/"+e+"/xhr"+r.queryString},onHeartbeat:function(){},sendHeartbeat:function(r){r.sendRaw("[]")},onFinished:function(r,e){e===200?r.reconnect():r.onClose(1006,"Connection interrupted ("+e+")",!1)}};const mr=gr;var br={getRequest:function(r){var e=v.getXHRAPI(),n=new e;return n.onreadystatechange=n.onprogress=function(){switch(n.readyState){case 3:n.responseText&&n.responseText.length>0&&r.onChunk(n.status,n.responseText);break;case 4:n.responseText&&n.responseText.length>0&&r.onChunk(n.status,n.responseText),r.emit("finished",n.status),r.close();break}},n},abortRequest:function(r){r.onreadystatechange=null,r.abort()}};const yr=br;var vr={createStreamingSocket(r){return this.createSocket(pr,r)},createPollingSocket(r){return this.createSocket(mr,r)},createSocket(r,e){return new dr(r,e)},createXHR(r,e){return this.createRequest(yr,r,e)},createRequest(r,e,n){return new ir(r,e,n)}};const dt=vr;dt.createXDR=function(r,e){return this.createRequest(rr,r,e)};var wr={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:A,DependenciesReceivers:C,getDefaultStrategy:er,Transports:Pn,transportConnectionInitializer:tr,HTTPFactory:dt,TimelineTransport:bn,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(r){window.Pusher=r;var e=()=>{this.onDocumentBody(r.ready)};window.JSON?e():_.load("json2",{},e)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:$t,jsonp:dn}},onDocumentBody(r){document.body?r():setTimeout(()=>{this.onDocumentBody(r)},0)},createJSONPRequest(r,e){return new pn(r,e)},createScriptRequest(r){return new fn(r)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var r=this.getXHRAPI();return new r},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return On},createWebSocket(r){var e=this.getWebSocketAPI();return new e(r)},createSocketRequest(r,e){if(this.isXHRSupported())return this.HTTPFactory.createXHR(r,e);if(this.isXDRSupported(e.indexOf("https:")===0))return this.HTTPFactory.createXDR(r,e);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var r=this.getXHRAPI();return!!r&&new r().withCredentials!==void 0},isXDRSupported(r){var e=r?"https:":"http:",n=this.getProtocol();return!!window.XDomainRequest&&n===e},addUnloadListener(r){window.addEventListener!==void 0?window.addEventListener("unload",r,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",r)},removeUnloadListener(r){window.addEventListener!==void 0?window.removeEventListener("unload",r,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",r)},randomInt(r){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)}()*r)}};const v=wr;var Ie;(function(r){r[r.ERROR=3]="ERROR",r[r.INFO=6]="INFO",r[r.DEBUG=7]="DEBUG"})(Ie||(Ie={}));const me=Ie;class kr{constructor(e,n,o){this.key=e,this.session=n,this.events=[],this.options=o||{},this.sent=0,this.uniqueID=0}log(e,n){e<=this.options.level&&(this.events.push(H({},n,{timestamp:j.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(e){this.log(me.ERROR,e)}info(e){this.log(me.INFO,e)}debug(e){this.log(me.DEBUG,e)}isEmpty(){return this.events.length===0}send(e,n){var o=H({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(o,(a,u)=>{a||this.sent++,n&&n(a,u)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class Sr{constructor(e,n,o,a){this.name=e,this.priority=n,this.transport=o,this.options=a||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}
2connect(e,n){if(this.isSupported()){if(this.priority<e)return ft(new q,n)}else return ft(new B,n);var o=!1,a=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),u=null,h=function(){a.unbind("initialized",h),a.connect()},g=function(){u=G.createHandshake(a,function(M){o=!0,P(),n(null,M)})},b=function(M){P(),n(M)},T=function(){P();var M;M=fe(a),n(new D(M))},P=function(){a.unbind("initialized",h),a.unbind("open",g),a.unbind("error",b),a.unbind("closed",T)};return a.bind("initialized",h),a.bind("open",g),a.bind("error",b),a.bind("closed",T),a.initialize(),{abort:()=>{o||(P(),u?u.close():a.close())},forceMinPriority:M=>{o||this.priority<M&&(u?u.close():a.close())}}}}function ft(r,e){return j.defer(function(){e(r)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:Cr}=v;var _r=function(r,e,n,o,a,u){var h=Cr[n];if(!h)throw new X(n);var g=(!r.enabledTransports||Ke(r.enabledTransports,e)!==-1)&&(!r.disabledTransports||Ke(r.disabledTransports,e)===-1),b;return g?(a=Object.assign({ignoreNullOrigin:r.ignoreNullOrigin},a),b=new Sr(e,o,u?u.getAssistant(h):h,a)):b=Er,b},Er={isSupported:function(){return!1},connect:function(r,e){var n=j.defer(function(){e(new B)});return{abort:function(){n.ensureAborted()},forceMinPriority:function(){}}}};function Ar(r){if(r==null)throw"You must pass an options object";if(r.cluster==null)throw"Options object must provide a cluster";"disableStats"in r&&O.warn("The disableStats option is deprecated in favor of enableStats")}const Tr=(r,e)=>{var n="socket_id="+encodeURIComponent(r.socketId);for(var o in e.params)n+="&"+encodeURIComponent(o)+"="+encodeURIComponent(e.params[o]);if(e.paramsProvider!=null){let a=e.paramsProvider();for(var o in a)n+="&"+encodeURIComponent(o)+"="+encodeURIComponent(a[o])}return n},Lr=r=>{if(typeof v.getAuthorizers()[r.transport]>"u")throw`'${r.transport}' is not a recognized auth transport`;return(e,n)=>{const o=Tr(e,r);v.getAuthorizers()[r.transport](v,o,r,d.UserAuthentication,n)}},xr=(r,e)=>{var n="socket_id="+encodeURIComponent(r.socketId);n+="&channel_name="+encodeURIComponent(r.channelName);for(var o in e.params)n+="&"+encodeURIComponent(o)+"="+encodeURIComponent(e.params[o]);if(e.paramsProvider!=null){let a=e.paramsProvider();for(var o in a)n+="&"+encodeURIComponent(o)+"="+encodeURIComponent(a[o])}return n},Pr=r=>{if(typeof v.getAuthorizers()[r.transport]>"u")throw`'${r.transport}' is not a recognized auth transport`;return(e,n)=>{const o=xr(e,r);v.getAuthorizers()[r.transport](v,o,r,d.ChannelAuthorization,n)}},Ir=(r,e,n)=>{const o={authTransport:e.transport,authEndpoint:e.endpoint,auth:{params:e.params,headers:e.headers}};return(a,u)=>{const h=r.channel(a.channelName);n(h,o).authorize(a.socketId,u)}};function pt(r,e){let n={activityTimeout:r.activityTimeout||w.activityTimeout,cluster:r.cluster,httpPath:r.httpPath||w.httpPath,httpPort:r.httpPort||w.httpPort,httpsPort:r.httpsPort||w.httpsPort,pongTimeout:r.pongTimeout||w.pongTimeout,statsHost:r.statsHost||w.stats_host,unavailableTimeout:r.unavailableTimeout||w.unavailableTimeout,wsPath:r.wsPath||w.wsPath,wsPort:r.wsPort||w.wsPort,wssPort:r.wssPort||w.wssPort,enableStats:Dr(r),httpHost:Or(r),useTLS:qr(r),wsHost:Rr(r),userAuthenticator:Nr(r),channelAuthorizer:Br(r,e)};return"disabledTransports"in r&&(n.disabledTransports=r.disabledTransports),"enabledTransports"in r&&(n.enabledTransports=r.enabledTransports),"ignoreNullOrigin"in r&&(n.ignoreNullOrigin=r.ignoreNullOrigin),"timelineParams"in r&&(n.timelineParams=r.timelineParams),"nacl"in r&&(n.nacl=r.nacl),n}function Or(r){return r.httpHost?r.httpHost:r.cluster?`sockjs-${r.cluster}.pusher.com`:w.httpHost}function Rr(r){return r.wsHost?r.wsHost:Mr(r.cluster)}function Mr(r){return`ws-${r}.pusher.com`}function qr(r){return v.getProtocol()==="https:"?!0:r.forceTLS!==!1}function Dr(r){return"enableStats"in r?r.enableStats:"disableStats"in r?!r.disableStats:!1}const gt=r=>"customHandler"in r&&r.customHandler!=null;function Nr(r){const e=Object.assign(Object.assign({},w.userAuthentication),r.userAuthentication);return gt(e)?e.customHandler:Lr(e)}function jr(r,e){let n;if("channelAuthorization"in r)n=Object.assign(Object.assign({},w.channelAuthorization),r.channelAuthorization);else if(n={transport:r.authTransport||w.authTransport,endpoint:r.authEndpoint||w.authEndpoint},"auth"in r&&("params"in r.auth&&(n.params=r.auth.params),"headers"in r.auth&&(n.headers=r.auth.headers)),"authorizer"in r)return{customHandler:Ir(e,n,r.authorizer)};return n}function Br(r,e){const n=jr(r,e);return gt(n)?n.customHandler:Pr(n)}class Ur extends J{constructor(e){super(function(n,o){O.debug(`No callbacks on watchlist events for ${n}`)}),this.pusher=e,this.bindWatchlistInternalEvent()}
2handleEvent(e){e.data.events.forEach(n=>{this.emit(n.name,n)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",e=>{var n=e.event;n==="pusher_internal:watchlist_events"&&this.handleEvent(e)})}}function Hr(){let r,e;return{promise:new Promise((o,a)=>{r=o,e=a}),resolve:r,reject:e}}const Fr=Hr;class zr extends J{constructor(e){super(function(n,o){O.debug("No callbacks on user for "+n)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(n,o)=>{if(n){O.warn(`Error during signin: ${n}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:o.auth,user_data:o.user_data})},this.pusher=e,this.pusher.connection.bind("state_change",({previous:n,current:o})=>{n!=="connected"&&o==="connected"&&this._signin(),n==="connected"&&o!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new Ur(e),this.pusher.connection.bind("message",n=>{var o=n.event;o==="pusher:signin_success"&&this._onSigninSuccess(n.data),this.serverToUserChannel&&this.serverToUserChannel.name===n.channel&&this.serverToUserChannel.handleEvent(n)})}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{O.error(`Failed parsing user data after signin: ${e.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){O.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const e=n=>{n.subscriptionPending&&n.subscriptionCancelled?n.reinstateSubscription():!n.subscriptionPending&&this.pusher.connection.state==="connected"&&n.subscribe()};this.serverToUserChannel=new Ee(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((n,o)=>{n.indexOf("pusher_internal:")===0||n.indexOf("pusher:")===0||this.emit(n,o)}),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:n}=Fr();e.done=!1;const o=()=>{e.done=!0};e.then(o).catch(o),this.signinDonePromise=e,this._signinDoneResolve=n}}class N{static ready(){N.isReady=!0;for(var e=0,n=N.instances.length;e<n;e++)N.instances[e].connect()}static getClientFeatures(){return Ye(et({ws:v.Transports.ws},function(e){return e.isSupported({})}))}constructor(e,n){$r(e),Ar(n),this.key=e,this.options=n,this.config=pt(this.options,this),this.channels=G.createChannels(),this.global_emitter=new J,this.sessionID=v.randomInt(1e9),this.timeline=new kr(this.key,this.sessionID,{cluster:this.config.cluster,features:N.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:me.INFO,version:w.VERSION}),this.config.enableStats&&(this.timelineSender=G.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+v.TimelineTransport.name}));var o=a=>v.getDefaultStrategy(this.config,a,_r);this.connection=G.createConnectionManager(this.key,{getStrategy:o,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",a=>{var u=a.event,h=u.indexOf("pusher_internal:")===0;if(a.channel){var g=this.channel(a.channel);g&&g.handleEvent(a)}h||this.global_emitter.emit(a.event,a.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",a=>{O.warn(a)}),N.instances.push(this),this.timeline.info({instances:N.instances.length}),this.user=new zr(this),N.isReady&&this.connect()}switchCluster(e){const{appKey:n,cluster:o}=e;this.key=n,this.options=Object.assign(Object.assign({},this.options),{cluster:o}),this.config=pt(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(),n=this.timelineSender;this.timelineSenderTimer=new Zt(6e4,function(){n.send(e)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(e,n,o){return this.global_emitter.bind(e,n,o),this}unbind(e,n,o){return this.global_emitter.unbind(e,n,o),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;
2for(e in this.channels.channels)this.channels.channels.hasOwnProperty(e)&&this.subscribe(e)}subscribe(e){var n=this.channels.add(e,this);return n.subscriptionPending&&n.subscriptionCancelled?n.reinstateSubscription():!n.subscriptionPending&&this.connection.state==="connected"&&n.subscribe(),n}unsubscribe(e){var n=this.channels.find(e);n&&n.subscriptionPending?n.cancelSubscription():(n=this.channels.remove(e),n&&n.subscribed&&n.unsubscribe())}send_event(e,n,o){return this.connection.send_event(e,n,o)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}N.instances=[],N.isReady=!1,N.logToConsole=!1,N.Runtime=v,N.ScriptReceivers=v.ScriptReceivers,N.DependenciesReceivers=v.DependenciesReceivers,N.auth_callbacks=v.auth_callbacks;const be=N;function $r(r){if(r==null)throw"You must pass your app key when you instantiate Pusher."}v.setup(N)}},c={};function l(S){var L=c[S];if(L!==void 0)return L.exports;var k=c[S]={exports:{}};return s[S].call(k.exports,k,k.exports,l),k.exports}l.d=(S,L)=>{for(var k in L)l.o(L,k)&&!l.o(S,k)&&Object.defineProperty(S,k,{enumerable:!0,get:L[k]})},l.o=(S,L)=>Object.prototype.hasOwnProperty.call(S,L);var f=l(721);return f})())})(Me)),Me.exports}var gs=ps();const ms=ts(gs);window.axios=es;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";const Nt=()=>document.querySelector('meta[name="user-id"]')?.getAttribute("content");window.axios.interceptors.request.use(i=>{const t=Nt();return t&&(i.headers.__m=String(t)),i});const bs=window.fetch;window.fetch=function(i,t={}){const s=Nt();if(s){const c=new Headers(t.headers||{});c.has("__m")||c.set("__m",String(s)),t={...t,headers:c}}return bs.call(this,i,t)};window.Pusher=ms;const ys=(()=>{if(typeof window>"u")return!1;const i=window.location?.pathname||"";return/^\/chats\/[A-Za-z0-9_-]+\/?$/.test(i)})();if(ys){const i=window.reverbConfig||{};window.Echo=new fs({broadcaster:"reverb",key:i.key||void 0||"9wxcaekdjm9wtnfl6m4y",wsHost:i.host||void 0||window.location.hostname,wsPort:i.port??void 0??8081,wssPort:i.port??void 0??8081,wsPath:i.path||void 0||"",forceTLS:(i.scheme??void 0??"https")==="https",enabledTransports:["ws","wss"]})}else window.Echo=void 0;class vs{constructor(){this.modals=new Map,this.openModals=new Set,this.init()}init(){window.addEventListener("open-modal",t=>{this.open(t.detail)}),window.addEventListener("close-modal",t=>{this.close(t.detail)}),document.addEventListener("keydown",t=>{t.key==="Escape"&&this.closeAllIfAllowed()})}register(t,s){this.modals.set(t,s)}isOpen(t){return this.openModals.has(t)}syncBodyScrollLock(){Array.from(this.openModals).some(s=>{const c=this.modals.get(s);return c?c.getAttribute("data-scroll-lock")!=="false":!1})?document.body.classList.add("overflow-y-hidden"):document.body.classList.remove("overflow-y-hidden")}open(t){let s=this.modals.get(t);s||(s=document.querySelector(`[data-modal-name="${t}"]`),s&&this.register(t,s)),s&&(s.style.display="block",this.openModals.add(t),this.syncBodyScrollLock(),setTimeout(()=>{s.classList.add("modal-show")},10),window.dispatchEvent(new CustomEvent("modal-opened",{detail:t})))}close(t){const s=this.modals.get(t);s&&(s.classList.remove("modal-show"),this.openModals.delete(t),this.syncBodyScrollLock(),setTimeout(()=>{s.style.display="none"},300),window.dispatchEvent(new CustomEvent("modal-closed",{detail:t})))}closeAll(){this.modals.forEach((t,s)=>{this.close(s)})}closeAllIfAllowed(){this.modals.forEach((t,s)=>{t.getAttribute("data-close-on-escape")!=="false"&&t.classList.contains("modal-show")&&this.close(s)})}}const jt=new vs;window.modalManager=jt;window.openModal=i=>{window.dispatchEvent(new CustomEvent("open-modal",{detail:i}))};window.closeModal=i=>{window.dispatchEvent(new CustomEvent("close-modal",{detail:i}))};document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("[data-modal-name]").forEach(i=>{const t=i.getAttribute("data-modal-name");jt.register(t,i)}),document.querySelectorAll("[data-modal-trigger]").forEach(i=>{i.addEventListener("click",t=>{t.preventDefault();const s=i.getAttribute("data-modal-trigger");
2window.openModal(s)})}),document.querySelectorAll("[data-modal-close]").forEach(i=>{i.addEventListener("click",t=>{t.preventDefault();const s=i.closest("[data-modal-name]")?.getAttribute("data-modal-name");s&&window.closeModal(s)})}),document.querySelectorAll("[data-modal-backdrop]").forEach(i=>{i.addEventListener("click",t=>{if(t.target===i){const s=i.closest("[data-modal-name]"),c=s?.getAttribute("data-modal-name"),l=s?.getAttribute("data-close-on-backdrop")!=="false";c&&l&&window.closeModal(c)}})})});function We(i){return typeof document>"u"||!i?null:document.querySelector(`[data-modal-name="${i}"]`)}function Y(i){return i?i.querySelector("[data-report-form]"):null}function ne(i,t,s){if(!i)return;const c=i.querySelector(`input[type="hidden"][name="${t}"]`);c&&(c.value=s==null?"":String(s))}function ws(i){return i?.querySelector?.("[data-report-details]")||null}function ks(i){return(i?.querySelector?.('textarea[name="details"]')?.value||"").trim()}function Xe(i,t){const s=Y(i);if(!s)return;const c=ws(s);c&&c.classList.toggle("hidden",!t)}function K(i){const t=Y(i);if(!t)return;const s=i.querySelector("[data-report-submit]"),c=t.querySelectorAll('input[type="radio"][name="reason"]');if(!s||!c.length)return;if(i.dataset.reportSubmitting==="true"){s.disabled=!0,s.classList.remove("report-submit-enabled");return}const l=Array.from(c).some(f=>f.checked);s.disabled=!l,s.classList.toggle("report-submit-enabled",l),Xe(i,l)}function Ss(){return document.querySelector('meta[name="csrf-token"]')?.getAttribute("content")||""}function Cs(i){return i?.querySelector('input[type="radio"][name="reason"]:checked')?.value||""}function _s(i){if(typeof window>"u"||!i)return i;const t=String(i).trim();if(!t)return null;if(t.startsWith("http://")||t.startsWith("https://"))return t;const s=new URL(window.location.href);return s.searchParams.set("content_id",t),s.toString()}function Es(i){const t=(i?.querySelector('input[type="hidden"][name="reportType"]')?.value||"").trim(),s=(i?.querySelector('input[type="hidden"][name="contentType"]')?.value||"").trim(),c=(i?.querySelector('input[type="hidden"][name="contentValue"]')?.value||"").trim(),l=ks(i),f=t==="content"?s==="chat"?c:_s(c):typeof window<"u"?window.location.href:c;return{reportType:t,contentType:s||null,contentValue:f||null,reason:Cs(i),details:l||null}}function As(i){if(!i)return["Something went wrong."];if(Array.isArray(i))return i.map(String);if(typeof i=="string")return[i];if(i.errors&&typeof i.errors=="object"){const t=[];if(Object.values(i.errors).forEach(s=>{Array.isArray(s)?s.forEach(c=>t.push(String(c))):s!=null&&t.push(String(s))}),t.length)return t}return i.message?[String(i.message)]:["Something went wrong."]}function Ts(i){let t=i.querySelector("[data-report-status]");if(t)return t;t=document.createElement("div"),t.setAttribute("data-report-status","true"),t.className="report-modal-scroll px-4 pb-3 text-xs max-h-[100px] overflow-y-auto whitespace-pre-wrap break-words md:px-6";const s=i.querySelector("[data-report-footer]");return s?.parentNode?(s.parentNode.insertBefore(t,s),t):(i.appendChild(t),t)}function le(i,{type:t,messages:s}){const c=Ts(i);if(!c)return;const l=Array.isArray(s)?s:s?[String(s)]:[];if(!l.length){c.textContent="",c.classList.remove("text-red-400","text-green-400");return}c.textContent=l.join(" "),c.classList.toggle("text-red-400",t==="error"),c.classList.toggle("text-green-400",t==="success")}function Ve(i){const t=Y(i);if(!i||!t)return;i.dataset.reportSubmitting="false",le(i,{type:null,messages:[]}),t.querySelectorAll('input[type="radio"][name="reason"]').forEach(c=>{c.checked=!1});const s=t.querySelector('textarea[name="details"]');s&&(s.value=""),Xe(i,!1),K(i)}async function Ls(i){const t=Y(i);if(!t)return;const s=i.querySelector("[data-report-submit]");if(!s||i.dataset.reportSubmitting==="true")return;const c=Es(t);if(!c.reason){K(i);return}i.dataset.reportSubmitting="true",le(i,{type:null,messages:[]}),K(i);const l=s.textContent;s.textContent="Submitting...";try{const f=Ss(),S=await fetch("/api/content-removal",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest","X-CSRF-TOKEN":f},credentials:"same-origin",body:JSON.stringify(c)}),k=(S.headers.get("content-type")||"").includes("application/json")?await S.json().catch(()=>null):null;if(!S.ok){const A=As(k);le(i,{type:"error",messages:A});return}le(i,{type:"success",messages:["Report submitted."]}),t.querySelectorAll('input[type="radio"][name="reason"]').forEach(A=>{A.checked=!1}
2);const E=t.querySelector('textarea[name="details"]');E&&(E.value=""),Xe(i,!1),setTimeout(()=>{const A=i.getAttribute("data-modal-name");A&&typeof window.closeModal=="function"?window.closeModal(A):i.dispatchEvent(new CustomEvent("close-modal",{detail:A}))},450)}catch{le(i,{type:"error",messages:["Failed to submit report. Please try again."]})}finally{i.dataset.reportSubmitting="false",s.textContent=l,K(i)}}function At(i){if(!i||i.dataset.reportModalsBound==="true")return;i.dataset.reportModalsBound="true";const t=Y(i);if(!t)return;t.querySelectorAll('input[type="radio"][name="reason"]').forEach(f=>{f.addEventListener("change",()=>K(i))});const c=t.querySelector('textarea[name="details"]');c&&c.addEventListener("input",()=>K(i));const l=i.querySelector("[data-report-submit]");l&&l.addEventListener("click",f=>{f.preventDefault(),Ls(i)}),K(i)}function xs(i,{userId:t,profileUrl:s}={}){const c=We(i),l=Y(c);!c||!l||(ne(l,"reportType","profile"),ne(l,"contentType","profile"),ne(l,"contentValue",typeof window<"u"?window.location.href:s||t),Ve(c))}function Ps(i,{contentType:t,contentValue:s}={}){const c=We(i),l=Y(c);!c||!l||(ne(l,"reportType","content"),ne(l,"contentType",t),ne(l,"contentValue",s),Ve(c))}function Is(){if(typeof window>"u")return;const i=()=>{document.querySelectorAll("[data-modal-name]").forEach(t=>{t.querySelector("[data-report-form]")&&At(t)})};document.addEventListener("click",t=>{const s=t.target?.closest?.("[data-open-report-user-modal]");if(!s)return;t.preventDefault();const c=s.getAttribute("data-modal-name")||"report-user-modal",l=s.getAttribute("data-user-id"),f=l?Number(l):null,S=s.getAttribute("data-profile-url");typeof window.openReportUserModal=="function"&&window.openReportUserModal({modalName:c,userId:f,profileUrl:S}),s.closest("details")?.removeAttribute("open")}),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",i):i(),window.addEventListener("modal-opened",t=>{const s=t?.detail,c=We(s);if(c&&c.querySelector("[data-report-form]")&&(At(c),Ve(c),K(c),s==="report-user-modal")){const l=Y(c);!(l?.querySelector('input[type="hidden"][name="contentValue"]')?.value||"").trim()&&typeof window<"u"&&ne(l,"contentValue",window.location.href)}}),window.openReportUserModal=(t={})=>{const s=t.modalName||"report-user-modal";xs(s,{userId:t.userId,profileUrl:t.profileUrl}),typeof window.openModal=="function"&&window.openModal(s)},window.openReportContentModal=(t={})=>{const s=t.modalName||"report-content-modal";Ps(s,{contentType:t.contentType,contentValue:t.contentValue}),typeof window.openModal=="function"&&window.openModal(s)}}Is();window.PaymentFlow={currentPlanData:{name:"",price:0},currentRealEstate:null,setAtlasRealEstate:function(i){if(!(typeof window.atlas!="object"||typeof window.atlas.setRealEstate!="function"))try{window.atlas.setRealEstate(i),this.logAtlasDebug("info","setRealEstate success",{realEstate:i})}catch(t){this.logAtlasDebug("error","setRealEstate failed",{realEstate:i,error:t?.message}),console.error("Atlas setRealEstate failed:",t)}},isAtlasDebugEnabled:function(){const i=window.location.hostname;return i.includes("localhost")||i.includes("127.0.0.1")||i.includes("stage")||window.location.search.includes("atlasDebug=1")},logAtlasDebug:function(i,t,s={}){if(!this.isAtlasDebugEnabled())return;const c={timestamp:new Date().toISOString(),...s};if(i==="error"){console.error(`[AF-FE] ${t}`,c);return}if(i==="warn"){console.warn(`[AF-FE] ${t}`,c);return}console.info(`[AF-FE] ${t}`,c)},trackAtlasEvent:function(i,t={}){if(typeof window.atlas!="object"){this.logAtlasDebug("warn","atlas object missing; event skipped",{eventName:i,payload:t});return}const s=window.atlas,c=Number(t.nvalue)||1;let l=null;this.logAtlasDebug("info","event dispatch attempt",{eventName:i,payload:t,nvalue:c,availableMethods:Object.keys(s).filter(f=>typeof s[f]=="function")});try{switch(i){case"JOINHIT":if(typeof s.joinHit=="function"){s.joinHit(t),l="joinHit",this.logAtlasDebug("info","event dispatch success",{eventName:i,methodUsed:l,payload:t});return}break;case"JOINSUBMIT":if(typeof s.joinSubmit=="function"){s.joinSubmit(c),l="joinSubmit",this.logAtlasDebug("info","event dispatch success",{eventName:i,methodUsed:l,nvalue:c,payload:t});return}break;case"GATEWAYHIT":if(typeof s.gatewayHit=="function"){s.gatewayHit(t),l="gatewayHit",this.logAtlasDebug("info","event dispatch success",{eventName:i,methodUsed:l,payload:t});return}break;case"GATEWAYSUBMIT":if(typeof s.gatewaySubmit=="function"){s.gatewaySubmit(),l="gatewaySubmit",this.logAtlasDebug("info","event dispatch success",{eventName:i,methodUsed:l});return}break;case"APPROVAL":if(typeof s.conversion=="function"){s.conversion("APPROVAL",c),l="conversion",this.logAtlasDebug("info","event dispatch success",{eventName:i,methodUsed:l,nvalue:c,payload:t});return}break;case"DENIAL":if(typeof s.denial=="function"){s.denial(),l="denial",this.logAtlasDebug("info","event dispatch success",{eventName:i,methodUsed:l});return}break;default:break}if(typeof s.track=="function"){s.track(i),l="track",this.logAtlasDebug("info","event dispatch success via fallback",{eventName:i,methodUsed:l,payload:t});return}this.logAtlasDebug("warn","no compatible atlas method found for event",{eventName:i,payload:t})}catch(f){this.logAtlasDebug("error","event dispatch failed",{eventName:i,methodUsed:l,payload:t,error:f?.message}),console.error("Atlas tracking failed:",f)}},isGatewayPage:function(){return window.location.pathname.toLowerCase().includes("gateway")},detectTransactionOutcome:function(){const i=`${window.location.pathname}${window.location.search}`.toLowerCase(),t=new URLSearchParams(window.location.search),s=t.get("payment-success"),c=t.get("atlasOutcome"),l=t.get("atlasGatewaySubmit");
2if(t.has("payment-success")){if(s==="1"||s==="true"){this.trackAtlasEvent("GATEWAYSUBMIT"),this.trackAtlasEvent("APPROVAL");return}this.trackAtlasEvent("DENIAL");return}if(l==="1"&&this.trackAtlasEvent("GATEWAYSUBMIT"),c==="approval"){this.trackAtlasEvent("APPROVAL");return}if(c==="denial"){this.trackAtlasEvent("DENIAL");return}if(i.includes("approval")||i.includes("approved")||i.includes("success")){this.trackAtlasEvent("APPROVAL");return}(i.includes("denial")||i.includes("denied")||i.includes("failed")||i.includes("failure"))&&this.trackAtlasEvent("DENIAL")},trackGatewayTransitionBeforeExit:function(i){this.trackAtlasEvent("GATEWAYHIT",{realEstate:this.currentRealEstate,destinationHost:this.safeExtractHost(i)})},safeExtractHost:function(i){if(!i)return null;try{return new URL(i,window.location.origin).hostname}catch(t){return this.logAtlasDebug("warn","failed to parse redirect url host",{redirectUrl:i,error:t?.message}),null}},redirectToGateway:function(i){this.trackGatewayTransitionBeforeExit(i),setTimeout(()=>{window.location.href=i},200)},init:function(){document.addEventListener("DOMContentLoaded",()=>{this.isGatewayPage()&&(this.trackAtlasEvent("GATEWAYHIT"),document.querySelectorAll("form").forEach(i=>{i.addEventListener("submit",()=>{this.trackAtlasEvent("GATEWAYSUBMIT")})})),this.detectTransactionOutcome()})},handlePaymentMethodSelection:async function(i,t,s,c){console.log("Selected payment method:",i,"payment type:",t,"for plan:",s,c),this.trackAtlasEvent("JOINSUBMIT",{nvalue:c||this.currentPlanData.price||1,realEstate:this.currentRealEstate});try{const l=await fetch("/api/payment/init",{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]')?.content||""},body:JSON.stringify({plan_id:s,payment_method:i,payment_type:t})});if(!l.ok){const S=await l.json();throw new Error(S.error||"Failed to initialize payment")}const f=l.headers.get("content-type");f&&f.includes("text/html")?this.handleHtmlResponse(await l.text()):this.handleJsonResponse(await l.json())}catch(l){throw console.error("Error initializing payment:",l.message),l}},handleHtmlResponse:function(i){const t=document.createElement("div");t.innerHTML=i;const s=t.querySelector("a[href]"),c=t.querySelector("form"),l=t.querySelector("[data-payment-url]")?.dataset.paymentUrl;if(s&&s.href)this.redirectToGateway(s.href);else if(l)this.redirectToGateway(l);else if(c)this.trackGatewayTransitionBeforeExit(c.action),document.body.appendChild(c),setTimeout(()=>{c.submit()},200);else{const f=window.open("","_blank");f?(f.document.write(i),f.document.close()):console.error("Popup blocked â unable to display payment page."),window.closeModal("select-payment-method")}},handleJsonResponse:function(i){i.payment_url||i.payurl?this.redirectToGateway(i.payment_url||i.payurl):(console.log("Payment initialized:",i),window.closeModal("select-payment-method"))}};window.PaymentFlow.init();function Je(i){return typeof i!="string"?!1:i==="/admin"||i.startsWith("/admin/")}const qe="cookie_consent";class Bt{constructor(){this.accordionInitialized=!1,this.isLoadingConsent=!1,this._backendConsentCache=null,this._backendConsentCacheAt=0;const t=window.location?.pathname||"";Je(t)||(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>this.init()):this.init())}init(){const t=this.hasConsentCookie(),s=this.shouldSkipAutoOpenForCurrentPath();t&&this.validateConsentWithBackend(),!t&&!s&&!window.modalManager?.isOpen?.("cookie-consent")&&window.openModal("cookie-consent"),this.attachEventListeners()}async getBackendConsentCached(){const s=Date.now();if(this._backendConsentCache&&s-this._backendConsentCacheAt<3e4)return this._backendConsentCache;const c=fetch("/api/cookie-consent",{method:"GET",headers:{"X-Requested-With":"XMLHttpRequest"},credentials:"same-origin"}).then(async l=>{if(l.status===204)return{status:204,ok:!0,consent:null};if(!l.ok)return{status:l.status,ok:!1,consent:null};const f=await l.json();return!f||Array.isArray(f)&&f.length===0||typeof f=="object"&&Object.keys(f).length===0?{status:204,ok:!0,consent:null}:{status:l.status,ok:!0,consent:f}}).catch(l=>({status:0,ok:!1,consent:null,error:l}));return this._backendConsentCache=c,this._backendConsentCacheAt=s,c}
2async validateConsentWithBackend(){try{const t=await this.getBackendConsentCached(),s=this.hasConsentCookie();if((t.status===204||!t.consent)&&s)console.warn("[CookieConsent] Cookie exists but no backend consent found - cookie will be deleted"),this.deleteEncryptedCookie(),!this.shouldSkipAutoOpenForCurrentPath()&&!window.modalManager?.isOpen?.("cookie-consent")&&window.openModal("cookie-consent");else if(t.ok&&s&&t.consent){const c=t.consent,l=this.getConsentFromCookie();l&&(l.analytics===c.analytics&&l.functional===c.functional&&l.targeting===c.targeting||(console.warn("[CookieConsent] Cookie tampering detected - values do not match backend"),console.log("[CookieConsent] Cookie:",l),console.log("[CookieConsent] Backend:",c)))}}catch(t){console.error("[CookieConsent] Failed to validate consent with backend:",t)}}hasConsentCookie(){const t=Ne(qe);if(!t)return!1;try{const s=decodeURIComponent(t);return s.startsWith("eyJ")&&s.includes("InZhbHVlIjo")?(console.warn("[CookieConsent] Found encrypted cookie, treating as non-existent"),this.deleteEncryptedCookie(),!1):(JSON.parse(s),!0)}catch{return this.deleteEncryptedCookie(),!1}}shouldSkipAutoOpenForCurrentPath(){const t=window.location?.pathname||"";return/^\/legal\/doc\/(privacy|tos)\/?$/.test(t)}attachEventListeners(){document.getElementById("cookie-consent-expand")?.addEventListener("click",()=>{this.expandBanner()}),document.getElementById("cookie-consent-close")?.addEventListener("click",()=>{this.collapseBanner()}),["cookie-consent-accept-all-initial","cookie-consent-accept-all"].forEach(t=>{document.getElementById(t)?.addEventListener("click",()=>{this.acceptAll()})}),document.getElementById("cookie-consent-save-and-apply")?.addEventListener("click",()=>{this.savePreferences()}),["cookie-consent-essential-only","cookie-consent-accept-essential"].forEach(t=>{document.getElementById(t)?.addEventListener("click",()=>{this.acceptEssentialOnly()})}),this.attachToggleSwitchListeners()}attachToggleSwitchListeners(){document.querySelectorAll("[data-toggle][data-cookie-option]").forEach(s=>{s.addEventListener("click",c=>{this.toggleSwitch(c.currentTarget)})})}toggleSwitch(t){if(this.isLoadingConsent){console.log("[CookieConsent] Ignoring toggle while loading consent");return}const c=!(t.getAttribute("aria-pressed")==="true");t.setAttribute("aria-pressed",String(c));const l=t.querySelector("span");c?(t.classList.remove("bg-white"),t.classList.add("bg-black"),l.classList.remove("bg-black"),l.classList.add("bg-white"),l.style.transform="translateX(1.25rem)"):(t.classList.remove("bg-black"),t.classList.add("bg-white"),l.classList.remove("bg-white"),l.classList.add("bg-black"),l.style.transform="translateX(0)")}getToggleState(t){const s=document.querySelector(`[data-cookie-option="${t}"]`);return s?s.getAttribute("aria-pressed")==="true":!1}setToggleState(t,s){const c=document.querySelector(`[data-cookie-option="${t}"]`);if(console.log(`[CookieConsent] Setting ${t} to ${s} (type: ${typeof s}), button found:`,!!c),!c){console.warn(`[CookieConsent] Toggle button not found for: ${t}`);return}const l=String(s);c.setAttribute("aria-pressed",l),console.log(`[CookieConsent] Set aria-pressed="${l}" for ${t}`);const f=c.querySelector("span");if(!f){console.warn(`[CookieConsent] Toggle span not found for: ${t}`);return}s?(c.classList.remove("bg-white"),c.classList.add("bg-black"),f.classList.remove("bg-black"),f.classList.add("bg-white"),f.style.transform="translateX(1.25rem)"):(c.classList.remove("bg-black"),c.classList.add("bg-white"),f.classList.remove("bg-white"),f.classList.add("bg-black"),f.style.transform="translateX(0)");const S=c.getAttribute("aria-pressed");console.log(`[CookieConsent] Final aria-pressed for ${t}: "${S}" (expected: "${l}")`)}expandBanner(){document.getElementById("cookie-consent-collapsed")?.classList.add("hidden"),document.getElementById("cookie-consent-expanded")?.classList.remove("hidden"),document.getElementById("cookie-consent-expanded")?.classList.add("flex"),document.getElementById("cookie-consent-initial-buttons")?.classList.add("hidden"),this.resetExpandedModalScroll(),this.setBackgroun
2dScrollLocked(!0),setTimeout(()=>{this.showLoadingIndicator(),this.loadExistingConsent()},50),this.initAccordion(),this.isMobileAccordionEnabled()&&this.toggleAccordion("functional")}showLoadingIndicator(){const t=document.getElementById("cookie-consent-loading");t&&(t.classList.remove("hidden"),t.classList.add("flex"))}hideLoadingIndicator(){const t=document.getElementById("cookie-consent-loading");t&&(t.classList.add("hidden"),t.classList.remove("flex"))}async loadExistingConsent(){this.isLoadingConsent=!0;try{const t=await this.getBackendConsentCached();if(t.status===204||!t.consent){console.log("[CookieConsent] No existing consent found in database, checking cookie"),this.loadConsentFromCookie();return}if(!t.ok){console.warn("[CookieConsent] Failed to fetch consent from backend, falling back to cookie"),this.loadConsentFromCookie();return}const s=t.consent;console.log("[CookieConsent] Loading existing preferences from backend:",s),this.setToggleState("analytics",s.analytics??!1),this.setToggleState("functional",s.functional??!1),this.setToggleState("targeting",s.targeting??!1)}catch(t){console.error("[CookieConsent] Error fetching consent from backend:",t),console.log("[CookieConsent] Falling back to cookie"),this.loadConsentFromCookie()}finally{this.isLoadingConsent=!1,this.hideLoadingIndicator()}}loadConsentFromCookie(){const t=this.getConsentFromCookie();t?(console.log("[CookieConsent] Loading preferences from cookie (fallback):",t),this.setToggleState("analytics",t.analytics??!1),this.setToggleState("functional",t.functional??!1),this.setToggleState("targeting",t.targeting??!1)):(console.log("[CookieConsent] No consent found in cookie either, initializing to default (all false)"),this.setToggleState("analytics",!1),this.setToggleState("functional",!1),this.setToggleState("targeting",!1))}collapseBanner(){document.getElementById("cookie-consent-expanded")?.classList.add("hidden"),document.getElementById("cookie-consent-expanded")?.classList.remove("flex"),document.getElementById("cookie-consent-initial-buttons")?.classList.remove("hidden"),document.getElementById("cookie-consent-collapsed")?.classList.remove("hidden"),this.resetExpandedModalScroll(),this.setBackgroundScrollLocked(!1)}async acceptEssentialOnly(){if(typeof window.atlas=="object"&&typeof window.atlas.setOnlyEssentialCookies=="function")try{window.atlas.setOnlyEssentialCookies(!0)}catch(t){console.error("[CookieConsent] Atlas: Failed to call setOnlyEssentialCookies(true)",t)}await this.submitConsent({necessary:!0,analytics:!1,functional:!1,targeting:!1}),setTimeout(()=>{window.location.reload()},100)}async acceptAll(){try{document.cookie.split(";").map(t=>t.trim()).map(t=>t.split("=")[0]).filter(t=>t.startsWith("atstrackPiece")).forEach(t=>{document.cookie=`${t}=; Max-Age=0; path=/; SameSite=Lax`})}catch(t){console.error("[CookieConsent] Failed to clear Atlas tracking cookies",t)}if(typeof window.atlas=="object"&&typeof window.atlas.setOnlyEssentialCookies=="function")try{window.atlas.setOnlyEssentialCookies(!1)}catch(t){console.error("[CookieConsent] Atlas: Failed to call setOnlyEssentialCookies(false)",t)}await this.submitConsent({necessary:!0,analytics:!0,functional:!0,targeting:!0}),setTimeout(()=>{window.location.reload()},100)}async savePreferences(){await this.submitConsent({necessary:!0,analytics:this.getToggleState("analytics"),functional:this.getToggleState("functional"),targeting:this.getToggleState("targeting")})}async submitConsent(t){try{const s=document.querySelector('meta[name="csrf-token"]')?.getAttribute("content");if(!s){this.showError("CSRF token not found");return}if(!(await fetch("/api/cookie-consent",{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":s,"X-Requested-With":"XMLHttpRequest"},credentials:"same-origin",body:JSON.stringify(t)})).ok){this.showError("Failed to save preferences");return}window.location.reload()}catch(s){console.error("[CookieConsent] Error:",s),this.showError("Failed to save preferences. Please try again.")}}showError(t){const s=document.createElement("div");s.className="fixed top-4 right-4 bg-red-500 text-white px-6 py-3 rounded-lg shadow-lg z-50",s.textContent=t,document.body.appendChild(s),setTimeout(()=>{s.remove()},5e3)}
2closeModal(){this.setBackgroundScrollLocked(!1),window.closeModal("cookie-consent")}resetExpandedModalScroll(){const t=document.getElementById("cookie-consent-expanded"),s=document.getElementById("cookie-consent-preferences-backdrop"),c=document.getElementById("cookie-consent-preferences-content");t&&(t.scrollTop=0),s&&(s.scrollTop=0),c&&(c.scrollTop=0)}setBackgroundScrollLocked(t){const s=document.body;if(s){if(t){if(s.dataset.cookieConsentScrollLocked==="true")return;s.dataset.cookieConsentScrollLocked="true",s.dataset.cookieConsentPrevOverflow=s.style.overflow||"",s.dataset.cookieConsentPrevTouchAction=s.style.touchAction||"",s.style.overflow="hidden",s.style.touchAction="none";return}s.dataset.cookieConsentScrollLocked==="true"&&(s.style.overflow=s.dataset.cookieConsentPrevOverflow||"",s.style.touchAction=s.dataset.cookieConsentPrevTouchAction||"",delete s.dataset.cookieConsentPrevOverflow,delete s.dataset.cookieConsentPrevTouchAction,delete s.dataset.cookieConsentScrollLocked)}}isMobileAccordionEnabled(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(max-width: 639px)").matches}initAccordion(){if(!this.isMobileAccordionEnabled()||this.accordionInitialized)return;this.accordionInitialized=!0,document.querySelectorAll("[data-cookie-accordion-trigger]").forEach(s=>{s.addEventListener("click",c=>{if(c.target?.closest?.("[data-toggle]"))return;const l=s.getAttribute("data-cookie-accordion-trigger");l&&this.toggleAccordion(l)}),s.addEventListener("keydown",c=>{if(c.key!=="Enter"&&c.key!==" ")return;c.preventDefault();const l=s.getAttribute("data-cookie-accordion-trigger");l&&this.toggleAccordion(l)})})}setAccordionOpen(t,s){const c=document.querySelector(`[data-cookie-accordion-trigger="${t}"]`),l=document.querySelector(`[data-cookie-accordion-panel="${t}"]`),f=document.querySelector(`[data-cookie-accordion-icon="${t}"]`);!c||!l||(c.setAttribute("aria-expanded",s?"true":"false"),l.classList.toggle("hidden",!s),f&&f.classList.toggle("rotate-180",s))}toggleAccordion(t){if(!this.isMobileAccordionEnabled())return;const c=document.querySelector(`[data-cookie-accordion-trigger="${t}"]`)?.getAttribute("aria-expanded")==="true";document.querySelectorAll("[data-cookie-accordion-trigger]").forEach(l=>{const f=l.getAttribute("data-cookie-accordion-trigger");f&&this.setAccordionOpen(f,!1)}),this.setAccordionOpen(t,!c)}getConsentFromCookie(){const t=Ne(qe);if(!t)return console.log("[CookieConsent] No cookie found"),null;try{const s=decodeURIComponent(t);return s.startsWith("eyJ")&&s.includes("InZhbHVlIjo")?(console.warn("[CookieConsent] Detected old encrypted cookie, deleting it..."),this.deleteEncryptedCookie(),null):JSON.parse(s)}catch(s){return console.error("[CookieConsent] Failed to parse cookie:",s),console.warn("[CookieConsent] Deleting invalid cookie..."),this.deleteEncryptedCookie(),null}}deleteEncryptedCookie(){document.cookie=`${qe}=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;`,console.log("[CookieConsent] Old cookie deleted. Please accept consent again.")}static openSettings(){window.openModal("cookie-consent")}}window.CookieConsentUI=Bt;document.addEventListener("DOMContentLoaded",()=>{const i=window.location?.pathname||"";Je(i)||(window.cookieConsentInstance=new Bt)});function Ut(){window.dispatchEvent(new CustomEvent("user-logged-in",{detail:{timestamp:new Date().toISOString()}}))}function Ht(){window.dispatchEvent(new CustomEvent("user-logged-out",{detail:{timestamp:new Date().toISOString()}}))}document.addEventListener("DOMContentLoaded",()=>{const i=sessionStorage.getItem("was_authenticated")==="true",s=document.querySelector('meta[name="user-authenticated"]')?.getAttribute("content")==="true";if(!i&&s){try{window.localStorage.removeItem("trial_countdown_banner_dismissed")}catch{console.log("Failed to remove trial countdown banner dismissed flag")}Ut()}i&&!s&&Ht(),sessionStorage.setItem("was_authenticated",s?"true":"false")});window.dispatchLoginEvent=Ut;window.dispatchLogoutEvent=Ht;const je="[data-featured-avatar-video]",Be=new WeakMap;function Ft(i){is(i,Be,"data-featured-avatar-hls-src")}function Ue(i){if(!i)return!1;const t=i.getAttribute("data-src");if(!t)return!1;if(rs(t)){if(ce.isSupported()){let s=Be.get(i);s||(s=new ce({enableWorker:!0,lowLatencyMode:!1}),s.on(ce.Events.ERROR,(c,l)=>
2{if(l?.fatal){try{if(l.type===ce.ErrorTypes.NETWORK_ERROR){s.startLoad();return}if(l.type===ce.ErrorTypes.MEDIA_ERROR){s.recoverMediaError();return}}catch{console.log("[thumb] fatal hls recovery failed")}Ft(i)}}),Be.set(i,s),s.attachMedia(i));try{i.getAttribute("data-featured-avatar-hls-src")!==t&&(s.loadSource(t),i.setAttribute("data-featured-avatar-hls-src",t))}catch{return console.log("[thumb] hls.loadSource failed"),!1}return!0}if(ss(i)){if(i.getAttribute("src")===t||i.getAttribute("src"))return!0;try{return i.src=t,typeof i.load=="function"&&i.load(),!0}catch{return console.log("[thumb] native hls set src/load failed"),!1}}return!1}if(i.getAttribute("src")===t||i.getAttribute("src"))return!0;try{return i.src=t,typeof i.load=="function"&&i.load(),!0}catch{return console.log("[thumb] non-hls set src/load failed"),!1}}function Os(){if(typeof window>"u"||typeof window.matchMedia!="function")return!1;const i=t=>{try{return window.matchMedia(t).matches}catch{return!1}};return i("(any-hover: hover)")||i("(hover: hover)")||i("(any-pointer: fine)")}function He(i){if(i){try{i.pause(),i.currentTime=0}catch{console.log("[thumb] pause/reset failed")}Ft(i);try{i.removeAttribute("src"),typeof i.load=="function"&&i.load()}catch{console.log("[thumb] clear src/load failed")}}}function Rs(i){i.forEach(t=>{He(t);const s=t.closest('a, button, [role="button"], .group')||t.parentElement;s&&(s.hasAttribute("data-featured-avatar-hover-bound")||(s.setAttribute("data-featured-avatar-hover-bound","true"),t.loop=!1,t.hasAttribute("data-featured-avatar-ended-replay-bound")||(t.setAttribute("data-featured-avatar-ended-replay-bound","true"),t.addEventListener("ended",()=>{if(s.matches(":hover")){try{t.currentTime=0}catch{console.log("[thumb] reset currentTime failed")}ue(t)}})),s.addEventListener("mouseenter",()=>{if(Ue(t))if(t.loop=!0,t.readyState>=3)ue(t);else{const c=()=>{t.removeEventListener("canplay",c),s.matches(":hover")&&ue(t)};t.addEventListener("canplay",c)}}),s.addEventListener("mouseleave",()=>{He(t),t.loop=!1})))})}function Ms(i){if(i.forEach(s=>{s.hasAttribute("data-featured-avatar-mobile-observed")||(s.setAttribute("data-featured-avatar-mobile-observed","true"),s.muted=!0,s.loop=!0,s.playsInline=!0,s.hasAttribute("data-featured-avatar-ended-bound")||(s.setAttribute("data-featured-avatar-ended-bound","true"),s.addEventListener("ended",()=>{s.setAttribute("data-featured-avatar-ended","true")})))}),typeof IntersectionObserver>"u"){i.forEach(s=>{Ue(s),ue(s)});return}const t=new IntersectionObserver(s=>{s.forEach(c=>{const l=c.target;if(c.isIntersecting)Ue(l),ue(l);else{try{l.pause()}catch{console.log("[thumb] pause failed")}He(l)}})},{threshold:.35});i.forEach(s=>t.observe(s))}function De(){if(typeof document>"u")return;const i=Array.from(document.querySelectorAll(je));if(i.length===0)return;const t=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(any-pointer: coarse)").matches;Os()||!t?Rs(i):Ms(i)}typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",De):De(),typeof MutationObserver<"u"&&new MutationObserver(t=>{for(const s of t)for(const c of s.addedNodes){if(!c||c.nodeType!==1)continue;const l=c;if(l.matches?.(je)||l.querySelector?.(je)){De();return}}}).observe(document.body,{childList:!0,subtree:!0}));const qs=.8,Tt=20,Lt="age-verification",we="age-verification-modal";function Ds(){if(typeof document>"u"||document.documentElement.hasAttribute("data-media-contextmenu-disabled"))return;document.documentElement.setAttribute("data-media-contextmenu-disabled","true");const i=c=>{if(c.target?.closest?.("img, picture, video")||c.target?.closest?.("#companionProfileGallery, #imageCarousel"))return!0;const l=typeof c.composedPath=="function"?c.composedPath():null;return Array.isArray(l)?l.some(f=>{if(!f||typeof f!="object"||!f.tagName)return!1;const S=String(f?.tagName).toLowerCase();return S==="img"||S==="picture"||S==="video"}):!1},t=c=>!c||c.nodeType!==1?!1:!!c.closest('input, textarea, select, [contenteditable="true"], pre, code'),s=c=>{if(!c||c.nodeType!==1)return!1;let l=c,f=0;for(;l&&f<6;){if(l.hasAttribute("data-allow-contextmenu"))return!1;const S=window.getComputedStyle(l).backgroundImage;if(S&&S!=="none"&&S.includes("url("))return!0;l=l.parentElement,f+=1}return!1};document.addEventListener("contextmenu",c=>{const l=c.target;if(l&&!t(l)&&!l.closest("[data-allow-contextmenu]")){if(i(c)){c.preventDefault();return}s(l)&&c.preventDefault()}},{capture:!0}),document.addEventListener("dragstart",c=>{c.target&&i(c)&&c.preventDefault()},{capture:!0})}function Ns(){const i=document.querySelector("[data-auto-open-modal]");if(!i)return;const t=i.getAttribute("data-auto-open-modal");if(!t)return;const s=document.querySelector(`[data-modal-name="${t}"]`);s&&(s.style.display="block",s.classList.add("modal-show"))}function js(){if(typeof window>"u")return;const i=window.location?.pathname||"";if(Je(i)||/^\/legal\/doc\/tos\/?$/.test(i)||!document.querySelector(`[data-modal-name="${we}"]`))return;const c=document.getElementById("age-verification-enter"),l=document.getElementById("age-verification-exit");if(!c||!l)return;const f=()=>{const k=Ne(Lt);return k==="true"},S=k=>{try{ns(Lt,k?"true":"false",{maxAgeSeconds:null})}catch{console.log("Failed to set age verification cookie")}},L=()=>{document.documentElement.classList.remove("age-gate-pending")};
2f()?L():window.modalManager?.isOpen?.(we)||window.openModal(we),c.hasAttribute("data-age-verification-bound")||(c.setAttribute("data-age-verification-bound","true"),c.addEventListener("click",()=>{S(!0),L(),window.closeModal(we)})),l.hasAttribute("data-age-verification-bound")||(l.setAttribute("data-age-verification-bound","true"),l.addEventListener("click",()=>{const k=l.getAttribute("data-exit-url");if(k){window.location.href=k;return}let E="about:blank";if(document.referrer)try{const A=new URL(document.referrer);A.origin!==window.location.origin&&(E=A.href)}catch{}window.location.href=E}))}function Bs(){if(typeof window>"u"||!(window.location?.pathname||"").endsWith("/legal/content-removal"))return;const s=new URLSearchParams(window.location.search).get("content_url");if(!s)return;const c=document.getElementById("content-url");if(c&&!c.value)try{c.value=decodeURIComponent(s)}catch{c.value=s}}function xt(i,t){t?(i.classList.add("opacity-0","invisible"),i.classList.remove("opacity-100","visible")):(i.classList.remove("opacity-0","invisible"),i.classList.add("opacity-100","visible"))}function he(i){const t=document.getElementById(i),s=document.querySelector(`.left-arrow[data-row="${i}"]`),c=document.querySelector(`.right-arrow[data-row="${i}"]`);if(!t||!s||!c)return;const l=t.scrollLeft<Tt,f=t.scrollWidth<=t.clientWidth+t.scrollLeft+Tt;xt(s,l),xt(c,f)}window.scrollCompanionsRow=function(i,t){const s=document.getElementById(i);if(!s)return;const c=s.offsetWidth*qs;he(i),s.scrollBy({left:c*t,behavior:"smooth"}),setTimeout(()=>he(i),300)};window.filterCompanions=function(i){document.querySelectorAll("[data-category].relative").forEach(t=>{i==="all"||t.dataset.category===i?t.style.display="block":t.style.display="none"}),document.querySelectorAll("[data-carousel-row]").forEach(t=>{he(t.id)})};window.setActiveFilter=function(i,t){document.querySelectorAll(".filter-btn").forEach(s=>{s.classList.remove("text-yellow","border-yellow"),s.classList.add("bg-secondary-button","text-secondary-button","border-secondary-button")}),i.classList.remove("bg-secondary-button","text-secondary-button","border-secondary-button"),i.classList.add("text-yellow","border-yellow"),filterCompanions(t)};function Us(){const i=document.getElementById("user-menu-button"),t=document.getElementById("user-dropdown");!i||!t||(i.addEventListener("click",s=>{s.stopPropagation();const c=i.getAttribute("aria-expanded")==="true";i.setAttribute("aria-expanded",!c),t.classList.toggle("hidden",c),t.classList.toggle("block",!c)}),document.addEventListener("click",s=>{!i.contains(s.target)&&!t.contains(s.target)&&(i.setAttribute("aria-expanded","false"),t.classList.add("hidden"),t.classList.remove("block"))}),document.addEventListener("keydown",s=>{s.key==="Escape"&&i.getAttribute("aria-expanded")==="true"&&(i.setAttribute("aria-expanded","false"),t.classList.add("hidden"),t.classList.remove("block"))}))}window.imageLoaded=function(i){const t=i.closest('[id^="container-"]');if(!t)return;const s=t.querySelector(".bg-gray-800");s&&(t.offsetHeight,s.style.transition="opacity 300ms ease-out",s.style.opacity="0",i.style.transition="opacity 500ms ease-out, transform 500ms ease-out",i.style.opacity="1",i.style.transform="scale(1)",setTimeout(()=>{s&&s.parentNode&&(s.style.display="none")},300))};window.imageLoadError=function(i){const t=i.closest('[id^="container-"]');if(!t)return;const s=t.querySelector(".bg-gray-800");s&&(s.style.display="none"),i.style.opacity="1",i.style.transform="scale(1)"};function zt(i=document){i.querySelectorAll('img[data-image-with-skeleton][id^="img-"]:not([data-image-initialized])').forEach(t=>{t.setAttribute("data-image-initialized","true");let s=!1;const c=()=>{t.removeEventListener("load",l),t.removeEventListener("error",f)},l=()=>{s||(s=!0,c(),window.imageLoaded(t))},f=()=>{s||(s=!0,c(),window.imageLoadError(t))};t.addEventListener("load",l,{once:!0}),t.addEventListener("error",f,{once:!0}),t.complete&&(t.naturalWidth>0?l():f())})}const Hs=new MutationObserver(i=>{i.forEach(t=>{t.addedNodes.length&&t.addedNodes.forEach(s=>{s.nodeType===1&&zt(s)})})});Hs.observe(document.body,{childList:!0,subtree:!0});document.addEventListener("DOMContentLoaded",()=>{Us(),zt(),Bs(),Ns(),js(),Ds(),document.querySelectorAll("video[autoplay]").forEach(t=>{if(!t.hasAttribute("data-featured-avatar-video"))try{const s=t.play();s&&typeof s.catch=="function"&&s.catch(()=>{t.autoplay=!1,t.removeAttribute("autoplay"),t.hasAttribute("data-autoplay-fallback-controls")?t.controls=!0:(t.controls=!1,t.removeAttribute("controls"))})}catch{t.autoplay=!1,t.removeAttribute("autoplay"),t.hasAttribute("data-autoplay-fallback-controls")?t.controls=!0:(t.controls=!1,t.removeAttribute("controls"))}}),document.querySelectorAll("input[data-password-strength]").forEach(t=>{const s=t.getAttribute("data-password-error-target"),c=s?document.getElementById(s):null,f=(t.getAttribute("data-password-backend-error-targets")||"").split(",").map(C=>
2C.trim()).filter(Boolean);let S=!1;const L=C=>{if(!C)return;const _=C.value.replace(/\s+/g,"");_!==C.value&&(C.value=_)},k=C=>{!C||C.hasAttribute("data-no-spaces-bound")||(C.setAttribute("data-no-spaces-bound","true"),C.addEventListener("keydown",_=>{_.key===" "&&_.preventDefault()}),C.addEventListener("input",()=>L(C)),C.addEventListener("paste",()=>setTimeout(()=>L(C),0)))};k(t);const E=t.closest("form");E&&k(E.querySelector('input[name="password_confirmation"]'));const A=C=>{const _=[];return C.length<6&&_.push("length"),/\s/.test(C)&&_.push("whitespace"),/[A-Za-z]/.test(C)||_.push("letter"),/[0-9]/.test(C)||_.push("number"),{isValid:_.length===0,errors:_}},F=C=>{f.forEach(_=>{const R=document.getElementById(_);R&&(C?R.classList.add("hidden"):R.classList.remove("hidden"))})},w=({forceShow:C=!1}={})=>{if(!c)return;const _=t.value.length===0,{isValid:R}=A(t.value),y=t.hasAttribute("required")&&_||!_&&!R,d=C||S?y:!1;F(d),d?c.classList.remove("hidden"):c.classList.add("hidden")};t.addEventListener("input",()=>{S=!0,w()}),t.addEventListener("blur",()=>{S=!0,w()}),w();const x=t.closest("form");x&&!x.hasAttribute("data-password-strength-bound")&&(x.setAttribute("data-password-strength-bound","true"),x.addEventListener("submit",C=>{const _=x.querySelectorAll("input[data-password-strength]");let R=null;_.forEach(z=>{const y=z.getAttribute("data-password-error-target"),d=y?document.getElementById(y):null,m=(z.getAttribute("data-password-backend-error-targets")||"").split(",").map(B=>B.trim()).filter(Boolean),I=B=>{m.forEach(U=>{const W=document.getElementById(U);W&&(B?W.classList.add("hidden"):W.classList.remove("hidden"))})},q=z.value.length===0,{isValid:D}=A(z.value);z.hasAttribute("required")&&q||!q&&!D?(d&&d.classList.remove("hidden"),I(!0),R||(R=z)):I(!1)}),R&&(C.preventDefault(),R.focus())}))});const i=document.querySelector(".filter-btn");i&&(i.classList.add("text-yellow","border-yellow"),i.classList.remove("bg-secondary-button","text-secondary-button","border-secondary-button")),typeof filterCompanions=="function"&&filterCompanions("all"),document.querySelectorAll("[data-carousel-row]").forEach(t=>{const s=t.id;if(s){let c;const l=()=>{clearTimeout(c),c=setTimeout(()=>he(s),100)};he(s),t.addEventListener("scroll",l),t._cleanup=()=>{t.removeEventListener("scroll",l),delete t._cleanup}}})});const Fs=new MutationObserver(i=>{i.forEach(t=>{t.removedNodes.forEach(s=>{s.nodeType===1&&(s._cleanup&&s._cleanup(),s.querySelectorAll("[data-carousel-row]").forEach(c=>{c._cleanup&&c._cleanup()}))})})});Fs.observe(document.body,{childList:!0,subtree:!0});
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.