vendor: 7,440 bytes, line 1
1(function(){var t,e;e=()=>(()=>{var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"t",{value:!0})};var e,n={};t.r(n),t.d(n,{AbortError:()=>s,DefaultHttpClient:()=>R,HttpClient:()=>d,HttpError:()=>o,HttpResponse:()=>u,HttpTransportType:()=>B,HubConnection:()=>W,HubConnectionBuilder:()=>tt,HubConnectionState:()=>A,JsonHubProtocol:()=>G,LogLevel:()=>e,MessageType:()=>q,NullLogger:()=>p,Subject:()=>N,TimeoutError:()=>i,TransferFormat:()=>F,VERSION:()=>g});class o extends Error{constructor(t,e){const n=new.target.prototype;super(`${t}: Status code '${e}'`),this.statusCode=e,this.__proto__=n}}class i extends Error{constructor(t="A timeout occurred."){const e=new.target.prototype;super(t),this.__proto__=e}}class s extends Error{constructor(t="An abort occurred."){const e=new.target.prototype;super(t),this.__proto__=e}}class r extends Error{constructor(t,e){const n=new.target.prototype;super(t),this.transport=e,this.errorType="UnsupportedTransportError",this.__proto__=n}}class c extends Error{constructor(t,e){const n=new.target.prototype;super(t),this.transport=e,this.errorType="DisabledTransportError",this.__proto__=n}}class a extends Error{constructor(t,e){const n=new.target.prototype;super(t),this.transport=e,this.errorType="FailedToStartTransportError",this.__proto__=n}}class h extends Error{constructor(t){const e=new.target.prototype;super(t),this.errorType="FailedToNegotiateWithServerError",this.__proto__=e}}class l extends Error{constructor(t,e){const n=new.target.prototype;super(t),this.innerErrors=e,this.__proto__=n}}class u{constructor(t,e,n){this.statusCode=t,this.statusText=e,this.content=n}}class d{get(t,e){return this.send({...e,method:"GET",url:t})}post(t,e){return this.send({...e,method:"POST",url:t})}delete(t,e){return this.send({...e,method:"DELETE",url:t})}getCookieString(t){return""}}!function(t){t[t.Trace=0]="Trace",t[t.Debug=1]="Debug",t[t.Information=2]="Information",t[t.Warning=3]="Warning",t[t.Error=4]="Error",t[t.Critical=5]="Critical",t[t.None=6]="None"}(e||(e={}));class p{constructor(){}log(t,e){}}p.instance=new p;const g="8.0.0";class f{static isRequired(t,e){if(null==t)throw new Error(`The '${e}' argument is required.`)}static isNotEmpty(t,e){if(!t||t.match(/^\s*$/))throw new Error(`The '${e}' argument should not be empty.`)}static isIn(t,e,n){if(!(t in e))throw new Error(`Unknown ${n} value: ${t}.`)}}class w{static get isBrowser(){return!w.isNode&&"object"==typeof window&&"object"==typeof window.document}static get isWebWorker(){return!w.isNode&&"object"==typeof self&&"importScripts"in self}static get isReactNative(){return!w.isNode&&"object"==typeof window&&void 0===window.document}static get isNode(){return"undefined"!=typeof process&&process.release&&"node"===process.release.name}}function m(t,e){let n="";return y(t)?(n=`Binary data of length ${t.byteLength}`,e&&(n+=`. Content: '${function(t){const e=new Uint8Array(t);return lets="",e.forEach((t=>{n+=`0x${t<16?"0":""}${t.toString(16)} `})),n.substr(0,n.length-1)}(t)}'`)):"string"==typeof t&&(n=`String data of length ${t.length}`,e&&(n+=`. Content: '${t}'`)),n}function y(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}async function b(t,n,o,i,s,r){const c={},[a,h]=S();c[a]=h,t.log(e.Trace,`(${n} transport) sending data. ${m(s,r.logMessageContent)}.`);const l=y(s)?"arraybuffer":"text",u=await o.post(i,{content:s,headers:{...c,...r.headers},responseType:l,timeout:r.timeout,withCredentials:r.withCredentials});t.log(e.Trace,`(${n} transport) request complete. Response status: ${u.statusCode}.`)}class v{constructor(t,e){this.i=t,this.h=e}dispose(){const t=this.i.observers.indexOf(this.h);t>-1&&this.i.observers.splice(t,1),0===this.i.observers.length&&this.i.cancelCallback&&this.i.cancelCallback().catch((t=>{}))}}class C{constructor(t){this.l=t,this.out=console}log(t,n){if(t>=this.l){const o=`[${(new Date).toISOString()}] ${e[t]}: ${n}`;switch(t){case e.Critical:case e.Error:this.out.error(o);break;case e.Warning:this.out.warn(o);break;case e.Information:this.out.info(o);break;default:this.out.log(o)}}}}function S(){let t="X-SignalR-User-Agent";return w.isNode&&(t="User-Agent"),[t,E(g,$(),w.isNode?"NodeJS":"Browser",I())]}function E(t,e,n,o){let i="Microsoft SignalR/";const s=t.split(".");return i+=`${s[0]}.${s[1]}`,i+=` (${t}; `,i+=e&&""!==e?`${e}; `:"Unknown OS; ",i+=`${n}`,i+=o?`; ${o}`:"; Unknown Runtime Version",i+=")",i}function $(){if(!w.isNode)return"";switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}}function I(){if(w.isNode)return process.versions.node}function T(t){return t.stack?t.stack:t.message?t.message:`${t}`}class k extends d{constructor(e){super(),this.u=e,this.p=fetch.bind(function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==t.g)return t.g;throw new Error("could not find global")}()),this.m=AbortController,this.m}async send(t){if(t.abortSignal&&t.abortSignal.aborted)throw new s;if(!t.method)throw new Error("No method defined.");if(!t.url)throw new Error("No url defined.");const n=new this.m;let r;t.abortSignal&&(t.abortSignal.onabort=()=>{n.abort(),r=new s});let c,a=null;if(t.timeout){const o=t.timeout;a=setTimeout((()=>{n.abort(),this.u.log(e.Warning,"Timeout from HTTP request."),r=new i}),o)}""===t.content&&(t.content=void 0),t.content&&(t.headers=t.headers||{},y(t.content)?t.headers["Content-Type"]="application/octet-stream":t.headers["Content-Type"]="text/plain;charset=UTF-8");try{c=await this.p(t.url,{body:t.content,cache:"no-cache",credentials:!0===t.withCredentials?"include":"same-origin",headers:{"X-Requested-With":"XMLHttpRequest",...t.headers},method:t.method,mode:"cors",redirect:"follow",signal:n.signal})}catch(t){if(r)throw r;throw this.u.log(e.Warning,`Error from HTTP request. ${t}.`),t}finally{a&&clearTimeout(a),t.abortSignal&&(t.abortSignal.onabort=null)}if(!c.ok){const t=await P(c,"text");throw new o(t||c.statusText,c.status)}const h=P(c,t.responseType),l=await h;return new u(c.status,c.statusText,l)}getCookieString(t){let e="";return w.isNode&&this.v&&this.v.getCookies(t,((t,n)=>e=n.join("; "))),e}}function P(t,e){let n;switch(e){case"arraybuffer":n=t.arrayBuffer();break;case"text":default:n=t.text();break;case"blob":case"document":case"json":throw new Error(`${e} is not supported.`)}return n}class D extends d{constructor(t){super(),this.u=t}send(t){return t.abortSignal&&t.abortSignal.aborted?Promise.reject(new s):t.method?t.url?new Promise(((n,r)=>{const c=new XMLHttpRequest;c.open(t.method,t.url,!0),c.withCredentials=void 0===t.withCredentials||t.withCredentials,c.setRequestHeader("X-Requested-With","XMLHttpRequest"),""===t.content&&(t.content=void 0),t.content&&(y(t.content)?c.setRequestHeader("Content-Type","application/octet-stream"):c.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const a=t.headers;
vendor: 1,647 bytes, line 1
1a&&Object.keys(a).forEach((t=>{c.setRequestHeader(t,a[t])})),t.responseType&&(c.responseType=t.responseType),t.abortSignal&&(t.abortSignal.onabort=()=>{c.abort(),r(new s)}),t.timeout&&(c.timeout=t.timeout),c.onload=()=>{t.abortSignal&&(t.abortSignal.onabort=null),c.status>=200&&c.status<300?n(new u(c.status,c.statusText,c.response||c.responseText)):r(new o(c.response||c.responseText||c.statusText,c.status))},c.onerror=()=>{this.u.log(e.Warning,`Error from HTTP request. ${c.status}: ${c.statusText}.`),r(new o(c.statusText,c.status))},c.ontimeout=()=>{this.u.log(e.Warning,"Timeout from HTTP request."),r(new i)},c.send(t.content)})):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class R extends d{constructor(t){if(super(),"undefined"!=typeof fetch||w.isNode)this.$=new k(t);else{if("undefined"==typeof XMLHttpRequest)throw new Error("No usable HttpClient found.");this.$=new D(t)}}send(t){return t.abortSignal&&t.abortSignal.aborted?Promise.reject(new s):t.method?t.url?this.$.send(t):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(t){return this.$.getCookieString(t)}}class x{static write(t){return`${t}${x.RecordSeparator}`}static parse(t){if(t[t.length-1]!==x.RecordSeparator)throw new Error("Message is incomplete.");const e=t.split(x.RecordSeparator);return e.pop(),e}}x.RecordSeparatorCode=30,x.RecordSeparator=String.fromCharCode(x.RecordSeparatorCode);class H{writeHandshakeRequest(t){return x.write(JSON.stringify(t))}parseHandshakeResponse(t){let e,n;if(y(t)){const o=new Uint8Array(t),i=o.indexOf(x.RecordSeparatorCode);
vendor: 5,084 bytes, line 1
1if(-1===i)throw new Error("Message is incomplete.");const s=i+1;e=String.fromCharCode.apply(null,Array.prototype.slice.call(o.slice(0,s))),n=o.byteLength>s?o.slice(s).buffer:null}else{const o=t,i=o.indexOf(x.RecordSeparator);if(-1===i)throw new Error("Message is incomplete.");const s=i+1;e=o.substring(0,s),n=o.length>s?o.substring(s):null}const o=x.parse(e),i=JSON.parse(o[0]);if(i.type)throw new Error("Expected a handshake response from the server.");return[n,i]}}var q,A;!function(t){t[t.Invocation=1]="Invocation",t[t.StreamItem=2]="StreamItem",t[t.Completion=3]="Completion",t[t.StreamInvocation=4]="StreamInvocation",t[t.CancelInvocation=5]="CancelInvocation",t[t.Ping=6]="Ping",t[t.Close=7]="Close",t[t.Ack=8]="Ack",t[t.Sequence=9]="Sequence"}(q||(q={}));class N{constructor(){this.observers=[]}next(t){for(const e of this.observers)e.next(t)}error(t){for(const e of this.observers)e.error&&e.error(t)}complete(){for(const t of this.observers)t.complete&&t.complete()}subscribe(t){return this.observers.push(t),new v(this,t)}}class L{constructor(t,e,n){this.C=1e5,this.S=[],this.k=0,this.P=!1,this.T=1,this.I=0,this._=0,this.H=!1,this.D=t,this.R=e,this.C=n}async A(t){const e=this.D.writeMessage(t);let n=Promise.resolve();if(this.U(t)){this.k++;let t=()=>{},o=()=>{};y(e)?this._+=e.byteLength:this._+=e.length,this._>=this.C&&(n=new Promise(((e,n)=>{t=e,o=n}))),this.S.push(new j(e,this.k,t,o))}try{this.H||await this.R.send(e)}catch{this.L()}await n}N(t){let e=-1;for(let n=0;n<this.S.length;n++){const o=this.S[n];if(o.q<=t.sequenceId)e=n,y(o.M)?this._-=o.M.byteLength:this._-=o.M.length,o.j();else{if(!(this._<this.C))break;o.j()}}-1!==e&&(this.S=this.S.slice(e+1))}W(t){if(this.P)return t.type===q.Sequence&&(this.P=!1,!0);if(!this.U(t))return!0;const e=this.T;return this.T++,e<=this.I?(e===this.I&&this.O(),!1):(this.I=e,this.O(),!0)}F(t){t.sequenceId>this.T?this.R.stop(new Error("Sequence ID greater than amount of messages we've received.")):this.T=t.sequenceId}L(){this.H=!0,this.P=!0}async B(){const t=0!==this.S.length?this.S[0].q:this.k+1;await this.R.send(this.D.writeMessage({type:q.Sequence,sequenceId:t}));const e=this.S;for(const t of e)await this.R.send(t.M);this.H=!1}X(t){null!=t||(t=new Error("Unable to reconnect to server."));for(const e of this.S)e.J(t)}U(t){switch(t.type){case q.Invocation:case q.StreamItem:case q.Completion:case q.StreamInvocation:case q.CancelInvocation:return!0;case q.Close:case q.Sequence:case q.Ping:case q.Ack:return!1}}O(){void 0===this.V&&(this.V=setTimeout((async()=>{try{this.H||await this.R.send(this.D.writeMessage({type:q.Ack,sequenceId:this.I}))}catch{}clearTimeout(this.V),this.V=void 0}),1e3))}}class j{constructor(t,e,n,o){this.M=t,this.q=e,this.j=n,this.J=o}}!function(t){t.Disconnected="Disconnected",t.Connecting="Connecting",t.Connected="Connected",t.Disconnecting="Disconnecting",t.Reconnecting="Reconnecting"}(A||(A={}));class W{static create(t,e,n,o,i,s,r){return new W(t,e,n,o,i,s,r)}constructor(t,n,o,i,s,r,c){this.K=0,this.G=()=>{this.u.log(e.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},f.isRequired(t,"connection"),f.isRequired(n,"logger"),f.isRequired(o,"protocol"),this.serverTimeoutInMilliseconds=null!=s?s:3e4,this.keepAliveIntervalInMilliseconds=null!=r?r:15e3,this.Y=null!=c?c:1e5,this.u=n,this.D=o,this.connection=t,this.Z=i,this.tt=new H,this.connection.onreceive=t=>this.et(t),this.connection.onclose=t=>this.st(t),this.it={},this.nt={},this.rt=[],this.ot=[],this.ht=[],this.ct=0,this.lt=!1,this.ut=A.Disconnected,this.dt=!1,this.ft=this.D.writeMessage({type:q.Ping})}get state(){return this.ut}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(t){if(this.ut!==A.Disconnected&&this.ut!==A.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!t)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=t}start(){return this.wt=this.gt(),this.wt}async gt(){if(this.ut!==A.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this.ut=A.Connecting,this.u.log(e.Debug,"Starting HubConnection.");try{await this.yt(),w.isBrowser&&window.document.addEventListener("freeze",this.G),this.ut=A.Connected,this.dt=!0,this.u.log(e.Debug,"HubConnection connected successfully.")}catch(t){return this.ut=A.Disconnected,this.u.log(e.Debug,`HubConnection failed to start successfully because of error '${t}'.`),Promise.reject(t)}}async yt(){this.bt=void 0,this.lt=!1;const t=new Promise(((t,e)=>{this.vt=t,this.Et=e}));await this.connection.start(this.D.transferFormat);try{let n=this.D.version;this.connection.features.reconnect||(n=1);const o={protocol:this.D.name,version:n};if(this.u.log(e.Debug,"Sending handshake request."),await this.$t(this.tt.writeHandshakeRequest
vendor: 4,394 bytes, line 1
1(o)),this.u.log(e.Information,`Using HubProtocol '${this.D.name}'.`),this.Ct(),this.St(),this.kt(),await t,this.bt)throw this.bt;!!this.connection.features.reconnect&&(this.Pt=new L(this.D,this.connection,this.Y),this.connection.features.disconnected=this.Pt.L.bind(this.Pt),this.connection.features.resend=()=>{if(this.Pt)return this.Pt.B()}),this.connection.features.inherentKeepAlive||await this.$t(this.ft)}catch(t){throw this.u.log(e.Debug,`Hub handshake failed with error '${t}' during start(). Stopping HubConnection.`),this.Ct(),this.Tt(),await this.connection.stop(t),t}}async stop(){const t=this.wt;this.connection.features.reconnect=!1,this.It=this._t(),await this.It;try{await t}catch(t){}}_t(t){if(this.ut===A.Disconnected)return this.u.log(e.Debug,`Call to HubConnection.stop(${t}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this.ut===A.Disconnecting)return this.u.log(e.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnecting state.`),this.It;const n=this.ut;return this.ut=A.Disconnecting,this.u.log(e.Debug,"Stopping HubConnection."),this.Ht?(this.u.log(e.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this.Ht),this.Ht=void 0,this.Dt(),Promise.resolve()):(n===A.Connected&&this.Rt(),this.Ct(),this.Tt(),this.bt=t||new s("The connection was stopped before the hub handshake could complete."),this.connection.stop(t))}async Rt(){try{await this.xt(this.At())}catch{}}stream(t,...e){const[n,o]=this.Ut(e),i=this.Lt(t,e,o);let s;const r=new N;return r.cancelCallback=()=>{const t=this.Nt(i.invocationId);return delete this.it[i.invocationId],s.then((()=>this.xt(t)))},this.it[i.invocationId]=(t,e)=>{e?r.error(e):t&&(t.type===q.Completion?t.error?r.error(new Error(t.error)):r.complete():r.next(t.item))},s=this.xt(i).catch((t=>{r.error(t),delete this.it[i.invocationId]})),this.qt(n,s),r}$t(t){return this.kt(),this.connection.send(t)}xt(t){return this.Pt?this.Pt.A(t):this.$t(this.D.writeMessage(t))}send(t,...e){const[n,o]=this.Ut(e),i=this.xt(this.Mt(t,e,!0,o));return this.qt(n,i),i}invoke(t,...e){const[n,o]=this.Ut(e),i=this.Mt(t,e,!1,o);return new Promise(((t,e)=>{this.it[i.invocationId]=(n,o)=>{o?e(o):n&&(n.type===q.Completion?n.error?e(new Error(n.error)):t(n.result):e(new Error(`Unexpected message type: ${n.type}`)))};const o=this.xt(i).catch((t=>{e(t),delete this.it[i.invocationId]}));this.qt(n,o)}))}on(t,e){t&&e&&(t=t.toLowerCase(),this.nt[t]||(this.nt[t]=[]),-1===this.nt[t].indexOf(e)&&this.nt[t].push(e))}off(t,e){if(!t)return;t=t.toLowerCase();const n=this.nt[t];if(n)if(e){const o=n.indexOf(e);-1!==o&&(n.splice(o,1),0===n.length&&delete this.nt[t])}else delete this.nt[t]}onclose(t){t&&this.rt.push(t)}onreconnecting(t){t&&this.ot.push(t)}onreconnected(t){t&&this.ht.push(t)}et(t){if(this.Ct(),this.lt||(t=this.jt(t),this.lt=!0),t){const n=this.D.parseMessages(t,this.u);for(const o of n)if(!this.Pt||this.Pt.W(o))switch(o.type){case q.Invocation:this.Wt(o);break;case q.StreamItem:case q.Completion:{const n=this.it[o.invocationId];if(n){o.type===q.Completion&&delete this.it[o.invocationId];try{n(o)}catch(t){this.u.log(e.Error,`Stream callback threw error: ${T(t)}`)}}break}case q.Ping:break;case q.Close:{this.u.log(e.Information,"Close message received from server.");const t=o.error?new Error("Server returned an error on close: "+o.error):void 0;!0===o.allowReconnect?this.connection.stop(t):this.It=this._t(t);break}case q.Ack:this.Pt&&this.Pt.N(o);break;case q.Sequence:this.Pt&&this.Pt.F(o);break;default:this.u.log(e.Warning,`Invalid message type: ${o.type}.`)}}this.St()}jt(t){let n,o;try{[o,n]=this.tt.parseHandshakeResponse(t)}catch(t){const n="Error parsing handshake response: "+t;this.u.log(e.Error,n);const o=new Error(n);throw this.Et(o),o}if(n.error){const t="Server returned handshake error: "+n.error;this.u.log(e.Error,t);const o=new Error(t);throw this.Et(o),o}return this.u.log(e.Debug,"Server handshake complete."),this.vt(),o}kt(){this.connection.features.inherentKeepAlive||(this.K=(new Date).getTime()+this.keepAliveIntervalInMilliseconds,this.Tt())}St(){if(!(this.connection.features&&this.connection.features.inherentKeepAlive||(this.Ot=setTimeout((()=>this.serverTimeout()),this.serverTimeoutInMilliseconds),void 0!==this.Ft))){let t=this.K-(new Date).getTime();t<0&&(t=0),this.Ft=setTimeout((async()=>
1{if(this.ut===A.Connected)try{await this.$t(this.ft)}catch{this.Tt()}}),t)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}async Wt(t){const n=t.target.toLowerCase(),o=this.nt[n];if(!o)return this.u.log(e.Warning,`No client method with the name '${n}' found.`),void(t.invocationId&&(this.u.log(e.Warning,`No result given for '${n}' method and invocation ID '${t.invocationId}'.`),await this.xt(this.Bt(t.invocationId,"Client didn't provide a result.",null))));const i=o.slice(),s=!!t.invocationId;let r,c,a;for(const o of i)try{const i=r;r=await o.apply(this,t.arguments),s&&r&&i&&(this.u.log(e.Error,`Multiple results provided for '${n}'. Sending error to server.`),a=this.Bt(t.invocationId,"Client provided multiple results.",null)),c=void 0}catch(t){c=t,this.u.log(e.Error,`A callback for the method '${n}' threw error '${t}'.`)}a?await this.xt(a):s?(c?a=this.Bt(t.invocationId,`${c}`,null):void 0!==r?a=this.Bt(t.invocationId,null,r):(this.u.log(e.Warning,`No result given for '${n}' method and invocation ID '${t.invocationId}'.`),a=this.Bt(t.invocationId,"Client didn't provide a result.",null)),await this.xt(a)):r&&this.u.log(e.Error,`Result given for '${n}' method but server is not expecting a result.`)}st(t){this.u.log(e.Debug,`HubConnection.connectionClosed(${t}) called while in state ${this.ut}.`),this.bt=this.bt||t||new s("The underlying connection was closed before the hub handshake could complete."),this.vt&&this.vt(),this.Xt(t||new Error("Invocation canceled due to the underlying connection being closed.")),this.Ct(),this.Tt(),this.ut===A.Disconnecting?this.Dt(t):this.ut===A.Connected&&this.Z?this.Jt(t):this.ut===A.Connected&&this.Dt(t)}Dt(t){if(this.dt){this.ut=A.Disconnected,this.dt=!1,this.Pt&&(this.Pt.X(null!=t?t:new Error("Connection closed.")),this.Pt=void 0),w.isBrowser&&window.document.removeEventListener("freeze",this.G);try{this.rt.forEach((e=>e.apply(this,[t])))}catch(n){this.u.log(e.Error,`An onclose callback called with error '${t}' threw error '${n}'.`)}}}async Jt(t){const n=Date.now();let o=0,i=void 0!==t?t:new Error("Attempting to reconnect due to a unknown error."),s=this.zt(o++,0,i);if(null===s)return this.u.log(e.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this.Dt(t);if(this.ut=A.Reconnecting,t?this.u.log(e.Information,`Connection reconnecting because of error '${t}'.`):this.u.log(e.Information,"Connection reconnecting."),0!==this.ot.length){try{this.ot.forEach((e=>e.apply(this,[t])))}catch(n){this.u.log(e.Error,`An onreconnecting callback called with error '${t}' threw error '${n}'.`)}if(this.ut!==A.Reconnecting)return void this.u.log(e.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;null!==s;){if(this.u.log(e.Information,`Reconnect attempt number ${o} will start in ${s} ms.`),await new Promise((t=>{this.Ht=setTimeout(t,s)})),this.Ht=void 0,this.ut!==A.Reconnecting)return void this.u.log(e.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this.yt(),this.ut=A.Connected,this.u.log(e.Information,"HubConnection reconnected successfully."),0!==this.ht.length)try{this.ht.forEach((t=>t.apply(this,[this.connection.connectionId])))}catch(t){this.u.log(e.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${t}'.`)}return}catch(t){if(this.u.log(e.Information,`Reconnect attempt failed because of error '${t}'.`),this.ut!==A.Reconnecting)return this.u.log(e.Debug,`Connection moved to the '${this.ut}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this.ut===A.Disconnecting&&this.Dt());i=t instanceof Error?t:new Error(t.toString()),s=this.zt(o++,Date.now()-n,i)}}this.u.log(e.Information,`Reconnect retries have been exhausted after ${Date.now()-n} ms and ${o} failed attempts. Connection disconnecting.`),this.Dt()}zt(t,n,o){try{return this.Z.nextRetryDelayInMilliseconds({elapsedMilliseconds:n,previousRetryCount:t,retryReason:o})}catch(o){return this.u.log(e.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${t}, ${n}) threw error '${o}'.`),null}}Xt(t){const n=this.it;this.it={}
vendor: 24,355 bytes, line 1
1,Object.keys(n).forEach((o=>{const i=n[o];try{i(null,t)}catch(n){this.u.log(e.Error,`Stream 'error' callback called with '${t}' threw error: ${T(n)}`)}}))}Tt(){this.Ft&&(clearTimeout(this.Ft),this.Ft=void 0)}Ct(){this.Ot&&clearTimeout(this.Ot)}Mt(t,e,n,o){if(n)return 0!==o.length?{arguments:e,streamIds:o,target:t,type:q.Invocation}:{arguments:e,target:t,type:q.Invocation};{const n=this.ct;return this.ct++,0!==o.length?{arguments:e,invocationId:n.toString(),streamIds:o,target:t,type:q.Invocation}:{arguments:e,invocationId:n.toString(),target:t,type:q.Invocation}}}qt(t,e){if(0!==t.length){e||(e=Promise.resolve());for(const n in t)t[n].subscribe({complete:()=>{e=e.then((()=>this.xt(this.Bt(n))))},error:t=>{let o;o=t instanceof Error?t.message:t&&t.toString?t.toString():"Unknown error",e=e.then((()=>this.xt(this.Bt(n,o))))},next:t=>{e=e.then((()=>this.xt(this.Vt(n,t))))}})}}Ut(t){const e=[],n=[];for(let o=0;o<t.length;o++){const i=t[o];if(this.Kt(i)){const s=this.ct;this.ct++,e[s]=i,n.push(s.toString()),t.splice(o,1)}}return[e,n]}Kt(t){return t&&t.subscribe&&"function"==typeof t.subscribe}Lt(t,e,n){const o=this.ct;return this.ct++,0!==n.length?{arguments:e,invocationId:o.toString(),streamIds:n,target:t,type:q.StreamInvocation}:{arguments:e,invocationId:o.toString(),target:t,type:q.StreamInvocation}}Nt(t){return{invocationId:t,type:q.CancelInvocation}}Vt(t,e){return{invocationId:t,item:e,type:q.StreamItem}}Bt(t,e,n){return e?{error:e,invocationId:t,type:q.Completion}:{invocationId:t,result:n,type:q.Completion}}At(){return{type:q.Close}}}const U=[0,2e3,1e4,3e4,null];class O{constructor(t){this.Gt=void 0!==t?[...t,null]:U}nextRetryDelayInMilliseconds(t){return this.Gt[t.previousRetryCount]}}class _{}_.Authorization="Authorization",_.Cookie="Cookie";class M extends d{constructor(t,e){super(),this.Qt=t,this.Yt=e}async send(t){let e=!0;this.Yt&&(!this.Zt||t.url&&t.url.indexOf("/negotiate?")>0)&&(e=!1,this.Zt=await this.Yt()),this.te(t);const n=await this.Qt.send(t);return e&&401===n.statusCode&&this.Yt?(this.Zt=await this.Yt(),this.te(t),await this.Qt.send(t)):n}te(t){t.headers||(t.headers={}),this.Zt?t.headers[_.Authorization]=`Bearer ${this.Zt}`:this.Yt&&t.headers[_.Authorization]&&delete t.headers[_.Authorization]}getCookieString(t){return this.Qt.getCookieString(t)}}var B,F;!function(t){t[t.None=0]="None",t[t.WebSockets=1]="WebSockets",t[t.ServerSentEvents=2]="ServerSentEvents",t[t.LongPolling=4]="LongPolling"}(B||(B={})),function(t){t[t.Text=1]="Text",t[t.Binary=2]="Binary"}(F||(F={}));class z{constructor(){this.ee=!1,this.onabort=null}abort(){this.ee||(this.ee=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this.ee}}class Y{get pollAborted(){return this.se.aborted}constructor(t,e,n){this.$=t,this.u=e,this.se=new z,this.ie=n,this.ne=!1,this.onreceive=null,this.onclose=null}async connect(t,n){if(f.isRequired(t,"url"),f.isRequired(n,"transferFormat"),f.isIn(n,F,"transferFormat"),this.re=t,this.u.log(e.Trace,"(LongPolling transport) Connecting."),n===F.Binary&&"undefined"!=typeof XMLHttpRequest&&"string"!=typeof(new XMLHttpRequest).responseType)throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[i,s]=S(),r={[i]:s,...this.ie.headers},c={abortSignal:this.se.signal,headers:r,timeout:1e5,withCredentials:this.ie.withCredentials};n===F.Binary&&(c.responseType="arraybuffer");const a=`${t}&_=${Date.now()}`;this.u.log(e.Trace,`(LongPolling transport) polling: ${a}.`);const h=await this.$.get(a,c);200!==h.statusCode?(this.u.log(e.Error,`(LongPolling transport) Unexpected response code: ${h.statusCode}.`),this.oe=new o(h.statusText||"",h.statusCode),this.ne=!1):this.ne=!0,this.he=this.ce(this.re,c)}async ce(t,n){try{for(;this.ne;)try{const i=`${t}&_=${Date.now()}`;this.u.log(e.Trace,`(LongPolling transport) polling: ${i}.`);const s=await this.$.get(i,n);204===s.statusCode?(this.u.log(e.Information,"(LongPolling transport) Poll terminated by server."),this.ne=!1):200!==s.statusCode?(this.u.log(e.Error,`(LongPolling transport) Unexpected response code: ${s.statusCode}.`),this.oe=new o(s.statusText||"",s.statusCode),this.ne=!1):s.content?(this.u.log(e.Trace,`(LongPolling transport) data received. ${m(s.content,this.ie.logMessageContent)}.`),this.onreceive&&this.onreceive(s.content)):this.u.log(e.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(t){this.ne?t instanceof i?this.u.log(e.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this.oe=t,this.ne=!1):this.u.log(e.Trace,`(LongPolling transport) Poll errored after shutdown: ${t.message}`)}}finally{this.u.log(e.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this.ae()}}async send(t){return this.ne?b(this.u,"LongPolling",this.$,this.re,t,this.ie):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this.u.log(e.Trace,"(LongPolling transport) Stopping polling."),this.ne=!1,this.se.abort();try{await this.he,this.u.log(e.Trace,`(LongPolling transport) sending DELETE request to ${this.re}.`);const t={},[n,i]=S();t[n]=i;const s={headers:{...t,...this.ie.headers},timeout:this.ie.timeout,withCredentials:this.ie.withCredentials};let r;try{await this.$.delete(this.re,s)}catch(t){r=t}r?r instanceof o&&(404===r.statusCode?this.u.log(e.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this.u.log(e.Trace,`(LongPolling transport) Error sending a DELETE request: ${r}`)):this.u.log(e.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this.u.log(e.Trace,"(LongPolling transport) Stop finished."),this.ae()}}ae(){if(this.onclose){let t="(LongPolling transport) Firing onclose event.";this.oe&&(t+=" Error: "+this.oe),this.u.log(e.Trace,t),this.onclose(this.oe)}}}class X{constructor(t,e,n,o){this.$=t,this.Zt=e,this.u=n,this.ie=o,this.onreceive=null,this.onclose=null}async connect(t,n){return f.isRequired(t,"url"),f.isRequired(n,"transferFormat"),f.isIn(n,F,"transferFormat"),this.u.log(e.Trace,"(SSE transport) Connecting."),this.re=t,this.Zt&&(t+=(t.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this.Zt)}`),new Promise(((o,i)=>{let s,r=!1;if(n===F.Text){if(w.isBrowser||w.isWebWorker)s=new this.ie.EventSource(t,{withCredentials:this.ie.withCredentials});else{const e=this.$.getCookieString(t),n={};n.Cookie=e;const[o,i]=S();n[o]=i,s=new this.ie.EventSource(t,{withCredentials:this.ie.withCredentials,headers:{...n,...this.ie.headers}})}try{s.onmessage=t=>{if(this.onreceive)try{this.u.log(e.Trace,`(SSE transport) data received. ${m(t.data,this.ie.logMessageContent)}.`),this.onreceive(t.data)}catch(t){return void this.le(t)}},s.onerror=t=>{r?this.le():i(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},s.onopen=()=>{this.u.log(e.Information,`SSE connected to ${this.re}`),this.ue=s,r=!0,o()}}catch(t){return void i(t)}}else i(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))}))}async send(t){return this.ue?b(this.u,"SSE",this.$,this.re,t,this.ie):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this.le(),Promise.resolve()}le(t){this.ue&&(this.ue.close(),this.ue=void 0,this.onclose&&this.onclose(t))}}class V{constructor(t,e,n,o,i,s){this.u=n,this.Yt=e,this.de=o,this.fe=i,this.$=t,this.onreceive=null,this.onclose=null,this.pe=s}async connect(t,n){let o;return f.isRequired(t,"url"),f.isRequired(n,"transferFormat"),f.isIn(n,F,"transferFormat"),this.u.log(e.Trace,"(WebSockets transport) Connecting."),this.Yt&&(o=await this.Yt()),new Promise(((i,s)=>{let r;t=t.replace(/^http/,"ws");const c=this.$.getCookieString(t);let a=!1;if(w.isNode||w.isReactNative){const e={},[n,i]=S();e[n]=i,o&&(e[_.Authorization]=`Bearer ${o}`),c&&(e[_.Cookie]=c),r=new this.fe(t,void 0,{headers:{...e,...this.pe}})}else o&&(t+=(t.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(o)}`);r||(r=new this.fe(t)),n===F.Binary&&(r.binaryType="arraybuffer"),r.onopen=n=>{this.u.log(e.Information,`WebSocket connected to ${t}.`),this.we=r,a=!0,i()},r.onerror=t=>{let n=null;n="undefined"!=typeof ErrorEvent&&t instanceof ErrorEvent?t.error:"There was an error with the transport",this.u.log(e.Information,`(WebSockets transport) ${n}.`)},r.onmessage=t=>{if(this.u.log(e.Trace,`(WebSockets transport) data received. ${m(t.data,this.de)}.`),this.onreceive)try{this.onreceive(t.data)}catch(t){return void this.le(t)}},r.onclose=t=>{if(a)this.le(t);else{let e=null;e="undefined"!=typeof ErrorEvent&&t instanceof ErrorEvent?t.error:"WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",s(new Error(e))}}}))}send(t){return this.we&&this.we.readyState===this.fe.OPEN?(this.u.log(e.Trace,`(WebSockets transport) sending data. ${m(t,this.de)}.`),this.we.send(t),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this.we&&this.le(void 0),Promise.resolve()}le(t){this.we&&(this.we.onclose=()=>{},this.we.onmessage=()=>{},this.we.onerror=()=>{},this.we.close(),this.we=void 0),this.u.log(e.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this.ge(t)||!1!==t.wasClean&&1e3===t.code?t instanceof Error?this.onclose(t):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${t.code} (${t.reason||"no reason given"}).`)))}ge(t){return t&&"boolean"==typeof t.wasClean&&"number"==typeof t.code}}class J{constructor(t,n={}){var o;if(this.me=()=>{},this.features={},this.ye=1,f.isRequired(t,"url"),this.u=void 0===(o=n.logger)?new C(e.Information):null===o?p.instance:void 0!==o.log?o:new C(o),this.baseUrl=this.be(t),(n=n||{}).logMessageContent=void 0!==n.logMessageContent&&n.logMessageContent,"boolean"!=typeof n.withCredentials&&void 0!==n.withCredentials)throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");n.withCredentials=void 0===n.withCredentials||n.withCredentials,n.timeout=void 0===n.timeout?1e5:n.timeout;let i=null,s=null;w.isNode&&(i=function(){throw new Error("Trying to import 'ws' in the browser.")}(),s=function(){throw new Error("Trying to import 'eventsource' in the browser.")}()),w.isNode||"undefined"==typeof WebSocket||n.WebSocket?w.isNode&&!n.WebSocket&&i&&(n.WebSocket=i):n.WebSocket=WebSocket,w.isNode||"undefined"==typeof EventSource||n.EventSource?w.isNode&&!n.EventSource&&void 0!==s&&(n.EventSource=s):n.EventSource=EventSource,this.$=new M(n.httpClient||new R(this.u),n.accessTokenFactory),this.ut="Disconnected",this.dt=!1,this.ie=n,this.onreceive=null,this.onclose=null}async start(t){if(t=t||F.Binary,f.isIn(t,F,"transferFormat"),this.u.log(e.Debug,`Starting connection with transfer format '${F[t]}'.`),"Disconnected"!==this.ut)return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this.ut="Connecting",this.ve=this.yt(t),await this.ve,"Disconnecting"===this.ut){const t="Failed to start the HttpConnection before stop() was called.";return this.u.log(e.Error,t),await this.It,Promise.reject(new s(t))}if("Connected"!==this.ut){const t="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this.u.log(e.Error,t),Promise.reject(new s(t))}this.dt=!0}send(t){return"Connected"!==this.ut?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this.Ee||(this.Ee=new Z(this.transport)),this.Ee.send(t))}async stop(t){return"Disconnected"===this.ut?(this.u.log(e.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):"Disconnecting"===this.ut?(this.u.log(e.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnecting state.`),this.It):(this.ut="Disconnecting",this.It=new Promise((t=>{this.me=t})),await this._t(t),void await this.It)}async _t(t){this.$e=t;try{await this.ve}catch(t){}if(this.transport){try{await this.transport.stop()}catch(t){this.u.log(e.Error,`HttpConnection.transport.stop() threw error '${t}'.`),this.Ce()}this.transport=void 0}else this.u.log(e.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async yt(t){let n=this.baseUrl;this.Yt=this.ie.accessTokenFactory,this.$.Yt=this.Yt;try{if(this.ie.skipNegotiation){if(this.ie.transport!==B.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this.Se(B.WebSockets),await this.ke(n,t)}else{let e=null,o=0;do{if(e=await this.Pe(n),"Disconnecting"===this.ut||"Disconnected"===this.ut)throw new s("The connection was stopped during negotiation.");if(e.error)throw new Error(e.error);if(e.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(e.url&&(n=e.url),e.accessToken){const t=e.accessToken;this.Yt=()=>t,this.$.Zt=t,this.$.Yt=void 0}o++}while(e.url&&o<100);if(100===o&&e.url)throw new Error("Negotiate redirection limit exceeded.");await this.Te(n,this.ie.transport,e,t)}this.transport instanceof Y&&(this.features.inherentKeepAlive=!0),"Connecting"===this.ut&&(this.u.log(e.Debug,"The HttpConnection connected successfully."),this.ut="Connected")}catch(t){return this.u.log(e.Error,"Failed to start the connection: "+t),this.ut="Disconnected",this.transport=void 0,this.me(),Promise.reject(t)}}async Pe(t){const n={},[i,s]=S();n[i]=s;const r=this.Ie(t);this.u.log(e.Debug,`Sending negotiation request: ${r}.`);try{const t=await this.$.post(r,{content:"",headers:{...n,...this.ie.headers},timeout:this.ie.timeout,withCredentials:this.ie.withCredentials});if(200!==t.statusCode)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${t.statusCode}'`));const e=JSON.parse(t.content);return(!e.negotiateVersion||e.negotiateVersion<1)&&(e.connectionToken=e.connectionId),e.useStatefulReconnect&&!0!==this.ie._e?Promise.reject(new h("Client didn't negotiate Stateful Reconnect but the server did.")):e}catch(t){let n="Failed to complete negotiation with the server: "+t;return t instanceof o&&404===t.statusCode&&(n+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this.u.log(e.Error,n),Promise.reject(new h(n))}}He(t,e){return e?t+(-1===t.indexOf("?")?"?":"&")+`id=${e}`:t}async Te(t,n,o,i){let r=this.He(t,o.connectionToken);if(this.De(n))return this.u.log(e.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=n,await this.ke(r,i),void(this.connectionId=o.connectionId);const c=[],h=o.availableTransports||[];let u=o;for(const o of h){const h=this.Re(o,n,i,!0===(null==u?void 0:u.useStatefulReconnect));if(h instanceof Error)c.push(`${o.transport} failed:`),c.push(h);else if(this.De(h)){if(this.transport=h,!u){try{u=await this.Pe(t)}catch(t){return Promise.reject(t)}r=this.He(t,u.connectionToken)}try{return await this.ke(r,i),void(this.connectionId=u.connectionId)}catch(t){if(this.u.log(e.Error,`Failed to start the transport '${o.transport}': ${t}`),u=void 0,c.push(new a(`${o.transport} failed: ${t}`,B[o.transport])),"Connecting"!==this.ut){const t="Failed to select transport before stop() was called.";return this.u.log(e.Debug,t),Promise.reject(new s(t))}}}}return c.length>0?Promise.reject(new l(`Unable to connect to the server with any of the available transports. ${c.join(" ")}`,c)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))}Se(t){switch(t){case B.WebSockets:if(!this.ie.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new V(this.$,this.Yt,this.u,this.ie.logMessageContent,this.ie.WebSocket,this.ie.headers||{});case B.ServerSentEvents:if(!this.ie.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new X(this.$,this.$.Zt,this.u,this.ie);case B.LongPolling:return new Y(this.$,this.u,this.ie);default:throw new Error(`Unknown transport: ${t}.`)}}ke(t,e){return this.transport.onreceive=this.onreceive,this.features.reconnect?this.transport.onclose=async n=>{let o=!1;if(this.features.reconnect){try{this.features.disconnected(),await this.transport.connect(t,e),await this.features.resend()}catch{o=!0}o&&this.Ce(n)}else this.Ce(n)}:this.transport.onclose=t=>this.Ce(t),this.transport.connect(t,e)}Re(t,n,o,i){const s=B[t.transport];if(null==s)return this.u.log(e.Debug,`Skipping transport '${t.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${t.transport}' because it is not supported by this client.`);if(!function(t,e){return!t||0!=(e&t)}(n,s))return this.u.log(e.Debug,`Skipping transport '${B[s]}' because it was disabled by the client.`),new c(`'${B[s]}' is disabled by the client.`,s);if(!(t.transferFormats.map((t=>F[t])).indexOf(o)>=0))return this.u.log(e.Debug,`Skipping transport '${B[s]}' because it does not support the requested transfer format '${F[o]}'.`),new Error(`'${B[s]}' does not support ${F[o]}.`);if(s===B.WebSockets&&!this.ie.WebSocket||s===B.ServerSentEvents&&!this.ie.EventSource)return this.u.log(e.Debug,`Skipping transport '${B[s]}' because it is not supported in your environment.'`),new r(`'${B[s]}' is not supported in your environment.`,s);this.u.log(e.Debug,`Selecting transport '${B[s]}'.`);try{return this.features.reconnect=s===B.WebSockets?i:void 0,this.Se(s)}catch(t){return t}}De(t){return t&&"object"==typeof t&&"connect"in t}Ce(t){if(this.u.log(e.Debug,`HttpConnection.stopConnection(${t}) called while in state ${this.ut}.`),this.transport=void 0,t=this.$e||t,this.$e=void 0,"Disconnected"!==this.ut){if("Connecting"===this.ut)throw this.u.log(e.Warning,`Call to HttpConnection.stopConnection(${t}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${t}) was called while the connection is still in the connecting state.`);if("Disconnecting"===this.ut&&this.me(),t?this.u.log(e.Error,`Connection disconnected with error '${t}'.`):this.u.log(e.Information,"Connection disconnected."),this.Ee&&(this.Ee.stop().catch((t=>{this.u.log(e.Error,`TransportSendQueue.stop() threw error '${t}'.`)})),this.Ee=void 0),this.connectionId=void 0,this.ut="Disconnected",this.dt){this.dt=!1;try{this.onclose&&this.onclose(t)}catch(n){this.u.log(e.Error,`HttpConnection.onclose(${t}) threw error '${n}'.`)}}}else this.u.log(e.Debug,`Call to HttpConnection.stopConnection(${t}) was ignored because the connection is already in the disconnected state.`)}be(t){if(0===t.lastIndexOf("https://",0)||0===t.lastIndexOf("http://",0))return t;if(!w.isBrowser)throw new Error(`Cannot resolve '${t}'.`);const n=window.document.createElement("a");return n.href=t,this.u.log(e.Information,`Normalizing '${t}' to '${n.href}'.`),n.href}Ie(t){const e=new URL(t);e.pathname.endsWith("/")?e.pathname+="negotiate":e.pathname+="/negotiate";const n=new URLSearchParams(e.searchParams);return n.has("negotiateVersion")||n.append("negotiateVersion",this.ye.toString()),n.has("useStatefulReconnect")?"true"===n.get("useStatefulReconnect")&&(this.ie._e=!0):!0===this.ie._e&&n.append("useStatefulReconnect","true"),e.search=n.toString(),e.toString()}}class Z{constructor(t){this.xe=t,this.Ae=[],this.Ue=!0,this.Le=new K,this.Ne=new K,this.qe=this.Me()}send(t){return this.je(t),this.Ne||(this.Ne=new K),this.Ne.promise}stop(){return this.Ue=!1,this.Le.resolve(),this.qe}je(t){if(this.Ae.length&&typeof this.Ae[0]!=typeof t)throw new Error(`Expected data to be of type ${typeof this.Ae} but was of type ${typeof t}`);this.Ae.push(t),this.Le.resolve()}async Me(){for(;;){if(await this.Le.promise,!this.Ue){this.Ne&&this.Ne.reject("Connection stopped.");break}this.Le=new K;const t=this.Ne;this.Ne=void 0;const e="string"==typeof this.Ae[0]?this.Ae.join(""):Z.We(this.Ae);this.Ae.length=0;try{await this.xe.send(e),t.resolve()}catch(e){t.reject(e)}}}static We(t){const e=t.map((t=>t.byteLength)).reduce(((t,e)=>t+e)),n=new Uint8Array(e);let o=0;for(const e of t)n.set(new Uint8Array(e),o),o+=e.byteLength;return n.buffer}}class K{constructor(){this.promise=new Promise(((t,e)=>[this.j,this.Oe]=[t,e]))}resolve(){this.j()}reject(t){this.Oe(t)}}class G{constructor(){this.name="json",this.version=2,this.transferFormat=F.Text}parseMessages(t,n){if("string"!=typeof t)throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!t)return[];null===n&&(n=p.instance);const o=x.parse(t),i=[];for(const t of o){const o=JSON.parse(t);if("number"!=typeof o.type)throw new Error("Invalid payload.");switch(o.type){case q.Invocation:this.U(o);break;case q.StreamItem:this.Fe(o);break;case q.Completion:this.Be(o);break;case q.Ping:case q.Close:break;case q.Ack:this.Xe(o);break;case q.Sequence:this.Je(o);break;default:n.log(e.Information,"Unknown message type '"+o.type+"' ignored.");continue}i.push(o)}return i}writeMessage(t){return x.write(JSON.stringify(t))}U(t){this.ze(t.target,"Invalid payload for Invocation message."),void 0!==t.invocationId&&this.ze(t.invocationId,"Invalid payload for Invocation message.")}Fe(t){if(this.ze(t.invocationId,"Invalid payload for StreamItem message."),void 0===t.item)throw new Error("Invalid payload for StreamItem message.")}Be(t){if(t.result&&t.error)throw new Error("Invalid payload for Completion message.");!t.result&&t.error&&this.ze(t.error,"Invalid payload for Completion message."),this.ze(t.invocationId,"Invalid payload for Completion message.")}Xe(t){if("number"!=typeof t.sequenceId)throw new Error("Invalid SequenceId for Ack message.")}Je(t){if("number"!=typeof t.sequenceId)throw new Error("Invalid SequenceId for Sequence message.")}ze(t,e){if("string"!=typeof t||""===t)throw new Error(e)}}const Q={trace:e.Trace,debug:e.Debug,info:e.Information,information:e.Information,warn:e.Warning,warning:e.Warning,error:e.Error,critical:e.Critical,none:e.None};class tt{configureLogging(t){if(f.isRequired(t,"logging"),void 0!==t.log)this.logger=t;else if("string"==typeof t){const e=function(t){const e=Q[t.toLowerCase()];if(void 0!==e)return e;throw new Error(`Unknown log level: ${t}`)}(t);this.logger=new C(e)}else this.logger=new C(t);return this}withUrl(t,e){return f.isRequired(t,"url"),f.isNotEmpty(t,"url"),this.url=t,this.httpConnectionOptions="object"==typeof e?{...this.httpConnectionOptions,...e}:{...this.httpConnectionOptions,transport:e},this}withHubProtocol(t){return f.isRequired(t,"protocol"),this.protocol=t,this}withAutomaticReconnect(t){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return t?Array.isArray(t)?this.reconnectPolicy=new O(t):this.reconnectPolicy=t:this.reconnectPolicy=new O,this}withServerTimeout(t){return f.isRequired(t,"milliseconds"),this.Ve=t,this}withKeepAliveInterval(t){return f.isRequired(t,"milliseconds"),this.Ke=t,this}withStatefulReconnect(t){return void 0===this.httpConnectionOptions&&(this.httpConnectionOptions={}),this.httpConnectionOptions._e=!0,this.Y=null==t?void 0:t.bufferSize,this}build(){const t=this.httpConnectionOptions||{};if(void 0===t.logger&&(t.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const e=new J(this.url,t);return W.create(e,this.logger||p.instance,this.protocol||new G,this.reconnectPolicy,this.Ve,this.Ke,this.Y)}}return Uint8Array.prototype.indexOf||Object.defineProperty(Uint8Array.prototype,"indexOf",{value:Array.prototype.indexOf,writable:!0}),Uint8Array.prototype.slice||Object.defineProperty(Uint8Array.prototype,"slice",{value:function(t,e){return new Uint8Array(Array.prototype.slice.call(this,t,e))},writable:!0}),Uint8Array.prototype.forEach||Object.defineProperty(Uint8Array.prototype,"forEach",{value:Array.prototype.forEach,writable:!0}),n})(),(t=self).signalR=e();})()
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.