function mn(s,t){return function(){return s.apply(t,arguments)}}const{toString:Js}=Object.prototype,{getPrototypeOf:bt}=Object,{iterator:$e,toStringTag:gn}=Symbol,Je=(s=>t=>{const i=Js.call(t);return s[i]||(s[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Y=s=>(s=s.toLowerCase(),t=>Je(t)===s),Xe=s=>t=>typeof t===s,{isArray:be}=Array,ge=Xe("undefined");function Te(s){return s!==null&&!ge(s)&&s.constructor!==null&&!ge(s.constructor)&&V(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const bn=Y("ArrayBuffer");function Xs(s){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(s):t=s&&s.buffer&&bn(s.buffer),t}const Ws=Xe("string"),V=Xe("function"),yn=Xe("number"),Ee=s=>s!==null&&typeof s=="object",Vs=s=>s===!0||s===!1,qe=s=>{if(Je(s)!=="object")return!1;const t=bt(s);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(gn in s)&&!($e in s)},Ks=s=>{if(!Ee(s)||Te(s))return!1;try{return Object.keys(s).length===0&&Object.getPrototypeOf(s)===Object.prototype}catch{return!1}},Gs=Y("Date"),Qs=Y("File"),Ys=Y("Blob"),Zs=Y("FileList"),ei=s=>Ee(s)&&V(s.pipe),ti=s=>{let t;return s&&(typeof FormData=="function"&&s instanceof FormData||V(s.append)&&((t=Je(s))==="formdata"||t==="object"&&V(s.toString)&&s.toString()==="[object FormData]"))},ni=Y("URLSearchParams"),[ri,si,ii,oi]=["ReadableStream","Request","Response","Headers"].map(Y),ai=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ke(s,t,{allOwnKeys:i=!1}={}){if(s===null||typeof s>"u")return;let o,c;if(typeof s!="object"&&(s=[s]),be(s))for(o=0,c=s.length;o0;)if(c=i[o],t===c.toLowerCase())return c;return null}const he=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,wn=s=>!ge(s)&&s!==he;function ft(){const{caseless:s,skipUndefined:t}=wn(this)&&this||{},i={},o=(c,h)=>{const l=s&&vn(i,h)||h;qe(i[l])&&qe(c)?i[l]=ft(i[l],c):qe(c)?i[l]=ft({},c):be(c)?i[l]=c.slice():(!t||!ge(c))&&(i[l]=c)};for(let c=0,h=arguments.length;c(ke(t,(c,h)=>{i&&V(c)?Object.defineProperty(s,h,{value:mn(c,i),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(s,h,{value:c,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),s),ui=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),li=(s,t,i,o)=>{s.prototype=Object.create(t.prototype,o),Object.defineProperty(s.prototype,"constructor",{value:s,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(s,"super",{value:t.prototype}),i&&Object.assign(s.prototype,i)},hi=(s,t,i,o)=>{let c,h,l;const p={};if(t=t||{},s==null)return t;do{for(c=Object.getOwnPropertyNames(s),h=c.length;h-- >0;)l=c[h],(!o||o(l,s,t))&&!p[l]&&(t[l]=s[l],p[l]=!0);s=i!==!1&&bt(s)}while(s&&(!i||i(s,t))&&s!==Object.prototype);return t},di=(s,t,i)=>{s=String(s),(i===void 0||i>s.length)&&(i=s.length),i-=t.length;const o=s.indexOf(t,i);return o!==-1&&o===i},fi=s=>{if(!s)return null;if(be(s))return s;let t=s.length;if(!yn(t))return null;const i=new Array(t);for(;t-- >0;)i[t]=s[t];return i},pi=(s=>t=>s&&t instanceof s)(typeof Uint8Array<"u"&&bt(Uint8Array)),mi=(s,t)=>{const o=(s&&s[$e]).call(s);let c;for(;(c=o.next())&&!c.done;){const h=c.value;t.call(s,h[0],h[1])}},gi=(s,t)=>{let i;const o=[];for(;(i=s.exec(t))!==null;)o.push(i);return o},bi=Y("HTMLFormElement"),yi=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,o,c){return o.toUpperCase()+c}),Gt=(({hasOwnProperty:s})=>(t,i)=>s.call(t,i))(Object.prototype),vi=Y("RegExp"),Sn=(s,t)=>{const i=Object.getOwnPropertyDescriptors(s),o={};ke(i,(c,h)=>{let l;(l=t(c,h,s))!==!1&&(o[h]=l||c)}),Object.defineProperties(s,o)},wi=s=>{Sn(s,(t,i)=>{if(V(s)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const o=s[i];if(V(o)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},Si=(s,t)=>{const i={},o=c=>{c.forEach(h=>{i[h]=!0})};return be(s)?o(s):o(String(s).split(t)),i},_i=()=>{},Ci=(s,t)=>s!=null&&Number.isFinite(s=+s)?s:t;function Ti(s){return!!(s&&V(s.append)&&s[gn]==="FormData"&&s[$e])}const Ei=s=>{const t=new Array(10),i=(o,c)=>{if(Ee(o)){if(t.indexOf(o)>=0)return;if(Te(o))return o;if(!("toJSON"in o)){t[c]=o;const h=be(o)?[]:{};return ke(o,(l,p)=>{const y=i(l,c+1);!ge(y)&&(h[p]=y)}),t[c]=void 0,h}}return o};return i(s,0)},ki=Y("AsyncFunction"),xi=s=>s&&(Ee(s)||V(s))&&V(s.then)&&V(s.catch),_n=((s,t)=>s?setImmediate:t?((i,o)=>(he.addEventListener("message",({source:c,data:h})=>{c===he&&h===i&&o.length&&o.shift()()},!1),c=>{o.push(c),he.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",V(he.postMessage)),Ri=typeof queueMicrotask<"u"?queueMicrotask.bind(he):typeof process<"u"&&process.nextTick||_n,Oi=s=>s!=null&&V(s[$e]),d={isArray:be,isArrayBuffer:bn,isBuffer:Te,isFormData:ti,isArrayBufferView:Xs,isString:Ws,isNumber:yn,isBoolean:Vs,isObject:Ee,isPlainObject:qe,isEmptyObject:Ks,isReadableStream:ri,isRequest:si,isResponse:ii,isHeaders:oi,isUndefined:ge,isDate:Gs,isFile:Qs,isBlob:Ys,isRegExp:vi,isFunction:V,isStream:ei,isURLSearchParams:ni,isTypedArray:pi,isFileList:Zs,forEach:ke,merge:ft,extend:ci,trim:ai,stripBOM:ui,inherits:li,toFlatObject:hi,kindOf:Je,kindOfTest:Y,endsWith:di,toArray:fi,forEachEntry:mi,matchAll:gi,isHTMLForm:bi,hasOwnProperty:Gt,hasOwnProp:Gt,reduceDescriptors:Sn,freezeMethods:wi,toObjectSet:Si,toCamelCase:yi,noop:_i,toFiniteNumber:Ci,findKey:vn,global:he,isContextDefined:wn,isSpecCompliantForm:Ti,toJSONObject:Ei,isAsyncFn:ki,isThenable:xi,setImmediate:_n,asap:Ri,isIterable:Oi};let R=class Cn extends Error{static from(t,i,o,c,h,l){const p=new Cn(t.message,i||t.code,o,c,h);return p.cause=t,p.name=t.name,l&&Object.assign(p,l),p}constructor(t,i,o,c,h){super(t),this.name="AxiosError",this.isAxiosError=!0,i&&(this.code=i),o&&(this.config=o),c&&(this.request=c),h&&(this.response=h,this.status=h.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:d.toJSONObject(this.config),code:this.code,status:this.status}}};R.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";R.ERR_BAD_OPTION="ERR_BAD_OPTION";R.ECONNABORTED="ECONNABORTED";R.ETIMEDOUT="ETIMEDOUT";R.ERR_NETWORK="ERR_NETWORK";R.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";R.ERR_DEPRECATED="ERR_DEPRECATED";R.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";R.ERR_BAD_REQUEST="ERR_BAD_REQUEST";R.ERR_CANCELED="ERR_CANCELED";R.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";R.ERR_INVALID_URL="ERR_INVALID_URL";const Pi=null;function pt(s){return d.isPlainObject(s)||d.isArray(s)}function Tn(s){return d.endsWith(s,"[]")?s.slice(0,-2):s}function Qt(s,t,i){return s?s.concat(t).map(function(c,h){return c=Tn(c),!i&&h?"["+c+"]":c}).join(i?".":""):t}function Ai(s){return d.isArray(s)&&!s.some(pt)}const Li=d.toFlatObject(d,{},null,function(t){return/^is[A-Z]/.test(t)});function We(s,t,i){if(!d.isObject(s))throw new TypeError("target must be an object");t=t||new FormData,i=d.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,f){return!d.isUndefined(f[v])});const o=i.metaTokens,c=i.visitor||b,h=i.dots,l=i.indexes,y=(i.Blob||typeof Blob<"u"&&Blob)&&d.isSpecCompliantForm(t);if(!d.isFunction(c))throw new TypeError("visitor must be a function");function w(g){if(g===null)return"";if(d.isDate(g))return g.toISOString();if(d.isBoolean(g))return g.toString();if(!y&&d.isBlob(g))throw new R("Blob is not supported. Use a Buffer instead.");return d.isArrayBuffer(g)||d.isTypedArray(g)?y&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function b(g,v,f){let S=g;if(g&&!f&&typeof g=="object"){if(d.endsWith(v,"{}"))v=o?v:v.slice(0,-2),g=JSON.stringify(g);else if(d.isArray(g)&&Ai(g)||(d.isFileList(g)||d.endsWith(v,"[]"))&&(S=d.toArray(g)))return v=Tn(v),S.forEach(function(O,N){!(d.isUndefined(O)||O===null)&&t.append(l===!0?Qt([v],N,h):l===null?v:v+"[]",w(O))}),!1}return pt(g)?!0:(t.append(Qt(f,v,h),w(g)),!1)}const C=[],T=Object.assign(Li,{defaultVisitor:b,convertValue:w,isVisitable:pt});function x(g,v){if(!d.isUndefined(g)){if(C.indexOf(g)!==-1)throw Error("Circular reference detected in "+v.join("."));C.push(g),d.forEach(g,function(S,k){(!(d.isUndefined(S)||S===null)&&c.call(t,S,d.isString(k)?k.trim():k,v,T))===!0&&x(S,v?v.concat(k):[k])}),C.pop()}}if(!d.isObject(s))throw new TypeError("data must be an object");return x(s),t}function Yt(s){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(o){return t[o]})}function yt(s,t){this._pairs=[],s&&We(s,this,t)}const En=yt.prototype;En.append=function(t,i){this._pairs.push([t,i])};En.toString=function(t){const i=t?function(o){return t.call(this,o,Yt)}:Yt;return this._pairs.map(function(c){return i(c[0])+"="+i(c[1])},"").join("&")};function Ni(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function kn(s,t,i){if(!t)return s;const o=i&&i.encode||Ni,c=d.isFunction(i)?{serialize:i}:i,h=c&&c.serialize;let l;if(h?l=h(t,c):l=d.isURLSearchParams(t)?t.toString():new yt(t,c).toString(o),l){const p=s.indexOf("#");p!==-1&&(s=s.slice(0,p)),s+=(s.indexOf("?")===-1?"?":"&")+l}return s}class Zt{constructor(){this.handlers=[]}use(t,i,o){return this.handlers.push({fulfilled:t,rejected:i,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){d.forEach(this.handlers,function(o){o!==null&&t(o)})}}const xn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ii=typeof URLSearchParams<"u"?URLSearchParams:yt,Ui=typeof FormData<"u"?FormData:null,ji=typeof Blob<"u"?Blob:null,Di={isBrowser:!0,classes:{URLSearchParams:Ii,FormData:Ui,Blob:ji},protocols:["http","https","file","blob","url","data"]},vt=typeof window<"u"&&typeof document<"u",mt=typeof navigator=="object"&&navigator||void 0,Fi=vt&&(!mt||["ReactNative","NativeScript","NS"].indexOf(mt.product)<0),qi=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Bi=vt&&window.location.href||"http://localhost",Hi=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:vt,hasStandardBrowserEnv:Fi,hasStandardBrowserWebWorkerEnv:qi,navigator:mt,origin:Bi},Symbol.toStringTag,{value:"Module"})),$={...Hi,...Di};function Mi(s,t){return We(s,new $.classes.URLSearchParams,{visitor:function(i,o,c,h){return $.isNode&&d.isBuffer(i)?(this.append(o,i.toString("base64")),!1):h.defaultVisitor.apply(this,arguments)},...t})}function zi(s){return d.matchAll(/\w+|\[(\w*)]/g,s).map(t=>t[0]==="[]"?"":t[1]||t[0])}function $i(s){const t={},i=Object.keys(s);let o;const c=i.length;let h;for(o=0;o=i.length;return l=!l&&d.isArray(c)?c.length:l,y?(d.hasOwnProp(c,l)?c[l]=[c[l],o]:c[l]=o,!p):((!c[l]||!d.isObject(c[l]))&&(c[l]=[]),t(i,o,c[l],h)&&d.isArray(c[l])&&(c[l]=$i(c[l])),!p)}if(d.isFormData(s)&&d.isFunction(s.entries)){const i={};return d.forEachEntry(s,(o,c)=>{t(zi(o),c,i,0)}),i}return null}function Ji(s,t,i){if(d.isString(s))try{return(t||JSON.parse)(s),d.trim(s)}catch(o){if(o.name!=="SyntaxError")throw o}return(i||JSON.stringify)(s)}const xe={transitional:xn,adapter:["xhr","http","fetch"],transformRequest:[function(t,i){const o=i.getContentType()||"",c=o.indexOf("application/json")>-1,h=d.isObject(t);if(h&&d.isHTMLForm(t)&&(t=new FormData(t)),d.isFormData(t))return c?JSON.stringify(Rn(t)):t;if(d.isArrayBuffer(t)||d.isBuffer(t)||d.isStream(t)||d.isFile(t)||d.isBlob(t)||d.isReadableStream(t))return t;if(d.isArrayBufferView(t))return t.buffer;if(d.isURLSearchParams(t))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let p;if(h){if(o.indexOf("application/x-www-form-urlencoded")>-1)return Mi(t,this.formSerializer).toString();if((p=d.isFileList(t))||o.indexOf("multipart/form-data")>-1){const y=this.env&&this.env.FormData;return We(p?{"files[]":t}:t,y&&new y,this.formSerializer)}}return h||c?(i.setContentType("application/json",!1),Ji(t)):t}],transformResponse:[function(t){const i=this.transitional||xe.transitional,o=i&&i.forcedJSONParsing,c=this.responseType==="json";if(d.isResponse(t)||d.isReadableStream(t))return t;if(t&&d.isString(t)&&(o&&!this.responseType||c)){const l=!(i&&i.silentJSONParsing)&&c;try{return JSON.parse(t,this.parseReviver)}catch(p){if(l)throw p.name==="SyntaxError"?R.from(p,R.ERR_BAD_RESPONSE,this,null,this.response):p}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:$.classes.FormData,Blob:$.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};d.forEach(["delete","get","head","post","put","patch"],s=>{xe.headers[s]={}});const Xi=d.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Wi=s=>{const t={};let i,o,c;return s&&s.split(` `).forEach(function(l){c=l.indexOf(":"),i=l.substring(0,c).trim().toLowerCase(),o=l.substring(c+1).trim(),!(!i||t[i]&&Xi[i])&&(i==="set-cookie"?t[i]?t[i].push(o):t[i]=[o]:t[i]=t[i]?t[i]+", "+o:o)}),t},en=Symbol("internals");function Ce(s){return s&&String(s).trim().toLowerCase()}function Be(s){return s===!1||s==null?s:d.isArray(s)?s.map(Be):String(s)}function Vi(s){const t=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=i.exec(s);)t[o[1]]=o[2];return t}const Ki=s=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(s.trim());function ut(s,t,i,o,c){if(d.isFunction(o))return o.call(this,t,i);if(c&&(t=i),!!d.isString(t)){if(d.isString(o))return t.indexOf(o)!==-1;if(d.isRegExp(o))return o.test(t)}}function Gi(s){return s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,i,o)=>i.toUpperCase()+o)}function Qi(s,t){const i=d.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(s,o+i,{value:function(c,h,l){return this[o].call(this,t,c,h,l)},configurable:!0})})}let K=class{constructor(t){t&&this.set(t)}set(t,i,o){const c=this;function h(p,y,w){const b=Ce(y);if(!b)throw new Error("header name must be a non-empty string");const C=d.findKey(c,b);(!C||c[C]===void 0||w===!0||w===void 0&&c[C]!==!1)&&(c[C||y]=Be(p))}const l=(p,y)=>d.forEach(p,(w,b)=>h(w,b,y));if(d.isPlainObject(t)||t instanceof this.constructor)l(t,i);else if(d.isString(t)&&(t=t.trim())&&!Ki(t))l(Wi(t),i);else if(d.isObject(t)&&d.isIterable(t)){let p={},y,w;for(const b of t){if(!d.isArray(b))throw TypeError("Object iterator must return a key-value pair");p[w=b[0]]=(y=p[w])?d.isArray(y)?[...y,b[1]]:[y,b[1]]:b[1]}l(p,i)}else t!=null&&h(i,t,o);return this}get(t,i){if(t=Ce(t),t){const o=d.findKey(this,t);if(o){const c=this[o];if(!i)return c;if(i===!0)return Vi(c);if(d.isFunction(i))return i.call(this,c,o);if(d.isRegExp(i))return i.exec(c);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,i){if(t=Ce(t),t){const o=d.findKey(this,t);return!!(o&&this[o]!==void 0&&(!i||ut(this,this[o],o,i)))}return!1}delete(t,i){const o=this;let c=!1;function h(l){if(l=Ce(l),l){const p=d.findKey(o,l);p&&(!i||ut(o,o[p],p,i))&&(delete o[p],c=!0)}}return d.isArray(t)?t.forEach(h):h(t),c}clear(t){const i=Object.keys(this);let o=i.length,c=!1;for(;o--;){const h=i[o];(!t||ut(this,this[h],h,t,!0))&&(delete this[h],c=!0)}return c}normalize(t){const i=this,o={};return d.forEach(this,(c,h)=>{const l=d.findKey(o,h);if(l){i[l]=Be(c),delete i[h];return}const p=t?Gi(h):String(h).trim();p!==h&&delete i[h],i[p]=Be(c),o[p]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const i=Object.create(null);return d.forEach(this,(o,c)=>{o!=null&&o!==!1&&(i[c]=t&&d.isArray(o)?o.join(", "):o)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,i])=>t+": "+i).join(` `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...i){const o=new this(t);return i.forEach(c=>o.set(c)),o}static accessor(t){const o=(this[en]=this[en]={accessors:{}}).accessors,c=this.prototype;function h(l){const p=Ce(l);o[p]||(Qi(c,l),o[p]=!0)}return d.isArray(t)?t.forEach(h):h(t),this}};K.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);d.reduceDescriptors(K.prototype,({value:s},t)=>{let i=t[0].toUpperCase()+t.slice(1);return{get:()=>s,set(o){this[i]=o}}});d.freezeMethods(K);function lt(s,t){const i=this||xe,o=t||i,c=K.from(o.headers);let h=o.data;return d.forEach(s,function(p){h=p.call(i,h,c.normalize(),t?t.status:void 0)}),c.normalize(),h}function On(s){return!!(s&&s.__CANCEL__)}let Re=class extends R{constructor(t,i,o){super(t??"canceled",R.ERR_CANCELED,i,o),this.name="CanceledError",this.__CANCEL__=!0}};function Pn(s,t,i){const o=i.config.validateStatus;!i.status||!o||o(i.status)?s(i):t(new R("Request failed with status code "+i.status,[R.ERR_BAD_REQUEST,R.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function Yi(s){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return t&&t[1]||""}function Zi(s,t){s=s||10;const i=new Array(s),o=new Array(s);let c=0,h=0,l;return t=t!==void 0?t:1e3,function(y){const w=Date.now(),b=o[h];l||(l=w),i[c]=y,o[c]=w;let C=h,T=0;for(;C!==c;)T+=i[C++],C=C%s;if(c=(c+1)%s,c===h&&(h=(h+1)%s),w-l{i=b,c=null,h&&(clearTimeout(h),h=null),s(...w)};return[(...w)=>{const b=Date.now(),C=b-i;C>=o?l(w,b):(c=w,h||(h=setTimeout(()=>{h=null,l(c)},o-C)))},()=>c&&l(c)]}const Me=(s,t,i=3)=>{let o=0;const c=Zi(50,250);return eo(h=>{const l=h.loaded,p=h.lengthComputable?h.total:void 0,y=l-o,w=c(y),b=l<=p;o=l;const C={loaded:l,total:p,progress:p?l/p:void 0,bytes:y,rate:w||void 0,estimated:w&&p&&b?(p-l)/w:void 0,event:h,lengthComputable:p!=null,[t?"download":"upload"]:!0};s(C)},i)},tn=(s,t)=>{const i=s!=null;return[o=>t[0]({lengthComputable:i,total:s,loaded:o}),t[1]]},nn=s=>(...t)=>d.asap(()=>s(...t)),to=$.hasStandardBrowserEnv?((s,t)=>i=>(i=new URL(i,$.origin),s.protocol===i.protocol&&s.host===i.host&&(t||s.port===i.port)))(new URL($.origin),$.navigator&&/(msie|trident)/i.test($.navigator.userAgent)):()=>!0,no=$.hasStandardBrowserEnv?{write(s,t,i,o,c,h,l){if(typeof document>"u")return;const p=[`${s}=${encodeURIComponent(t)}`];d.isNumber(i)&&p.push(`expires=${new Date(i).toUTCString()}`),d.isString(o)&&p.push(`path=${o}`),d.isString(c)&&p.push(`domain=${c}`),h===!0&&p.push("secure"),d.isString(l)&&p.push(`SameSite=${l}`),document.cookie=p.join("; ")},read(s){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+s+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(s){this.write(s,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function ro(s){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function so(s,t){return t?s.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):s}function An(s,t,i){let o=!ro(t);return s&&(o||i==!1)?so(s,t):t}const rn=s=>s instanceof K?{...s}:s;function fe(s,t){t=t||{};const i={};function o(w,b,C,T){return d.isPlainObject(w)&&d.isPlainObject(b)?d.merge.call({caseless:T},w,b):d.isPlainObject(b)?d.merge({},b):d.isArray(b)?b.slice():b}function c(w,b,C,T){if(d.isUndefined(b)){if(!d.isUndefined(w))return o(void 0,w,C,T)}else return o(w,b,C,T)}function h(w,b){if(!d.isUndefined(b))return o(void 0,b)}function l(w,b){if(d.isUndefined(b)){if(!d.isUndefined(w))return o(void 0,w)}else return o(void 0,b)}function p(w,b,C){if(C in t)return o(w,b);if(C in s)return o(void 0,w)}const y={url:h,method:h,data:h,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:p,headers:(w,b,C)=>c(rn(w),rn(b),C,!0)};return d.forEach(Object.keys({...s,...t}),function(b){const C=y[b]||c,T=C(s[b],t[b],b);d.isUndefined(T)&&C!==p||(i[b]=T)}),i}const Ln=s=>{const t=fe({},s);let{data:i,withXSRFToken:o,xsrfHeaderName:c,xsrfCookieName:h,headers:l,auth:p}=t;if(t.headers=l=K.from(l),t.url=kn(An(t.baseURL,t.url,t.allowAbsoluteUrls),s.params,s.paramsSerializer),p&&l.set("Authorization","Basic "+btoa((p.username||"")+":"+(p.password?unescape(encodeURIComponent(p.password)):""))),d.isFormData(i)){if($.hasStandardBrowserEnv||$.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if(d.isFunction(i.getHeaders)){const y=i.getHeaders(),w=["content-type","content-length"];Object.entries(y).forEach(([b,C])=>{w.includes(b.toLowerCase())&&l.set(b,C)})}}if($.hasStandardBrowserEnv&&(o&&d.isFunction(o)&&(o=o(t)),o||o!==!1&&to(t.url))){const y=c&&h&&no.read(h);y&&l.set(c,y)}return t},io=typeof XMLHttpRequest<"u",oo=io&&function(s){return new Promise(function(i,o){const c=Ln(s);let h=c.data;const l=K.from(c.headers).normalize();let{responseType:p,onUploadProgress:y,onDownloadProgress:w}=c,b,C,T,x,g;function v(){x&&x(),g&&g(),c.cancelToken&&c.cancelToken.unsubscribe(b),c.signal&&c.signal.removeEventListener("abort",b)}let f=new XMLHttpRequest;f.open(c.method.toUpperCase(),c.url,!0),f.timeout=c.timeout;function S(){if(!f)return;const O=K.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),U={data:!p||p==="text"||p==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:O,config:s,request:f};Pn(function(D){i(D),v()},function(D){o(D),v()},U),f=null}"onloadend"in f?f.onloadend=S:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(S)},f.onabort=function(){f&&(o(new R("Request aborted",R.ECONNABORTED,s,f)),f=null)},f.onerror=function(N){const U=N&&N.message?N.message:"Network Error",B=new R(U,R.ERR_NETWORK,s,f);B.event=N||null,o(B),f=null},f.ontimeout=function(){let N=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded";const U=c.transitional||xn;c.timeoutErrorMessage&&(N=c.timeoutErrorMessage),o(new R(N,U.clarifyTimeoutError?R.ETIMEDOUT:R.ECONNABORTED,s,f)),f=null},h===void 0&&l.setContentType(null),"setRequestHeader"in f&&d.forEach(l.toJSON(),function(N,U){f.setRequestHeader(U,N)}),d.isUndefined(c.withCredentials)||(f.withCredentials=!!c.withCredentials),p&&p!=="json"&&(f.responseType=c.responseType),w&&([T,g]=Me(w,!0),f.addEventListener("progress",T)),y&&f.upload&&([C,x]=Me(y),f.upload.addEventListener("progress",C),f.upload.addEventListener("loadend",x)),(c.cancelToken||c.signal)&&(b=O=>{f&&(o(!O||O.type?new Re(null,s,f):O),f.abort(),f=null)},c.cancelToken&&c.cancelToken.subscribe(b),c.signal&&(c.signal.aborted?b():c.signal.addEventListener("abort",b)));const k=Yi(c.url);if(k&&$.protocols.indexOf(k)===-1){o(new R("Unsupported protocol "+k+":",R.ERR_BAD_REQUEST,s));return}f.send(h||null)})},ao=(s,t)=>{const{length:i}=s=s?s.filter(Boolean):[];if(t||i){let o=new AbortController,c;const h=function(w){if(!c){c=!0,p();const b=w instanceof Error?w:this.reason;o.abort(b instanceof R?b:new Re(b instanceof Error?b.message:b))}};let l=t&&setTimeout(()=>{l=null,h(new R(`timeout of ${t}ms exceeded`,R.ETIMEDOUT))},t);const p=()=>{s&&(l&&clearTimeout(l),l=null,s.forEach(w=>{w.unsubscribe?w.unsubscribe(h):w.removeEventListener("abort",h)}),s=null)};s.forEach(w=>w.addEventListener("abort",h));const{signal:y}=o;return y.unsubscribe=()=>d.asap(p),y}},co=function*(s,t){let i=s.byteLength;if(i{const c=uo(s,t);let h=0,l,p=y=>{l||(l=!0,o&&o(y))};return new ReadableStream({async pull(y){try{const{done:w,value:b}=await c.next();if(w){p(),y.close();return}let C=b.byteLength;if(i){let T=h+=C;i(T)}y.enqueue(new Uint8Array(b))}catch(w){throw p(w),w}},cancel(y){return p(y),c.return()}},{highWaterMark:2})},on=64*1024,{isFunction:De}=d,ho=(({Request:s,Response:t})=>({Request:s,Response:t}))(d.global),{ReadableStream:an,TextEncoder:cn}=d.global,un=(s,...t)=>{try{return!!s(...t)}catch{return!1}},fo=s=>{s=d.merge.call({skipUndefined:!0},ho,s);const{fetch:t,Request:i,Response:o}=s,c=t?De(t):typeof fetch=="function",h=De(i),l=De(o);if(!c)return!1;const p=c&&De(an),y=c&&(typeof cn=="function"?(g=>v=>g.encode(v))(new cn):async g=>new Uint8Array(await new i(g).arrayBuffer())),w=h&&p&&un(()=>{let g=!1;const v=new i($.origin,{body:new an,method:"POST",get duplex(){return g=!0,"half"}}).headers.has("Content-Type");return g&&!v}),b=l&&p&&un(()=>d.isReadableStream(new o("").body)),C={stream:b&&(g=>g.body)};c&&["text","arrayBuffer","blob","formData","stream"].forEach(g=>{!C[g]&&(C[g]=(v,f)=>{let S=v&&v[g];if(S)return S.call(v);throw new R(`Response type '${g}' is not supported`,R.ERR_NOT_SUPPORT,f)})});const T=async g=>{if(g==null)return 0;if(d.isBlob(g))return g.size;if(d.isSpecCompliantForm(g))return(await new i($.origin,{method:"POST",body:g}).arrayBuffer()).byteLength;if(d.isArrayBufferView(g)||d.isArrayBuffer(g))return g.byteLength;if(d.isURLSearchParams(g)&&(g=g+""),d.isString(g))return(await y(g)).byteLength},x=async(g,v)=>{const f=d.toFiniteNumber(g.getContentLength());return f??T(v)};return async g=>{let{url:v,method:f,data:S,signal:k,cancelToken:O,timeout:N,onDownloadProgress:U,onUploadProgress:B,responseType:D,headers:z,withCredentials:J="same-origin",fetchOptions:Q}=Ln(g),Oe=t||fetch;D=D?(D+"").toLowerCase():"text";let Z=ao([k,O&&O.toAbortSignal()],N),ee=null;const se=Z&&Z.unsubscribe&&(()=>{Z.unsubscribe()});let Pe;try{if(B&&w&&f!=="get"&&f!=="head"&&(Pe=await x(z,S))!==0){let ne=new i(v,{method:"POST",body:S,duplex:"half"}),X;if(d.isFormData(S)&&(X=ne.headers.get("content-type"))&&z.setContentType(X),ne.body){const[ve,pe]=tn(Pe,Me(nn(B)));S=sn(ne.body,on,ve,pe)}}d.isString(J)||(J=J?"include":"omit");const G=h&&"credentials"in i.prototype,Ae={...Q,signal:Z,method:f.toUpperCase(),headers:z.normalize().toJSON(),body:S,duplex:"half",credentials:G?J:void 0};ee=h&&new i(v,Ae);let te=await(h?Oe(ee,Q):Oe(v,Ae));const ye=b&&(D==="stream"||D==="response");if(b&&(U||ye&&se)){const ne={};["status","statusText","headers"].forEach(H=>{ne[H]=te[H]});const X=d.toFiniteNumber(te.headers.get("content-length")),[ve,pe]=U&&tn(X,Me(nn(U),!0))||[];te=new o(sn(te.body,on,ve,()=>{pe&&pe(),se&&se()}),ne)}D=D||"text";let Ke=await C[d.findKey(C,D)||"text"](te,g);return!ye&&se&&se(),await new Promise((ne,X)=>{Pn(ne,X,{data:Ke,headers:K.from(te.headers),status:te.status,statusText:te.statusText,config:g,request:ee})})}catch(G){throw se&&se(),G&&G.name==="TypeError"&&/Load failed|fetch/i.test(G.message)?Object.assign(new R("Network Error",R.ERR_NETWORK,g,ee),{cause:G.cause||G}):R.from(G,G&&G.code,g,ee)}}},po=new Map,Nn=s=>{let t=s&&s.env||{};const{fetch:i,Request:o,Response:c}=t,h=[o,c,i];let l=h.length,p=l,y,w,b=po;for(;p--;)y=h[p],w=b.get(y),w===void 0&&b.set(y,w=p?new Map:fo(t)),b=w;return w};Nn();const wt={http:Pi,xhr:oo,fetch:{get:Nn}};d.forEach(wt,(s,t)=>{if(s){try{Object.defineProperty(s,"name",{value:t})}catch{}Object.defineProperty(s,"adapterName",{value:t})}});const ln=s=>`- ${s}`,mo=s=>d.isFunction(s)||s===null||s===!1;function go(s,t){s=d.isArray(s)?s:[s];const{length:i}=s;let o,c;const h={};for(let l=0;l`adapter ${y} `+(w===!1?"is not supported by the environment":"is not available in the build"));let p=i?l.length>1?`since : `+l.map(ln).join(` `):" "+ln(l[0]):"as no adapter specified";throw new R("There is no suitable adapter to dispatch the request "+p,"ERR_NOT_SUPPORT")}return c}const In={getAdapter:go,adapters:wt};function ht(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new Re(null,s)}function hn(s){return ht(s),s.headers=K.from(s.headers),s.data=lt.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),In.getAdapter(s.adapter||xe.adapter,s)(s).then(function(o){return ht(s),o.data=lt.call(s,s.transformResponse,o),o.headers=K.from(o.headers),o},function(o){return On(o)||(ht(s),o&&o.response&&(o.response.data=lt.call(s,s.transformResponse,o.response),o.response.headers=K.from(o.response.headers))),Promise.reject(o)})}const Un="1.13.4",Ve={};["object","boolean","number","function","string","symbol"].forEach((s,t)=>{Ve[s]=function(o){return typeof o===s||"a"+(t<1?"n ":" ")+s}});const dn={};Ve.transitional=function(t,i,o){function c(h,l){return"[Axios v"+Un+"] Transitional option '"+h+"'"+l+(o?". "+o:"")}return(h,l,p)=>{if(t===!1)throw new R(c(l," has been removed"+(i?" in "+i:"")),R.ERR_DEPRECATED);return i&&!dn[l]&&(dn[l]=!0,console.warn(c(l," has been deprecated since v"+i+" and will be removed in the near future"))),t?t(h,l,p):!0}};Ve.spelling=function(t){return(i,o)=>(console.warn(`${o} is likely a misspelling of ${t}`),!0)};function bo(s,t,i){if(typeof s!="object")throw new R("options must be an object",R.ERR_BAD_OPTION_VALUE);const o=Object.keys(s);let c=o.length;for(;c-- >0;){const h=o[c],l=t[h];if(l){const p=s[h],y=p===void 0||l(p,h,s);if(y!==!0)throw new R("option "+h+" must be "+y,R.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new R("Unknown option "+h,R.ERR_BAD_OPTION)}}const He={assertOptions:bo,validators:Ve},re=He.validators;let de=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Zt,response:new Zt}}async request(t,i){try{return await this._request(t,i)}catch(o){if(o instanceof Error){let c={};Error.captureStackTrace?Error.captureStackTrace(c):c=new Error;const h=c.stack?c.stack.replace(/^.+\n/,""):"";try{o.stack?h&&!String(o.stack).endsWith(h.replace(/^.+\n.+\n/,""))&&(o.stack+=` `+h):o.stack=h}catch{}}throw o}}_request(t,i){typeof t=="string"?(i=i||{},i.url=t):i=t||{},i=fe(this.defaults,i);const{transitional:o,paramsSerializer:c,headers:h}=i;o!==void 0&&He.assertOptions(o,{silentJSONParsing:re.transitional(re.boolean),forcedJSONParsing:re.transitional(re.boolean),clarifyTimeoutError:re.transitional(re.boolean)},!1),c!=null&&(d.isFunction(c)?i.paramsSerializer={serialize:c}:He.assertOptions(c,{encode:re.function,serialize:re.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),He.assertOptions(i,{baseUrl:re.spelling("baseURL"),withXsrfToken:re.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let l=h&&d.merge(h.common,h[i.method]);h&&d.forEach(["delete","get","head","post","put","patch","common"],g=>{delete h[g]}),i.headers=K.concat(l,h);const p=[];let y=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(i)===!1||(y=y&&v.synchronous,p.unshift(v.fulfilled,v.rejected))});const w=[];this.interceptors.response.forEach(function(v){w.push(v.fulfilled,v.rejected)});let b,C=0,T;if(!y){const g=[hn.bind(this),void 0];for(g.unshift(...p),g.push(...w),T=g.length,b=Promise.resolve(i);C{if(!o._listeners)return;let h=o._listeners.length;for(;h-- >0;)o._listeners[h](c);o._listeners=null}),this.promise.then=c=>{let h;const l=new Promise(p=>{o.subscribe(p),h=p}).then(c);return l.cancel=function(){o.unsubscribe(h)},l},t(function(h,l,p){o.reason||(o.reason=new Re(h,l,p),i(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const i=this._listeners.indexOf(t);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const t=new AbortController,i=o=>{t.abort(o)};return this.subscribe(i),t.signal.unsubscribe=()=>this.unsubscribe(i),t.signal}static source(){let t;return{token:new jn(function(c){t=c}),cancel:t}}};function vo(s){return function(i){return s.apply(null,i)}}function wo(s){return d.isObject(s)&&s.isAxiosError===!0}const gt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(gt).forEach(([s,t])=>{gt[t]=s});function Dn(s){const t=new de(s),i=mn(de.prototype.request,t);return d.extend(i,de.prototype,t,{allOwnKeys:!0}),d.extend(i,t,null,{allOwnKeys:!0}),i.create=function(c){return Dn(fe(s,c))},i}const F=Dn(xe);F.Axios=de;F.CanceledError=Re;F.CancelToken=yo;F.isCancel=On;F.VERSION=Un;F.toFormData=We;F.AxiosError=R;F.Cancel=F.CanceledError;F.all=function(t){return Promise.all(t)};F.spread=vo;F.isAxiosError=wo;F.mergeConfig=fe;F.AxiosHeaders=K;F.formToJSON=s=>Rn(d.isHTMLForm(s)?new FormData(s):s);F.getAdapter=In.getAdapter;F.HttpStatusCode=gt;F.default=F;const{Axios:Fo,AxiosError:qo,CanceledError:Bo,isCancel:Ho,CancelToken:Mo,VERSION:zo,all:$o,Cancel:Jo,isAxiosError:Xo,spread:Wo,toFormData:Vo,AxiosHeaders:Ko,HttpStatusCode:Go,formToJSON:Qo,getAdapter:Yo,mergeConfig:Zo}=F;class St{constructor(){this.notificationCreatedEvent=".Illuminate\\Notifications\\Events\\BroadcastNotificationCreated"}listenForWhisper(t,i){return this.listen(".client-"+t,i)}notification(t){return this.listen(this.notificationCreatedEvent,t)}stopListeningForNotification(t){return this.stopListening(this.notificationCreatedEvent,t)}stopListeningForWhisper(t,i){return this.stopListening(".client-"+t,i)}}class Fn{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 So(s){try{new s}catch(t){if(t instanceof Error&&t.message.includes("is not a constructor"))return!1}return!0}class _t extends St{constructor(t,i,o){super(),this.name=i,this.pusher=t,this.options=o,this.eventFormatter=new Fn(this.options.namespace),this.subscribe()}subscribe(){this.subscription=this.pusher.subscribe(this.name)}unsubscribe(){this.pusher.unsubscribe(this.name)}listen(t,i){return this.on(this.eventFormatter.format(t),i),this}listenToAll(t){return this.subscription.bind_global((i,o)=>{if(i.startsWith("pusher:"))return;let c=String(this.options.namespace??"").replace(/\./g,"\\"),h=i.startsWith(c)?i.substring(c.length+1):"."+i;t(h,o)}),this}stopListening(t,i){return i?this.subscription.unbind(this.eventFormatter.format(t),i):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",i=>{t(i)}),this}on(t,i){return this.subscription.bind(t,i),this}}class qn extends _t{whisper(t,i){return this.pusher.channels.channels[this.name].trigger(`client-${t}`,i),this}}class _o extends _t{whisper(t,i){return this.pusher.channels.channels[this.name].trigger(`client-${t}`,i),this}}class Co extends qn{here(t){return this.on("pusher:subscription_succeeded",i=>{t(Object.keys(i.members).map(o=>i.members[o]))}),this}joining(t){return this.on("pusher:member_added",i=>{t(i.info)}),this}whisper(t,i){return this.pusher.channels.channels[this.name].trigger(`client-${t}`,i),this}leaving(t){return this.on("pusher:member_removed",i=>{t(i.info)}),this}}class Bn extends St{constructor(t,i,o){super(),this.events={},this.listeners={},this.name=i,this.socket=t,this.options=o,this.eventFormatter=new Fn(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,i){return this.on(this.eventFormatter.format(t),i),this}stopListening(t,i){return this.unbindEvent(this.eventFormatter.format(t),i),this}subscribed(t){return this.on("connect",i=>{t(i)}),this}error(t){return this}on(t,i){return this.listeners[t]=this.listeners[t]||[],this.events[t]||(this.events[t]=(o,c)=>{this.name===o&&this.listeners[t]&&this.listeners[t].forEach(h=>h(c))},this.socket.on(t,this.events[t])),this.listeners[t].push(i),this}unbind(){Object.keys(this.events).forEach(t=>{this.unbindEvent(t)})}unbindEvent(t,i){this.listeners[t]=this.listeners[t]||[],i&&(this.listeners[t]=this.listeners[t].filter(o=>o!==i)),(!i||this.listeners[t].length===0)&&(this.events[t]&&(this.socket.removeListener(t,this.events[t]),delete this.events[t]),delete this.listeners[t])}}class Hn extends Bn{whisper(t,i){return this.socket.emit("client event",{channel:this.name,event:`client-${t}`,data:i}),this}}class To extends Hn{here(t){return this.on("presence:subscribed",i=>{t(i.map(o=>o.user_info))}),this}joining(t){return this.on("presence:joining",i=>t(i.user_info)),this}whisper(t,i){return this.socket.emit("client event",{channel:this.name,event:`client-${t}`,data:i}),this}leaving(t){return this.on("presence:leaving",i=>t(i.user_info)),this}}class ze extends St{subscribe(){}unsubscribe(){}listen(t,i){return this}listenToAll(t){return this}stopListening(t,i){return this}subscribed(t){return this}error(t){return this}on(t,i){return this}}class Mn extends ze{whisper(t,i){return this}}class Eo extends ze{whisper(t,i){return this}}class ko extends Mn{here(t){return this}joining(t){return this}whisper(t,i){return this}leaving(t){return this}}const zn=class $n{constructor(t){this.setOptions(t),this.connect()}setOptions(t){this.options={...$n._defaultOptions,...t,broadcaster:t.broadcaster};let i=this.csrfToken();i&&(this.options.auth.headers["X-CSRF-TOKEN"]=i,this.options.userAuthentication.headers["X-CSRF-TOKEN"]=i),i=this.options.bearerToken,i&&(this.options.auth.headers.Authorization="Bearer "+i,this.options.userAuthentication.headers.Authorization="Bearer "+i)}csrfToken(){var t,i;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"?((i=document.querySelector('meta[name="csrf-token"]'))==null?void 0:i.getAttribute("content"))??null:null}};zn._defaultOptions={auth:{headers:{}},authEndpoint:"/broadcasting/auth",userAuthentication:{endpoint:"/broadcasting/user-auth",headers:{}},csrfToken:null,bearerToken:null,host:null,key:null,namespace:"App.Events"};let Ct=zn;class Fe extends Ct{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,i,o){return this.channel(t).listen(i,o)}channel(t){return this.channels[t]||(this.channels[t]=new _t(this.pusher,t,this.options)),this.channels[t]}privateChannel(t){return this.channels["private-"+t]||(this.channels["private-"+t]=new qn(this.pusher,"private-"+t,this.options)),this.channels["private-"+t]}encryptedPrivateChannel(t){return this.channels["private-encrypted-"+t]||(this.channels["private-encrypted-"+t]=new _o(this.pusher,"private-encrypted-"+t,this.options)),this.channels["private-encrypted-"+t]}presenceChannel(t){return this.channels["presence-"+t]||(this.channels["presence-"+t]=new Co(this.pusher,"presence-"+t,this.options)),this.channels["presence-"+t]}leave(t){[t,"private-"+t,"private-encrypted-"+t,"presence-"+t].forEach(i=>{this.leaveChannel(i)})}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 i=()=>{t(this.connectionStatus())},o=["state_change","connected","disconnected"];return o.forEach(c=>{this.pusher.connection.bind(c,i)}),()=>{o.forEach(c=>{this.pusher.connection.unbind(c,i)})}}disconnect(){this.pusher.disconnect()}}class xo extends Ct{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(i=>{i.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,i,o){return this.channel(t).listen(i,o)}channel(t){return this.channels[t]||(this.channels[t]=new Bn(this.socket,t,this.options)),this.channels[t]}privateChannel(t){return this.channels["private-"+t]||(this.channels["private-"+t]=new Hn(this.socket,"private-"+t,this.options)),this.channels["private-"+t]}presenceChannel(t){return this.channels["presence-"+t]||(this.channels["presence-"+t]=new To(this.socket,"presence-"+t,this.options)),this.channels["presence-"+t]}leave(t){[t,"private-"+t,"presence-"+t].forEach(i=>{this.leaveChannel(i)})}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 i=()=>{t(this.connectionStatus())},o=["connect","disconnect","connect_error","reconnect_attempt","reconnect","reconnect_error","reconnect_failed"];return o.forEach(c=>{this.socket.on(c,i)}),()=>{o.forEach(c=>{this.socket.off(c,i)})}}disconnect(){this.socket.disconnect()}}class fn extends Ct{constructor(){super(...arguments),this.channels={}}connect(){}listen(t,i,o){return new ze}channel(t){return new ze}privateChannel(t){return new Mn}encryptedPrivateChannel(t){return new Eo}presenceChannel(t){return new ko}leave(t){}leaveChannel(t){}socketId(){return"fake-socket-id"}connectionStatus(){return"connected"}onConnectionChange(t){return()=>{}}disconnect(){}}class Ro{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 Fe({...this.options,cluster:""});else if(this.options.broadcaster==="pusher")this.connector=new Fe(this.options);else if(this.options.broadcaster==="ably")this.connector=new Fe({...this.options,cluster:"",broadcaster:"pusher"});else if(this.options.broadcaster==="socket.io")this.connector=new xo(this.options);else if(this.options.broadcaster==="null")this.connector=new fn(this.options);else if(typeof this.options.broadcaster=="function"&&So(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,i,o){return this.connector.listen(t,i,o)}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 Fe||t instanceof fn}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,i)=>{this.socketId()&&t.headers.set("X-Socket-ID",this.socketId()),i()})}registerAxiosRequestInterceptor(){axios.interceptors.request.use(t=>(this.socketId()&&(t.headers["X-Socket-Id"]=this.socketId()),t))}registerjQueryAjaxSetup(){typeof jQuery.ajax<"u"&&jQuery.ajaxPrefilter((t,i,o)=>{this.socketId()&&o.setRequestHeader("X-Socket-Id",this.socketId())})}registerTurboRequestInterceptor(){document.addEventListener("turbo:before-fetch-request",t=>{t.detail.fetchOptions.headers["X-Socket-Id"]=this.socketId()})}}function Oo(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var dt={exports:{}};var pn;function Po(){return pn||(pn=1,(function(s,t){(function(o,c){s.exports=c()})(window,function(){return(function(i){var o={};function c(h){if(o[h])return o[h].exports;var l=o[h]={i:h,l:!1,exports:{}};return i[h].call(l.exports,l,l.exports,c),l.l=!0,l.exports}return c.m=i,c.c=o,c.d=function(h,l,p){c.o(h,l)||Object.defineProperty(h,l,{enumerable:!0,get:p})},c.r=function(h){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(h,"__esModule",{value:!0})},c.t=function(h,l){if(l&1&&(h=c(h)),l&8||l&4&&typeof h=="object"&&h&&h.__esModule)return h;var p=Object.create(null);if(c.r(p),Object.defineProperty(p,"default",{enumerable:!0,value:h}),l&2&&typeof h!="string")for(var y in h)c.d(p,y,(function(w){return h[w]}).bind(null,y));return p},c.n=function(h){var l=h&&h.__esModule?function(){return h.default}:function(){return h};return c.d(l,"a",l),l},c.o=function(h,l){return Object.prototype.hasOwnProperty.call(h,l)},c.p="",c(c.s=2)})([(function(i,o,c){var h=this&&this.__extends||(function(){var v=function(f,S){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,O){k.__proto__=O}||function(k,O){for(var N in O)O.hasOwnProperty(N)&&(k[N]=O[N])},v(f,S)};return function(f,S){v(f,S);function k(){this.constructor=f}f.prototype=S===null?Object.create(S):(k.prototype=S.prototype,new k)}})();Object.defineProperty(o,"__esModule",{value:!0});var l=256,p=(function(){function v(f){f===void 0&&(f="="),this._paddingCharacter=f}return v.prototype.encodedLength=function(f){return this._paddingCharacter?(f+2)/3*4|0:(f*8+5)/6|0},v.prototype.encode=function(f){for(var S="",k=0;k>>18&63),S+=this._encodeByte(O>>>12&63),S+=this._encodeByte(O>>>6&63),S+=this._encodeByte(O>>>0&63)}var N=f.length-k;if(N>0){var O=f[k]<<16|(N===2?f[k+1]<<8:0);S+=this._encodeByte(O>>>18&63),S+=this._encodeByte(O>>>12&63),N===2?S+=this._encodeByte(O>>>6&63):S+=this._paddingCharacter||"",S+=this._paddingCharacter||""}return S},v.prototype.maxDecodedLength=function(f){return this._paddingCharacter?f/4*3|0:(f*6+7)/8|0},v.prototype.decodedLength=function(f){return this.maxDecodedLength(f.length-this._getPaddingLength(f))},v.prototype.decode=function(f){if(f.length===0)return new Uint8Array(0);for(var S=this._getPaddingLength(f),k=f.length-S,O=new Uint8Array(this.maxDecodedLength(k)),N=0,U=0,B=0,D=0,z=0,J=0,Q=0;U>>4,O[N++]=z<<4|J>>>2,O[N++]=J<<6|Q,B|=D&l,B|=z&l,B|=J&l,B|=Q&l;if(U>>4,B|=D&l,B|=z&l),U>>2,B|=J&l),U>>8&6,S+=51-f>>>8&-75,S+=61-f>>>8&-15,S+=62-f>>>8&3,String.fromCharCode(S)},v.prototype._decodeChar=function(f){var S=l;return S+=(42-f&f-44)>>>8&-l+f-43+62,S+=(46-f&f-48)>>>8&-l+f-47+63,S+=(47-f&f-58)>>>8&-l+f-48+52,S+=(64-f&f-91)>>>8&-l+f-65+0,S+=(96-f&f-123)>>>8&-l+f-97+26,S},v.prototype._getPaddingLength=function(f){var S=0;if(this._paddingCharacter){for(var k=f.length-1;k>=0&&f[k]===this._paddingCharacter;k--)S++;if(f.length<4||S>2)throw new Error("Base64Coder: incorrect padding")}return S},v})();o.Coder=p;var y=new p;function w(v){return y.encode(v)}o.encode=w;function b(v){return y.decode(v)}o.decode=b;var C=(function(v){h(f,v);function f(){return v!==null&&v.apply(this,arguments)||this}return f.prototype._encodeByte=function(S){var k=S;return k+=65,k+=25-S>>>8&6,k+=51-S>>>8&-75,k+=61-S>>>8&-13,k+=62-S>>>8&49,String.fromCharCode(k)},f.prototype._decodeChar=function(S){var k=l;return k+=(44-S&S-46)>>>8&-l+S-45+62,k+=(94-S&S-96)>>>8&-l+S-95+63,k+=(47-S&S-58)>>>8&-l+S-48+52,k+=(64-S&S-91)>>>8&-l+S-65+0,k+=(96-S&S-123)>>>8&-l+S-97+26,k},f})(p);o.URLSafeCoder=C;var T=new C;function x(v){return T.encode(v)}o.encodeURLSafe=x;function g(v){return T.decode(v)}o.decodeURLSafe=g,o.encodedLength=function(v){return y.encodedLength(v)},o.maxDecodedLength=function(v){return y.maxDecodedLength(v)},o.decodedLength=function(v){return y.decodedLength(v)}}),(function(i,o,c){Object.defineProperty(o,"__esModule",{value:!0});var h="utf8: invalid string",l="utf8: invalid source encoding";function p(b){for(var C=new Uint8Array(y(b)),T=0,x=0;x>6,C[T++]=128|g&63):g<55296?(C[T++]=224|g>>12,C[T++]=128|g>>6&63,C[T++]=128|g&63):(x++,g=(g&1023)<<10,g|=b.charCodeAt(x)&1023,g+=65536,C[T++]=240|g>>18,C[T++]=128|g>>12&63,C[T++]=128|g>>6&63,C[T++]=128|g&63)}return C}o.encode=p;function y(b){for(var C=0,T=0;T=b.length-1)throw new Error(h);T++,C+=4}else throw new Error(h)}return C}o.encodedLength=y;function w(b){for(var C=[],T=0;T=b.length)throw new Error(l);var v=b[++T];if((v&192)!==128)throw new Error(l);x=(x&31)<<6|v&63,g=128}else if(x<240){if(T>=b.length-1)throw new Error(l);var v=b[++T],f=b[++T];if((v&192)!==128||(f&192)!==128)throw new Error(l);x=(x&15)<<12|(v&63)<<6|f&63,g=2048}else if(x<248){if(T>=b.length-2)throw new Error(l);var v=b[++T],f=b[++T],S=b[++T];if((v&192)!==128||(f&192)!==128||(S&192)!==128)throw new Error(l);x=(x&15)<<18|(v&63)<<12|(f&63)<<6|S&63,g=65536}else throw new Error(l);if(x=55296&&x<=57343)throw new Error(l);if(x>=65536){if(x>1114111)throw new Error(l);x-=65536,C.push(String.fromCharCode(55296|x>>10)),x=56320|x&1023}}C.push(String.fromCharCode(x))}return C.join("")}o.decode=w}),(function(i,o,c){i.exports=c(3).default}),(function(i,o,c){c.r(o);class h{constructor(e,n){this.lastId=0,this.prefix=e,this.name=n}create(e){this.lastId++;var n=this.lastId,a=this.prefix+n,u=this.name+"["+n+"]",m=!1,_=function(){m||(e.apply(null,arguments),m=!0)};return this[n]=_,{number:n,id:a,name:u,callback:_}}remove(e){delete this[e.number]}}var l=new h("_pusher_script_","Pusher.ScriptReceivers"),p={VERSION:"8.4.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:""},y=p;class w{constructor(e){this.options=e,this.receivers=e.receivers||l,this.loading={}}load(e,n,a){var u=this;if(u.loading[e]&&u.loading[e].length>0)u.loading[e].push(a);else{u.loading[e]=[a];var m=A.createScriptRequest(u.getPath(e,n)),_=u.receivers.create(function(E){if(u.receivers.remove(_),u.loading[e]){var P=u.loading[e];delete u.loading[e];for(var L=function(q){q||m.cleanup()},I=0;I>>6)+Z(128|e&63):Z(224|e>>>12&15)+Z(128|e>>>6&63)+Z(128|e&63)},Pe=function(r){return r.replace(/[^\x00-\x7F]/g,se)},G=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),a=[ee.charAt(n>>>18),ee.charAt(n>>>12&63),e>=2?"=":ee.charAt(n>>>6&63),e>=1?"=":ee.charAt(n&63)];return a.join("")},Ae=window.btoa||function(r){return r.replace(/[\s\S]{1,3}/g,G)};class te{constructor(e,n,a,u){this.clear=n,this.timer=e(()=>{this.timer&&(this.timer=u(this.timer))},a)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}var ye=te;function Ke(r){window.clearTimeout(r)}function ne(r){window.clearInterval(r)}class X extends ye{constructor(e,n){super(setTimeout,Ke,e,function(a){return n(),null})}}class ve extends ye{constructor(e,n){super(setInterval,ne,e,function(a){return n(),a})}}var pe={now(){return Date.now?Date.now():new Date().valueOf()},defer(r){return new X(0,r)},method(r,...e){var n=Array.prototype.slice.call(arguments,1);return function(a){return a[r].apply(a,n.concat(arguments))}}},H=pe;function W(r,...e){for(var n=0;n{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 a=Jn.apply(this,arguments);ot.log?ot.log(a):ot.logToConsole&&e.bind(this)(a)}}var j=new Zn,er=function(r,e,n,a,u){(n.headers!==void 0||n.headersProvider!=null)&&j.warn(`To send headers with the ${a.toString()} request, you must use AJAX, rather than JSONP.`);var m=r.nextAuthCallbackID.toString();r.nextAuthCallbackID++;var _=r.getDocument(),E=_.createElement("script");r.auth_callbacks[m]=function(I){u(null,I)};var P="Pusher.auth_callbacks['"+m+"']";E.src=n.endpoint+"?callback="+encodeURIComponent(P)+"&"+e;var L=_.getElementsByTagName("head")[0]||_.documentElement;L.insertBefore(E,L.firstChild)},tr=er;class nr{constructor(e){this.src=e}send(e){var n=this,a="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(a)},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+"('"+a+"');",n.script.async=n.errorScript.async=!1):n.script.async=!0;var u=document.getElementsByTagName("head")[0];u.insertBefore(n.script,u.firstChild),n.errorScript&&u.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 rr{constructor(e,n){this.url=e,this.data=n}send(e){if(!this.request){var n=Qn(this.data),a=this.url+"/"+e.number+"?"+n;this.request=A.createScriptRequest(a),this.request.send(e)}}cleanup(){this.request&&this.request.cleanup()}}var sr=function(r,e){return function(n,a){var u="http"+(e?"s":"")+"://",m=u+(r.host||r.options.host)+r.options.path,_=A.createJSONPRequest(m,n),E=A.ScriptReceivers.create(function(P,L){l.remove(E),_.cleanup(),L&&L.host&&(r.host=L.host),a&&a(P,L)});_.send(E)}},ir={name:"jsonp",getAgent:sr},or=ir;function Ge(r,e,n){var a=r+(e.useTLS?"s":""),u=e.useTLS?e.hostTLS:e.hostNonTLS;return a+"://"+u+n}function Qe(r,e){var n="/app/"+r,a="?protocol="+y.PROTOCOL+"&client=js&version="+y.VERSION+(e?"&"+e:"");return n+a}var ar={getInitial:function(r,e){var n=(e.httpPath||"")+Qe(r,"flash=false");return Ge("ws",e,n)}},cr={getInitial:function(r,e){var n=(e.httpPath||"/pusher")+Qe(r);return Ge("http",e,n)}},ur={getInitial:function(r,e){return Ge("http",e,e.httpPath||"/pusher")},getPath:function(r,e){return Qe(r)}};class lr{constructor(){this._callbacks={}}get(e){return this._callbacks[Ye(e)]}add(e,n,a){var u=Ye(e);this._callbacks[u]=this._callbacks[u]||[],this._callbacks[u].push({fn:n,context:a})}remove(e,n,a){if(!e&&!n&&!a){this._callbacks={};return}var u=e?[Ye(e)]:Et(this._callbacks);n||a?this.removeCallback(u,n,a):this.removeAllCallbacks(u)}removeCallback(e,n,a){we(e,function(u){this._callbacks[u]=xt(this._callbacks[u]||[],function(m){return n&&n!==m.fn||a&&a!==m.context}),this._callbacks[u].length===0&&delete this._callbacks[u]},this)}removeAllCallbacks(e){we(e,function(n){delete this._callbacks[n]},this)}}function Ye(r){return"_"+r}class oe{constructor(e){this.callbacks=new lr,this.global_callbacks=[],this.failThrough=e}bind(e,n,a){return this.callbacks.add(e,n,a),this}bind_global(e){return this.global_callbacks.push(e),this}unbind(e,n,a){return this.callbacks.remove(e,n,a),this}unbind_global(e){return e?(this.global_callbacks=xt(this.global_callbacks||[],n=>n!==e),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(e,n,a){for(var u=0;u0)for(var u=0;u{this.onError(n),this.changeState("closed")}),!1}return this.bindListeners(),j.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"?(H.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 W({cid:this.id},e)}}class me{constructor(e){this.hooks=e}isSupported(e){return this.hooks.isSupported(e)}createConnection(e,n,a,u){return new hr(this.hooks,e,n,a,u)}}var dr=new me({urls:ar,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!A.getWebSocketAPI()},isSupported:function(){return!!A.getWebSocketAPI()},getSocket:function(r){return A.createWebSocket(r)}}),Pt={urls:cr,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},At=W({getSocket:function(r){return A.HTTPFactory.createStreamingSocket(r)}},Pt),Lt=W({getSocket:function(r){return A.HTTPFactory.createPollingSocket(r)}},Pt),Nt={isSupported:function(){return A.isXHRSupported()}},fr=new me(W({},At,Nt)),pr=new me(W({},Lt,Nt)),mr={ws:dr,xhr_streaming:fr,xhr_polling:pr},Ne=mr,gr=new me({file:"sockjs",urls:ur,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:C.getPath("sockjs",{useTLS:e.useTLS}),ignore_null_origin:e.ignoreNullOrigin})},beforeOpen:function(r,e){r.send(JSON.stringify({path:e}))}}),It={isSupported:function(r){var e=A.isXDRSupported(r.useTLS);return e}},br=new me(W({},At,It)),yr=new me(W({},Lt,It));Ne.xdr_streaming=br,Ne.xdr_polling=yr,Ne.sockjs=gr;var vr=Ne;class wr extends oe{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 Sr=new wr;class _r{constructor(e,n,a){this.manager=e,this.transport=n,this.minPingDelay=a.minPingDelay,this.maxPingDelay=a.maxPingDelay,this.pingDelay=void 0}createConnection(e,n,a,u){u=W({},u,{activityTimeout:this.pingDelay});var m=this.transport.createConnection(e,n,a,u),_=null,E=function(){m.unbind("open",E),m.bind("closed",P),_=H.now()},P=L=>{if(m.unbind("closed",P),L.code===1002||L.code===1003)this.manager.reportDeath();else if(!L.wasClean&&_){var I=H.now()-_;I<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(I/2,this.minPingDelay))}};return m.bind("open",E),m}isSupported(e){return this.manager.isAlive()&&this.transport.isSupported(e)}}const Ut={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 a={event:e.event,channel:e.channel,data:n};return e.user_id&&(a.user_id=e.user_id),a}catch(u){throw{type:"MessageParseError",error:u,data:r.data}}},encodeMessage:function(r){return JSON.stringify(r)},processHandshake:function(r){var e=Ut.decodeMessage(r);if(e.event==="pusher:connection_established"){if(!e.data.activity_timeout)throw"No activity timeout specified in handshake";return{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}};var ce=Ut;class Cr extends oe{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,a){var u={event:e,data:n};return a&&(u.channel=a),j.debug("Event sent",u),this.send(ce.encodeMessage(u))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var e={message:a=>{var u;try{u=ce.decodeMessage(a)}catch(m){this.emit("error",{type:"MessageParseError",error:m,data:a.data})}if(u!==void 0){switch(j.debug("Event recd",u),u.event){case"pusher:error":this.emit("error",{type:"PusherError",data:u.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",u)}},activity:()=>{this.emit("activity")},error:a=>{this.emit("error",a)},closed:a=>{n(),a&&a.code&&this.handleCloseEvent(a),this.transport=null,this.emit("closed")}},n=()=>{ie(e,(a,u)=>{this.transport.unbind(u,a)})};ie(e,(a,u)=>{this.transport.bind(u,a)})}handleCloseEvent(e){var n=ce.getCloseAction(e),a=ce.getCloseError(e);a&&this.emit("error",a),n&&this.emit(n,{action:n,error:a})}}class Tr{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=ce.processHandshake(e)}catch(a){this.finish("error",{error:a}),this.transport.close();return}n.action==="connected"?this.finish("connected",{connection:new Cr(n.id,this.transport),activityTimeout:n.activityTimeout}):(this.finish(n.action,{error:n.error}),this.transport.close())},this.onClosed=e=>{this.unbindListeners();var n=ce.getCloseAction(e)||"backoff",a=ce.getCloseError(e);this.finish(n,{error:a})},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(W({transport:this.transport,action:e},n))}}class Er{constructor(e,n){this.timeline=e,this.options=n||{}}send(e,n){this.timeline.isEmpty()||this.timeline.send(A.TimelineTransport.getAgent(this,e),n)}}class Ze extends oe{constructor(e,n){super(function(a,u){j.debug("No callbacks on "+e+" for "+a)}),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 f("Event '"+e+"' does not start with 'client-'");if(!this.subscribed){var a=g.buildLogSuffix("triggeringClientEvents");j.warn(`Client event triggered before channel 'subscription_succeeded' event . ${a}`)}return this.pusher.send_event(e,n,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(e){var n=e.event,a=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 u={};this.emit(n,a,u)}}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,j.error(e.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:e.message},e instanceof z?{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 et extends Ze{authorize(e,n){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:e},n)}}class kr{constructor(){this.reset()}get(e){return Object.prototype.hasOwnProperty.call(this.members,e)?{id:e,info:this.members[e]}:null}each(e){ie(this.members,(n,a)=>{e(this.get(a))})}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 xr=function(r,e,n,a){function u(m){return m instanceof n?m:new n(function(_){_(m)})}return new(n||(n=Promise))(function(m,_){function E(I){try{L(a.next(I))}catch(q){_(q)}}function P(I){try{L(a.throw(I))}catch(q){_(q)}}function L(I){I.done?m(I.value):u(I.value).then(E,P)}L((a=a.apply(r,e||[])).next())})};class Rr extends et{constructor(e,n){super(e,n),this.members=new kr}authorize(e,n){super.authorize(e,(a,u)=>xr(this,void 0,void 0,function*(){if(!a)if(u=u,u.channel_data!=null){var m=JSON.parse(u.channel_data);this.members.setMyID(m.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 _=g.buildLogSuffix("authorizationEndpoint");j.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${_}, or the user should be signed in.`),n("Invalid auth response");return}n(a,u)}))}handleEvent(e){var n=e.event;if(n.indexOf("pusher_internal:")===0)this.handleInternalEvent(e);else{var a=e.data,u={};e.user_id&&(u.user_id=e.user_id),this.emit(n,a,u)}}handleInternalEvent(e){var n=e.event,a=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 u=this.members.addMember(a);this.emit("pusher:member_added",u);break;case"pusher_internal:member_removed":var m=this.members.removeMember(a);m&&this.emit("pusher:member_removed",m);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 Or=c(1),tt=c(0);class Pr extends et{constructor(e,n,a){super(e,n),this.key=null,this.nacl=a}authorize(e,n){super.authorize(e,(a,u)=>{if(a){n(a,u);return}let m=u.shared_secret;if(!m){n(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=Object(tt.decode)(m),delete u.shared_secret,n(null,u)})}trigger(e,n){throw new U("Client events are not currently supported for encrypted channels")}handleEvent(e){var n=e.event,a=e.data;if(n.indexOf("pusher_internal:")===0||n.indexOf("pusher:")===0){super.handleEvent(e);return}this.handleEncryptedEvent(n,a)}handleEncryptedEvent(e,n){if(!this.key){j.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!n.ciphertext||!n.nonce){j.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+n);return}let a=Object(tt.decode)(n.ciphertext);if(a.length{if(_){j.error(`Failed to make a request to the authEndpoint: ${E}. Unable to fetch new key, so dropping encrypted event`);return}if(m=this.nacl.secretbox.open(a,u,this.key),m===null){j.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(e,this.getDataToEmit(m))});return}this.emit(e,this.getDataToEmit(m))}getDataToEmit(e){let n=Object(Or.decode)(e);try{return JSON.parse(n)}catch{return n}}}class Ar extends oe{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 a=A.getNetwork();a.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),a.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}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,a){return this.connection?this.connection.send_event(e,n,a):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var e=(n,a)=>{n?this.runner=this.strategy.connect(0,e):a.action==="error"?(this.emit("error",{type:"HandshakeError",error:a.error}),this.timeline.error({handshakeError:a.error})):(this.abortConnecting(),this.handshakeCallbacks[a.action](a))};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 X(e||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new X(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new X(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 X(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(e){return W({},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 W({},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=>a=>{a.error&&this.emit("error",{type:"WebSocketError",error:a.error}),n(a)};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 a=this.state;if(this.state=e,a!==e){var u=e;u==="connected"&&(u+=" with new socket ID "+n.socket_id),j.debug("State changed",a+" -> "+u),this.timeline.info({state:e,params:n}),this.emit("state_change",{previous:a,current:e}),this.emit(e,n)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class Lr{constructor(){this.channels={}}add(e,n){return this.channels[e]||(this.channels[e]=Nr(e,n)),this.channels[e]}all(){return Xn(this.channels)}find(e){return this.channels[e]}remove(e){var n=this.channels[e];return delete this.channels[e],n}disconnect(){ie(this.channels,function(e){e.disconnect()})}}function Nr(r,e){if(r.indexOf("private-encrypted-")===0){if(e.config.nacl)return ae.createEncryptedChannel(r,e,e.config.nacl);let n="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",a=g.buildLogSuffix("encryptedChannelSupport");throw new U(`${n}. ${a}`)}else{if(r.indexOf("private-")===0)return ae.createPrivateChannel(r,e);if(r.indexOf("presence-")===0)return ae.createPresenceChannel(r,e);if(r.indexOf("#")===0)throw new S('Cannot create a channel with name "'+r+'".');return ae.createChannel(r,e)}}var Ir={createChannels(){return new Lr},createConnectionManager(r,e){return new Ar(r,e)},createChannel(r,e){return new Ze(r,e)},createPrivateChannel(r,e){return new et(r,e)},createPresenceChannel(r,e){return new Rr(r,e)},createEncryptedChannel(r,e,n){return new Pr(r,e,n)},createTimelineSender(r,e){return new Er(r,e)},createHandshake(r,e){return new Tr(r,e)},createAssistantToTheTransportManager(r,e,n){return new _r(r,e,n)}},ae=Ir;class jt{constructor(e){this.options=e||{},this.livesLeft=this.options.lives||1/0}getAssistant(e){return ae.createAssistantToTheTransportManager(this,e,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class ue{constructor(e,n){this.strategies=e,this.loop=!!n.loop,this.failFast=!!n.failFast,this.timeout=n.timeout,this.timeoutLimit=n.timeoutLimit}isSupported(){return Ot(this.strategies,H.method("isSupported"))}connect(e,n){var a=this.strategies,u=0,m=this.timeout,_=null,E=(P,L)=>{L?n(null,L):(u=u+1,this.loop&&(u=u%a.length),u0&&(m=new X(a.timeout,function(){_.abort(),u(!0)})),_=e.connect(n,function(E,P){E&&m&&m.isRunning()&&!a.failFast||(m&&m.ensureAborted(),u(E,P))}),{abort:function(){m&&m.ensureAborted(),_.abort()},forceMinPriority:function(E){_.forceMinPriority(E)}}}}class nt{constructor(e){this.strategies=e}isSupported(){return Ot(this.strategies,H.method("isSupported"))}connect(e,n){return Ur(this.strategies,e,function(a,u){return function(m,_){if(u[a].error=m,m){jr(u)&&n(!0);return}we(u,function(E){E.forceMinPriority(_.transport.priority)}),n(null,_)}})}}function Ur(r,e,n){var a=kt(r,function(u,m,_,E){return u.connect(e,n(m,E))});return{abort:function(){we(a,Dr)},forceMinPriority:function(u){we(a,function(m){m.forceMinPriority(u)})}}}function jr(r){return Kn(r,function(e){return!!e.error})}function Dr(r){!r.error&&!r.aborted&&(r.abort(),r.aborted=!0)}class Fr{constructor(e,n,a){this.strategy=e,this.transports=n,this.ttl=a.ttl||1800*1e3,this.usingTLS=a.useTLS,this.timeline=a.timeline}isSupported(){return this.strategy.isSupported()}connect(e,n){var a=this.usingTLS,u=qr(a),m=u&&u.cacheSkipCount?u.cacheSkipCount:0,_=[this.strategy];if(u&&u.timestamp+this.ttl>=H.now()){var E=this.transports[u.transport];E&&(["ws","wss"].includes(u.transport)||m>3?(this.timeline.info({cached:!0,transport:u.transport,latency:u.latency}),_.push(new ue([E],{timeout:u.latency*2+1e3,failFast:!0}))):m++)}var P=H.now(),L=_.pop().connect(e,function I(q,je){q?(Dt(a),_.length>0?(P=H.now(),L=_.pop().connect(e,I)):n(q)):(Br(a,je.transport.name,H.now()-P,m),n(null,je))});return{abort:function(){L.abort()},forceMinPriority:function(I){e=I,L&&L.forceMinPriority(I)}}}}function rt(r){return"pusherTransport"+(r?"TLS":"NonTLS")}function qr(r){var e=A.getLocalStorage();if(e)try{var n=e[rt(r)];if(n)return JSON.parse(n)}catch{Dt(r)}return null}function Br(r,e,n,a){var u=A.getLocalStorage();if(u)try{u[rt(r)]=Le({timestamp:H.now(),transport:e,latency:n,cacheSkipCount:a})}catch{}}function Dt(r){var e=A.getLocalStorage();if(e)try{delete e[rt(r)]}catch{}}class Ie{constructor(e,{delay:n}){this.strategy=e,this.options={delay:n}}isSupported(){return this.strategy.isSupported()}connect(e,n){var a=this.strategy,u,m=new X(this.options.delay,function(){u=a.connect(e,n)});return{abort:function(){m.ensureAborted(),u&&u.abort()},forceMinPriority:function(_){e=_,u&&u.forceMinPriority(_)}}}}class Se{constructor(e,n,a){this.test=e,this.trueBranch=n,this.falseBranch=a}isSupported(){var e=this.test()?this.trueBranch:this.falseBranch;return e.isSupported()}connect(e,n){var a=this.test()?this.trueBranch:this.falseBranch;return a.connect(e,n)}}class Hr{constructor(e){this.strategy=e}isSupported(){return this.strategy.isSupported()}connect(e,n){var a=this.strategy.connect(e,function(u,m){m&&a.abort(),n(u,m)});return a}}function _e(r){return function(){return r.isSupported()}}var Mr=function(r,e,n){var a={};function u(Vt,Hs,Ms,zs,$s){var Kt=n(r,Vt,Hs,Ms,zs,$s);return a[Vt]=Kt,Kt}var m=Object.assign({},e,{hostNonTLS:r.wsHost+":"+r.wsPort,hostTLS:r.wsHost+":"+r.wssPort,httpPath:r.wsPath}),_=Object.assign({},m,{useTLS:!0}),E=Object.assign({},e,{hostNonTLS:r.httpHost+":"+r.httpPort,hostTLS:r.httpHost+":"+r.httpsPort,httpPath:r.httpPath}),P={loop:!0,timeout:15e3,timeoutLimit:6e4},L=new jt({minPingDelay:1e4,maxPingDelay:r.activityTimeout}),I=new jt({lives:2,minPingDelay:1e4,maxPingDelay:r.activityTimeout}),q=u("ws","ws",3,m,L),je=u("wss","ws",3,_,L),js=u("sockjs","sockjs",1,E),Mt=u("xhr_streaming","xhr_streaming",1,E,I),Ds=u("xdr_streaming","xdr_streaming",1,E,I),zt=u("xhr_polling","xhr_polling",1,E),Fs=u("xdr_polling","xdr_polling",1,E),$t=new ue([q],P),qs=new ue([je],P),Bs=new ue([js],P),Jt=new ue([new Se(_e(Mt),Mt,Ds)],P),Xt=new ue([new Se(_e(zt),zt,Fs)],P),Wt=new ue([new Se(_e(Jt),new nt([Jt,new Ie(Xt,{delay:4e3})]),Xt)],P),at=new Se(_e(Wt),Wt,Bs),ct;return e.useTLS?ct=new nt([$t,new Ie(at,{delay:2e3})]):ct=new nt([$t,new Ie(qs,{delay:2e3}),new Ie(at,{delay:5e3})]),new Fr(new Hr(new Se(_e(q),ct,at)),a,{ttl:18e5,timeline:e.timeline,useTLS:e.useTLS})},zr=Mr,$r=(function(){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"),C.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()}),Jr={getRequest:function(r){var e=new window.XDomainRequest;return e.ontimeout=function(){r.emit("error",new k),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()}},Xr=Jr;const Wr=256*1024;class Vr extends oe{constructor(e,n,a){super(),this.hooks=e,this.method=n,this.url=a}start(e){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},A.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&&(A.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(e,n){for(;;){var a=this.advanceBuffer(n);if(a)this.emit("chunk",{status:e,data:a});else break}this.isBufferTooLong(n)&&this.emit("buffer_too_long")}advanceBuffer(e){var n=e.slice(this.position),a=n.indexOf(` `);return a!==-1?(this.position+=a+1,n.slice(0,a)):null}isBufferTooLong(e){return this.position===e.length&&e.length>Wr}}var st;(function(r){r[r.CONNECTING=0]="CONNECTING",r[r.OPEN=1]="OPEN",r[r.CLOSED=3]="CLOSED"})(st||(st={}));var le=st,Kr=1;class Gr{constructor(e,n){this.hooks=e,this.session=qt(1e3)+"/"+es(8),this.location=Qr(n),this.readyState=le.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===le.OPEN)try{return A.createSocketRequest("POST",Ft(Yr(this.location,this.session))).start(e),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(e,n,a){this.closeStream(),this.readyState=le.CLOSED,this.onclose&&this.onclose({code:e,reason:n,wasClean:a})}onChunk(e){if(e.status===200){this.readyState===le.OPEN&&this.onActivity();var n,a=e.data.slice(0,1);switch(a){case"o":n=JSON.parse(e.data.slice(1)||"{}"),this.onOpen(n);break;case"a":n=JSON.parse(e.data.slice(1)||"[]");for(var u=0;u{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){H.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 Qr(r){var e=/([^\?]*)\/*(\??.*)/.exec(r);return{base:e[1],queryString:e[2]}}function Yr(r,e){return r.base+"/"+e+"/xhr_send"}function Ft(r){var e=r.indexOf("?")===-1?"?":"&";return r+e+"t="+ +new Date+"&n="+Kr++}function Zr(r,e){var n=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(r);return n[1]+e+n[3]}function qt(r){return A.randomInt(r)}function es(r){for(var e=[],n=0;n0&&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()}},as=os,cs={createStreamingSocket(r){return this.createSocket(rs,r)},createPollingSocket(r){return this.createSocket(is,r)},createSocket(r,e){return new ts(r,e)},createXHR(r,e){return this.createRequest(as,r,e)},createRequest(r,e,n){return new Vr(r,e,n)}},Bt=cs;Bt.createXDR=function(r,e){return this.createRequest(Xr,r,e)};var us=Bt,ls={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:l,DependenciesReceivers:b,getDefaultStrategy:zr,Transports:vr,transportConnectionInitializer:$r,HTTPFactory:us,TimelineTransport:or,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(r){window.Pusher=r;var e=()=>{this.onDocumentBody(r.ready)};window.JSON?e():C.load("json2",{},e)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:Q,jsonp:tr}},onDocumentBody(r){document.body?r():setTimeout(()=>{this.onDocumentBody(r)},0)},createJSONPRequest(r,e){return new rr(r,e)},createScriptRequest(r){return new nr(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 Sr},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)}},A=ls,it;(function(r){r[r.ERROR=3]="ERROR",r[r.INFO=6]="INFO",r[r.DEBUG=7]="DEBUG"})(it||(it={}));var Ue=it;class hs{constructor(e,n,a){this.key=e,this.session=n,this.events=[],this.options=a||{},this.sent=0,this.uniqueID=0}log(e,n){e<=this.options.level&&(this.events.push(W({},n,{timestamp:H.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(e){this.log(Ue.ERROR,e)}info(e){this.log(Ue.INFO,e)}debug(e){this.log(Ue.DEBUG,e)}isEmpty(){return this.events.length===0}send(e,n){var a=W({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],e(a,(u,m)=>{u||this.sent++,n&&n(u,m)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class ds{constructor(e,n,a,u){this.name=e,this.priority=n,this.transport=a,this.options=u||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(e,n){if(this.isSupported()){if(this.priority{a||(I(),m?m.close():u.close())},forceMinPriority:q=>{a||this.priority{var n="socket_id="+encodeURIComponent(r.socketId);for(var a in e.params)n+="&"+encodeURIComponent(a)+"="+encodeURIComponent(e.params[a]);if(e.paramsProvider!=null){let u=e.paramsProvider();for(var a in u)n+="&"+encodeURIComponent(a)+"="+encodeURIComponent(u[a])}return n};var ys=r=>{if(typeof A.getAuthorizers()[r.transport]>"u")throw`'${r.transport}' is not a recognized auth transport`;return(e,n)=>{const a=bs(e,r);A.getAuthorizers()[r.transport](A,a,r,v.UserAuthentication,n)}};const vs=(r,e)=>{var n="socket_id="+encodeURIComponent(r.socketId);n+="&channel_name="+encodeURIComponent(r.channelName);for(var a in e.params)n+="&"+encodeURIComponent(a)+"="+encodeURIComponent(e.params[a]);if(e.paramsProvider!=null){let u=e.paramsProvider();for(var a in u)n+="&"+encodeURIComponent(a)+"="+encodeURIComponent(u[a])}return n};var ws=r=>{if(typeof A.getAuthorizers()[r.transport]>"u")throw`'${r.transport}' is not a recognized auth transport`;return(e,n)=>{const a=vs(e,r);A.getAuthorizers()[r.transport](A,a,r,v.ChannelAuthorization,n)}};const Ss=(r,e,n)=>{const a={authTransport:e.transport,authEndpoint:e.endpoint,auth:{params:e.params,headers:e.headers}};return(u,m)=>{const _=r.channel(u.channelName);n(_,a).authorize(u.socketId,m)}};function _s(r,e){let n={activityTimeout:r.activityTimeout||y.activityTimeout,cluster:r.cluster,httpPath:r.httpPath||y.httpPath,httpPort:r.httpPort||y.httpPort,httpsPort:r.httpsPort||y.httpsPort,pongTimeout:r.pongTimeout||y.pongTimeout,statsHost:r.statsHost||y.stats_host,unavailableTimeout:r.unavailableTimeout||y.unavailableTimeout,wsPath:r.wsPath||y.wsPath,wsPort:r.wsPort||y.wsPort,wssPort:r.wssPort||y.wssPort,enableStats:xs(r),httpHost:Cs(r),useTLS:ks(r),wsHost:Ts(r),userAuthenticator:Rs(r),channelAuthorizer:Ps(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 Cs(r){return r.httpHost?r.httpHost:r.cluster?`sockjs-${r.cluster}.pusher.com`:y.httpHost}function Ts(r){return r.wsHost?r.wsHost:Es(r.cluster)}function Es(r){return`ws-${r}.pusher.com`}function ks(r){return A.getProtocol()==="https:"?!0:r.forceTLS!==!1}function xs(r){return"enableStats"in r?r.enableStats:"disableStats"in r?!r.disableStats:!1}function Rs(r){const e=Object.assign(Object.assign({},y.userAuthentication),r.userAuthentication);return"customHandler"in e&&e.customHandler!=null?e.customHandler:ys(e)}function Os(r,e){let n;return"channelAuthorization"in r?n=Object.assign(Object.assign({},y.channelAuthorization),r.channelAuthorization):(n={transport:r.authTransport||y.authTransport,endpoint:r.authEndpoint||y.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&&(n.customHandler=Ss(e,n,r.authorizer))),n}function Ps(r,e){const n=Os(r,e);return"customHandler"in n&&n.customHandler!=null?n.customHandler:ws(n)}class As extends oe{constructor(e){super(function(n,a){j.debug(`No callbacks on watchlist events for ${n}`)}),this.pusher=e,this.bindWatchlistInternalEvent()}handleEvent(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 Ls(){let r,e;return{promise:new Promise((a,u)=>{r=a,e=u}),resolve:r,reject:e}}var Ns=Ls;class Is extends oe{constructor(e){super(function(n,a){j.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,a)=>{if(n){j.warn(`Error during signin: ${n}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:a.auth,user_data:a.user_data})},this.pusher=e,this.pusher.connection.bind("state_change",({previous:n,current:a})=>{n!=="connected"&&a==="connected"&&this._signin(),n==="connected"&&a!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new As(e),this.pusher.connection.bind("message",n=>{var a=n.event;a==="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{j.error(`Failed parsing user data after signin: ${e.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){j.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 Ze(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((n,a)=>{n.indexOf("pusher_internal:")===0||n.indexOf("pusher:")===0||this.emit(n,a)}),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}=Ns();e.done=!1;const a=()=>{e.done=!0};e.then(a).catch(a),this.signinDonePromise=e,this._signinDoneResolve=n}}class M{static ready(){M.isReady=!0;for(var e=0,n=M.instances.length;eA.getDefaultStrategy(this.config,u,ps);this.connection=ae.createConnectionManager(this.key,{getStrategy:a,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",u=>{var m=u.event,_=m.indexOf("pusher_internal:")===0;if(u.channel){var E=this.channel(u.channel);E&&E.handleEvent(u)}_||this.global_emitter.emit(u.event,u.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",u=>{j.warn(u)}),M.instances.push(this),this.timeline.info({instances:M.instances.length}),this.user=new Is(this),M.isReady&&this.connect()}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 ve(6e4,function(){n.send(e)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(e,n,a){return this.global_emitter.bind(e,n,a),this}unbind(e,n,a){return this.global_emitter.unbind(e,n,a),this}bind_global(e){return this.global_emitter.bind_global(e),this}unbind_global(e){return this.global_emitter.unbind_global(e),this}unbind_all(e){return this.global_emitter.unbind_all(),this}subscribeAll(){var e;for(e in this.channels.channels)this.channels.channels.hasOwnProperty(e)&&this.subscribe(e)}subscribe(e){var 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,a){return this.connection.send_event(e,n,a)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}M.instances=[],M.isReady=!1,M.logToConsole=!1,M.Runtime=A,M.ScriptReceivers=A.ScriptReceivers,M.DependenciesReceivers=A.DependenciesReceivers,M.auth_callbacks=A.auth_callbacks;var ot=o.default=M;function Us(r){if(r==null)throw"You must pass your app key when you instantiate Pusher."}A.setup(M)})])})})(dt)),dt.exports}var Ao=Po();const Lo=Oo(Ao);window.Pusher=Lo;window.Echo=new Ro({broadcaster:"reverb",key:void 0,wsHost:void 0,wsPort:80,wssPort:443,forceTLS:!0,enabledTransports:["ws","wss"]});window.axios=F;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";