diff --git a/src/Components/Web.JS/dist/Release/blazor.server.js b/src/Components/Web.JS/dist/Release/blazor.server.js
index 12213a01490a..a3420b40f14d 100644
--- a/src/Components/Web.JS/dist/Release/blazor.server.js
+++ b/src/Components/Web.JS/dist/Release/blazor.server.js
@@ -1 +1 @@
-(()=>{var e={778:()=>{},77:()=>{},203:()=>{},200:()=>{},628:()=>{},321:()=>{}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),(()=>{"use strict";var e,t,r;!function(e){const t=[],n="__jsObjectId",r="__dotNetObject",o="__byte[]",s="__dotNetStream",i="__jsStreamReferenceLength";let a,c;class l{constructor(e){this._jsObject=e,this._cachedFunctions=new Map}findFunction(e){const t=this._cachedFunctions.get(e);if(t)return t;let n,r=this._jsObject;if(e.split(".").forEach((t=>{if(!(t in r))throw new Error(`Could not find '${e}' ('${t}' was undefined).`);n=r,r=r[t]})),r instanceof Function)return r=r.bind(n),this._cachedFunctions.set(e,r),r;throw new Error(`The value '${e}' is not a function.`)}getWrappedObject(){return this._jsObject}}const h={0:new l(window)};h[0]._cachedFunctions.set("import",(e=>("string"==typeof e&&e.startsWith("./")&&(e=new URL(e.substr(2),document.baseURI).toString()),import(e))));let d,u=1;function p(e){t.push(e)}function f(e){if(e&&"object"==typeof e){h[u]=new l(e);const t={[n]:u};return u++,t}throw new Error(`Cannot create a JSObjectReference from the value '${e}'.`)}function g(e){let t=-1;if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Blob)t=e.size;else{if(!(e.buffer instanceof ArrayBuffer))throw new Error("Supplied value is not a typed array or blob.");if(void 0===e.byteLength)throw new Error(`Cannot create a JSStreamReference from the value '${e}' as it doesn't have a byteLength.`);t=e.byteLength}const r={[i]:t};try{const t=f(e);r[n]=t[n]}catch(t){throw new Error(`Cannot create a JSStreamReference from the value '${e}'.`)}return r}function m(e,n){c=e;const r=n?JSON.parse(n,((e,n)=>t.reduce(((t,n)=>n(e,t)),n))):null;return c=void 0,r}function v(){if(void 0===a)throw new Error("No call dispatcher has been set.");if(null===a)throw new Error("There are multiple .NET runtimes present, so a default dispatcher could not be resolved. Use DotNetObject to invoke .NET instance methods.");return a}e.attachDispatcher=function(e){const t=new y(e);return void 0===a?a=t:a&&(a=null),t},e.attachReviver=p,e.invokeMethod=function(e,t,...n){return v().invokeDotNetStaticMethod(e,t,...n)},e.invokeMethodAsync=function(e,t,...n){return v().invokeDotNetStaticMethodAsync(e,t,...n)},e.createJSObjectReference=f,e.createJSStreamReference=g,e.disposeJSObjectReference=function(e){const t=e&&e[n];"number"==typeof t&&b(t)},function(e){e[e.Default=0]="Default",e[e.JSObjectReference=1]="JSObjectReference",e[e.JSStreamReference=2]="JSStreamReference",e[e.JSVoidResult=3]="JSVoidResult"}(d=e.JSCallResultType||(e.JSCallResultType={}));class y{constructor(e){this._dotNetCallDispatcher=e,this._byteArraysToBeRevived=new Map,this._pendingDotNetToJSStreams=new Map,this._pendingAsyncCalls={},this._nextAsyncCallId=1}getDotNetCallDispatcher(){return this._dotNetCallDispatcher}invokeJSFromDotNet(e,t,n,r){const o=m(this,t),s=I(_(e,r)(...o||[]),n);return null==s?null:T(this,s)}beginInvokeJSFromDotNet(e,t,n,r,o){const s=new Promise((e=>{const r=m(this,n);e(_(t,o)(...r||[]))}));e&&s.then((t=>T(this,[e,!0,I(t,r)]))).then((t=>this._dotNetCallDispatcher.endInvokeJSFromDotNet(e,!0,t)),(t=>this._dotNetCallDispatcher.endInvokeJSFromDotNet(e,!1,JSON.stringify([e,!1,w(t)]))))}endInvokeDotNetFromJS(e,t,n){const r=t?m(this,n):new Error(n);this.completePendingCall(parseInt(e,10),t,r)}invokeDotNetStaticMethod(e,t,...n){return this.invokeDotNetMethod(e,t,null,n)}invokeDotNetStaticMethodAsync(e,t,...n){return this.invokeDotNetMethodAsync(e,t,null,n)}invokeDotNetMethod(e,t,n,r){if(this._dotNetCallDispatcher.invokeDotNetFromJS){const o=T(this,r),s=this._dotNetCallDispatcher.invokeDotNetFromJS(e,t,n,o);return s?m(this,s):null}throw new Error("The current dispatcher does not support synchronous calls from JS to .NET. Use invokeDotNetMethodAsync instead.")}invokeDotNetMethodAsync(e,t,n,r){if(e&&n)throw new Error(`For instance method calls, assemblyName should be null. Received '${e}'.`);const o=this._nextAsyncCallId++,s=new Promise(((e,t)=>{this._pendingAsyncCalls[o]={resolve:e,reject:t}}));try{const s=T(this,r);this._dotNetCallDispatcher.beginInvokeDotNetFromJS(o,e,t,n,s)}catch(e){this.completePendingCall(o,!1,e)}return s}receiveByteArray(e,t){this._byteArraysToBeRevived.set(e,t)}processByteArray(e){const t=this._byteArraysToBeRevived.get(e);return t?(this._byteArraysToBeRevived.delete(e),t):null}supplyDotNetStream(e,t){if(this._pendingDotNetToJSStreams.has(e)){const n=this._pendingDotNetToJSStreams.get(e);this._pendingDotNetToJSStreams.delete(e),n.resolve(t)}else{const n=new C;n.resolve(t),this._pendingDotNetToJSStreams.set(e,n)}}getDotNetStreamPromise(e){let t;if(this._pendingDotNetToJSStreams.has(e))t=this._pendingDotNetToJSStreams.get(e).streamPromise,this._pendingDotNetToJSStreams.delete(e);else{const n=new C;this._pendingDotNetToJSStreams.set(e,n),t=n.streamPromise}return t}completePendingCall(e,t,n){if(!this._pendingAsyncCalls.hasOwnProperty(e))throw new Error(`There is no pending async call with ID ${e}.`);const r=this._pendingAsyncCalls[e];delete this._pendingAsyncCalls[e],t?r.resolve(n):r.reject(n)}}function w(e){return e instanceof Error?`${e.message}\n${e.stack}`:e?e.toString():"null"}function _(e,t){const n=h[t];if(n)return n.findFunction(e);throw new Error(`JS object instance with ID ${t} does not exist (has it been disposed?).`)}function b(e){delete h[e]}e.findJSFunction=_,e.disposeJSObjectReferenceById=b;class S{constructor(e,t){this._id=e,this._callDispatcher=t}invokeMethod(e,...t){return this._callDispatcher.invokeDotNetMethod(null,e,this._id,t)}invokeMethodAsync(e,...t){return this._callDispatcher.invokeDotNetMethodAsync(null,e,this._id,t)}dispose(){this._callDispatcher.invokeDotNetMethodAsync(null,"__Dispose",this._id,null).catch((e=>console.error(e)))}serializeAsArg(){return{[r]:this._id}}}e.DotNetObject=S,p((function(e,t){if(t&&"object"==typeof t){if(t.hasOwnProperty(r))return new S(t[r],c);if(t.hasOwnProperty(n)){const e=t[n],r=h[e];if(r)return r.getWrappedObject();throw new Error(`JS object instance with Id '${e}' does not exist. It may have been disposed.`)}if(t.hasOwnProperty(o)){const e=t[o],n=c.processByteArray(e);if(void 0===n)throw new Error(`Byte array index '${e}' does not exist.`);return n}if(t.hasOwnProperty(s)){const e=t[s],n=c.getDotNetStreamPromise(e);return new E(n)}}return t}));class E{constructor(e){this._streamPromise=e}stream(){return this._streamPromise}async arrayBuffer(){return new Response(await this.stream()).arrayBuffer()}}class C{constructor(){this.streamPromise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}function I(e,t){switch(t){case d.Default:return e;case d.JSObjectReference:return f(e);case d.JSStreamReference:return g(e);case d.JSVoidResult:return null;default:throw new Error(`Invalid JS call result type '${t}'.`)}}let k=0;function T(e,t){k=0,c=e;const n=JSON.stringify(t,D);return c=void 0,n}function D(e,t){if(t instanceof S)return t.serializeAsArg();if(t instanceof Uint8Array){c.getDotNetCallDispatcher().sendByteArray(k,t);const e={[o]:k};return k++,e}return t}}(e||(e={})),function(e){e[e.prependFrame=1]="prependFrame",e[e.removeFrame=2]="removeFrame",e[e.setAttribute=3]="setAttribute",e[e.removeAttribute=4]="removeAttribute",e[e.updateText=5]="updateText",e[e.stepIn=6]="stepIn",e[e.stepOut=7]="stepOut",e[e.updateMarkup=8]="updateMarkup",e[e.permutationListEntry=9]="permutationListEntry",e[e.permutationListEnd=10]="permutationListEnd"}(t||(t={})),function(e){e[e.element=1]="element",e[e.text=2]="text",e[e.attribute=3]="attribute",e[e.component=4]="component",e[e.region=5]="region",e[e.elementReferenceCapture=6]="elementReferenceCapture",e[e.markup=8]="markup",e[e.namedEvent=10]="namedEvent"}(r||(r={}));class o{constructor(e,t){this.componentId=e,this.fieldValue=t}static fromEvent(e,t){const n=t.target;if(n instanceof Element){const t=function(e){return e instanceof HTMLInputElement?e.type&&"checkbox"===e.type.toLowerCase()?{value:e.checked}:{value:e.value}:e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement?{value:e.value}:null}(n);if(t)return new o(e,t.value)}return null}}const s=new Map,i=new Map,a=[];function c(e){return s.get(e)}function l(e){const t=s.get(e);return(null==t?void 0:t.browserEventName)||e}function h(e,t){e.forEach((e=>s.set(e,t)))}function d(e){const t=[];for(let n=0;ne.selected)).map((e=>e.value))}}{const e=function(e){return!!e&&"INPUT"===e.tagName&&"checkbox"===e.getAttribute("type")}(t);return{value:e?!!t.checked:t.value}}}}),h(["copy","cut","paste"],{createEventArgs:e=>({type:e.type})}),h(["drag","dragend","dragenter","dragleave","dragover","dragstart","drop"],{createEventArgs:e=>{return{...u(t=e),dataTransfer:t.dataTransfer?{dropEffect:t.dataTransfer.dropEffect,effectAllowed:t.dataTransfer.effectAllowed,files:Array.from(t.dataTransfer.files).map((e=>e.name)),items:Array.from(t.dataTransfer.items).map((e=>({kind:e.kind,type:e.type}))),types:t.dataTransfer.types}:null};var t}}),h(["focus","blur","focusin","focusout"],{createEventArgs:e=>({type:e.type})}),h(["keydown","keyup","keypress"],{createEventArgs:e=>{return{key:(t=e).key,code:t.code,location:t.location,repeat:t.repeat,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,type:t.type};var t}}),h(["contextmenu","click","mouseover","mouseout","mousemove","mousedown","mouseup","mouseleave","mouseenter","dblclick"],{createEventArgs:e=>u(e)}),h(["error"],{createEventArgs:e=>{return{message:(t=e).message,filename:t.filename,lineno:t.lineno,colno:t.colno,type:t.type};var t}}),h(["loadstart","timeout","abort","load","loadend","progress"],{createEventArgs:e=>{return{lengthComputable:(t=e).lengthComputable,loaded:t.loaded,total:t.total,type:t.type};var t}}),h(["touchcancel","touchend","touchmove","touchenter","touchleave","touchstart"],{createEventArgs:e=>{return{detail:(t=e).detail,touches:d(t.touches),targetTouches:d(t.targetTouches),changedTouches:d(t.changedTouches),ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,type:t.type};var t}}),h(["gotpointercapture","lostpointercapture","pointercancel","pointerdown","pointerenter","pointerleave","pointermove","pointerout","pointerover","pointerup"],{createEventArgs:e=>{return{...u(t=e),pointerId:t.pointerId,width:t.width,height:t.height,pressure:t.pressure,tiltX:t.tiltX,tiltY:t.tiltY,pointerType:t.pointerType,isPrimary:t.isPrimary};var t}}),h(["wheel","mousewheel"],{createEventArgs:e=>{return{...u(t=e),deltaX:t.deltaX,deltaY:t.deltaY,deltaZ:t.deltaZ,deltaMode:t.deltaMode};var t}}),h(["cancel","close","toggle"],{createEventArgs:()=>({})});const p=["date","datetime-local","month","time","week"],f=new Map;let g,m,v=0;const y={async add(e,t,n){if(!n)throw new Error("initialParameters must be an object, even if empty.");const r="__bl-dynamic-root:"+(++v).toString();f.set(r,e);const o=await b().invokeMethodAsync("AddRootComponent",t,r),s=new _(o,m[t]);return await s.setParameters(n),s}};class w{invoke(e){return this._callback(e)}setCallback(t){this._selfJSObjectReference||(this._selfJSObjectReference=e.createJSObjectReference(this)),this._callback=t}getJSObjectReference(){return this._selfJSObjectReference}dispose(){this._selfJSObjectReference&&e.disposeJSObjectReference(this._selfJSObjectReference)}}class _{constructor(e,t){this._jsEventCallbackWrappers=new Map,this._componentId=e;for(const e of t)"eventcallback"===e.type&&this._jsEventCallbackWrappers.set(e.name.toLowerCase(),new w)}setParameters(e){const t={},n=Object.entries(e||{}),r=n.length;for(const[e,r]of n){const n=this._jsEventCallbackWrappers.get(e.toLowerCase());n&&r?(n.setCallback(r),t[e]=n.getJSObjectReference()):t[e]=r}return b().invokeMethodAsync("SetRootComponentParameters",this._componentId,r,t)}async dispose(){if(null!==this._componentId){await b().invokeMethodAsync("RemoveRootComponent",this._componentId),this._componentId=null;for(const e of this._jsEventCallbackWrappers.values())e.dispose()}}}function b(){if(!g)throw new Error("Dynamic root components have not been enabled in this application.");return g}const S=new Map,E=[],C=new Map;function I(t,n,r,o){var s,i;if(S.has(t))throw new Error(`Interop methods are already registered for renderer ${t}`);S.set(t,n),r&&o&&Object.keys(r).length>0&&function(t,n,r){if(g)throw new Error("Dynamic root components have already been enabled.");g=t,m=n;for(const[t,o]of Object.entries(r)){const r=e.findJSFunction(t,0);for(const e of o)r(e,n[e])}}(T(t),r,o),null===(i=null===(s=C.get(t))||void 0===s?void 0:s[0])||void 0===i||i.call(s),function(e){for(const t of E)t(e)}(t)}function k(e,t,n){return D(e,t.eventHandlerId,(()=>T(e).invokeMethodAsync("DispatchEventAsync",t,n)))}function T(e){const t=S.get(e);if(!t)throw new Error(`No interop methods are registered for renderer ${e}`);return t}let D=(e,t,n)=>n();const R=M(["abort","blur","cancel","canplay","canplaythrough","change","close","cuechange","durationchange","emptied","ended","error","focus","load","loadeddata","loadedmetadata","loadend","loadstart","mouseenter","mouseleave","pointerenter","pointerleave","pause","play","playing","progress","ratechange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeupdate","toggle","unload","volumechange","waiting","DOMNodeInsertedIntoDocument","DOMNodeRemovedFromDocument"]),x={submit:!0},A=M(["click","dblclick","mousedown","mousemove","mouseup"]);class P{constructor(e){this.browserRendererId=e,this.afterClickCallbacks=[];const t=++P.nextEventDelegatorId;this.eventsCollectionKey=`_blazorEvents_${t}`,this.eventInfoStore=new U(this.onGlobalEvent.bind(this))}setListener(e,t,n,r){const o=this.getEventHandlerInfosForElement(e,!0),s=o.getHandler(t);if(s)this.eventInfoStore.update(s.eventHandlerId,n);else{const s={element:e,eventName:t,eventHandlerId:n,renderingComponentId:r};this.eventInfoStore.add(s),o.setHandler(t,s)}}getHandler(e){return this.eventInfoStore.get(e)}removeListener(e){const t=this.eventInfoStore.remove(e);if(t){const e=t.element,n=this.getEventHandlerInfosForElement(e,!1);n&&n.removeHandler(t.eventName)}}notifyAfterClick(e){this.afterClickCallbacks.push(e),this.eventInfoStore.addGlobalListener("click")}setStopPropagation(e,t,n){this.getEventHandlerInfosForElement(e,!0).stopPropagation(t,n)}setPreventDefault(e,t,n){this.getEventHandlerInfosForElement(e,!0).preventDefault(t,n)}onGlobalEvent(e){if(!(e.target instanceof Element))return;this.dispatchGlobalEventToAllElements(e.type,e);const t=(n=e.type,i.get(n));var n;t&&t.forEach((t=>this.dispatchGlobalEventToAllElements(t,e))),"click"===e.type&&this.afterClickCallbacks.forEach((t=>t(e)))}dispatchGlobalEventToAllElements(e,t){const n=t.composedPath();let r=n.shift(),s=null,i=!1;const a=Object.prototype.hasOwnProperty.call(R,e);let l=!1;for(;r;){const u=r,p=this.getEventHandlerInfosForElement(u,!1);if(p){const n=p.getHandler(e);if(n&&(h=u,d=t.type,!((h instanceof HTMLButtonElement||h instanceof HTMLInputElement||h instanceof HTMLTextAreaElement||h instanceof HTMLSelectElement)&&Object.prototype.hasOwnProperty.call(A,d)&&h.disabled))){if(!i){const n=c(e);s=(null==n?void 0:n.createEventArgs)?n.createEventArgs(t):{},i=!0}Object.prototype.hasOwnProperty.call(x,t.type)&&t.preventDefault(),k(this.browserRendererId,{eventHandlerId:n.eventHandlerId,eventName:e,eventFieldInfo:o.fromEvent(n.renderingComponentId,t)},s)}p.stopPropagation(e)&&(l=!0),p.preventDefault(e)&&t.preventDefault()}r=a||l?void 0:n.shift()}var h,d}getEventHandlerInfosForElement(e,t){return Object.prototype.hasOwnProperty.call(e,this.eventsCollectionKey)?e[this.eventsCollectionKey]:t?e[this.eventsCollectionKey]=new N:null}}P.nextEventDelegatorId=0;class U{constructor(e){this.globalListener=e,this.infosByEventHandlerId={},this.countByEventName={},a.push(this.handleEventNameAliasAdded.bind(this))}add(e){if(this.infosByEventHandlerId[e.eventHandlerId])throw new Error(`Event ${e.eventHandlerId} is already tracked`);this.infosByEventHandlerId[e.eventHandlerId]=e,this.addGlobalListener(e.eventName)}get(e){return this.infosByEventHandlerId[e]}addGlobalListener(e){if(e=l(e),Object.prototype.hasOwnProperty.call(this.countByEventName,e))this.countByEventName[e]++;else{this.countByEventName[e]=1;const t=Object.prototype.hasOwnProperty.call(R,e);document.addEventListener(e,this.globalListener,t)}}update(e,t){if(Object.prototype.hasOwnProperty.call(this.infosByEventHandlerId,t))throw new Error(`Event ${t} is already tracked`);const n=this.infosByEventHandlerId[e];delete this.infosByEventHandlerId[e],n.eventHandlerId=t,this.infosByEventHandlerId[t]=n}remove(e){const t=this.infosByEventHandlerId[e];if(t){delete this.infosByEventHandlerId[e];const n=l(t.eventName);0==--this.countByEventName[n]&&(delete this.countByEventName[n],document.removeEventListener(n,this.globalListener))}return t}handleEventNameAliasAdded(e,t){if(Object.prototype.hasOwnProperty.call(this.countByEventName,e)){const n=this.countByEventName[e];delete this.countByEventName[e],document.removeEventListener(e,this.globalListener),this.addGlobalListener(t),this.countByEventName[t]+=n-1}}}class N{constructor(){this.handlers={},this.preventDefaultFlags=null,this.stopPropagationFlags=null}getHandler(e){return Object.prototype.hasOwnProperty.call(this.handlers,e)?this.handlers[e]:null}setHandler(e,t){this.handlers[e]=t}removeHandler(e){delete this.handlers[e]}preventDefault(e,t){return void 0!==t&&(this.preventDefaultFlags=this.preventDefaultFlags||{},this.preventDefaultFlags[e]=t),!!this.preventDefaultFlags&&this.preventDefaultFlags[e]}stopPropagation(e,t){return void 0!==t&&(this.stopPropagationFlags=this.stopPropagationFlags||{},this.stopPropagationFlags[e]=t),!!this.stopPropagationFlags&&this.stopPropagationFlags[e]}}function M(e){const t={};return e.forEach((e=>{t[e]=!0})),t}const B=Symbol(),L=Symbol(),$=Symbol();function O(e,t){if(B in e)return e;const n=[];if(e.childNodes.length>0){if(!t)throw new Error("New logical elements must start empty, or allowExistingContents must be true");e.childNodes.forEach((t=>{const r=O(t,!0);r[L]=e,n.push(r)}))}return e[B]=n,e}function F(e){const t=K(e);for(;t.length;)W(e,0)}function H(e,t){const n=document.createComment("!");return j(n,e,t),n}function j(e,t,n){const r=e;let o=e;if(e instanceof Comment){const t=K(r);if((null==t?void 0:t.length)>0){const t=Q(r),n=new Range;n.setStartBefore(e),n.setEndAfter(t),o=n.extractContents()}}const s=z(r);if(s){const e=K(s),t=Array.prototype.indexOf.call(e,r);e.splice(t,1),delete r[L]}const i=K(t);if(n0;)W(n,0)}const r=n;r.parentNode.removeChild(r)}function z(e){return e[L]||null}function q(e,t){return K(e)[t]}function J(e){const t=Y(e);return"http://www.w3.org/2000/svg"===t.namespaceURI&&"foreignObject"!==t.tagName}function K(e){return e[B]}function V(e){const t=K(z(e));return t[Array.prototype.indexOf.call(t,e)+1]||null}function X(e,t){const n=K(e);t.forEach((e=>{e.moveRangeStart=n[e.fromSiblingIndex],e.moveRangeEnd=Q(e.moveRangeStart)})),t.forEach((t=>{const r=document.createComment("marker");t.moveToBeforeMarker=r;const o=n[t.toSiblingIndex+1];o?o.parentNode.insertBefore(r,o):G(r,e)})),t.forEach((e=>{const t=e.moveToBeforeMarker,n=t.parentNode,r=e.moveRangeStart,o=e.moveRangeEnd;let s=r;for(;s;){const e=s.nextSibling;if(n.insertBefore(s,t),s===o)break;s=e}n.removeChild(t)})),t.forEach((e=>{n[e.toSiblingIndex]=e.moveRangeStart}))}function Y(e){if(e instanceof Element||e instanceof DocumentFragment)return e;if(e instanceof Comment)return e.parentNode;throw new Error("Not a valid logical element")}function G(e,t){if(t instanceof Element||t instanceof DocumentFragment)t.appendChild(e);else{if(!(t instanceof Comment))throw new Error(`Cannot append node because the parent is not a valid logical element. Parent: ${t}`);{const n=V(t);n?n.parentNode.insertBefore(e,n):G(e,z(t))}}}function Q(e){if(e instanceof Element||e instanceof DocumentFragment)return e;const t=V(e);if(t)return t.previousSibling;{const t=z(e);return t instanceof Element||t instanceof DocumentFragment?t.lastChild:Q(t)}}function Z(e){return`_bl_${e}`}const ee="__internalId";e.attachReviver(((e,t)=>t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,ee)&&"string"==typeof t[ee]?function(e){const t=`[${Z(e)}]`;return document.querySelector(t)}(t[ee]):t));const te="_blazorDeferredValue";function ne(e){return"select-multiple"===e.type}function re(e,t){e.value=t||""}function oe(e,t){e instanceof HTMLSelectElement?ne(e)?function(e,t){t||(t=[]);for(let n=0;n{Ie()&&function(e,t){if(0!==e.button||function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e))return;if(e.defaultPrevented)return;const n=function(e){const t=e.composedPath&&e.composedPath();if(t)for(let e=0;e{const t=document.createElement("script");t.textContent=e.textContent,e.getAttributeNames().forEach((n=>{t.setAttribute(n,e.getAttribute(n))})),e.parentNode.replaceChild(t,e)})),ie.content));var i;let a=0;for(;s.firstChild;)j(s.firstChild,o,a++)}applyAttribute(e,t,n,r){const o=e.frameReader,s=o.attributeName(r),i=o.attributeEventHandlerId(r);if(i){const e=fe(s);return void this.eventDelegator.setListener(n,e,i,t)}const a=o.attributeValue(r);this.setOrRemoveAttributeOrProperty(n,s,a)}insertFrameRange(e,t,n,r,o,s,i){const a=r;for(let a=s;a{He(t,e)})},enableNavigationInterception:function(e){if(void 0!==me&&me!==e)throw new Error("Only one interactive runtime may enable navigation interception at a time.");me=e},setHasLocationChangingListeners:function(e,t){const n=xe.get(e);if(!n)throw new Error(`Renderer with ID '${e}' is not listening for navigation events`);n.hasLocationChangingEventListeners=t},endLocationChanging:function(e,t){Pe&&e===Re&&(Pe(t),Pe=null)},navigateTo:function(e,t){Me(e,t,!0)},refresh:function(e){!e&&Se()?Ee(location.href,!0):location.reload()},getBaseURI:()=>document.baseURI,getLocationHref:()=>location.href,scrollToElement:Ne};function Ne(e){const t=document.getElementById(e);return!!t&&(t.scrollIntoView(),!0)}function Me(e,t,n=!1){const r=Ce(e),o=ze();if(t.forceLoad||!be(r)||"serverside-fullpageload"===o)!function(e,t){if(location.href===e){const t=e+"?";history.replaceState(null,"",t),location.replace(e)}else t?location.replace(e):location.href=e}(e,t.replaceHistoryEntry);else if("clientside-router"===o)Be(r,!1,t.replaceHistoryEntry,t.historyEntryState,n);else{if("serverside-enhanced"!==o)throw new Error(`Unsupported page load mechanism: ${o}`);Ee(r,t.replaceHistoryEntry)}}async function Be(e,t,n,r=void 0,o=!1){if(Oe(),function(e){const t=e.indexOf("#");return t>-1&&location.href.replace(location.hash,"")===e.substring(0,t)}(e))return void function(e,t,n){Le(e,t,n);const r=e.indexOf("#");r!==e.length-1&&Ne(e.substring(r+1))}(e,n,r);const s=We();(o||!(null==s?void 0:s.hasLocationChangingEventListeners)||await Fe(e,r,t,s))&&(_e=!0,Le(e,n,r),await He(t))}function Le(e,t,n=void 0){t?history.replaceState({userState:n,_index:De},"",e):(De++,history.pushState({userState:n,_index:De},"",e))}function $e(e){return new Promise((t=>{const n=Ae;Ae=()=>{Ae=n,t()},history.go(e)}))}function Oe(){Pe&&(Pe(!1),Pe=null)}function Fe(e,t,n,r){return new Promise((o=>{Oe(),Re++,Pe=o,r.locationChanging(Re,e,t,n)}))}async function He(e,t){const n=null!=t?t:location.href;await Promise.all(Array.from(xe,(async([t,r])=>{var o,s;s=t,S.has(s)&&await r.locationChanged(n,null===(o=history.state)||void 0===o?void 0:o.userState,e)})))}async function je(e){var t,n;Ae&&"serverside-enhanced"!==ze()&&await Ae(e),De=null!==(n=null===(t=history.state)||void 0===t?void 0:t._index)&&void 0!==n?n:0}function We(){const e=ke();if(void 0!==e)return xe.get(e)}function ze(){return Ie()?"clientside-router":Se()?"serverside-enhanced":window.Blazor._internal.isBlazorWeb?"serverside-fullpageload":"clientside-router"}const qe={focus:function(e,t){if(e instanceof HTMLElement)e.focus({preventScroll:t});else{if(!(e instanceof SVGElement))throw new Error("Unable to focus an invalid element.");if(!e.hasAttribute("tabindex"))throw new Error("Unable to focus an SVG element that does not have a tabindex.");e.focus({preventScroll:t})}},focusBySelector:function(e,t){const n=document.querySelector(e);n&&(n.hasAttribute("tabindex")||(n.tabIndex=-1),n.focus({preventScroll:!0}))}},Je={init:function(e,t,n,r=50){const o=Ve(t);(o||document.documentElement).style.overflowAnchor="none";const s=document.createRange();u(n.parentElement)&&(t.style.display="table-row",n.style.display="table-row");const i=new IntersectionObserver((function(r){r.forEach((r=>{var o;if(!r.isIntersecting)return;s.setStartAfter(t),s.setEndBefore(n);const i=s.getBoundingClientRect().height,a=null===(o=r.rootBounds)||void 0===o?void 0:o.height;r.target===t?e.invokeMethodAsync("OnSpacerBeforeVisible",r.intersectionRect.top-r.boundingClientRect.top,i,a):r.target===n&&n.offsetHeight>0&&e.invokeMethodAsync("OnSpacerAfterVisible",r.boundingClientRect.bottom-r.intersectionRect.bottom,i,a)}))}),{root:o,rootMargin:`${r}px`});i.observe(t),i.observe(n);const a=d(t),c=d(n),{observersByDotNetObjectId:l,id:h}=Xe(e);function d(e){const t={attributes:!0},n=new MutationObserver(((n,r)=>{u(e.parentElement)&&(r.disconnect(),e.style.display="table-row",r.observe(e,t)),i.unobserve(e),i.observe(e)}));return n.observe(e,t),n}function u(e){return null!==e&&(e instanceof HTMLTableElement&&""===e.style.display||"table"===e.style.display||e instanceof HTMLTableSectionElement&&""===e.style.display||"table-row-group"===e.style.display)}l[h]={intersectionObserver:i,mutationObserverBefore:a,mutationObserverAfter:c}},dispose:function(e){const{observersByDotNetObjectId:t,id:n}=Xe(e),r=t[n];r&&(r.intersectionObserver.disconnect(),r.mutationObserverBefore.disconnect(),r.mutationObserverAfter.disconnect(),e.dispose(),delete t[n])}},Ke=Symbol();function Ve(e){return e&&e!==document.body&&e!==document.documentElement?"visible"!==getComputedStyle(e).overflowY?e:Ve(e.parentElement):null}function Xe(e){var t;const n=e._callDispatcher,r=e._id;return null!==(t=n[Ke])&&void 0!==t||(n[Ke]={}),{observersByDotNetObjectId:n[Ke],id:r}}const Ye={getAndRemoveExistingTitle:function(){var e;const t=document.head?document.head.getElementsByTagName("title"):[];if(0===t.length)return null;let n=null;for(let r=t.length-1;r>=0;r--){const o=t[r],s=o.previousSibling;s instanceof Comment&&null!==z(s)||(null===n&&(n=o.textContent),null===(e=o.parentNode)||void 0===e||e.removeChild(o))}return n}},Ge={init:function(e,t){t._blazorInputFileNextFileId=0,t.addEventListener("click",(function(){t.value=""})),t.addEventListener("change",(function(){t._blazorFilesById={};const n=Array.prototype.map.call(t.files,(function(e){const n={id:++t._blazorInputFileNextFileId,lastModified:new Date(e.lastModified).toISOString(),name:e.name,size:e.size,contentType:e.type,readPromise:void 0,arrayBuffer:void 0,blob:e};return t._blazorFilesById[n.id]=n,n}));e.invokeMethodAsync("NotifyChange",n)}))},toImageFile:async function(e,t,n,r,o){const s=Qe(e,t),i=await new Promise((function(e){const t=new Image;t.onload=function(){URL.revokeObjectURL(t.src),e(t)},t.onerror=function(){t.onerror=null,URL.revokeObjectURL(t.src)},t.src=URL.createObjectURL(s.blob)})),a=await new Promise((function(e){var t;const s=Math.min(1,r/i.width),a=Math.min(1,o/i.height),c=Math.min(s,a),l=document.createElement("canvas");l.width=Math.round(i.width*c),l.height=Math.round(i.height*c),null===(t=l.getContext("2d"))||void 0===t||t.drawImage(i,0,0,l.width,l.height),l.toBlob(e,n)})),c={id:++e._blazorInputFileNextFileId,lastModified:s.lastModified,name:s.name,size:(null==a?void 0:a.size)||0,contentType:n,blob:a||s.blob};return e._blazorFilesById[c.id]=c,c},readFileData:async function(e,t){return Qe(e,t).blob}};function Qe(e,t){const n=e._blazorFilesById[t];if(!n)throw new Error(`There is no file with ID ${t}. The file list may have changed. See https://aka.ms/aspnet/blazor-input-file-multiple-selections.`);return n}const Ze=new Set,et={enableNavigationPrompt:function(e){0===Ze.size&&window.addEventListener("beforeunload",tt),Ze.add(e)},disableNavigationPrompt:function(e){Ze.delete(e),0===Ze.size&&window.removeEventListener("beforeunload",tt)}};function tt(e){e.preventDefault(),e.returnValue=!0}async function nt(e,t,n){return e instanceof Blob?await async function(e,t,n){const r=e.slice(t,t+n),o=await r.arrayBuffer();return new Uint8Array(o)}(e,t,n):function(e,t,n){return new Uint8Array(e.buffer,e.byteOffset+t,n)}(e,t,n)}new Map;const rt={navigateTo:function(e,t,n=!1){Me(e,t instanceof Object?t:{forceLoad:t,replaceHistoryEntry:n})},registerCustomEventType:function(e,t){if(!t)throw new Error("The options parameter is required.");if(s.has(e))throw new Error(`The event '${e}' is already registered.`);if(t.browserEventName){const n=i.get(t.browserEventName);n?n.push(e):i.set(t.browserEventName,[e]),a.forEach((n=>n(e,t.browserEventName)))}s.set(e,t)},rootComponents:y,runtime:{},_internal:{navigationManager:Ue,domWrapper:qe,Virtualize:Je,PageTitle:Ye,InputFile:Ge,NavigationLock:et,getJSDataStreamChunk:nt,attachWebRendererInterop:I}};var ot;function st(e){const t={...it,...e};return e&&e.reconnectionOptions&&(t.reconnectionOptions={...it.reconnectionOptions,...e.reconnectionOptions}),t}window.Blazor=rt,function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Information=2]="Information",e[e.Warning=3]="Warning",e[e.Error=4]="Error",e[e.Critical=5]="Critical",e[e.None=6]="None"}(ot||(ot={}));const it={configureSignalR:e=>{},logLevel:ot.Warning,initializers:void 0,circuitHandlers:[],reconnectionOptions:{maxRetries:8,retryIntervalMilliseconds:2e4,dialogId:"components-reconnect-modal"}};class at{log(e,t){}}at.instance=new at;class ct{constructor(e){this.minLevel=e}log(e,t){if(e>=this.minLevel){const n=`[${(new Date).toISOString()}] ${ot[e]}: ${t}`;switch(e){case ot.Critical:case ot.Error:console.error(n);break;case ot.Warning:console.warn(n);break;case ot.Information:console.info(n);break;default:console.log(n)}}}}const lt=/^\s*Blazor-Server-Component-State:(?[a-zA-Z0-9+/=]+)$/;function ht(e,t,n="state"){var r;if(e.nodeType===Node.COMMENT_NODE){const o=e.textContent||"",s=t.exec(o),i=s&&s.groups&&s.groups[n];return i&&(null===(r=e.parentNode)||void 0===r||r.removeChild(e)),i}if(!e.hasChildNodes())return;const o=e.childNodes;for(let e=0;e.*)$/);function pt(e,t){const n=e.currentElement;var r,o,s;if(n&&n.nodeType===Node.COMMENT_NODE&&n.textContent){const i=ut.exec(n.textContent),a=i&&i.groups&&i.groups.descriptor;if(!a)return;!function(e){if(e.parentNode instanceof Document)throw new Error("Root components cannot be marked as interactive. The element must be rendered statically so that scripts are not evaluated multiple times.")}(n);try{const i=function(e){const t=JSON.parse(e),{type:n}=t;if("server"!==n&&"webassembly"!==n&&"auto"!==n)throw new Error(`Invalid component type '${n}'.`);return t}(a),c=function(e,t,n){const{prerenderId:r}=e;if(r){for(;n.next()&&n.currentElement;){const e=n.currentElement;if(e.nodeType!==Node.COMMENT_NODE)continue;if(!e.textContent)continue;const t=ut.exec(e.textContent),o=t&&t[1];if(o)return vt(o,r),e}throw new Error(`Could not find an end component comment for '${t}'.`)}}(i,n,e);if(t!==i.type)return;switch(i.type){case"webassembly":return o=n,s=c,mt(r=i),{...r,uniqueId:ft++,start:o,end:s};case"server":return function(e,t,n){return gt(e),{...e,uniqueId:ft++,start:t,end:n}}(i,n,c);case"auto":return function(e,t,n){return gt(e),mt(e),{...e,uniqueId:ft++,start:t,end:n}}(i,n,c)}}catch(e){throw new Error(`Found malformed component comment at ${n.textContent}`)}}}let ft=0;function gt(e){const{descriptor:t,sequence:n}=e;if(!t)throw new Error("descriptor must be defined when using a descriptor.");if(void 0===n)throw new Error("sequence must be defined when using a descriptor.");if(!Number.isInteger(n))throw new Error(`Error parsing the sequence '${n}' for component '${JSON.stringify(e)}'`)}function mt(e){const{assembly:t,typeName:n}=e;if(!t)throw new Error("assembly must be defined when using a descriptor.");if(!n)throw new Error("typeName must be defined when using a descriptor.");e.parameterDefinitions=e.parameterDefinitions&&atob(e.parameterDefinitions),e.parameterValues=e.parameterValues&&atob(e.parameterValues)}function vt(e,t){const n=JSON.parse(e);if(1!==Object.keys(n).length)throw new Error(`Invalid end of component comment: '${e}'`);const r=n.prerenderId;if(!r)throw new Error(`End of component comment must have a value for the prerendered property: '${e}'`);if(r!==t)throw new Error(`End of component comment prerendered property must match the start comment prerender id: '${t}', '${r}'`)}class yt{constructor(e){this.childNodes=e,this.currentIndex=-1,this.length=e.length}next(){return this.currentIndex++,this.currentIndex{n+=`0x${e<16?"0":""}${e.toString(16)} `})),n.substr(0,n.length-1)}(e)}'`)):"string"==typeof e&&(n=`String data of length ${e.length}`,t&&(n+=`. Content: '${e}'`)),n}function kt(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}async function Tt(e,t,n,r,o,s){const i={},[a,c]=xt();i[a]=c,e.log(_t.Trace,`(${t} transport) sending data. ${It(o,s.logMessageContent)}.`);const l=kt(o)?"arraybuffer":"text",h=await n.post(r,{content:o,headers:{...i,...s.headers},responseType:l,timeout:s.timeout,withCredentials:s.withCredentials});e.log(_t.Trace,`(${t} transport) request complete. Response status: ${h.statusCode}.`)}class Dt{constructor(e,t){this._subject=e,this._observer=t}dispose(){const e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),0===this._subject.observers.length&&this._subject.cancelCallback&&this._subject.cancelCallback().catch((e=>{}))}}class Rt{constructor(e){this._minLevel=e,this.out=console}log(e,t){if(e>=this._minLevel){const n=`[${(new Date).toISOString()}] ${_t[e]}: ${t}`;switch(e){case _t.Critical:case _t.Error:this.out.error(n);break;case _t.Warning:this.out.warn(n);break;case _t.Information:this.out.info(n);break;default:this.out.log(n)}}}}function xt(){let e="X-SignalR-User-Agent";return Ct.isNode&&(e="User-Agent"),[e,At(St,Pt(),Ct.isNode?"NodeJS":"Browser",Ut())]}function At(e,t,n,r){let o="Microsoft SignalR/";const s=e.split(".");return o+=`${s[0]}.${s[1]}`,o+=` (${e}; `,o+=t&&""!==t?`${t}; `:"Unknown OS; ",o+=`${n}`,o+=r?`; ${r}`:"; Unknown Runtime Version",o+=")",o}function Pt(){if(!Ct.isNode)return"";switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}}function Ut(){if(Ct.isNode)return process.versions.node}function Nt(e){return e.stack?e.stack:e.message?e.message:`${e}`}class Mt{writeHandshakeRequest(e){return wt.write(JSON.stringify(e))}parseHandshakeResponse(e){let t,n;if(kt(e)){const r=new Uint8Array(e),o=r.indexOf(wt.RecordSeparatorCode);if(-1===o)throw new Error("Message is incomplete.");const s=o+1;t=String.fromCharCode.apply(null,Array.prototype.slice.call(r.slice(0,s))),n=r.byteLength>s?r.slice(s).buffer:null}else{const r=e,o=r.indexOf(wt.RecordSeparator);if(-1===o)throw new Error("Message is incomplete.");const s=o+1;t=r.substring(0,s),n=r.length>s?r.substring(s):null}const r=wt.parse(t),o=JSON.parse(r[0]);if(o.type)throw new Error("Expected a handshake response from the server.");return[n,o]}}class Bt extends Error{constructor(e,t){const n=new.target.prototype;super(`${e}: Status code '${t}'`),this.statusCode=t,this.__proto__=n}}class Lt extends Error{constructor(e="A timeout occurred."){const t=new.target.prototype;super(e),this.__proto__=t}}class $t extends Error{constructor(e="An abort occurred."){const t=new.target.prototype;super(e),this.__proto__=t}}class Ot extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.transport=t,this.errorType="UnsupportedTransportError",this.__proto__=n}}class Ft extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.transport=t,this.errorType="DisabledTransportError",this.__proto__=n}}class Ht extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.transport=t,this.errorType="FailedToStartTransportError",this.__proto__=n}}class jt extends Error{constructor(e){const t=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=t}}class Wt extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.innerErrors=t,this.__proto__=n}}var zt,qt;!function(e){e[e.Invocation=1]="Invocation",e[e.StreamItem=2]="StreamItem",e[e.Completion=3]="Completion",e[e.StreamInvocation=4]="StreamInvocation",e[e.CancelInvocation=5]="CancelInvocation",e[e.Ping=6]="Ping",e[e.Close=7]="Close",e[e.Ack=8]="Ack",e[e.Sequence=9]="Sequence"}(zt||(zt={}));class Jt{constructor(){this.observers=[]}next(e){for(const t of this.observers)t.next(e)}error(e){for(const t of this.observers)t.error&&t.error(e)}complete(){for(const e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new Dt(this,e)}}class Kt{constructor(e,t,n){this._bufferSize=1e5,this._messages=[],this._totalMessageCount=0,this._waitForSequenceMessage=!1,this._nextReceivingSequenceId=1,this._latestReceivedSequenceId=0,this._bufferedByteCount=0,this._reconnectInProgress=!1,this._protocol=e,this._connection=t,this._bufferSize=n}async _send(e){const t=this._protocol.writeMessage(e);let n=Promise.resolve();if(this._isInvocationMessage(e)){this._totalMessageCount++;let e=()=>{},r=()=>{};kt(t)?this._bufferedByteCount+=t.byteLength:this._bufferedByteCount+=t.length,this._bufferedByteCount>=this._bufferSize&&(n=new Promise(((t,n)=>{e=t,r=n}))),this._messages.push(new Vt(t,this._totalMessageCount,e,r))}try{this._reconnectInProgress||await this._connection.send(t)}catch{this._disconnected()}await n}_ack(e){let t=-1;for(let n=0;nthis._nextReceivingSequenceId?this._connection.stop(new Error("Sequence ID greater than amount of messages we've received.")):this._nextReceivingSequenceId=e.sequenceId}_disconnected(){this._reconnectInProgress=!0,this._waitForSequenceMessage=!0}async _resend(){const e=0!==this._messages.length?this._messages[0]._id:this._totalMessageCount+1;await this._connection.send(this._protocol.writeMessage({type:zt.Sequence,sequenceId:e}));const t=this._messages;for(const e of t)await this._connection.send(e._message);this._reconnectInProgress=!1}_dispose(e){null!=e||(e=new Error("Unable to reconnect to server."));for(const t of this._messages)t._rejector(e)}_isInvocationMessage(e){switch(e.type){case zt.Invocation:case zt.StreamItem:case zt.Completion:case zt.StreamInvocation:case zt.CancelInvocation:return!0;case zt.Close:case zt.Sequence:case zt.Ping:case zt.Ack:return!1}}_ackTimer(){void 0===this._ackTimerHandle&&(this._ackTimerHandle=setTimeout((async()=>{try{this._reconnectInProgress||await this._connection.send(this._protocol.writeMessage({type:zt.Ack,sequenceId:this._latestReceivedSequenceId}))}catch{}clearTimeout(this._ackTimerHandle),this._ackTimerHandle=void 0}),1e3))}}class Vt{constructor(e,t,n,r){this._message=e,this._id=t,this._resolver=n,this._rejector=r}}!function(e){e.Disconnected="Disconnected",e.Connecting="Connecting",e.Connected="Connected",e.Disconnecting="Disconnecting",e.Reconnecting="Reconnecting"}(qt||(qt={}));class Xt{static create(e,t,n,r,o,s,i){return new Xt(e,t,n,r,o,s,i)}constructor(e,t,n,r,o,s,i){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(_t.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")},Et.isRequired(e,"connection"),Et.isRequired(t,"logger"),Et.isRequired(n,"protocol"),this.serverTimeoutInMilliseconds=null!=o?o:3e4,this.keepAliveIntervalInMilliseconds=null!=s?s:15e3,this._statefulReconnectBufferSize=null!=i?i:1e5,this._logger=t,this._protocol=n,this.connection=e,this._reconnectPolicy=r,this._handshakeProtocol=new Mt,this.connection.onreceive=e=>this._processIncomingData(e),this.connection.onclose=e=>this._connectionClosed(e),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=qt.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:zt.Ping})}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(e){if(this._connectionState!==qt.Disconnected&&this._connectionState!==qt.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}async _startWithStateTransitions(){if(this._connectionState!==qt.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=qt.Connecting,this._logger.log(_t.Debug,"Starting HubConnection.");try{await this._startInternal(),Ct.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=qt.Connected,this._connectionStarted=!0,this._logger.log(_t.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=qt.Disconnected,this._logger.log(_t.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}}async _startInternal(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;const e=new Promise(((e,t)=>{this._handshakeResolver=e,this._handshakeRejecter=t}));await this.connection.start(this._protocol.transferFormat);try{let t=this._protocol.version;this.connection.features.reconnect||(t=1);const n={protocol:this._protocol.name,version:t};if(this._logger.log(_t.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(n)),this._logger.log(_t.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await e,this._stopDuringStartError)throw this._stopDuringStartError;!!this.connection.features.reconnect&&(this._messageBuffer=new Kt(this._protocol,this.connection,this._statefulReconnectBufferSize),this.connection.features.disconnected=this._messageBuffer._disconnected.bind(this._messageBuffer),this.connection.features.resend=()=>{if(this._messageBuffer)return this._messageBuffer._resend()}),this.connection.features.inherentKeepAlive||await this._sendMessage(this._cachedPingMessage)}catch(e){throw this._logger.log(_t.Debug,`Hub handshake failed with error '${e}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),await this.connection.stop(e),e}}async stop(){const e=this._startPromise;this.connection.features.reconnect=!1,this._stopPromise=this._stopInternal(),await this._stopPromise;try{await e}catch(e){}}_stopInternal(e){if(this._connectionState===qt.Disconnected)return this._logger.log(_t.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this._connectionState===qt.Disconnecting)return this._logger.log(_t.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;const t=this._connectionState;return this._connectionState=qt.Disconnecting,this._logger.log(_t.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(_t.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(t===qt.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new $t("The connection was stopped before the hub handshake could complete."),this.connection.stop(e))}async _sendCloseMessage(){try{await this._sendWithProtocol(this._createCloseMessage())}catch{}}stream(e,...t){const[n,r]=this._replaceStreamingParams(t),o=this._createStreamInvocation(e,t,r);let s;const i=new Jt;return i.cancelCallback=()=>{const e=this._createCancelInvocation(o.invocationId);return delete this._callbacks[o.invocationId],s.then((()=>this._sendWithProtocol(e)))},this._callbacks[o.invocationId]=(e,t)=>{t?i.error(t):e&&(e.type===zt.Completion?e.error?i.error(new Error(e.error)):i.complete():i.next(e.item))},s=this._sendWithProtocol(o).catch((e=>{i.error(e),delete this._callbacks[o.invocationId]})),this._launchStreams(n,s),i}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._messageBuffer?this._messageBuffer._send(e):this._sendMessage(this._protocol.writeMessage(e))}send(e,...t){const[n,r]=this._replaceStreamingParams(t),o=this._sendWithProtocol(this._createInvocation(e,t,!0,r));return this._launchStreams(n,o),o}invoke(e,...t){const[n,r]=this._replaceStreamingParams(t),o=this._createInvocation(e,t,!1,r);return new Promise(((e,t)=>{this._callbacks[o.invocationId]=(n,r)=>{r?t(r):n&&(n.type===zt.Completion?n.error?t(new Error(n.error)):e(n.result):t(new Error(`Unexpected message type: ${n.type}`)))};const r=this._sendWithProtocol(o).catch((e=>{t(e),delete this._callbacks[o.invocationId]}));this._launchStreams(n,r)}))}on(e,t){e&&t&&(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),-1===this._methods[e].indexOf(t)&&this._methods[e].push(t))}off(e,t){if(!e)return;e=e.toLowerCase();const n=this._methods[e];if(n)if(t){const r=n.indexOf(t);-1!==r&&(n.splice(r,1),0===n.length&&delete this._methods[e])}else delete this._methods[e]}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(e=this._processHandshakeResponse(e),this._receivedHandshakeResponse=!0),e){const t=this._protocol.parseMessages(e,this._logger);for(const e of t)if(!this._messageBuffer||this._messageBuffer._shouldProcessMessage(e))switch(e.type){case zt.Invocation:this._invokeClientMethod(e);break;case zt.StreamItem:case zt.Completion:{const t=this._callbacks[e.invocationId];if(t){e.type===zt.Completion&&delete this._callbacks[e.invocationId];try{t(e)}catch(e){this._logger.log(_t.Error,`Stream callback threw error: ${Nt(e)}`)}}break}case zt.Ping:break;case zt.Close:{this._logger.log(_t.Information,"Close message received from server.");const t=e.error?new Error("Server returned an error on close: "+e.error):void 0;!0===e.allowReconnect?this.connection.stop(t):this._stopPromise=this._stopInternal(t);break}case zt.Ack:this._messageBuffer&&this._messageBuffer._ack(e);break;case zt.Sequence:this._messageBuffer&&this._messageBuffer._resetSequence(e);break;default:this._logger.log(_t.Warning,`Invalid message type: ${e.type}.`)}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let t,n;try{[n,t]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(e){const t="Error parsing handshake response: "+e;this._logger.log(_t.Error,t);const n=new Error(t);throw this._handshakeRejecter(n),n}if(t.error){const e="Server returned handshake error: "+t.error;this._logger.log(_t.Error,e);const n=new Error(e);throw this._handshakeRejecter(n),n}return this._logger.log(_t.Debug,"Server handshake complete."),this._handshakeResolver(),n}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=(new Date).getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if(!(this.connection.features&&this.connection.features.inherentKeepAlive||(this._timeoutHandle=setTimeout((()=>this.serverTimeout()),this.serverTimeoutInMilliseconds),void 0!==this._pingServerHandle))){let e=this._nextKeepAlive-(new Date).getTime();e<0&&(e=0),this._pingServerHandle=setTimeout((async()=>{if(this._connectionState===qt.Connected)try{await this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}}),e)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}async _invokeClientMethod(e){const t=e.target.toLowerCase(),n=this._methods[t];if(!n)return this._logger.log(_t.Warning,`No client method with the name '${t}' found.`),void(e.invocationId&&(this._logger.log(_t.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),await this._sendWithProtocol(this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null))));const r=n.slice(),o=!!e.invocationId;let s,i,a;for(const n of r)try{const r=s;s=await n.apply(this,e.arguments),o&&s&&r&&(this._logger.log(_t.Error,`Multiple results provided for '${t}'. Sending error to server.`),a=this._createCompletionMessage(e.invocationId,"Client provided multiple results.",null)),i=void 0}catch(e){i=e,this._logger.log(_t.Error,`A callback for the method '${t}' threw error '${e}'.`)}a?await this._sendWithProtocol(a):o?(i?a=this._createCompletionMessage(e.invocationId,`${i}`,null):void 0!==s?a=this._createCompletionMessage(e.invocationId,null,s):(this._logger.log(_t.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),a=this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)),await this._sendWithProtocol(a)):s&&this._logger.log(_t.Error,`Result given for '${t}' method but server is not expecting a result.`)}_connectionClosed(e){this._logger.log(_t.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new $t("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===qt.Disconnecting?this._completeClose(e):this._connectionState===qt.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===qt.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=qt.Disconnected,this._connectionStarted=!1,this._messageBuffer&&(this._messageBuffer._dispose(null!=e?e:new Error("Connection closed.")),this._messageBuffer=void 0),Ct.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach((t=>t.apply(this,[e])))}catch(t){this._logger.log(_t.Error,`An onclose callback called with error '${e}' threw error '${t}'.`)}}}async _reconnect(e){const t=Date.now();let n=0,r=void 0!==e?e:new Error("Attempting to reconnect due to a unknown error."),o=this._getNextRetryDelay(n++,0,r);if(null===o)return this._logger.log(_t.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this._completeClose(e);if(this._connectionState=qt.Reconnecting,e?this._logger.log(_t.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(_t.Information,"Connection reconnecting."),0!==this._reconnectingCallbacks.length){try{this._reconnectingCallbacks.forEach((t=>t.apply(this,[e])))}catch(t){this._logger.log(_t.Error,`An onreconnecting callback called with error '${e}' threw error '${t}'.`)}if(this._connectionState!==qt.Reconnecting)return void this._logger.log(_t.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;null!==o;){if(this._logger.log(_t.Information,`Reconnect attempt number ${n} will start in ${o} ms.`),await new Promise((e=>{this._reconnectDelayHandle=setTimeout(e,o)})),this._reconnectDelayHandle=void 0,this._connectionState!==qt.Reconnecting)return void this._logger.log(_t.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this._startInternal(),this._connectionState=qt.Connected,this._logger.log(_t.Information,"HubConnection reconnected successfully."),0!==this._reconnectedCallbacks.length)try{this._reconnectedCallbacks.forEach((e=>e.apply(this,[this.connection.connectionId])))}catch(e){this._logger.log(_t.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${e}'.`)}return}catch(e){if(this._logger.log(_t.Information,`Reconnect attempt failed because of error '${e}'.`),this._connectionState!==qt.Reconnecting)return this._logger.log(_t.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this._connectionState===qt.Disconnecting&&this._completeClose());r=e instanceof Error?e:new Error(e.toString()),o=this._getNextRetryDelay(n++,Date.now()-t,r)}}this._logger.log(_t.Information,`Reconnect retries have been exhausted after ${Date.now()-t} ms and ${n} failed attempts. Connection disconnecting.`),this._completeClose()}_getNextRetryDelay(e,t,n){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:t,previousRetryCount:e,retryReason:n})}catch(n){return this._logger.log(_t.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${t}) threw error '${n}'.`),null}}_cancelCallbacksWithError(e){const t=this._callbacks;this._callbacks={},Object.keys(t).forEach((n=>{const r=t[n];try{r(null,e)}catch(t){this._logger.log(_t.Error,`Stream 'error' callback called with '${e}' threw error: ${Nt(t)}`)}}))}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,t,n,r){if(n)return 0!==r.length?{arguments:t,streamIds:r,target:e,type:zt.Invocation}:{arguments:t,target:e,type:zt.Invocation};{const n=this._invocationId;return this._invocationId++,0!==r.length?{arguments:t,invocationId:n.toString(),streamIds:r,target:e,type:zt.Invocation}:{arguments:t,invocationId:n.toString(),target:e,type:zt.Invocation}}}_launchStreams(e,t){if(0!==e.length){t||(t=Promise.resolve());for(const n in e)e[n].subscribe({complete:()=>{t=t.then((()=>this._sendWithProtocol(this._createCompletionMessage(n))))},error:e=>{let r;r=e instanceof Error?e.message:e&&e.toString?e.toString():"Unknown error",t=t.then((()=>this._sendWithProtocol(this._createCompletionMessage(n,r))))},next:e=>{t=t.then((()=>this._sendWithProtocol(this._createStreamItemMessage(n,e))))}})}}_replaceStreamingParams(e){const t=[],n=[];for(let r=0;r0)&&(t=!1,this._accessToken=await this._accessTokenFactory()),this._setAuthorizationHeader(e);const n=await this._innerClient.send(e);return t&&401===n.statusCode&&this._accessTokenFactory?(this._accessToken=await this._accessTokenFactory(),this._setAuthorizationHeader(e),await this._innerClient.send(e)):n}_setAuthorizationHeader(e){e.headers||(e.headers={}),this._accessToken?e.headers[Qt.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[Qt.Authorization]&&delete e.headers[Qt.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}}class nn extends en{constructor(e){super(),this._logger=e;const t={_fetchType:void 0,_jar:void 0};var r;r=t,"undefined"==typeof fetch&&(r._jar=new(n(628).CookieJar),"undefined"==typeof fetch?r._fetchType=n(200):r._fetchType=fetch,r._fetchType=n(203)(r._fetchType,r._jar),1)?(this._fetchType=t._fetchType,this._jar=t._jar):this._fetchType=fetch.bind(function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n.g)return n.g;throw new Error("could not find global")}()),this._abortControllerType=AbortController;const o={_abortControllerType:this._abortControllerType};(function(e){return"undefined"==typeof AbortController&&(e._abortControllerType=n(778),!0)})(o)&&(this._abortControllerType=o._abortControllerType)}async send(e){if(e.abortSignal&&e.abortSignal.aborted)throw new $t;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");const t=new this._abortControllerType;let n;e.abortSignal&&(e.abortSignal.onabort=()=>{t.abort(),n=new $t});let r,o=null;if(e.timeout){const r=e.timeout;o=setTimeout((()=>{t.abort(),this._logger.log(_t.Warning,"Timeout from HTTP request."),n=new Lt}),r)}""===e.content&&(e.content=void 0),e.content&&(e.headers=e.headers||{},kt(e.content)?e.headers["Content-Type"]="application/octet-stream":e.headers["Content-Type"]="text/plain;charset=UTF-8");try{r=await this._fetchType(e.url,{body:e.content,cache:"no-cache",credentials:!0===e.withCredentials?"include":"same-origin",headers:{"X-Requested-With":"XMLHttpRequest",...e.headers},method:e.method,mode:"cors",redirect:"follow",signal:t.signal})}catch(e){if(n)throw n;throw this._logger.log(_t.Warning,`Error from HTTP request. ${e}.`),e}finally{o&&clearTimeout(o),e.abortSignal&&(e.abortSignal.onabort=null)}if(!r.ok){const e=await rn(r,"text");throw new Bt(e||r.statusText,r.status)}const s=rn(r,e.responseType),i=await s;return new Zt(r.status,r.statusText,i)}getCookieString(e){return""}}function rn(e,t){let n;switch(t){case"arraybuffer":n=e.arrayBuffer();break;case"text":default:n=e.text();break;case"blob":case"document":case"json":throw new Error(`${t} is not supported.`)}return n}class on extends en{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new $t):e.method?e.url?new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),r.withCredentials=void 0===e.withCredentials||e.withCredentials,r.setRequestHeader("X-Requested-With","XMLHttpRequest"),""===e.content&&(e.content=void 0),e.content&&(kt(e.content)?r.setRequestHeader("Content-Type","application/octet-stream"):r.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const o=e.headers;o&&Object.keys(o).forEach((e=>{r.setRequestHeader(e,o[e])})),e.responseType&&(r.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=()=>{r.abort(),n(new $t)}),e.timeout&&(r.timeout=e.timeout),r.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),r.status>=200&&r.status<300?t(new Zt(r.status,r.statusText,r.response||r.responseText)):n(new Bt(r.response||r.responseText||r.statusText,r.status))},r.onerror=()=>{this._logger.log(_t.Warning,`Error from HTTP request. ${r.status}: ${r.statusText}.`),n(new Bt(r.statusText,r.status))},r.ontimeout=()=>{this._logger.log(_t.Warning,"Timeout from HTTP request."),n(new Lt)},r.send(e.content)})):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class sn extends en{constructor(e){if(super(),"undefined"!=typeof fetch)this._httpClient=new nn(e);else{if("undefined"==typeof XMLHttpRequest)throw new Error("No usable HttpClient found.");this._httpClient=new on(e)}}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new $t):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}}var an,cn;!function(e){e[e.None=0]="None",e[e.WebSockets=1]="WebSockets",e[e.ServerSentEvents=2]="ServerSentEvents",e[e.LongPolling=4]="LongPolling"}(an||(an={})),function(e){e[e.Text=1]="Text",e[e.Binary=2]="Binary"}(cn||(cn={}));class ln{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}}class hn{get pollAborted(){return this._pollAbort.aborted}constructor(e,t,n){this._httpClient=e,this._logger=t,this._pollAbort=new ln,this._options=n,this._running=!1,this.onreceive=null,this.onclose=null}async connect(e,t){if(Et.isRequired(e,"url"),Et.isRequired(t,"transferFormat"),Et.isIn(t,cn,"transferFormat"),this._url=e,this._logger.log(_t.Trace,"(LongPolling transport) Connecting."),t===cn.Binary&&"undefined"!=typeof XMLHttpRequest&&"string"!=typeof(new XMLHttpRequest).responseType)throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[n,r]=xt(),o={[n]:r,...this._options.headers},s={abortSignal:this._pollAbort.signal,headers:o,timeout:1e5,withCredentials:this._options.withCredentials};t===cn.Binary&&(s.responseType="arraybuffer");const i=`${e}&_=${Date.now()}`;this._logger.log(_t.Trace,`(LongPolling transport) polling: ${i}.`);const a=await this._httpClient.get(i,s);200!==a.statusCode?(this._logger.log(_t.Error,`(LongPolling transport) Unexpected response code: ${a.statusCode}.`),this._closeError=new Bt(a.statusText||"",a.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,s)}async _poll(e,t){try{for(;this._running;)try{const n=`${e}&_=${Date.now()}`;this._logger.log(_t.Trace,`(LongPolling transport) polling: ${n}.`);const r=await this._httpClient.get(n,t);204===r.statusCode?(this._logger.log(_t.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):200!==r.statusCode?(this._logger.log(_t.Error,`(LongPolling transport) Unexpected response code: ${r.statusCode}.`),this._closeError=new Bt(r.statusText||"",r.statusCode),this._running=!1):r.content?(this._logger.log(_t.Trace,`(LongPolling transport) data received. ${It(r.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(r.content)):this._logger.log(_t.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(e){this._running?e instanceof Lt?this._logger.log(_t.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=e,this._running=!1):this._logger.log(_t.Trace,`(LongPolling transport) Poll errored after shutdown: ${e.message}`)}}finally{this._logger.log(_t.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(e){return this._running?Tt(this._logger,"LongPolling",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this._logger.log(_t.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(_t.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const e={},[t,n]=xt();e[t]=n;const r={headers:{...e,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials};let o;try{await this._httpClient.delete(this._url,r)}catch(e){o=e}o?o instanceof Bt&&(404===o.statusCode?this._logger.log(_t.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this._logger.log(_t.Trace,`(LongPolling transport) Error sending a DELETE request: ${o}`)):this._logger.log(_t.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this._logger.log(_t.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}}_raiseOnClose(){if(this.onclose){let e="(LongPolling transport) Firing onclose event.";this._closeError&&(e+=" Error: "+this._closeError),this._logger.log(_t.Trace,e),this.onclose(this._closeError)}}}class dn{constructor(e,t,n,r){this._httpClient=e,this._accessToken=t,this._logger=n,this._options=r,this.onreceive=null,this.onclose=null}async connect(e,t){return Et.isRequired(e,"url"),Et.isRequired(t,"transferFormat"),Et.isIn(t,cn,"transferFormat"),this._logger.log(_t.Trace,"(SSE transport) Connecting."),this._url=e,this._accessToken&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise(((n,r)=>{let o,s=!1;if(t===cn.Text){if(Ct.isBrowser||Ct.isWebWorker)o=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{const t=this._httpClient.getCookieString(e),n={};n.Cookie=t;const[r,s]=xt();n[r]=s,o=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:{...n,...this._options.headers}})}try{o.onmessage=e=>{if(this.onreceive)try{this._logger.log(_t.Trace,`(SSE transport) data received. ${It(e.data,this._options.logMessageContent)}.`),this.onreceive(e.data)}catch(e){return void this._close(e)}},o.onerror=e=>{s?this._close():r(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."))},o.onopen=()=>{this._logger.log(_t.Information,`SSE connected to ${this._url}`),this._eventSource=o,s=!0,n()}}catch(e){return void r(e)}}else r(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))}))}async send(e){return this._eventSource?Tt(this._logger,"SSE",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}}class un{constructor(e,t,n,r,o,s){this._logger=n,this._accessTokenFactory=t,this._logMessageContent=r,this._webSocketConstructor=o,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=s}async connect(e,t){let n;return Et.isRequired(e,"url"),Et.isRequired(t,"transferFormat"),Et.isIn(t,cn,"transferFormat"),this._logger.log(_t.Trace,"(WebSockets transport) Connecting."),this._accessTokenFactory&&(n=await this._accessTokenFactory()),new Promise(((r,o)=>{let s;e=e.replace(/^http/,"ws");const i=this._httpClient.getCookieString(e);let a=!1;if(Ct.isReactNative){const t={},[r,o]=xt();t[r]=o,n&&(t[Qt.Authorization]=`Bearer ${n}`),i&&(t[Qt.Cookie]=i),s=new this._webSocketConstructor(e,void 0,{headers:{...t,...this._headers}})}else n&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(n)}`);s||(s=new this._webSocketConstructor(e)),t===cn.Binary&&(s.binaryType="arraybuffer"),s.onopen=t=>{this._logger.log(_t.Information,`WebSocket connected to ${e}.`),this._webSocket=s,a=!0,r()},s.onerror=e=>{let t=null;t="undefined"!=typeof ErrorEvent&&e instanceof ErrorEvent?e.error:"There was an error with the transport",this._logger.log(_t.Information,`(WebSockets transport) ${t}.`)},s.onmessage=e=>{if(this._logger.log(_t.Trace,`(WebSockets transport) data received. ${It(e.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(e.data)}catch(e){return void this._close(e)}},s.onclose=e=>{if(a)this._close(e);else{let t=null;t="undefined"!=typeof ErrorEvent&&e instanceof ErrorEvent?e.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.",o(new Error(t))}}}))}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(_t.Trace,`(WebSockets transport) sending data. ${It(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(_t.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this._isCloseEvent(e)||!1!==e.wasClean&&1e3===e.code?e instanceof Error?this.onclose(e):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason||"no reason given"}).`)))}_isCloseEvent(e){return e&&"boolean"==typeof e.wasClean&&"number"==typeof e.code}}class pn{constructor(e,t={}){if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,Et.isRequired(e,"url"),this._logger=function(e){return void 0===e?new Rt(_t.Information):null===e?bt.instance:void 0!==e.log?e:new Rt(e)}(t.logger),this.baseUrl=this._resolveUrl(e),(t=t||{}).logMessageContent=void 0!==t.logMessageContent&&t.logMessageContent,"boolean"!=typeof t.withCredentials&&void 0!==t.withCredentials)throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");t.withCredentials=void 0===t.withCredentials||t.withCredentials,t.timeout=void 0===t.timeout?1e5:t.timeout,"undefined"==typeof WebSocket||t.WebSocket||(t.WebSocket=WebSocket),"undefined"==typeof EventSource||t.EventSource||(t.EventSource=EventSource),this._httpClient=new tn(t.httpClient||new sn(this._logger),t.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=t,this.onreceive=null,this.onclose=null}async start(e){if(e=e||cn.Binary,Et.isIn(e,cn,"transferFormat"),this._logger.log(_t.Debug,`Starting connection with transfer format '${cn[e]}'.`),"Disconnected"!==this._connectionState)return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(e),await this._startInternalPromise,"Disconnecting"===this._connectionState){const e="Failed to start the HttpConnection before stop() was called.";return this._logger.log(_t.Error,e),await this._stopPromise,Promise.reject(new $t(e))}if("Connected"!==this._connectionState){const e="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(_t.Error,e),Promise.reject(new $t(e))}this._connectionStarted=!0}send(e){return"Connected"!==this._connectionState?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new fn(this.transport)),this._sendQueue.send(e))}async stop(e){return"Disconnected"===this._connectionState?(this._logger.log(_t.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):"Disconnecting"===this._connectionState?(this._logger.log(_t.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState="Disconnecting",this._stopPromise=new Promise((e=>{this._stopPromiseResolver=e})),await this._stopInternal(e),void await this._stopPromise)}async _stopInternal(e){this._stopError=e;try{await this._startInternalPromise}catch(e){}if(this.transport){try{await this.transport.stop()}catch(e){this._logger.log(_t.Error,`HttpConnection.transport.stop() threw error '${e}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(_t.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async _startInternal(e){let t=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport!==an.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(an.WebSockets),await this._startTransport(t,e)}else{let n=null,r=0;do{if(n=await this._getNegotiationResponse(t),"Disconnecting"===this._connectionState||"Disconnected"===this._connectionState)throw new $t("The connection was stopped during negotiation.");if(n.error)throw new Error(n.error);if(n.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(n.url&&(t=n.url),n.accessToken){const e=n.accessToken;this._accessTokenFactory=()=>e,this._httpClient._accessToken=e,this._httpClient._accessTokenFactory=void 0}r++}while(n.url&&r<100);if(100===r&&n.url)throw new Error("Negotiate redirection limit exceeded.");await this._createTransport(t,this._options.transport,n,e)}this.transport instanceof hn&&(this.features.inherentKeepAlive=!0),"Connecting"===this._connectionState&&(this._logger.log(_t.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(e){return this._logger.log(_t.Error,"Failed to start the connection: "+e),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(e)}}async _getNegotiationResponse(e){const t={},[n,r]=xt();t[n]=r;const o=this._resolveNegotiateUrl(e);this._logger.log(_t.Debug,`Sending negotiation request: ${o}.`);try{const e=await this._httpClient.post(o,{content:"",headers:{...t,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(200!==e.statusCode)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${e.statusCode}'`));const n=JSON.parse(e.content);return(!n.negotiateVersion||n.negotiateVersion<1)&&(n.connectionToken=n.connectionId),n.useStatefulReconnect&&!0!==this._options._useStatefulReconnect?Promise.reject(new jt("Client didn't negotiate Stateful Reconnect but the server did.")):n}catch(e){let t="Failed to complete negotiation with the server: "+e;return e instanceof Bt&&404===e.statusCode&&(t+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(_t.Error,t),Promise.reject(new jt(t))}}_createConnectUrl(e,t){return t?e+(-1===e.indexOf("?")?"?":"&")+`id=${t}`:e}async _createTransport(e,t,n,r){let o=this._createConnectUrl(e,n.connectionToken);if(this._isITransport(t))return this._logger.log(_t.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=t,await this._startTransport(o,r),void(this.connectionId=n.connectionId);const s=[],i=n.availableTransports||[];let a=n;for(const n of i){const i=this._resolveTransportOrError(n,t,r,!0===(null==a?void 0:a.useStatefulReconnect));if(i instanceof Error)s.push(`${n.transport} failed:`),s.push(i);else if(this._isITransport(i)){if(this.transport=i,!a){try{a=await this._getNegotiationResponse(e)}catch(e){return Promise.reject(e)}o=this._createConnectUrl(e,a.connectionToken)}try{return await this._startTransport(o,r),void(this.connectionId=a.connectionId)}catch(e){if(this._logger.log(_t.Error,`Failed to start the transport '${n.transport}': ${e}`),a=void 0,s.push(new Ht(`${n.transport} failed: ${e}`,an[n.transport])),"Connecting"!==this._connectionState){const e="Failed to select transport before stop() was called.";return this._logger.log(_t.Debug,e),Promise.reject(new $t(e))}}}}return s.length>0?Promise.reject(new Wt(`Unable to connect to the server with any of the available transports. ${s.join(" ")}`,s)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))}_constructTransport(e){switch(e){case an.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new un(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case an.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new dn(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case an.LongPolling:return new hn(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,t){return this.transport.onreceive=this.onreceive,this.features.reconnect?this.transport.onclose=async n=>{let r=!1;if(this.features.reconnect){try{this.features.disconnected(),await this.transport.connect(e,t),await this.features.resend()}catch{r=!0}r&&this._stopConnection(n)}else this._stopConnection(n)}:this.transport.onclose=e=>this._stopConnection(e),this.transport.connect(e,t)}_resolveTransportOrError(e,t,n,r){const o=an[e.transport];if(null==o)return this._logger.log(_t.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(!function(e,t){return!e||0!=(t&e)}(t,o))return this._logger.log(_t.Debug,`Skipping transport '${an[o]}' because it was disabled by the client.`),new Ft(`'${an[o]}' is disabled by the client.`,o);if(!(e.transferFormats.map((e=>cn[e])).indexOf(n)>=0))return this._logger.log(_t.Debug,`Skipping transport '${an[o]}' because it does not support the requested transfer format '${cn[n]}'.`),new Error(`'${an[o]}' does not support ${cn[n]}.`);if(o===an.WebSockets&&!this._options.WebSocket||o===an.ServerSentEvents&&!this._options.EventSource)return this._logger.log(_t.Debug,`Skipping transport '${an[o]}' because it is not supported in your environment.'`),new Ot(`'${an[o]}' is not supported in your environment.`,o);this._logger.log(_t.Debug,`Selecting transport '${an[o]}'.`);try{return this.features.reconnect=o===an.WebSockets?r:void 0,this._constructTransport(o)}catch(e){return e}}_isITransport(e){return e&&"object"==typeof e&&"connect"in e}_stopConnection(e){if(this._logger.log(_t.Debug,`HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`),this.transport=void 0,e=this._stopError||e,this._stopError=void 0,"Disconnected"!==this._connectionState){if("Connecting"===this._connectionState)throw this._logger.log(_t.Warning,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);if("Disconnecting"===this._connectionState&&this._stopPromiseResolver(),e?this._logger.log(_t.Error,`Connection disconnected with error '${e}'.`):this._logger.log(_t.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch((e=>{this._logger.log(_t.Error,`TransportSendQueue.stop() threw error '${e}'.`)})),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(t){this._logger.log(_t.Error,`HttpConnection.onclose(${e}) threw error '${t}'.`)}}}else this._logger.log(_t.Debug,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`)}_resolveUrl(e){if(0===e.lastIndexOf("https://",0)||0===e.lastIndexOf("http://",0))return e;if(!Ct.isBrowser)throw new Error(`Cannot resolve '${e}'.`);const t=window.document.createElement("a");return t.href=e,this._logger.log(_t.Information,`Normalizing '${e}' to '${t.href}'.`),t.href}_resolveNegotiateUrl(e){const t=new URL(e);t.pathname.endsWith("/")?t.pathname+="negotiate":t.pathname+="/negotiate";const n=new URLSearchParams(t.searchParams);return n.has("negotiateVersion")||n.append("negotiateVersion",this._negotiateVersion.toString()),n.has("useStatefulReconnect")?"true"===n.get("useStatefulReconnect")&&(this._options._useStatefulReconnect=!0):!0===this._options._useStatefulReconnect&&n.append("useStatefulReconnect","true"),t.search=n.toString(),t.toString()}}class fn{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new gn,this._transportResult=new gn,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new gn),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}async _sendLoop(){for(;;){if(await this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new gn;const e=this._transportResult;this._transportResult=void 0;const t="string"==typeof this._buffer[0]?this._buffer.join(""):fn._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(t),e.resolve()}catch(t){e.reject(t)}}}static _concatBuffers(e){const t=e.map((e=>e.byteLength)).reduce(((e,t)=>e+t)),n=new Uint8Array(t);let r=0;for(const t of e)n.set(new Uint8Array(t),r),r+=t.byteLength;return n.buffer}}class gn{constructor(){this.promise=new Promise(((e,t)=>[this._resolver,this._rejecter]=[e,t]))}resolve(){this._resolver()}reject(e){this._rejecter(e)}}class mn{constructor(){this.name="json",this.version=2,this.transferFormat=cn.Text}parseMessages(e,t){if("string"!=typeof e)throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];null===t&&(t=bt.instance);const n=wt.parse(e),r=[];for(const e of n){const n=JSON.parse(e);if("number"!=typeof n.type)throw new Error("Invalid payload.");switch(n.type){case zt.Invocation:this._isInvocationMessage(n);break;case zt.StreamItem:this._isStreamItemMessage(n);break;case zt.Completion:this._isCompletionMessage(n);break;case zt.Ping:case zt.Close:break;case zt.Ack:this._isAckMessage(n);break;case zt.Sequence:this._isSequenceMessage(n);break;default:t.log(_t.Information,"Unknown message type '"+n.type+"' ignored.");continue}r.push(n)}return r}writeMessage(e){return wt.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,"Invalid payload for Invocation message."),void 0!==e.invocationId&&this._assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),void 0===e.item)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this._assertNotEmptyString(e.error,"Invalid payload for Completion message."),this._assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")}_isAckMessage(e){if("number"!=typeof e.sequenceId)throw new Error("Invalid SequenceId for Ack message.")}_isSequenceMessage(e){if("number"!=typeof e.sequenceId)throw new Error("Invalid SequenceId for Sequence message.")}_assertNotEmptyString(e,t){if("string"!=typeof e||""===e)throw new Error(t)}}const vn={trace:_t.Trace,debug:_t.Debug,info:_t.Information,information:_t.Information,warn:_t.Warning,warning:_t.Warning,error:_t.Error,critical:_t.Critical,none:_t.None};class yn{configureLogging(e){if(Et.isRequired(e,"logging"),function(e){return void 0!==e.log}(e))this.logger=e;else if("string"==typeof e){const t=function(e){const t=vn[e.toLowerCase()];if(void 0!==t)return t;throw new Error(`Unknown log level: ${e}`)}(e);this.logger=new Rt(t)}else this.logger=new Rt(e);return this}withUrl(e,t){return Et.isRequired(e,"url"),Et.isNotEmpty(e,"url"),this.url=e,this.httpConnectionOptions="object"==typeof t?{...this.httpConnectionOptions,...t}:{...this.httpConnectionOptions,transport:t},this}withHubProtocol(e){return Et.isRequired(e,"protocol"),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new Gt(e):this.reconnectPolicy=e:this.reconnectPolicy=new Gt,this}withServerTimeout(e){return Et.isRequired(e,"milliseconds"),this._serverTimeoutInMilliseconds=e,this}withKeepAliveInterval(e){return Et.isRequired(e,"milliseconds"),this._keepAliveIntervalInMilliseconds=e,this}withStatefulReconnect(e){return void 0===this.httpConnectionOptions&&(this.httpConnectionOptions={}),this.httpConnectionOptions._useStatefulReconnect=!0,this._statefulReconnectBufferSize=null==e?void 0:e.bufferSize,this}build(){const e=this.httpConnectionOptions||{};if(void 0===e.logger&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const t=new pn(this.url,e);return Xt.create(t,this.logger||bt.instance,this.protocol||new mn,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}}var wn;!function(e){e[e.Default=0]="Default",e[e.Server=1]="Server",e[e.WebAssembly=2]="WebAssembly",e[e.WebView=3]="WebView"}(wn||(wn={}));var _n,bn,Sn,En=4294967295;function Cn(e,t,n){var r=Math.floor(n/4294967296),o=n;e.setUint32(t,r),e.setUint32(t+4,o)}function In(e,t){return 4294967296*e.getInt32(t)+e.getUint32(t+4)}var kn=("undefined"==typeof process||"never"!==(null===(_n=null===process||void 0===process?void 0:process.env)||void 0===_n?void 0:_n.TEXT_ENCODING))&&"undefined"!=typeof TextEncoder&&"undefined"!=typeof TextDecoder;function Tn(e){for(var t=e.length,n=0,r=0;r=55296&&o<=56319&&r65535&&(h-=65536,s.push(h>>>10&1023|55296),h=56320|1023&h),s.push(h)}else s.push(a);s.length>=4096&&(i+=String.fromCharCode.apply(String,s),s.length=0)}return s.length>0&&(i+=String.fromCharCode.apply(String,s)),i}var Pn,Un=kn?new TextDecoder:null,Nn=kn?"undefined"!=typeof process&&"force"!==(null===(Sn=null===process||void 0===process?void 0:process.env)||void 0===Sn?void 0:Sn.TEXT_DECODER)?200:0:En,Mn=function(e,t){this.type=e,this.data=t},Bn=(Pn=function(e,t){return Pn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Pn(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Pn(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Ln=function(e){function t(n){var r=e.call(this,n)||this,o=Object.create(t.prototype);return Object.setPrototypeOf(r,o),Object.defineProperty(r,"name",{configurable:!0,enumerable:!1,value:t.name}),r}return Bn(t,e),t}(Error),$n={type:-1,encode:function(e){var t,n,r,o;return e instanceof Date?function(e){var t,n=e.sec,r=e.nsec;if(n>=0&&r>=0&&n<=17179869183){if(0===r&&n<=4294967295){var o=new Uint8Array(4);return(t=new DataView(o.buffer)).setUint32(0,n),o}var s=n/4294967296,i=4294967295&n;return o=new Uint8Array(8),(t=new DataView(o.buffer)).setUint32(0,r<<2|3&s),t.setUint32(4,i),o}return o=new Uint8Array(12),(t=new DataView(o.buffer)).setUint32(0,r),Cn(t,4,n),o}((r=1e6*((t=e.getTime())-1e3*(n=Math.floor(t/1e3))),{sec:n+(o=Math.floor(r/1e9)),nsec:r-1e9*o})):null},decode:function(e){var t=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:var n=t.getUint32(0);return{sec:4294967296*(3&n)+t.getUint32(4),nsec:n>>>2};case 12:return{sec:In(t,4),nsec:t.getUint32(0)};default:throw new Ln("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(e.length))}}(e);return new Date(1e3*t.sec+t.nsec/1e6)}},On=function(){function e(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register($n)}return e.prototype.register=function(e){var t=e.type,n=e.encode,r=e.decode;if(t>=0)this.encoders[t]=n,this.decoders[t]=r;else{var o=1+t;this.builtInEncoders[o]=n,this.builtInDecoders[o]=r}},e.prototype.tryToEncode=function(e,t){for(var n=0;nthis.maxDepth)throw new Error("Too deep objects in depth ".concat(t));null==e?this.encodeNil():"boolean"==typeof e?this.encodeBoolean(e):"number"==typeof e?this.encodeNumber(e):"string"==typeof e?this.encodeString(e):this.encodeObject(e,t)},e.prototype.ensureBufferSizeToWrite=function(e){var t=this.pos+e;this.view.byteLength=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):(this.writeU8(211),this.writeI64(e)):this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))},e.prototype.writeStringHeader=function(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else{if(!(e<4294967296))throw new Error("Too long string: ".concat(e," bytes in UTF-8"));this.writeU8(219),this.writeU32(e)}},e.prototype.encodeString=function(e){if(e.length>Rn){var t=Tn(e);this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),xn(e,this.bytes,this.pos),this.pos+=t}else t=Tn(e),this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),function(e,t,n){for(var r=e.length,o=n,s=0;s>6&31|192;else{if(i>=55296&&i<=56319&&s>12&15|224,t[o++]=i>>6&63|128):(t[o++]=i>>18&7|240,t[o++]=i>>12&63|128,t[o++]=i>>6&63|128)}t[o++]=63&i|128}else t[o++]=i}}(e,this.bytes,this.pos),this.pos+=t},e.prototype.encodeObject=function(e,t){var n=this.extensionCodec.tryToEncode(e,this.context);if(null!=n)this.encodeExtension(n);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else{if("object"!=typeof e)throw new Error("Unrecognized object: ".concat(Object.prototype.toString.apply(e)));this.encodeMap(e,t)}},e.prototype.encodeBinary=function(e){var t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too large binary: ".concat(t));this.writeU8(198),this.writeU32(t)}var n=Fn(e);this.writeU8a(n)},e.prototype.encodeArray=function(e,t){var n=e.length;if(n<16)this.writeU8(144+n);else if(n<65536)this.writeU8(220),this.writeU16(n);else{if(!(n<4294967296))throw new Error("Too large array: ".concat(n));this.writeU8(221),this.writeU32(n)}for(var r=0,o=e;r0&&e<=this.maxKeyLength},e.prototype.find=function(e,t,n){e:for(var r=0,o=this.caches[n-1];r=this.maxLengthPerKey?n[Math.random()*n.length|0]=r:n.push(r)},e.prototype.decode=function(e,t,n){var r=this.find(e,t,n);if(null!=r)return this.hit++,r;this.miss++;var o=An(e,t,n),s=Uint8Array.prototype.slice.call(e,t,t+n);return this.store(s,o),o},e}(),zn=function(e,t){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=e},e.prototype.createExtraByteError=function(e){var t=this.view,n=this.pos;return new RangeError("Extra ".concat(t.byteLength-n," of ").concat(t.byteLength," byte(s) found at buffer[").concat(e,"]"))},e.prototype.decode=function(e){this.reinitializeState(),this.setBuffer(e);var t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t},e.prototype.decodeMulti=function(e){return zn(this,(function(t){switch(t.label){case 0:this.reinitializeState(),this.setBuffer(e),t.label=1;case 1:return this.hasRemaining(1)?[4,this.doDecodeSync()]:[3,3];case 2:return t.sent(),[3,1];case 3:return[2]}}))},e.prototype.decodeAsync=function(e){var t,n,r,o,s,i,a;return s=this,void 0,a=function(){var s,i,a,c,l,h,d,u;return zn(this,(function(p){switch(p.label){case 0:s=!1,p.label=1;case 1:p.trys.push([1,6,7,12]),t=qn(e),p.label=2;case 2:return[4,t.next()];case 3:if((n=p.sent()).done)return[3,5];if(a=n.value,s)throw this.createExtraByteError(this.totalPos);this.appendBuffer(a);try{i=this.doDecodeSync(),s=!0}catch(e){if(!(e instanceof Xn))throw e}this.totalPos+=this.pos,p.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return c=p.sent(),r={error:c},[3,12];case 7:return p.trys.push([7,,10,11]),n&&!n.done&&(o=t.return)?[4,o.call(t)]:[3,9];case 8:p.sent(),p.label=9;case 9:return[3,11];case 10:if(r)throw r.error;return[7];case 11:return[7];case 12:if(s){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return[2,i]}throw h=(l=this).headByte,d=l.pos,u=l.totalPos,new RangeError("Insufficient data in parsing ".concat(jn(h)," at ").concat(u," (").concat(d," in the current buffer)"))}}))},new((i=void 0)||(i=Promise))((function(e,t){function n(e){try{o(a.next(e))}catch(e){t(e)}}function r(e){try{o(a.throw(e))}catch(e){t(e)}}function o(t){var o;t.done?e(t.value):(o=t.value,o instanceof i?o:new i((function(e){e(o)}))).then(n,r)}o((a=a.apply(s,[])).next())}))},e.prototype.decodeArrayStream=function(e){return this.decodeMultiAsync(e,!0)},e.prototype.decodeStream=function(e){return this.decodeMultiAsync(e,!1)},e.prototype.decodeMultiAsync=function(e,t){return function(n,r,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s,i=function(){var n,r,o,s,i,a,c,l,h;return zn(this,(function(d){switch(d.label){case 0:n=t,r=-1,d.label=1;case 1:d.trys.push([1,13,14,19]),o=qn(e),d.label=2;case 2:return[4,Jn(o.next())];case 3:if((s=d.sent()).done)return[3,12];if(i=s.value,t&&0===r)throw this.createExtraByteError(this.totalPos);this.appendBuffer(i),n&&(r=this.readArraySize(),n=!1,this.complete()),d.label=4;case 4:d.trys.push([4,9,,10]),d.label=5;case 5:return[4,Jn(this.doDecodeSync())];case 6:return[4,d.sent()];case 7:return d.sent(),0==--r?[3,8]:[3,5];case 8:return[3,10];case 9:if(!((a=d.sent())instanceof Xn))throw a;return[3,10];case 10:this.totalPos+=this.pos,d.label=11;case 11:return[3,2];case 12:return[3,19];case 13:return c=d.sent(),l={error:c},[3,19];case 14:return d.trys.push([14,,17,18]),s&&!s.done&&(h=o.return)?[4,Jn(h.call(o))]:[3,16];case 15:d.sent(),d.label=16;case 16:return[3,18];case 17:if(l)throw l.error;return[7];case 18:return[7];case 19:return[2]}}))}.apply(n,r||[]),a=[];return s={},c("next"),c("throw"),c("return"),s[Symbol.asyncIterator]=function(){return this},s;function c(e){i[e]&&(s[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||l(e,t)}))})}function l(e,t){try{(n=i[e](t)).value instanceof Jn?Promise.resolve(n.value.v).then(h,d):u(a[0][2],n)}catch(e){u(a[0][3],e)}var n}function h(e){l("next",e)}function d(e){l("throw",e)}function u(e,t){e(t),a.shift(),a.length&&l(a[0][0],a[0][1])}}(this,arguments)},e.prototype.doDecodeSync=function(){e:for(;;){var e=this.readHeadByte(),t=void 0;if(e>=224)t=e-256;else if(e<192)if(e<128)t=e;else if(e<144){if(0!=(r=e-128)){this.pushMapState(r),this.complete();continue e}t={}}else if(e<160){if(0!=(r=e-144)){this.pushArrayState(r),this.complete();continue e}t=[]}else{var n=e-160;t=this.decodeUtf8String(n,0)}else if(192===e)t=null;else if(194===e)t=!1;else if(195===e)t=!0;else if(202===e)t=this.readF32();else if(203===e)t=this.readF64();else if(204===e)t=this.readU8();else if(205===e)t=this.readU16();else if(206===e)t=this.readU32();else if(207===e)t=this.readU64();else if(208===e)t=this.readI8();else if(209===e)t=this.readI16();else if(210===e)t=this.readI32();else if(211===e)t=this.readI64();else if(217===e)n=this.lookU8(),t=this.decodeUtf8String(n,1);else if(218===e)n=this.lookU16(),t=this.decodeUtf8String(n,2);else if(219===e)n=this.lookU32(),t=this.decodeUtf8String(n,4);else if(220===e){if(0!==(r=this.readU16())){this.pushArrayState(r),this.complete();continue e}t=[]}else if(221===e){if(0!==(r=this.readU32())){this.pushArrayState(r),this.complete();continue e}t=[]}else if(222===e){if(0!==(r=this.readU16())){this.pushMapState(r),this.complete();continue e}t={}}else if(223===e){if(0!==(r=this.readU32())){this.pushMapState(r),this.complete();continue e}t={}}else if(196===e){var r=this.lookU8();t=this.decodeBinary(r,1)}else if(197===e)r=this.lookU16(),t=this.decodeBinary(r,2);else if(198===e)r=this.lookU32(),t=this.decodeBinary(r,4);else if(212===e)t=this.decodeExtension(1,0);else if(213===e)t=this.decodeExtension(2,0);else if(214===e)t=this.decodeExtension(4,0);else if(215===e)t=this.decodeExtension(8,0);else if(216===e)t=this.decodeExtension(16,0);else if(199===e)r=this.lookU8(),t=this.decodeExtension(r,1);else if(200===e)r=this.lookU16(),t=this.decodeExtension(r,2);else{if(201!==e)throw new Ln("Unrecognized type byte: ".concat(jn(e)));r=this.lookU32(),t=this.decodeExtension(r,4)}this.complete();for(var o=this.stack;o.length>0;){var s=o[o.length-1];if(0===s.type){if(s.array[s.position]=t,s.position++,s.position!==s.size)continue e;o.pop(),t=s.array}else{if(1===s.type){if("string"!=(i=typeof t)&&"number"!==i)throw new Ln("The type of key must be string or number but "+typeof t);if("__proto__"===t)throw new Ln("The key __proto__ is not allowed");s.key=t,s.type=2;continue e}if(s.map[s.key]=t,s.readCount++,s.readCount!==s.size){s.key=null,s.type=1;continue e}o.pop(),t=s.map}}return t}var i},e.prototype.readHeadByte=function(){return-1===this.headByte&&(this.headByte=this.readU8()),this.headByte},e.prototype.complete=function(){this.headByte=-1},e.prototype.readArraySize=function(){var e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw new Ln("Unrecognized array type byte: ".concat(jn(e)))}},e.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw new Ln("Max length exceeded: map length (".concat(e,") > maxMapLengthLength (").concat(this.maxMapLength,")"));this.stack.push({type:1,size:e,key:null,readCount:0,map:{}})},e.prototype.pushArrayState=function(e){if(e>this.maxArrayLength)throw new Ln("Max length exceeded: array length (".concat(e,") > maxArrayLength (").concat(this.maxArrayLength,")"));this.stack.push({type:0,size:e,array:new Array(e),position:0})},e.prototype.decodeUtf8String=function(e,t){var n;if(e>this.maxStrLength)throw new Ln("Max length exceeded: UTF-8 byte length (".concat(e,") > maxStrLength (").concat(this.maxStrLength,")"));if(this.bytes.byteLengthNn?function(e,t,n){var r=e.subarray(t,t+n);return Un.decode(r)}(this.bytes,o,e):An(this.bytes,o,e),this.pos+=t+e,r},e.prototype.stateIsMapKey=function(){return this.stack.length>0&&1===this.stack[this.stack.length-1].type},e.prototype.decodeBinary=function(e,t){if(e>this.maxBinLength)throw new Ln("Max length exceeded: bin length (".concat(e,") > maxBinLength (").concat(this.maxBinLength,")"));if(!this.hasRemaining(e+t))throw Yn;var n=this.pos+t,r=this.bytes.subarray(n,n+e);return this.pos+=t+e,r},e.prototype.decodeExtension=function(e,t){if(e>this.maxExtLength)throw new Ln("Max length exceeded: ext length (".concat(e,") > maxExtLength (").concat(this.maxExtLength,")"));var n=this.view.getInt8(this.pos+t),r=this.decodeBinary(e,t+1);return this.extensionCodec.decode(r,n,this.context)},e.prototype.lookU8=function(){return this.view.getUint8(this.pos)},e.prototype.lookU16=function(){return this.view.getUint16(this.pos)},e.prototype.lookU32=function(){return this.view.getUint32(this.pos)},e.prototype.readU8=function(){var e=this.view.getUint8(this.pos);return this.pos++,e},e.prototype.readI8=function(){var e=this.view.getInt8(this.pos);return this.pos++,e},e.prototype.readU16=function(){var e=this.view.getUint16(this.pos);return this.pos+=2,e},e.prototype.readI16=function(){var e=this.view.getInt16(this.pos);return this.pos+=2,e},e.prototype.readU32=function(){var e=this.view.getUint32(this.pos);return this.pos+=4,e},e.prototype.readI32=function(){var e=this.view.getInt32(this.pos);return this.pos+=4,e},e.prototype.readU64=function(){var e,t,n=(e=this.view,t=this.pos,4294967296*e.getUint32(t)+e.getUint32(t+4));return this.pos+=8,n},e.prototype.readI64=function(){var e=In(this.view,this.pos);return this.pos+=8,e},e.prototype.readF32=function(){var e=this.view.getFloat32(this.pos);return this.pos+=4,e},e.prototype.readF64=function(){var e=this.view.getFloat64(this.pos);return this.pos+=8,e},e}();class Zn{static write(e){let t=e.byteLength||e.length;const n=[];do{let e=127&t;t>>=7,t>0&&(e|=128),n.push(e)}while(t>0);t=e.byteLength||e.length;const r=new Uint8Array(n.length+t);return r.set(n,0),r.set(e,n.length),r.buffer}static parse(e){const t=[],n=new Uint8Array(e),r=[0,7,14,21,28];for(let o=0;o7)throw new Error("Messages bigger than 2GB are not supported.");if(!(n.byteLength>=o+i+a))throw new Error("Incomplete message.");t.push(n.slice?n.slice(o+i,o+i+a):n.subarray(o+i,o+i+a)),o=o+i+a}return t}}const er=new Uint8Array([145,zt.Ping]);class tr{constructor(e){this.name="messagepack",this.version=2,this.transferFormat=cn.Binary,this._errorResult=1,this._voidResult=2,this._nonVoidResult=3,e=e||{},this._encoder=new Hn(e.extensionCodec,e.context,e.maxDepth,e.initialBufferSize,e.sortKeys,e.forceFloat32,e.ignoreUndefined,e.forceIntegerToFloat),this._decoder=new Qn(e.extensionCodec,e.context,e.maxStrLength,e.maxBinLength,e.maxArrayLength,e.maxMapLength,e.maxExtLength)}parseMessages(e,t){if(!(n=e)||"undefined"==typeof ArrayBuffer||!(n instanceof ArrayBuffer||n.constructor&&"ArrayBuffer"===n.constructor.name))throw new Error("Invalid input for MessagePack hub protocol. Expected an ArrayBuffer.");var n;null===t&&(t=bt.instance);const r=Zn.parse(e),o=[];for(const e of r){const n=this._parseMessage(e,t);n&&o.push(n)}return o}writeMessage(e){switch(e.type){case zt.Invocation:return this._writeInvocation(e);case zt.StreamInvocation:return this._writeStreamInvocation(e);case zt.StreamItem:return this._writeStreamItem(e);case zt.Completion:return this._writeCompletion(e);case zt.Ping:return Zn.write(er);case zt.CancelInvocation:return this._writeCancelInvocation(e);case zt.Close:return this._writeClose();case zt.Ack:return this._writeAck(e);case zt.Sequence:return this._writeSequence(e);default:throw new Error("Invalid message type.")}}_parseMessage(e,t){if(0===e.length)throw new Error("Invalid payload.");const n=this._decoder.decode(e);if(0===n.length||!(n instanceof Array))throw new Error("Invalid payload.");const r=n[0];switch(r){case zt.Invocation:return this._createInvocationMessage(this._readHeaders(n),n);case zt.StreamItem:return this._createStreamItemMessage(this._readHeaders(n),n);case zt.Completion:return this._createCompletionMessage(this._readHeaders(n),n);case zt.Ping:return this._createPingMessage(n);case zt.Close:return this._createCloseMessage(n);case zt.Ack:return this._createAckMessage(n);case zt.Sequence:return this._createSequenceMessage(n);default:return t.log(_t.Information,"Unknown message type '"+r+"' ignored."),null}}_createCloseMessage(e){if(e.length<2)throw new Error("Invalid payload for Close message.");return{allowReconnect:e.length>=3?e[2]:void 0,error:e[1],type:zt.Close}}_createPingMessage(e){if(e.length<1)throw new Error("Invalid payload for Ping message.");return{type:zt.Ping}}_createInvocationMessage(e,t){if(t.length<5)throw new Error("Invalid payload for Invocation message.");const n=t[2];return n?{arguments:t[4],headers:e,invocationId:n,streamIds:[],target:t[3],type:zt.Invocation}:{arguments:t[4],headers:e,streamIds:[],target:t[3],type:zt.Invocation}}_createStreamItemMessage(e,t){if(t.length<4)throw new Error("Invalid payload for StreamItem message.");return{headers:e,invocationId:t[2],item:t[3],type:zt.StreamItem}}_createCompletionMessage(e,t){if(t.length<4)throw new Error("Invalid payload for Completion message.");const n=t[3];if(n!==this._voidResult&&t.length<5)throw new Error("Invalid payload for Completion message.");let r,o;switch(n){case this._errorResult:r=t[4];break;case this._nonVoidResult:o=t[4]}return{error:r,headers:e,invocationId:t[2],result:o,type:zt.Completion}}_createAckMessage(e){if(e.length<1)throw new Error("Invalid payload for Ack message.");return{sequenceId:e[1],type:zt.Ack}}_createSequenceMessage(e){if(e.length<1)throw new Error("Invalid payload for Sequence message.");return{sequenceId:e[1],type:zt.Sequence}}_writeInvocation(e){let t;return t=e.streamIds?this._encoder.encode([zt.Invocation,e.headers||{},e.invocationId||null,e.target,e.arguments,e.streamIds]):this._encoder.encode([zt.Invocation,e.headers||{},e.invocationId||null,e.target,e.arguments]),Zn.write(t.slice())}_writeStreamInvocation(e){let t;return t=e.streamIds?this._encoder.encode([zt.StreamInvocation,e.headers||{},e.invocationId,e.target,e.arguments,e.streamIds]):this._encoder.encode([zt.StreamInvocation,e.headers||{},e.invocationId,e.target,e.arguments]),Zn.write(t.slice())}_writeStreamItem(e){const t=this._encoder.encode([zt.StreamItem,e.headers||{},e.invocationId,e.item]);return Zn.write(t.slice())}_writeCompletion(e){const t=e.error?this._errorResult:void 0!==e.result?this._nonVoidResult:this._voidResult;let n;switch(t){case this._errorResult:n=this._encoder.encode([zt.Completion,e.headers||{},e.invocationId,t,e.error]);break;case this._voidResult:n=this._encoder.encode([zt.Completion,e.headers||{},e.invocationId,t]);break;case this._nonVoidResult:n=this._encoder.encode([zt.Completion,e.headers||{},e.invocationId,t,e.result])}return Zn.write(n.slice())}_writeCancelInvocation(e){const t=this._encoder.encode([zt.CancelInvocation,e.headers||{},e.invocationId]);return Zn.write(t.slice())}_writeClose(){const e=this._encoder.encode([zt.Close,null]);return Zn.write(e.slice())}_writeAck(e){const t=this._encoder.encode([zt.Ack,e.sequenceId]);return Zn.write(t.slice())}_writeSequence(e){const t=this._encoder.encode([zt.Sequence,e.sequenceId]);return Zn.write(t.slice())}_readHeaders(e){const t=e[1];if("object"!=typeof t)throw new Error("Invalid headers.");return t}}const nr="function"==typeof TextDecoder?new TextDecoder("utf-8"):null,rr=nr?nr.decode.bind(nr):function(e){let t=0;const n=e.length,r=[],o=[];for(;t65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o)}r.length>1024&&(o.push(String.fromCharCode.apply(null,r)),r.length=0)}return o.push(String.fromCharCode.apply(null,r)),o.join("")},or=Math.pow(2,32),sr=Math.pow(2,21)-1;function ir(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}function ar(e,t){return e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24>>>0)}function cr(e,t){const n=ar(e,t+4);if(n>sr)throw new Error(`Cannot read uint64 with high order part ${n}, because the result would exceed Number.MAX_SAFE_INTEGER.`);return n*or+ar(e,t)}class lr{constructor(e){this.batchData=e;const t=new pr(e);this.arrayRangeReader=new fr(e),this.arrayBuilderSegmentReader=new gr(e),this.diffReader=new hr(e),this.editReader=new dr(e,t),this.frameReader=new ur(e,t)}updatedComponents(){return ir(this.batchData,this.batchData.length-20)}referenceFrames(){return ir(this.batchData,this.batchData.length-16)}disposedComponentIds(){return ir(this.batchData,this.batchData.length-12)}disposedEventHandlerIds(){return ir(this.batchData,this.batchData.length-8)}updatedComponentsEntry(e,t){const n=e+4*t;return ir(this.batchData,n)}referenceFramesEntry(e,t){return e+20*t}disposedComponentIdsEntry(e,t){const n=e+4*t;return ir(this.batchData,n)}disposedEventHandlerIdsEntry(e,t){const n=e+8*t;return cr(this.batchData,n)}}class hr{constructor(e){this.batchDataUint8=e}componentId(e){return ir(this.batchDataUint8,e)}edits(e){return e+4}editsEntry(e,t){return e+16*t}}class dr{constructor(e,t){this.batchDataUint8=e,this.stringReader=t}editType(e){return ir(this.batchDataUint8,e)}siblingIndex(e){return ir(this.batchDataUint8,e+4)}newTreeIndex(e){return ir(this.batchDataUint8,e+8)}moveToSiblingIndex(e){return ir(this.batchDataUint8,e+8)}removedAttributeName(e){const t=ir(this.batchDataUint8,e+12);return this.stringReader.readString(t)}}class ur{constructor(e,t){this.batchDataUint8=e,this.stringReader=t}frameType(e){return ir(this.batchDataUint8,e)}subtreeLength(e){return ir(this.batchDataUint8,e+4)}elementReferenceCaptureId(e){const t=ir(this.batchDataUint8,e+4);return this.stringReader.readString(t)}componentId(e){return ir(this.batchDataUint8,e+8)}elementName(e){const t=ir(this.batchDataUint8,e+8);return this.stringReader.readString(t)}textContent(e){const t=ir(this.batchDataUint8,e+4);return this.stringReader.readString(t)}markupContent(e){const t=ir(this.batchDataUint8,e+4);return this.stringReader.readString(t)}attributeName(e){const t=ir(this.batchDataUint8,e+4);return this.stringReader.readString(t)}attributeValue(e){const t=ir(this.batchDataUint8,e+8);return this.stringReader.readString(t)}attributeEventHandlerId(e){return cr(this.batchDataUint8,e+12)}}class pr{constructor(e){this.batchDataUint8=e,this.stringTableStartIndex=ir(e,e.length-4)}readString(e){if(-1===e)return null;{const n=ir(this.batchDataUint8,this.stringTableStartIndex+4*e),r=function(e,t){let n=0,r=0;for(let o=0;o<4;o++){const s=e[t+o];if(n|=(127&s)<this.nextBatchId)return this.fatalError?(this.logger.log(ot.Debug,`Received a new batch ${e} but errored out on a previous batch ${this.nextBatchId-1}`),void await n.send("OnRenderCompleted",this.nextBatchId-1,this.fatalError.toString())):void this.logger.log(ot.Debug,`Waiting for batch ${this.nextBatchId}. Batch ${e} not processed.`);try{this.nextBatchId++,this.logger.log(ot.Debug,`Applying batch ${e}.`),function(e,t){const n=ge[e];if(!n)throw new Error(`There is no browser renderer with ID ${e}.`);const r=t.arrayRangeReader,o=t.updatedComponents(),s=r.values(o),i=r.count(o),a=t.referenceFrames(),c=r.values(a),l=t.diffReader;for(let e=0;e{e.onclick=function(e){location.reload(),e.preventDefault()}})),document.querySelectorAll("#blazor-error-ui .dismiss").forEach((e=>{e.onclick=function(e){const t=document.querySelector("#blazor-error-ui");t&&(t.style.display="none"),e.preventDefault()}})))}class Ir{constructor(t,n,r,o){this._firstUpdate=!0,this._renderingFailed=!1,this._disposed=!1,this._circuitId=void 0,this._applicationState=n,this._componentManager=t,this._options=r,this._logger=o,this._renderQueue=new mr(this._logger),this._dispatcher=e.attachDispatcher(this)}start(){if(this.isDisposedOrDisposing())throw new Error("Cannot start a disposed circuit.");return this._startPromise||(this._startPromise=this.startCore()),this._startPromise}updateRootComponents(e){var t,n;return this._firstUpdate?(this._firstUpdate=!1,null===(t=this._connection)||void 0===t?void 0:t.send("UpdateRootComponents",e,this._applicationState)):null===(n=this._connection)||void 0===n?void 0:n.send("UpdateRootComponents",e,"")}async startCore(){if(this._connection=await this.startConnection(),this._connection.state!==qt.Connected)return!1;const e=JSON.stringify(this._componentManager.initialComponents.map((e=>{return t=e,{...t,start:void 0,end:void 0};var t})));if(this._circuitId=await this._connection.invoke("StartCircuit",Ue.getBaseURI(),Ue.getLocationHref(),e,this._applicationState||""),!this._circuitId)return!1;for(const e of this._options.circuitHandlers)e.onCircuitOpened&&e.onCircuitOpened();return!0}async startConnection(){var e,t;const n=new tr;n.name="blazorpack";const r=(new yn).withUrl("_blazor").withHubProtocol(n);this._options.configureSignalR(r);const o=r.build();o.on("JS.AttachComponent",((e,t)=>function(e,t,n,r){let o=ge[e];o||(o=new de(e),ge[e]=o),o.attachRootComponentToLogicalElement(n,t,!1)}(wn.Server,this.resolveElement(t),e))),o.on("JS.BeginInvokeJS",this._dispatcher.beginInvokeJSFromDotNet.bind(this._dispatcher)),o.on("JS.EndInvokeDotNet",this._dispatcher.endInvokeDotNetFromJS.bind(this._dispatcher)),o.on("JS.ReceiveByteArray",this._dispatcher.receiveByteArray.bind(this._dispatcher)),o.on("JS.BeginTransmitStream",(e=>{const t=new ReadableStream({start:t=>{o.stream("SendDotNetStreamToJS",e).subscribe({next:e=>t.enqueue(e),complete:()=>t.close(),error:e=>t.error(e)})}});this._dispatcher.supplyDotNetStream(e,t)})),o.on("JS.RenderBatch",(async(e,t)=>{var n,r;this._logger.log(_t.Debug,`Received render batch with id ${e} and ${t.byteLength} bytes.`),await this._renderQueue.processBatch(e,t,this._connection),null===(r=(n=this._componentManager).onAfterRenderBatch)||void 0===r||r.call(n,wn.Server)})),o.on("JS.EndUpdateRootComponents",(e=>{var t,n;null===(n=(t=this._componentManager).onAfterUpdateRootComponents)||void 0===n||n.call(t,e)})),o.on("JS.EndLocationChanging",rt._internal.navigationManager.endLocationChanging),o.onclose((e=>{this._interopMethodsForReconnection=function(e){const t=S.get(e);if(!t)throw new Error(`Interop methods are not registered for renderer ${e}`);return S.delete(e),t}(wn.Server),this._disposed||this._renderingFailed||this._options.reconnectionHandler.onConnectionDown(this._options.reconnectionOptions,e)})),o.on("JS.Error",(e=>{this._renderingFailed=!0,this.unhandledError(e),Cr()}));try{await o.start()}catch(e){if(this.unhandledError(e),"FailedToNegotiateWithServerError"===e.errorType)throw e;Cr(),e.innerErrors&&(e.innerErrors.some((e=>"UnsupportedTransportError"===e.errorType&&e.transport===an.WebSockets))?this._logger.log(_t.Error,"Unable to connect, please ensure you are using an updated browser that supports WebSockets."):e.innerErrors.some((e=>"FailedToStartTransportError"===e.errorType&&e.transport===an.WebSockets))?this._logger.log(_t.Error,"Unable to connect, please ensure WebSockets are available. A VPN or proxy may be blocking the connection."):e.innerErrors.some((e=>"DisabledTransportError"===e.errorType&&e.transport===an.LongPolling))&&this._logger.log(_t.Error,"Unable to initiate a SignalR connection to the server. This might be because the server is not configured to support WebSockets. For additional details, visit https://aka.ms/blazor-server-websockets-error."))}return(null===(t=null===(e=o.connection)||void 0===e?void 0:e.features)||void 0===t?void 0:t.inherentKeepAlive)&&this._logger.log(_t.Warning,"Failed to connect via WebSockets, using the Long Polling fallback transport. This may be due to a VPN or proxy blocking the connection. To troubleshoot this, visit https://aka.ms/blazor-server-using-fallback-long-polling."),o}async disconnect(){var e;await(null===(e=this._connection)||void 0===e?void 0:e.stop())}async reconnect(){if(!this._circuitId)throw new Error("Circuit host not initialized.");return this._connection.state===qt.Connected||(this._connection=await this.startConnection(),this._interopMethodsForReconnection&&(I(wn.Server,this._interopMethodsForReconnection),this._interopMethodsForReconnection=void 0),!!await this._connection.invoke("ConnectCircuit",this._circuitId)&&(this._options.reconnectionHandler.onConnectionUp(),!0))}beginInvokeDotNetFromJS(e,t,n,r,o){this.throwIfDispatchingWhenDisposed(),this._connection.send("BeginInvokeDotNetFromJS",e?e.toString():null,t,n,r||0,o)}endInvokeJSFromDotNet(e,t,n){this.throwIfDispatchingWhenDisposed(),this._connection.send("EndInvokeJSFromDotNet",e,t,n)}sendByteArray(e,t){this.throwIfDispatchingWhenDisposed(),this._connection.send("ReceiveByteArray",e,t)}throwIfDispatchingWhenDisposed(){if(this._disposed)throw new Error("The circuit associated with this dispatcher is no longer available.")}sendLocationChanged(e,t,n){return this._connection.send("OnLocationChanged",e,t,n)}sendLocationChanging(e,t,n,r){return this._connection.send("OnLocationChanging",e,t,n,r)}sendJsDataStream(e,t,n){return function(e,t,n,r){setTimeout((async()=>{let o=5,s=(new Date).valueOf();try{const i=t instanceof Blob?t.size:t.byteLength;let a=0,c=0;for(;a1)await e.send("ReceiveJSDataChunk",n,c,h,null);else{if(!await e.invoke("ReceiveJSDataChunk",n,c,h,null))break;const t=(new Date).valueOf(),r=t-s;s=t,o=Math.max(1,Math.round(500/Math.max(1,r)))}a+=l,c++}}catch(t){await e.send("ReceiveJSDataChunk",n,-1,null,t.toString())}}),0)}(this._connection,e,t,n)}resolveElement(e){const t=function(e){const t=f.get(e);if(t)return f.delete(e),t}(e);if(t)return O(t,!0);const n=Number.parseInt(e);if(!Number.isNaN(n))return function(e){const{start:t,end:n}=e,r=t[$];if(r){if(r!==e)throw new Error("The start component comment was already associated with another component descriptor.");return t}const o=t.parentNode;if(!o)throw new Error(`Comment not connected to the DOM ${t.textContent}`);const s=O(o,!0),i=K(s);t[L]=s,t[$]=e;const a=O(t);if(n){const e=K(a),r=Array.prototype.indexOf.call(i,a)+1;let o=null;for(;o!==n;){const n=i.splice(r,1)[0];if(!n)throw new Error("Could not find the end component comment in the parent logical node list");n[L]=t,e.push(n),o=n}}return a}(this._componentManager.resolveRootComponent(n));throw new Error(`Invalid sequence number or identifier '${e}'.`)}getRootComponentManager(){return this._componentManager}unhandledError(e){this._logger.log(_t.Error,e),this.disconnect()}getDisconnectFormData(){const e=new FormData,t=this._circuitId;return e.append("circuitId",t),e}didRenderingFail(){return this._renderingFailed}isDisposedOrDisposing(){return void 0!==this._disposePromise}sendDisconnectBeacon(){if(this._disposed)return;const e=this.getDisconnectFormData();this._disposed=navigator.sendBeacon("_blazor/disconnect",e)}dispose(){return this._disposePromise||(this._disposePromise=this.disposeCore()),this._disposePromise}async disposeCore(){var e;if(!this._startPromise)return void(this._disposed=!0);await this._startPromise,this._disposed=!0,null===(e=this._connection)||void 0===e||e.stop();const t=this.getDisconnectFormData();fetch("_blazor/disconnect",{method:"POST",body:t});for(const e of this._options.circuitHandlers)e.onCircuitClosed&&e.onCircuitClosed()}}class kr{constructor(e,t,n,r){this.maxRetries=t,this.document=n,this.logger=r,this.modal=this.document.createElement("div"),this.modal.id=e,this.maxRetries=t,this.modal.style.cssText=["position: fixed","top: 0","right: 0","bottom: 0","left: 0","z-index: 1050","display: none","overflow: hidden","background-color: #fff","opacity: 0.8","text-align: center","font-weight: bold","transition: visibility 0s linear 500ms"].join(";"),this.message=this.document.createElement("h5"),this.message.style.cssText="margin-top: 20px",this.button=this.document.createElement("button"),this.button.style.cssText="margin:5px auto 5px",this.button.textContent="Retry";const o=this.document.createElement("a");o.addEventListener("click",(()=>location.reload())),o.textContent="reload",this.reloadParagraph=this.document.createElement("p"),this.reloadParagraph.textContent="Alternatively, ",this.reloadParagraph.appendChild(o),this.modal.appendChild(this.message),this.modal.appendChild(this.button),this.modal.appendChild(this.reloadParagraph),this.loader=this.getLoader(),this.message.after(this.loader),this.button.addEventListener("click",(async()=>{this.show();try{await rt.reconnect()||this.rejected()}catch(e){this.logger.log(ot.Error,e),this.failed()}}))}show(){this.document.contains(this.modal)||this.document.body.appendChild(this.modal),this.modal.style.display="block",this.loader.style.display="inline-block",this.button.style.display="none",this.reloadParagraph.style.display="none",this.message.textContent="Attempting to reconnect to the server...",this.modal.style.visibility="hidden",setTimeout((()=>{this.modal.style.visibility="visible"}),0)}update(e){this.message.textContent=`Attempting to reconnect to the server: ${e} of ${this.maxRetries}`}hide(){this.modal.style.display="none"}failed(){this.button.style.display="block",this.reloadParagraph.style.display="none",this.loader.style.display="none";const e=this.document.createTextNode("Reconnection failed. Try "),t=this.document.createElement("a");t.textContent="reloading",t.setAttribute("href",""),t.addEventListener("click",(()=>location.reload()));const n=this.document.createTextNode(" the page if you're unable to reconnect.");this.message.replaceChildren(e,t,n)}rejected(){this.button.style.display="none",this.reloadParagraph.style.display="none",this.loader.style.display="none";const e=this.document.createTextNode("Could not reconnect to the server. "),t=this.document.createElement("a");t.textContent="Reload",t.setAttribute("href",""),t.addEventListener("click",(()=>location.reload()));const n=this.document.createTextNode(" the page to restore functionality.");this.message.replaceChildren(e,t,n)}getLoader(){const e=this.document.createElement("div");return e.style.cssText=["border: 0.3em solid #f3f3f3","border-top: 0.3em solid #3498db","border-radius: 50%","width: 2em","height: 2em","display: inline-block"].join(";"),e.animate([{transform:"rotate(0deg)"},{transform:"rotate(360deg)"}],{duration:2e3,iterations:1/0}),e}}class Tr{constructor(e,t,n){this.dialog=e,this.maxRetries=t,this.document=n,this.document=n;const r=this.document.getElementById(Tr.MaxRetriesId);r&&(r.innerText=this.maxRetries.toString())}show(){this.removeClasses(),this.dialog.classList.add(Tr.ShowClassName)}update(e){const t=this.document.getElementById(Tr.CurrentAttemptId);t&&(t.innerText=e.toString())}hide(){this.removeClasses(),this.dialog.classList.add(Tr.HideClassName)}failed(){this.removeClasses(),this.dialog.classList.add(Tr.FailedClassName)}rejected(){this.removeClasses(),this.dialog.classList.add(Tr.RejectedClassName)}removeClasses(){this.dialog.classList.remove(Tr.ShowClassName,Tr.HideClassName,Tr.FailedClassName,Tr.RejectedClassName)}}Tr.ShowClassName="components-reconnect-show",Tr.HideClassName="components-reconnect-hide",Tr.FailedClassName="components-reconnect-failed",Tr.RejectedClassName="components-reconnect-rejected",Tr.MaxRetriesId="components-reconnect-max-retries",Tr.CurrentAttemptId="components-reconnect-current-attempt";class Dr{constructor(e,t,n){this._currentReconnectionProcess=null,this._logger=e,this._reconnectionDisplay=t,this._reconnectCallback=n||rt.reconnect}onConnectionDown(e,t){if(!this._reconnectionDisplay){const t=document.getElementById(e.dialogId);this._reconnectionDisplay=t?new Tr(t,e.maxRetries,document):new kr(e.dialogId,e.maxRetries,document,this._logger)}this._currentReconnectionProcess||(this._currentReconnectionProcess=new Rr(e,this._logger,this._reconnectCallback,this._reconnectionDisplay))}onConnectionUp(){this._currentReconnectionProcess&&(this._currentReconnectionProcess.dispose(),this._currentReconnectionProcess=null)}}class Rr{constructor(e,t,n,r){this.logger=t,this.reconnectCallback=n,this.isDisposed=!1,this.reconnectDisplay=r,this.reconnectDisplay.show(),this.attemptPeriodicReconnection(e)}dispose(){this.isDisposed=!0,this.reconnectDisplay.hide()}async attemptPeriodicReconnection(e){for(let t=0;tRr.MaximumFirstRetryInterval?Rr.MaximumFirstRetryInterval:e.retryIntervalMilliseconds;if(await this.delay(n),this.isDisposed)break;try{return await this.reconnectCallback()?void 0:void this.reconnectDisplay.rejected()}catch(e){this.logger.log(ot.Error,e)}}this.reconnectDisplay.failed()}delay(e){return new Promise((t=>setTimeout(t,e)))}}Rr.MaximumFirstRetryInterval=3e3;class xr{constructor(e=!0,t,n,r=0){this.singleRuntime=e,this.logger=t,this.webRendererId=r,this.afterStartedCallbacks=[],n&&this.afterStartedCallbacks.push(...n)}async importInitializersAsync(e,t){await Promise.all(e.map((e=>async function(e,n){const r=function(e){const t=document.baseURI;return t.endsWith("/")?`${t}${e}`:`${t}/${e}`}(n),o=await import(r);if(void 0!==o){if(e.singleRuntime){const{beforeStart:n,afterStarted:r,beforeWebAssemblyStart:i,afterWebAssemblyStarted:a,beforeServerStart:c,afterServerStarted:l}=o;let h=n;e.webRendererId===wn.Server&&c&&(h=c),e.webRendererId===wn.WebAssembly&&i&&(h=i);let d=r;return e.webRendererId===wn.Server&&l&&(d=l),e.webRendererId===wn.WebAssembly&&a&&(d=a),s(e,h,d,t)}return function(e,t,n){var o;const i=n[0],{beforeStart:a,afterStarted:c,beforeWebStart:l,afterWebStarted:h,beforeWebAssemblyStart:d,afterWebAssemblyStarted:u,beforeServerStart:p,afterServerStarted:f}=t,g=!(l||h||d||u||p||f||!a&&!c),m=g&&i.enableClassicInitializers;if(g&&!i.enableClassicInitializers)null===(o=e.logger)||void 0===o||o.log(ot.Warning,`Initializer '${r}' will be ignored because multiple runtimes are available. use 'before(web|webAssembly|server)Start' and 'after(web|webAssembly|server)Started?' instead.)`);else if(m)return s(e,a,c,n);if(function(e){e.webAssembly?e.webAssembly.initializers||(e.webAssembly.initializers={beforeStart:[],afterStarted:[]}):e.webAssembly={initializers:{beforeStart:[],afterStarted:[]}},e.circuit?e.circuit.initializers||(e.circuit.initializers={beforeStart:[],afterStarted:[]}):e.circuit={initializers:{beforeStart:[],afterStarted:[]}}}(i),d&&i.webAssembly.initializers.beforeStart.push(d),u&&i.webAssembly.initializers.afterStarted.push(u),p&&i.circuit.initializers.beforeStart.push(p),f&&i.circuit.initializers.afterStarted.push(f),h&&e.afterStartedCallbacks.push(h),l)return l(i)}(e,o,t)}function s(e,t,n,r){if(n&&e.afterStartedCallbacks.push(n),t)return t(...r)}}(this,e))))}async invokeAfterStartedCallbacks(e){const t=function(e){var t;return null===(t=C.get(e))||void 0===t?void 0:t[1]}(this.webRendererId);t&&await t,await Promise.all(this.afterStartedCallbacks.map((t=>t(e))))}}function Ar(e){if(void 0!==Sr)throw new Error("Blazor Server has already started.");return Sr=new Promise(Pr.bind(null,e)),Sr}async function Pr(e,t,n){await vr;const r=await async function(e){if(e.initializers)return await Promise.all(e.initializers.beforeStart.map((t=>t(e)))),new xr(!1,void 0,e.initializers.afterStarted,wn.Server);const t=await fetch("_blazor/initializers",{method:"GET",credentials:"include",cache:"no-cache"}),n=await t.json(),r=new xr(!0,void 0,void 0,wn.Server);return await r.importInitializersAsync(n,[e]),r}(_r);var o;if(o=document,yr=ht(o,lt)||"",br=new ct(_r.logLevel),wr=new Ir(e,yr,_r,br),br.log(ot.Information,"Starting up Blazor server-side application."),rt.reconnect=async()=>!(wr.didRenderingFail()||!await wr.reconnect()&&(br.log(ot.Information,"Reconnection attempt to the circuit was rejected by the server. This may indicate that the associated state is no longer available on the server."),1)),rt.defaultReconnectionHandler=new Dr(br),_r.reconnectionHandler=_r.reconnectionHandler||rt.defaultReconnectionHandler,rt._internal.navigationManager.listenForNavigationEvents(wn.Server,((e,t,n)=>wr.sendLocationChanged(e,t,n)),((e,t,n,r)=>wr.sendLocationChanging(e,t,n,r))),rt._internal.forceCloseConnection=()=>wr.disconnect(),rt._internal.sendJSDataStream=(e,t,n)=>wr.sendJsDataStream(e,t,n),!await wr.start())return br.log(ot.Error,"Failed to start the circuit."),void t();const s=()=>{wr.sendDisconnectBeacon()};rt.disconnect=s,window.addEventListener("unload",s,{capture:!1,once:!0}),br.log(ot.Information,"Blazor server-side application started."),r.invokeAfterStartedCallbacks(rt),t()}class Ur{constructor(e){this.initialComponents=e}resolveRootComponent(e){return this.initialComponents[e]}}class Nr{constructor(){this._eventListeners=new Map}static create(e){const t=new Nr;return e.addEventListener=t.addEventListener.bind(t),e.removeEventListener=t.removeEventListener.bind(t),t}addEventListener(e,t){let n=this._eventListeners.get(e);n||(n=new Set,this._eventListeners.set(e,n)),n.add(t)}removeEventListener(e,t){var n;null===(n=this._eventListeners.get(e))||void 0===n||n.delete(t)}dispatchEvent(e,t){const n=this._eventListeners.get(e);if(!n)return;const r={...t,type:e};for(const e of n)e(r)}}let Mr=!1;function Br(e){if(Mr)throw new Error("Blazor has already started.");Mr=!0;const t=st(e);!function(e){if(_r)throw new Error("Circuit options have already been configured.");if(_r)throw new Error("WebAssembly options have already been configured.");vr=async function(e){const t=await e;_r=st(t)}(e)}(Promise.resolve(t||{})),Nr.create(rt);const n=function(e){return dt(e,"server").sort(((e,t)=>e.sequence-t.sequence))}(document);return Ar(new Ur(n))}rt.start=Br,window.DotNet=e,document&&document.currentScript&&"false"!==document.currentScript.getAttribute("autostart")&&Br()})()})();
\ No newline at end of file
+(()=>{var e={778:()=>{},77:()=>{},203:()=>{},200:()=>{},628:()=>{},321:()=>{}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),(()=>{"use strict";var e,t,r;!function(e){const t=[],n="__jsObjectId",r="__dotNetObject",o="__byte[]",s="__dotNetStream",i="__jsStreamReferenceLength";let a,c;class l{constructor(e){this._jsObject=e,this._cachedFunctions=new Map}findFunction(e){const t=this._cachedFunctions.get(e);if(t)return t;let n,r=this._jsObject;if(e.split(".").forEach((t=>{if(!(t in r))throw new Error(`Could not find '${e}' ('${t}' was undefined).`);n=r,r=r[t]})),r instanceof Function)return r=r.bind(n),this._cachedFunctions.set(e,r),r;throw new Error(`The value '${e}' is not a function.`)}getWrappedObject(){return this._jsObject}}const h={0:new l(window)};h[0]._cachedFunctions.set("import",(e=>("string"==typeof e&&e.startsWith("./")&&(e=new URL(e.substr(2),document.baseURI).toString()),import(e))));let d,u=1;function p(e){t.push(e)}function f(e){if(e&&"object"==typeof e){h[u]=new l(e);const t={[n]:u};return u++,t}throw new Error(`Cannot create a JSObjectReference from the value '${e}'.`)}function g(e){let t=-1;if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Blob)t=e.size;else{if(!(e.buffer instanceof ArrayBuffer))throw new Error("Supplied value is not a typed array or blob.");if(void 0===e.byteLength)throw new Error(`Cannot create a JSStreamReference from the value '${e}' as it doesn't have a byteLength.`);t=e.byteLength}const r={[i]:t};try{const t=f(e);r[n]=t[n]}catch(t){throw new Error(`Cannot create a JSStreamReference from the value '${e}'.`)}return r}function m(e,n){c=e;const r=n?JSON.parse(n,((e,n)=>t.reduce(((t,n)=>n(e,t)),n))):null;return c=void 0,r}function v(){if(void 0===a)throw new Error("No call dispatcher has been set.");if(null===a)throw new Error("There are multiple .NET runtimes present, so a default dispatcher could not be resolved. Use DotNetObject to invoke .NET instance methods.");return a}e.attachDispatcher=function(e){const t=new y(e);return void 0===a?a=t:a&&(a=null),t},e.attachReviver=p,e.invokeMethod=function(e,t,...n){return v().invokeDotNetStaticMethod(e,t,...n)},e.invokeMethodAsync=function(e,t,...n){return v().invokeDotNetStaticMethodAsync(e,t,...n)},e.createJSObjectReference=f,e.createJSStreamReference=g,e.disposeJSObjectReference=function(e){const t=e&&e[n];"number"==typeof t&&b(t)},function(e){e[e.Default=0]="Default",e[e.JSObjectReference=1]="JSObjectReference",e[e.JSStreamReference=2]="JSStreamReference",e[e.JSVoidResult=3]="JSVoidResult"}(d=e.JSCallResultType||(e.JSCallResultType={}));class y{constructor(e){this._dotNetCallDispatcher=e,this._byteArraysToBeRevived=new Map,this._pendingDotNetToJSStreams=new Map,this._pendingAsyncCalls={},this._nextAsyncCallId=1}getDotNetCallDispatcher(){return this._dotNetCallDispatcher}invokeJSFromDotNet(e,t,n,r){const o=m(this,t),s=I(_(e,r)(...o||[]),n);return null==s?null:T(this,s)}beginInvokeJSFromDotNet(e,t,n,r,o){const s=new Promise((e=>{const r=m(this,n);e(_(t,o)(...r||[]))}));e&&s.then((t=>T(this,[e,!0,I(t,r)]))).then((t=>this._dotNetCallDispatcher.endInvokeJSFromDotNet(e,!0,t)),(t=>this._dotNetCallDispatcher.endInvokeJSFromDotNet(e,!1,JSON.stringify([e,!1,w(t)]))))}endInvokeDotNetFromJS(e,t,n){const r=t?m(this,n):new Error(n);this.completePendingCall(parseInt(e,10),t,r)}invokeDotNetStaticMethod(e,t,...n){return this.invokeDotNetMethod(e,t,null,n)}invokeDotNetStaticMethodAsync(e,t,...n){return this.invokeDotNetMethodAsync(e,t,null,n)}invokeDotNetMethod(e,t,n,r){if(this._dotNetCallDispatcher.invokeDotNetFromJS){const o=T(this,r),s=this._dotNetCallDispatcher.invokeDotNetFromJS(e,t,n,o);return s?m(this,s):null}throw new Error("The current dispatcher does not support synchronous calls from JS to .NET. Use invokeDotNetMethodAsync instead.")}invokeDotNetMethodAsync(e,t,n,r){if(e&&n)throw new Error(`For instance method calls, assemblyName should be null. Received '${e}'.`);const o=this._nextAsyncCallId++,s=new Promise(((e,t)=>{this._pendingAsyncCalls[o]={resolve:e,reject:t}}));try{const s=T(this,r);this._dotNetCallDispatcher.beginInvokeDotNetFromJS(o,e,t,n,s)}catch(e){this.completePendingCall(o,!1,e)}return s}receiveByteArray(e,t){this._byteArraysToBeRevived.set(e,t)}processByteArray(e){const t=this._byteArraysToBeRevived.get(e);return t?(this._byteArraysToBeRevived.delete(e),t):null}supplyDotNetStream(e,t){if(this._pendingDotNetToJSStreams.has(e)){const n=this._pendingDotNetToJSStreams.get(e);this._pendingDotNetToJSStreams.delete(e),n.resolve(t)}else{const n=new C;n.resolve(t),this._pendingDotNetToJSStreams.set(e,n)}}getDotNetStreamPromise(e){let t;if(this._pendingDotNetToJSStreams.has(e))t=this._pendingDotNetToJSStreams.get(e).streamPromise,this._pendingDotNetToJSStreams.delete(e);else{const n=new C;this._pendingDotNetToJSStreams.set(e,n),t=n.streamPromise}return t}completePendingCall(e,t,n){if(!this._pendingAsyncCalls.hasOwnProperty(e))throw new Error(`There is no pending async call with ID ${e}.`);const r=this._pendingAsyncCalls[e];delete this._pendingAsyncCalls[e],t?r.resolve(n):r.reject(n)}}function w(e){return e instanceof Error?`${e.message}\n${e.stack}`:e?e.toString():"null"}function _(e,t){const n=h[t];if(n)return n.findFunction(e);throw new Error(`JS object instance with ID ${t} does not exist (has it been disposed?).`)}function b(e){delete h[e]}e.findJSFunction=_,e.disposeJSObjectReferenceById=b;class S{constructor(e,t){this._id=e,this._callDispatcher=t}invokeMethod(e,...t){return this._callDispatcher.invokeDotNetMethod(null,e,this._id,t)}invokeMethodAsync(e,...t){return this._callDispatcher.invokeDotNetMethodAsync(null,e,this._id,t)}dispose(){this._callDispatcher.invokeDotNetMethodAsync(null,"__Dispose",this._id,null).catch((e=>console.error(e)))}serializeAsArg(){return{[r]:this._id}}}e.DotNetObject=S,p((function(e,t){if(t&&"object"==typeof t){if(t.hasOwnProperty(r))return new S(t[r],c);if(t.hasOwnProperty(n)){const e=t[n],r=h[e];if(r)return r.getWrappedObject();throw new Error(`JS object instance with Id '${e}' does not exist. It may have been disposed.`)}if(t.hasOwnProperty(o)){const e=t[o],n=c.processByteArray(e);if(void 0===n)throw new Error(`Byte array index '${e}' does not exist.`);return n}if(t.hasOwnProperty(s)){const e=t[s],n=c.getDotNetStreamPromise(e);return new E(n)}}return t}));class E{constructor(e){this._streamPromise=e}stream(){return this._streamPromise}async arrayBuffer(){return new Response(await this.stream()).arrayBuffer()}}class C{constructor(){this.streamPromise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}function I(e,t){switch(t){case d.Default:return e;case d.JSObjectReference:return f(e);case d.JSStreamReference:return g(e);case d.JSVoidResult:return null;default:throw new Error(`Invalid JS call result type '${t}'.`)}}let k=0;function T(e,t){k=0,c=e;const n=JSON.stringify(t,D);return c=void 0,n}function D(e,t){if(t instanceof S)return t.serializeAsArg();if(t instanceof Uint8Array){c.getDotNetCallDispatcher().sendByteArray(k,t);const e={[o]:k};return k++,e}return t}}(e||(e={})),function(e){e[e.prependFrame=1]="prependFrame",e[e.removeFrame=2]="removeFrame",e[e.setAttribute=3]="setAttribute",e[e.removeAttribute=4]="removeAttribute",e[e.updateText=5]="updateText",e[e.stepIn=6]="stepIn",e[e.stepOut=7]="stepOut",e[e.updateMarkup=8]="updateMarkup",e[e.permutationListEntry=9]="permutationListEntry",e[e.permutationListEnd=10]="permutationListEnd"}(t||(t={})),function(e){e[e.element=1]="element",e[e.text=2]="text",e[e.attribute=3]="attribute",e[e.component=4]="component",e[e.region=5]="region",e[e.elementReferenceCapture=6]="elementReferenceCapture",e[e.markup=8]="markup",e[e.namedEvent=10]="namedEvent"}(r||(r={}));class o{constructor(e,t){this.componentId=e,this.fieldValue=t}static fromEvent(e,t){const n=t.target;if(n instanceof Element){const t=function(e){return e instanceof HTMLInputElement?e.type&&"checkbox"===e.type.toLowerCase()?{value:e.checked}:{value:e.value}:e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement?{value:e.value}:null}(n);if(t)return new o(e,t.value)}return null}}const s=new Map,i=new Map,a=[];function c(e){return s.get(e)}function l(e){const t=s.get(e);return(null==t?void 0:t.browserEventName)||e}function h(e,t){e.forEach((e=>s.set(e,t)))}function d(e){const t=[];for(let n=0;ne.selected)).map((e=>e.value))}}{const e=function(e){return!!e&&"INPUT"===e.tagName&&"checkbox"===e.getAttribute("type")}(t);return{value:e?!!t.checked:t.value}}}}),h(["copy","cut","paste"],{createEventArgs:e=>({type:e.type})}),h(["drag","dragend","dragenter","dragleave","dragover","dragstart","drop"],{createEventArgs:e=>{return{...u(t=e),dataTransfer:t.dataTransfer?{dropEffect:t.dataTransfer.dropEffect,effectAllowed:t.dataTransfer.effectAllowed,files:Array.from(t.dataTransfer.files).map((e=>e.name)),items:Array.from(t.dataTransfer.items).map((e=>({kind:e.kind,type:e.type}))),types:t.dataTransfer.types}:null};var t}}),h(["focus","blur","focusin","focusout"],{createEventArgs:e=>({type:e.type})}),h(["keydown","keyup","keypress"],{createEventArgs:e=>{return{key:(t=e).key,code:t.code,location:t.location,repeat:t.repeat,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,type:t.type};var t}}),h(["contextmenu","click","mouseover","mouseout","mousemove","mousedown","mouseup","mouseleave","mouseenter","dblclick"],{createEventArgs:e=>u(e)}),h(["error"],{createEventArgs:e=>{return{message:(t=e).message,filename:t.filename,lineno:t.lineno,colno:t.colno,type:t.type};var t}}),h(["loadstart","timeout","abort","load","loadend","progress"],{createEventArgs:e=>{return{lengthComputable:(t=e).lengthComputable,loaded:t.loaded,total:t.total,type:t.type};var t}}),h(["touchcancel","touchend","touchmove","touchenter","touchleave","touchstart"],{createEventArgs:e=>{return{detail:(t=e).detail,touches:d(t.touches),targetTouches:d(t.targetTouches),changedTouches:d(t.changedTouches),ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,type:t.type};var t}}),h(["gotpointercapture","lostpointercapture","pointercancel","pointerdown","pointerenter","pointerleave","pointermove","pointerout","pointerover","pointerup"],{createEventArgs:e=>{return{...u(t=e),pointerId:t.pointerId,width:t.width,height:t.height,pressure:t.pressure,tiltX:t.tiltX,tiltY:t.tiltY,pointerType:t.pointerType,isPrimary:t.isPrimary};var t}}),h(["wheel","mousewheel"],{createEventArgs:e=>{return{...u(t=e),deltaX:t.deltaX,deltaY:t.deltaY,deltaZ:t.deltaZ,deltaMode:t.deltaMode};var t}}),h(["cancel","close","toggle"],{createEventArgs:()=>({})});const p=["date","datetime-local","month","time","week"],f=new Map;let g,m,v=0;const y={async add(e,t,n){if(!n)throw new Error("initialParameters must be an object, even if empty.");const r="__bl-dynamic-root:"+(++v).toString();f.set(r,e);const o=await b().invokeMethodAsync("AddRootComponent",t,r),s=new _(o,m[t]);return await s.setParameters(n),s}};class w{invoke(e){return this._callback(e)}setCallback(t){this._selfJSObjectReference||(this._selfJSObjectReference=e.createJSObjectReference(this)),this._callback=t}getJSObjectReference(){return this._selfJSObjectReference}dispose(){this._selfJSObjectReference&&e.disposeJSObjectReference(this._selfJSObjectReference)}}class _{constructor(e,t){this._jsEventCallbackWrappers=new Map,this._componentId=e;for(const e of t)"eventcallback"===e.type&&this._jsEventCallbackWrappers.set(e.name.toLowerCase(),new w)}setParameters(e){const t={},n=Object.entries(e||{}),r=n.length;for(const[e,r]of n){const n=this._jsEventCallbackWrappers.get(e.toLowerCase());n&&r?(n.setCallback(r),t[e]=n.getJSObjectReference()):t[e]=r}return b().invokeMethodAsync("SetRootComponentParameters",this._componentId,r,t)}async dispose(){if(null!==this._componentId){await b().invokeMethodAsync("RemoveRootComponent",this._componentId),this._componentId=null;for(const e of this._jsEventCallbackWrappers.values())e.dispose()}}}function b(){if(!g)throw new Error("Dynamic root components have not been enabled in this application.");return g}const S=new Map,E=[],C=new Map;function I(t,n,r,o){var s,i;if(S.has(t))throw new Error(`Interop methods are already registered for renderer ${t}`);S.set(t,n),r&&o&&Object.keys(r).length>0&&function(t,n,r){if(g)throw new Error("Dynamic root components have already been enabled.");g=t,m=n;for(const[t,o]of Object.entries(r)){const r=e.findJSFunction(t,0);for(const e of o)r(e,n[e])}}(T(t),r,o),null===(i=null===(s=C.get(t))||void 0===s?void 0:s[0])||void 0===i||i.call(s),function(e){for(const t of E)t(e)}(t)}function k(e,t,n){return D(e,t.eventHandlerId,(()=>T(e).invokeMethodAsync("DispatchEventAsync",t,n)))}function T(e){const t=S.get(e);if(!t)throw new Error(`No interop methods are registered for renderer ${e}`);return t}let D=(e,t,n)=>n();const R=M(["abort","blur","cancel","canplay","canplaythrough","change","close","cuechange","durationchange","emptied","ended","error","focus","load","loadeddata","loadedmetadata","loadend","loadstart","mouseenter","mouseleave","pointerenter","pointerleave","pause","play","playing","progress","ratechange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeupdate","toggle","unload","volumechange","waiting","DOMNodeInsertedIntoDocument","DOMNodeRemovedFromDocument"]),x={submit:!0},A=M(["click","dblclick","mousedown","mousemove","mouseup"]);class P{constructor(e){this.browserRendererId=e,this.afterClickCallbacks=[];const t=++P.nextEventDelegatorId;this.eventsCollectionKey=`_blazorEvents_${t}`,this.eventInfoStore=new U(this.onGlobalEvent.bind(this))}setListener(e,t,n,r){const o=this.getEventHandlerInfosForElement(e,!0),s=o.getHandler(t);if(s)this.eventInfoStore.update(s.eventHandlerId,n);else{const s={element:e,eventName:t,eventHandlerId:n,renderingComponentId:r};this.eventInfoStore.add(s),o.setHandler(t,s)}}getHandler(e){return this.eventInfoStore.get(e)}removeListener(e){const t=this.eventInfoStore.remove(e);if(t){const e=t.element,n=this.getEventHandlerInfosForElement(e,!1);n&&n.removeHandler(t.eventName)}}notifyAfterClick(e){this.afterClickCallbacks.push(e),this.eventInfoStore.addGlobalListener("click")}setStopPropagation(e,t,n){this.getEventHandlerInfosForElement(e,!0).stopPropagation(t,n)}setPreventDefault(e,t,n){this.getEventHandlerInfosForElement(e,!0).preventDefault(t,n)}onGlobalEvent(e){if(!(e.target instanceof Element))return;this.dispatchGlobalEventToAllElements(e.type,e);const t=(n=e.type,i.get(n));var n;t&&t.forEach((t=>this.dispatchGlobalEventToAllElements(t,e))),"click"===e.type&&this.afterClickCallbacks.forEach((t=>t(e)))}dispatchGlobalEventToAllElements(e,t){const n=t.composedPath();let r=n.shift(),s=null,i=!1;const a=Object.prototype.hasOwnProperty.call(R,e);let l=!1;for(;r;){const u=r,p=this.getEventHandlerInfosForElement(u,!1);if(p){const n=p.getHandler(e);if(n&&(h=u,d=t.type,!((h instanceof HTMLButtonElement||h instanceof HTMLInputElement||h instanceof HTMLTextAreaElement||h instanceof HTMLSelectElement)&&Object.prototype.hasOwnProperty.call(A,d)&&h.disabled))){if(!i){const n=c(e);s=(null==n?void 0:n.createEventArgs)?n.createEventArgs(t):{},i=!0}Object.prototype.hasOwnProperty.call(x,t.type)&&t.preventDefault(),k(this.browserRendererId,{eventHandlerId:n.eventHandlerId,eventName:e,eventFieldInfo:o.fromEvent(n.renderingComponentId,t)},s)}p.stopPropagation(e)&&(l=!0),p.preventDefault(e)&&t.preventDefault()}r=a||l?void 0:n.shift()}var h,d}getEventHandlerInfosForElement(e,t){return Object.prototype.hasOwnProperty.call(e,this.eventsCollectionKey)?e[this.eventsCollectionKey]:t?e[this.eventsCollectionKey]=new N:null}}P.nextEventDelegatorId=0;class U{constructor(e){this.globalListener=e,this.infosByEventHandlerId={},this.countByEventName={},a.push(this.handleEventNameAliasAdded.bind(this))}add(e){if(this.infosByEventHandlerId[e.eventHandlerId])throw new Error(`Event ${e.eventHandlerId} is already tracked`);this.infosByEventHandlerId[e.eventHandlerId]=e,this.addGlobalListener(e.eventName)}get(e){return this.infosByEventHandlerId[e]}addGlobalListener(e){if(e=l(e),Object.prototype.hasOwnProperty.call(this.countByEventName,e))this.countByEventName[e]++;else{this.countByEventName[e]=1;const t=Object.prototype.hasOwnProperty.call(R,e);document.addEventListener(e,this.globalListener,t)}}update(e,t){if(Object.prototype.hasOwnProperty.call(this.infosByEventHandlerId,t))throw new Error(`Event ${t} is already tracked`);const n=this.infosByEventHandlerId[e];delete this.infosByEventHandlerId[e],n.eventHandlerId=t,this.infosByEventHandlerId[t]=n}remove(e){const t=this.infosByEventHandlerId[e];if(t){delete this.infosByEventHandlerId[e];const n=l(t.eventName);0==--this.countByEventName[n]&&(delete this.countByEventName[n],document.removeEventListener(n,this.globalListener))}return t}handleEventNameAliasAdded(e,t){if(Object.prototype.hasOwnProperty.call(this.countByEventName,e)){const n=this.countByEventName[e];delete this.countByEventName[e],document.removeEventListener(e,this.globalListener),this.addGlobalListener(t),this.countByEventName[t]+=n-1}}}class N{constructor(){this.handlers={},this.preventDefaultFlags=null,this.stopPropagationFlags=null}getHandler(e){return Object.prototype.hasOwnProperty.call(this.handlers,e)?this.handlers[e]:null}setHandler(e,t){this.handlers[e]=t}removeHandler(e){delete this.handlers[e]}preventDefault(e,t){return void 0!==t&&(this.preventDefaultFlags=this.preventDefaultFlags||{},this.preventDefaultFlags[e]=t),!!this.preventDefaultFlags&&this.preventDefaultFlags[e]}stopPropagation(e,t){return void 0!==t&&(this.stopPropagationFlags=this.stopPropagationFlags||{},this.stopPropagationFlags[e]=t),!!this.stopPropagationFlags&&this.stopPropagationFlags[e]}}function M(e){const t={};return e.forEach((e=>{t[e]=!0})),t}const B=Symbol(),L=Symbol(),$=Symbol();function O(e,t){if(B in e)return e;const n=[];if(e.childNodes.length>0){if(!t)throw new Error("New logical elements must start empty, or allowExistingContents must be true");e.childNodes.forEach((t=>{const r=O(t,!0);r[L]=e,n.push(r)}))}return e[B]=n,e}function F(e){const t=K(e);for(;t.length;)W(e,0)}function H(e,t){const n=document.createComment("!");return j(n,e,t),n}function j(e,t,n){const r=e;let o=e;if(e instanceof Comment){const t=K(r);if((null==t?void 0:t.length)>0){const t=Q(r),n=new Range;n.setStartBefore(e),n.setEndAfter(t),o=n.extractContents()}}const s=z(r);if(s){const e=K(s),t=Array.prototype.indexOf.call(e,r);e.splice(t,1),delete r[L]}const i=K(t);if(n0;)W(n,0)}const r=n;r.parentNode.removeChild(r)}function z(e){return e[L]||null}function q(e,t){return K(e)[t]}function J(e){const t=Y(e);return"http://www.w3.org/2000/svg"===t.namespaceURI&&"foreignObject"!==t.tagName}function K(e){return e[B]}function V(e){const t=K(z(e));return t[Array.prototype.indexOf.call(t,e)+1]||null}function X(e,t){const n=K(e);t.forEach((e=>{e.moveRangeStart=n[e.fromSiblingIndex],e.moveRangeEnd=Q(e.moveRangeStart)})),t.forEach((t=>{const r=document.createComment("marker");t.moveToBeforeMarker=r;const o=n[t.toSiblingIndex+1];o?o.parentNode.insertBefore(r,o):G(r,e)})),t.forEach((e=>{const t=e.moveToBeforeMarker,n=t.parentNode,r=e.moveRangeStart,o=e.moveRangeEnd;let s=r;for(;s;){const e=s.nextSibling;if(n.insertBefore(s,t),s===o)break;s=e}n.removeChild(t)})),t.forEach((e=>{n[e.toSiblingIndex]=e.moveRangeStart}))}function Y(e){if(e instanceof Element||e instanceof DocumentFragment)return e;if(e instanceof Comment)return e.parentNode;throw new Error("Not a valid logical element")}function G(e,t){if(t instanceof Element||t instanceof DocumentFragment)t.appendChild(e);else{if(!(t instanceof Comment))throw new Error(`Cannot append node because the parent is not a valid logical element. Parent: ${t}`);{const n=V(t);n?n.parentNode.insertBefore(e,n):G(e,z(t))}}}function Q(e){if(e instanceof Element||e instanceof DocumentFragment)return e;const t=V(e);if(t)return t.previousSibling;{const t=z(e);return t instanceof Element||t instanceof DocumentFragment?t.lastChild:Q(t)}}function Z(e){return`_bl_${e}`}const ee="__internalId";e.attachReviver(((e,t)=>t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,ee)&&"string"==typeof t[ee]?function(e){const t=`[${Z(e)}]`;return document.querySelector(t)}(t[ee]):t));const te="_blazorDeferredValue";function ne(e){return"select-multiple"===e.type}function re(e,t){e.value=t||""}function oe(e,t){e instanceof HTMLSelectElement?ne(e)?function(e,t){t||(t=[]);for(let n=0;n{ke()&&function(e,t){if(0!==e.button||function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e))return;if(e.defaultPrevented)return;const n=function(e){const t=e.composedPath&&e.composedPath();if(t)for(let e=0;e{const t=document.createElement("script");t.textContent=e.textContent,e.getAttributeNames().forEach((n=>{t.setAttribute(n,e.getAttribute(n))})),e.parentNode.replaceChild(t,e)})),ie.content));var i;let a=0;for(;s.firstChild;)j(s.firstChild,o,a++)}applyAttribute(e,t,n,r){const o=e.frameReader,s=o.attributeName(r),i=o.attributeEventHandlerId(r);if(i){const e=fe(s);return void this.eventDelegator.setListener(n,e,i,t)}const a=o.attributeValue(r);this.setOrRemoveAttributeOrProperty(n,s,a)}insertFrameRange(e,t,n,r,o,s,i){const a=r;for(let a=s;a{He(t,e)})},enableNavigationInterception:function(e){if(void 0!==me&&me!==e)throw new Error("Only one interactive runtime may enable navigation interception at a time.");me=e},setHasLocationChangingListeners:function(e,t){const n=Ae.get(e);if(!n)throw new Error(`Renderer with ID '${e}' is not listening for navigation events`);n.hasLocationChangingEventListeners=t},endLocationChanging:function(e,t){Ue&&e===xe&&(Ue(t),Ue=null)},navigateTo:function(e,t){Me(e,t,!0)},refresh:function(e){!e&&Ee()?Ce(location.href,!0):location.reload()},getBaseURI:()=>document.baseURI,getLocationHref:()=>location.href,scrollToElement:Se};function Me(e,t,n=!1){const r=Ie(e),o=ze();if(t.forceLoad||!be(r)||"serverside-fullpageload"===o)!function(e,t){if(location.href===e){const t=e+"?";history.replaceState(null,"",t),location.replace(e)}else t?location.replace(e):location.href=e}(e,t.replaceHistoryEntry);else if("clientside-router"===o)Be(r,!1,t.replaceHistoryEntry,t.historyEntryState,n);else{if("serverside-enhanced"!==o)throw new Error(`Unsupported page load mechanism: ${o}`);Ce(r,t.replaceHistoryEntry)}}async function Be(e,t,n,r=void 0,o=!1){if(Oe(),function(e){const t=new URL(e);return""!==t.hash&&location.origin===t.origin&&location.pathname===t.pathname&&location.search===t.search}(e))return Le(e,n,r),void function(e){const t=e.indexOf("#");t!==e.length-1&&Se(e.substring(t+1))}(e);const s=We();(o||!(null==s?void 0:s.hasLocationChangingEventListeners)||await Fe(e,r,t,s))&&(_e=!0,Le(e,n,r),await He(t))}function Le(e,t,n=void 0){t?history.replaceState({userState:n,_index:Re},"",e):(Re++,history.pushState({userState:n,_index:Re},"",e))}function $e(e){return new Promise((t=>{const n=Pe;Pe=()=>{Pe=n,t()},history.go(e)}))}function Oe(){Ue&&(Ue(!1),Ue=null)}function Fe(e,t,n,r){return new Promise((o=>{Oe(),xe++,Ue=o,r.locationChanging(xe,e,t,n)}))}async function He(e,t){const n=null!=t?t:location.href;await Promise.all(Array.from(Ae,(async([t,r])=>{var o,s;s=t,S.has(s)&&await r.locationChanged(n,null===(o=history.state)||void 0===o?void 0:o.userState,e)})))}async function je(e){var t,n;Pe&&"serverside-enhanced"!==ze()&&await Pe(e),Re=null!==(n=null===(t=history.state)||void 0===t?void 0:t._index)&&void 0!==n?n:0}function We(){const e=Te();if(void 0!==e)return Ae.get(e)}function ze(){return ke()?"clientside-router":Ee()?"serverside-enhanced":window.Blazor._internal.isBlazorWeb?"serverside-fullpageload":"clientside-router"}const qe={focus:function(e,t){if(e instanceof HTMLElement)e.focus({preventScroll:t});else{if(!(e instanceof SVGElement))throw new Error("Unable to focus an invalid element.");if(!e.hasAttribute("tabindex"))throw new Error("Unable to focus an SVG element that does not have a tabindex.");e.focus({preventScroll:t})}},focusBySelector:function(e,t){const n=document.querySelector(e);n&&(n.hasAttribute("tabindex")||(n.tabIndex=-1),n.focus({preventScroll:!0}))}},Je={init:function(e,t,n,r=50){const o=Ve(t);(o||document.documentElement).style.overflowAnchor="none";const s=document.createRange();u(n.parentElement)&&(t.style.display="table-row",n.style.display="table-row");const i=new IntersectionObserver((function(r){r.forEach((r=>{var o;if(!r.isIntersecting)return;s.setStartAfter(t),s.setEndBefore(n);const i=s.getBoundingClientRect().height,a=null===(o=r.rootBounds)||void 0===o?void 0:o.height;r.target===t?e.invokeMethodAsync("OnSpacerBeforeVisible",r.intersectionRect.top-r.boundingClientRect.top,i,a):r.target===n&&n.offsetHeight>0&&e.invokeMethodAsync("OnSpacerAfterVisible",r.boundingClientRect.bottom-r.intersectionRect.bottom,i,a)}))}),{root:o,rootMargin:`${r}px`});i.observe(t),i.observe(n);const a=d(t),c=d(n),{observersByDotNetObjectId:l,id:h}=Xe(e);function d(e){const t={attributes:!0},n=new MutationObserver(((n,r)=>{u(e.parentElement)&&(r.disconnect(),e.style.display="table-row",r.observe(e,t)),i.unobserve(e),i.observe(e)}));return n.observe(e,t),n}function u(e){return null!==e&&(e instanceof HTMLTableElement&&""===e.style.display||"table"===e.style.display||e instanceof HTMLTableSectionElement&&""===e.style.display||"table-row-group"===e.style.display)}l[h]={intersectionObserver:i,mutationObserverBefore:a,mutationObserverAfter:c}},dispose:function(e){const{observersByDotNetObjectId:t,id:n}=Xe(e),r=t[n];r&&(r.intersectionObserver.disconnect(),r.mutationObserverBefore.disconnect(),r.mutationObserverAfter.disconnect(),e.dispose(),delete t[n])}},Ke=Symbol();function Ve(e){return e&&e!==document.body&&e!==document.documentElement?"visible"!==getComputedStyle(e).overflowY?e:Ve(e.parentElement):null}function Xe(e){var t;const n=e._callDispatcher,r=e._id;return null!==(t=n[Ke])&&void 0!==t||(n[Ke]={}),{observersByDotNetObjectId:n[Ke],id:r}}const Ye={getAndRemoveExistingTitle:function(){var e;const t=document.head?document.head.getElementsByTagName("title"):[];if(0===t.length)return null;let n=null;for(let r=t.length-1;r>=0;r--){const o=t[r],s=o.previousSibling;s instanceof Comment&&null!==z(s)||(null===n&&(n=o.textContent),null===(e=o.parentNode)||void 0===e||e.removeChild(o))}return n}},Ge={init:function(e,t){t._blazorInputFileNextFileId=0,t.addEventListener("click",(function(){t.value=""})),t.addEventListener("change",(function(){t._blazorFilesById={};const n=Array.prototype.map.call(t.files,(function(e){const n={id:++t._blazorInputFileNextFileId,lastModified:new Date(e.lastModified).toISOString(),name:e.name,size:e.size,contentType:e.type,readPromise:void 0,arrayBuffer:void 0,blob:e};return t._blazorFilesById[n.id]=n,n}));e.invokeMethodAsync("NotifyChange",n)}))},toImageFile:async function(e,t,n,r,o){const s=Qe(e,t),i=await new Promise((function(e){const t=new Image;t.onload=function(){URL.revokeObjectURL(t.src),e(t)},t.onerror=function(){t.onerror=null,URL.revokeObjectURL(t.src)},t.src=URL.createObjectURL(s.blob)})),a=await new Promise((function(e){var t;const s=Math.min(1,r/i.width),a=Math.min(1,o/i.height),c=Math.min(s,a),l=document.createElement("canvas");l.width=Math.round(i.width*c),l.height=Math.round(i.height*c),null===(t=l.getContext("2d"))||void 0===t||t.drawImage(i,0,0,l.width,l.height),l.toBlob(e,n)})),c={id:++e._blazorInputFileNextFileId,lastModified:s.lastModified,name:s.name,size:(null==a?void 0:a.size)||0,contentType:n,blob:a||s.blob};return e._blazorFilesById[c.id]=c,c},readFileData:async function(e,t){return Qe(e,t).blob}};function Qe(e,t){const n=e._blazorFilesById[t];if(!n)throw new Error(`There is no file with ID ${t}. The file list may have changed. See https://aka.ms/aspnet/blazor-input-file-multiple-selections.`);return n}const Ze=new Set,et={enableNavigationPrompt:function(e){0===Ze.size&&window.addEventListener("beforeunload",tt),Ze.add(e)},disableNavigationPrompt:function(e){Ze.delete(e),0===Ze.size&&window.removeEventListener("beforeunload",tt)}};function tt(e){e.preventDefault(),e.returnValue=!0}async function nt(e,t,n){return e instanceof Blob?await async function(e,t,n){const r=e.slice(t,t+n),o=await r.arrayBuffer();return new Uint8Array(o)}(e,t,n):function(e,t,n){return new Uint8Array(e.buffer,e.byteOffset+t,n)}(e,t,n)}new Map;const rt={navigateTo:function(e,t,n=!1){Me(e,t instanceof Object?t:{forceLoad:t,replaceHistoryEntry:n})},registerCustomEventType:function(e,t){if(!t)throw new Error("The options parameter is required.");if(s.has(e))throw new Error(`The event '${e}' is already registered.`);if(t.browserEventName){const n=i.get(t.browserEventName);n?n.push(e):i.set(t.browserEventName,[e]),a.forEach((n=>n(e,t.browserEventName)))}s.set(e,t)},rootComponents:y,runtime:{},_internal:{navigationManager:Ne,domWrapper:qe,Virtualize:Je,PageTitle:Ye,InputFile:Ge,NavigationLock:et,getJSDataStreamChunk:nt,attachWebRendererInterop:I}};var ot;function st(e){const t={...it,...e};return e&&e.reconnectionOptions&&(t.reconnectionOptions={...it.reconnectionOptions,...e.reconnectionOptions}),t}window.Blazor=rt,function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Information=2]="Information",e[e.Warning=3]="Warning",e[e.Error=4]="Error",e[e.Critical=5]="Critical",e[e.None=6]="None"}(ot||(ot={}));const it={configureSignalR:e=>{},logLevel:ot.Warning,initializers:void 0,circuitHandlers:[],reconnectionOptions:{maxRetries:8,retryIntervalMilliseconds:2e4,dialogId:"components-reconnect-modal"}};class at{log(e,t){}}at.instance=new at;class ct{constructor(e){this.minLevel=e}log(e,t){if(e>=this.minLevel){const n=`[${(new Date).toISOString()}] ${ot[e]}: ${t}`;switch(e){case ot.Critical:case ot.Error:console.error(n);break;case ot.Warning:console.warn(n);break;case ot.Information:console.info(n);break;default:console.log(n)}}}}const lt=/^\s*Blazor-Server-Component-State:(?[a-zA-Z0-9+/=]+)$/;function ht(e,t,n="state"){var r;if(e.nodeType===Node.COMMENT_NODE){const o=e.textContent||"",s=t.exec(o),i=s&&s.groups&&s.groups[n];return i&&(null===(r=e.parentNode)||void 0===r||r.removeChild(e)),i}if(!e.hasChildNodes())return;const o=e.childNodes;for(let e=0;e.*)$/);function pt(e,t){const n=e.currentElement;var r,o,s;if(n&&n.nodeType===Node.COMMENT_NODE&&n.textContent){const i=ut.exec(n.textContent),a=i&&i.groups&&i.groups.descriptor;if(!a)return;!function(e){if(e.parentNode instanceof Document)throw new Error("Root components cannot be marked as interactive. The element must be rendered statically so that scripts are not evaluated multiple times.")}(n);try{const i=function(e){const t=JSON.parse(e),{type:n}=t;if("server"!==n&&"webassembly"!==n&&"auto"!==n)throw new Error(`Invalid component type '${n}'.`);return t}(a),c=function(e,t,n){const{prerenderId:r}=e;if(r){for(;n.next()&&n.currentElement;){const e=n.currentElement;if(e.nodeType!==Node.COMMENT_NODE)continue;if(!e.textContent)continue;const t=ut.exec(e.textContent),o=t&&t[1];if(o)return vt(o,r),e}throw new Error(`Could not find an end component comment for '${t}'.`)}}(i,n,e);if(t!==i.type)return;switch(i.type){case"webassembly":return o=n,s=c,mt(r=i),{...r,uniqueId:ft++,start:o,end:s};case"server":return function(e,t,n){return gt(e),{...e,uniqueId:ft++,start:t,end:n}}(i,n,c);case"auto":return function(e,t,n){return gt(e),mt(e),{...e,uniqueId:ft++,start:t,end:n}}(i,n,c)}}catch(e){throw new Error(`Found malformed component comment at ${n.textContent}`)}}}let ft=0;function gt(e){const{descriptor:t,sequence:n}=e;if(!t)throw new Error("descriptor must be defined when using a descriptor.");if(void 0===n)throw new Error("sequence must be defined when using a descriptor.");if(!Number.isInteger(n))throw new Error(`Error parsing the sequence '${n}' for component '${JSON.stringify(e)}'`)}function mt(e){const{assembly:t,typeName:n}=e;if(!t)throw new Error("assembly must be defined when using a descriptor.");if(!n)throw new Error("typeName must be defined when using a descriptor.");e.parameterDefinitions=e.parameterDefinitions&&atob(e.parameterDefinitions),e.parameterValues=e.parameterValues&&atob(e.parameterValues)}function vt(e,t){const n=JSON.parse(e);if(1!==Object.keys(n).length)throw new Error(`Invalid end of component comment: '${e}'`);const r=n.prerenderId;if(!r)throw new Error(`End of component comment must have a value for the prerendered property: '${e}'`);if(r!==t)throw new Error(`End of component comment prerendered property must match the start comment prerender id: '${t}', '${r}'`)}class yt{constructor(e){this.childNodes=e,this.currentIndex=-1,this.length=e.length}next(){return this.currentIndex++,this.currentIndex{n+=`0x${e<16?"0":""}${e.toString(16)} `})),n.substr(0,n.length-1)}(e)}'`)):"string"==typeof e&&(n=`String data of length ${e.length}`,t&&(n+=`. Content: '${e}'`)),n}function kt(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}async function Tt(e,t,n,r,o,s){const i={},[a,c]=xt();i[a]=c,e.log(_t.Trace,`(${t} transport) sending data. ${It(o,s.logMessageContent)}.`);const l=kt(o)?"arraybuffer":"text",h=await n.post(r,{content:o,headers:{...i,...s.headers},responseType:l,timeout:s.timeout,withCredentials:s.withCredentials});e.log(_t.Trace,`(${t} transport) request complete. Response status: ${h.statusCode}.`)}class Dt{constructor(e,t){this._subject=e,this._observer=t}dispose(){const e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),0===this._subject.observers.length&&this._subject.cancelCallback&&this._subject.cancelCallback().catch((e=>{}))}}class Rt{constructor(e){this._minLevel=e,this.out=console}log(e,t){if(e>=this._minLevel){const n=`[${(new Date).toISOString()}] ${_t[e]}: ${t}`;switch(e){case _t.Critical:case _t.Error:this.out.error(n);break;case _t.Warning:this.out.warn(n);break;case _t.Information:this.out.info(n);break;default:this.out.log(n)}}}}function xt(){let e="X-SignalR-User-Agent";return Ct.isNode&&(e="User-Agent"),[e,At(St,Pt(),Ct.isNode?"NodeJS":"Browser",Ut())]}function At(e,t,n,r){let o="Microsoft SignalR/";const s=e.split(".");return o+=`${s[0]}.${s[1]}`,o+=` (${e}; `,o+=t&&""!==t?`${t}; `:"Unknown OS; ",o+=`${n}`,o+=r?`; ${r}`:"; Unknown Runtime Version",o+=")",o}function Pt(){if(!Ct.isNode)return"";switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}}function Ut(){if(Ct.isNode)return process.versions.node}function Nt(e){return e.stack?e.stack:e.message?e.message:`${e}`}class Mt{writeHandshakeRequest(e){return wt.write(JSON.stringify(e))}parseHandshakeResponse(e){let t,n;if(kt(e)){const r=new Uint8Array(e),o=r.indexOf(wt.RecordSeparatorCode);if(-1===o)throw new Error("Message is incomplete.");const s=o+1;t=String.fromCharCode.apply(null,Array.prototype.slice.call(r.slice(0,s))),n=r.byteLength>s?r.slice(s).buffer:null}else{const r=e,o=r.indexOf(wt.RecordSeparator);if(-1===o)throw new Error("Message is incomplete.");const s=o+1;t=r.substring(0,s),n=r.length>s?r.substring(s):null}const r=wt.parse(t),o=JSON.parse(r[0]);if(o.type)throw new Error("Expected a handshake response from the server.");return[n,o]}}class Bt extends Error{constructor(e,t){const n=new.target.prototype;super(`${e}: Status code '${t}'`),this.statusCode=t,this.__proto__=n}}class Lt extends Error{constructor(e="A timeout occurred."){const t=new.target.prototype;super(e),this.__proto__=t}}class $t extends Error{constructor(e="An abort occurred."){const t=new.target.prototype;super(e),this.__proto__=t}}class Ot extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.transport=t,this.errorType="UnsupportedTransportError",this.__proto__=n}}class Ft extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.transport=t,this.errorType="DisabledTransportError",this.__proto__=n}}class Ht extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.transport=t,this.errorType="FailedToStartTransportError",this.__proto__=n}}class jt extends Error{constructor(e){const t=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=t}}class Wt extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.innerErrors=t,this.__proto__=n}}var zt,qt;!function(e){e[e.Invocation=1]="Invocation",e[e.StreamItem=2]="StreamItem",e[e.Completion=3]="Completion",e[e.StreamInvocation=4]="StreamInvocation",e[e.CancelInvocation=5]="CancelInvocation",e[e.Ping=6]="Ping",e[e.Close=7]="Close",e[e.Ack=8]="Ack",e[e.Sequence=9]="Sequence"}(zt||(zt={}));class Jt{constructor(){this.observers=[]}next(e){for(const t of this.observers)t.next(e)}error(e){for(const t of this.observers)t.error&&t.error(e)}complete(){for(const e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new Dt(this,e)}}class Kt{constructor(e,t,n){this._bufferSize=1e5,this._messages=[],this._totalMessageCount=0,this._waitForSequenceMessage=!1,this._nextReceivingSequenceId=1,this._latestReceivedSequenceId=0,this._bufferedByteCount=0,this._reconnectInProgress=!1,this._protocol=e,this._connection=t,this._bufferSize=n}async _send(e){const t=this._protocol.writeMessage(e);let n=Promise.resolve();if(this._isInvocationMessage(e)){this._totalMessageCount++;let e=()=>{},r=()=>{};kt(t)?this._bufferedByteCount+=t.byteLength:this._bufferedByteCount+=t.length,this._bufferedByteCount>=this._bufferSize&&(n=new Promise(((t,n)=>{e=t,r=n}))),this._messages.push(new Vt(t,this._totalMessageCount,e,r))}try{this._reconnectInProgress||await this._connection.send(t)}catch{this._disconnected()}await n}_ack(e){let t=-1;for(let n=0;nthis._nextReceivingSequenceId?this._connection.stop(new Error("Sequence ID greater than amount of messages we've received.")):this._nextReceivingSequenceId=e.sequenceId}_disconnected(){this._reconnectInProgress=!0,this._waitForSequenceMessage=!0}async _resend(){const e=0!==this._messages.length?this._messages[0]._id:this._totalMessageCount+1;await this._connection.send(this._protocol.writeMessage({type:zt.Sequence,sequenceId:e}));const t=this._messages;for(const e of t)await this._connection.send(e._message);this._reconnectInProgress=!1}_dispose(e){null!=e||(e=new Error("Unable to reconnect to server."));for(const t of this._messages)t._rejector(e)}_isInvocationMessage(e){switch(e.type){case zt.Invocation:case zt.StreamItem:case zt.Completion:case zt.StreamInvocation:case zt.CancelInvocation:return!0;case zt.Close:case zt.Sequence:case zt.Ping:case zt.Ack:return!1}}_ackTimer(){void 0===this._ackTimerHandle&&(this._ackTimerHandle=setTimeout((async()=>{try{this._reconnectInProgress||await this._connection.send(this._protocol.writeMessage({type:zt.Ack,sequenceId:this._latestReceivedSequenceId}))}catch{}clearTimeout(this._ackTimerHandle),this._ackTimerHandle=void 0}),1e3))}}class Vt{constructor(e,t,n,r){this._message=e,this._id=t,this._resolver=n,this._rejector=r}}!function(e){e.Disconnected="Disconnected",e.Connecting="Connecting",e.Connected="Connected",e.Disconnecting="Disconnecting",e.Reconnecting="Reconnecting"}(qt||(qt={}));class Xt{static create(e,t,n,r,o,s,i){return new Xt(e,t,n,r,o,s,i)}constructor(e,t,n,r,o,s,i){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(_t.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")},Et.isRequired(e,"connection"),Et.isRequired(t,"logger"),Et.isRequired(n,"protocol"),this.serverTimeoutInMilliseconds=null!=o?o:3e4,this.keepAliveIntervalInMilliseconds=null!=s?s:15e3,this._statefulReconnectBufferSize=null!=i?i:1e5,this._logger=t,this._protocol=n,this.connection=e,this._reconnectPolicy=r,this._handshakeProtocol=new Mt,this.connection.onreceive=e=>this._processIncomingData(e),this.connection.onclose=e=>this._connectionClosed(e),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=qt.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:zt.Ping})}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(e){if(this._connectionState!==qt.Disconnected&&this._connectionState!==qt.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}async _startWithStateTransitions(){if(this._connectionState!==qt.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=qt.Connecting,this._logger.log(_t.Debug,"Starting HubConnection.");try{await this._startInternal(),Ct.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=qt.Connected,this._connectionStarted=!0,this._logger.log(_t.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=qt.Disconnected,this._logger.log(_t.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}}async _startInternal(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;const e=new Promise(((e,t)=>{this._handshakeResolver=e,this._handshakeRejecter=t}));await this.connection.start(this._protocol.transferFormat);try{let t=this._protocol.version;this.connection.features.reconnect||(t=1);const n={protocol:this._protocol.name,version:t};if(this._logger.log(_t.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(n)),this._logger.log(_t.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await e,this._stopDuringStartError)throw this._stopDuringStartError;!!this.connection.features.reconnect&&(this._messageBuffer=new Kt(this._protocol,this.connection,this._statefulReconnectBufferSize),this.connection.features.disconnected=this._messageBuffer._disconnected.bind(this._messageBuffer),this.connection.features.resend=()=>{if(this._messageBuffer)return this._messageBuffer._resend()}),this.connection.features.inherentKeepAlive||await this._sendMessage(this._cachedPingMessage)}catch(e){throw this._logger.log(_t.Debug,`Hub handshake failed with error '${e}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),await this.connection.stop(e),e}}async stop(){const e=this._startPromise;this.connection.features.reconnect=!1,this._stopPromise=this._stopInternal(),await this._stopPromise;try{await e}catch(e){}}_stopInternal(e){if(this._connectionState===qt.Disconnected)return this._logger.log(_t.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this._connectionState===qt.Disconnecting)return this._logger.log(_t.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;const t=this._connectionState;return this._connectionState=qt.Disconnecting,this._logger.log(_t.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(_t.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(t===qt.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new $t("The connection was stopped before the hub handshake could complete."),this.connection.stop(e))}async _sendCloseMessage(){try{await this._sendWithProtocol(this._createCloseMessage())}catch{}}stream(e,...t){const[n,r]=this._replaceStreamingParams(t),o=this._createStreamInvocation(e,t,r);let s;const i=new Jt;return i.cancelCallback=()=>{const e=this._createCancelInvocation(o.invocationId);return delete this._callbacks[o.invocationId],s.then((()=>this._sendWithProtocol(e)))},this._callbacks[o.invocationId]=(e,t)=>{t?i.error(t):e&&(e.type===zt.Completion?e.error?i.error(new Error(e.error)):i.complete():i.next(e.item))},s=this._sendWithProtocol(o).catch((e=>{i.error(e),delete this._callbacks[o.invocationId]})),this._launchStreams(n,s),i}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._messageBuffer?this._messageBuffer._send(e):this._sendMessage(this._protocol.writeMessage(e))}send(e,...t){const[n,r]=this._replaceStreamingParams(t),o=this._sendWithProtocol(this._createInvocation(e,t,!0,r));return this._launchStreams(n,o),o}invoke(e,...t){const[n,r]=this._replaceStreamingParams(t),o=this._createInvocation(e,t,!1,r);return new Promise(((e,t)=>{this._callbacks[o.invocationId]=(n,r)=>{r?t(r):n&&(n.type===zt.Completion?n.error?t(new Error(n.error)):e(n.result):t(new Error(`Unexpected message type: ${n.type}`)))};const r=this._sendWithProtocol(o).catch((e=>{t(e),delete this._callbacks[o.invocationId]}));this._launchStreams(n,r)}))}on(e,t){e&&t&&(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),-1===this._methods[e].indexOf(t)&&this._methods[e].push(t))}off(e,t){if(!e)return;e=e.toLowerCase();const n=this._methods[e];if(n)if(t){const r=n.indexOf(t);-1!==r&&(n.splice(r,1),0===n.length&&delete this._methods[e])}else delete this._methods[e]}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(e=this._processHandshakeResponse(e),this._receivedHandshakeResponse=!0),e){const t=this._protocol.parseMessages(e,this._logger);for(const e of t)if(!this._messageBuffer||this._messageBuffer._shouldProcessMessage(e))switch(e.type){case zt.Invocation:this._invokeClientMethod(e);break;case zt.StreamItem:case zt.Completion:{const t=this._callbacks[e.invocationId];if(t){e.type===zt.Completion&&delete this._callbacks[e.invocationId];try{t(e)}catch(e){this._logger.log(_t.Error,`Stream callback threw error: ${Nt(e)}`)}}break}case zt.Ping:break;case zt.Close:{this._logger.log(_t.Information,"Close message received from server.");const t=e.error?new Error("Server returned an error on close: "+e.error):void 0;!0===e.allowReconnect?this.connection.stop(t):this._stopPromise=this._stopInternal(t);break}case zt.Ack:this._messageBuffer&&this._messageBuffer._ack(e);break;case zt.Sequence:this._messageBuffer&&this._messageBuffer._resetSequence(e);break;default:this._logger.log(_t.Warning,`Invalid message type: ${e.type}.`)}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let t,n;try{[n,t]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(e){const t="Error parsing handshake response: "+e;this._logger.log(_t.Error,t);const n=new Error(t);throw this._handshakeRejecter(n),n}if(t.error){const e="Server returned handshake error: "+t.error;this._logger.log(_t.Error,e);const n=new Error(e);throw this._handshakeRejecter(n),n}return this._logger.log(_t.Debug,"Server handshake complete."),this._handshakeResolver(),n}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=(new Date).getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if(!(this.connection.features&&this.connection.features.inherentKeepAlive||(this._timeoutHandle=setTimeout((()=>this.serverTimeout()),this.serverTimeoutInMilliseconds),void 0!==this._pingServerHandle))){let e=this._nextKeepAlive-(new Date).getTime();e<0&&(e=0),this._pingServerHandle=setTimeout((async()=>{if(this._connectionState===qt.Connected)try{await this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}}),e)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}async _invokeClientMethod(e){const t=e.target.toLowerCase(),n=this._methods[t];if(!n)return this._logger.log(_t.Warning,`No client method with the name '${t}' found.`),void(e.invocationId&&(this._logger.log(_t.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),await this._sendWithProtocol(this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null))));const r=n.slice(),o=!!e.invocationId;let s,i,a;for(const n of r)try{const r=s;s=await n.apply(this,e.arguments),o&&s&&r&&(this._logger.log(_t.Error,`Multiple results provided for '${t}'. Sending error to server.`),a=this._createCompletionMessage(e.invocationId,"Client provided multiple results.",null)),i=void 0}catch(e){i=e,this._logger.log(_t.Error,`A callback for the method '${t}' threw error '${e}'.`)}a?await this._sendWithProtocol(a):o?(i?a=this._createCompletionMessage(e.invocationId,`${i}`,null):void 0!==s?a=this._createCompletionMessage(e.invocationId,null,s):(this._logger.log(_t.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),a=this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)),await this._sendWithProtocol(a)):s&&this._logger.log(_t.Error,`Result given for '${t}' method but server is not expecting a result.`)}_connectionClosed(e){this._logger.log(_t.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new $t("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===qt.Disconnecting?this._completeClose(e):this._connectionState===qt.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===qt.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=qt.Disconnected,this._connectionStarted=!1,this._messageBuffer&&(this._messageBuffer._dispose(null!=e?e:new Error("Connection closed.")),this._messageBuffer=void 0),Ct.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach((t=>t.apply(this,[e])))}catch(t){this._logger.log(_t.Error,`An onclose callback called with error '${e}' threw error '${t}'.`)}}}async _reconnect(e){const t=Date.now();let n=0,r=void 0!==e?e:new Error("Attempting to reconnect due to a unknown error."),o=this._getNextRetryDelay(n++,0,r);if(null===o)return this._logger.log(_t.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this._completeClose(e);if(this._connectionState=qt.Reconnecting,e?this._logger.log(_t.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(_t.Information,"Connection reconnecting."),0!==this._reconnectingCallbacks.length){try{this._reconnectingCallbacks.forEach((t=>t.apply(this,[e])))}catch(t){this._logger.log(_t.Error,`An onreconnecting callback called with error '${e}' threw error '${t}'.`)}if(this._connectionState!==qt.Reconnecting)return void this._logger.log(_t.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;null!==o;){if(this._logger.log(_t.Information,`Reconnect attempt number ${n} will start in ${o} ms.`),await new Promise((e=>{this._reconnectDelayHandle=setTimeout(e,o)})),this._reconnectDelayHandle=void 0,this._connectionState!==qt.Reconnecting)return void this._logger.log(_t.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this._startInternal(),this._connectionState=qt.Connected,this._logger.log(_t.Information,"HubConnection reconnected successfully."),0!==this._reconnectedCallbacks.length)try{this._reconnectedCallbacks.forEach((e=>e.apply(this,[this.connection.connectionId])))}catch(e){this._logger.log(_t.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${e}'.`)}return}catch(e){if(this._logger.log(_t.Information,`Reconnect attempt failed because of error '${e}'.`),this._connectionState!==qt.Reconnecting)return this._logger.log(_t.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this._connectionState===qt.Disconnecting&&this._completeClose());r=e instanceof Error?e:new Error(e.toString()),o=this._getNextRetryDelay(n++,Date.now()-t,r)}}this._logger.log(_t.Information,`Reconnect retries have been exhausted after ${Date.now()-t} ms and ${n} failed attempts. Connection disconnecting.`),this._completeClose()}_getNextRetryDelay(e,t,n){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:t,previousRetryCount:e,retryReason:n})}catch(n){return this._logger.log(_t.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${t}) threw error '${n}'.`),null}}_cancelCallbacksWithError(e){const t=this._callbacks;this._callbacks={},Object.keys(t).forEach((n=>{const r=t[n];try{r(null,e)}catch(t){this._logger.log(_t.Error,`Stream 'error' callback called with '${e}' threw error: ${Nt(t)}`)}}))}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,t,n,r){if(n)return 0!==r.length?{arguments:t,streamIds:r,target:e,type:zt.Invocation}:{arguments:t,target:e,type:zt.Invocation};{const n=this._invocationId;return this._invocationId++,0!==r.length?{arguments:t,invocationId:n.toString(),streamIds:r,target:e,type:zt.Invocation}:{arguments:t,invocationId:n.toString(),target:e,type:zt.Invocation}}}_launchStreams(e,t){if(0!==e.length){t||(t=Promise.resolve());for(const n in e)e[n].subscribe({complete:()=>{t=t.then((()=>this._sendWithProtocol(this._createCompletionMessage(n))))},error:e=>{let r;r=e instanceof Error?e.message:e&&e.toString?e.toString():"Unknown error",t=t.then((()=>this._sendWithProtocol(this._createCompletionMessage(n,r))))},next:e=>{t=t.then((()=>this._sendWithProtocol(this._createStreamItemMessage(n,e))))}})}}_replaceStreamingParams(e){const t=[],n=[];for(let r=0;r0)&&(t=!1,this._accessToken=await this._accessTokenFactory()),this._setAuthorizationHeader(e);const n=await this._innerClient.send(e);return t&&401===n.statusCode&&this._accessTokenFactory?(this._accessToken=await this._accessTokenFactory(),this._setAuthorizationHeader(e),await this._innerClient.send(e)):n}_setAuthorizationHeader(e){e.headers||(e.headers={}),this._accessToken?e.headers[Qt.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[Qt.Authorization]&&delete e.headers[Qt.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}}class nn extends en{constructor(e){super(),this._logger=e;const t={_fetchType:void 0,_jar:void 0};var r;r=t,"undefined"==typeof fetch&&(r._jar=new(n(628).CookieJar),"undefined"==typeof fetch?r._fetchType=n(200):r._fetchType=fetch,r._fetchType=n(203)(r._fetchType,r._jar),1)?(this._fetchType=t._fetchType,this._jar=t._jar):this._fetchType=fetch.bind(function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n.g)return n.g;throw new Error("could not find global")}()),this._abortControllerType=AbortController;const o={_abortControllerType:this._abortControllerType};(function(e){return"undefined"==typeof AbortController&&(e._abortControllerType=n(778),!0)})(o)&&(this._abortControllerType=o._abortControllerType)}async send(e){if(e.abortSignal&&e.abortSignal.aborted)throw new $t;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");const t=new this._abortControllerType;let n;e.abortSignal&&(e.abortSignal.onabort=()=>{t.abort(),n=new $t});let r,o=null;if(e.timeout){const r=e.timeout;o=setTimeout((()=>{t.abort(),this._logger.log(_t.Warning,"Timeout from HTTP request."),n=new Lt}),r)}""===e.content&&(e.content=void 0),e.content&&(e.headers=e.headers||{},kt(e.content)?e.headers["Content-Type"]="application/octet-stream":e.headers["Content-Type"]="text/plain;charset=UTF-8");try{r=await this._fetchType(e.url,{body:e.content,cache:"no-cache",credentials:!0===e.withCredentials?"include":"same-origin",headers:{"X-Requested-With":"XMLHttpRequest",...e.headers},method:e.method,mode:"cors",redirect:"follow",signal:t.signal})}catch(e){if(n)throw n;throw this._logger.log(_t.Warning,`Error from HTTP request. ${e}.`),e}finally{o&&clearTimeout(o),e.abortSignal&&(e.abortSignal.onabort=null)}if(!r.ok){const e=await rn(r,"text");throw new Bt(e||r.statusText,r.status)}const s=rn(r,e.responseType),i=await s;return new Zt(r.status,r.statusText,i)}getCookieString(e){return""}}function rn(e,t){let n;switch(t){case"arraybuffer":n=e.arrayBuffer();break;case"text":default:n=e.text();break;case"blob":case"document":case"json":throw new Error(`${t} is not supported.`)}return n}class on extends en{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new $t):e.method?e.url?new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),r.withCredentials=void 0===e.withCredentials||e.withCredentials,r.setRequestHeader("X-Requested-With","XMLHttpRequest"),""===e.content&&(e.content=void 0),e.content&&(kt(e.content)?r.setRequestHeader("Content-Type","application/octet-stream"):r.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const o=e.headers;o&&Object.keys(o).forEach((e=>{r.setRequestHeader(e,o[e])})),e.responseType&&(r.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=()=>{r.abort(),n(new $t)}),e.timeout&&(r.timeout=e.timeout),r.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),r.status>=200&&r.status<300?t(new Zt(r.status,r.statusText,r.response||r.responseText)):n(new Bt(r.response||r.responseText||r.statusText,r.status))},r.onerror=()=>{this._logger.log(_t.Warning,`Error from HTTP request. ${r.status}: ${r.statusText}.`),n(new Bt(r.statusText,r.status))},r.ontimeout=()=>{this._logger.log(_t.Warning,"Timeout from HTTP request."),n(new Lt)},r.send(e.content)})):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class sn extends en{constructor(e){if(super(),"undefined"!=typeof fetch)this._httpClient=new nn(e);else{if("undefined"==typeof XMLHttpRequest)throw new Error("No usable HttpClient found.");this._httpClient=new on(e)}}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new $t):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}}var an,cn;!function(e){e[e.None=0]="None",e[e.WebSockets=1]="WebSockets",e[e.ServerSentEvents=2]="ServerSentEvents",e[e.LongPolling=4]="LongPolling"}(an||(an={})),function(e){e[e.Text=1]="Text",e[e.Binary=2]="Binary"}(cn||(cn={}));class ln{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}}class hn{get pollAborted(){return this._pollAbort.aborted}constructor(e,t,n){this._httpClient=e,this._logger=t,this._pollAbort=new ln,this._options=n,this._running=!1,this.onreceive=null,this.onclose=null}async connect(e,t){if(Et.isRequired(e,"url"),Et.isRequired(t,"transferFormat"),Et.isIn(t,cn,"transferFormat"),this._url=e,this._logger.log(_t.Trace,"(LongPolling transport) Connecting."),t===cn.Binary&&"undefined"!=typeof XMLHttpRequest&&"string"!=typeof(new XMLHttpRequest).responseType)throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[n,r]=xt(),o={[n]:r,...this._options.headers},s={abortSignal:this._pollAbort.signal,headers:o,timeout:1e5,withCredentials:this._options.withCredentials};t===cn.Binary&&(s.responseType="arraybuffer");const i=`${e}&_=${Date.now()}`;this._logger.log(_t.Trace,`(LongPolling transport) polling: ${i}.`);const a=await this._httpClient.get(i,s);200!==a.statusCode?(this._logger.log(_t.Error,`(LongPolling transport) Unexpected response code: ${a.statusCode}.`),this._closeError=new Bt(a.statusText||"",a.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,s)}async _poll(e,t){try{for(;this._running;)try{const n=`${e}&_=${Date.now()}`;this._logger.log(_t.Trace,`(LongPolling transport) polling: ${n}.`);const r=await this._httpClient.get(n,t);204===r.statusCode?(this._logger.log(_t.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):200!==r.statusCode?(this._logger.log(_t.Error,`(LongPolling transport) Unexpected response code: ${r.statusCode}.`),this._closeError=new Bt(r.statusText||"",r.statusCode),this._running=!1):r.content?(this._logger.log(_t.Trace,`(LongPolling transport) data received. ${It(r.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(r.content)):this._logger.log(_t.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(e){this._running?e instanceof Lt?this._logger.log(_t.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=e,this._running=!1):this._logger.log(_t.Trace,`(LongPolling transport) Poll errored after shutdown: ${e.message}`)}}finally{this._logger.log(_t.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(e){return this._running?Tt(this._logger,"LongPolling",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this._logger.log(_t.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(_t.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const e={},[t,n]=xt();e[t]=n;const r={headers:{...e,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials};let o;try{await this._httpClient.delete(this._url,r)}catch(e){o=e}o?o instanceof Bt&&(404===o.statusCode?this._logger.log(_t.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this._logger.log(_t.Trace,`(LongPolling transport) Error sending a DELETE request: ${o}`)):this._logger.log(_t.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this._logger.log(_t.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}}_raiseOnClose(){if(this.onclose){let e="(LongPolling transport) Firing onclose event.";this._closeError&&(e+=" Error: "+this._closeError),this._logger.log(_t.Trace,e),this.onclose(this._closeError)}}}class dn{constructor(e,t,n,r){this._httpClient=e,this._accessToken=t,this._logger=n,this._options=r,this.onreceive=null,this.onclose=null}async connect(e,t){return Et.isRequired(e,"url"),Et.isRequired(t,"transferFormat"),Et.isIn(t,cn,"transferFormat"),this._logger.log(_t.Trace,"(SSE transport) Connecting."),this._url=e,this._accessToken&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise(((n,r)=>{let o,s=!1;if(t===cn.Text){if(Ct.isBrowser||Ct.isWebWorker)o=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{const t=this._httpClient.getCookieString(e),n={};n.Cookie=t;const[r,s]=xt();n[r]=s,o=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:{...n,...this._options.headers}})}try{o.onmessage=e=>{if(this.onreceive)try{this._logger.log(_t.Trace,`(SSE transport) data received. ${It(e.data,this._options.logMessageContent)}.`),this.onreceive(e.data)}catch(e){return void this._close(e)}},o.onerror=e=>{s?this._close():r(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."))},o.onopen=()=>{this._logger.log(_t.Information,`SSE connected to ${this._url}`),this._eventSource=o,s=!0,n()}}catch(e){return void r(e)}}else r(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))}))}async send(e){return this._eventSource?Tt(this._logger,"SSE",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}}class un{constructor(e,t,n,r,o,s){this._logger=n,this._accessTokenFactory=t,this._logMessageContent=r,this._webSocketConstructor=o,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=s}async connect(e,t){let n;return Et.isRequired(e,"url"),Et.isRequired(t,"transferFormat"),Et.isIn(t,cn,"transferFormat"),this._logger.log(_t.Trace,"(WebSockets transport) Connecting."),this._accessTokenFactory&&(n=await this._accessTokenFactory()),new Promise(((r,o)=>{let s;e=e.replace(/^http/,"ws");const i=this._httpClient.getCookieString(e);let a=!1;if(Ct.isReactNative){const t={},[r,o]=xt();t[r]=o,n&&(t[Qt.Authorization]=`Bearer ${n}`),i&&(t[Qt.Cookie]=i),s=new this._webSocketConstructor(e,void 0,{headers:{...t,...this._headers}})}else n&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(n)}`);s||(s=new this._webSocketConstructor(e)),t===cn.Binary&&(s.binaryType="arraybuffer"),s.onopen=t=>{this._logger.log(_t.Information,`WebSocket connected to ${e}.`),this._webSocket=s,a=!0,r()},s.onerror=e=>{let t=null;t="undefined"!=typeof ErrorEvent&&e instanceof ErrorEvent?e.error:"There was an error with the transport",this._logger.log(_t.Information,`(WebSockets transport) ${t}.`)},s.onmessage=e=>{if(this._logger.log(_t.Trace,`(WebSockets transport) data received. ${It(e.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(e.data)}catch(e){return void this._close(e)}},s.onclose=e=>{if(a)this._close(e);else{let t=null;t="undefined"!=typeof ErrorEvent&&e instanceof ErrorEvent?e.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.",o(new Error(t))}}}))}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(_t.Trace,`(WebSockets transport) sending data. ${It(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(_t.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this._isCloseEvent(e)||!1!==e.wasClean&&1e3===e.code?e instanceof Error?this.onclose(e):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason||"no reason given"}).`)))}_isCloseEvent(e){return e&&"boolean"==typeof e.wasClean&&"number"==typeof e.code}}class pn{constructor(e,t={}){if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,Et.isRequired(e,"url"),this._logger=function(e){return void 0===e?new Rt(_t.Information):null===e?bt.instance:void 0!==e.log?e:new Rt(e)}(t.logger),this.baseUrl=this._resolveUrl(e),(t=t||{}).logMessageContent=void 0!==t.logMessageContent&&t.logMessageContent,"boolean"!=typeof t.withCredentials&&void 0!==t.withCredentials)throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");t.withCredentials=void 0===t.withCredentials||t.withCredentials,t.timeout=void 0===t.timeout?1e5:t.timeout,"undefined"==typeof WebSocket||t.WebSocket||(t.WebSocket=WebSocket),"undefined"==typeof EventSource||t.EventSource||(t.EventSource=EventSource),this._httpClient=new tn(t.httpClient||new sn(this._logger),t.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=t,this.onreceive=null,this.onclose=null}async start(e){if(e=e||cn.Binary,Et.isIn(e,cn,"transferFormat"),this._logger.log(_t.Debug,`Starting connection with transfer format '${cn[e]}'.`),"Disconnected"!==this._connectionState)return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(e),await this._startInternalPromise,"Disconnecting"===this._connectionState){const e="Failed to start the HttpConnection before stop() was called.";return this._logger.log(_t.Error,e),await this._stopPromise,Promise.reject(new $t(e))}if("Connected"!==this._connectionState){const e="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(_t.Error,e),Promise.reject(new $t(e))}this._connectionStarted=!0}send(e){return"Connected"!==this._connectionState?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new fn(this.transport)),this._sendQueue.send(e))}async stop(e){return"Disconnected"===this._connectionState?(this._logger.log(_t.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):"Disconnecting"===this._connectionState?(this._logger.log(_t.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState="Disconnecting",this._stopPromise=new Promise((e=>{this._stopPromiseResolver=e})),await this._stopInternal(e),void await this._stopPromise)}async _stopInternal(e){this._stopError=e;try{await this._startInternalPromise}catch(e){}if(this.transport){try{await this.transport.stop()}catch(e){this._logger.log(_t.Error,`HttpConnection.transport.stop() threw error '${e}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(_t.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async _startInternal(e){let t=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport!==an.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(an.WebSockets),await this._startTransport(t,e)}else{let n=null,r=0;do{if(n=await this._getNegotiationResponse(t),"Disconnecting"===this._connectionState||"Disconnected"===this._connectionState)throw new $t("The connection was stopped during negotiation.");if(n.error)throw new Error(n.error);if(n.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(n.url&&(t=n.url),n.accessToken){const e=n.accessToken;this._accessTokenFactory=()=>e,this._httpClient._accessToken=e,this._httpClient._accessTokenFactory=void 0}r++}while(n.url&&r<100);if(100===r&&n.url)throw new Error("Negotiate redirection limit exceeded.");await this._createTransport(t,this._options.transport,n,e)}this.transport instanceof hn&&(this.features.inherentKeepAlive=!0),"Connecting"===this._connectionState&&(this._logger.log(_t.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(e){return this._logger.log(_t.Error,"Failed to start the connection: "+e),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(e)}}async _getNegotiationResponse(e){const t={},[n,r]=xt();t[n]=r;const o=this._resolveNegotiateUrl(e);this._logger.log(_t.Debug,`Sending negotiation request: ${o}.`);try{const e=await this._httpClient.post(o,{content:"",headers:{...t,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(200!==e.statusCode)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${e.statusCode}'`));const n=JSON.parse(e.content);return(!n.negotiateVersion||n.negotiateVersion<1)&&(n.connectionToken=n.connectionId),n.useStatefulReconnect&&!0!==this._options._useStatefulReconnect?Promise.reject(new jt("Client didn't negotiate Stateful Reconnect but the server did.")):n}catch(e){let t="Failed to complete negotiation with the server: "+e;return e instanceof Bt&&404===e.statusCode&&(t+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(_t.Error,t),Promise.reject(new jt(t))}}_createConnectUrl(e,t){return t?e+(-1===e.indexOf("?")?"?":"&")+`id=${t}`:e}async _createTransport(e,t,n,r){let o=this._createConnectUrl(e,n.connectionToken);if(this._isITransport(t))return this._logger.log(_t.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=t,await this._startTransport(o,r),void(this.connectionId=n.connectionId);const s=[],i=n.availableTransports||[];let a=n;for(const n of i){const i=this._resolveTransportOrError(n,t,r,!0===(null==a?void 0:a.useStatefulReconnect));if(i instanceof Error)s.push(`${n.transport} failed:`),s.push(i);else if(this._isITransport(i)){if(this.transport=i,!a){try{a=await this._getNegotiationResponse(e)}catch(e){return Promise.reject(e)}o=this._createConnectUrl(e,a.connectionToken)}try{return await this._startTransport(o,r),void(this.connectionId=a.connectionId)}catch(e){if(this._logger.log(_t.Error,`Failed to start the transport '${n.transport}': ${e}`),a=void 0,s.push(new Ht(`${n.transport} failed: ${e}`,an[n.transport])),"Connecting"!==this._connectionState){const e="Failed to select transport before stop() was called.";return this._logger.log(_t.Debug,e),Promise.reject(new $t(e))}}}}return s.length>0?Promise.reject(new Wt(`Unable to connect to the server with any of the available transports. ${s.join(" ")}`,s)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))}_constructTransport(e){switch(e){case an.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new un(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case an.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new dn(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case an.LongPolling:return new hn(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,t){return this.transport.onreceive=this.onreceive,this.features.reconnect?this.transport.onclose=async n=>{let r=!1;if(this.features.reconnect){try{this.features.disconnected(),await this.transport.connect(e,t),await this.features.resend()}catch{r=!0}r&&this._stopConnection(n)}else this._stopConnection(n)}:this.transport.onclose=e=>this._stopConnection(e),this.transport.connect(e,t)}_resolveTransportOrError(e,t,n,r){const o=an[e.transport];if(null==o)return this._logger.log(_t.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(!function(e,t){return!e||0!=(t&e)}(t,o))return this._logger.log(_t.Debug,`Skipping transport '${an[o]}' because it was disabled by the client.`),new Ft(`'${an[o]}' is disabled by the client.`,o);if(!(e.transferFormats.map((e=>cn[e])).indexOf(n)>=0))return this._logger.log(_t.Debug,`Skipping transport '${an[o]}' because it does not support the requested transfer format '${cn[n]}'.`),new Error(`'${an[o]}' does not support ${cn[n]}.`);if(o===an.WebSockets&&!this._options.WebSocket||o===an.ServerSentEvents&&!this._options.EventSource)return this._logger.log(_t.Debug,`Skipping transport '${an[o]}' because it is not supported in your environment.'`),new Ot(`'${an[o]}' is not supported in your environment.`,o);this._logger.log(_t.Debug,`Selecting transport '${an[o]}'.`);try{return this.features.reconnect=o===an.WebSockets?r:void 0,this._constructTransport(o)}catch(e){return e}}_isITransport(e){return e&&"object"==typeof e&&"connect"in e}_stopConnection(e){if(this._logger.log(_t.Debug,`HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`),this.transport=void 0,e=this._stopError||e,this._stopError=void 0,"Disconnected"!==this._connectionState){if("Connecting"===this._connectionState)throw this._logger.log(_t.Warning,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);if("Disconnecting"===this._connectionState&&this._stopPromiseResolver(),e?this._logger.log(_t.Error,`Connection disconnected with error '${e}'.`):this._logger.log(_t.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch((e=>{this._logger.log(_t.Error,`TransportSendQueue.stop() threw error '${e}'.`)})),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(t){this._logger.log(_t.Error,`HttpConnection.onclose(${e}) threw error '${t}'.`)}}}else this._logger.log(_t.Debug,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`)}_resolveUrl(e){if(0===e.lastIndexOf("https://",0)||0===e.lastIndexOf("http://",0))return e;if(!Ct.isBrowser)throw new Error(`Cannot resolve '${e}'.`);const t=window.document.createElement("a");return t.href=e,this._logger.log(_t.Information,`Normalizing '${e}' to '${t.href}'.`),t.href}_resolveNegotiateUrl(e){const t=new URL(e);t.pathname.endsWith("/")?t.pathname+="negotiate":t.pathname+="/negotiate";const n=new URLSearchParams(t.searchParams);return n.has("negotiateVersion")||n.append("negotiateVersion",this._negotiateVersion.toString()),n.has("useStatefulReconnect")?"true"===n.get("useStatefulReconnect")&&(this._options._useStatefulReconnect=!0):!0===this._options._useStatefulReconnect&&n.append("useStatefulReconnect","true"),t.search=n.toString(),t.toString()}}class fn{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new gn,this._transportResult=new gn,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new gn),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}async _sendLoop(){for(;;){if(await this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new gn;const e=this._transportResult;this._transportResult=void 0;const t="string"==typeof this._buffer[0]?this._buffer.join(""):fn._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(t),e.resolve()}catch(t){e.reject(t)}}}static _concatBuffers(e){const t=e.map((e=>e.byteLength)).reduce(((e,t)=>e+t)),n=new Uint8Array(t);let r=0;for(const t of e)n.set(new Uint8Array(t),r),r+=t.byteLength;return n.buffer}}class gn{constructor(){this.promise=new Promise(((e,t)=>[this._resolver,this._rejecter]=[e,t]))}resolve(){this._resolver()}reject(e){this._rejecter(e)}}class mn{constructor(){this.name="json",this.version=2,this.transferFormat=cn.Text}parseMessages(e,t){if("string"!=typeof e)throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];null===t&&(t=bt.instance);const n=wt.parse(e),r=[];for(const e of n){const n=JSON.parse(e);if("number"!=typeof n.type)throw new Error("Invalid payload.");switch(n.type){case zt.Invocation:this._isInvocationMessage(n);break;case zt.StreamItem:this._isStreamItemMessage(n);break;case zt.Completion:this._isCompletionMessage(n);break;case zt.Ping:case zt.Close:break;case zt.Ack:this._isAckMessage(n);break;case zt.Sequence:this._isSequenceMessage(n);break;default:t.log(_t.Information,"Unknown message type '"+n.type+"' ignored.");continue}r.push(n)}return r}writeMessage(e){return wt.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,"Invalid payload for Invocation message."),void 0!==e.invocationId&&this._assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),void 0===e.item)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this._assertNotEmptyString(e.error,"Invalid payload for Completion message."),this._assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")}_isAckMessage(e){if("number"!=typeof e.sequenceId)throw new Error("Invalid SequenceId for Ack message.")}_isSequenceMessage(e){if("number"!=typeof e.sequenceId)throw new Error("Invalid SequenceId for Sequence message.")}_assertNotEmptyString(e,t){if("string"!=typeof e||""===e)throw new Error(t)}}const vn={trace:_t.Trace,debug:_t.Debug,info:_t.Information,information:_t.Information,warn:_t.Warning,warning:_t.Warning,error:_t.Error,critical:_t.Critical,none:_t.None};class yn{configureLogging(e){if(Et.isRequired(e,"logging"),function(e){return void 0!==e.log}(e))this.logger=e;else if("string"==typeof e){const t=function(e){const t=vn[e.toLowerCase()];if(void 0!==t)return t;throw new Error(`Unknown log level: ${e}`)}(e);this.logger=new Rt(t)}else this.logger=new Rt(e);return this}withUrl(e,t){return Et.isRequired(e,"url"),Et.isNotEmpty(e,"url"),this.url=e,this.httpConnectionOptions="object"==typeof t?{...this.httpConnectionOptions,...t}:{...this.httpConnectionOptions,transport:t},this}withHubProtocol(e){return Et.isRequired(e,"protocol"),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new Gt(e):this.reconnectPolicy=e:this.reconnectPolicy=new Gt,this}withServerTimeout(e){return Et.isRequired(e,"milliseconds"),this._serverTimeoutInMilliseconds=e,this}withKeepAliveInterval(e){return Et.isRequired(e,"milliseconds"),this._keepAliveIntervalInMilliseconds=e,this}withStatefulReconnect(e){return void 0===this.httpConnectionOptions&&(this.httpConnectionOptions={}),this.httpConnectionOptions._useStatefulReconnect=!0,this._statefulReconnectBufferSize=null==e?void 0:e.bufferSize,this}build(){const e=this.httpConnectionOptions||{};if(void 0===e.logger&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const t=new pn(this.url,e);return Xt.create(t,this.logger||bt.instance,this.protocol||new mn,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}}var wn;!function(e){e[e.Default=0]="Default",e[e.Server=1]="Server",e[e.WebAssembly=2]="WebAssembly",e[e.WebView=3]="WebView"}(wn||(wn={}));var _n,bn,Sn,En=4294967295;function Cn(e,t,n){var r=Math.floor(n/4294967296),o=n;e.setUint32(t,r),e.setUint32(t+4,o)}function In(e,t){return 4294967296*e.getInt32(t)+e.getUint32(t+4)}var kn=("undefined"==typeof process||"never"!==(null===(_n=null===process||void 0===process?void 0:process.env)||void 0===_n?void 0:_n.TEXT_ENCODING))&&"undefined"!=typeof TextEncoder&&"undefined"!=typeof TextDecoder;function Tn(e){for(var t=e.length,n=0,r=0;r=55296&&o<=56319&&r65535&&(h-=65536,s.push(h>>>10&1023|55296),h=56320|1023&h),s.push(h)}else s.push(a);s.length>=4096&&(i+=String.fromCharCode.apply(String,s),s.length=0)}return s.length>0&&(i+=String.fromCharCode.apply(String,s)),i}var Pn,Un=kn?new TextDecoder:null,Nn=kn?"undefined"!=typeof process&&"force"!==(null===(Sn=null===process||void 0===process?void 0:process.env)||void 0===Sn?void 0:Sn.TEXT_DECODER)?200:0:En,Mn=function(e,t){this.type=e,this.data=t},Bn=(Pn=function(e,t){return Pn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Pn(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Pn(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Ln=function(e){function t(n){var r=e.call(this,n)||this,o=Object.create(t.prototype);return Object.setPrototypeOf(r,o),Object.defineProperty(r,"name",{configurable:!0,enumerable:!1,value:t.name}),r}return Bn(t,e),t}(Error),$n={type:-1,encode:function(e){var t,n,r,o;return e instanceof Date?function(e){var t,n=e.sec,r=e.nsec;if(n>=0&&r>=0&&n<=17179869183){if(0===r&&n<=4294967295){var o=new Uint8Array(4);return(t=new DataView(o.buffer)).setUint32(0,n),o}var s=n/4294967296,i=4294967295&n;return o=new Uint8Array(8),(t=new DataView(o.buffer)).setUint32(0,r<<2|3&s),t.setUint32(4,i),o}return o=new Uint8Array(12),(t=new DataView(o.buffer)).setUint32(0,r),Cn(t,4,n),o}((r=1e6*((t=e.getTime())-1e3*(n=Math.floor(t/1e3))),{sec:n+(o=Math.floor(r/1e9)),nsec:r-1e9*o})):null},decode:function(e){var t=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:var n=t.getUint32(0);return{sec:4294967296*(3&n)+t.getUint32(4),nsec:n>>>2};case 12:return{sec:In(t,4),nsec:t.getUint32(0)};default:throw new Ln("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(e.length))}}(e);return new Date(1e3*t.sec+t.nsec/1e6)}},On=function(){function e(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register($n)}return e.prototype.register=function(e){var t=e.type,n=e.encode,r=e.decode;if(t>=0)this.encoders[t]=n,this.decoders[t]=r;else{var o=1+t;this.builtInEncoders[o]=n,this.builtInDecoders[o]=r}},e.prototype.tryToEncode=function(e,t){for(var n=0;nthis.maxDepth)throw new Error("Too deep objects in depth ".concat(t));null==e?this.encodeNil():"boolean"==typeof e?this.encodeBoolean(e):"number"==typeof e?this.encodeNumber(e):"string"==typeof e?this.encodeString(e):this.encodeObject(e,t)},e.prototype.ensureBufferSizeToWrite=function(e){var t=this.pos+e;this.view.byteLength=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):(this.writeU8(211),this.writeI64(e)):this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))},e.prototype.writeStringHeader=function(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else{if(!(e<4294967296))throw new Error("Too long string: ".concat(e," bytes in UTF-8"));this.writeU8(219),this.writeU32(e)}},e.prototype.encodeString=function(e){if(e.length>Rn){var t=Tn(e);this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),xn(e,this.bytes,this.pos),this.pos+=t}else t=Tn(e),this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),function(e,t,n){for(var r=e.length,o=n,s=0;s>6&31|192;else{if(i>=55296&&i<=56319&&s>12&15|224,t[o++]=i>>6&63|128):(t[o++]=i>>18&7|240,t[o++]=i>>12&63|128,t[o++]=i>>6&63|128)}t[o++]=63&i|128}else t[o++]=i}}(e,this.bytes,this.pos),this.pos+=t},e.prototype.encodeObject=function(e,t){var n=this.extensionCodec.tryToEncode(e,this.context);if(null!=n)this.encodeExtension(n);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else{if("object"!=typeof e)throw new Error("Unrecognized object: ".concat(Object.prototype.toString.apply(e)));this.encodeMap(e,t)}},e.prototype.encodeBinary=function(e){var t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too large binary: ".concat(t));this.writeU8(198),this.writeU32(t)}var n=Fn(e);this.writeU8a(n)},e.prototype.encodeArray=function(e,t){var n=e.length;if(n<16)this.writeU8(144+n);else if(n<65536)this.writeU8(220),this.writeU16(n);else{if(!(n<4294967296))throw new Error("Too large array: ".concat(n));this.writeU8(221),this.writeU32(n)}for(var r=0,o=e;r0&&e<=this.maxKeyLength},e.prototype.find=function(e,t,n){e:for(var r=0,o=this.caches[n-1];r=this.maxLengthPerKey?n[Math.random()*n.length|0]=r:n.push(r)},e.prototype.decode=function(e,t,n){var r=this.find(e,t,n);if(null!=r)return this.hit++,r;this.miss++;var o=An(e,t,n),s=Uint8Array.prototype.slice.call(e,t,t+n);return this.store(s,o),o},e}(),zn=function(e,t){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=e},e.prototype.createExtraByteError=function(e){var t=this.view,n=this.pos;return new RangeError("Extra ".concat(t.byteLength-n," of ").concat(t.byteLength," byte(s) found at buffer[").concat(e,"]"))},e.prototype.decode=function(e){this.reinitializeState(),this.setBuffer(e);var t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t},e.prototype.decodeMulti=function(e){return zn(this,(function(t){switch(t.label){case 0:this.reinitializeState(),this.setBuffer(e),t.label=1;case 1:return this.hasRemaining(1)?[4,this.doDecodeSync()]:[3,3];case 2:return t.sent(),[3,1];case 3:return[2]}}))},e.prototype.decodeAsync=function(e){var t,n,r,o,s,i,a;return s=this,void 0,a=function(){var s,i,a,c,l,h,d,u;return zn(this,(function(p){switch(p.label){case 0:s=!1,p.label=1;case 1:p.trys.push([1,6,7,12]),t=qn(e),p.label=2;case 2:return[4,t.next()];case 3:if((n=p.sent()).done)return[3,5];if(a=n.value,s)throw this.createExtraByteError(this.totalPos);this.appendBuffer(a);try{i=this.doDecodeSync(),s=!0}catch(e){if(!(e instanceof Xn))throw e}this.totalPos+=this.pos,p.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return c=p.sent(),r={error:c},[3,12];case 7:return p.trys.push([7,,10,11]),n&&!n.done&&(o=t.return)?[4,o.call(t)]:[3,9];case 8:p.sent(),p.label=9;case 9:return[3,11];case 10:if(r)throw r.error;return[7];case 11:return[7];case 12:if(s){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return[2,i]}throw h=(l=this).headByte,d=l.pos,u=l.totalPos,new RangeError("Insufficient data in parsing ".concat(jn(h)," at ").concat(u," (").concat(d," in the current buffer)"))}}))},new((i=void 0)||(i=Promise))((function(e,t){function n(e){try{o(a.next(e))}catch(e){t(e)}}function r(e){try{o(a.throw(e))}catch(e){t(e)}}function o(t){var o;t.done?e(t.value):(o=t.value,o instanceof i?o:new i((function(e){e(o)}))).then(n,r)}o((a=a.apply(s,[])).next())}))},e.prototype.decodeArrayStream=function(e){return this.decodeMultiAsync(e,!0)},e.prototype.decodeStream=function(e){return this.decodeMultiAsync(e,!1)},e.prototype.decodeMultiAsync=function(e,t){return function(n,r,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s,i=function(){var n,r,o,s,i,a,c,l,h;return zn(this,(function(d){switch(d.label){case 0:n=t,r=-1,d.label=1;case 1:d.trys.push([1,13,14,19]),o=qn(e),d.label=2;case 2:return[4,Jn(o.next())];case 3:if((s=d.sent()).done)return[3,12];if(i=s.value,t&&0===r)throw this.createExtraByteError(this.totalPos);this.appendBuffer(i),n&&(r=this.readArraySize(),n=!1,this.complete()),d.label=4;case 4:d.trys.push([4,9,,10]),d.label=5;case 5:return[4,Jn(this.doDecodeSync())];case 6:return[4,d.sent()];case 7:return d.sent(),0==--r?[3,8]:[3,5];case 8:return[3,10];case 9:if(!((a=d.sent())instanceof Xn))throw a;return[3,10];case 10:this.totalPos+=this.pos,d.label=11;case 11:return[3,2];case 12:return[3,19];case 13:return c=d.sent(),l={error:c},[3,19];case 14:return d.trys.push([14,,17,18]),s&&!s.done&&(h=o.return)?[4,Jn(h.call(o))]:[3,16];case 15:d.sent(),d.label=16;case 16:return[3,18];case 17:if(l)throw l.error;return[7];case 18:return[7];case 19:return[2]}}))}.apply(n,r||[]),a=[];return s={},c("next"),c("throw"),c("return"),s[Symbol.asyncIterator]=function(){return this},s;function c(e){i[e]&&(s[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||l(e,t)}))})}function l(e,t){try{(n=i[e](t)).value instanceof Jn?Promise.resolve(n.value.v).then(h,d):u(a[0][2],n)}catch(e){u(a[0][3],e)}var n}function h(e){l("next",e)}function d(e){l("throw",e)}function u(e,t){e(t),a.shift(),a.length&&l(a[0][0],a[0][1])}}(this,arguments)},e.prototype.doDecodeSync=function(){e:for(;;){var e=this.readHeadByte(),t=void 0;if(e>=224)t=e-256;else if(e<192)if(e<128)t=e;else if(e<144){if(0!=(r=e-128)){this.pushMapState(r),this.complete();continue e}t={}}else if(e<160){if(0!=(r=e-144)){this.pushArrayState(r),this.complete();continue e}t=[]}else{var n=e-160;t=this.decodeUtf8String(n,0)}else if(192===e)t=null;else if(194===e)t=!1;else if(195===e)t=!0;else if(202===e)t=this.readF32();else if(203===e)t=this.readF64();else if(204===e)t=this.readU8();else if(205===e)t=this.readU16();else if(206===e)t=this.readU32();else if(207===e)t=this.readU64();else if(208===e)t=this.readI8();else if(209===e)t=this.readI16();else if(210===e)t=this.readI32();else if(211===e)t=this.readI64();else if(217===e)n=this.lookU8(),t=this.decodeUtf8String(n,1);else if(218===e)n=this.lookU16(),t=this.decodeUtf8String(n,2);else if(219===e)n=this.lookU32(),t=this.decodeUtf8String(n,4);else if(220===e){if(0!==(r=this.readU16())){this.pushArrayState(r),this.complete();continue e}t=[]}else if(221===e){if(0!==(r=this.readU32())){this.pushArrayState(r),this.complete();continue e}t=[]}else if(222===e){if(0!==(r=this.readU16())){this.pushMapState(r),this.complete();continue e}t={}}else if(223===e){if(0!==(r=this.readU32())){this.pushMapState(r),this.complete();continue e}t={}}else if(196===e){var r=this.lookU8();t=this.decodeBinary(r,1)}else if(197===e)r=this.lookU16(),t=this.decodeBinary(r,2);else if(198===e)r=this.lookU32(),t=this.decodeBinary(r,4);else if(212===e)t=this.decodeExtension(1,0);else if(213===e)t=this.decodeExtension(2,0);else if(214===e)t=this.decodeExtension(4,0);else if(215===e)t=this.decodeExtension(8,0);else if(216===e)t=this.decodeExtension(16,0);else if(199===e)r=this.lookU8(),t=this.decodeExtension(r,1);else if(200===e)r=this.lookU16(),t=this.decodeExtension(r,2);else{if(201!==e)throw new Ln("Unrecognized type byte: ".concat(jn(e)));r=this.lookU32(),t=this.decodeExtension(r,4)}this.complete();for(var o=this.stack;o.length>0;){var s=o[o.length-1];if(0===s.type){if(s.array[s.position]=t,s.position++,s.position!==s.size)continue e;o.pop(),t=s.array}else{if(1===s.type){if("string"!=(i=typeof t)&&"number"!==i)throw new Ln("The type of key must be string or number but "+typeof t);if("__proto__"===t)throw new Ln("The key __proto__ is not allowed");s.key=t,s.type=2;continue e}if(s.map[s.key]=t,s.readCount++,s.readCount!==s.size){s.key=null,s.type=1;continue e}o.pop(),t=s.map}}return t}var i},e.prototype.readHeadByte=function(){return-1===this.headByte&&(this.headByte=this.readU8()),this.headByte},e.prototype.complete=function(){this.headByte=-1},e.prototype.readArraySize=function(){var e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw new Ln("Unrecognized array type byte: ".concat(jn(e)))}},e.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw new Ln("Max length exceeded: map length (".concat(e,") > maxMapLengthLength (").concat(this.maxMapLength,")"));this.stack.push({type:1,size:e,key:null,readCount:0,map:{}})},e.prototype.pushArrayState=function(e){if(e>this.maxArrayLength)throw new Ln("Max length exceeded: array length (".concat(e,") > maxArrayLength (").concat(this.maxArrayLength,")"));this.stack.push({type:0,size:e,array:new Array(e),position:0})},e.prototype.decodeUtf8String=function(e,t){var n;if(e>this.maxStrLength)throw new Ln("Max length exceeded: UTF-8 byte length (".concat(e,") > maxStrLength (").concat(this.maxStrLength,")"));if(this.bytes.byteLengthNn?function(e,t,n){var r=e.subarray(t,t+n);return Un.decode(r)}(this.bytes,o,e):An(this.bytes,o,e),this.pos+=t+e,r},e.prototype.stateIsMapKey=function(){return this.stack.length>0&&1===this.stack[this.stack.length-1].type},e.prototype.decodeBinary=function(e,t){if(e>this.maxBinLength)throw new Ln("Max length exceeded: bin length (".concat(e,") > maxBinLength (").concat(this.maxBinLength,")"));if(!this.hasRemaining(e+t))throw Yn;var n=this.pos+t,r=this.bytes.subarray(n,n+e);return this.pos+=t+e,r},e.prototype.decodeExtension=function(e,t){if(e>this.maxExtLength)throw new Ln("Max length exceeded: ext length (".concat(e,") > maxExtLength (").concat(this.maxExtLength,")"));var n=this.view.getInt8(this.pos+t),r=this.decodeBinary(e,t+1);return this.extensionCodec.decode(r,n,this.context)},e.prototype.lookU8=function(){return this.view.getUint8(this.pos)},e.prototype.lookU16=function(){return this.view.getUint16(this.pos)},e.prototype.lookU32=function(){return this.view.getUint32(this.pos)},e.prototype.readU8=function(){var e=this.view.getUint8(this.pos);return this.pos++,e},e.prototype.readI8=function(){var e=this.view.getInt8(this.pos);return this.pos++,e},e.prototype.readU16=function(){var e=this.view.getUint16(this.pos);return this.pos+=2,e},e.prototype.readI16=function(){var e=this.view.getInt16(this.pos);return this.pos+=2,e},e.prototype.readU32=function(){var e=this.view.getUint32(this.pos);return this.pos+=4,e},e.prototype.readI32=function(){var e=this.view.getInt32(this.pos);return this.pos+=4,e},e.prototype.readU64=function(){var e,t,n=(e=this.view,t=this.pos,4294967296*e.getUint32(t)+e.getUint32(t+4));return this.pos+=8,n},e.prototype.readI64=function(){var e=In(this.view,this.pos);return this.pos+=8,e},e.prototype.readF32=function(){var e=this.view.getFloat32(this.pos);return this.pos+=4,e},e.prototype.readF64=function(){var e=this.view.getFloat64(this.pos);return this.pos+=8,e},e}();class Zn{static write(e){let t=e.byteLength||e.length;const n=[];do{let e=127&t;t>>=7,t>0&&(e|=128),n.push(e)}while(t>0);t=e.byteLength||e.length;const r=new Uint8Array(n.length+t);return r.set(n,0),r.set(e,n.length),r.buffer}static parse(e){const t=[],n=new Uint8Array(e),r=[0,7,14,21,28];for(let o=0;o7)throw new Error("Messages bigger than 2GB are not supported.");if(!(n.byteLength>=o+i+a))throw new Error("Incomplete message.");t.push(n.slice?n.slice(o+i,o+i+a):n.subarray(o+i,o+i+a)),o=o+i+a}return t}}const er=new Uint8Array([145,zt.Ping]);class tr{constructor(e){this.name="messagepack",this.version=2,this.transferFormat=cn.Binary,this._errorResult=1,this._voidResult=2,this._nonVoidResult=3,e=e||{},this._encoder=new Hn(e.extensionCodec,e.context,e.maxDepth,e.initialBufferSize,e.sortKeys,e.forceFloat32,e.ignoreUndefined,e.forceIntegerToFloat),this._decoder=new Qn(e.extensionCodec,e.context,e.maxStrLength,e.maxBinLength,e.maxArrayLength,e.maxMapLength,e.maxExtLength)}parseMessages(e,t){if(!(n=e)||"undefined"==typeof ArrayBuffer||!(n instanceof ArrayBuffer||n.constructor&&"ArrayBuffer"===n.constructor.name))throw new Error("Invalid input for MessagePack hub protocol. Expected an ArrayBuffer.");var n;null===t&&(t=bt.instance);const r=Zn.parse(e),o=[];for(const e of r){const n=this._parseMessage(e,t);n&&o.push(n)}return o}writeMessage(e){switch(e.type){case zt.Invocation:return this._writeInvocation(e);case zt.StreamInvocation:return this._writeStreamInvocation(e);case zt.StreamItem:return this._writeStreamItem(e);case zt.Completion:return this._writeCompletion(e);case zt.Ping:return Zn.write(er);case zt.CancelInvocation:return this._writeCancelInvocation(e);case zt.Close:return this._writeClose();case zt.Ack:return this._writeAck(e);case zt.Sequence:return this._writeSequence(e);default:throw new Error("Invalid message type.")}}_parseMessage(e,t){if(0===e.length)throw new Error("Invalid payload.");const n=this._decoder.decode(e);if(0===n.length||!(n instanceof Array))throw new Error("Invalid payload.");const r=n[0];switch(r){case zt.Invocation:return this._createInvocationMessage(this._readHeaders(n),n);case zt.StreamItem:return this._createStreamItemMessage(this._readHeaders(n),n);case zt.Completion:return this._createCompletionMessage(this._readHeaders(n),n);case zt.Ping:return this._createPingMessage(n);case zt.Close:return this._createCloseMessage(n);case zt.Ack:return this._createAckMessage(n);case zt.Sequence:return this._createSequenceMessage(n);default:return t.log(_t.Information,"Unknown message type '"+r+"' ignored."),null}}_createCloseMessage(e){if(e.length<2)throw new Error("Invalid payload for Close message.");return{allowReconnect:e.length>=3?e[2]:void 0,error:e[1],type:zt.Close}}_createPingMessage(e){if(e.length<1)throw new Error("Invalid payload for Ping message.");return{type:zt.Ping}}_createInvocationMessage(e,t){if(t.length<5)throw new Error("Invalid payload for Invocation message.");const n=t[2];return n?{arguments:t[4],headers:e,invocationId:n,streamIds:[],target:t[3],type:zt.Invocation}:{arguments:t[4],headers:e,streamIds:[],target:t[3],type:zt.Invocation}}_createStreamItemMessage(e,t){if(t.length<4)throw new Error("Invalid payload for StreamItem message.");return{headers:e,invocationId:t[2],item:t[3],type:zt.StreamItem}}_createCompletionMessage(e,t){if(t.length<4)throw new Error("Invalid payload for Completion message.");const n=t[3];if(n!==this._voidResult&&t.length<5)throw new Error("Invalid payload for Completion message.");let r,o;switch(n){case this._errorResult:r=t[4];break;case this._nonVoidResult:o=t[4]}return{error:r,headers:e,invocationId:t[2],result:o,type:zt.Completion}}_createAckMessage(e){if(e.length<1)throw new Error("Invalid payload for Ack message.");return{sequenceId:e[1],type:zt.Ack}}_createSequenceMessage(e){if(e.length<1)throw new Error("Invalid payload for Sequence message.");return{sequenceId:e[1],type:zt.Sequence}}_writeInvocation(e){let t;return t=e.streamIds?this._encoder.encode([zt.Invocation,e.headers||{},e.invocationId||null,e.target,e.arguments,e.streamIds]):this._encoder.encode([zt.Invocation,e.headers||{},e.invocationId||null,e.target,e.arguments]),Zn.write(t.slice())}_writeStreamInvocation(e){let t;return t=e.streamIds?this._encoder.encode([zt.StreamInvocation,e.headers||{},e.invocationId,e.target,e.arguments,e.streamIds]):this._encoder.encode([zt.StreamInvocation,e.headers||{},e.invocationId,e.target,e.arguments]),Zn.write(t.slice())}_writeStreamItem(e){const t=this._encoder.encode([zt.StreamItem,e.headers||{},e.invocationId,e.item]);return Zn.write(t.slice())}_writeCompletion(e){const t=e.error?this._errorResult:void 0!==e.result?this._nonVoidResult:this._voidResult;let n;switch(t){case this._errorResult:n=this._encoder.encode([zt.Completion,e.headers||{},e.invocationId,t,e.error]);break;case this._voidResult:n=this._encoder.encode([zt.Completion,e.headers||{},e.invocationId,t]);break;case this._nonVoidResult:n=this._encoder.encode([zt.Completion,e.headers||{},e.invocationId,t,e.result])}return Zn.write(n.slice())}_writeCancelInvocation(e){const t=this._encoder.encode([zt.CancelInvocation,e.headers||{},e.invocationId]);return Zn.write(t.slice())}_writeClose(){const e=this._encoder.encode([zt.Close,null]);return Zn.write(e.slice())}_writeAck(e){const t=this._encoder.encode([zt.Ack,e.sequenceId]);return Zn.write(t.slice())}_writeSequence(e){const t=this._encoder.encode([zt.Sequence,e.sequenceId]);return Zn.write(t.slice())}_readHeaders(e){const t=e[1];if("object"!=typeof t)throw new Error("Invalid headers.");return t}}const nr="function"==typeof TextDecoder?new TextDecoder("utf-8"):null,rr=nr?nr.decode.bind(nr):function(e){let t=0;const n=e.length,r=[],o=[];for(;t65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o)}r.length>1024&&(o.push(String.fromCharCode.apply(null,r)),r.length=0)}return o.push(String.fromCharCode.apply(null,r)),o.join("")},or=Math.pow(2,32),sr=Math.pow(2,21)-1;function ir(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}function ar(e,t){return e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24>>>0)}function cr(e,t){const n=ar(e,t+4);if(n>sr)throw new Error(`Cannot read uint64 with high order part ${n}, because the result would exceed Number.MAX_SAFE_INTEGER.`);return n*or+ar(e,t)}class lr{constructor(e){this.batchData=e;const t=new pr(e);this.arrayRangeReader=new fr(e),this.arrayBuilderSegmentReader=new gr(e),this.diffReader=new hr(e),this.editReader=new dr(e,t),this.frameReader=new ur(e,t)}updatedComponents(){return ir(this.batchData,this.batchData.length-20)}referenceFrames(){return ir(this.batchData,this.batchData.length-16)}disposedComponentIds(){return ir(this.batchData,this.batchData.length-12)}disposedEventHandlerIds(){return ir(this.batchData,this.batchData.length-8)}updatedComponentsEntry(e,t){const n=e+4*t;return ir(this.batchData,n)}referenceFramesEntry(e,t){return e+20*t}disposedComponentIdsEntry(e,t){const n=e+4*t;return ir(this.batchData,n)}disposedEventHandlerIdsEntry(e,t){const n=e+8*t;return cr(this.batchData,n)}}class hr{constructor(e){this.batchDataUint8=e}componentId(e){return ir(this.batchDataUint8,e)}edits(e){return e+4}editsEntry(e,t){return e+16*t}}class dr{constructor(e,t){this.batchDataUint8=e,this.stringReader=t}editType(e){return ir(this.batchDataUint8,e)}siblingIndex(e){return ir(this.batchDataUint8,e+4)}newTreeIndex(e){return ir(this.batchDataUint8,e+8)}moveToSiblingIndex(e){return ir(this.batchDataUint8,e+8)}removedAttributeName(e){const t=ir(this.batchDataUint8,e+12);return this.stringReader.readString(t)}}class ur{constructor(e,t){this.batchDataUint8=e,this.stringReader=t}frameType(e){return ir(this.batchDataUint8,e)}subtreeLength(e){return ir(this.batchDataUint8,e+4)}elementReferenceCaptureId(e){const t=ir(this.batchDataUint8,e+4);return this.stringReader.readString(t)}componentId(e){return ir(this.batchDataUint8,e+8)}elementName(e){const t=ir(this.batchDataUint8,e+8);return this.stringReader.readString(t)}textContent(e){const t=ir(this.batchDataUint8,e+4);return this.stringReader.readString(t)}markupContent(e){const t=ir(this.batchDataUint8,e+4);return this.stringReader.readString(t)}attributeName(e){const t=ir(this.batchDataUint8,e+4);return this.stringReader.readString(t)}attributeValue(e){const t=ir(this.batchDataUint8,e+8);return this.stringReader.readString(t)}attributeEventHandlerId(e){return cr(this.batchDataUint8,e+12)}}class pr{constructor(e){this.batchDataUint8=e,this.stringTableStartIndex=ir(e,e.length-4)}readString(e){if(-1===e)return null;{const n=ir(this.batchDataUint8,this.stringTableStartIndex+4*e),r=function(e,t){let n=0,r=0;for(let o=0;o<4;o++){const s=e[t+o];if(n|=(127&s)<this.nextBatchId)return this.fatalError?(this.logger.log(ot.Debug,`Received a new batch ${e} but errored out on a previous batch ${this.nextBatchId-1}`),void await n.send("OnRenderCompleted",this.nextBatchId-1,this.fatalError.toString())):void this.logger.log(ot.Debug,`Waiting for batch ${this.nextBatchId}. Batch ${e} not processed.`);try{this.nextBatchId++,this.logger.log(ot.Debug,`Applying batch ${e}.`),function(e,t){const n=ge[e];if(!n)throw new Error(`There is no browser renderer with ID ${e}.`);const r=t.arrayRangeReader,o=t.updatedComponents(),s=r.values(o),i=r.count(o),a=t.referenceFrames(),c=r.values(a),l=t.diffReader;for(let e=0;e{e.onclick=function(e){location.reload(),e.preventDefault()}})),document.querySelectorAll("#blazor-error-ui .dismiss").forEach((e=>{e.onclick=function(e){const t=document.querySelector("#blazor-error-ui");t&&(t.style.display="none"),e.preventDefault()}})))}class Ir{constructor(t,n,r,o){this._firstUpdate=!0,this._renderingFailed=!1,this._disposed=!1,this._circuitId=void 0,this._applicationState=n,this._componentManager=t,this._options=r,this._logger=o,this._renderQueue=new mr(this._logger),this._dispatcher=e.attachDispatcher(this)}start(){if(this.isDisposedOrDisposing())throw new Error("Cannot start a disposed circuit.");return this._startPromise||(this._startPromise=this.startCore()),this._startPromise}updateRootComponents(e){var t,n;return this._firstUpdate?(this._firstUpdate=!1,null===(t=this._connection)||void 0===t?void 0:t.send("UpdateRootComponents",e,this._applicationState)):null===(n=this._connection)||void 0===n?void 0:n.send("UpdateRootComponents",e,"")}async startCore(){if(this._connection=await this.startConnection(),this._connection.state!==qt.Connected)return!1;const e=JSON.stringify(this._componentManager.initialComponents.map((e=>{return t=e,{...t,start:void 0,end:void 0};var t})));if(this._circuitId=await this._connection.invoke("StartCircuit",Ne.getBaseURI(),Ne.getLocationHref(),e,this._applicationState||""),!this._circuitId)return!1;for(const e of this._options.circuitHandlers)e.onCircuitOpened&&e.onCircuitOpened();return!0}async startConnection(){var e,t;const n=new tr;n.name="blazorpack";const r=(new yn).withUrl("_blazor").withHubProtocol(n);this._options.configureSignalR(r);const o=r.build();o.on("JS.AttachComponent",((e,t)=>function(e,t,n,r){let o=ge[e];o||(o=new de(e),ge[e]=o),o.attachRootComponentToLogicalElement(n,t,!1)}(wn.Server,this.resolveElement(t),e))),o.on("JS.BeginInvokeJS",this._dispatcher.beginInvokeJSFromDotNet.bind(this._dispatcher)),o.on("JS.EndInvokeDotNet",this._dispatcher.endInvokeDotNetFromJS.bind(this._dispatcher)),o.on("JS.ReceiveByteArray",this._dispatcher.receiveByteArray.bind(this._dispatcher)),o.on("JS.BeginTransmitStream",(e=>{const t=new ReadableStream({start:t=>{o.stream("SendDotNetStreamToJS",e).subscribe({next:e=>t.enqueue(e),complete:()=>t.close(),error:e=>t.error(e)})}});this._dispatcher.supplyDotNetStream(e,t)})),o.on("JS.RenderBatch",(async(e,t)=>{var n,r;this._logger.log(_t.Debug,`Received render batch with id ${e} and ${t.byteLength} bytes.`),await this._renderQueue.processBatch(e,t,this._connection),null===(r=(n=this._componentManager).onAfterRenderBatch)||void 0===r||r.call(n,wn.Server)})),o.on("JS.EndUpdateRootComponents",(e=>{var t,n;null===(n=(t=this._componentManager).onAfterUpdateRootComponents)||void 0===n||n.call(t,e)})),o.on("JS.EndLocationChanging",rt._internal.navigationManager.endLocationChanging),o.onclose((e=>{this._interopMethodsForReconnection=function(e){const t=S.get(e);if(!t)throw new Error(`Interop methods are not registered for renderer ${e}`);return S.delete(e),t}(wn.Server),this._disposed||this._renderingFailed||this._options.reconnectionHandler.onConnectionDown(this._options.reconnectionOptions,e)})),o.on("JS.Error",(e=>{this._renderingFailed=!0,this.unhandledError(e),Cr()}));try{await o.start()}catch(e){if(this.unhandledError(e),"FailedToNegotiateWithServerError"===e.errorType)throw e;Cr(),e.innerErrors&&(e.innerErrors.some((e=>"UnsupportedTransportError"===e.errorType&&e.transport===an.WebSockets))?this._logger.log(_t.Error,"Unable to connect, please ensure you are using an updated browser that supports WebSockets."):e.innerErrors.some((e=>"FailedToStartTransportError"===e.errorType&&e.transport===an.WebSockets))?this._logger.log(_t.Error,"Unable to connect, please ensure WebSockets are available. A VPN or proxy may be blocking the connection."):e.innerErrors.some((e=>"DisabledTransportError"===e.errorType&&e.transport===an.LongPolling))&&this._logger.log(_t.Error,"Unable to initiate a SignalR connection to the server. This might be because the server is not configured to support WebSockets. For additional details, visit https://aka.ms/blazor-server-websockets-error."))}return(null===(t=null===(e=o.connection)||void 0===e?void 0:e.features)||void 0===t?void 0:t.inherentKeepAlive)&&this._logger.log(_t.Warning,"Failed to connect via WebSockets, using the Long Polling fallback transport. This may be due to a VPN or proxy blocking the connection. To troubleshoot this, visit https://aka.ms/blazor-server-using-fallback-long-polling."),o}async disconnect(){var e;await(null===(e=this._connection)||void 0===e?void 0:e.stop())}async reconnect(){if(!this._circuitId)throw new Error("Circuit host not initialized.");return this._connection.state===qt.Connected||(this._connection=await this.startConnection(),this._interopMethodsForReconnection&&(I(wn.Server,this._interopMethodsForReconnection),this._interopMethodsForReconnection=void 0),!!await this._connection.invoke("ConnectCircuit",this._circuitId)&&(this._options.reconnectionHandler.onConnectionUp(),!0))}beginInvokeDotNetFromJS(e,t,n,r,o){this.throwIfDispatchingWhenDisposed(),this._connection.send("BeginInvokeDotNetFromJS",e?e.toString():null,t,n,r||0,o)}endInvokeJSFromDotNet(e,t,n){this.throwIfDispatchingWhenDisposed(),this._connection.send("EndInvokeJSFromDotNet",e,t,n)}sendByteArray(e,t){this.throwIfDispatchingWhenDisposed(),this._connection.send("ReceiveByteArray",e,t)}throwIfDispatchingWhenDisposed(){if(this._disposed)throw new Error("The circuit associated with this dispatcher is no longer available.")}sendLocationChanged(e,t,n){return this._connection.send("OnLocationChanged",e,t,n)}sendLocationChanging(e,t,n,r){return this._connection.send("OnLocationChanging",e,t,n,r)}sendJsDataStream(e,t,n){return function(e,t,n,r){setTimeout((async()=>{let o=5,s=(new Date).valueOf();try{const i=t instanceof Blob?t.size:t.byteLength;let a=0,c=0;for(;a1)await e.send("ReceiveJSDataChunk",n,c,h,null);else{if(!await e.invoke("ReceiveJSDataChunk",n,c,h,null))break;const t=(new Date).valueOf(),r=t-s;s=t,o=Math.max(1,Math.round(500/Math.max(1,r)))}a+=l,c++}}catch(t){await e.send("ReceiveJSDataChunk",n,-1,null,t.toString())}}),0)}(this._connection,e,t,n)}resolveElement(e){const t=function(e){const t=f.get(e);if(t)return f.delete(e),t}(e);if(t)return O(t,!0);const n=Number.parseInt(e);if(!Number.isNaN(n))return function(e){const{start:t,end:n}=e,r=t[$];if(r){if(r!==e)throw new Error("The start component comment was already associated with another component descriptor.");return t}const o=t.parentNode;if(!o)throw new Error(`Comment not connected to the DOM ${t.textContent}`);const s=O(o,!0),i=K(s);t[L]=s,t[$]=e;const a=O(t);if(n){const e=K(a),r=Array.prototype.indexOf.call(i,a)+1;let o=null;for(;o!==n;){const n=i.splice(r,1)[0];if(!n)throw new Error("Could not find the end component comment in the parent logical node list");n[L]=t,e.push(n),o=n}}return a}(this._componentManager.resolveRootComponent(n));throw new Error(`Invalid sequence number or identifier '${e}'.`)}getRootComponentManager(){return this._componentManager}unhandledError(e){this._logger.log(_t.Error,e),this.disconnect()}getDisconnectFormData(){const e=new FormData,t=this._circuitId;return e.append("circuitId",t),e}didRenderingFail(){return this._renderingFailed}isDisposedOrDisposing(){return void 0!==this._disposePromise}sendDisconnectBeacon(){if(this._disposed)return;const e=this.getDisconnectFormData();this._disposed=navigator.sendBeacon("_blazor/disconnect",e)}dispose(){return this._disposePromise||(this._disposePromise=this.disposeCore()),this._disposePromise}async disposeCore(){var e;if(!this._startPromise)return void(this._disposed=!0);await this._startPromise,this._disposed=!0,null===(e=this._connection)||void 0===e||e.stop();const t=this.getDisconnectFormData();fetch("_blazor/disconnect",{method:"POST",body:t});for(const e of this._options.circuitHandlers)e.onCircuitClosed&&e.onCircuitClosed()}}class kr{constructor(e,t,n,r){this.maxRetries=t,this.document=n,this.logger=r,this.modal=this.document.createElement("div"),this.modal.id=e,this.maxRetries=t,this.modal.style.cssText=["position: fixed","top: 0","right: 0","bottom: 0","left: 0","z-index: 1050","display: none","overflow: hidden","background-color: #fff","opacity: 0.8","text-align: center","font-weight: bold","transition: visibility 0s linear 500ms"].join(";"),this.message=this.document.createElement("h5"),this.message.style.cssText="margin-top: 20px",this.button=this.document.createElement("button"),this.button.style.cssText="margin:5px auto 5px",this.button.textContent="Retry";const o=this.document.createElement("a");o.addEventListener("click",(()=>location.reload())),o.textContent="reload",this.reloadParagraph=this.document.createElement("p"),this.reloadParagraph.textContent="Alternatively, ",this.reloadParagraph.appendChild(o),this.modal.appendChild(this.message),this.modal.appendChild(this.button),this.modal.appendChild(this.reloadParagraph),this.loader=this.getLoader(),this.message.after(this.loader),this.button.addEventListener("click",(async()=>{this.show();try{await rt.reconnect()||this.rejected()}catch(e){this.logger.log(ot.Error,e),this.failed()}}))}show(){this.document.contains(this.modal)||this.document.body.appendChild(this.modal),this.modal.style.display="block",this.loader.style.display="inline-block",this.button.style.display="none",this.reloadParagraph.style.display="none",this.message.textContent="Attempting to reconnect to the server...",this.modal.style.visibility="hidden",setTimeout((()=>{this.modal.style.visibility="visible"}),0)}update(e){this.message.textContent=`Attempting to reconnect to the server: ${e} of ${this.maxRetries}`}hide(){this.modal.style.display="none"}failed(){this.button.style.display="block",this.reloadParagraph.style.display="none",this.loader.style.display="none";const e=this.document.createTextNode("Reconnection failed. Try "),t=this.document.createElement("a");t.textContent="reloading",t.setAttribute("href",""),t.addEventListener("click",(()=>location.reload()));const n=this.document.createTextNode(" the page if you're unable to reconnect.");this.message.replaceChildren(e,t,n)}rejected(){this.button.style.display="none",this.reloadParagraph.style.display="none",this.loader.style.display="none";const e=this.document.createTextNode("Could not reconnect to the server. "),t=this.document.createElement("a");t.textContent="Reload",t.setAttribute("href",""),t.addEventListener("click",(()=>location.reload()));const n=this.document.createTextNode(" the page to restore functionality.");this.message.replaceChildren(e,t,n)}getLoader(){const e=this.document.createElement("div");return e.style.cssText=["border: 0.3em solid #f3f3f3","border-top: 0.3em solid #3498db","border-radius: 50%","width: 2em","height: 2em","display: inline-block"].join(";"),e.animate([{transform:"rotate(0deg)"},{transform:"rotate(360deg)"}],{duration:2e3,iterations:1/0}),e}}class Tr{constructor(e,t,n){this.dialog=e,this.maxRetries=t,this.document=n,this.document=n;const r=this.document.getElementById(Tr.MaxRetriesId);r&&(r.innerText=this.maxRetries.toString())}show(){this.removeClasses(),this.dialog.classList.add(Tr.ShowClassName)}update(e){const t=this.document.getElementById(Tr.CurrentAttemptId);t&&(t.innerText=e.toString())}hide(){this.removeClasses(),this.dialog.classList.add(Tr.HideClassName)}failed(){this.removeClasses(),this.dialog.classList.add(Tr.FailedClassName)}rejected(){this.removeClasses(),this.dialog.classList.add(Tr.RejectedClassName)}removeClasses(){this.dialog.classList.remove(Tr.ShowClassName,Tr.HideClassName,Tr.FailedClassName,Tr.RejectedClassName)}}Tr.ShowClassName="components-reconnect-show",Tr.HideClassName="components-reconnect-hide",Tr.FailedClassName="components-reconnect-failed",Tr.RejectedClassName="components-reconnect-rejected",Tr.MaxRetriesId="components-reconnect-max-retries",Tr.CurrentAttemptId="components-reconnect-current-attempt";class Dr{constructor(e,t,n){this._currentReconnectionProcess=null,this._logger=e,this._reconnectionDisplay=t,this._reconnectCallback=n||rt.reconnect}onConnectionDown(e,t){if(!this._reconnectionDisplay){const t=document.getElementById(e.dialogId);this._reconnectionDisplay=t?new Tr(t,e.maxRetries,document):new kr(e.dialogId,e.maxRetries,document,this._logger)}this._currentReconnectionProcess||(this._currentReconnectionProcess=new Rr(e,this._logger,this._reconnectCallback,this._reconnectionDisplay))}onConnectionUp(){this._currentReconnectionProcess&&(this._currentReconnectionProcess.dispose(),this._currentReconnectionProcess=null)}}class Rr{constructor(e,t,n,r){this.logger=t,this.reconnectCallback=n,this.isDisposed=!1,this.reconnectDisplay=r,this.reconnectDisplay.show(),this.attemptPeriodicReconnection(e)}dispose(){this.isDisposed=!0,this.reconnectDisplay.hide()}async attemptPeriodicReconnection(e){for(let t=0;tRr.MaximumFirstRetryInterval?Rr.MaximumFirstRetryInterval:e.retryIntervalMilliseconds;if(await this.delay(n),this.isDisposed)break;try{return await this.reconnectCallback()?void 0:void this.reconnectDisplay.rejected()}catch(e){this.logger.log(ot.Error,e)}}this.reconnectDisplay.failed()}delay(e){return new Promise((t=>setTimeout(t,e)))}}Rr.MaximumFirstRetryInterval=3e3;class xr{constructor(e=!0,t,n,r=0){this.singleRuntime=e,this.logger=t,this.webRendererId=r,this.afterStartedCallbacks=[],n&&this.afterStartedCallbacks.push(...n)}async importInitializersAsync(e,t){await Promise.all(e.map((e=>async function(e,n){const r=function(e){const t=document.baseURI;return t.endsWith("/")?`${t}${e}`:`${t}/${e}`}(n),o=await import(r);if(void 0!==o){if(e.singleRuntime){const{beforeStart:n,afterStarted:r,beforeWebAssemblyStart:i,afterWebAssemblyStarted:a,beforeServerStart:c,afterServerStarted:l}=o;let h=n;e.webRendererId===wn.Server&&c&&(h=c),e.webRendererId===wn.WebAssembly&&i&&(h=i);let d=r;return e.webRendererId===wn.Server&&l&&(d=l),e.webRendererId===wn.WebAssembly&&a&&(d=a),s(e,h,d,t)}return function(e,t,n){var o;const i=n[0],{beforeStart:a,afterStarted:c,beforeWebStart:l,afterWebStarted:h,beforeWebAssemblyStart:d,afterWebAssemblyStarted:u,beforeServerStart:p,afterServerStarted:f}=t,g=!(l||h||d||u||p||f||!a&&!c),m=g&&i.enableClassicInitializers;if(g&&!i.enableClassicInitializers)null===(o=e.logger)||void 0===o||o.log(ot.Warning,`Initializer '${r}' will be ignored because multiple runtimes are available. use 'before(web|webAssembly|server)Start' and 'after(web|webAssembly|server)Started?' instead.)`);else if(m)return s(e,a,c,n);if(function(e){e.webAssembly?e.webAssembly.initializers||(e.webAssembly.initializers={beforeStart:[],afterStarted:[]}):e.webAssembly={initializers:{beforeStart:[],afterStarted:[]}},e.circuit?e.circuit.initializers||(e.circuit.initializers={beforeStart:[],afterStarted:[]}):e.circuit={initializers:{beforeStart:[],afterStarted:[]}}}(i),d&&i.webAssembly.initializers.beforeStart.push(d),u&&i.webAssembly.initializers.afterStarted.push(u),p&&i.circuit.initializers.beforeStart.push(p),f&&i.circuit.initializers.afterStarted.push(f),h&&e.afterStartedCallbacks.push(h),l)return l(i)}(e,o,t)}function s(e,t,n,r){if(n&&e.afterStartedCallbacks.push(n),t)return t(...r)}}(this,e))))}async invokeAfterStartedCallbacks(e){const t=function(e){var t;return null===(t=C.get(e))||void 0===t?void 0:t[1]}(this.webRendererId);t&&await t,await Promise.all(this.afterStartedCallbacks.map((t=>t(e))))}}function Ar(e){if(void 0!==Sr)throw new Error("Blazor Server has already started.");return Sr=new Promise(Pr.bind(null,e)),Sr}async function Pr(e,t,n){await vr;const r=await async function(e){if(e.initializers)return await Promise.all(e.initializers.beforeStart.map((t=>t(e)))),new xr(!1,void 0,e.initializers.afterStarted,wn.Server);const t=await fetch("_blazor/initializers",{method:"GET",credentials:"include",cache:"no-cache"}),n=await t.json(),r=new xr(!0,void 0,void 0,wn.Server);return await r.importInitializersAsync(n,[e]),r}(_r);var o;if(o=document,yr=ht(o,lt)||"",br=new ct(_r.logLevel),wr=new Ir(e,yr,_r,br),br.log(ot.Information,"Starting up Blazor server-side application."),rt.reconnect=async()=>!(wr.didRenderingFail()||!await wr.reconnect()&&(br.log(ot.Information,"Reconnection attempt to the circuit was rejected by the server. This may indicate that the associated state is no longer available on the server."),1)),rt.defaultReconnectionHandler=new Dr(br),_r.reconnectionHandler=_r.reconnectionHandler||rt.defaultReconnectionHandler,rt._internal.navigationManager.listenForNavigationEvents(wn.Server,((e,t,n)=>wr.sendLocationChanged(e,t,n)),((e,t,n,r)=>wr.sendLocationChanging(e,t,n,r))),rt._internal.forceCloseConnection=()=>wr.disconnect(),rt._internal.sendJSDataStream=(e,t,n)=>wr.sendJsDataStream(e,t,n),!await wr.start())return br.log(ot.Error,"Failed to start the circuit."),void t();const s=()=>{wr.sendDisconnectBeacon()};rt.disconnect=s,window.addEventListener("unload",s,{capture:!1,once:!0}),br.log(ot.Information,"Blazor server-side application started."),r.invokeAfterStartedCallbacks(rt),t()}class Ur{constructor(e){this.initialComponents=e}resolveRootComponent(e){return this.initialComponents[e]}}class Nr{constructor(){this._eventListeners=new Map}static create(e){const t=new Nr;return e.addEventListener=t.addEventListener.bind(t),e.removeEventListener=t.removeEventListener.bind(t),t}addEventListener(e,t){let n=this._eventListeners.get(e);n||(n=new Set,this._eventListeners.set(e,n)),n.add(t)}removeEventListener(e,t){var n;null===(n=this._eventListeners.get(e))||void 0===n||n.delete(t)}dispatchEvent(e,t){const n=this._eventListeners.get(e);if(!n)return;const r={...t,type:e};for(const e of n)e(r)}}let Mr=!1;function Br(e){if(Mr)throw new Error("Blazor has already started.");Mr=!0;const t=st(e);!function(e){if(_r)throw new Error("Circuit options have already been configured.");if(_r)throw new Error("WebAssembly options have already been configured.");vr=async function(e){const t=await e;_r=st(t)}(e)}(Promise.resolve(t||{})),Nr.create(rt);const n=function(e){return dt(e,"server").sort(((e,t)=>e.sequence-t.sequence))}(document);return Ar(new Ur(n))}rt.start=Br,window.DotNet=e,document&&document.currentScript&&"false"!==document.currentScript.getAttribute("autostart")&&Br()})()})();
\ No newline at end of file
diff --git a/src/Components/Web.JS/dist/Release/blazor.web.js b/src/Components/Web.JS/dist/Release/blazor.web.js
index f61bd122dfe8..9281f8ac0392 100644
--- a/src/Components/Web.JS/dist/Release/blazor.web.js
+++ b/src/Components/Web.JS/dist/Release/blazor.web.js
@@ -1 +1 @@
-(()=>{var e={778:()=>{},77:()=>{},203:()=>{},200:()=>{},628:()=>{},321:()=>{}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),(()=>{"use strict";var e,t,o;!function(e){const t=[],n="__jsObjectId",o="__dotNetObject",r="__byte[]",i="__dotNetStream",s="__jsStreamReferenceLength";let a,c;class l{constructor(e){this._jsObject=e,this._cachedFunctions=new Map}findFunction(e){const t=this._cachedFunctions.get(e);if(t)return t;let n,o=this._jsObject;if(e.split(".").forEach((t=>{if(!(t in o))throw new Error(`Could not find '${e}' ('${t}' was undefined).`);n=o,o=o[t]})),o instanceof Function)return o=o.bind(n),this._cachedFunctions.set(e,o),o;throw new Error(`The value '${e}' is not a function.`)}getWrappedObject(){return this._jsObject}}const h={0:new l(window)};h[0]._cachedFunctions.set("import",(e=>("string"==typeof e&&e.startsWith("./")&&(e=new URL(e.substr(2),document.baseURI).toString()),import(e))));let d,u=1;function p(e){t.push(e)}function f(e){if(e&&"object"==typeof e){h[u]=new l(e);const t={[n]:u};return u++,t}throw new Error(`Cannot create a JSObjectReference from the value '${e}'.`)}function g(e){let t=-1;if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Blob)t=e.size;else{if(!(e.buffer instanceof ArrayBuffer))throw new Error("Supplied value is not a typed array or blob.");if(void 0===e.byteLength)throw new Error(`Cannot create a JSStreamReference from the value '${e}' as it doesn't have a byteLength.`);t=e.byteLength}const o={[s]:t};try{const t=f(e);o[n]=t[n]}catch(t){throw new Error(`Cannot create a JSStreamReference from the value '${e}'.`)}return o}function m(e,n){c=e;const o=n?JSON.parse(n,((e,n)=>t.reduce(((t,n)=>n(e,t)),n))):null;return c=void 0,o}function v(){if(void 0===a)throw new Error("No call dispatcher has been set.");if(null===a)throw new Error("There are multiple .NET runtimes present, so a default dispatcher could not be resolved. Use DotNetObject to invoke .NET instance methods.");return a}e.attachDispatcher=function(e){const t=new y(e);return void 0===a?a=t:a&&(a=null),t},e.attachReviver=p,e.invokeMethod=function(e,t,...n){return v().invokeDotNetStaticMethod(e,t,...n)},e.invokeMethodAsync=function(e,t,...n){return v().invokeDotNetStaticMethodAsync(e,t,...n)},e.createJSObjectReference=f,e.createJSStreamReference=g,e.disposeJSObjectReference=function(e){const t=e&&e[n];"number"==typeof t&&_(t)},function(e){e[e.Default=0]="Default",e[e.JSObjectReference=1]="JSObjectReference",e[e.JSStreamReference=2]="JSStreamReference",e[e.JSVoidResult=3]="JSVoidResult"}(d=e.JSCallResultType||(e.JSCallResultType={}));class y{constructor(e){this._dotNetCallDispatcher=e,this._byteArraysToBeRevived=new Map,this._pendingDotNetToJSStreams=new Map,this._pendingAsyncCalls={},this._nextAsyncCallId=1}getDotNetCallDispatcher(){return this._dotNetCallDispatcher}invokeJSFromDotNet(e,t,n,o){const r=m(this,t),i=I(b(e,o)(...r||[]),n);return null==i?null:T(this,i)}beginInvokeJSFromDotNet(e,t,n,o,r){const i=new Promise((e=>{const o=m(this,n);e(b(t,r)(...o||[]))}));e&&i.then((t=>T(this,[e,!0,I(t,o)]))).then((t=>this._dotNetCallDispatcher.endInvokeJSFromDotNet(e,!0,t)),(t=>this._dotNetCallDispatcher.endInvokeJSFromDotNet(e,!1,JSON.stringify([e,!1,w(t)]))))}endInvokeDotNetFromJS(e,t,n){const o=t?m(this,n):new Error(n);this.completePendingCall(parseInt(e,10),t,o)}invokeDotNetStaticMethod(e,t,...n){return this.invokeDotNetMethod(e,t,null,n)}invokeDotNetStaticMethodAsync(e,t,...n){return this.invokeDotNetMethodAsync(e,t,null,n)}invokeDotNetMethod(e,t,n,o){if(this._dotNetCallDispatcher.invokeDotNetFromJS){const r=T(this,o),i=this._dotNetCallDispatcher.invokeDotNetFromJS(e,t,n,r);return i?m(this,i):null}throw new Error("The current dispatcher does not support synchronous calls from JS to .NET. Use invokeDotNetMethodAsync instead.")}invokeDotNetMethodAsync(e,t,n,o){if(e&&n)throw new Error(`For instance method calls, assemblyName should be null. Received '${e}'.`);const r=this._nextAsyncCallId++,i=new Promise(((e,t)=>{this._pendingAsyncCalls[r]={resolve:e,reject:t}}));try{const i=T(this,o);this._dotNetCallDispatcher.beginInvokeDotNetFromJS(r,e,t,n,i)}catch(e){this.completePendingCall(r,!1,e)}return i}receiveByteArray(e,t){this._byteArraysToBeRevived.set(e,t)}processByteArray(e){const t=this._byteArraysToBeRevived.get(e);return t?(this._byteArraysToBeRevived.delete(e),t):null}supplyDotNetStream(e,t){if(this._pendingDotNetToJSStreams.has(e)){const n=this._pendingDotNetToJSStreams.get(e);this._pendingDotNetToJSStreams.delete(e),n.resolve(t)}else{const n=new E;n.resolve(t),this._pendingDotNetToJSStreams.set(e,n)}}getDotNetStreamPromise(e){let t;if(this._pendingDotNetToJSStreams.has(e))t=this._pendingDotNetToJSStreams.get(e).streamPromise,this._pendingDotNetToJSStreams.delete(e);else{const n=new E;this._pendingDotNetToJSStreams.set(e,n),t=n.streamPromise}return t}completePendingCall(e,t,n){if(!this._pendingAsyncCalls.hasOwnProperty(e))throw new Error(`There is no pending async call with ID ${e}.`);const o=this._pendingAsyncCalls[e];delete this._pendingAsyncCalls[e],t?o.resolve(n):o.reject(n)}}function w(e){return e instanceof Error?`${e.message}\n${e.stack}`:e?e.toString():"null"}function b(e,t){const n=h[t];if(n)return n.findFunction(e);throw new Error(`JS object instance with ID ${t} does not exist (has it been disposed?).`)}function _(e){delete h[e]}e.findJSFunction=b,e.disposeJSObjectReferenceById=_;class S{constructor(e,t){this._id=e,this._callDispatcher=t}invokeMethod(e,...t){return this._callDispatcher.invokeDotNetMethod(null,e,this._id,t)}invokeMethodAsync(e,...t){return this._callDispatcher.invokeDotNetMethodAsync(null,e,this._id,t)}dispose(){this._callDispatcher.invokeDotNetMethodAsync(null,"__Dispose",this._id,null).catch((e=>console.error(e)))}serializeAsArg(){return{[o]:this._id}}}e.DotNetObject=S,p((function(e,t){if(t&&"object"==typeof t){if(t.hasOwnProperty(o))return new S(t[o],c);if(t.hasOwnProperty(n)){const e=t[n],o=h[e];if(o)return o.getWrappedObject();throw new Error(`JS object instance with Id '${e}' does not exist. It may have been disposed.`)}if(t.hasOwnProperty(r)){const e=t[r],n=c.processByteArray(e);if(void 0===n)throw new Error(`Byte array index '${e}' does not exist.`);return n}if(t.hasOwnProperty(i)){const e=t[i],n=c.getDotNetStreamPromise(e);return new C(n)}}return t}));class C{constructor(e){this._streamPromise=e}stream(){return this._streamPromise}async arrayBuffer(){return new Response(await this.stream()).arrayBuffer()}}class E{constructor(){this.streamPromise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}function I(e,t){switch(t){case d.Default:return e;case d.JSObjectReference:return f(e);case d.JSStreamReference:return g(e);case d.JSVoidResult:return null;default:throw new Error(`Invalid JS call result type '${t}'.`)}}let k=0;function T(e,t){k=0,c=e;const n=JSON.stringify(t,R);return c=void 0,n}function R(e,t){if(t instanceof S)return t.serializeAsArg();if(t instanceof Uint8Array){c.getDotNetCallDispatcher().sendByteArray(k,t);const e={[r]:k};return k++,e}return t}}(e||(e={})),function(e){e[e.prependFrame=1]="prependFrame",e[e.removeFrame=2]="removeFrame",e[e.setAttribute=3]="setAttribute",e[e.removeAttribute=4]="removeAttribute",e[e.updateText=5]="updateText",e[e.stepIn=6]="stepIn",e[e.stepOut=7]="stepOut",e[e.updateMarkup=8]="updateMarkup",e[e.permutationListEntry=9]="permutationListEntry",e[e.permutationListEnd=10]="permutationListEnd"}(t||(t={})),function(e){e[e.element=1]="element",e[e.text=2]="text",e[e.attribute=3]="attribute",e[e.component=4]="component",e[e.region=5]="region",e[e.elementReferenceCapture=6]="elementReferenceCapture",e[e.markup=8]="markup",e[e.namedEvent=10]="namedEvent"}(o||(o={}));class r{constructor(e,t){this.componentId=e,this.fieldValue=t}static fromEvent(e,t){const n=t.target;if(n instanceof Element){const t=function(e){return e instanceof HTMLInputElement?e.type&&"checkbox"===e.type.toLowerCase()?{value:e.checked}:{value:e.value}:e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement?{value:e.value}:null}(n);if(t)return new r(e,t.value)}return null}}const i=new Map,s=new Map,a=[];function c(e){return i.get(e)}function l(e){const t=i.get(e);return(null==t?void 0:t.browserEventName)||e}function h(e,t){e.forEach((e=>i.set(e,t)))}function d(e){const t=[];for(let n=0;ne.selected)).map((e=>e.value))}}{const e=function(e){return!!e&&"INPUT"===e.tagName&&"checkbox"===e.getAttribute("type")}(t);return{value:e?!!t.checked:t.value}}}}),h(["copy","cut","paste"],{createEventArgs:e=>({type:e.type})}),h(["drag","dragend","dragenter","dragleave","dragover","dragstart","drop"],{createEventArgs:e=>{return{...u(t=e),dataTransfer:t.dataTransfer?{dropEffect:t.dataTransfer.dropEffect,effectAllowed:t.dataTransfer.effectAllowed,files:Array.from(t.dataTransfer.files).map((e=>e.name)),items:Array.from(t.dataTransfer.items).map((e=>({kind:e.kind,type:e.type}))),types:t.dataTransfer.types}:null};var t}}),h(["focus","blur","focusin","focusout"],{createEventArgs:e=>({type:e.type})}),h(["keydown","keyup","keypress"],{createEventArgs:e=>{return{key:(t=e).key,code:t.code,location:t.location,repeat:t.repeat,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,type:t.type};var t}}),h(["contextmenu","click","mouseover","mouseout","mousemove","mousedown","mouseup","mouseleave","mouseenter","dblclick"],{createEventArgs:e=>u(e)}),h(["error"],{createEventArgs:e=>{return{message:(t=e).message,filename:t.filename,lineno:t.lineno,colno:t.colno,type:t.type};var t}}),h(["loadstart","timeout","abort","load","loadend","progress"],{createEventArgs:e=>{return{lengthComputable:(t=e).lengthComputable,loaded:t.loaded,total:t.total,type:t.type};var t}}),h(["touchcancel","touchend","touchmove","touchenter","touchleave","touchstart"],{createEventArgs:e=>{return{detail:(t=e).detail,touches:d(t.touches),targetTouches:d(t.targetTouches),changedTouches:d(t.changedTouches),ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,type:t.type};var t}}),h(["gotpointercapture","lostpointercapture","pointercancel","pointerdown","pointerenter","pointerleave","pointermove","pointerout","pointerover","pointerup"],{createEventArgs:e=>{return{...u(t=e),pointerId:t.pointerId,width:t.width,height:t.height,pressure:t.pressure,tiltX:t.tiltX,tiltY:t.tiltY,pointerType:t.pointerType,isPrimary:t.isPrimary};var t}}),h(["wheel","mousewheel"],{createEventArgs:e=>{return{...u(t=e),deltaX:t.deltaX,deltaY:t.deltaY,deltaZ:t.deltaZ,deltaMode:t.deltaMode};var t}}),h(["cancel","close","toggle"],{createEventArgs:()=>({})});const p=["date","datetime-local","month","time","week"],f=new Map;let g,m,v=0;const y={async add(e,t,n){if(!n)throw new Error("initialParameters must be an object, even if empty.");const o="__bl-dynamic-root:"+(++v).toString();f.set(o,e);const r=await S().invokeMethodAsync("AddRootComponent",t,o),i=new _(r,m[t]);return await i.setParameters(n),i}};function w(e){const t=f.get(e);if(t)return f.delete(e),t}class b{invoke(e){return this._callback(e)}setCallback(t){this._selfJSObjectReference||(this._selfJSObjectReference=e.createJSObjectReference(this)),this._callback=t}getJSObjectReference(){return this._selfJSObjectReference}dispose(){this._selfJSObjectReference&&e.disposeJSObjectReference(this._selfJSObjectReference)}}class _{constructor(e,t){this._jsEventCallbackWrappers=new Map,this._componentId=e;for(const e of t)"eventcallback"===e.type&&this._jsEventCallbackWrappers.set(e.name.toLowerCase(),new b)}setParameters(e){const t={},n=Object.entries(e||{}),o=n.length;for(const[e,o]of n){const n=this._jsEventCallbackWrappers.get(e.toLowerCase());n&&o?(n.setCallback(o),t[e]=n.getJSObjectReference()):t[e]=o}return S().invokeMethodAsync("SetRootComponentParameters",this._componentId,o,t)}async dispose(){if(null!==this._componentId){await S().invokeMethodAsync("RemoveRootComponent",this._componentId),this._componentId=null;for(const e of this._jsEventCallbackWrappers.values())e.dispose()}}}function S(){if(!g)throw new Error("Dynamic root components have not been enabled in this application.");return g}const C=new Map,E=[],I=new Map;function k(t,n,o,r){var i,s;if(C.has(t))throw new Error(`Interop methods are already registered for renderer ${t}`);C.set(t,n),o&&r&&Object.keys(o).length>0&&function(t,n,o){if(g)throw new Error("Dynamic root components have already been enabled.");g=t,m=n;for(const[t,r]of Object.entries(o)){const o=e.findJSFunction(t,0);for(const e of r)o(e,n[e])}}(A(t),o,r),null===(s=null===(i=I.get(t))||void 0===i?void 0:i[0])||void 0===s||s.call(i),function(e){for(const t of E)t(e)}(t)}function T(e){return C.has(e)}function R(e,t,n){return D(e,t.eventHandlerId,(()=>A(e).invokeMethodAsync("DispatchEventAsync",t,n)))}function A(e){const t=C.get(e);if(!t)throw new Error(`No interop methods are registered for renderer ${e}`);return t}let D=(e,t,n)=>n();const x=B(["abort","blur","cancel","canplay","canplaythrough","change","close","cuechange","durationchange","emptied","ended","error","focus","load","loadeddata","loadedmetadata","loadend","loadstart","mouseenter","mouseleave","pointerenter","pointerleave","pause","play","playing","progress","ratechange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeupdate","toggle","unload","volumechange","waiting","DOMNodeInsertedIntoDocument","DOMNodeRemovedFromDocument"]),N={submit:!0},M=B(["click","dblclick","mousedown","mousemove","mouseup"]);class P{constructor(e){this.browserRendererId=e,this.afterClickCallbacks=[];const t=++P.nextEventDelegatorId;this.eventsCollectionKey=`_blazorEvents_${t}`,this.eventInfoStore=new U(this.onGlobalEvent.bind(this))}setListener(e,t,n,o){const r=this.getEventHandlerInfosForElement(e,!0),i=r.getHandler(t);if(i)this.eventInfoStore.update(i.eventHandlerId,n);else{const i={element:e,eventName:t,eventHandlerId:n,renderingComponentId:o};this.eventInfoStore.add(i),r.setHandler(t,i)}}getHandler(e){return this.eventInfoStore.get(e)}removeListener(e){const t=this.eventInfoStore.remove(e);if(t){const e=t.element,n=this.getEventHandlerInfosForElement(e,!1);n&&n.removeHandler(t.eventName)}}notifyAfterClick(e){this.afterClickCallbacks.push(e),this.eventInfoStore.addGlobalListener("click")}setStopPropagation(e,t,n){this.getEventHandlerInfosForElement(e,!0).stopPropagation(t,n)}setPreventDefault(e,t,n){this.getEventHandlerInfosForElement(e,!0).preventDefault(t,n)}onGlobalEvent(e){if(!(e.target instanceof Element))return;this.dispatchGlobalEventToAllElements(e.type,e);const t=(n=e.type,s.get(n));var n;t&&t.forEach((t=>this.dispatchGlobalEventToAllElements(t,e))),"click"===e.type&&this.afterClickCallbacks.forEach((t=>t(e)))}dispatchGlobalEventToAllElements(e,t){const n=t.composedPath();let o=n.shift(),i=null,s=!1;const a=Object.prototype.hasOwnProperty.call(x,e);let l=!1;for(;o;){const u=o,p=this.getEventHandlerInfosForElement(u,!1);if(p){const n=p.getHandler(e);if(n&&(h=u,d=t.type,!((h instanceof HTMLButtonElement||h instanceof HTMLInputElement||h instanceof HTMLTextAreaElement||h instanceof HTMLSelectElement)&&Object.prototype.hasOwnProperty.call(M,d)&&h.disabled))){if(!s){const n=c(e);i=(null==n?void 0:n.createEventArgs)?n.createEventArgs(t):{},s=!0}Object.prototype.hasOwnProperty.call(N,t.type)&&t.preventDefault(),R(this.browserRendererId,{eventHandlerId:n.eventHandlerId,eventName:e,eventFieldInfo:r.fromEvent(n.renderingComponentId,t)},i)}p.stopPropagation(e)&&(l=!0),p.preventDefault(e)&&t.preventDefault()}o=a||l?void 0:n.shift()}var h,d}getEventHandlerInfosForElement(e,t){return Object.prototype.hasOwnProperty.call(e,this.eventsCollectionKey)?e[this.eventsCollectionKey]:t?e[this.eventsCollectionKey]=new L:null}}P.nextEventDelegatorId=0;class U{constructor(e){this.globalListener=e,this.infosByEventHandlerId={},this.countByEventName={},a.push(this.handleEventNameAliasAdded.bind(this))}add(e){if(this.infosByEventHandlerId[e.eventHandlerId])throw new Error(`Event ${e.eventHandlerId} is already tracked`);this.infosByEventHandlerId[e.eventHandlerId]=e,this.addGlobalListener(e.eventName)}get(e){return this.infosByEventHandlerId[e]}addGlobalListener(e){if(e=l(e),Object.prototype.hasOwnProperty.call(this.countByEventName,e))this.countByEventName[e]++;else{this.countByEventName[e]=1;const t=Object.prototype.hasOwnProperty.call(x,e);document.addEventListener(e,this.globalListener,t)}}update(e,t){if(Object.prototype.hasOwnProperty.call(this.infosByEventHandlerId,t))throw new Error(`Event ${t} is already tracked`);const n=this.infosByEventHandlerId[e];delete this.infosByEventHandlerId[e],n.eventHandlerId=t,this.infosByEventHandlerId[t]=n}remove(e){const t=this.infosByEventHandlerId[e];if(t){delete this.infosByEventHandlerId[e];const n=l(t.eventName);0==--this.countByEventName[n]&&(delete this.countByEventName[n],document.removeEventListener(n,this.globalListener))}return t}handleEventNameAliasAdded(e,t){if(Object.prototype.hasOwnProperty.call(this.countByEventName,e)){const n=this.countByEventName[e];delete this.countByEventName[e],document.removeEventListener(e,this.globalListener),this.addGlobalListener(t),this.countByEventName[t]+=n-1}}}class L{constructor(){this.handlers={},this.preventDefaultFlags=null,this.stopPropagationFlags=null}getHandler(e){return Object.prototype.hasOwnProperty.call(this.handlers,e)?this.handlers[e]:null}setHandler(e,t){this.handlers[e]=t}removeHandler(e){delete this.handlers[e]}preventDefault(e,t){return void 0!==t&&(this.preventDefaultFlags=this.preventDefaultFlags||{},this.preventDefaultFlags[e]=t),!!this.preventDefaultFlags&&this.preventDefaultFlags[e]}stopPropagation(e,t){return void 0!==t&&(this.stopPropagationFlags=this.stopPropagationFlags||{},this.stopPropagationFlags[e]=t),!!this.stopPropagationFlags&&this.stopPropagationFlags[e]}}function B(e){const t={};return e.forEach((e=>{t[e]=!0})),t}const O=Symbol(),F=Symbol(),$=Symbol();function H(e){const{start:t,end:n}=e,o=t[$];if(o){if(o!==e)throw new Error("The start component comment was already associated with another component descriptor.");return t}const r=t.parentNode;if(!r)throw new Error(`Comment not connected to the DOM ${t.textContent}`);const i=W(r,!0),s=Y(i);t[F]=i,t[$]=e;const a=W(t);if(n){const e=Y(a),o=Array.prototype.indexOf.call(s,a)+1;let r=null;for(;r!==n;){const n=s.splice(o,1)[0];if(!n)throw new Error("Could not find the end component comment in the parent logical node list");n[F]=t,e.push(n),r=n}}return a}function W(e,t){if(O in e)return e;const n=[];if(e.childNodes.length>0){if(!t)throw new Error("New logical elements must start empty, or allowExistingContents must be true");e.childNodes.forEach((t=>{const o=W(t,!0);o[F]=e,n.push(o)}))}return e[O]=n,e}function j(e){const t=Y(e);for(;t.length;)J(e,0)}function z(e,t){const n=document.createComment("!");return q(n,e,t),n}function q(e,t,n){const o=e;let r=e;if(e instanceof Comment){const t=Y(o);if((null==t?void 0:t.length)>0){const t=oe(o),n=new Range;n.setStartBefore(e),n.setEndAfter(t),r=n.extractContents()}}const i=K(o);if(i){const e=Y(i),t=Array.prototype.indexOf.call(e,o);e.splice(t,1),delete o[F]}const s=Y(t);if(n0;)J(n,0)}const o=n;o.parentNode.removeChild(o)}function K(e){return e[F]||null}function V(e,t){return Y(e)[t]}function X(e){return e[$]||null}function G(e){const t=te(e);return"http://www.w3.org/2000/svg"===t.namespaceURI&&"foreignObject"!==t.tagName}function Y(e){return e[O]}function Q(e){const t=Y(K(e));return t[Array.prototype.indexOf.call(t,e)+1]||null}function Z(e){return O in e}function ee(e,t){const n=Y(e);t.forEach((e=>{e.moveRangeStart=n[e.fromSiblingIndex],e.moveRangeEnd=oe(e.moveRangeStart)})),t.forEach((t=>{const o=document.createComment("marker");t.moveToBeforeMarker=o;const r=n[t.toSiblingIndex+1];r?r.parentNode.insertBefore(o,r):ne(o,e)})),t.forEach((e=>{const t=e.moveToBeforeMarker,n=t.parentNode,o=e.moveRangeStart,r=e.moveRangeEnd;let i=o;for(;i;){const e=i.nextSibling;if(n.insertBefore(i,t),i===r)break;i=e}n.removeChild(t)})),t.forEach((e=>{n[e.toSiblingIndex]=e.moveRangeStart}))}function te(e){if(e instanceof Element||e instanceof DocumentFragment)return e;if(e instanceof Comment)return e.parentNode;throw new Error("Not a valid logical element")}function ne(e,t){if(t instanceof Element||t instanceof DocumentFragment)t.appendChild(e);else{if(!(t instanceof Comment))throw new Error(`Cannot append node because the parent is not a valid logical element. Parent: ${t}`);{const n=Q(t);n?n.parentNode.insertBefore(e,n):ne(e,K(t))}}}function oe(e){if(e instanceof Element||e instanceof DocumentFragment)return e;const t=Q(e);if(t)return t.previousSibling;{const t=K(e);return t instanceof Element||t instanceof DocumentFragment?t.lastChild:oe(t)}}function re(e){return`_bl_${e}`}const ie="__internalId";e.attachReviver(((e,t)=>t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,ie)&&"string"==typeof t[ie]?function(e){const t=`[${re(e)}]`;return document.querySelector(t)}(t[ie]):t));const se="_blazorDeferredValue";function ae(e){e instanceof HTMLOptionElement?de(e):se in e&&he(e,e[se])}function ce(e){return"select-multiple"===e.type}function le(e,t){e.value=t||""}function he(e,t){e instanceof HTMLSelectElement?ce(e)?function(e,t){t||(t=[]);for(let n=0;n{Be()&&Ne(e,(e=>{Ve(e,!0,!1)}))}))}getRootComponentCount(){return this.rootComponentIds.size}attachRootComponentToLogicalElement(e,t,n){if(we(t))throw new Error(`Root component '${e}' could not be attached because its target element is already associated with a root component`);n&&(t=z(t,Y(t).length)),ye(t,!0),this.attachComponentToElement(e,t),this.rootComponentIds.add(e),fe.add(t)}updateComponent(e,t,n,o){var r;const i=this.childComponentLocations[t];if(!i)throw new Error(`No element is currently associated with component ${t}`);fe.delete(i)&&(j(i),i instanceof Comment&&(i.textContent="!"));const s=null===(r=te(i))||void 0===r?void 0:r.getRootNode(),a=s&&s.activeElement;this.applyEdits(e,t,i,0,n,o),a instanceof HTMLElement&&s&&s.activeElement!==a&&a.focus()}disposeComponent(e){if(this.rootComponentIds.delete(e)){const t=this.childComponentLocations[e];ye(t,!1),!0===t[me]?fe.add(t):j(t)}delete this.childComponentLocations[e]}disposeEventHandler(e){this.eventDelegator.removeListener(e)}attachComponentToElement(e,t){this.childComponentLocations[e]=t}applyEdits(e,n,o,r,i,s){let a,c=0,l=r;const h=e.arrayBuilderSegmentReader,d=e.editReader,u=e.frameReader,p=h.values(i),f=h.offset(i),g=f+h.count(i);for(let i=f;i{const t=document.createElement("script");t.textContent=e.textContent,e.getAttributeNames().forEach((n=>{t.setAttribute(n,e.getAttribute(n))})),e.parentNode.replaceChild(t,e)})),ue.content));var s;let a=0;for(;i.firstChild;)q(i.firstChild,r,a++)}applyAttribute(e,t,n,o){const r=e.frameReader,i=r.attributeName(o),s=r.attributeEventHandlerId(o);if(s){const e=Se(i);return void this.eventDelegator.setListener(n,e,s,t)}const a=r.attributeValue(o);this.setOrRemoveAttributeOrProperty(n,i,a)}insertFrameRange(e,t,n,o,r,i,s){const a=o;for(let a=i;a{Ze(t,e)})},enableNavigationInterception:function(e){if(void 0!==Ee&&Ee!==e)throw new Error("Only one interactive runtime may enable navigation interception at a time.");Ee=e},setHasLocationChangingListeners:function(e,t){const n=We.get(e);if(!n)throw new Error(`Renderer with ID '${e}' is not listening for navigation events`);n.hasLocationChangingEventListeners=t},endLocationChanging:function(e,t){ze&&e===He&&(ze(t),ze=null)},navigateTo:function(e,t){Ke(e,t,!0)},refresh:function(e){!e&&Pe()?Ue(location.href,!0):location.reload()},getBaseURI:()=>document.baseURI,getLocationHref:()=>location.href,scrollToElement:Je};function Je(e){const t=document.getElementById(e);return!!t&&(t.scrollIntoView(),!0)}function Ke(e,t,n=!1){const o=Le(e),r=nt();if(t.forceLoad||!Me(o)||"serverside-fullpageload"===r)!function(e,t){if(location.href===e){const t=e+"?";history.replaceState(null,"",t),location.replace(e)}else t?location.replace(e):location.href=e}(e,t.replaceHistoryEntry);else if("clientside-router"===r)Ve(o,!1,t.replaceHistoryEntry,t.historyEntryState,n);else{if("serverside-enhanced"!==r)throw new Error(`Unsupported page load mechanism: ${r}`);Ue(o,t.replaceHistoryEntry)}}async function Ve(e,t,n,o=void 0,r=!1){if(Ye(),function(e){const t=e.indexOf("#");return t>-1&&location.href.replace(location.hash,"")===e.substring(0,t)}(e))return void function(e,t,n){Xe(e,t,n);const o=e.indexOf("#");o!==e.length-1&&Je(e.substring(o+1))}(e,n,o);const i=tt();(r||!(null==i?void 0:i.hasLocationChangingEventListeners)||await Qe(e,o,t,i))&&(Re=!0,Xe(e,n,o),await Ze(t))}function Xe(e,t,n=void 0){t?history.replaceState({userState:n,_index:$e},"",e):($e++,history.pushState({userState:n,_index:$e},"",e))}function Ge(e){return new Promise((t=>{const n=je;je=()=>{je=n,t()},history.go(e)}))}function Ye(){ze&&(ze(!1),ze=null)}function Qe(e,t,n,o){return new Promise((r=>{Ye(),He++,ze=r,o.locationChanging(He,e,t,n)}))}async function Ze(e,t){const n=null!=t?t:location.href;await Promise.all(Array.from(We,(async([t,o])=>{var r;T(t)&&await o.locationChanged(n,null===(r=history.state)||void 0===r?void 0:r.userState,e)})))}async function et(e){var t,n;je&&"serverside-enhanced"!==nt()&&await je(e),$e=null!==(n=null===(t=history.state)||void 0===t?void 0:t._index)&&void 0!==n?n:0}function tt(){const e=Oe();if(void 0!==e)return We.get(e)}function nt(){return Be()?"clientside-router":Pe()?"serverside-enhanced":window.Blazor._internal.isBlazorWeb?"serverside-fullpageload":"clientside-router"}const ot={focus:function(e,t){if(e instanceof HTMLElement)e.focus({preventScroll:t});else{if(!(e instanceof SVGElement))throw new Error("Unable to focus an invalid element.");if(!e.hasAttribute("tabindex"))throw new Error("Unable to focus an SVG element that does not have a tabindex.");e.focus({preventScroll:t})}},focusBySelector:function(e,t){const n=document.querySelector(e);n&&(n.hasAttribute("tabindex")||(n.tabIndex=-1),n.focus({preventScroll:!0}))}},rt={init:function(e,t,n,o=50){const r=st(t);(r||document.documentElement).style.overflowAnchor="none";const i=document.createRange();u(n.parentElement)&&(t.style.display="table-row",n.style.display="table-row");const s=new IntersectionObserver((function(o){o.forEach((o=>{var r;if(!o.isIntersecting)return;i.setStartAfter(t),i.setEndBefore(n);const s=i.getBoundingClientRect().height,a=null===(r=o.rootBounds)||void 0===r?void 0:r.height;o.target===t?e.invokeMethodAsync("OnSpacerBeforeVisible",o.intersectionRect.top-o.boundingClientRect.top,s,a):o.target===n&&n.offsetHeight>0&&e.invokeMethodAsync("OnSpacerAfterVisible",o.boundingClientRect.bottom-o.intersectionRect.bottom,s,a)}))}),{root:r,rootMargin:`${o}px`});s.observe(t),s.observe(n);const a=d(t),c=d(n),{observersByDotNetObjectId:l,id:h}=at(e);function d(e){const t={attributes:!0},n=new MutationObserver(((n,o)=>{u(e.parentElement)&&(o.disconnect(),e.style.display="table-row",o.observe(e,t)),s.unobserve(e),s.observe(e)}));return n.observe(e,t),n}function u(e){return null!==e&&(e instanceof HTMLTableElement&&""===e.style.display||"table"===e.style.display||e instanceof HTMLTableSectionElement&&""===e.style.display||"table-row-group"===e.style.display)}l[h]={intersectionObserver:s,mutationObserverBefore:a,mutationObserverAfter:c}},dispose:function(e){const{observersByDotNetObjectId:t,id:n}=at(e),o=t[n];o&&(o.intersectionObserver.disconnect(),o.mutationObserverBefore.disconnect(),o.mutationObserverAfter.disconnect(),e.dispose(),delete t[n])}},it=Symbol();function st(e){return e&&e!==document.body&&e!==document.documentElement?"visible"!==getComputedStyle(e).overflowY?e:st(e.parentElement):null}function at(e){var t;const n=e._callDispatcher,o=e._id;return null!==(t=n[it])&&void 0!==t||(n[it]={}),{observersByDotNetObjectId:n[it],id:o}}const ct={getAndRemoveExistingTitle:function(){var e;const t=document.head?document.head.getElementsByTagName("title"):[];if(0===t.length)return null;let n=null;for(let o=t.length-1;o>=0;o--){const r=t[o],i=r.previousSibling;i instanceof Comment&&null!==K(i)||(null===n&&(n=r.textContent),null===(e=r.parentNode)||void 0===e||e.removeChild(r))}return n}},lt={init:function(e,t){t._blazorInputFileNextFileId=0,t.addEventListener("click",(function(){t.value=""})),t.addEventListener("change",(function(){t._blazorFilesById={};const n=Array.prototype.map.call(t.files,(function(e){const n={id:++t._blazorInputFileNextFileId,lastModified:new Date(e.lastModified).toISOString(),name:e.name,size:e.size,contentType:e.type,readPromise:void 0,arrayBuffer:void 0,blob:e};return t._blazorFilesById[n.id]=n,n}));e.invokeMethodAsync("NotifyChange",n)}))},toImageFile:async function(e,t,n,o,r){const i=ht(e,t),s=await new Promise((function(e){const t=new Image;t.onload=function(){URL.revokeObjectURL(t.src),e(t)},t.onerror=function(){t.onerror=null,URL.revokeObjectURL(t.src)},t.src=URL.createObjectURL(i.blob)})),a=await new Promise((function(e){var t;const i=Math.min(1,o/s.width),a=Math.min(1,r/s.height),c=Math.min(i,a),l=document.createElement("canvas");l.width=Math.round(s.width*c),l.height=Math.round(s.height*c),null===(t=l.getContext("2d"))||void 0===t||t.drawImage(s,0,0,l.width,l.height),l.toBlob(e,n)})),c={id:++e._blazorInputFileNextFileId,lastModified:i.lastModified,name:i.name,size:(null==a?void 0:a.size)||0,contentType:n,blob:a||i.blob};return e._blazorFilesById[c.id]=c,c},readFileData:async function(e,t){return ht(e,t).blob}};function ht(e,t){const n=e._blazorFilesById[t];if(!n)throw new Error(`There is no file with ID ${t}. The file list may have changed. See https://aka.ms/aspnet/blazor-input-file-multiple-selections.`);return n}const dt=new Set,ut={enableNavigationPrompt:function(e){0===dt.size&&window.addEventListener("beforeunload",pt),dt.add(e)},disableNavigationPrompt:function(e){dt.delete(e),0===dt.size&&window.removeEventListener("beforeunload",pt)}};function pt(e){e.preventDefault(),e.returnValue=!0}async function ft(e,t,n){return e instanceof Blob?await async function(e,t,n){const o=e.slice(t,t+n),r=await o.arrayBuffer();return new Uint8Array(r)}(e,t,n):function(e,t,n){return new Uint8Array(e.buffer,e.byteOffset+t,n)}(e,t,n)}const gt=new Map,mt={navigateTo:function(e,t,n=!1){Ke(e,t instanceof Object?t:{forceLoad:t,replaceHistoryEntry:n})},registerCustomEventType:function(e,t){if(!t)throw new Error("The options parameter is required.");if(i.has(e))throw new Error(`The event '${e}' is already registered.`);if(t.browserEventName){const n=s.get(t.browserEventName);n?n.push(e):s.set(t.browserEventName,[e]),a.forEach((n=>n(e,t.browserEventName)))}i.set(e,t)},rootComponents:y,runtime:{},_internal:{navigationManager:qe,domWrapper:ot,Virtualize:rt,PageTitle:ct,InputFile:lt,NavigationLock:ut,getJSDataStreamChunk:ft,attachWebRendererInterop:k}};var vt;window.Blazor=mt,function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Information=2]="Information",e[e.Warning=3]="Warning",e[e.Error=4]="Error",e[e.Critical=5]="Critical",e[e.None=6]="None"}(vt||(vt={}));class yt{log(e,t){}}yt.instance=new yt;class wt{constructor(e){this.minLevel=e}log(e,t){if(e>=this.minLevel){const n=`[${(new Date).toISOString()}] ${vt[e]}: ${t}`;switch(e){case vt.Critical:case vt.Error:console.error(n);break;case vt.Warning:console.warn(n);break;case vt.Information:console.info(n);break;default:console.log(n)}}}}function bt(e,t){switch(t){case"webassembly":return kt(e,"webassembly");case"server":return function(e){return kt(e,"server").sort(((e,t)=>e.sequence-t.sequence))}(e);case"auto":return kt(e,"auto")}}const _t=/^\s*Blazor-Server-Component-State:(?[a-zA-Z0-9+/=]+)$/,St=/^\s*Blazor-WebAssembly-Component-State:(?[a-zA-Z0-9+/=]+)$/,Ct=/^\s*Blazor-Web-Initializers:(?[a-zA-Z0-9+/=]+)$/;function Et(e){return It(e,_t)}function It(e,t,n="state"){var o;if(e.nodeType===Node.COMMENT_NODE){const r=e.textContent||"",i=t.exec(r),s=i&&i.groups&&i.groups[n];return s&&(null===(o=e.parentNode)||void 0===o||o.removeChild(e)),s}if(!e.hasChildNodes())return;const r=e.childNodes;for(let e=0;e.*)$/);function Rt(e,t){const n=e.currentElement;var o,r,i;if(n&&n.nodeType===Node.COMMENT_NODE&&n.textContent){const s=Tt.exec(n.textContent),a=s&&s.groups&&s.groups.descriptor;if(!a)return;!function(e){if(e.parentNode instanceof Document)throw new Error("Root components cannot be marked as interactive. The element must be rendered statically so that scripts are not evaluated multiple times.")}(n);try{const s=function(e){const t=JSON.parse(e),{type:n}=t;if("server"!==n&&"webassembly"!==n&&"auto"!==n)throw new Error(`Invalid component type '${n}'.`);return t}(a),c=function(e,t,n){const{prerenderId:o}=e;if(o){for(;n.next()&&n.currentElement;){const e=n.currentElement;if(e.nodeType!==Node.COMMENT_NODE)continue;if(!e.textContent)continue;const t=Tt.exec(e.textContent),r=t&&t[1];if(r)return Nt(r,o),e}throw new Error(`Could not find an end component comment for '${t}'.`)}}(s,n,e);if(t!==s.type)return;switch(s.type){case"webassembly":return r=n,i=c,xt(o=s),{...o,uniqueId:At++,start:r,end:i};case"server":return function(e,t,n){return Dt(e),{...e,uniqueId:At++,start:t,end:n}}(s,n,c);case"auto":return function(e,t,n){return Dt(e),xt(e),{...e,uniqueId:At++,start:t,end:n}}(s,n,c)}}catch(e){throw new Error(`Found malformed component comment at ${n.textContent}`)}}}let At=0;function Dt(e){const{descriptor:t,sequence:n}=e;if(!t)throw new Error("descriptor must be defined when using a descriptor.");if(void 0===n)throw new Error("sequence must be defined when using a descriptor.");if(!Number.isInteger(n))throw new Error(`Error parsing the sequence '${n}' for component '${JSON.stringify(e)}'`)}function xt(e){const{assembly:t,typeName:n}=e;if(!t)throw new Error("assembly must be defined when using a descriptor.");if(!n)throw new Error("typeName must be defined when using a descriptor.");e.parameterDefinitions=e.parameterDefinitions&&atob(e.parameterDefinitions),e.parameterValues=e.parameterValues&&atob(e.parameterValues)}function Nt(e,t){const n=JSON.parse(e);if(1!==Object.keys(n).length)throw new Error(`Invalid end of component comment: '${e}'`);const o=n.prerenderId;if(!o)throw new Error(`End of component comment must have a value for the prerendered property: '${e}'`);if(o!==t)throw new Error(`End of component comment prerendered property must match the start comment prerender id: '${t}', '${o}'`)}class Mt{constructor(e){this.childNodes=e,this.currentIndex=-1,this.length=e.length}next(){return this.currentIndex++,this.currentIndex{n+=`0x${e<16?"0":""}${e.toString(16)} `})),n.substr(0,n.length-1)}(e)}'`)):"string"==typeof e&&(n=`String data of length ${e.length}`,t&&(n+=`. Content: '${e}'`)),n}function jt(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}async function zt(e,t,n,o,r,i){const s={},[a,c]=Kt();s[a]=c,e.log(Bt.Trace,`(${t} transport) sending data. ${Wt(r,i.logMessageContent)}.`);const l=jt(r)?"arraybuffer":"text",h=await n.post(o,{content:r,headers:{...s,...i.headers},responseType:l,timeout:i.timeout,withCredentials:i.withCredentials});e.log(Bt.Trace,`(${t} transport) request complete. Response status: ${h.statusCode}.`)}class qt{constructor(e,t){this._subject=e,this._observer=t}dispose(){const e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),0===this._subject.observers.length&&this._subject.cancelCallback&&this._subject.cancelCallback().catch((e=>{}))}}class Jt{constructor(e){this._minLevel=e,this.out=console}log(e,t){if(e>=this._minLevel){const n=`[${(new Date).toISOString()}] ${Bt[e]}: ${t}`;switch(e){case Bt.Critical:case Bt.Error:this.out.error(n);break;case Bt.Warning:this.out.warn(n);break;case Bt.Information:this.out.info(n);break;default:this.out.log(n)}}}}function Kt(){let e="X-SignalR-User-Agent";return Ht.isNode&&(e="User-Agent"),[e,Vt(Ft,Xt(),Ht.isNode?"NodeJS":"Browser",Gt())]}function Vt(e,t,n,o){let r="Microsoft SignalR/";const i=e.split(".");return r+=`${i[0]}.${i[1]}`,r+=` (${e}; `,r+=t&&""!==t?`${t}; `:"Unknown OS; ",r+=`${n}`,r+=o?`; ${o}`:"; Unknown Runtime Version",r+=")",r}function Xt(){if(!Ht.isNode)return"";switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}}function Gt(){if(Ht.isNode)return process.versions.node}function Yt(e){return e.stack?e.stack:e.message?e.message:`${e}`}class Qt{writeHandshakeRequest(e){return Lt.write(JSON.stringify(e))}parseHandshakeResponse(e){let t,n;if(jt(e)){const o=new Uint8Array(e),r=o.indexOf(Lt.RecordSeparatorCode);if(-1===r)throw new Error("Message is incomplete.");const i=r+1;t=String.fromCharCode.apply(null,Array.prototype.slice.call(o.slice(0,i))),n=o.byteLength>i?o.slice(i).buffer:null}else{const o=e,r=o.indexOf(Lt.RecordSeparator);if(-1===r)throw new Error("Message is incomplete.");const i=r+1;t=o.substring(0,i),n=o.length>i?o.substring(i):null}const o=Lt.parse(t),r=JSON.parse(o[0]);if(r.type)throw new Error("Expected a handshake response from the server.");return[n,r]}}class Zt extends Error{constructor(e,t){const n=new.target.prototype;super(`${e}: Status code '${t}'`),this.statusCode=t,this.__proto__=n}}class en extends Error{constructor(e="A timeout occurred."){const t=new.target.prototype;super(e),this.__proto__=t}}class tn extends Error{constructor(e="An abort occurred."){const t=new.target.prototype;super(e),this.__proto__=t}}class nn extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.transport=t,this.errorType="UnsupportedTransportError",this.__proto__=n}}class on extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.transport=t,this.errorType="DisabledTransportError",this.__proto__=n}}class rn extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.transport=t,this.errorType="FailedToStartTransportError",this.__proto__=n}}class sn extends Error{constructor(e){const t=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=t}}class an extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.innerErrors=t,this.__proto__=n}}var cn,ln;!function(e){e[e.Invocation=1]="Invocation",e[e.StreamItem=2]="StreamItem",e[e.Completion=3]="Completion",e[e.StreamInvocation=4]="StreamInvocation",e[e.CancelInvocation=5]="CancelInvocation",e[e.Ping=6]="Ping",e[e.Close=7]="Close",e[e.Ack=8]="Ack",e[e.Sequence=9]="Sequence"}(cn||(cn={}));class hn{constructor(){this.observers=[]}next(e){for(const t of this.observers)t.next(e)}error(e){for(const t of this.observers)t.error&&t.error(e)}complete(){for(const e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new qt(this,e)}}class dn{constructor(e,t,n){this._bufferSize=1e5,this._messages=[],this._totalMessageCount=0,this._waitForSequenceMessage=!1,this._nextReceivingSequenceId=1,this._latestReceivedSequenceId=0,this._bufferedByteCount=0,this._reconnectInProgress=!1,this._protocol=e,this._connection=t,this._bufferSize=n}async _send(e){const t=this._protocol.writeMessage(e);let n=Promise.resolve();if(this._isInvocationMessage(e)){this._totalMessageCount++;let e=()=>{},o=()=>{};jt(t)?this._bufferedByteCount+=t.byteLength:this._bufferedByteCount+=t.length,this._bufferedByteCount>=this._bufferSize&&(n=new Promise(((t,n)=>{e=t,o=n}))),this._messages.push(new un(t,this._totalMessageCount,e,o))}try{this._reconnectInProgress||await this._connection.send(t)}catch{this._disconnected()}await n}_ack(e){let t=-1;for(let n=0;nthis._nextReceivingSequenceId?this._connection.stop(new Error("Sequence ID greater than amount of messages we've received.")):this._nextReceivingSequenceId=e.sequenceId}_disconnected(){this._reconnectInProgress=!0,this._waitForSequenceMessage=!0}async _resend(){const e=0!==this._messages.length?this._messages[0]._id:this._totalMessageCount+1;await this._connection.send(this._protocol.writeMessage({type:cn.Sequence,sequenceId:e}));const t=this._messages;for(const e of t)await this._connection.send(e._message);this._reconnectInProgress=!1}_dispose(e){null!=e||(e=new Error("Unable to reconnect to server."));for(const t of this._messages)t._rejector(e)}_isInvocationMessage(e){switch(e.type){case cn.Invocation:case cn.StreamItem:case cn.Completion:case cn.StreamInvocation:case cn.CancelInvocation:return!0;case cn.Close:case cn.Sequence:case cn.Ping:case cn.Ack:return!1}}_ackTimer(){void 0===this._ackTimerHandle&&(this._ackTimerHandle=setTimeout((async()=>{try{this._reconnectInProgress||await this._connection.send(this._protocol.writeMessage({type:cn.Ack,sequenceId:this._latestReceivedSequenceId}))}catch{}clearTimeout(this._ackTimerHandle),this._ackTimerHandle=void 0}),1e3))}}class un{constructor(e,t,n,o){this._message=e,this._id=t,this._resolver=n,this._rejector=o}}!function(e){e.Disconnected="Disconnected",e.Connecting="Connecting",e.Connected="Connected",e.Disconnecting="Disconnecting",e.Reconnecting="Reconnecting"}(ln||(ln={}));class pn{static create(e,t,n,o,r,i,s){return new pn(e,t,n,o,r,i,s)}constructor(e,t,n,o,r,i,s){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(Bt.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")},$t.isRequired(e,"connection"),$t.isRequired(t,"logger"),$t.isRequired(n,"protocol"),this.serverTimeoutInMilliseconds=null!=r?r:3e4,this.keepAliveIntervalInMilliseconds=null!=i?i:15e3,this._statefulReconnectBufferSize=null!=s?s:1e5,this._logger=t,this._protocol=n,this.connection=e,this._reconnectPolicy=o,this._handshakeProtocol=new Qt,this.connection.onreceive=e=>this._processIncomingData(e),this.connection.onclose=e=>this._connectionClosed(e),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=ln.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:cn.Ping})}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(e){if(this._connectionState!==ln.Disconnected&&this._connectionState!==ln.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}async _startWithStateTransitions(){if(this._connectionState!==ln.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=ln.Connecting,this._logger.log(Bt.Debug,"Starting HubConnection.");try{await this._startInternal(),Ht.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=ln.Connected,this._connectionStarted=!0,this._logger.log(Bt.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=ln.Disconnected,this._logger.log(Bt.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}}async _startInternal(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;const e=new Promise(((e,t)=>{this._handshakeResolver=e,this._handshakeRejecter=t}));await this.connection.start(this._protocol.transferFormat);try{let t=this._protocol.version;this.connection.features.reconnect||(t=1);const n={protocol:this._protocol.name,version:t};if(this._logger.log(Bt.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(n)),this._logger.log(Bt.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await e,this._stopDuringStartError)throw this._stopDuringStartError;!!this.connection.features.reconnect&&(this._messageBuffer=new dn(this._protocol,this.connection,this._statefulReconnectBufferSize),this.connection.features.disconnected=this._messageBuffer._disconnected.bind(this._messageBuffer),this.connection.features.resend=()=>{if(this._messageBuffer)return this._messageBuffer._resend()}),this.connection.features.inherentKeepAlive||await this._sendMessage(this._cachedPingMessage)}catch(e){throw this._logger.log(Bt.Debug,`Hub handshake failed with error '${e}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),await this.connection.stop(e),e}}async stop(){const e=this._startPromise;this.connection.features.reconnect=!1,this._stopPromise=this._stopInternal(),await this._stopPromise;try{await e}catch(e){}}_stopInternal(e){if(this._connectionState===ln.Disconnected)return this._logger.log(Bt.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this._connectionState===ln.Disconnecting)return this._logger.log(Bt.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;const t=this._connectionState;return this._connectionState=ln.Disconnecting,this._logger.log(Bt.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(Bt.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(t===ln.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new tn("The connection was stopped before the hub handshake could complete."),this.connection.stop(e))}async _sendCloseMessage(){try{await this._sendWithProtocol(this._createCloseMessage())}catch{}}stream(e,...t){const[n,o]=this._replaceStreamingParams(t),r=this._createStreamInvocation(e,t,o);let i;const s=new hn;return s.cancelCallback=()=>{const e=this._createCancelInvocation(r.invocationId);return delete this._callbacks[r.invocationId],i.then((()=>this._sendWithProtocol(e)))},this._callbacks[r.invocationId]=(e,t)=>{t?s.error(t):e&&(e.type===cn.Completion?e.error?s.error(new Error(e.error)):s.complete():s.next(e.item))},i=this._sendWithProtocol(r).catch((e=>{s.error(e),delete this._callbacks[r.invocationId]})),this._launchStreams(n,i),s}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._messageBuffer?this._messageBuffer._send(e):this._sendMessage(this._protocol.writeMessage(e))}send(e,...t){const[n,o]=this._replaceStreamingParams(t),r=this._sendWithProtocol(this._createInvocation(e,t,!0,o));return this._launchStreams(n,r),r}invoke(e,...t){const[n,o]=this._replaceStreamingParams(t),r=this._createInvocation(e,t,!1,o);return new Promise(((e,t)=>{this._callbacks[r.invocationId]=(n,o)=>{o?t(o):n&&(n.type===cn.Completion?n.error?t(new Error(n.error)):e(n.result):t(new Error(`Unexpected message type: ${n.type}`)))};const o=this._sendWithProtocol(r).catch((e=>{t(e),delete this._callbacks[r.invocationId]}));this._launchStreams(n,o)}))}on(e,t){e&&t&&(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),-1===this._methods[e].indexOf(t)&&this._methods[e].push(t))}off(e,t){if(!e)return;e=e.toLowerCase();const n=this._methods[e];if(n)if(t){const o=n.indexOf(t);-1!==o&&(n.splice(o,1),0===n.length&&delete this._methods[e])}else delete this._methods[e]}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(e=this._processHandshakeResponse(e),this._receivedHandshakeResponse=!0),e){const t=this._protocol.parseMessages(e,this._logger);for(const e of t)if(!this._messageBuffer||this._messageBuffer._shouldProcessMessage(e))switch(e.type){case cn.Invocation:this._invokeClientMethod(e);break;case cn.StreamItem:case cn.Completion:{const t=this._callbacks[e.invocationId];if(t){e.type===cn.Completion&&delete this._callbacks[e.invocationId];try{t(e)}catch(e){this._logger.log(Bt.Error,`Stream callback threw error: ${Yt(e)}`)}}break}case cn.Ping:break;case cn.Close:{this._logger.log(Bt.Information,"Close message received from server.");const t=e.error?new Error("Server returned an error on close: "+e.error):void 0;!0===e.allowReconnect?this.connection.stop(t):this._stopPromise=this._stopInternal(t);break}case cn.Ack:this._messageBuffer&&this._messageBuffer._ack(e);break;case cn.Sequence:this._messageBuffer&&this._messageBuffer._resetSequence(e);break;default:this._logger.log(Bt.Warning,`Invalid message type: ${e.type}.`)}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let t,n;try{[n,t]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(e){const t="Error parsing handshake response: "+e;this._logger.log(Bt.Error,t);const n=new Error(t);throw this._handshakeRejecter(n),n}if(t.error){const e="Server returned handshake error: "+t.error;this._logger.log(Bt.Error,e);const n=new Error(e);throw this._handshakeRejecter(n),n}return this._logger.log(Bt.Debug,"Server handshake complete."),this._handshakeResolver(),n}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=(new Date).getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if(!(this.connection.features&&this.connection.features.inherentKeepAlive||(this._timeoutHandle=setTimeout((()=>this.serverTimeout()),this.serverTimeoutInMilliseconds),void 0!==this._pingServerHandle))){let e=this._nextKeepAlive-(new Date).getTime();e<0&&(e=0),this._pingServerHandle=setTimeout((async()=>{if(this._connectionState===ln.Connected)try{await this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}}),e)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}async _invokeClientMethod(e){const t=e.target.toLowerCase(),n=this._methods[t];if(!n)return this._logger.log(Bt.Warning,`No client method with the name '${t}' found.`),void(e.invocationId&&(this._logger.log(Bt.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),await this._sendWithProtocol(this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null))));const o=n.slice(),r=!!e.invocationId;let i,s,a;for(const n of o)try{const o=i;i=await n.apply(this,e.arguments),r&&i&&o&&(this._logger.log(Bt.Error,`Multiple results provided for '${t}'. Sending error to server.`),a=this._createCompletionMessage(e.invocationId,"Client provided multiple results.",null)),s=void 0}catch(e){s=e,this._logger.log(Bt.Error,`A callback for the method '${t}' threw error '${e}'.`)}a?await this._sendWithProtocol(a):r?(s?a=this._createCompletionMessage(e.invocationId,`${s}`,null):void 0!==i?a=this._createCompletionMessage(e.invocationId,null,i):(this._logger.log(Bt.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),a=this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)),await this._sendWithProtocol(a)):i&&this._logger.log(Bt.Error,`Result given for '${t}' method but server is not expecting a result.`)}_connectionClosed(e){this._logger.log(Bt.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new tn("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===ln.Disconnecting?this._completeClose(e):this._connectionState===ln.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===ln.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=ln.Disconnected,this._connectionStarted=!1,this._messageBuffer&&(this._messageBuffer._dispose(null!=e?e:new Error("Connection closed.")),this._messageBuffer=void 0),Ht.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach((t=>t.apply(this,[e])))}catch(t){this._logger.log(Bt.Error,`An onclose callback called with error '${e}' threw error '${t}'.`)}}}async _reconnect(e){const t=Date.now();let n=0,o=void 0!==e?e:new Error("Attempting to reconnect due to a unknown error."),r=this._getNextRetryDelay(n++,0,o);if(null===r)return this._logger.log(Bt.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this._completeClose(e);if(this._connectionState=ln.Reconnecting,e?this._logger.log(Bt.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(Bt.Information,"Connection reconnecting."),0!==this._reconnectingCallbacks.length){try{this._reconnectingCallbacks.forEach((t=>t.apply(this,[e])))}catch(t){this._logger.log(Bt.Error,`An onreconnecting callback called with error '${e}' threw error '${t}'.`)}if(this._connectionState!==ln.Reconnecting)return void this._logger.log(Bt.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;null!==r;){if(this._logger.log(Bt.Information,`Reconnect attempt number ${n} will start in ${r} ms.`),await new Promise((e=>{this._reconnectDelayHandle=setTimeout(e,r)})),this._reconnectDelayHandle=void 0,this._connectionState!==ln.Reconnecting)return void this._logger.log(Bt.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this._startInternal(),this._connectionState=ln.Connected,this._logger.log(Bt.Information,"HubConnection reconnected successfully."),0!==this._reconnectedCallbacks.length)try{this._reconnectedCallbacks.forEach((e=>e.apply(this,[this.connection.connectionId])))}catch(e){this._logger.log(Bt.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${e}'.`)}return}catch(e){if(this._logger.log(Bt.Information,`Reconnect attempt failed because of error '${e}'.`),this._connectionState!==ln.Reconnecting)return this._logger.log(Bt.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this._connectionState===ln.Disconnecting&&this._completeClose());o=e instanceof Error?e:new Error(e.toString()),r=this._getNextRetryDelay(n++,Date.now()-t,o)}}this._logger.log(Bt.Information,`Reconnect retries have been exhausted after ${Date.now()-t} ms and ${n} failed attempts. Connection disconnecting.`),this._completeClose()}_getNextRetryDelay(e,t,n){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:t,previousRetryCount:e,retryReason:n})}catch(n){return this._logger.log(Bt.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${t}) threw error '${n}'.`),null}}_cancelCallbacksWithError(e){const t=this._callbacks;this._callbacks={},Object.keys(t).forEach((n=>{const o=t[n];try{o(null,e)}catch(t){this._logger.log(Bt.Error,`Stream 'error' callback called with '${e}' threw error: ${Yt(t)}`)}}))}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,t,n,o){if(n)return 0!==o.length?{arguments:t,streamIds:o,target:e,type:cn.Invocation}:{arguments:t,target:e,type:cn.Invocation};{const n=this._invocationId;return this._invocationId++,0!==o.length?{arguments:t,invocationId:n.toString(),streamIds:o,target:e,type:cn.Invocation}:{arguments:t,invocationId:n.toString(),target:e,type:cn.Invocation}}}_launchStreams(e,t){if(0!==e.length){t||(t=Promise.resolve());for(const n in e)e[n].subscribe({complete:()=>{t=t.then((()=>this._sendWithProtocol(this._createCompletionMessage(n))))},error:e=>{let o;o=e instanceof Error?e.message:e&&e.toString?e.toString():"Unknown error",t=t.then((()=>this._sendWithProtocol(this._createCompletionMessage(n,o))))},next:e=>{t=t.then((()=>this._sendWithProtocol(this._createStreamItemMessage(n,e))))}})}}_replaceStreamingParams(e){const t=[],n=[];for(let o=0;o0)&&(t=!1,this._accessToken=await this._accessTokenFactory()),this._setAuthorizationHeader(e);const n=await this._innerClient.send(e);return t&&401===n.statusCode&&this._accessTokenFactory?(this._accessToken=await this._accessTokenFactory(),this._setAuthorizationHeader(e),await this._innerClient.send(e)):n}_setAuthorizationHeader(e){e.headers||(e.headers={}),this._accessToken?e.headers[mn.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[mn.Authorization]&&delete e.headers[mn.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}}class bn extends yn{constructor(e){super(),this._logger=e;const t={_fetchType:void 0,_jar:void 0};var o;o=t,"undefined"==typeof fetch&&(o._jar=new(n(628).CookieJar),"undefined"==typeof fetch?o._fetchType=n(200):o._fetchType=fetch,o._fetchType=n(203)(o._fetchType,o._jar),1)?(this._fetchType=t._fetchType,this._jar=t._jar):this._fetchType=fetch.bind(function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n.g)return n.g;throw new Error("could not find global")}()),this._abortControllerType=AbortController;const r={_abortControllerType:this._abortControllerType};(function(e){return"undefined"==typeof AbortController&&(e._abortControllerType=n(778),!0)})(r)&&(this._abortControllerType=r._abortControllerType)}async send(e){if(e.abortSignal&&e.abortSignal.aborted)throw new tn;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");const t=new this._abortControllerType;let n;e.abortSignal&&(e.abortSignal.onabort=()=>{t.abort(),n=new tn});let o,r=null;if(e.timeout){const o=e.timeout;r=setTimeout((()=>{t.abort(),this._logger.log(Bt.Warning,"Timeout from HTTP request."),n=new en}),o)}""===e.content&&(e.content=void 0),e.content&&(e.headers=e.headers||{},jt(e.content)?e.headers["Content-Type"]="application/octet-stream":e.headers["Content-Type"]="text/plain;charset=UTF-8");try{o=await this._fetchType(e.url,{body:e.content,cache:"no-cache",credentials:!0===e.withCredentials?"include":"same-origin",headers:{"X-Requested-With":"XMLHttpRequest",...e.headers},method:e.method,mode:"cors",redirect:"follow",signal:t.signal})}catch(e){if(n)throw n;throw this._logger.log(Bt.Warning,`Error from HTTP request. ${e}.`),e}finally{r&&clearTimeout(r),e.abortSignal&&(e.abortSignal.onabort=null)}if(!o.ok){const e=await _n(o,"text");throw new Zt(e||o.statusText,o.status)}const i=_n(o,e.responseType),s=await i;return new vn(o.status,o.statusText,s)}getCookieString(e){return""}}function _n(e,t){let n;switch(t){case"arraybuffer":n=e.arrayBuffer();break;case"text":default:n=e.text();break;case"blob":case"document":case"json":throw new Error(`${t} is not supported.`)}return n}class Sn extends yn{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new tn):e.method?e.url?new Promise(((t,n)=>{const o=new XMLHttpRequest;o.open(e.method,e.url,!0),o.withCredentials=void 0===e.withCredentials||e.withCredentials,o.setRequestHeader("X-Requested-With","XMLHttpRequest"),""===e.content&&(e.content=void 0),e.content&&(jt(e.content)?o.setRequestHeader("Content-Type","application/octet-stream"):o.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const r=e.headers;r&&Object.keys(r).forEach((e=>{o.setRequestHeader(e,r[e])})),e.responseType&&(o.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=()=>{o.abort(),n(new tn)}),e.timeout&&(o.timeout=e.timeout),o.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),o.status>=200&&o.status<300?t(new vn(o.status,o.statusText,o.response||o.responseText)):n(new Zt(o.response||o.responseText||o.statusText,o.status))},o.onerror=()=>{this._logger.log(Bt.Warning,`Error from HTTP request. ${o.status}: ${o.statusText}.`),n(new Zt(o.statusText,o.status))},o.ontimeout=()=>{this._logger.log(Bt.Warning,"Timeout from HTTP request."),n(new en)},o.send(e.content)})):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class Cn extends yn{constructor(e){if(super(),"undefined"!=typeof fetch)this._httpClient=new bn(e);else{if("undefined"==typeof XMLHttpRequest)throw new Error("No usable HttpClient found.");this._httpClient=new Sn(e)}}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new tn):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}}var En,In;!function(e){e[e.None=0]="None",e[e.WebSockets=1]="WebSockets",e[e.ServerSentEvents=2]="ServerSentEvents",e[e.LongPolling=4]="LongPolling"}(En||(En={})),function(e){e[e.Text=1]="Text",e[e.Binary=2]="Binary"}(In||(In={}));class kn{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}}class Tn{get pollAborted(){return this._pollAbort.aborted}constructor(e,t,n){this._httpClient=e,this._logger=t,this._pollAbort=new kn,this._options=n,this._running=!1,this.onreceive=null,this.onclose=null}async connect(e,t){if($t.isRequired(e,"url"),$t.isRequired(t,"transferFormat"),$t.isIn(t,In,"transferFormat"),this._url=e,this._logger.log(Bt.Trace,"(LongPolling transport) Connecting."),t===In.Binary&&"undefined"!=typeof XMLHttpRequest&&"string"!=typeof(new XMLHttpRequest).responseType)throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[n,o]=Kt(),r={[n]:o,...this._options.headers},i={abortSignal:this._pollAbort.signal,headers:r,timeout:1e5,withCredentials:this._options.withCredentials};t===In.Binary&&(i.responseType="arraybuffer");const s=`${e}&_=${Date.now()}`;this._logger.log(Bt.Trace,`(LongPolling transport) polling: ${s}.`);const a=await this._httpClient.get(s,i);200!==a.statusCode?(this._logger.log(Bt.Error,`(LongPolling transport) Unexpected response code: ${a.statusCode}.`),this._closeError=new Zt(a.statusText||"",a.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,i)}async _poll(e,t){try{for(;this._running;)try{const n=`${e}&_=${Date.now()}`;this._logger.log(Bt.Trace,`(LongPolling transport) polling: ${n}.`);const o=await this._httpClient.get(n,t);204===o.statusCode?(this._logger.log(Bt.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):200!==o.statusCode?(this._logger.log(Bt.Error,`(LongPolling transport) Unexpected response code: ${o.statusCode}.`),this._closeError=new Zt(o.statusText||"",o.statusCode),this._running=!1):o.content?(this._logger.log(Bt.Trace,`(LongPolling transport) data received. ${Wt(o.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(o.content)):this._logger.log(Bt.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(e){this._running?e instanceof en?this._logger.log(Bt.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=e,this._running=!1):this._logger.log(Bt.Trace,`(LongPolling transport) Poll errored after shutdown: ${e.message}`)}}finally{this._logger.log(Bt.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(e){return this._running?zt(this._logger,"LongPolling",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this._logger.log(Bt.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(Bt.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const e={},[t,n]=Kt();e[t]=n;const o={headers:{...e,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials};let r;try{await this._httpClient.delete(this._url,o)}catch(e){r=e}r?r instanceof Zt&&(404===r.statusCode?this._logger.log(Bt.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this._logger.log(Bt.Trace,`(LongPolling transport) Error sending a DELETE request: ${r}`)):this._logger.log(Bt.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this._logger.log(Bt.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}}_raiseOnClose(){if(this.onclose){let e="(LongPolling transport) Firing onclose event.";this._closeError&&(e+=" Error: "+this._closeError),this._logger.log(Bt.Trace,e),this.onclose(this._closeError)}}}class Rn{constructor(e,t,n,o){this._httpClient=e,this._accessToken=t,this._logger=n,this._options=o,this.onreceive=null,this.onclose=null}async connect(e,t){return $t.isRequired(e,"url"),$t.isRequired(t,"transferFormat"),$t.isIn(t,In,"transferFormat"),this._logger.log(Bt.Trace,"(SSE transport) Connecting."),this._url=e,this._accessToken&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise(((n,o)=>{let r,i=!1;if(t===In.Text){if(Ht.isBrowser||Ht.isWebWorker)r=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{const t=this._httpClient.getCookieString(e),n={};n.Cookie=t;const[o,i]=Kt();n[o]=i,r=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:{...n,...this._options.headers}})}try{r.onmessage=e=>{if(this.onreceive)try{this._logger.log(Bt.Trace,`(SSE transport) data received. ${Wt(e.data,this._options.logMessageContent)}.`),this.onreceive(e.data)}catch(e){return void this._close(e)}},r.onerror=e=>{i?this._close():o(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."))},r.onopen=()=>{this._logger.log(Bt.Information,`SSE connected to ${this._url}`),this._eventSource=r,i=!0,n()}}catch(e){return void o(e)}}else o(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))}))}async send(e){return this._eventSource?zt(this._logger,"SSE",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}}class An{constructor(e,t,n,o,r,i){this._logger=n,this._accessTokenFactory=t,this._logMessageContent=o,this._webSocketConstructor=r,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=i}async connect(e,t){let n;return $t.isRequired(e,"url"),$t.isRequired(t,"transferFormat"),$t.isIn(t,In,"transferFormat"),this._logger.log(Bt.Trace,"(WebSockets transport) Connecting."),this._accessTokenFactory&&(n=await this._accessTokenFactory()),new Promise(((o,r)=>{let i;e=e.replace(/^http/,"ws");const s=this._httpClient.getCookieString(e);let a=!1;if(Ht.isReactNative){const t={},[o,r]=Kt();t[o]=r,n&&(t[mn.Authorization]=`Bearer ${n}`),s&&(t[mn.Cookie]=s),i=new this._webSocketConstructor(e,void 0,{headers:{...t,...this._headers}})}else n&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(n)}`);i||(i=new this._webSocketConstructor(e)),t===In.Binary&&(i.binaryType="arraybuffer"),i.onopen=t=>{this._logger.log(Bt.Information,`WebSocket connected to ${e}.`),this._webSocket=i,a=!0,o()},i.onerror=e=>{let t=null;t="undefined"!=typeof ErrorEvent&&e instanceof ErrorEvent?e.error:"There was an error with the transport",this._logger.log(Bt.Information,`(WebSockets transport) ${t}.`)},i.onmessage=e=>{if(this._logger.log(Bt.Trace,`(WebSockets transport) data received. ${Wt(e.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(e.data)}catch(e){return void this._close(e)}},i.onclose=e=>{if(a)this._close(e);else{let t=null;t="undefined"!=typeof ErrorEvent&&e instanceof ErrorEvent?e.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.",r(new Error(t))}}}))}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(Bt.Trace,`(WebSockets transport) sending data. ${Wt(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(Bt.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this._isCloseEvent(e)||!1!==e.wasClean&&1e3===e.code?e instanceof Error?this.onclose(e):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason||"no reason given"}).`)))}_isCloseEvent(e){return e&&"boolean"==typeof e.wasClean&&"number"==typeof e.code}}class Dn{constructor(e,t={}){if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,$t.isRequired(e,"url"),this._logger=function(e){return void 0===e?new Jt(Bt.Information):null===e?Ot.instance:void 0!==e.log?e:new Jt(e)}(t.logger),this.baseUrl=this._resolveUrl(e),(t=t||{}).logMessageContent=void 0!==t.logMessageContent&&t.logMessageContent,"boolean"!=typeof t.withCredentials&&void 0!==t.withCredentials)throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");t.withCredentials=void 0===t.withCredentials||t.withCredentials,t.timeout=void 0===t.timeout?1e5:t.timeout,"undefined"==typeof WebSocket||t.WebSocket||(t.WebSocket=WebSocket),"undefined"==typeof EventSource||t.EventSource||(t.EventSource=EventSource),this._httpClient=new wn(t.httpClient||new Cn(this._logger),t.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=t,this.onreceive=null,this.onclose=null}async start(e){if(e=e||In.Binary,$t.isIn(e,In,"transferFormat"),this._logger.log(Bt.Debug,`Starting connection with transfer format '${In[e]}'.`),"Disconnected"!==this._connectionState)return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(e),await this._startInternalPromise,"Disconnecting"===this._connectionState){const e="Failed to start the HttpConnection before stop() was called.";return this._logger.log(Bt.Error,e),await this._stopPromise,Promise.reject(new tn(e))}if("Connected"!==this._connectionState){const e="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(Bt.Error,e),Promise.reject(new tn(e))}this._connectionStarted=!0}send(e){return"Connected"!==this._connectionState?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new xn(this.transport)),this._sendQueue.send(e))}async stop(e){return"Disconnected"===this._connectionState?(this._logger.log(Bt.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):"Disconnecting"===this._connectionState?(this._logger.log(Bt.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState="Disconnecting",this._stopPromise=new Promise((e=>{this._stopPromiseResolver=e})),await this._stopInternal(e),void await this._stopPromise)}async _stopInternal(e){this._stopError=e;try{await this._startInternalPromise}catch(e){}if(this.transport){try{await this.transport.stop()}catch(e){this._logger.log(Bt.Error,`HttpConnection.transport.stop() threw error '${e}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(Bt.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async _startInternal(e){let t=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport!==En.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(En.WebSockets),await this._startTransport(t,e)}else{let n=null,o=0;do{if(n=await this._getNegotiationResponse(t),"Disconnecting"===this._connectionState||"Disconnected"===this._connectionState)throw new tn("The connection was stopped during negotiation.");if(n.error)throw new Error(n.error);if(n.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(n.url&&(t=n.url),n.accessToken){const e=n.accessToken;this._accessTokenFactory=()=>e,this._httpClient._accessToken=e,this._httpClient._accessTokenFactory=void 0}o++}while(n.url&&o<100);if(100===o&&n.url)throw new Error("Negotiate redirection limit exceeded.");await this._createTransport(t,this._options.transport,n,e)}this.transport instanceof Tn&&(this.features.inherentKeepAlive=!0),"Connecting"===this._connectionState&&(this._logger.log(Bt.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(e){return this._logger.log(Bt.Error,"Failed to start the connection: "+e),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(e)}}async _getNegotiationResponse(e){const t={},[n,o]=Kt();t[n]=o;const r=this._resolveNegotiateUrl(e);this._logger.log(Bt.Debug,`Sending negotiation request: ${r}.`);try{const e=await this._httpClient.post(r,{content:"",headers:{...t,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(200!==e.statusCode)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${e.statusCode}'`));const n=JSON.parse(e.content);return(!n.negotiateVersion||n.negotiateVersion<1)&&(n.connectionToken=n.connectionId),n.useStatefulReconnect&&!0!==this._options._useStatefulReconnect?Promise.reject(new sn("Client didn't negotiate Stateful Reconnect but the server did.")):n}catch(e){let t="Failed to complete negotiation with the server: "+e;return e instanceof Zt&&404===e.statusCode&&(t+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(Bt.Error,t),Promise.reject(new sn(t))}}_createConnectUrl(e,t){return t?e+(-1===e.indexOf("?")?"?":"&")+`id=${t}`:e}async _createTransport(e,t,n,o){let r=this._createConnectUrl(e,n.connectionToken);if(this._isITransport(t))return this._logger.log(Bt.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=t,await this._startTransport(r,o),void(this.connectionId=n.connectionId);const i=[],s=n.availableTransports||[];let a=n;for(const n of s){const s=this._resolveTransportOrError(n,t,o,!0===(null==a?void 0:a.useStatefulReconnect));if(s instanceof Error)i.push(`${n.transport} failed:`),i.push(s);else if(this._isITransport(s)){if(this.transport=s,!a){try{a=await this._getNegotiationResponse(e)}catch(e){return Promise.reject(e)}r=this._createConnectUrl(e,a.connectionToken)}try{return await this._startTransport(r,o),void(this.connectionId=a.connectionId)}catch(e){if(this._logger.log(Bt.Error,`Failed to start the transport '${n.transport}': ${e}`),a=void 0,i.push(new rn(`${n.transport} failed: ${e}`,En[n.transport])),"Connecting"!==this._connectionState){const e="Failed to select transport before stop() was called.";return this._logger.log(Bt.Debug,e),Promise.reject(new tn(e))}}}}return i.length>0?Promise.reject(new an(`Unable to connect to the server with any of the available transports. ${i.join(" ")}`,i)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))}_constructTransport(e){switch(e){case En.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new An(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case En.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new Rn(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case En.LongPolling:return new Tn(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,t){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(e,t),await this.features.resend()}catch{o=!0}o&&this._stopConnection(n)}else this._stopConnection(n)}:this.transport.onclose=e=>this._stopConnection(e),this.transport.connect(e,t)}_resolveTransportOrError(e,t,n,o){const r=En[e.transport];if(null==r)return this._logger.log(Bt.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(!function(e,t){return!e||0!=(t&e)}(t,r))return this._logger.log(Bt.Debug,`Skipping transport '${En[r]}' because it was disabled by the client.`),new on(`'${En[r]}' is disabled by the client.`,r);if(!(e.transferFormats.map((e=>In[e])).indexOf(n)>=0))return this._logger.log(Bt.Debug,`Skipping transport '${En[r]}' because it does not support the requested transfer format '${In[n]}'.`),new Error(`'${En[r]}' does not support ${In[n]}.`);if(r===En.WebSockets&&!this._options.WebSocket||r===En.ServerSentEvents&&!this._options.EventSource)return this._logger.log(Bt.Debug,`Skipping transport '${En[r]}' because it is not supported in your environment.'`),new nn(`'${En[r]}' is not supported in your environment.`,r);this._logger.log(Bt.Debug,`Selecting transport '${En[r]}'.`);try{return this.features.reconnect=r===En.WebSockets?o:void 0,this._constructTransport(r)}catch(e){return e}}_isITransport(e){return e&&"object"==typeof e&&"connect"in e}_stopConnection(e){if(this._logger.log(Bt.Debug,`HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`),this.transport=void 0,e=this._stopError||e,this._stopError=void 0,"Disconnected"!==this._connectionState){if("Connecting"===this._connectionState)throw this._logger.log(Bt.Warning,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);if("Disconnecting"===this._connectionState&&this._stopPromiseResolver(),e?this._logger.log(Bt.Error,`Connection disconnected with error '${e}'.`):this._logger.log(Bt.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch((e=>{this._logger.log(Bt.Error,`TransportSendQueue.stop() threw error '${e}'.`)})),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(t){this._logger.log(Bt.Error,`HttpConnection.onclose(${e}) threw error '${t}'.`)}}}else this._logger.log(Bt.Debug,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`)}_resolveUrl(e){if(0===e.lastIndexOf("https://",0)||0===e.lastIndexOf("http://",0))return e;if(!Ht.isBrowser)throw new Error(`Cannot resolve '${e}'.`);const t=window.document.createElement("a");return t.href=e,this._logger.log(Bt.Information,`Normalizing '${e}' to '${t.href}'.`),t.href}_resolveNegotiateUrl(e){const t=new URL(e);t.pathname.endsWith("/")?t.pathname+="negotiate":t.pathname+="/negotiate";const n=new URLSearchParams(t.searchParams);return n.has("negotiateVersion")||n.append("negotiateVersion",this._negotiateVersion.toString()),n.has("useStatefulReconnect")?"true"===n.get("useStatefulReconnect")&&(this._options._useStatefulReconnect=!0):!0===this._options._useStatefulReconnect&&n.append("useStatefulReconnect","true"),t.search=n.toString(),t.toString()}}class xn{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new Nn,this._transportResult=new Nn,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new Nn),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}async _sendLoop(){for(;;){if(await this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new Nn;const e=this._transportResult;this._transportResult=void 0;const t="string"==typeof this._buffer[0]?this._buffer.join(""):xn._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(t),e.resolve()}catch(t){e.reject(t)}}}static _concatBuffers(e){const t=e.map((e=>e.byteLength)).reduce(((e,t)=>e+t)),n=new Uint8Array(t);let o=0;for(const t of e)n.set(new Uint8Array(t),o),o+=t.byteLength;return n.buffer}}class Nn{constructor(){this.promise=new Promise(((e,t)=>[this._resolver,this._rejecter]=[e,t]))}resolve(){this._resolver()}reject(e){this._rejecter(e)}}class Mn{constructor(){this.name="json",this.version=2,this.transferFormat=In.Text}parseMessages(e,t){if("string"!=typeof e)throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];null===t&&(t=Ot.instance);const n=Lt.parse(e),o=[];for(const e of n){const n=JSON.parse(e);if("number"!=typeof n.type)throw new Error("Invalid payload.");switch(n.type){case cn.Invocation:this._isInvocationMessage(n);break;case cn.StreamItem:this._isStreamItemMessage(n);break;case cn.Completion:this._isCompletionMessage(n);break;case cn.Ping:case cn.Close:break;case cn.Ack:this._isAckMessage(n);break;case cn.Sequence:this._isSequenceMessage(n);break;default:t.log(Bt.Information,"Unknown message type '"+n.type+"' ignored.");continue}o.push(n)}return o}writeMessage(e){return Lt.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,"Invalid payload for Invocation message."),void 0!==e.invocationId&&this._assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),void 0===e.item)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this._assertNotEmptyString(e.error,"Invalid payload for Completion message."),this._assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")}_isAckMessage(e){if("number"!=typeof e.sequenceId)throw new Error("Invalid SequenceId for Ack message.")}_isSequenceMessage(e){if("number"!=typeof e.sequenceId)throw new Error("Invalid SequenceId for Sequence message.")}_assertNotEmptyString(e,t){if("string"!=typeof e||""===e)throw new Error(t)}}const Pn={trace:Bt.Trace,debug:Bt.Debug,info:Bt.Information,information:Bt.Information,warn:Bt.Warning,warning:Bt.Warning,error:Bt.Error,critical:Bt.Critical,none:Bt.None};class Un{configureLogging(e){if($t.isRequired(e,"logging"),function(e){return void 0!==e.log}(e))this.logger=e;else if("string"==typeof e){const t=function(e){const t=Pn[e.toLowerCase()];if(void 0!==t)return t;throw new Error(`Unknown log level: ${e}`)}(e);this.logger=new Jt(t)}else this.logger=new Jt(e);return this}withUrl(e,t){return $t.isRequired(e,"url"),$t.isNotEmpty(e,"url"),this.url=e,this.httpConnectionOptions="object"==typeof t?{...this.httpConnectionOptions,...t}:{...this.httpConnectionOptions,transport:t},this}withHubProtocol(e){return $t.isRequired(e,"protocol"),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new gn(e):this.reconnectPolicy=e:this.reconnectPolicy=new gn,this}withServerTimeout(e){return $t.isRequired(e,"milliseconds"),this._serverTimeoutInMilliseconds=e,this}withKeepAliveInterval(e){return $t.isRequired(e,"milliseconds"),this._keepAliveIntervalInMilliseconds=e,this}withStatefulReconnect(e){return void 0===this.httpConnectionOptions&&(this.httpConnectionOptions={}),this.httpConnectionOptions._useStatefulReconnect=!0,this._statefulReconnectBufferSize=null==e?void 0:e.bufferSize,this}build(){const e=this.httpConnectionOptions||{};if(void 0===e.logger&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const t=new Dn(this.url,e);return pn.create(t,this.logger||Ot.instance,this.protocol||new Mn,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}}var Ln;!function(e){e[e.Default=0]="Default",e[e.Server=1]="Server",e[e.WebAssembly=2]="WebAssembly",e[e.WebView=3]="WebView"}(Ln||(Ln={}));var Bn,On,Fn,$n=4294967295;function Hn(e,t,n){var o=Math.floor(n/4294967296),r=n;e.setUint32(t,o),e.setUint32(t+4,r)}function Wn(e,t){return 4294967296*e.getInt32(t)+e.getUint32(t+4)}var jn=("undefined"==typeof process||"never"!==(null===(Bn=null===process||void 0===process?void 0:process.env)||void 0===Bn?void 0:Bn.TEXT_ENCODING))&&"undefined"!=typeof TextEncoder&&"undefined"!=typeof TextDecoder;function zn(e){for(var t=e.length,n=0,o=0;o=55296&&r<=56319&&o65535&&(h-=65536,i.push(h>>>10&1023|55296),h=56320|1023&h),i.push(h)}else i.push(a);i.length>=4096&&(s+=String.fromCharCode.apply(String,i),i.length=0)}return i.length>0&&(s+=String.fromCharCode.apply(String,i)),s}var Xn,Gn=jn?new TextDecoder:null,Yn=jn?"undefined"!=typeof process&&"force"!==(null===(Fn=null===process||void 0===process?void 0:process.env)||void 0===Fn?void 0:Fn.TEXT_DECODER)?200:0:$n,Qn=function(e,t){this.type=e,this.data=t},Zn=(Xn=function(e,t){return Xn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Xn(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Xn(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),eo=function(e){function t(n){var o=e.call(this,n)||this,r=Object.create(t.prototype);return Object.setPrototypeOf(o,r),Object.defineProperty(o,"name",{configurable:!0,enumerable:!1,value:t.name}),o}return Zn(t,e),t}(Error),to={type:-1,encode:function(e){var t,n,o,r;return e instanceof Date?function(e){var t,n=e.sec,o=e.nsec;if(n>=0&&o>=0&&n<=17179869183){if(0===o&&n<=4294967295){var r=new Uint8Array(4);return(t=new DataView(r.buffer)).setUint32(0,n),r}var i=n/4294967296,s=4294967295&n;return r=new Uint8Array(8),(t=new DataView(r.buffer)).setUint32(0,o<<2|3&i),t.setUint32(4,s),r}return r=new Uint8Array(12),(t=new DataView(r.buffer)).setUint32(0,o),Hn(t,4,n),r}((o=1e6*((t=e.getTime())-1e3*(n=Math.floor(t/1e3))),{sec:n+(r=Math.floor(o/1e9)),nsec:o-1e9*r})):null},decode:function(e){var t=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:var n=t.getUint32(0);return{sec:4294967296*(3&n)+t.getUint32(4),nsec:n>>>2};case 12:return{sec:Wn(t,4),nsec:t.getUint32(0)};default:throw new eo("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(e.length))}}(e);return new Date(1e3*t.sec+t.nsec/1e6)}},no=function(){function e(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(to)}return e.prototype.register=function(e){var t=e.type,n=e.encode,o=e.decode;if(t>=0)this.encoders[t]=n,this.decoders[t]=o;else{var r=1+t;this.builtInEncoders[r]=n,this.builtInDecoders[r]=o}},e.prototype.tryToEncode=function(e,t){for(var n=0;nthis.maxDepth)throw new Error("Too deep objects in depth ".concat(t));null==e?this.encodeNil():"boolean"==typeof e?this.encodeBoolean(e):"number"==typeof e?this.encodeNumber(e):"string"==typeof e?this.encodeString(e):this.encodeObject(e,t)},e.prototype.ensureBufferSizeToWrite=function(e){var t=this.pos+e;this.view.byteLength=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):(this.writeU8(211),this.writeI64(e)):this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))},e.prototype.writeStringHeader=function(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else{if(!(e<4294967296))throw new Error("Too long string: ".concat(e," bytes in UTF-8"));this.writeU8(219),this.writeU32(e)}},e.prototype.encodeString=function(e){if(e.length>Jn){var t=zn(e);this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),Kn(e,this.bytes,this.pos),this.pos+=t}else t=zn(e),this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),function(e,t,n){for(var o=e.length,r=n,i=0;i>6&31|192;else{if(s>=55296&&s<=56319&&i>12&15|224,t[r++]=s>>6&63|128):(t[r++]=s>>18&7|240,t[r++]=s>>12&63|128,t[r++]=s>>6&63|128)}t[r++]=63&s|128}else t[r++]=s}}(e,this.bytes,this.pos),this.pos+=t},e.prototype.encodeObject=function(e,t){var n=this.extensionCodec.tryToEncode(e,this.context);if(null!=n)this.encodeExtension(n);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else{if("object"!=typeof e)throw new Error("Unrecognized object: ".concat(Object.prototype.toString.apply(e)));this.encodeMap(e,t)}},e.prototype.encodeBinary=function(e){var t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too large binary: ".concat(t));this.writeU8(198),this.writeU32(t)}var n=oo(e);this.writeU8a(n)},e.prototype.encodeArray=function(e,t){var n=e.length;if(n<16)this.writeU8(144+n);else if(n<65536)this.writeU8(220),this.writeU16(n);else{if(!(n<4294967296))throw new Error("Too large array: ".concat(n));this.writeU8(221),this.writeU32(n)}for(var o=0,r=e;o0&&e<=this.maxKeyLength},e.prototype.find=function(e,t,n){e:for(var o=0,r=this.caches[n-1];o=this.maxLengthPerKey?n[Math.random()*n.length|0]=o:n.push(o)},e.prototype.decode=function(e,t,n){var o=this.find(e,t,n);if(null!=o)return this.hit++,o;this.miss++;var r=Vn(e,t,n),i=Uint8Array.prototype.slice.call(e,t,t+n);return this.store(i,r),r},e}(),ao=function(e,t){var n,o,r,i,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,o=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]=e},e.prototype.createExtraByteError=function(e){var t=this.view,n=this.pos;return new RangeError("Extra ".concat(t.byteLength-n," of ").concat(t.byteLength," byte(s) found at buffer[").concat(e,"]"))},e.prototype.decode=function(e){this.reinitializeState(),this.setBuffer(e);var t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t},e.prototype.decodeMulti=function(e){return ao(this,(function(t){switch(t.label){case 0:this.reinitializeState(),this.setBuffer(e),t.label=1;case 1:return this.hasRemaining(1)?[4,this.doDecodeSync()]:[3,3];case 2:return t.sent(),[3,1];case 3:return[2]}}))},e.prototype.decodeAsync=function(e){var t,n,o,r,i,s,a;return i=this,void 0,a=function(){var i,s,a,c,l,h,d,u;return ao(this,(function(p){switch(p.label){case 0:i=!1,p.label=1;case 1:p.trys.push([1,6,7,12]),t=co(e),p.label=2;case 2:return[4,t.next()];case 3:if((n=p.sent()).done)return[3,5];if(a=n.value,i)throw this.createExtraByteError(this.totalPos);this.appendBuffer(a);try{s=this.doDecodeSync(),i=!0}catch(e){if(!(e instanceof po))throw e}this.totalPos+=this.pos,p.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return c=p.sent(),o={error:c},[3,12];case 7:return p.trys.push([7,,10,11]),n&&!n.done&&(r=t.return)?[4,r.call(t)]:[3,9];case 8:p.sent(),p.label=9;case 9:return[3,11];case 10:if(o)throw o.error;return[7];case 11:return[7];case 12:if(i){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return[2,s]}throw h=(l=this).headByte,d=l.pos,u=l.totalPos,new RangeError("Insufficient data in parsing ".concat(io(h)," at ").concat(u," (").concat(d," in the current buffer)"))}}))},new((s=void 0)||(s=Promise))((function(e,t){function n(e){try{r(a.next(e))}catch(e){t(e)}}function o(e){try{r(a.throw(e))}catch(e){t(e)}}function r(t){var r;t.done?e(t.value):(r=t.value,r instanceof s?r:new s((function(e){e(r)}))).then(n,o)}r((a=a.apply(i,[])).next())}))},e.prototype.decodeArrayStream=function(e){return this.decodeMultiAsync(e,!0)},e.prototype.decodeStream=function(e){return this.decodeMultiAsync(e,!1)},e.prototype.decodeMultiAsync=function(e,t){return function(n,o,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,s=function(){var n,o,r,i,s,a,c,l,h;return ao(this,(function(d){switch(d.label){case 0:n=t,o=-1,d.label=1;case 1:d.trys.push([1,13,14,19]),r=co(e),d.label=2;case 2:return[4,lo(r.next())];case 3:if((i=d.sent()).done)return[3,12];if(s=i.value,t&&0===o)throw this.createExtraByteError(this.totalPos);this.appendBuffer(s),n&&(o=this.readArraySize(),n=!1,this.complete()),d.label=4;case 4:d.trys.push([4,9,,10]),d.label=5;case 5:return[4,lo(this.doDecodeSync())];case 6:return[4,d.sent()];case 7:return d.sent(),0==--o?[3,8]:[3,5];case 8:return[3,10];case 9:if(!((a=d.sent())instanceof po))throw a;return[3,10];case 10:this.totalPos+=this.pos,d.label=11;case 11:return[3,2];case 12:return[3,19];case 13:return c=d.sent(),l={error:c},[3,19];case 14:return d.trys.push([14,,17,18]),i&&!i.done&&(h=r.return)?[4,lo(h.call(r))]:[3,16];case 15:d.sent(),d.label=16;case 16:return[3,18];case 17:if(l)throw l.error;return[7];case 18:return[7];case 19:return[2]}}))}.apply(n,o||[]),a=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(e){s[e]&&(i[e]=function(t){return new Promise((function(n,o){a.push([e,t,n,o])>1||l(e,t)}))})}function l(e,t){try{(n=s[e](t)).value instanceof lo?Promise.resolve(n.value.v).then(h,d):u(a[0][2],n)}catch(e){u(a[0][3],e)}var n}function h(e){l("next",e)}function d(e){l("throw",e)}function u(e,t){e(t),a.shift(),a.length&&l(a[0][0],a[0][1])}}(this,arguments)},e.prototype.doDecodeSync=function(){e:for(;;){var e=this.readHeadByte(),t=void 0;if(e>=224)t=e-256;else if(e<192)if(e<128)t=e;else if(e<144){if(0!=(o=e-128)){this.pushMapState(o),this.complete();continue e}t={}}else if(e<160){if(0!=(o=e-144)){this.pushArrayState(o),this.complete();continue e}t=[]}else{var n=e-160;t=this.decodeUtf8String(n,0)}else if(192===e)t=null;else if(194===e)t=!1;else if(195===e)t=!0;else if(202===e)t=this.readF32();else if(203===e)t=this.readF64();else if(204===e)t=this.readU8();else if(205===e)t=this.readU16();else if(206===e)t=this.readU32();else if(207===e)t=this.readU64();else if(208===e)t=this.readI8();else if(209===e)t=this.readI16();else if(210===e)t=this.readI32();else if(211===e)t=this.readI64();else if(217===e)n=this.lookU8(),t=this.decodeUtf8String(n,1);else if(218===e)n=this.lookU16(),t=this.decodeUtf8String(n,2);else if(219===e)n=this.lookU32(),t=this.decodeUtf8String(n,4);else if(220===e){if(0!==(o=this.readU16())){this.pushArrayState(o),this.complete();continue e}t=[]}else if(221===e){if(0!==(o=this.readU32())){this.pushArrayState(o),this.complete();continue e}t=[]}else if(222===e){if(0!==(o=this.readU16())){this.pushMapState(o),this.complete();continue e}t={}}else if(223===e){if(0!==(o=this.readU32())){this.pushMapState(o),this.complete();continue e}t={}}else if(196===e){var o=this.lookU8();t=this.decodeBinary(o,1)}else if(197===e)o=this.lookU16(),t=this.decodeBinary(o,2);else if(198===e)o=this.lookU32(),t=this.decodeBinary(o,4);else if(212===e)t=this.decodeExtension(1,0);else if(213===e)t=this.decodeExtension(2,0);else if(214===e)t=this.decodeExtension(4,0);else if(215===e)t=this.decodeExtension(8,0);else if(216===e)t=this.decodeExtension(16,0);else if(199===e)o=this.lookU8(),t=this.decodeExtension(o,1);else if(200===e)o=this.lookU16(),t=this.decodeExtension(o,2);else{if(201!==e)throw new eo("Unrecognized type byte: ".concat(io(e)));o=this.lookU32(),t=this.decodeExtension(o,4)}this.complete();for(var r=this.stack;r.length>0;){var i=r[r.length-1];if(0===i.type){if(i.array[i.position]=t,i.position++,i.position!==i.size)continue e;r.pop(),t=i.array}else{if(1===i.type){if("string"!=(s=typeof t)&&"number"!==s)throw new eo("The type of key must be string or number but "+typeof t);if("__proto__"===t)throw new eo("The key __proto__ is not allowed");i.key=t,i.type=2;continue e}if(i.map[i.key]=t,i.readCount++,i.readCount!==i.size){i.key=null,i.type=1;continue e}r.pop(),t=i.map}}return t}var s},e.prototype.readHeadByte=function(){return-1===this.headByte&&(this.headByte=this.readU8()),this.headByte},e.prototype.complete=function(){this.headByte=-1},e.prototype.readArraySize=function(){var e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw new eo("Unrecognized array type byte: ".concat(io(e)))}},e.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw new eo("Max length exceeded: map length (".concat(e,") > maxMapLengthLength (").concat(this.maxMapLength,")"));this.stack.push({type:1,size:e,key:null,readCount:0,map:{}})},e.prototype.pushArrayState=function(e){if(e>this.maxArrayLength)throw new eo("Max length exceeded: array length (".concat(e,") > maxArrayLength (").concat(this.maxArrayLength,")"));this.stack.push({type:0,size:e,array:new Array(e),position:0})},e.prototype.decodeUtf8String=function(e,t){var n;if(e>this.maxStrLength)throw new eo("Max length exceeded: UTF-8 byte length (".concat(e,") > maxStrLength (").concat(this.maxStrLength,")"));if(this.bytes.byteLengthYn?function(e,t,n){var o=e.subarray(t,t+n);return Gn.decode(o)}(this.bytes,r,e):Vn(this.bytes,r,e),this.pos+=t+e,o},e.prototype.stateIsMapKey=function(){return this.stack.length>0&&1===this.stack[this.stack.length-1].type},e.prototype.decodeBinary=function(e,t){if(e>this.maxBinLength)throw new eo("Max length exceeded: bin length (".concat(e,") > maxBinLength (").concat(this.maxBinLength,")"));if(!this.hasRemaining(e+t))throw fo;var n=this.pos+t,o=this.bytes.subarray(n,n+e);return this.pos+=t+e,o},e.prototype.decodeExtension=function(e,t){if(e>this.maxExtLength)throw new eo("Max length exceeded: ext length (".concat(e,") > maxExtLength (").concat(this.maxExtLength,")"));var n=this.view.getInt8(this.pos+t),o=this.decodeBinary(e,t+1);return this.extensionCodec.decode(o,n,this.context)},e.prototype.lookU8=function(){return this.view.getUint8(this.pos)},e.prototype.lookU16=function(){return this.view.getUint16(this.pos)},e.prototype.lookU32=function(){return this.view.getUint32(this.pos)},e.prototype.readU8=function(){var e=this.view.getUint8(this.pos);return this.pos++,e},e.prototype.readI8=function(){var e=this.view.getInt8(this.pos);return this.pos++,e},e.prototype.readU16=function(){var e=this.view.getUint16(this.pos);return this.pos+=2,e},e.prototype.readI16=function(){var e=this.view.getInt16(this.pos);return this.pos+=2,e},e.prototype.readU32=function(){var e=this.view.getUint32(this.pos);return this.pos+=4,e},e.prototype.readI32=function(){var e=this.view.getInt32(this.pos);return this.pos+=4,e},e.prototype.readU64=function(){var e,t,n=(e=this.view,t=this.pos,4294967296*e.getUint32(t)+e.getUint32(t+4));return this.pos+=8,n},e.prototype.readI64=function(){var e=Wn(this.view,this.pos);return this.pos+=8,e},e.prototype.readF32=function(){var e=this.view.getFloat32(this.pos);return this.pos+=4,e},e.prototype.readF64=function(){var e=this.view.getFloat64(this.pos);return this.pos+=8,e},e}();class vo{static write(e){let t=e.byteLength||e.length;const n=[];do{let e=127&t;t>>=7,t>0&&(e|=128),n.push(e)}while(t>0);t=e.byteLength||e.length;const o=new Uint8Array(n.length+t);return o.set(n,0),o.set(e,n.length),o.buffer}static parse(e){const t=[],n=new Uint8Array(e),o=[0,7,14,21,28];for(let r=0;r7)throw new Error("Messages bigger than 2GB are not supported.");if(!(n.byteLength>=r+s+a))throw new Error("Incomplete message.");t.push(n.slice?n.slice(r+s,r+s+a):n.subarray(r+s,r+s+a)),r=r+s+a}return t}}const yo=new Uint8Array([145,cn.Ping]);class wo{constructor(e){this.name="messagepack",this.version=2,this.transferFormat=In.Binary,this._errorResult=1,this._voidResult=2,this._nonVoidResult=3,e=e||{},this._encoder=new ro(e.extensionCodec,e.context,e.maxDepth,e.initialBufferSize,e.sortKeys,e.forceFloat32,e.ignoreUndefined,e.forceIntegerToFloat),this._decoder=new mo(e.extensionCodec,e.context,e.maxStrLength,e.maxBinLength,e.maxArrayLength,e.maxMapLength,e.maxExtLength)}parseMessages(e,t){if(!(n=e)||"undefined"==typeof ArrayBuffer||!(n instanceof ArrayBuffer||n.constructor&&"ArrayBuffer"===n.constructor.name))throw new Error("Invalid input for MessagePack hub protocol. Expected an ArrayBuffer.");var n;null===t&&(t=Ot.instance);const o=vo.parse(e),r=[];for(const e of o){const n=this._parseMessage(e,t);n&&r.push(n)}return r}writeMessage(e){switch(e.type){case cn.Invocation:return this._writeInvocation(e);case cn.StreamInvocation:return this._writeStreamInvocation(e);case cn.StreamItem:return this._writeStreamItem(e);case cn.Completion:return this._writeCompletion(e);case cn.Ping:return vo.write(yo);case cn.CancelInvocation:return this._writeCancelInvocation(e);case cn.Close:return this._writeClose();case cn.Ack:return this._writeAck(e);case cn.Sequence:return this._writeSequence(e);default:throw new Error("Invalid message type.")}}_parseMessage(e,t){if(0===e.length)throw new Error("Invalid payload.");const n=this._decoder.decode(e);if(0===n.length||!(n instanceof Array))throw new Error("Invalid payload.");const o=n[0];switch(o){case cn.Invocation:return this._createInvocationMessage(this._readHeaders(n),n);case cn.StreamItem:return this._createStreamItemMessage(this._readHeaders(n),n);case cn.Completion:return this._createCompletionMessage(this._readHeaders(n),n);case cn.Ping:return this._createPingMessage(n);case cn.Close:return this._createCloseMessage(n);case cn.Ack:return this._createAckMessage(n);case cn.Sequence:return this._createSequenceMessage(n);default:return t.log(Bt.Information,"Unknown message type '"+o+"' ignored."),null}}_createCloseMessage(e){if(e.length<2)throw new Error("Invalid payload for Close message.");return{allowReconnect:e.length>=3?e[2]:void 0,error:e[1],type:cn.Close}}_createPingMessage(e){if(e.length<1)throw new Error("Invalid payload for Ping message.");return{type:cn.Ping}}_createInvocationMessage(e,t){if(t.length<5)throw new Error("Invalid payload for Invocation message.");const n=t[2];return n?{arguments:t[4],headers:e,invocationId:n,streamIds:[],target:t[3],type:cn.Invocation}:{arguments:t[4],headers:e,streamIds:[],target:t[3],type:cn.Invocation}}_createStreamItemMessage(e,t){if(t.length<4)throw new Error("Invalid payload for StreamItem message.");return{headers:e,invocationId:t[2],item:t[3],type:cn.StreamItem}}_createCompletionMessage(e,t){if(t.length<4)throw new Error("Invalid payload for Completion message.");const n=t[3];if(n!==this._voidResult&&t.length<5)throw new Error("Invalid payload for Completion message.");let o,r;switch(n){case this._errorResult:o=t[4];break;case this._nonVoidResult:r=t[4]}return{error:o,headers:e,invocationId:t[2],result:r,type:cn.Completion}}_createAckMessage(e){if(e.length<1)throw new Error("Invalid payload for Ack message.");return{sequenceId:e[1],type:cn.Ack}}_createSequenceMessage(e){if(e.length<1)throw new Error("Invalid payload for Sequence message.");return{sequenceId:e[1],type:cn.Sequence}}_writeInvocation(e){let t;return t=e.streamIds?this._encoder.encode([cn.Invocation,e.headers||{},e.invocationId||null,e.target,e.arguments,e.streamIds]):this._encoder.encode([cn.Invocation,e.headers||{},e.invocationId||null,e.target,e.arguments]),vo.write(t.slice())}_writeStreamInvocation(e){let t;return t=e.streamIds?this._encoder.encode([cn.StreamInvocation,e.headers||{},e.invocationId,e.target,e.arguments,e.streamIds]):this._encoder.encode([cn.StreamInvocation,e.headers||{},e.invocationId,e.target,e.arguments]),vo.write(t.slice())}_writeStreamItem(e){const t=this._encoder.encode([cn.StreamItem,e.headers||{},e.invocationId,e.item]);return vo.write(t.slice())}_writeCompletion(e){const t=e.error?this._errorResult:void 0!==e.result?this._nonVoidResult:this._voidResult;let n;switch(t){case this._errorResult:n=this._encoder.encode([cn.Completion,e.headers||{},e.invocationId,t,e.error]);break;case this._voidResult:n=this._encoder.encode([cn.Completion,e.headers||{},e.invocationId,t]);break;case this._nonVoidResult:n=this._encoder.encode([cn.Completion,e.headers||{},e.invocationId,t,e.result])}return vo.write(n.slice())}_writeCancelInvocation(e){const t=this._encoder.encode([cn.CancelInvocation,e.headers||{},e.invocationId]);return vo.write(t.slice())}_writeClose(){const e=this._encoder.encode([cn.Close,null]);return vo.write(e.slice())}_writeAck(e){const t=this._encoder.encode([cn.Ack,e.sequenceId]);return vo.write(t.slice())}_writeSequence(e){const t=this._encoder.encode([cn.Sequence,e.sequenceId]);return vo.write(t.slice())}_readHeaders(e){const t=e[1];if("object"!=typeof t)throw new Error("Invalid headers.");return t}}const bo="function"==typeof TextDecoder?new TextDecoder("utf-8"):null,_o=bo?bo.decode.bind(bo):function(e){let t=0;const n=e.length,o=[],r=[];for(;t65535&&(r-=65536,o.push(r>>>10&1023|55296),r=56320|1023&r),o.push(r)}o.length>1024&&(r.push(String.fromCharCode.apply(null,o)),o.length=0)}return r.push(String.fromCharCode.apply(null,o)),r.join("")},So=Math.pow(2,32),Co=Math.pow(2,21)-1;function Eo(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}function Io(e,t){return e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24>>>0)}function ko(e,t){const n=Io(e,t+4);if(n>Co)throw new Error(`Cannot read uint64 with high order part ${n}, because the result would exceed Number.MAX_SAFE_INTEGER.`);return n*So+Io(e,t)}class To{constructor(e){this.batchData=e;const t=new xo(e);this.arrayRangeReader=new No(e),this.arrayBuilderSegmentReader=new Mo(e),this.diffReader=new Ro(e),this.editReader=new Ao(e,t),this.frameReader=new Do(e,t)}updatedComponents(){return Eo(this.batchData,this.batchData.length-20)}referenceFrames(){return Eo(this.batchData,this.batchData.length-16)}disposedComponentIds(){return Eo(this.batchData,this.batchData.length-12)}disposedEventHandlerIds(){return Eo(this.batchData,this.batchData.length-8)}updatedComponentsEntry(e,t){const n=e+4*t;return Eo(this.batchData,n)}referenceFramesEntry(e,t){return e+20*t}disposedComponentIdsEntry(e,t){const n=e+4*t;return Eo(this.batchData,n)}disposedEventHandlerIdsEntry(e,t){const n=e+8*t;return ko(this.batchData,n)}}class Ro{constructor(e){this.batchDataUint8=e}componentId(e){return Eo(this.batchDataUint8,e)}edits(e){return e+4}editsEntry(e,t){return e+16*t}}class Ao{constructor(e,t){this.batchDataUint8=e,this.stringReader=t}editType(e){return Eo(this.batchDataUint8,e)}siblingIndex(e){return Eo(this.batchDataUint8,e+4)}newTreeIndex(e){return Eo(this.batchDataUint8,e+8)}moveToSiblingIndex(e){return Eo(this.batchDataUint8,e+8)}removedAttributeName(e){const t=Eo(this.batchDataUint8,e+12);return this.stringReader.readString(t)}}class Do{constructor(e,t){this.batchDataUint8=e,this.stringReader=t}frameType(e){return Eo(this.batchDataUint8,e)}subtreeLength(e){return Eo(this.batchDataUint8,e+4)}elementReferenceCaptureId(e){const t=Eo(this.batchDataUint8,e+4);return this.stringReader.readString(t)}componentId(e){return Eo(this.batchDataUint8,e+8)}elementName(e){const t=Eo(this.batchDataUint8,e+8);return this.stringReader.readString(t)}textContent(e){const t=Eo(this.batchDataUint8,e+4);return this.stringReader.readString(t)}markupContent(e){const t=Eo(this.batchDataUint8,e+4);return this.stringReader.readString(t)}attributeName(e){const t=Eo(this.batchDataUint8,e+4);return this.stringReader.readString(t)}attributeValue(e){const t=Eo(this.batchDataUint8,e+8);return this.stringReader.readString(t)}attributeEventHandlerId(e){return ko(this.batchDataUint8,e+12)}}class xo{constructor(e){this.batchDataUint8=e,this.stringTableStartIndex=Eo(e,e.length-4)}readString(e){if(-1===e)return null;{const n=Eo(this.batchDataUint8,this.stringTableStartIndex+4*e),o=function(e,t){let n=0,o=0;for(let r=0;r<4;r++){const i=e[t+r];if(n|=(127&i)<this.nextBatchId)return this.fatalError?(this.logger.log(vt.Debug,`Received a new batch ${e} but errored out on a previous batch ${this.nextBatchId-1}`),void await n.send("OnRenderCompleted",this.nextBatchId-1,this.fatalError.toString())):void this.logger.log(vt.Debug,`Waiting for batch ${this.nextBatchId}. Batch ${e} not processed.`);try{this.nextBatchId++,this.logger.log(vt.Debug,`Applying batch ${e}.`),xe(Ln.Server,new To(t)),await this.completeBatch(n,e)}catch(t){throw this.fatalError=t.toString(),this.logger.log(vt.Error,`There was an error applying batch ${e}.`),n.send("OnRenderCompleted",e,t.toString()),t}}getLastBatchid(){return this.nextBatchId-1}async completeBatch(e,t){try{await e.send("OnRenderCompleted",t,null)}catch{this.logger.log(vt.Warning,`Failed to deliver completion notification for render '${t}'.`)}}}let Uo=!1;function Lo(){const e=document.querySelector("#blazor-error-ui");e&&(e.style.display="block"),Uo||(Uo=!0,document.querySelectorAll("#blazor-error-ui .reload").forEach((e=>{e.onclick=function(e){location.reload(),e.preventDefault()}})),document.querySelectorAll("#blazor-error-ui .dismiss").forEach((e=>{e.onclick=function(e){const t=document.querySelector("#blazor-error-ui");t&&(t.style.display="none"),e.preventDefault()}})))}class Bo{constructor(t,n,o,r){this._firstUpdate=!0,this._renderingFailed=!1,this._disposed=!1,this._circuitId=void 0,this._applicationState=n,this._componentManager=t,this._options=o,this._logger=r,this._renderQueue=new Po(this._logger),this._dispatcher=e.attachDispatcher(this)}start(){if(this.isDisposedOrDisposing())throw new Error("Cannot start a disposed circuit.");return this._startPromise||(this._startPromise=this.startCore()),this._startPromise}updateRootComponents(e){var t,n;return this._firstUpdate?(this._firstUpdate=!1,null===(t=this._connection)||void 0===t?void 0:t.send("UpdateRootComponents",e,this._applicationState)):null===(n=this._connection)||void 0===n?void 0:n.send("UpdateRootComponents",e,"")}async startCore(){if(this._connection=await this.startConnection(),this._connection.state!==ln.Connected)return!1;const e=JSON.stringify(this._componentManager.initialComponents.map((e=>Pt(e))));if(this._circuitId=await this._connection.invoke("StartCircuit",qe.getBaseURI(),qe.getLocationHref(),e,this._applicationState||""),!this._circuitId)return!1;for(const e of this._options.circuitHandlers)e.onCircuitOpened&&e.onCircuitOpened();return!0}async startConnection(){var e,t;const n=new wo;n.name="blazorpack";const o=(new Un).withUrl("_blazor").withHubProtocol(n);this._options.configureSignalR(o);const r=o.build();r.on("JS.AttachComponent",((e,t)=>Ae(Ln.Server,this.resolveElement(t),e,!1))),r.on("JS.BeginInvokeJS",this._dispatcher.beginInvokeJSFromDotNet.bind(this._dispatcher)),r.on("JS.EndInvokeDotNet",this._dispatcher.endInvokeDotNetFromJS.bind(this._dispatcher)),r.on("JS.ReceiveByteArray",this._dispatcher.receiveByteArray.bind(this._dispatcher)),r.on("JS.BeginTransmitStream",(e=>{const t=new ReadableStream({start:t=>{r.stream("SendDotNetStreamToJS",e).subscribe({next:e=>t.enqueue(e),complete:()=>t.close(),error:e=>t.error(e)})}});this._dispatcher.supplyDotNetStream(e,t)})),r.on("JS.RenderBatch",(async(e,t)=>{var n,o;this._logger.log(Bt.Debug,`Received render batch with id ${e} and ${t.byteLength} bytes.`),await this._renderQueue.processBatch(e,t,this._connection),null===(o=(n=this._componentManager).onAfterRenderBatch)||void 0===o||o.call(n,Ln.Server)})),r.on("JS.EndUpdateRootComponents",(e=>{var t,n;null===(n=(t=this._componentManager).onAfterUpdateRootComponents)||void 0===n||n.call(t,e)})),r.on("JS.EndLocationChanging",mt._internal.navigationManager.endLocationChanging),r.onclose((e=>{this._interopMethodsForReconnection=function(e){const t=C.get(e);if(!t)throw new Error(`Interop methods are not registered for renderer ${e}`);return C.delete(e),t}(Ln.Server),this._disposed||this._renderingFailed||this._options.reconnectionHandler.onConnectionDown(this._options.reconnectionOptions,e)})),r.on("JS.Error",(e=>{this._renderingFailed=!0,this.unhandledError(e),Lo()}));try{await r.start()}catch(e){if(this.unhandledError(e),"FailedToNegotiateWithServerError"===e.errorType)throw e;Lo(),e.innerErrors&&(e.innerErrors.some((e=>"UnsupportedTransportError"===e.errorType&&e.transport===En.WebSockets))?this._logger.log(Bt.Error,"Unable to connect, please ensure you are using an updated browser that supports WebSockets."):e.innerErrors.some((e=>"FailedToStartTransportError"===e.errorType&&e.transport===En.WebSockets))?this._logger.log(Bt.Error,"Unable to connect, please ensure WebSockets are available. A VPN or proxy may be blocking the connection."):e.innerErrors.some((e=>"DisabledTransportError"===e.errorType&&e.transport===En.LongPolling))&&this._logger.log(Bt.Error,"Unable to initiate a SignalR connection to the server. This might be because the server is not configured to support WebSockets. For additional details, visit https://aka.ms/blazor-server-websockets-error."))}return(null===(t=null===(e=r.connection)||void 0===e?void 0:e.features)||void 0===t?void 0:t.inherentKeepAlive)&&this._logger.log(Bt.Warning,"Failed to connect via WebSockets, using the Long Polling fallback transport. This may be due to a VPN or proxy blocking the connection. To troubleshoot this, visit https://aka.ms/blazor-server-using-fallback-long-polling."),r}async disconnect(){var e;await(null===(e=this._connection)||void 0===e?void 0:e.stop())}async reconnect(){if(!this._circuitId)throw new Error("Circuit host not initialized.");return this._connection.state===ln.Connected||(this._connection=await this.startConnection(),this._interopMethodsForReconnection&&(k(Ln.Server,this._interopMethodsForReconnection),this._interopMethodsForReconnection=void 0),!!await this._connection.invoke("ConnectCircuit",this._circuitId)&&(this._options.reconnectionHandler.onConnectionUp(),!0))}beginInvokeDotNetFromJS(e,t,n,o,r){this.throwIfDispatchingWhenDisposed(),this._connection.send("BeginInvokeDotNetFromJS",e?e.toString():null,t,n,o||0,r)}endInvokeJSFromDotNet(e,t,n){this.throwIfDispatchingWhenDisposed(),this._connection.send("EndInvokeJSFromDotNet",e,t,n)}sendByteArray(e,t){this.throwIfDispatchingWhenDisposed(),this._connection.send("ReceiveByteArray",e,t)}throwIfDispatchingWhenDisposed(){if(this._disposed)throw new Error("The circuit associated with this dispatcher is no longer available.")}sendLocationChanged(e,t,n){return this._connection.send("OnLocationChanged",e,t,n)}sendLocationChanging(e,t,n,o){return this._connection.send("OnLocationChanging",e,t,n,o)}sendJsDataStream(e,t,n){return function(e,t,n,o){setTimeout((async()=>{let r=5,i=(new Date).valueOf();try{const s=t instanceof Blob?t.size:t.byteLength;let a=0,c=0;for(;a1)await e.send("ReceiveJSDataChunk",n,c,h,null);else{if(!await e.invoke("ReceiveJSDataChunk",n,c,h,null))break;const t=(new Date).valueOf(),o=t-i;i=t,r=Math.max(1,Math.round(500/Math.max(1,o)))}a+=l,c++}}catch(t){await e.send("ReceiveJSDataChunk",n,-1,null,t.toString())}}),0)}(this._connection,e,t,n)}resolveElement(e){const t=w(e);if(t)return W(t,!0);const n=Number.parseInt(e);if(!Number.isNaN(n))return H(this._componentManager.resolveRootComponent(n));throw new Error(`Invalid sequence number or identifier '${e}'.`)}getRootComponentManager(){return this._componentManager}unhandledError(e){this._logger.log(Bt.Error,e),this.disconnect()}getDisconnectFormData(){const e=new FormData,t=this._circuitId;return e.append("circuitId",t),e}didRenderingFail(){return this._renderingFailed}isDisposedOrDisposing(){return void 0!==this._disposePromise}sendDisconnectBeacon(){if(this._disposed)return;const e=this.getDisconnectFormData();this._disposed=navigator.sendBeacon("_blazor/disconnect",e)}dispose(){return this._disposePromise||(this._disposePromise=this.disposeCore()),this._disposePromise}async disposeCore(){var e;if(!this._startPromise)return void(this._disposed=!0);await this._startPromise,this._disposed=!0,null===(e=this._connection)||void 0===e||e.stop();const t=this.getDisconnectFormData();fetch("_blazor/disconnect",{method:"POST",body:t});for(const e of this._options.circuitHandlers)e.onCircuitClosed&&e.onCircuitClosed()}}function Oo(e){const t={...Fo,...e};return e&&e.reconnectionOptions&&(t.reconnectionOptions={...Fo.reconnectionOptions,...e.reconnectionOptions}),t}const Fo={configureSignalR:e=>{},logLevel:vt.Warning,initializers:void 0,circuitHandlers:[],reconnectionOptions:{maxRetries:8,retryIntervalMilliseconds:2e4,dialogId:"components-reconnect-modal"}};class $o{constructor(e,t,n,o){this.maxRetries=t,this.document=n,this.logger=o,this.modal=this.document.createElement("div"),this.modal.id=e,this.maxRetries=t,this.modal.style.cssText=["position: fixed","top: 0","right: 0","bottom: 0","left: 0","z-index: 1050","display: none","overflow: hidden","background-color: #fff","opacity: 0.8","text-align: center","font-weight: bold","transition: visibility 0s linear 500ms"].join(";"),this.message=this.document.createElement("h5"),this.message.style.cssText="margin-top: 20px",this.button=this.document.createElement("button"),this.button.style.cssText="margin:5px auto 5px",this.button.textContent="Retry";const r=this.document.createElement("a");r.addEventListener("click",(()=>location.reload())),r.textContent="reload",this.reloadParagraph=this.document.createElement("p"),this.reloadParagraph.textContent="Alternatively, ",this.reloadParagraph.appendChild(r),this.modal.appendChild(this.message),this.modal.appendChild(this.button),this.modal.appendChild(this.reloadParagraph),this.loader=this.getLoader(),this.message.after(this.loader),this.button.addEventListener("click",(async()=>{this.show();try{await mt.reconnect()||this.rejected()}catch(e){this.logger.log(vt.Error,e),this.failed()}}))}show(){this.document.contains(this.modal)||this.document.body.appendChild(this.modal),this.modal.style.display="block",this.loader.style.display="inline-block",this.button.style.display="none",this.reloadParagraph.style.display="none",this.message.textContent="Attempting to reconnect to the server...",this.modal.style.visibility="hidden",setTimeout((()=>{this.modal.style.visibility="visible"}),0)}update(e){this.message.textContent=`Attempting to reconnect to the server: ${e} of ${this.maxRetries}`}hide(){this.modal.style.display="none"}failed(){this.button.style.display="block",this.reloadParagraph.style.display="none",this.loader.style.display="none";const e=this.document.createTextNode("Reconnection failed. Try "),t=this.document.createElement("a");t.textContent="reloading",t.setAttribute("href",""),t.addEventListener("click",(()=>location.reload()));const n=this.document.createTextNode(" the page if you're unable to reconnect.");this.message.replaceChildren(e,t,n)}rejected(){this.button.style.display="none",this.reloadParagraph.style.display="none",this.loader.style.display="none";const e=this.document.createTextNode("Could not reconnect to the server. "),t=this.document.createElement("a");t.textContent="Reload",t.setAttribute("href",""),t.addEventListener("click",(()=>location.reload()));const n=this.document.createTextNode(" the page to restore functionality.");this.message.replaceChildren(e,t,n)}getLoader(){const e=this.document.createElement("div");return e.style.cssText=["border: 0.3em solid #f3f3f3","border-top: 0.3em solid #3498db","border-radius: 50%","width: 2em","height: 2em","display: inline-block"].join(";"),e.animate([{transform:"rotate(0deg)"},{transform:"rotate(360deg)"}],{duration:2e3,iterations:1/0}),e}}class Ho{constructor(e,t,n){this.dialog=e,this.maxRetries=t,this.document=n,this.document=n;const o=this.document.getElementById(Ho.MaxRetriesId);o&&(o.innerText=this.maxRetries.toString())}show(){this.removeClasses(),this.dialog.classList.add(Ho.ShowClassName)}update(e){const t=this.document.getElementById(Ho.CurrentAttemptId);t&&(t.innerText=e.toString())}hide(){this.removeClasses(),this.dialog.classList.add(Ho.HideClassName)}failed(){this.removeClasses(),this.dialog.classList.add(Ho.FailedClassName)}rejected(){this.removeClasses(),this.dialog.classList.add(Ho.RejectedClassName)}removeClasses(){this.dialog.classList.remove(Ho.ShowClassName,Ho.HideClassName,Ho.FailedClassName,Ho.RejectedClassName)}}Ho.ShowClassName="components-reconnect-show",Ho.HideClassName="components-reconnect-hide",Ho.FailedClassName="components-reconnect-failed",Ho.RejectedClassName="components-reconnect-rejected",Ho.MaxRetriesId="components-reconnect-max-retries",Ho.CurrentAttemptId="components-reconnect-current-attempt";class Wo{constructor(e,t,n){this._currentReconnectionProcess=null,this._logger=e,this._reconnectionDisplay=t,this._reconnectCallback=n||mt.reconnect}onConnectionDown(e,t){if(!this._reconnectionDisplay){const t=document.getElementById(e.dialogId);this._reconnectionDisplay=t?new Ho(t,e.maxRetries,document):new $o(e.dialogId,e.maxRetries,document,this._logger)}this._currentReconnectionProcess||(this._currentReconnectionProcess=new jo(e,this._logger,this._reconnectCallback,this._reconnectionDisplay))}onConnectionUp(){this._currentReconnectionProcess&&(this._currentReconnectionProcess.dispose(),this._currentReconnectionProcess=null)}}class jo{constructor(e,t,n,o){this.logger=t,this.reconnectCallback=n,this.isDisposed=!1,this.reconnectDisplay=o,this.reconnectDisplay.show(),this.attemptPeriodicReconnection(e)}dispose(){this.isDisposed=!0,this.reconnectDisplay.hide()}async attemptPeriodicReconnection(e){for(let t=0;tjo.MaximumFirstRetryInterval?jo.MaximumFirstRetryInterval:e.retryIntervalMilliseconds;if(await this.delay(n),this.isDisposed)break;try{return await this.reconnectCallback()?void 0:void this.reconnectDisplay.rejected()}catch(e){this.logger.log(vt.Error,e)}}this.reconnectDisplay.failed()}delay(e){return new Promise((t=>setTimeout(t,e)))}}jo.MaximumFirstRetryInterval=3e3;class zo{constructor(e=!0,t,n,o=0){this.singleRuntime=e,this.logger=t,this.webRendererId=o,this.afterStartedCallbacks=[],n&&this.afterStartedCallbacks.push(...n)}async importInitializersAsync(e,t){await Promise.all(e.map((e=>async function(e,n){const o=function(e){const t=document.baseURI;return t.endsWith("/")?`${t}${e}`:`${t}/${e}`}(n),r=await import(o);if(void 0!==r){if(e.singleRuntime){const{beforeStart:n,afterStarted:o,beforeWebAssemblyStart:s,afterWebAssemblyStarted:a,beforeServerStart:c,afterServerStarted:l}=r;let h=n;e.webRendererId===Ln.Server&&c&&(h=c),e.webRendererId===Ln.WebAssembly&&s&&(h=s);let d=o;return e.webRendererId===Ln.Server&&l&&(d=l),e.webRendererId===Ln.WebAssembly&&a&&(d=a),i(e,h,d,t)}return function(e,t,n){var r;const s=n[0],{beforeStart:a,afterStarted:c,beforeWebStart:l,afterWebStarted:h,beforeWebAssemblyStart:d,afterWebAssemblyStarted:u,beforeServerStart:p,afterServerStarted:f}=t,g=!(l||h||d||u||p||f||!a&&!c),m=g&&s.enableClassicInitializers;if(g&&!s.enableClassicInitializers)null===(r=e.logger)||void 0===r||r.log(vt.Warning,`Initializer '${o}' will be ignored because multiple runtimes are available. use 'before(web|webAssembly|server)Start' and 'after(web|webAssembly|server)Started?' instead.)`);else if(m)return i(e,a,c,n);if(function(e){e.webAssembly?e.webAssembly.initializers||(e.webAssembly.initializers={beforeStart:[],afterStarted:[]}):e.webAssembly={initializers:{beforeStart:[],afterStarted:[]}},e.circuit?e.circuit.initializers||(e.circuit.initializers={beforeStart:[],afterStarted:[]}):e.circuit={initializers:{beforeStart:[],afterStarted:[]}}}(s),d&&s.webAssembly.initializers.beforeStart.push(d),u&&s.webAssembly.initializers.afterStarted.push(u),p&&s.circuit.initializers.beforeStart.push(p),f&&s.circuit.initializers.afterStarted.push(f),h&&e.afterStartedCallbacks.push(h),l)return l(s)}(e,r,t)}function i(e,t,n,o){if(n&&e.afterStartedCallbacks.push(n),t)return t(...o)}}(this,e))))}async invokeAfterStartedCallbacks(e){const t=function(e){var t;return null===(t=I.get(e))||void 0===t?void 0:t[1]}(this.webRendererId);t&&await t,await Promise.all(this.afterStartedCallbacks.map((t=>t(e))))}}let qo,Jo,Ko,Vo,Xo,Go,Yo,Qo;function Zo(e){if(Vo)throw new Error("Circuit options have already been configured.");if(Vo)throw new Error("WebAssembly options have already been configured.");qo=async function(e){const t=await e;Vo=Oo(t)}(e)}function er(e){if(void 0!==Go)throw new Error("Blazor Server has already started.");return Go=new Promise(tr.bind(null,e)),Go}async function tr(e,t,n){await qo;const o=await async function(e){if(e.initializers)return await Promise.all(e.initializers.beforeStart.map((t=>t(e)))),new zo(!1,void 0,e.initializers.afterStarted,Ln.Server);const t=await fetch("_blazor/initializers",{method:"GET",credentials:"include",cache:"no-cache"}),n=await t.json(),o=new zo(!0,void 0,void 0,Ln.Server);return await o.importInitializersAsync(n,[e]),o}(Vo);if(Jo=Et(document)||"",Xo=new wt(Vo.logLevel),Ko=new Bo(e,Jo,Vo,Xo),Xo.log(vt.Information,"Starting up Blazor server-side application."),mt.reconnect=async()=>!(Ko.didRenderingFail()||!await Ko.reconnect()&&(Xo.log(vt.Information,"Reconnection attempt to the circuit was rejected by the server. This may indicate that the associated state is no longer available on the server."),1)),mt.defaultReconnectionHandler=new Wo(Xo),Vo.reconnectionHandler=Vo.reconnectionHandler||mt.defaultReconnectionHandler,mt._internal.navigationManager.listenForNavigationEvents(Ln.Server,((e,t,n)=>Ko.sendLocationChanged(e,t,n)),((e,t,n,o)=>Ko.sendLocationChanging(e,t,n,o))),mt._internal.forceCloseConnection=()=>Ko.disconnect(),mt._internal.sendJSDataStream=(e,t,n)=>Ko.sendJsDataStream(e,t,n),!await Ko.start())return Xo.log(vt.Error,"Failed to start the circuit."),void t();const r=()=>{Ko.sendDisconnectBeacon()};mt.disconnect=r,window.addEventListener("unload",r,{capture:!1,once:!0}),Xo.log(vt.Information,"Blazor server-side application started."),o.invokeAfterStartedCallbacks(mt),t()}async function nr(){if(!Go)throw new Error("Cannot start the circuit until Blazor Server has started.");return!(!Ko||Ko.isDisposedOrDisposing())||(Yo?await Yo:(await Go,(!Ko||!Ko.didRenderingFail())&&(Ko&&Ko.isDisposedOrDisposing()&&(Jo=Et(document)||"",Ko=new Bo(Ko.getRootComponentManager(),Jo,Vo,Xo)),Yo=Ko.start(),async function(e){await e,Yo===e&&(Yo=void 0)}(Yo),Yo)))}function or(e){if(Ko&&!Ko.isDisposedOrDisposing())return Ko.updateRootComponents(e);!async function(e){await Go,await nr()&&Ko.updateRootComponents(e)}(e)}function rr(e){return Qo=e,Qo}var ir,sr;const ar=navigator,cr=ar.userAgentData&&ar.userAgentData.brands,lr=cr&&cr.length>0?cr.some((e=>"Google Chrome"===e.brand||"Microsoft Edge"===e.brand||"Chromium"===e.brand)):window.chrome,hr=null!==(sr=null===(ir=ar.userAgentData)||void 0===ir?void 0:ir.platform)&&void 0!==sr?sr:navigator.platform;function dr(e){return 0!==e.debugLevel&&(lr||navigator.userAgent.includes("Firefox"))}let ur,pr,fr,gr,mr,vr,yr;const wr=Math.pow(2,32),br=Math.pow(2,21)-1;let _r=null;function Sr(e){return pr.getI32(e)}const Cr={load:function(e,t){return async function(e,t){const{dotnet:n}=await async function(e){if("undefined"==typeof WebAssembly||!WebAssembly.validate)throw new Error("This browser does not support WebAssembly.");let t="_framework/dotnet.js";if(e.loadBootResource){const n="dotnetjs",o=e.loadBootResource(n,"dotnet.js",t,"","js-module-dotnet");if("string"==typeof o)t=o;else if(o)throw new Error(`For a ${n} resource, custom loaders must supply a URI string.`)}const n=new URL(t,document.baseURI).toString();return await import(n)}(e),o=function(e,t){const n={maxParallelDownloads:1e6,enableDownloadRetry:!1,applicationEnvironment:e.environment},o={...window.Module||{},onConfigLoaded:async n=>{n.environmentVariables||(n.environmentVariables={}),"sharded"===n.globalizationMode&&(n.environmentVariables.__BLAZOR_SHARDED_ICU="1"),mt._internal.getApplicationEnvironment=()=>n.applicationEnvironment,null==t||t(n),yr=await async function(e,t){var n,o,r;if(e.initializers)return await Promise.all(e.initializers.beforeStart.map((t=>t(e)))),new zo(!1,void 0,e.initializers.afterStarted,Ln.WebAssembly);{const i=[e,null!==(o=null===(n=t.resources)||void 0===n?void 0:n.extensions)&&void 0!==o?o:{}],s=new zo(!0,void 0,void 0,Ln.WebAssembly),a=Object.keys((null===(r=null==t?void 0:t.resources)||void 0===r?void 0:r.libraryInitializers)||{});return await s.importInitializersAsync(a,i),s}}(e,n)},onDownloadResourceProgress:Er,config:n,disableDotnet6Compatibility:!1,out:kr,err:Tr};return o}(e,t);e.applicationCulture&&n.withApplicationCulture(e.applicationCulture),e.environment&&n.withApplicationEnvironment(e.environment),e.loadBootResource&&n.withResourceLoader(e.loadBootResource),n.withModuleConfig(o),e.configureRuntime&&e.configureRuntime(n),vr=await n.create()}(e,t)},start:function(){return async function(){if(!vr)throw new Error("The runtime must be loaded it gets configured.");const{MONO:t,BINDING:n,Module:o,setModuleImports:r,INTERNAL:i,getConfig:s,invokeLibraryInitializers:a}=vr;fr=o,ur=n,pr=t,mr=i,function(e){const t=hr.match(/^Mac/i)?"Cmd":"Alt";dr(e)&&console.info(`Debugging hotkey: Shift+${t}+D (when application has focus)`),document.addEventListener("keydown",(t=>{t.shiftKey&&(t.metaKey||t.altKey)&&"KeyD"===t.code&&(dr(e)?navigator.userAgent.includes("Firefox")?async function(){const e=await fetch(`_framework/debug?url=${encodeURIComponent(location.href)}&isFirefox=true`);200!==e.status&&console.warn(await e.text())}():lr?function(){const e=document.createElement("a");e.href=`_framework/debug?url=${encodeURIComponent(location.href)}`,e.target="_blank",e.rel="noopener noreferrer",e.click()}():console.error("Currently, only Microsoft Edge (80+), Google Chrome, or Chromium, are supported for debugging."):console.error("Cannot start debugging, because the application was not compiled with debugging enabled."))}))}(s()),mt.runtime=vr,mt._internal.dotNetCriticalError=Tr,r("blazor-internal",{Blazor:{_internal:mt._internal}});const c=await vr.getAssemblyExports("Microsoft.AspNetCore.Components.WebAssembly");return Object.assign(mt._internal,{dotNetExports:{...c.Microsoft.AspNetCore.Components.WebAssembly.Services.DefaultWebAssemblyJSRuntime}}),gr=e.attachDispatcher({beginInvokeDotNetFromJS:(e,t,n,o,r)=>{if(Ar(),!o&&!t)throw new Error("Either assemblyName or dotNetObjectId must have a non null value.");const i=o?o.toString():t;mt._internal.dotNetExports.BeginInvokeDotNet(e?e.toString():null,i,n,r)},endInvokeJSFromDotNet:(e,t,n)=>{mt._internal.dotNetExports.EndInvokeJS(n)},sendByteArray:(e,t)=>{mt._internal.dotNetExports.ReceiveByteArrayFromJS(e,t)},invokeDotNetFromJS:(e,t,n,o)=>(Ar(),mt._internal.dotNetExports.InvokeDotNet(e||null,t,null!=n?n:0,o))}),{invokeLibraryInitializers:a}}()},callEntryPoint:async function(){try{await vr.runMain(vr.getConfig().mainAssemblyName,[])}catch(e){console.error(e),Lo()}},toUint8Array:function(e){const t=Rr(e),n=Sr(t),o=new Uint8Array(n);return o.set(fr.HEAPU8.subarray(t+4,t+4+n)),o},getArrayLength:function(e){return Sr(Rr(e))},getArrayEntryPtr:function(e,t,n){return Rr(e)+4+t*n},getObjectFieldsBaseAddress:function(e){return e+8},readInt16Field:function(e,t){return n=e+(t||0),pr.getI16(n);var n},readInt32Field:function(e,t){return Sr(e+(t||0))},readUint64Field:function(e,t){return function(e){const t=e>>2,n=fr.HEAPU32[t+1];if(n>br)throw new Error(`Cannot read uint64 with high order part ${n}, because the result would exceed Number.MAX_SAFE_INTEGER.`);return n*wr+fr.HEAPU32[t]}(e+(t||0))},readFloatField:function(e,t){return n=e+(t||0),pr.getF32(n);var n},readObjectField:function(e,t){return Sr(e+(t||0))},readStringField:function(e,t,n){const o=Sr(e+(t||0));if(0===o)return null;if(n){const e=ur.unbox_mono_obj(o);return"boolean"==typeof e?e?"":null:e}return ur.conv_string(o)},readStructField:function(e,t){return e+(t||0)},beginHeapLock:function(){return Ar(),_r=Dr.create(),_r},invokeWhenHeapUnlocked:function(e){_r?_r.enqueuePostReleaseAction(e):e()}};function Er(e,t){const n=e/t*100;document.documentElement.style.setProperty("--blazor-load-percentage",`${n}%`),document.documentElement.style.setProperty("--blazor-load-percentage-text",`"${Math.floor(n)}%"`)}const Ir=["DEBUGGING ENABLED"],kr=e=>Ir.indexOf(e)<0&&console.log(e),Tr=e=>{console.error(e||"(null)"),Lo()};function Rr(e){return e+12}function Ar(){if(_r)throw new Error("Assertion failed - heap is currently locked")}class Dr{enqueuePostReleaseAction(e){this.postReleaseActions||(this.postReleaseActions=[]),this.postReleaseActions.push(e)}release(){var e;if(_r!==this)throw new Error("Trying to release a lock which isn't current");for(mr.mono_wasm_gc_unlock(),_r=null;null===(e=this.postReleaseActions)||void 0===e?void 0:e.length;)this.postReleaseActions.shift()(),Ar()}static create(){return mr.mono_wasm_gc_lock(),new Dr}}class xr{constructor(e){this.batchAddress=e,this.arrayRangeReader=Nr,this.arrayBuilderSegmentReader=Mr,this.diffReader=Pr,this.editReader=Ur,this.frameReader=Lr}updatedComponents(){return Qo.readStructField(this.batchAddress,0)}referenceFrames(){return Qo.readStructField(this.batchAddress,Nr.structLength)}disposedComponentIds(){return Qo.readStructField(this.batchAddress,2*Nr.structLength)}disposedEventHandlerIds(){return Qo.readStructField(this.batchAddress,3*Nr.structLength)}updatedComponentsEntry(e,t){return Br(e,t,Pr.structLength)}referenceFramesEntry(e,t){return Br(e,t,Lr.structLength)}disposedComponentIdsEntry(e,t){const n=Br(e,t,4);return Qo.readInt32Field(n)}disposedEventHandlerIdsEntry(e,t){const n=Br(e,t,8);return Qo.readUint64Field(n)}}const Nr={structLength:8,values:e=>Qo.readObjectField(e,0),count:e=>Qo.readInt32Field(e,4)},Mr={structLength:12,values:e=>{const t=Qo.readObjectField(e,0),n=Qo.getObjectFieldsBaseAddress(t);return Qo.readObjectField(n,0)},offset:e=>Qo.readInt32Field(e,4),count:e=>Qo.readInt32Field(e,8)},Pr={structLength:4+Mr.structLength,componentId:e=>Qo.readInt32Field(e,0),edits:e=>Qo.readStructField(e,4),editsEntry:(e,t)=>Br(e,t,Ur.structLength)},Ur={structLength:20,editType:e=>Qo.readInt32Field(e,0),siblingIndex:e=>Qo.readInt32Field(e,4),newTreeIndex:e=>Qo.readInt32Field(e,8),moveToSiblingIndex:e=>Qo.readInt32Field(e,8),removedAttributeName:e=>Qo.readStringField(e,16)},Lr={structLength:36,frameType:e=>Qo.readInt16Field(e,4),subtreeLength:e=>Qo.readInt32Field(e,8),elementReferenceCaptureId:e=>Qo.readStringField(e,16),componentId:e=>Qo.readInt32Field(e,12),elementName:e=>Qo.readStringField(e,16),textContent:e=>Qo.readStringField(e,16),markupContent:e=>Qo.readStringField(e,16),attributeName:e=>Qo.readStringField(e,16),attributeValue:e=>Qo.readStringField(e,24,!0),attributeEventHandlerId:e=>Qo.readUint64Field(e,8)};function Br(e,t,n){return Qo.getArrayEntryPtr(e,t,n)}class Or{constructor(e){this.componentManager=e}resolveRegisteredElement(e){const t=Number.parseInt(e);if(!Number.isNaN(t))return H(this.componentManager.resolveRootComponent(t))}getParameterValues(e){return this.componentManager.initialComponents[e].parameterValues}getParameterDefinitions(e){return this.componentManager.initialComponents[e].parameterDefinitions}getTypeName(e){return this.componentManager.initialComponents[e].typeName}getAssembly(e){return this.componentManager.initialComponents[e].assembly}getCount(){return this.componentManager.initialComponents.length}}let Fr,$r,Hr,Wr,jr,zr=!1,qr=!1,Jr=!0,Kr=!1;const Vr=new Promise((e=>{jr=e}));let Xr;const Gr=new Promise((e=>{Xr=e}));let Yr;function Qr(e){if(void 0!==Wr)throw new Error("Blazor WebAssembly has already started.");return Wr=new Promise(Zr.bind(null,e)),Wr}async function Zr(e,t,n){(function(){if(window.parent!==window&&!window.opener&&window.frameElement){const e=window.sessionStorage&&window.sessionStorage["Microsoft.AspNetCore.Components.WebAssembly.Authentication.CachedAuthSettings"],t=e&&JSON.parse(e);return t&&t.redirect_uri&&location.href.startsWith(t.redirect_uri)}return!1})()&&await new Promise((()=>{}));const o=ei();!function(e){const t=D;D=(e,n,o)=>{((e,t,n)=>{const o=De(e);(null==o?void 0:o.eventDelegator.getHandler(t))&&Cr.invokeWhenHeapUnlocked(n)})(e,n,(()=>t(e,n,o)))}}(),mt._internal.applyHotReload=(e,t,n,o)=>{gr.invokeDotNetStaticMethod("Microsoft.AspNetCore.Components.WebAssembly","ApplyHotReloadDelta",e,t,n,o)},mt._internal.getApplyUpdateCapabilities=()=>gr.invokeDotNetStaticMethod("Microsoft.AspNetCore.Components.WebAssembly","GetApplyUpdateCapabilities"),mt._internal.invokeJSFromDotNet=ni,mt._internal.invokeJSJson=oi,mt._internal.endInvokeDotNetFromJS=ri,mt._internal.receiveWebAssemblyDotNetDataStream=ii,mt._internal.receiveByteArray=si;const r=rr(Cr);mt.platform=r,mt._internal.renderBatch=(e,t)=>{const n=Cr.beginHeapLock();try{xe(e,new xr(t))}finally{n.release()}},mt._internal.navigationManager.listenForNavigationEvents(Ln.WebAssembly,(async(e,t,n)=>{await gr.invokeDotNetStaticMethodAsync("Microsoft.AspNetCore.Components.WebAssembly","NotifyLocationChanged",e,t,n)}),(async(e,t,n,o)=>{const r=await gr.invokeDotNetStaticMethodAsync("Microsoft.AspNetCore.Components.WebAssembly","NotifyLocationChangingAsync",t,n,o);mt._internal.navigationManager.endLocationChanging(e,r)}));const i=new Or(e);let s;mt._internal.registeredComponents={getRegisteredComponentsCount:()=>i.getCount(),getAssembly:e=>i.getAssembly(e),getTypeName:e=>i.getTypeName(e),getParameterDefinitions:e=>i.getParameterDefinitions(e)||"",getParameterValues:e=>i.getParameterValues(e)||""},mt._internal.getPersistedState=()=>It(document,St)||"",mt._internal.getInitialComponentsUpdate=()=>Gr,mt._internal.updateRootComponents=e=>{var t;return null===(t=mt._internal.dotNetExports)||void 0===t?void 0:t.UpdateRootComponentsCore(e)},mt._internal.endUpdateRootComponents=t=>{var n;return null===(n=e.onAfterUpdateRootComponents)||void 0===n?void 0:n.call(e,t)},mt._internal.attachRootComponentToElement=(e,t,n)=>{const o=i.resolveRegisteredElement(e);o?Ae(n,o,t,!1):function(e,t,n){const o="::before";let r=!1;if(e.endsWith("::after"))e=e.slice(0,-7),r=!0;else if(e.endsWith(o))throw new Error(`The '${o}' selector is not supported.`);const i=w(e)||document.querySelector(e);if(!i)throw new Error(`Could not find any element matching selector '${e}'.`);Ae(n,W(i,!0),t,r)}(e,t,n)};try{await o,s=await r.start()}catch(e){throw new Error(`Failed to start platform. Reason: ${e}`)}r.callEntryPoint(),yr.invokeAfterStartedCallbacks(mt),qr=!0,t()}function ei(){return null!=Hr||(Hr=(async()=>{await $r;const e=null!=Fr?Fr:{},t=null==Fr?void 0:Fr.configureRuntime;e.configureRuntime=e=>{null==t||t(e),Kr&&e.withEnvironmentVariable("__BLAZOR_WEBASSEMBLY_WAIT_FOR_ROOT_COMPONENTS","true")},await Cr.load(e,jr),zr=!0})()),Hr}function ti(){return zr}function ni(t,n,o,r){const i=Cr.readStringField(t,0),s=Cr.readInt32Field(t,4),a=Cr.readStringField(t,8),c=Cr.readUint64Field(t,20);if(null!==a){const e=Cr.readUint64Field(t,12);if(0!==e)return gr.beginInvokeJSFromDotNet(e,i,a,s,c),0;{const e=gr.invokeJSFromDotNet(i,a,s,c);return null===e?0:ur.js_string_to_mono_string(e)}}{const t=e.findJSFunction(i,c).call(null,n,o,r);switch(s){case e.JSCallResultType.Default:return t;case e.JSCallResultType.JSObjectReference:return e.createJSObjectReference(t).__jsObjectId;case e.JSCallResultType.JSStreamReference:{const n=e.createJSStreamReference(t),o=JSON.stringify(n);return ur.js_string_to_mono_string(o)}case e.JSCallResultType.JSVoidResult:return null;default:throw new Error(`Invalid JS call result type '${s}'.`)}}}function oi(e,t,n,o,r){return 0!==r?(gr.beginInvokeJSFromDotNet(r,e,o,n,t),null):gr.invokeJSFromDotNet(e,o,n,t)}function ri(e,t,n){gr.endInvokeDotNetFromJS(e,t,n)}function ii(e,t,n,o){!function(e,t,n,o,r){let i=gt.get(t);if(!i){const n=new ReadableStream({start(e){gt.set(t,e),i=e}});e.supplyDotNetStream(t,n)}r?(i.error(r),gt.delete(t)):0===o?(i.close(),gt.delete(t)):i.enqueue(n.length===o?n:n.subarray(0,o))}(gr,e,t,n,o)}function si(e,t){gr.receiveByteArray(e,t)}function ai(e,t){t.namespaceURI?e.setAttributeNS(t.namespaceURI,t.name,t.value):e.setAttribute(t.name,t.value)}$r=new Promise((e=>{Yr=e}));const ci="data-permanent";var li,hi;!function(e){e[e.None=0]="None",e[e.Some=1]="Some",e[e.Infinite=2]="Infinite"}(li||(li={})),function(e){e.Keep="keep",e.Update="update",e.Insert="insert",e.Delete="delete"}(hi||(hi={}));class di{static create(e,t,n){return 0===t&&n===e.length?e:new di(e,t,n)}constructor(e,t,n){this.source=e,this.startIndex=t,this.length=n}item(e){return this.source.item(e+this.startIndex)}forEach(e,t){for(let t=0;t=n&&s>=o&&r(e.item(i),t.item(s))===li.None;)i--,s--,a++;return a}(e,t,o,o,n),i=function(e){var t;const n=[];let o=e.length-1,r=(null===(t=e[o])||void 0===t?void 0:t.length)-1;for(;o>0||r>0;){const t=0===o?hi.Insert:0===r?hi.Delete:e[o][r];switch(n.unshift(t),t){case hi.Keep:case hi.Update:o--,r--;break;case hi.Insert:r--;break;case hi.Delete:o--}}return n}(function(e,t,n){const o=[],r=[],i=e.length,s=t.length;if(0===i&&0===s)return[];for(let e=0;e<=i;e++)(o[e]=Array(s+1))[0]=e,r[e]=Array(s+1);const a=o[0];for(let e=1;e<=s;e++)a[e]=e;for(let a=1;a<=i;a++)for(let i=1;i<=s;i++){const s=n(e.item(a-1),t.item(i-1)),c=o[a-1][i]+1,l=o[a][i-1]+1;let h;switch(s){case li.None:h=o[a-1][i-1];break;case li.Some:h=o[a-1][i-1]+1;break;case li.Infinite:h=Number.MAX_VALUE}h{history.pushState(null,"",e),Pi(e,!0)}))}function Ni(e){Be()||Pi(location.href,!1)}function Mi(e){var t,n,o,r,i;if(Be()||e.defaultPrevented)return;const s=e.target;if(s instanceof HTMLFormElement){if(!function(e){const t=e.getAttribute("data-enhance");return"string"==typeof t&&""===t||"true"===(null==t?void 0:t.toLowerCase())}(s))return;const a=(null===(t=e.submitter)||void 0===t?void 0:t.getAttribute("formmethod"))||s.method;if("dialog"===a)return void console.warn('A form cannot be enhanced when its method is "dialog".');const c=(null===(n=e.submitter)||void 0===n?void 0:n.getAttribute("formtarget"))||s.target;if(""!==c&&"_self"!==c)return void console.warn('A form cannot be enhanced when its target is different from the default value "_self".');e.preventDefault();const l=new URL((null===(o=e.submitter)||void 0===o?void 0:o.getAttribute("formaction"))||s.action,document.baseURI),h={method:a},d=new FormData(s),u=null===(r=e.submitter)||void 0===r?void 0:r.getAttribute("name"),p=e.submitter.getAttribute("value");u&&p&&d.append(u,p);const f=new URLSearchParams(d).toString();if("get"===h.method)l.search=f,history.pushState(null,"",l.toString());else{const t=(null===(i=e.submitter)||void 0===i?void 0:i.getAttribute("formenctype"))||s.enctype;"multipart/form-data"===t?h.body=d:(h.body=f,h.headers={"content-type":t,accept:Ei})}Pi(l.toString(),!1,h)}}async function Pi(e,t,n,o){Ti=!0,null==Ii||Ii.abort(),function(e,t){null==ke||ke(e,t)}(e,t),Ii=new AbortController;const r=Ii.signal,i=fetch(e,Object.assign({signal:r,mode:"no-cors",headers:{accept:Ei}},n));let s=null;if(await async function(e,t,n,o){let r;try{if(r=await e,!r.body)return void n(r,"");const t=r.headers.get("ssr-framing");if(!t){const e=await r.text();return void n(r,e)}let o=!0;await r.body.pipeThrough(new TextDecoderStream).pipeThrough(function(e){let t="";return new TransformStream({transform(n,o){if(t+=n,t.indexOf(e,t.length-n.length-e.length)>=0){const n=t.split(e);n.slice(0,-1).forEach((e=>o.enqueue(e))),t=n[n.length-1]}},flush(e){e.enqueue(t)}})}(`\x3c!--${t}--\x3e`)).pipeTo(new WritableStream({write(e){o?(o=!1,n(r,e)):(e=>{const t=document.createRange().createContextualFragment(e);for(;t.firstChild;)document.body.appendChild(t.firstChild)})(e)}}))}catch(e){if("AbortError"===e.name&&t.aborted)return;throw e}}(i,r,((t,r)=>{const i=!(null==n?void 0:n.method)||"get"===n.method,a=t.status>=200&&t.status<300;if("opaque"===t.type){if(i)return void Li(e);throw new Error("Enhanced navigation does not support making a non-GET request to an endpoint that redirects to an external origin. Avoid enabling enhanced navigation for form posts that may perform external redirections.")}if(a&&"allow"!==t.headers.get("blazor-enhanced-nav")){if(i)return void Li(e);throw new Error("Enhanced navigation does not support making a non-GET request to a non-Blazor endpoint. Avoid enabling enhanced navigation for forms that post to a non-Blazor endpoint.")}(t.redirected||o)&&((o?"get"===o:i)?history.replaceState(null,"",t.url):t.url!==location.href&&history.pushState(null,"",t.url),e=t.url);const c=t.headers.get("blazor-enhanced-nav-redirect-location");if(c)return void location.replace(c);t.redirected||i||!a||(function(e){const t=new URL(e.url),n=new URL(Ri);return t.protocol===n.protocol&&t.host===n.host&&t.port===n.port&&t.pathname===n.pathname}(t)?location.href!==Ri&&history.pushState(null,"",Ri):s=`Cannot perform enhanced form submission that changes the URL (except via a redirection), because then back/forward would not work. Either remove this form's 'action' attribute, or change its method to 'get', or do not mark it as enhanced.\nOld URL: ${location.href}\nNew URL: ${t.url}`),Ri=t.url;const l=t.headers.get("content-type");if((null==l?void 0:l.startsWith("text/html"))&&r){const e=(new DOMParser).parseFromString(r,"text/html");pi(document,e),ki.documentUpdated()}else(null==l?void 0:l.startsWith("text/"))&&r?Ui(r):a||r?i?Li(e):Ui(`Error: ${n.method} request to ${e} returned non-HTML content of type ${l||"unspecified"}.`):Ui(`Error: ${t.status} ${t.statusText}`)})),!r.aborted){const t=e.indexOf("#");if(t>=0){const n=e.substring(t+1),o=document.getElementById(n);null==o||o.scrollIntoView()}if(Ti=!1,ki.enhancedNavigationCompleted(),s)throw new Error(s)}}function Ui(e){document.documentElement.textContent=e;const t=document.documentElement.style;t.fontFamily="consolas, monospace",t.whiteSpace="pre-wrap",t.padding="1rem"}function Li(e){history.replaceState(null,"",e+"?"),location.replace(e)}let Bi,Oi=!0;class Fi extends HTMLElement{connectedCallback(){var e;const t=this.parentNode;null===(e=t.parentNode)||void 0===e||e.removeChild(t),t.childNodes.forEach((e=>{if(e instanceof HTMLTemplateElement){const t=e.getAttribute("blazor-component-id");if(t)"true"!==e.getAttribute("enhanced-nav")&&Ii||function(e,t){const n=function(e){const t=`bl:${e}`,n=document.createNodeIterator(document,NodeFilter.SHOW_COMMENT);let o=null;for(;(o=n.nextNode())&&o.textContent!==t;);if(!o)return null;const r=`/bl:${e}`;let i=null;for(;(i=n.nextNode())&&i.textContent!==r;);return i?{startMarker:o,endMarker:i}:null}(e);if(n){const{startMarker:e,endMarker:o}=n;if(Oi)pi({startExclusive:e,endExclusive:o},t);else{const n=o.parentNode,r=new Range;for(r.setStart(e,e.textContent.length),r.setEnd(o,0),r.deleteContents();t.childNodes[0];)n.insertBefore(t.childNodes[0],o)}Bi.documentUpdated()}}(t,e.content);else switch(e.getAttribute("type")){case"redirection":const t=Le(e.content.textContent),n="form-post"===e.getAttribute("from");"true"===e.getAttribute("enhanced")&&Me(t)?Pi(t,!1,void 0,n?"post":"get"):n?t!==location.href&&location.assign(t):location.replace(t);break;case"error":Ui(e.content.textContent||"Error")}}}))}}class $i{constructor(e){var t;this._circuitInactivityTimeoutMs=e,this._rootComponentsBySsrComponentId=new Map,this._seenDescriptors=new Set,this._pendingOperationBatches={},this._nextOperationBatchId=1,this._nextSsrComponentId=1,this._didWebAssemblyFailToLoadQuickly=!1,this._isComponentRefreshPending=!1,this.initialComponents=[],t=()=>{this.rootComponentsMayRequireRefresh()},E.push(t)}onAfterRenderBatch(e){e===Ln.Server&&this.circuitMayHaveNoRootComponents()}onDocumentUpdated(){this.rootComponentsMayRequireRefresh()}onEnhancedNavigationCompleted(){this.rootComponentsMayRequireRefresh()}registerComponent(e){if(this._seenDescriptors.has(e))return;"auto"!==e.type&&"webassembly"!==e.type||this.startLoadingWebAssemblyIfNotStarted();const t=this._nextSsrComponentId++;this._seenDescriptors.add(e),this._rootComponentsBySsrComponentId.set(t,{descriptor:e,ssrComponentId:t})}unregisterComponent(e){this._seenDescriptors.delete(e.descriptor),this._rootComponentsBySsrComponentId.delete(e.ssrComponentId),this.circuitMayHaveNoRootComponents()}async startLoadingWebAssemblyIfNotStarted(){if(void 0!==Hr)return;Kr=!0;const e=ei();setTimeout((()=>{ti()||this.onWebAssemblyFailedToLoadQuickly()}),mt._internal.loadWebAssemblyQuicklyTimeout);const t=await Vr;(function(e){if(!e.cacheBootResources)return!1;const t=Hi(e);if(!t)return!1;const n=window.localStorage.getItem(t.key);return t.value===n})(t)||this.onWebAssemblyFailedToLoadQuickly(),await e,function(e){const t=Hi(e);t&&window.localStorage.setItem(t.key,t.value)}(t),this.rootComponentsMayRequireRefresh()}onWebAssemblyFailedToLoadQuickly(){this._didWebAssemblyFailToLoadQuickly||(this._didWebAssemblyFailToLoadQuickly=!0,this.rootComponentsMayRequireRefresh())}startCircutIfNotStarted(){return void 0===Go?er(this):!Ko||Ko.isDisposedOrDisposing()?nr():void 0}async startWebAssemblyIfNotStarted(){this.startLoadingWebAssemblyIfNotStarted(),void 0===Wr&&await Qr(this)}rootComponentsMayRequireRefresh(){this._isComponentRefreshPending||(this._isComponentRefreshPending=!0,setTimeout((()=>{this._isComponentRefreshPending=!1,this.refreshRootComponents(this._rootComponentsBySsrComponentId.values())}),0))}circuitMayHaveNoRootComponents(){if(this.rendererHasExistingOrPendingComponents(Ln.Server,"server","auto"))return clearTimeout(this._circuitInactivityTimeoutId),void(this._circuitInactivityTimeoutId=void 0);void 0===this._circuitInactivityTimeoutId&&(this._circuitInactivityTimeoutId=setTimeout((()=>{this.rendererHasExistingOrPendingComponents(Ln.Server,"server","auto")||(async function(){await(null==Ko?void 0:Ko.dispose())}(),this._circuitInactivityTimeoutId=void 0)}),this._circuitInactivityTimeoutMs))}rendererHasComponents(e){const t=De(e);return void 0!==t&&t.getRootComponentCount()>0}rendererHasExistingOrPendingComponents(e,...t){if(this.rendererHasComponents(e))return!0;for(const{descriptor:{type:n},assignedRendererId:o}of this._rootComponentsBySsrComponentId.values()){if(o===e)return!0;if(void 0===o&&-1!==t.indexOf(n))return!0}return!1}refreshRootComponents(e){const t=new Map;for(const n of e){const e=this.determinePendingOperation(n);if(!e)continue;const o=n.assignedRendererId;if(!o)throw new Error("Descriptors must be assigned a renderer ID before getting used as root components");let r=t.get(o);r||(r=[],t.set(o,r)),r.push(e)}for(const[e,n]of t){const t={batchId:this._nextOperationBatchId++,operations:n};this._pendingOperationBatches[t.batchId]=t;const o=JSON.stringify(t);e===Ln.Server?or(o):this.updateWebAssemblyRootComponents(o)}}updateWebAssemblyRootComponents(e){Jr?(Xr(e),Jr=!1):function(e){if(!Wr)throw new Error("Blazor WebAssembly has not started.");if(!mt._internal.updateRootComponents)throw new Error("Blazor WebAssembly has not initialized.");qr?mt._internal.updateRootComponents(e):async function(e){if(await Wr,!mt._internal.updateRootComponents)throw new Error("Blazor WebAssembly has not initialized.");mt._internal.updateRootComponents(e)}(e)}(e)}resolveRendererIdForDescriptor(e){switch("auto"===e.type?this.getAutoRenderMode():e.type){case"server":return this.startCircutIfNotStarted(),Ln.Server;case"webassembly":return this.startWebAssemblyIfNotStarted(),Ln.WebAssembly;case null:return null}}getAutoRenderMode(){return this.rendererHasExistingOrPendingComponents(Ln.WebAssembly,"webassembly")?"webassembly":this.rendererHasExistingOrPendingComponents(Ln.Server,"server")?"server":ti()?"webassembly":this._didWebAssemblyFailToLoadQuickly?"server":null}determinePendingOperation(e){if(t=e.descriptor,document.contains(t.start)){if(void 0===e.assignedRendererId){if(Ti||"loading"===document.readyState)return null;const t=this.resolveRendererIdForDescriptor(e.descriptor);return null===t?null:T(t)?(be(e.descriptor.start,!0),e.assignedRendererId=t,e.uniqueIdAtLastUpdate=e.descriptor.uniqueId,{type:"add",ssrComponentId:e.ssrComponentId,marker:Pt(e.descriptor)}):null}return T(e.assignedRendererId)?e.uniqueIdAtLastUpdate===e.descriptor.uniqueId?null:(e.uniqueIdAtLastUpdate=e.descriptor.uniqueId,{type:"update",ssrComponentId:e.ssrComponentId,marker:Pt(e.descriptor)}):null}return e.hasPendingRemoveOperation?null:void 0===e.assignedRendererId?(this.unregisterComponent(e),null):T(e.assignedRendererId)?(be(e.descriptor.start,!1),e.hasPendingRemoveOperation=!0,{type:"remove",ssrComponentId:e.ssrComponentId}):null;var t}resolveRootComponent(e){const t=this._rootComponentsBySsrComponentId.get(e);if(!t)throw new Error(`Could not resolve a root component with SSR component ID '${e}'.`);return t.descriptor}onAfterUpdateRootComponents(e){const t=this._pendingOperationBatches[e];delete this._pendingOperationBatches[e];for(const e of t.operations)switch(e.type){case"remove":{const t=this._rootComponentsBySsrComponentId.get(e.ssrComponentId);t&&this.unregisterComponent(t);break}}}}function Hi(e){var t;const n=null===(t=e.resources)||void 0===t?void 0:t.hash,o=e.mainAssemblyName;return n&&o?{key:`blazor-resource-hash:${o}`,value:n}:null}class Wi{constructor(){this._eventListeners=new Map}static create(e){const t=new Wi;return e.addEventListener=t.addEventListener.bind(t),e.removeEventListener=t.removeEventListener.bind(t),t}addEventListener(e,t){let n=this._eventListeners.get(e);n||(n=new Set,this._eventListeners.set(e,n)),n.add(t)}removeEventListener(e,t){var n;null===(n=this._eventListeners.get(e))||void 0===n||n.delete(t)}dispatchEvent(e,t){const n=this._eventListeners.get(e);if(!n)return;const o={...t,type:e};for(const e of n)e(o)}}let ji,zi=!1;function qi(e){var t,n,o,r;if(zi)throw new Error("Blazor has already started.");zi=!0,null!==(t=(e=e||{}).logLevel)&&void 0!==t||(e.logLevel=vt.Error),mt._internal.loadWebAssemblyQuicklyTimeout=3e3,mt._internal.isBlazorWeb=!0,mt._internal.hotReloadApplied=()=>{Pe()&&Ue(location.href,!0)},ji=new $i(null!==(o=null===(n=null==e?void 0:e.ssr)||void 0===n?void 0:n.circuitInactivityTimeoutMs)&&void 0!==o?o:2e3);const i=Wi.create(mt),s={documentUpdated:()=>{ji.onDocumentUpdated(),i.dispatchEvent("enhancedload",{})},enhancedNavigationCompleted(){ji.onEnhancedNavigationCompleted()}};return ui=ji,function(e,t){Bi=t,(null==e?void 0:e.disableDomPreservation)&&(Oi=!1),customElements.define("blazor-ssr-end",Fi)}(null==e?void 0:e.ssr,s),(null===(r=null==e?void 0:e.ssr)||void 0===r?void 0:r.disableDomPreservation)||Ai(s),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Ji.bind(null,e)):Ji(e),Promise.resolve()}function Ji(e){const t=Oo((null==e?void 0:e.circuit)||{});e.circuit=t;const n=async function(e,t){var n;const o=It(document,Ct,"initializers");if(!o)return new zo(!1,t);const r=null!==(n=JSON.parse(atob(o)))&&void 0!==n?n:[],i=new zo(!1,t);return await i.importInitializersAsync(r,[e]),i}(e,new wt(t.logLevel));Zo(Ki(n,t)),function(e){if(Fr)throw new Error("WebAssembly options have already been configured.");!async function(e){const t=await e;Fr=t,Yr()}(e)}(Ki(n,(null==e?void 0:e.webAssembly)||{})),function(e){const t=wi(document);for(const e of t)null==ui||ui.registerComponent(e)}(),ji.onDocumentUpdated(),async function(e){const t=await e;await t.invokeAfterStartedCallbacks(mt)}(n)}async function Ki(e,t){return await e,t}mt.start=qi,window.DotNet=e,document&&document.currentScript&&"false"!==document.currentScript.getAttribute("autostart")&&qi()})()})();
\ No newline at end of file
+(()=>{var e={778:()=>{},77:()=>{},203:()=>{},200:()=>{},628:()=>{},321:()=>{}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),(()=>{"use strict";var e,t,o;!function(e){const t=[],n="__jsObjectId",o="__dotNetObject",r="__byte[]",i="__dotNetStream",s="__jsStreamReferenceLength";let a,c;class l{constructor(e){this._jsObject=e,this._cachedFunctions=new Map}findFunction(e){const t=this._cachedFunctions.get(e);if(t)return t;let n,o=this._jsObject;if(e.split(".").forEach((t=>{if(!(t in o))throw new Error(`Could not find '${e}' ('${t}' was undefined).`);n=o,o=o[t]})),o instanceof Function)return o=o.bind(n),this._cachedFunctions.set(e,o),o;throw new Error(`The value '${e}' is not a function.`)}getWrappedObject(){return this._jsObject}}const h={0:new l(window)};h[0]._cachedFunctions.set("import",(e=>("string"==typeof e&&e.startsWith("./")&&(e=new URL(e.substr(2),document.baseURI).toString()),import(e))));let d,u=1;function p(e){t.push(e)}function f(e){if(e&&"object"==typeof e){h[u]=new l(e);const t={[n]:u};return u++,t}throw new Error(`Cannot create a JSObjectReference from the value '${e}'.`)}function g(e){let t=-1;if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Blob)t=e.size;else{if(!(e.buffer instanceof ArrayBuffer))throw new Error("Supplied value is not a typed array or blob.");if(void 0===e.byteLength)throw new Error(`Cannot create a JSStreamReference from the value '${e}' as it doesn't have a byteLength.`);t=e.byteLength}const o={[s]:t};try{const t=f(e);o[n]=t[n]}catch(t){throw new Error(`Cannot create a JSStreamReference from the value '${e}'.`)}return o}function m(e,n){c=e;const o=n?JSON.parse(n,((e,n)=>t.reduce(((t,n)=>n(e,t)),n))):null;return c=void 0,o}function v(){if(void 0===a)throw new Error("No call dispatcher has been set.");if(null===a)throw new Error("There are multiple .NET runtimes present, so a default dispatcher could not be resolved. Use DotNetObject to invoke .NET instance methods.");return a}e.attachDispatcher=function(e){const t=new y(e);return void 0===a?a=t:a&&(a=null),t},e.attachReviver=p,e.invokeMethod=function(e,t,...n){return v().invokeDotNetStaticMethod(e,t,...n)},e.invokeMethodAsync=function(e,t,...n){return v().invokeDotNetStaticMethodAsync(e,t,...n)},e.createJSObjectReference=f,e.createJSStreamReference=g,e.disposeJSObjectReference=function(e){const t=e&&e[n];"number"==typeof t&&_(t)},function(e){e[e.Default=0]="Default",e[e.JSObjectReference=1]="JSObjectReference",e[e.JSStreamReference=2]="JSStreamReference",e[e.JSVoidResult=3]="JSVoidResult"}(d=e.JSCallResultType||(e.JSCallResultType={}));class y{constructor(e){this._dotNetCallDispatcher=e,this._byteArraysToBeRevived=new Map,this._pendingDotNetToJSStreams=new Map,this._pendingAsyncCalls={},this._nextAsyncCallId=1}getDotNetCallDispatcher(){return this._dotNetCallDispatcher}invokeJSFromDotNet(e,t,n,o){const r=m(this,t),i=I(b(e,o)(...r||[]),n);return null==i?null:T(this,i)}beginInvokeJSFromDotNet(e,t,n,o,r){const i=new Promise((e=>{const o=m(this,n);e(b(t,r)(...o||[]))}));e&&i.then((t=>T(this,[e,!0,I(t,o)]))).then((t=>this._dotNetCallDispatcher.endInvokeJSFromDotNet(e,!0,t)),(t=>this._dotNetCallDispatcher.endInvokeJSFromDotNet(e,!1,JSON.stringify([e,!1,w(t)]))))}endInvokeDotNetFromJS(e,t,n){const o=t?m(this,n):new Error(n);this.completePendingCall(parseInt(e,10),t,o)}invokeDotNetStaticMethod(e,t,...n){return this.invokeDotNetMethod(e,t,null,n)}invokeDotNetStaticMethodAsync(e,t,...n){return this.invokeDotNetMethodAsync(e,t,null,n)}invokeDotNetMethod(e,t,n,o){if(this._dotNetCallDispatcher.invokeDotNetFromJS){const r=T(this,o),i=this._dotNetCallDispatcher.invokeDotNetFromJS(e,t,n,r);return i?m(this,i):null}throw new Error("The current dispatcher does not support synchronous calls from JS to .NET. Use invokeDotNetMethodAsync instead.")}invokeDotNetMethodAsync(e,t,n,o){if(e&&n)throw new Error(`For instance method calls, assemblyName should be null. Received '${e}'.`);const r=this._nextAsyncCallId++,i=new Promise(((e,t)=>{this._pendingAsyncCalls[r]={resolve:e,reject:t}}));try{const i=T(this,o);this._dotNetCallDispatcher.beginInvokeDotNetFromJS(r,e,t,n,i)}catch(e){this.completePendingCall(r,!1,e)}return i}receiveByteArray(e,t){this._byteArraysToBeRevived.set(e,t)}processByteArray(e){const t=this._byteArraysToBeRevived.get(e);return t?(this._byteArraysToBeRevived.delete(e),t):null}supplyDotNetStream(e,t){if(this._pendingDotNetToJSStreams.has(e)){const n=this._pendingDotNetToJSStreams.get(e);this._pendingDotNetToJSStreams.delete(e),n.resolve(t)}else{const n=new E;n.resolve(t),this._pendingDotNetToJSStreams.set(e,n)}}getDotNetStreamPromise(e){let t;if(this._pendingDotNetToJSStreams.has(e))t=this._pendingDotNetToJSStreams.get(e).streamPromise,this._pendingDotNetToJSStreams.delete(e);else{const n=new E;this._pendingDotNetToJSStreams.set(e,n),t=n.streamPromise}return t}completePendingCall(e,t,n){if(!this._pendingAsyncCalls.hasOwnProperty(e))throw new Error(`There is no pending async call with ID ${e}.`);const o=this._pendingAsyncCalls[e];delete this._pendingAsyncCalls[e],t?o.resolve(n):o.reject(n)}}function w(e){return e instanceof Error?`${e.message}\n${e.stack}`:e?e.toString():"null"}function b(e,t){const n=h[t];if(n)return n.findFunction(e);throw new Error(`JS object instance with ID ${t} does not exist (has it been disposed?).`)}function _(e){delete h[e]}e.findJSFunction=b,e.disposeJSObjectReferenceById=_;class S{constructor(e,t){this._id=e,this._callDispatcher=t}invokeMethod(e,...t){return this._callDispatcher.invokeDotNetMethod(null,e,this._id,t)}invokeMethodAsync(e,...t){return this._callDispatcher.invokeDotNetMethodAsync(null,e,this._id,t)}dispose(){this._callDispatcher.invokeDotNetMethodAsync(null,"__Dispose",this._id,null).catch((e=>console.error(e)))}serializeAsArg(){return{[o]:this._id}}}e.DotNetObject=S,p((function(e,t){if(t&&"object"==typeof t){if(t.hasOwnProperty(o))return new S(t[o],c);if(t.hasOwnProperty(n)){const e=t[n],o=h[e];if(o)return o.getWrappedObject();throw new Error(`JS object instance with Id '${e}' does not exist. It may have been disposed.`)}if(t.hasOwnProperty(r)){const e=t[r],n=c.processByteArray(e);if(void 0===n)throw new Error(`Byte array index '${e}' does not exist.`);return n}if(t.hasOwnProperty(i)){const e=t[i],n=c.getDotNetStreamPromise(e);return new C(n)}}return t}));class C{constructor(e){this._streamPromise=e}stream(){return this._streamPromise}async arrayBuffer(){return new Response(await this.stream()).arrayBuffer()}}class E{constructor(){this.streamPromise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}function I(e,t){switch(t){case d.Default:return e;case d.JSObjectReference:return f(e);case d.JSStreamReference:return g(e);case d.JSVoidResult:return null;default:throw new Error(`Invalid JS call result type '${t}'.`)}}let k=0;function T(e,t){k=0,c=e;const n=JSON.stringify(t,R);return c=void 0,n}function R(e,t){if(t instanceof S)return t.serializeAsArg();if(t instanceof Uint8Array){c.getDotNetCallDispatcher().sendByteArray(k,t);const e={[r]:k};return k++,e}return t}}(e||(e={})),function(e){e[e.prependFrame=1]="prependFrame",e[e.removeFrame=2]="removeFrame",e[e.setAttribute=3]="setAttribute",e[e.removeAttribute=4]="removeAttribute",e[e.updateText=5]="updateText",e[e.stepIn=6]="stepIn",e[e.stepOut=7]="stepOut",e[e.updateMarkup=8]="updateMarkup",e[e.permutationListEntry=9]="permutationListEntry",e[e.permutationListEnd=10]="permutationListEnd"}(t||(t={})),function(e){e[e.element=1]="element",e[e.text=2]="text",e[e.attribute=3]="attribute",e[e.component=4]="component",e[e.region=5]="region",e[e.elementReferenceCapture=6]="elementReferenceCapture",e[e.markup=8]="markup",e[e.namedEvent=10]="namedEvent"}(o||(o={}));class r{constructor(e,t){this.componentId=e,this.fieldValue=t}static fromEvent(e,t){const n=t.target;if(n instanceof Element){const t=function(e){return e instanceof HTMLInputElement?e.type&&"checkbox"===e.type.toLowerCase()?{value:e.checked}:{value:e.value}:e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement?{value:e.value}:null}(n);if(t)return new r(e,t.value)}return null}}const i=new Map,s=new Map,a=[];function c(e){return i.get(e)}function l(e){const t=i.get(e);return(null==t?void 0:t.browserEventName)||e}function h(e,t){e.forEach((e=>i.set(e,t)))}function d(e){const t=[];for(let n=0;ne.selected)).map((e=>e.value))}}{const e=function(e){return!!e&&"INPUT"===e.tagName&&"checkbox"===e.getAttribute("type")}(t);return{value:e?!!t.checked:t.value}}}}),h(["copy","cut","paste"],{createEventArgs:e=>({type:e.type})}),h(["drag","dragend","dragenter","dragleave","dragover","dragstart","drop"],{createEventArgs:e=>{return{...u(t=e),dataTransfer:t.dataTransfer?{dropEffect:t.dataTransfer.dropEffect,effectAllowed:t.dataTransfer.effectAllowed,files:Array.from(t.dataTransfer.files).map((e=>e.name)),items:Array.from(t.dataTransfer.items).map((e=>({kind:e.kind,type:e.type}))),types:t.dataTransfer.types}:null};var t}}),h(["focus","blur","focusin","focusout"],{createEventArgs:e=>({type:e.type})}),h(["keydown","keyup","keypress"],{createEventArgs:e=>{return{key:(t=e).key,code:t.code,location:t.location,repeat:t.repeat,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,type:t.type};var t}}),h(["contextmenu","click","mouseover","mouseout","mousemove","mousedown","mouseup","mouseleave","mouseenter","dblclick"],{createEventArgs:e=>u(e)}),h(["error"],{createEventArgs:e=>{return{message:(t=e).message,filename:t.filename,lineno:t.lineno,colno:t.colno,type:t.type};var t}}),h(["loadstart","timeout","abort","load","loadend","progress"],{createEventArgs:e=>{return{lengthComputable:(t=e).lengthComputable,loaded:t.loaded,total:t.total,type:t.type};var t}}),h(["touchcancel","touchend","touchmove","touchenter","touchleave","touchstart"],{createEventArgs:e=>{return{detail:(t=e).detail,touches:d(t.touches),targetTouches:d(t.targetTouches),changedTouches:d(t.changedTouches),ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,type:t.type};var t}}),h(["gotpointercapture","lostpointercapture","pointercancel","pointerdown","pointerenter","pointerleave","pointermove","pointerout","pointerover","pointerup"],{createEventArgs:e=>{return{...u(t=e),pointerId:t.pointerId,width:t.width,height:t.height,pressure:t.pressure,tiltX:t.tiltX,tiltY:t.tiltY,pointerType:t.pointerType,isPrimary:t.isPrimary};var t}}),h(["wheel","mousewheel"],{createEventArgs:e=>{return{...u(t=e),deltaX:t.deltaX,deltaY:t.deltaY,deltaZ:t.deltaZ,deltaMode:t.deltaMode};var t}}),h(["cancel","close","toggle"],{createEventArgs:()=>({})});const p=["date","datetime-local","month","time","week"],f=new Map;let g,m,v=0;const y={async add(e,t,n){if(!n)throw new Error("initialParameters must be an object, even if empty.");const o="__bl-dynamic-root:"+(++v).toString();f.set(o,e);const r=await S().invokeMethodAsync("AddRootComponent",t,o),i=new _(r,m[t]);return await i.setParameters(n),i}};function w(e){const t=f.get(e);if(t)return f.delete(e),t}class b{invoke(e){return this._callback(e)}setCallback(t){this._selfJSObjectReference||(this._selfJSObjectReference=e.createJSObjectReference(this)),this._callback=t}getJSObjectReference(){return this._selfJSObjectReference}dispose(){this._selfJSObjectReference&&e.disposeJSObjectReference(this._selfJSObjectReference)}}class _{constructor(e,t){this._jsEventCallbackWrappers=new Map,this._componentId=e;for(const e of t)"eventcallback"===e.type&&this._jsEventCallbackWrappers.set(e.name.toLowerCase(),new b)}setParameters(e){const t={},n=Object.entries(e||{}),o=n.length;for(const[e,o]of n){const n=this._jsEventCallbackWrappers.get(e.toLowerCase());n&&o?(n.setCallback(o),t[e]=n.getJSObjectReference()):t[e]=o}return S().invokeMethodAsync("SetRootComponentParameters",this._componentId,o,t)}async dispose(){if(null!==this._componentId){await S().invokeMethodAsync("RemoveRootComponent",this._componentId),this._componentId=null;for(const e of this._jsEventCallbackWrappers.values())e.dispose()}}}function S(){if(!g)throw new Error("Dynamic root components have not been enabled in this application.");return g}const C=new Map,E=[],I=new Map;function k(t,n,o,r){var i,s;if(C.has(t))throw new Error(`Interop methods are already registered for renderer ${t}`);C.set(t,n),o&&r&&Object.keys(o).length>0&&function(t,n,o){if(g)throw new Error("Dynamic root components have already been enabled.");g=t,m=n;for(const[t,r]of Object.entries(o)){const o=e.findJSFunction(t,0);for(const e of r)o(e,n[e])}}(A(t),o,r),null===(s=null===(i=I.get(t))||void 0===i?void 0:i[0])||void 0===s||s.call(i),function(e){for(const t of E)t(e)}(t)}function T(e){return C.has(e)}function R(e,t,n){return D(e,t.eventHandlerId,(()=>A(e).invokeMethodAsync("DispatchEventAsync",t,n)))}function A(e){const t=C.get(e);if(!t)throw new Error(`No interop methods are registered for renderer ${e}`);return t}let D=(e,t,n)=>n();const x=B(["abort","blur","cancel","canplay","canplaythrough","change","close","cuechange","durationchange","emptied","ended","error","focus","load","loadeddata","loadedmetadata","loadend","loadstart","mouseenter","mouseleave","pointerenter","pointerleave","pause","play","playing","progress","ratechange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeupdate","toggle","unload","volumechange","waiting","DOMNodeInsertedIntoDocument","DOMNodeRemovedFromDocument"]),N={submit:!0},M=B(["click","dblclick","mousedown","mousemove","mouseup"]);class P{constructor(e){this.browserRendererId=e,this.afterClickCallbacks=[];const t=++P.nextEventDelegatorId;this.eventsCollectionKey=`_blazorEvents_${t}`,this.eventInfoStore=new U(this.onGlobalEvent.bind(this))}setListener(e,t,n,o){const r=this.getEventHandlerInfosForElement(e,!0),i=r.getHandler(t);if(i)this.eventInfoStore.update(i.eventHandlerId,n);else{const i={element:e,eventName:t,eventHandlerId:n,renderingComponentId:o};this.eventInfoStore.add(i),r.setHandler(t,i)}}getHandler(e){return this.eventInfoStore.get(e)}removeListener(e){const t=this.eventInfoStore.remove(e);if(t){const e=t.element,n=this.getEventHandlerInfosForElement(e,!1);n&&n.removeHandler(t.eventName)}}notifyAfterClick(e){this.afterClickCallbacks.push(e),this.eventInfoStore.addGlobalListener("click")}setStopPropagation(e,t,n){this.getEventHandlerInfosForElement(e,!0).stopPropagation(t,n)}setPreventDefault(e,t,n){this.getEventHandlerInfosForElement(e,!0).preventDefault(t,n)}onGlobalEvent(e){if(!(e.target instanceof Element))return;this.dispatchGlobalEventToAllElements(e.type,e);const t=(n=e.type,s.get(n));var n;t&&t.forEach((t=>this.dispatchGlobalEventToAllElements(t,e))),"click"===e.type&&this.afterClickCallbacks.forEach((t=>t(e)))}dispatchGlobalEventToAllElements(e,t){const n=t.composedPath();let o=n.shift(),i=null,s=!1;const a=Object.prototype.hasOwnProperty.call(x,e);let l=!1;for(;o;){const u=o,p=this.getEventHandlerInfosForElement(u,!1);if(p){const n=p.getHandler(e);if(n&&(h=u,d=t.type,!((h instanceof HTMLButtonElement||h instanceof HTMLInputElement||h instanceof HTMLTextAreaElement||h instanceof HTMLSelectElement)&&Object.prototype.hasOwnProperty.call(M,d)&&h.disabled))){if(!s){const n=c(e);i=(null==n?void 0:n.createEventArgs)?n.createEventArgs(t):{},s=!0}Object.prototype.hasOwnProperty.call(N,t.type)&&t.preventDefault(),R(this.browserRendererId,{eventHandlerId:n.eventHandlerId,eventName:e,eventFieldInfo:r.fromEvent(n.renderingComponentId,t)},i)}p.stopPropagation(e)&&(l=!0),p.preventDefault(e)&&t.preventDefault()}o=a||l?void 0:n.shift()}var h,d}getEventHandlerInfosForElement(e,t){return Object.prototype.hasOwnProperty.call(e,this.eventsCollectionKey)?e[this.eventsCollectionKey]:t?e[this.eventsCollectionKey]=new L:null}}P.nextEventDelegatorId=0;class U{constructor(e){this.globalListener=e,this.infosByEventHandlerId={},this.countByEventName={},a.push(this.handleEventNameAliasAdded.bind(this))}add(e){if(this.infosByEventHandlerId[e.eventHandlerId])throw new Error(`Event ${e.eventHandlerId} is already tracked`);this.infosByEventHandlerId[e.eventHandlerId]=e,this.addGlobalListener(e.eventName)}get(e){return this.infosByEventHandlerId[e]}addGlobalListener(e){if(e=l(e),Object.prototype.hasOwnProperty.call(this.countByEventName,e))this.countByEventName[e]++;else{this.countByEventName[e]=1;const t=Object.prototype.hasOwnProperty.call(x,e);document.addEventListener(e,this.globalListener,t)}}update(e,t){if(Object.prototype.hasOwnProperty.call(this.infosByEventHandlerId,t))throw new Error(`Event ${t} is already tracked`);const n=this.infosByEventHandlerId[e];delete this.infosByEventHandlerId[e],n.eventHandlerId=t,this.infosByEventHandlerId[t]=n}remove(e){const t=this.infosByEventHandlerId[e];if(t){delete this.infosByEventHandlerId[e];const n=l(t.eventName);0==--this.countByEventName[n]&&(delete this.countByEventName[n],document.removeEventListener(n,this.globalListener))}return t}handleEventNameAliasAdded(e,t){if(Object.prototype.hasOwnProperty.call(this.countByEventName,e)){const n=this.countByEventName[e];delete this.countByEventName[e],document.removeEventListener(e,this.globalListener),this.addGlobalListener(t),this.countByEventName[t]+=n-1}}}class L{constructor(){this.handlers={},this.preventDefaultFlags=null,this.stopPropagationFlags=null}getHandler(e){return Object.prototype.hasOwnProperty.call(this.handlers,e)?this.handlers[e]:null}setHandler(e,t){this.handlers[e]=t}removeHandler(e){delete this.handlers[e]}preventDefault(e,t){return void 0!==t&&(this.preventDefaultFlags=this.preventDefaultFlags||{},this.preventDefaultFlags[e]=t),!!this.preventDefaultFlags&&this.preventDefaultFlags[e]}stopPropagation(e,t){return void 0!==t&&(this.stopPropagationFlags=this.stopPropagationFlags||{},this.stopPropagationFlags[e]=t),!!this.stopPropagationFlags&&this.stopPropagationFlags[e]}}function B(e){const t={};return e.forEach((e=>{t[e]=!0})),t}const O=Symbol(),F=Symbol(),$=Symbol();function H(e){const{start:t,end:n}=e,o=t[$];if(o){if(o!==e)throw new Error("The start component comment was already associated with another component descriptor.");return t}const r=t.parentNode;if(!r)throw new Error(`Comment not connected to the DOM ${t.textContent}`);const i=W(r,!0),s=Y(i);t[F]=i,t[$]=e;const a=W(t);if(n){const e=Y(a),o=Array.prototype.indexOf.call(s,a)+1;let r=null;for(;r!==n;){const n=s.splice(o,1)[0];if(!n)throw new Error("Could not find the end component comment in the parent logical node list");n[F]=t,e.push(n),r=n}}return a}function W(e,t){if(O in e)return e;const n=[];if(e.childNodes.length>0){if(!t)throw new Error("New logical elements must start empty, or allowExistingContents must be true");e.childNodes.forEach((t=>{const o=W(t,!0);o[F]=e,n.push(o)}))}return e[O]=n,e}function j(e){const t=Y(e);for(;t.length;)J(e,0)}function z(e,t){const n=document.createComment("!");return q(n,e,t),n}function q(e,t,n){const o=e;let r=e;if(e instanceof Comment){const t=Y(o);if((null==t?void 0:t.length)>0){const t=oe(o),n=new Range;n.setStartBefore(e),n.setEndAfter(t),r=n.extractContents()}}const i=K(o);if(i){const e=Y(i),t=Array.prototype.indexOf.call(e,o);e.splice(t,1),delete o[F]}const s=Y(t);if(n0;)J(n,0)}const o=n;o.parentNode.removeChild(o)}function K(e){return e[F]||null}function V(e,t){return Y(e)[t]}function X(e){return e[$]||null}function G(e){const t=te(e);return"http://www.w3.org/2000/svg"===t.namespaceURI&&"foreignObject"!==t.tagName}function Y(e){return e[O]}function Q(e){const t=Y(K(e));return t[Array.prototype.indexOf.call(t,e)+1]||null}function Z(e){return O in e}function ee(e,t){const n=Y(e);t.forEach((e=>{e.moveRangeStart=n[e.fromSiblingIndex],e.moveRangeEnd=oe(e.moveRangeStart)})),t.forEach((t=>{const o=document.createComment("marker");t.moveToBeforeMarker=o;const r=n[t.toSiblingIndex+1];r?r.parentNode.insertBefore(o,r):ne(o,e)})),t.forEach((e=>{const t=e.moveToBeforeMarker,n=t.parentNode,o=e.moveRangeStart,r=e.moveRangeEnd;let i=o;for(;i;){const e=i.nextSibling;if(n.insertBefore(i,t),i===r)break;i=e}n.removeChild(t)})),t.forEach((e=>{n[e.toSiblingIndex]=e.moveRangeStart}))}function te(e){if(e instanceof Element||e instanceof DocumentFragment)return e;if(e instanceof Comment)return e.parentNode;throw new Error("Not a valid logical element")}function ne(e,t){if(t instanceof Element||t instanceof DocumentFragment)t.appendChild(e);else{if(!(t instanceof Comment))throw new Error(`Cannot append node because the parent is not a valid logical element. Parent: ${t}`);{const n=Q(t);n?n.parentNode.insertBefore(e,n):ne(e,K(t))}}}function oe(e){if(e instanceof Element||e instanceof DocumentFragment)return e;const t=Q(e);if(t)return t.previousSibling;{const t=K(e);return t instanceof Element||t instanceof DocumentFragment?t.lastChild:oe(t)}}function re(e){return`_bl_${e}`}const ie="__internalId";e.attachReviver(((e,t)=>t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,ie)&&"string"==typeof t[ie]?function(e){const t=`[${re(e)}]`;return document.querySelector(t)}(t[ie]):t));const se="_blazorDeferredValue";function ae(e){e instanceof HTMLOptionElement?de(e):se in e&&he(e,e[se])}function ce(e){return"select-multiple"===e.type}function le(e,t){e.value=t||""}function he(e,t){e instanceof HTMLSelectElement?ce(e)?function(e,t){t||(t=[]);for(let n=0;n{$e()&&Ne(e,(e=>{Ge(e,!0,!1)}))}))}getRootComponentCount(){return this.rootComponentIds.size}attachRootComponentToLogicalElement(e,t,n){if(we(t))throw new Error(`Root component '${e}' could not be attached because its target element is already associated with a root component`);n&&(t=z(t,Y(t).length)),ye(t,!0),this.attachComponentToElement(e,t),this.rootComponentIds.add(e),fe.add(t)}updateComponent(e,t,n,o){var r;const i=this.childComponentLocations[t];if(!i)throw new Error(`No element is currently associated with component ${t}`);fe.delete(i)&&(j(i),i instanceof Comment&&(i.textContent="!"));const s=null===(r=te(i))||void 0===r?void 0:r.getRootNode(),a=s&&s.activeElement;this.applyEdits(e,t,i,0,n,o),a instanceof HTMLElement&&s&&s.activeElement!==a&&a.focus()}disposeComponent(e){if(this.rootComponentIds.delete(e)){const t=this.childComponentLocations[e];ye(t,!1),!0===t[me]?fe.add(t):j(t)}delete this.childComponentLocations[e]}disposeEventHandler(e){this.eventDelegator.removeListener(e)}attachComponentToElement(e,t){this.childComponentLocations[e]=t}applyEdits(e,n,o,r,i,s){let a,c=0,l=r;const h=e.arrayBuilderSegmentReader,d=e.editReader,u=e.frameReader,p=h.values(i),f=h.offset(i),g=f+h.count(i);for(let i=f;i{const t=document.createElement("script");t.textContent=e.textContent,e.getAttributeNames().forEach((n=>{t.setAttribute(n,e.getAttribute(n))})),e.parentNode.replaceChild(t,e)})),ue.content));var s;let a=0;for(;i.firstChild;)q(i.firstChild,r,a++)}applyAttribute(e,t,n,o){const r=e.frameReader,i=r.attributeName(o),s=r.attributeEventHandlerId(o);if(s){const e=Se(i);return void this.eventDelegator.setListener(n,e,s,t)}const a=r.attributeValue(o);this.setOrRemoveAttributeOrProperty(n,i,a)}insertFrameRange(e,t,n,o,r,i,s){const a=o;for(let a=i;a{tt(t,e)})},enableNavigationInterception:function(e){if(void 0!==Ee&&Ee!==e)throw new Error("Only one interactive runtime may enable navigation interception at a time.");Ee=e},setHasLocationChangingListeners:function(e,t){const n=qe.get(e);if(!n)throw new Error(`Renderer with ID '${e}' is not listening for navigation events`);n.hasLocationChangingEventListeners=t},endLocationChanging:function(e,t){Ke&&e===ze&&(Ke(t),Ke=null)},navigateTo:function(e,t){Xe(e,t,!0)},refresh:function(e){!e&&Be()?Oe(location.href,!0):location.reload()},getBaseURI:()=>document.baseURI,getLocationHref:()=>location.href,scrollToElement:Le};function Xe(e,t,n=!1){const o=Fe(e),r=rt();if(t.forceLoad||!Me(o)||"serverside-fullpageload"===r)!function(e,t){if(location.href===e){const t=e+"?";history.replaceState(null,"",t),location.replace(e)}else t?location.replace(e):location.href=e}(e,t.replaceHistoryEntry);else if("clientside-router"===r)Ge(o,!1,t.replaceHistoryEntry,t.historyEntryState,n);else{if("serverside-enhanced"!==r)throw new Error(`Unsupported page load mechanism: ${r}`);Oe(o,t.replaceHistoryEntry)}}async function Ge(e,t,n,o=void 0,r=!1){if(Ze(),Pe(e))return Ye(e,n,o),void Ue(e);const i=ot();(r||!(null==i?void 0:i.hasLocationChangingEventListeners)||await et(e,o,t,i))&&(Re=!0,Ye(e,n,o),await tt(t))}function Ye(e,t,n=void 0){t?history.replaceState({userState:n,_index:je},"",e):(je++,history.pushState({userState:n,_index:je},"",e))}function Qe(e){return new Promise((t=>{const n=Je;Je=()=>{Je=n,t()},history.go(e)}))}function Ze(){Ke&&(Ke(!1),Ke=null)}function et(e,t,n,o){return new Promise((r=>{Ze(),ze++,Ke=r,o.locationChanging(ze,e,t,n)}))}async function tt(e,t){const n=null!=t?t:location.href;await Promise.all(Array.from(qe,(async([t,o])=>{var r;T(t)&&await o.locationChanged(n,null===(r=history.state)||void 0===r?void 0:r.userState,e)})))}async function nt(e){var t,n;Je&&"serverside-enhanced"!==rt()&&await Je(e),je=null!==(n=null===(t=history.state)||void 0===t?void 0:t._index)&&void 0!==n?n:0}function ot(){const e=He();if(void 0!==e)return qe.get(e)}function rt(){return $e()?"clientside-router":Be()?"serverside-enhanced":window.Blazor._internal.isBlazorWeb?"serverside-fullpageload":"clientside-router"}const it={focus:function(e,t){if(e instanceof HTMLElement)e.focus({preventScroll:t});else{if(!(e instanceof SVGElement))throw new Error("Unable to focus an invalid element.");if(!e.hasAttribute("tabindex"))throw new Error("Unable to focus an SVG element that does not have a tabindex.");e.focus({preventScroll:t})}},focusBySelector:function(e,t){const n=document.querySelector(e);n&&(n.hasAttribute("tabindex")||(n.tabIndex=-1),n.focus({preventScroll:!0}))}},st={init:function(e,t,n,o=50){const r=ct(t);(r||document.documentElement).style.overflowAnchor="none";const i=document.createRange();u(n.parentElement)&&(t.style.display="table-row",n.style.display="table-row");const s=new IntersectionObserver((function(o){o.forEach((o=>{var r;if(!o.isIntersecting)return;i.setStartAfter(t),i.setEndBefore(n);const s=i.getBoundingClientRect().height,a=null===(r=o.rootBounds)||void 0===r?void 0:r.height;o.target===t?e.invokeMethodAsync("OnSpacerBeforeVisible",o.intersectionRect.top-o.boundingClientRect.top,s,a):o.target===n&&n.offsetHeight>0&&e.invokeMethodAsync("OnSpacerAfterVisible",o.boundingClientRect.bottom-o.intersectionRect.bottom,s,a)}))}),{root:r,rootMargin:`${o}px`});s.observe(t),s.observe(n);const a=d(t),c=d(n),{observersByDotNetObjectId:l,id:h}=lt(e);function d(e){const t={attributes:!0},n=new MutationObserver(((n,o)=>{u(e.parentElement)&&(o.disconnect(),e.style.display="table-row",o.observe(e,t)),s.unobserve(e),s.observe(e)}));return n.observe(e,t),n}function u(e){return null!==e&&(e instanceof HTMLTableElement&&""===e.style.display||"table"===e.style.display||e instanceof HTMLTableSectionElement&&""===e.style.display||"table-row-group"===e.style.display)}l[h]={intersectionObserver:s,mutationObserverBefore:a,mutationObserverAfter:c}},dispose:function(e){const{observersByDotNetObjectId:t,id:n}=lt(e),o=t[n];o&&(o.intersectionObserver.disconnect(),o.mutationObserverBefore.disconnect(),o.mutationObserverAfter.disconnect(),e.dispose(),delete t[n])}},at=Symbol();function ct(e){return e&&e!==document.body&&e!==document.documentElement?"visible"!==getComputedStyle(e).overflowY?e:ct(e.parentElement):null}function lt(e){var t;const n=e._callDispatcher,o=e._id;return null!==(t=n[at])&&void 0!==t||(n[at]={}),{observersByDotNetObjectId:n[at],id:o}}const ht={getAndRemoveExistingTitle:function(){var e;const t=document.head?document.head.getElementsByTagName("title"):[];if(0===t.length)return null;let n=null;for(let o=t.length-1;o>=0;o--){const r=t[o],i=r.previousSibling;i instanceof Comment&&null!==K(i)||(null===n&&(n=r.textContent),null===(e=r.parentNode)||void 0===e||e.removeChild(r))}return n}},dt={init:function(e,t){t._blazorInputFileNextFileId=0,t.addEventListener("click",(function(){t.value=""})),t.addEventListener("change",(function(){t._blazorFilesById={};const n=Array.prototype.map.call(t.files,(function(e){const n={id:++t._blazorInputFileNextFileId,lastModified:new Date(e.lastModified).toISOString(),name:e.name,size:e.size,contentType:e.type,readPromise:void 0,arrayBuffer:void 0,blob:e};return t._blazorFilesById[n.id]=n,n}));e.invokeMethodAsync("NotifyChange",n)}))},toImageFile:async function(e,t,n,o,r){const i=ut(e,t),s=await new Promise((function(e){const t=new Image;t.onload=function(){URL.revokeObjectURL(t.src),e(t)},t.onerror=function(){t.onerror=null,URL.revokeObjectURL(t.src)},t.src=URL.createObjectURL(i.blob)})),a=await new Promise((function(e){var t;const i=Math.min(1,o/s.width),a=Math.min(1,r/s.height),c=Math.min(i,a),l=document.createElement("canvas");l.width=Math.round(s.width*c),l.height=Math.round(s.height*c),null===(t=l.getContext("2d"))||void 0===t||t.drawImage(s,0,0,l.width,l.height),l.toBlob(e,n)})),c={id:++e._blazorInputFileNextFileId,lastModified:i.lastModified,name:i.name,size:(null==a?void 0:a.size)||0,contentType:n,blob:a||i.blob};return e._blazorFilesById[c.id]=c,c},readFileData:async function(e,t){return ut(e,t).blob}};function ut(e,t){const n=e._blazorFilesById[t];if(!n)throw new Error(`There is no file with ID ${t}. The file list may have changed. See https://aka.ms/aspnet/blazor-input-file-multiple-selections.`);return n}const pt=new Set,ft={enableNavigationPrompt:function(e){0===pt.size&&window.addEventListener("beforeunload",gt),pt.add(e)},disableNavigationPrompt:function(e){pt.delete(e),0===pt.size&&window.removeEventListener("beforeunload",gt)}};function gt(e){e.preventDefault(),e.returnValue=!0}async function mt(e,t,n){return e instanceof Blob?await async function(e,t,n){const o=e.slice(t,t+n),r=await o.arrayBuffer();return new Uint8Array(r)}(e,t,n):function(e,t,n){return new Uint8Array(e.buffer,e.byteOffset+t,n)}(e,t,n)}const vt=new Map,yt={navigateTo:function(e,t,n=!1){Xe(e,t instanceof Object?t:{forceLoad:t,replaceHistoryEntry:n})},registerCustomEventType:function(e,t){if(!t)throw new Error("The options parameter is required.");if(i.has(e))throw new Error(`The event '${e}' is already registered.`);if(t.browserEventName){const n=s.get(t.browserEventName);n?n.push(e):s.set(t.browserEventName,[e]),a.forEach((n=>n(e,t.browserEventName)))}i.set(e,t)},rootComponents:y,runtime:{},_internal:{navigationManager:Ve,domWrapper:it,Virtualize:st,PageTitle:ht,InputFile:dt,NavigationLock:ft,getJSDataStreamChunk:mt,attachWebRendererInterop:k}};var wt;window.Blazor=yt,function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Information=2]="Information",e[e.Warning=3]="Warning",e[e.Error=4]="Error",e[e.Critical=5]="Critical",e[e.None=6]="None"}(wt||(wt={}));class bt{log(e,t){}}bt.instance=new bt;class _t{constructor(e){this.minLevel=e}log(e,t){if(e>=this.minLevel){const n=`[${(new Date).toISOString()}] ${wt[e]}: ${t}`;switch(e){case wt.Critical:case wt.Error:console.error(n);break;case wt.Warning:console.warn(n);break;case wt.Information:console.info(n);break;default:console.log(n)}}}}function St(e,t){switch(t){case"webassembly":return Rt(e,"webassembly");case"server":return function(e){return Rt(e,"server").sort(((e,t)=>e.sequence-t.sequence))}(e);case"auto":return Rt(e,"auto")}}const Ct=/^\s*Blazor-Server-Component-State:(?[a-zA-Z0-9+/=]+)$/,Et=/^\s*Blazor-WebAssembly-Component-State:(?[a-zA-Z0-9+/=]+)$/,It=/^\s*Blazor-Web-Initializers:(?[a-zA-Z0-9+/=]+)$/;function kt(e){return Tt(e,Ct)}function Tt(e,t,n="state"){var o;if(e.nodeType===Node.COMMENT_NODE){const r=e.textContent||"",i=t.exec(r),s=i&&i.groups&&i.groups[n];return s&&(null===(o=e.parentNode)||void 0===o||o.removeChild(e)),s}if(!e.hasChildNodes())return;const r=e.childNodes;for(let e=0;e.*)$/);function Dt(e,t){const n=e.currentElement;var o,r,i;if(n&&n.nodeType===Node.COMMENT_NODE&&n.textContent){const s=At.exec(n.textContent),a=s&&s.groups&&s.groups.descriptor;if(!a)return;!function(e){if(e.parentNode instanceof Document)throw new Error("Root components cannot be marked as interactive. The element must be rendered statically so that scripts are not evaluated multiple times.")}(n);try{const s=function(e){const t=JSON.parse(e),{type:n}=t;if("server"!==n&&"webassembly"!==n&&"auto"!==n)throw new Error(`Invalid component type '${n}'.`);return t}(a),c=function(e,t,n){const{prerenderId:o}=e;if(o){for(;n.next()&&n.currentElement;){const e=n.currentElement;if(e.nodeType!==Node.COMMENT_NODE)continue;if(!e.textContent)continue;const t=At.exec(e.textContent),r=t&&t[1];if(r)return Pt(r,o),e}throw new Error(`Could not find an end component comment for '${t}'.`)}}(s,n,e);if(t!==s.type)return;switch(s.type){case"webassembly":return r=n,i=c,Mt(o=s),{...o,uniqueId:xt++,start:r,end:i};case"server":return function(e,t,n){return Nt(e),{...e,uniqueId:xt++,start:t,end:n}}(s,n,c);case"auto":return function(e,t,n){return Nt(e),Mt(e),{...e,uniqueId:xt++,start:t,end:n}}(s,n,c)}}catch(e){throw new Error(`Found malformed component comment at ${n.textContent}`)}}}let xt=0;function Nt(e){const{descriptor:t,sequence:n}=e;if(!t)throw new Error("descriptor must be defined when using a descriptor.");if(void 0===n)throw new Error("sequence must be defined when using a descriptor.");if(!Number.isInteger(n))throw new Error(`Error parsing the sequence '${n}' for component '${JSON.stringify(e)}'`)}function Mt(e){const{assembly:t,typeName:n}=e;if(!t)throw new Error("assembly must be defined when using a descriptor.");if(!n)throw new Error("typeName must be defined when using a descriptor.");e.parameterDefinitions=e.parameterDefinitions&&atob(e.parameterDefinitions),e.parameterValues=e.parameterValues&&atob(e.parameterValues)}function Pt(e,t){const n=JSON.parse(e);if(1!==Object.keys(n).length)throw new Error(`Invalid end of component comment: '${e}'`);const o=n.prerenderId;if(!o)throw new Error(`End of component comment must have a value for the prerendered property: '${e}'`);if(o!==t)throw new Error(`End of component comment prerendered property must match the start comment prerender id: '${t}', '${o}'`)}class Ut{constructor(e){this.childNodes=e,this.currentIndex=-1,this.length=e.length}next(){return this.currentIndex++,this.currentIndex{n+=`0x${e<16?"0":""}${e.toString(16)} `})),n.substr(0,n.length-1)}(e)}'`)):"string"==typeof e&&(n=`String data of length ${e.length}`,t&&(n+=`. Content: '${e}'`)),n}function qt(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}async function Jt(e,t,n,o,r,i){const s={},[a,c]=Xt();s[a]=c,e.log(Ft.Trace,`(${t} transport) sending data. ${zt(r,i.logMessageContent)}.`);const l=qt(r)?"arraybuffer":"text",h=await n.post(o,{content:r,headers:{...s,...i.headers},responseType:l,timeout:i.timeout,withCredentials:i.withCredentials});e.log(Ft.Trace,`(${t} transport) request complete. Response status: ${h.statusCode}.`)}class Kt{constructor(e,t){this._subject=e,this._observer=t}dispose(){const e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),0===this._subject.observers.length&&this._subject.cancelCallback&&this._subject.cancelCallback().catch((e=>{}))}}class Vt{constructor(e){this._minLevel=e,this.out=console}log(e,t){if(e>=this._minLevel){const n=`[${(new Date).toISOString()}] ${Ft[e]}: ${t}`;switch(e){case Ft.Critical:case Ft.Error:this.out.error(n);break;case Ft.Warning:this.out.warn(n);break;case Ft.Information:this.out.info(n);break;default:this.out.log(n)}}}}function Xt(){let e="X-SignalR-User-Agent";return jt.isNode&&(e="User-Agent"),[e,Gt(Ht,Yt(),jt.isNode?"NodeJS":"Browser",Qt())]}function Gt(e,t,n,o){let r="Microsoft SignalR/";const i=e.split(".");return r+=`${i[0]}.${i[1]}`,r+=` (${e}; `,r+=t&&""!==t?`${t}; `:"Unknown OS; ",r+=`${n}`,r+=o?`; ${o}`:"; Unknown Runtime Version",r+=")",r}function Yt(){if(!jt.isNode)return"";switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}}function Qt(){if(jt.isNode)return process.versions.node}function Zt(e){return e.stack?e.stack:e.message?e.message:`${e}`}class en{writeHandshakeRequest(e){return Ot.write(JSON.stringify(e))}parseHandshakeResponse(e){let t,n;if(qt(e)){const o=new Uint8Array(e),r=o.indexOf(Ot.RecordSeparatorCode);if(-1===r)throw new Error("Message is incomplete.");const i=r+1;t=String.fromCharCode.apply(null,Array.prototype.slice.call(o.slice(0,i))),n=o.byteLength>i?o.slice(i).buffer:null}else{const o=e,r=o.indexOf(Ot.RecordSeparator);if(-1===r)throw new Error("Message is incomplete.");const i=r+1;t=o.substring(0,i),n=o.length>i?o.substring(i):null}const o=Ot.parse(t),r=JSON.parse(o[0]);if(r.type)throw new Error("Expected a handshake response from the server.");return[n,r]}}class tn extends Error{constructor(e,t){const n=new.target.prototype;super(`${e}: Status code '${t}'`),this.statusCode=t,this.__proto__=n}}class nn extends Error{constructor(e="A timeout occurred."){const t=new.target.prototype;super(e),this.__proto__=t}}class on extends Error{constructor(e="An abort occurred."){const t=new.target.prototype;super(e),this.__proto__=t}}class rn extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.transport=t,this.errorType="UnsupportedTransportError",this.__proto__=n}}class sn extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.transport=t,this.errorType="DisabledTransportError",this.__proto__=n}}class an extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.transport=t,this.errorType="FailedToStartTransportError",this.__proto__=n}}class cn extends Error{constructor(e){const t=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=t}}class ln extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.innerErrors=t,this.__proto__=n}}var hn,dn;!function(e){e[e.Invocation=1]="Invocation",e[e.StreamItem=2]="StreamItem",e[e.Completion=3]="Completion",e[e.StreamInvocation=4]="StreamInvocation",e[e.CancelInvocation=5]="CancelInvocation",e[e.Ping=6]="Ping",e[e.Close=7]="Close",e[e.Ack=8]="Ack",e[e.Sequence=9]="Sequence"}(hn||(hn={}));class un{constructor(){this.observers=[]}next(e){for(const t of this.observers)t.next(e)}error(e){for(const t of this.observers)t.error&&t.error(e)}complete(){for(const e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new Kt(this,e)}}class pn{constructor(e,t,n){this._bufferSize=1e5,this._messages=[],this._totalMessageCount=0,this._waitForSequenceMessage=!1,this._nextReceivingSequenceId=1,this._latestReceivedSequenceId=0,this._bufferedByteCount=0,this._reconnectInProgress=!1,this._protocol=e,this._connection=t,this._bufferSize=n}async _send(e){const t=this._protocol.writeMessage(e);let n=Promise.resolve();if(this._isInvocationMessage(e)){this._totalMessageCount++;let e=()=>{},o=()=>{};qt(t)?this._bufferedByteCount+=t.byteLength:this._bufferedByteCount+=t.length,this._bufferedByteCount>=this._bufferSize&&(n=new Promise(((t,n)=>{e=t,o=n}))),this._messages.push(new fn(t,this._totalMessageCount,e,o))}try{this._reconnectInProgress||await this._connection.send(t)}catch{this._disconnected()}await n}_ack(e){let t=-1;for(let n=0;nthis._nextReceivingSequenceId?this._connection.stop(new Error("Sequence ID greater than amount of messages we've received.")):this._nextReceivingSequenceId=e.sequenceId}_disconnected(){this._reconnectInProgress=!0,this._waitForSequenceMessage=!0}async _resend(){const e=0!==this._messages.length?this._messages[0]._id:this._totalMessageCount+1;await this._connection.send(this._protocol.writeMessage({type:hn.Sequence,sequenceId:e}));const t=this._messages;for(const e of t)await this._connection.send(e._message);this._reconnectInProgress=!1}_dispose(e){null!=e||(e=new Error("Unable to reconnect to server."));for(const t of this._messages)t._rejector(e)}_isInvocationMessage(e){switch(e.type){case hn.Invocation:case hn.StreamItem:case hn.Completion:case hn.StreamInvocation:case hn.CancelInvocation:return!0;case hn.Close:case hn.Sequence:case hn.Ping:case hn.Ack:return!1}}_ackTimer(){void 0===this._ackTimerHandle&&(this._ackTimerHandle=setTimeout((async()=>{try{this._reconnectInProgress||await this._connection.send(this._protocol.writeMessage({type:hn.Ack,sequenceId:this._latestReceivedSequenceId}))}catch{}clearTimeout(this._ackTimerHandle),this._ackTimerHandle=void 0}),1e3))}}class fn{constructor(e,t,n,o){this._message=e,this._id=t,this._resolver=n,this._rejector=o}}!function(e){e.Disconnected="Disconnected",e.Connecting="Connecting",e.Connected="Connected",e.Disconnecting="Disconnecting",e.Reconnecting="Reconnecting"}(dn||(dn={}));class gn{static create(e,t,n,o,r,i,s){return new gn(e,t,n,o,r,i,s)}constructor(e,t,n,o,r,i,s){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(Ft.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")},Wt.isRequired(e,"connection"),Wt.isRequired(t,"logger"),Wt.isRequired(n,"protocol"),this.serverTimeoutInMilliseconds=null!=r?r:3e4,this.keepAliveIntervalInMilliseconds=null!=i?i:15e3,this._statefulReconnectBufferSize=null!=s?s:1e5,this._logger=t,this._protocol=n,this.connection=e,this._reconnectPolicy=o,this._handshakeProtocol=new en,this.connection.onreceive=e=>this._processIncomingData(e),this.connection.onclose=e=>this._connectionClosed(e),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=dn.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:hn.Ping})}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(e){if(this._connectionState!==dn.Disconnected&&this._connectionState!==dn.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}async _startWithStateTransitions(){if(this._connectionState!==dn.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=dn.Connecting,this._logger.log(Ft.Debug,"Starting HubConnection.");try{await this._startInternal(),jt.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=dn.Connected,this._connectionStarted=!0,this._logger.log(Ft.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=dn.Disconnected,this._logger.log(Ft.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}}async _startInternal(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;const e=new Promise(((e,t)=>{this._handshakeResolver=e,this._handshakeRejecter=t}));await this.connection.start(this._protocol.transferFormat);try{let t=this._protocol.version;this.connection.features.reconnect||(t=1);const n={protocol:this._protocol.name,version:t};if(this._logger.log(Ft.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(n)),this._logger.log(Ft.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await e,this._stopDuringStartError)throw this._stopDuringStartError;!!this.connection.features.reconnect&&(this._messageBuffer=new pn(this._protocol,this.connection,this._statefulReconnectBufferSize),this.connection.features.disconnected=this._messageBuffer._disconnected.bind(this._messageBuffer),this.connection.features.resend=()=>{if(this._messageBuffer)return this._messageBuffer._resend()}),this.connection.features.inherentKeepAlive||await this._sendMessage(this._cachedPingMessage)}catch(e){throw this._logger.log(Ft.Debug,`Hub handshake failed with error '${e}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),await this.connection.stop(e),e}}async stop(){const e=this._startPromise;this.connection.features.reconnect=!1,this._stopPromise=this._stopInternal(),await this._stopPromise;try{await e}catch(e){}}_stopInternal(e){if(this._connectionState===dn.Disconnected)return this._logger.log(Ft.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this._connectionState===dn.Disconnecting)return this._logger.log(Ft.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;const t=this._connectionState;return this._connectionState=dn.Disconnecting,this._logger.log(Ft.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(Ft.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(t===dn.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new on("The connection was stopped before the hub handshake could complete."),this.connection.stop(e))}async _sendCloseMessage(){try{await this._sendWithProtocol(this._createCloseMessage())}catch{}}stream(e,...t){const[n,o]=this._replaceStreamingParams(t),r=this._createStreamInvocation(e,t,o);let i;const s=new un;return s.cancelCallback=()=>{const e=this._createCancelInvocation(r.invocationId);return delete this._callbacks[r.invocationId],i.then((()=>this._sendWithProtocol(e)))},this._callbacks[r.invocationId]=(e,t)=>{t?s.error(t):e&&(e.type===hn.Completion?e.error?s.error(new Error(e.error)):s.complete():s.next(e.item))},i=this._sendWithProtocol(r).catch((e=>{s.error(e),delete this._callbacks[r.invocationId]})),this._launchStreams(n,i),s}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._messageBuffer?this._messageBuffer._send(e):this._sendMessage(this._protocol.writeMessage(e))}send(e,...t){const[n,o]=this._replaceStreamingParams(t),r=this._sendWithProtocol(this._createInvocation(e,t,!0,o));return this._launchStreams(n,r),r}invoke(e,...t){const[n,o]=this._replaceStreamingParams(t),r=this._createInvocation(e,t,!1,o);return new Promise(((e,t)=>{this._callbacks[r.invocationId]=(n,o)=>{o?t(o):n&&(n.type===hn.Completion?n.error?t(new Error(n.error)):e(n.result):t(new Error(`Unexpected message type: ${n.type}`)))};const o=this._sendWithProtocol(r).catch((e=>{t(e),delete this._callbacks[r.invocationId]}));this._launchStreams(n,o)}))}on(e,t){e&&t&&(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),-1===this._methods[e].indexOf(t)&&this._methods[e].push(t))}off(e,t){if(!e)return;e=e.toLowerCase();const n=this._methods[e];if(n)if(t){const o=n.indexOf(t);-1!==o&&(n.splice(o,1),0===n.length&&delete this._methods[e])}else delete this._methods[e]}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(e=this._processHandshakeResponse(e),this._receivedHandshakeResponse=!0),e){const t=this._protocol.parseMessages(e,this._logger);for(const e of t)if(!this._messageBuffer||this._messageBuffer._shouldProcessMessage(e))switch(e.type){case hn.Invocation:this._invokeClientMethod(e);break;case hn.StreamItem:case hn.Completion:{const t=this._callbacks[e.invocationId];if(t){e.type===hn.Completion&&delete this._callbacks[e.invocationId];try{t(e)}catch(e){this._logger.log(Ft.Error,`Stream callback threw error: ${Zt(e)}`)}}break}case hn.Ping:break;case hn.Close:{this._logger.log(Ft.Information,"Close message received from server.");const t=e.error?new Error("Server returned an error on close: "+e.error):void 0;!0===e.allowReconnect?this.connection.stop(t):this._stopPromise=this._stopInternal(t);break}case hn.Ack:this._messageBuffer&&this._messageBuffer._ack(e);break;case hn.Sequence:this._messageBuffer&&this._messageBuffer._resetSequence(e);break;default:this._logger.log(Ft.Warning,`Invalid message type: ${e.type}.`)}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let t,n;try{[n,t]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(e){const t="Error parsing handshake response: "+e;this._logger.log(Ft.Error,t);const n=new Error(t);throw this._handshakeRejecter(n),n}if(t.error){const e="Server returned handshake error: "+t.error;this._logger.log(Ft.Error,e);const n=new Error(e);throw this._handshakeRejecter(n),n}return this._logger.log(Ft.Debug,"Server handshake complete."),this._handshakeResolver(),n}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=(new Date).getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if(!(this.connection.features&&this.connection.features.inherentKeepAlive||(this._timeoutHandle=setTimeout((()=>this.serverTimeout()),this.serverTimeoutInMilliseconds),void 0!==this._pingServerHandle))){let e=this._nextKeepAlive-(new Date).getTime();e<0&&(e=0),this._pingServerHandle=setTimeout((async()=>{if(this._connectionState===dn.Connected)try{await this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}}),e)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}async _invokeClientMethod(e){const t=e.target.toLowerCase(),n=this._methods[t];if(!n)return this._logger.log(Ft.Warning,`No client method with the name '${t}' found.`),void(e.invocationId&&(this._logger.log(Ft.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),await this._sendWithProtocol(this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null))));const o=n.slice(),r=!!e.invocationId;let i,s,a;for(const n of o)try{const o=i;i=await n.apply(this,e.arguments),r&&i&&o&&(this._logger.log(Ft.Error,`Multiple results provided for '${t}'. Sending error to server.`),a=this._createCompletionMessage(e.invocationId,"Client provided multiple results.",null)),s=void 0}catch(e){s=e,this._logger.log(Ft.Error,`A callback for the method '${t}' threw error '${e}'.`)}a?await this._sendWithProtocol(a):r?(s?a=this._createCompletionMessage(e.invocationId,`${s}`,null):void 0!==i?a=this._createCompletionMessage(e.invocationId,null,i):(this._logger.log(Ft.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),a=this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)),await this._sendWithProtocol(a)):i&&this._logger.log(Ft.Error,`Result given for '${t}' method but server is not expecting a result.`)}_connectionClosed(e){this._logger.log(Ft.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new on("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===dn.Disconnecting?this._completeClose(e):this._connectionState===dn.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===dn.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=dn.Disconnected,this._connectionStarted=!1,this._messageBuffer&&(this._messageBuffer._dispose(null!=e?e:new Error("Connection closed.")),this._messageBuffer=void 0),jt.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach((t=>t.apply(this,[e])))}catch(t){this._logger.log(Ft.Error,`An onclose callback called with error '${e}' threw error '${t}'.`)}}}async _reconnect(e){const t=Date.now();let n=0,o=void 0!==e?e:new Error("Attempting to reconnect due to a unknown error."),r=this._getNextRetryDelay(n++,0,o);if(null===r)return this._logger.log(Ft.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this._completeClose(e);if(this._connectionState=dn.Reconnecting,e?this._logger.log(Ft.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(Ft.Information,"Connection reconnecting."),0!==this._reconnectingCallbacks.length){try{this._reconnectingCallbacks.forEach((t=>t.apply(this,[e])))}catch(t){this._logger.log(Ft.Error,`An onreconnecting callback called with error '${e}' threw error '${t}'.`)}if(this._connectionState!==dn.Reconnecting)return void this._logger.log(Ft.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;null!==r;){if(this._logger.log(Ft.Information,`Reconnect attempt number ${n} will start in ${r} ms.`),await new Promise((e=>{this._reconnectDelayHandle=setTimeout(e,r)})),this._reconnectDelayHandle=void 0,this._connectionState!==dn.Reconnecting)return void this._logger.log(Ft.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this._startInternal(),this._connectionState=dn.Connected,this._logger.log(Ft.Information,"HubConnection reconnected successfully."),0!==this._reconnectedCallbacks.length)try{this._reconnectedCallbacks.forEach((e=>e.apply(this,[this.connection.connectionId])))}catch(e){this._logger.log(Ft.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${e}'.`)}return}catch(e){if(this._logger.log(Ft.Information,`Reconnect attempt failed because of error '${e}'.`),this._connectionState!==dn.Reconnecting)return this._logger.log(Ft.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this._connectionState===dn.Disconnecting&&this._completeClose());o=e instanceof Error?e:new Error(e.toString()),r=this._getNextRetryDelay(n++,Date.now()-t,o)}}this._logger.log(Ft.Information,`Reconnect retries have been exhausted after ${Date.now()-t} ms and ${n} failed attempts. Connection disconnecting.`),this._completeClose()}_getNextRetryDelay(e,t,n){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:t,previousRetryCount:e,retryReason:n})}catch(n){return this._logger.log(Ft.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${t}) threw error '${n}'.`),null}}_cancelCallbacksWithError(e){const t=this._callbacks;this._callbacks={},Object.keys(t).forEach((n=>{const o=t[n];try{o(null,e)}catch(t){this._logger.log(Ft.Error,`Stream 'error' callback called with '${e}' threw error: ${Zt(t)}`)}}))}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,t,n,o){if(n)return 0!==o.length?{arguments:t,streamIds:o,target:e,type:hn.Invocation}:{arguments:t,target:e,type:hn.Invocation};{const n=this._invocationId;return this._invocationId++,0!==o.length?{arguments:t,invocationId:n.toString(),streamIds:o,target:e,type:hn.Invocation}:{arguments:t,invocationId:n.toString(),target:e,type:hn.Invocation}}}_launchStreams(e,t){if(0!==e.length){t||(t=Promise.resolve());for(const n in e)e[n].subscribe({complete:()=>{t=t.then((()=>this._sendWithProtocol(this._createCompletionMessage(n))))},error:e=>{let o;o=e instanceof Error?e.message:e&&e.toString?e.toString():"Unknown error",t=t.then((()=>this._sendWithProtocol(this._createCompletionMessage(n,o))))},next:e=>{t=t.then((()=>this._sendWithProtocol(this._createStreamItemMessage(n,e))))}})}}_replaceStreamingParams(e){const t=[],n=[];for(let o=0;o0)&&(t=!1,this._accessToken=await this._accessTokenFactory()),this._setAuthorizationHeader(e);const n=await this._innerClient.send(e);return t&&401===n.statusCode&&this._accessTokenFactory?(this._accessToken=await this._accessTokenFactory(),this._setAuthorizationHeader(e),await this._innerClient.send(e)):n}_setAuthorizationHeader(e){e.headers||(e.headers={}),this._accessToken?e.headers[yn.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[yn.Authorization]&&delete e.headers[yn.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}}class Sn extends bn{constructor(e){super(),this._logger=e;const t={_fetchType:void 0,_jar:void 0};var o;o=t,"undefined"==typeof fetch&&(o._jar=new(n(628).CookieJar),"undefined"==typeof fetch?o._fetchType=n(200):o._fetchType=fetch,o._fetchType=n(203)(o._fetchType,o._jar),1)?(this._fetchType=t._fetchType,this._jar=t._jar):this._fetchType=fetch.bind(function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n.g)return n.g;throw new Error("could not find global")}()),this._abortControllerType=AbortController;const r={_abortControllerType:this._abortControllerType};(function(e){return"undefined"==typeof AbortController&&(e._abortControllerType=n(778),!0)})(r)&&(this._abortControllerType=r._abortControllerType)}async send(e){if(e.abortSignal&&e.abortSignal.aborted)throw new on;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");const t=new this._abortControllerType;let n;e.abortSignal&&(e.abortSignal.onabort=()=>{t.abort(),n=new on});let o,r=null;if(e.timeout){const o=e.timeout;r=setTimeout((()=>{t.abort(),this._logger.log(Ft.Warning,"Timeout from HTTP request."),n=new nn}),o)}""===e.content&&(e.content=void 0),e.content&&(e.headers=e.headers||{},qt(e.content)?e.headers["Content-Type"]="application/octet-stream":e.headers["Content-Type"]="text/plain;charset=UTF-8");try{o=await this._fetchType(e.url,{body:e.content,cache:"no-cache",credentials:!0===e.withCredentials?"include":"same-origin",headers:{"X-Requested-With":"XMLHttpRequest",...e.headers},method:e.method,mode:"cors",redirect:"follow",signal:t.signal})}catch(e){if(n)throw n;throw this._logger.log(Ft.Warning,`Error from HTTP request. ${e}.`),e}finally{r&&clearTimeout(r),e.abortSignal&&(e.abortSignal.onabort=null)}if(!o.ok){const e=await Cn(o,"text");throw new tn(e||o.statusText,o.status)}const i=Cn(o,e.responseType),s=await i;return new wn(o.status,o.statusText,s)}getCookieString(e){return""}}function Cn(e,t){let n;switch(t){case"arraybuffer":n=e.arrayBuffer();break;case"text":default:n=e.text();break;case"blob":case"document":case"json":throw new Error(`${t} is not supported.`)}return n}class En extends bn{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new on):e.method?e.url?new Promise(((t,n)=>{const o=new XMLHttpRequest;o.open(e.method,e.url,!0),o.withCredentials=void 0===e.withCredentials||e.withCredentials,o.setRequestHeader("X-Requested-With","XMLHttpRequest"),""===e.content&&(e.content=void 0),e.content&&(qt(e.content)?o.setRequestHeader("Content-Type","application/octet-stream"):o.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const r=e.headers;r&&Object.keys(r).forEach((e=>{o.setRequestHeader(e,r[e])})),e.responseType&&(o.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=()=>{o.abort(),n(new on)}),e.timeout&&(o.timeout=e.timeout),o.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),o.status>=200&&o.status<300?t(new wn(o.status,o.statusText,o.response||o.responseText)):n(new tn(o.response||o.responseText||o.statusText,o.status))},o.onerror=()=>{this._logger.log(Ft.Warning,`Error from HTTP request. ${o.status}: ${o.statusText}.`),n(new tn(o.statusText,o.status))},o.ontimeout=()=>{this._logger.log(Ft.Warning,"Timeout from HTTP request."),n(new nn)},o.send(e.content)})):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class In extends bn{constructor(e){if(super(),"undefined"!=typeof fetch)this._httpClient=new Sn(e);else{if("undefined"==typeof XMLHttpRequest)throw new Error("No usable HttpClient found.");this._httpClient=new En(e)}}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new on):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}}var kn,Tn;!function(e){e[e.None=0]="None",e[e.WebSockets=1]="WebSockets",e[e.ServerSentEvents=2]="ServerSentEvents",e[e.LongPolling=4]="LongPolling"}(kn||(kn={})),function(e){e[e.Text=1]="Text",e[e.Binary=2]="Binary"}(Tn||(Tn={}));class Rn{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}}class An{get pollAborted(){return this._pollAbort.aborted}constructor(e,t,n){this._httpClient=e,this._logger=t,this._pollAbort=new Rn,this._options=n,this._running=!1,this.onreceive=null,this.onclose=null}async connect(e,t){if(Wt.isRequired(e,"url"),Wt.isRequired(t,"transferFormat"),Wt.isIn(t,Tn,"transferFormat"),this._url=e,this._logger.log(Ft.Trace,"(LongPolling transport) Connecting."),t===Tn.Binary&&"undefined"!=typeof XMLHttpRequest&&"string"!=typeof(new XMLHttpRequest).responseType)throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[n,o]=Xt(),r={[n]:o,...this._options.headers},i={abortSignal:this._pollAbort.signal,headers:r,timeout:1e5,withCredentials:this._options.withCredentials};t===Tn.Binary&&(i.responseType="arraybuffer");const s=`${e}&_=${Date.now()}`;this._logger.log(Ft.Trace,`(LongPolling transport) polling: ${s}.`);const a=await this._httpClient.get(s,i);200!==a.statusCode?(this._logger.log(Ft.Error,`(LongPolling transport) Unexpected response code: ${a.statusCode}.`),this._closeError=new tn(a.statusText||"",a.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,i)}async _poll(e,t){try{for(;this._running;)try{const n=`${e}&_=${Date.now()}`;this._logger.log(Ft.Trace,`(LongPolling transport) polling: ${n}.`);const o=await this._httpClient.get(n,t);204===o.statusCode?(this._logger.log(Ft.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):200!==o.statusCode?(this._logger.log(Ft.Error,`(LongPolling transport) Unexpected response code: ${o.statusCode}.`),this._closeError=new tn(o.statusText||"",o.statusCode),this._running=!1):o.content?(this._logger.log(Ft.Trace,`(LongPolling transport) data received. ${zt(o.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(o.content)):this._logger.log(Ft.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(e){this._running?e instanceof nn?this._logger.log(Ft.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=e,this._running=!1):this._logger.log(Ft.Trace,`(LongPolling transport) Poll errored after shutdown: ${e.message}`)}}finally{this._logger.log(Ft.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(e){return this._running?Jt(this._logger,"LongPolling",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this._logger.log(Ft.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(Ft.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const e={},[t,n]=Xt();e[t]=n;const o={headers:{...e,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials};let r;try{await this._httpClient.delete(this._url,o)}catch(e){r=e}r?r instanceof tn&&(404===r.statusCode?this._logger.log(Ft.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this._logger.log(Ft.Trace,`(LongPolling transport) Error sending a DELETE request: ${r}`)):this._logger.log(Ft.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this._logger.log(Ft.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}}_raiseOnClose(){if(this.onclose){let e="(LongPolling transport) Firing onclose event.";this._closeError&&(e+=" Error: "+this._closeError),this._logger.log(Ft.Trace,e),this.onclose(this._closeError)}}}class Dn{constructor(e,t,n,o){this._httpClient=e,this._accessToken=t,this._logger=n,this._options=o,this.onreceive=null,this.onclose=null}async connect(e,t){return Wt.isRequired(e,"url"),Wt.isRequired(t,"transferFormat"),Wt.isIn(t,Tn,"transferFormat"),this._logger.log(Ft.Trace,"(SSE transport) Connecting."),this._url=e,this._accessToken&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise(((n,o)=>{let r,i=!1;if(t===Tn.Text){if(jt.isBrowser||jt.isWebWorker)r=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{const t=this._httpClient.getCookieString(e),n={};n.Cookie=t;const[o,i]=Xt();n[o]=i,r=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:{...n,...this._options.headers}})}try{r.onmessage=e=>{if(this.onreceive)try{this._logger.log(Ft.Trace,`(SSE transport) data received. ${zt(e.data,this._options.logMessageContent)}.`),this.onreceive(e.data)}catch(e){return void this._close(e)}},r.onerror=e=>{i?this._close():o(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."))},r.onopen=()=>{this._logger.log(Ft.Information,`SSE connected to ${this._url}`),this._eventSource=r,i=!0,n()}}catch(e){return void o(e)}}else o(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))}))}async send(e){return this._eventSource?Jt(this._logger,"SSE",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}}class xn{constructor(e,t,n,o,r,i){this._logger=n,this._accessTokenFactory=t,this._logMessageContent=o,this._webSocketConstructor=r,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=i}async connect(e,t){let n;return Wt.isRequired(e,"url"),Wt.isRequired(t,"transferFormat"),Wt.isIn(t,Tn,"transferFormat"),this._logger.log(Ft.Trace,"(WebSockets transport) Connecting."),this._accessTokenFactory&&(n=await this._accessTokenFactory()),new Promise(((o,r)=>{let i;e=e.replace(/^http/,"ws");const s=this._httpClient.getCookieString(e);let a=!1;if(jt.isReactNative){const t={},[o,r]=Xt();t[o]=r,n&&(t[yn.Authorization]=`Bearer ${n}`),s&&(t[yn.Cookie]=s),i=new this._webSocketConstructor(e,void 0,{headers:{...t,...this._headers}})}else n&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(n)}`);i||(i=new this._webSocketConstructor(e)),t===Tn.Binary&&(i.binaryType="arraybuffer"),i.onopen=t=>{this._logger.log(Ft.Information,`WebSocket connected to ${e}.`),this._webSocket=i,a=!0,o()},i.onerror=e=>{let t=null;t="undefined"!=typeof ErrorEvent&&e instanceof ErrorEvent?e.error:"There was an error with the transport",this._logger.log(Ft.Information,`(WebSockets transport) ${t}.`)},i.onmessage=e=>{if(this._logger.log(Ft.Trace,`(WebSockets transport) data received. ${zt(e.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(e.data)}catch(e){return void this._close(e)}},i.onclose=e=>{if(a)this._close(e);else{let t=null;t="undefined"!=typeof ErrorEvent&&e instanceof ErrorEvent?e.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.",r(new Error(t))}}}))}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(Ft.Trace,`(WebSockets transport) sending data. ${zt(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(Ft.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this._isCloseEvent(e)||!1!==e.wasClean&&1e3===e.code?e instanceof Error?this.onclose(e):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason||"no reason given"}).`)))}_isCloseEvent(e){return e&&"boolean"==typeof e.wasClean&&"number"==typeof e.code}}class Nn{constructor(e,t={}){if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,Wt.isRequired(e,"url"),this._logger=function(e){return void 0===e?new Vt(Ft.Information):null===e?$t.instance:void 0!==e.log?e:new Vt(e)}(t.logger),this.baseUrl=this._resolveUrl(e),(t=t||{}).logMessageContent=void 0!==t.logMessageContent&&t.logMessageContent,"boolean"!=typeof t.withCredentials&&void 0!==t.withCredentials)throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");t.withCredentials=void 0===t.withCredentials||t.withCredentials,t.timeout=void 0===t.timeout?1e5:t.timeout,"undefined"==typeof WebSocket||t.WebSocket||(t.WebSocket=WebSocket),"undefined"==typeof EventSource||t.EventSource||(t.EventSource=EventSource),this._httpClient=new _n(t.httpClient||new In(this._logger),t.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=t,this.onreceive=null,this.onclose=null}async start(e){if(e=e||Tn.Binary,Wt.isIn(e,Tn,"transferFormat"),this._logger.log(Ft.Debug,`Starting connection with transfer format '${Tn[e]}'.`),"Disconnected"!==this._connectionState)return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(e),await this._startInternalPromise,"Disconnecting"===this._connectionState){const e="Failed to start the HttpConnection before stop() was called.";return this._logger.log(Ft.Error,e),await this._stopPromise,Promise.reject(new on(e))}if("Connected"!==this._connectionState){const e="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(Ft.Error,e),Promise.reject(new on(e))}this._connectionStarted=!0}send(e){return"Connected"!==this._connectionState?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new Mn(this.transport)),this._sendQueue.send(e))}async stop(e){return"Disconnected"===this._connectionState?(this._logger.log(Ft.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):"Disconnecting"===this._connectionState?(this._logger.log(Ft.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState="Disconnecting",this._stopPromise=new Promise((e=>{this._stopPromiseResolver=e})),await this._stopInternal(e),void await this._stopPromise)}async _stopInternal(e){this._stopError=e;try{await this._startInternalPromise}catch(e){}if(this.transport){try{await this.transport.stop()}catch(e){this._logger.log(Ft.Error,`HttpConnection.transport.stop() threw error '${e}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(Ft.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async _startInternal(e){let t=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport!==kn.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(kn.WebSockets),await this._startTransport(t,e)}else{let n=null,o=0;do{if(n=await this._getNegotiationResponse(t),"Disconnecting"===this._connectionState||"Disconnected"===this._connectionState)throw new on("The connection was stopped during negotiation.");if(n.error)throw new Error(n.error);if(n.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(n.url&&(t=n.url),n.accessToken){const e=n.accessToken;this._accessTokenFactory=()=>e,this._httpClient._accessToken=e,this._httpClient._accessTokenFactory=void 0}o++}while(n.url&&o<100);if(100===o&&n.url)throw new Error("Negotiate redirection limit exceeded.");await this._createTransport(t,this._options.transport,n,e)}this.transport instanceof An&&(this.features.inherentKeepAlive=!0),"Connecting"===this._connectionState&&(this._logger.log(Ft.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(e){return this._logger.log(Ft.Error,"Failed to start the connection: "+e),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(e)}}async _getNegotiationResponse(e){const t={},[n,o]=Xt();t[n]=o;const r=this._resolveNegotiateUrl(e);this._logger.log(Ft.Debug,`Sending negotiation request: ${r}.`);try{const e=await this._httpClient.post(r,{content:"",headers:{...t,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(200!==e.statusCode)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${e.statusCode}'`));const n=JSON.parse(e.content);return(!n.negotiateVersion||n.negotiateVersion<1)&&(n.connectionToken=n.connectionId),n.useStatefulReconnect&&!0!==this._options._useStatefulReconnect?Promise.reject(new cn("Client didn't negotiate Stateful Reconnect but the server did.")):n}catch(e){let t="Failed to complete negotiation with the server: "+e;return e instanceof tn&&404===e.statusCode&&(t+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(Ft.Error,t),Promise.reject(new cn(t))}}_createConnectUrl(e,t){return t?e+(-1===e.indexOf("?")?"?":"&")+`id=${t}`:e}async _createTransport(e,t,n,o){let r=this._createConnectUrl(e,n.connectionToken);if(this._isITransport(t))return this._logger.log(Ft.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=t,await this._startTransport(r,o),void(this.connectionId=n.connectionId);const i=[],s=n.availableTransports||[];let a=n;for(const n of s){const s=this._resolveTransportOrError(n,t,o,!0===(null==a?void 0:a.useStatefulReconnect));if(s instanceof Error)i.push(`${n.transport} failed:`),i.push(s);else if(this._isITransport(s)){if(this.transport=s,!a){try{a=await this._getNegotiationResponse(e)}catch(e){return Promise.reject(e)}r=this._createConnectUrl(e,a.connectionToken)}try{return await this._startTransport(r,o),void(this.connectionId=a.connectionId)}catch(e){if(this._logger.log(Ft.Error,`Failed to start the transport '${n.transport}': ${e}`),a=void 0,i.push(new an(`${n.transport} failed: ${e}`,kn[n.transport])),"Connecting"!==this._connectionState){const e="Failed to select transport before stop() was called.";return this._logger.log(Ft.Debug,e),Promise.reject(new on(e))}}}}return i.length>0?Promise.reject(new ln(`Unable to connect to the server with any of the available transports. ${i.join(" ")}`,i)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))}_constructTransport(e){switch(e){case kn.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new xn(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case kn.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new Dn(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case kn.LongPolling:return new An(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,t){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(e,t),await this.features.resend()}catch{o=!0}o&&this._stopConnection(n)}else this._stopConnection(n)}:this.transport.onclose=e=>this._stopConnection(e),this.transport.connect(e,t)}_resolveTransportOrError(e,t,n,o){const r=kn[e.transport];if(null==r)return this._logger.log(Ft.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(!function(e,t){return!e||0!=(t&e)}(t,r))return this._logger.log(Ft.Debug,`Skipping transport '${kn[r]}' because it was disabled by the client.`),new sn(`'${kn[r]}' is disabled by the client.`,r);if(!(e.transferFormats.map((e=>Tn[e])).indexOf(n)>=0))return this._logger.log(Ft.Debug,`Skipping transport '${kn[r]}' because it does not support the requested transfer format '${Tn[n]}'.`),new Error(`'${kn[r]}' does not support ${Tn[n]}.`);if(r===kn.WebSockets&&!this._options.WebSocket||r===kn.ServerSentEvents&&!this._options.EventSource)return this._logger.log(Ft.Debug,`Skipping transport '${kn[r]}' because it is not supported in your environment.'`),new rn(`'${kn[r]}' is not supported in your environment.`,r);this._logger.log(Ft.Debug,`Selecting transport '${kn[r]}'.`);try{return this.features.reconnect=r===kn.WebSockets?o:void 0,this._constructTransport(r)}catch(e){return e}}_isITransport(e){return e&&"object"==typeof e&&"connect"in e}_stopConnection(e){if(this._logger.log(Ft.Debug,`HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`),this.transport=void 0,e=this._stopError||e,this._stopError=void 0,"Disconnected"!==this._connectionState){if("Connecting"===this._connectionState)throw this._logger.log(Ft.Warning,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);if("Disconnecting"===this._connectionState&&this._stopPromiseResolver(),e?this._logger.log(Ft.Error,`Connection disconnected with error '${e}'.`):this._logger.log(Ft.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch((e=>{this._logger.log(Ft.Error,`TransportSendQueue.stop() threw error '${e}'.`)})),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(t){this._logger.log(Ft.Error,`HttpConnection.onclose(${e}) threw error '${t}'.`)}}}else this._logger.log(Ft.Debug,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`)}_resolveUrl(e){if(0===e.lastIndexOf("https://",0)||0===e.lastIndexOf("http://",0))return e;if(!jt.isBrowser)throw new Error(`Cannot resolve '${e}'.`);const t=window.document.createElement("a");return t.href=e,this._logger.log(Ft.Information,`Normalizing '${e}' to '${t.href}'.`),t.href}_resolveNegotiateUrl(e){const t=new URL(e);t.pathname.endsWith("/")?t.pathname+="negotiate":t.pathname+="/negotiate";const n=new URLSearchParams(t.searchParams);return n.has("negotiateVersion")||n.append("negotiateVersion",this._negotiateVersion.toString()),n.has("useStatefulReconnect")?"true"===n.get("useStatefulReconnect")&&(this._options._useStatefulReconnect=!0):!0===this._options._useStatefulReconnect&&n.append("useStatefulReconnect","true"),t.search=n.toString(),t.toString()}}class Mn{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new Pn,this._transportResult=new Pn,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new Pn),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}async _sendLoop(){for(;;){if(await this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new Pn;const e=this._transportResult;this._transportResult=void 0;const t="string"==typeof this._buffer[0]?this._buffer.join(""):Mn._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(t),e.resolve()}catch(t){e.reject(t)}}}static _concatBuffers(e){const t=e.map((e=>e.byteLength)).reduce(((e,t)=>e+t)),n=new Uint8Array(t);let o=0;for(const t of e)n.set(new Uint8Array(t),o),o+=t.byteLength;return n.buffer}}class Pn{constructor(){this.promise=new Promise(((e,t)=>[this._resolver,this._rejecter]=[e,t]))}resolve(){this._resolver()}reject(e){this._rejecter(e)}}class Un{constructor(){this.name="json",this.version=2,this.transferFormat=Tn.Text}parseMessages(e,t){if("string"!=typeof e)throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];null===t&&(t=$t.instance);const n=Ot.parse(e),o=[];for(const e of n){const n=JSON.parse(e);if("number"!=typeof n.type)throw new Error("Invalid payload.");switch(n.type){case hn.Invocation:this._isInvocationMessage(n);break;case hn.StreamItem:this._isStreamItemMessage(n);break;case hn.Completion:this._isCompletionMessage(n);break;case hn.Ping:case hn.Close:break;case hn.Ack:this._isAckMessage(n);break;case hn.Sequence:this._isSequenceMessage(n);break;default:t.log(Ft.Information,"Unknown message type '"+n.type+"' ignored.");continue}o.push(n)}return o}writeMessage(e){return Ot.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,"Invalid payload for Invocation message."),void 0!==e.invocationId&&this._assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),void 0===e.item)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this._assertNotEmptyString(e.error,"Invalid payload for Completion message."),this._assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")}_isAckMessage(e){if("number"!=typeof e.sequenceId)throw new Error("Invalid SequenceId for Ack message.")}_isSequenceMessage(e){if("number"!=typeof e.sequenceId)throw new Error("Invalid SequenceId for Sequence message.")}_assertNotEmptyString(e,t){if("string"!=typeof e||""===e)throw new Error(t)}}const Ln={trace:Ft.Trace,debug:Ft.Debug,info:Ft.Information,information:Ft.Information,warn:Ft.Warning,warning:Ft.Warning,error:Ft.Error,critical:Ft.Critical,none:Ft.None};class Bn{configureLogging(e){if(Wt.isRequired(e,"logging"),function(e){return void 0!==e.log}(e))this.logger=e;else if("string"==typeof e){const t=function(e){const t=Ln[e.toLowerCase()];if(void 0!==t)return t;throw new Error(`Unknown log level: ${e}`)}(e);this.logger=new Vt(t)}else this.logger=new Vt(e);return this}withUrl(e,t){return Wt.isRequired(e,"url"),Wt.isNotEmpty(e,"url"),this.url=e,this.httpConnectionOptions="object"==typeof t?{...this.httpConnectionOptions,...t}:{...this.httpConnectionOptions,transport:t},this}withHubProtocol(e){return Wt.isRequired(e,"protocol"),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new vn(e):this.reconnectPolicy=e:this.reconnectPolicy=new vn,this}withServerTimeout(e){return Wt.isRequired(e,"milliseconds"),this._serverTimeoutInMilliseconds=e,this}withKeepAliveInterval(e){return Wt.isRequired(e,"milliseconds"),this._keepAliveIntervalInMilliseconds=e,this}withStatefulReconnect(e){return void 0===this.httpConnectionOptions&&(this.httpConnectionOptions={}),this.httpConnectionOptions._useStatefulReconnect=!0,this._statefulReconnectBufferSize=null==e?void 0:e.bufferSize,this}build(){const e=this.httpConnectionOptions||{};if(void 0===e.logger&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const t=new Nn(this.url,e);return gn.create(t,this.logger||$t.instance,this.protocol||new Un,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}}var On;!function(e){e[e.Default=0]="Default",e[e.Server=1]="Server",e[e.WebAssembly=2]="WebAssembly",e[e.WebView=3]="WebView"}(On||(On={}));var Fn,$n,Hn,Wn=4294967295;function jn(e,t,n){var o=Math.floor(n/4294967296),r=n;e.setUint32(t,o),e.setUint32(t+4,r)}function zn(e,t){return 4294967296*e.getInt32(t)+e.getUint32(t+4)}var qn=("undefined"==typeof process||"never"!==(null===(Fn=null===process||void 0===process?void 0:process.env)||void 0===Fn?void 0:Fn.TEXT_ENCODING))&&"undefined"!=typeof TextEncoder&&"undefined"!=typeof TextDecoder;function Jn(e){for(var t=e.length,n=0,o=0;o=55296&&r<=56319&&o65535&&(h-=65536,i.push(h>>>10&1023|55296),h=56320|1023&h),i.push(h)}else i.push(a);i.length>=4096&&(s+=String.fromCharCode.apply(String,i),i.length=0)}return i.length>0&&(s+=String.fromCharCode.apply(String,i)),s}var Yn,Qn=qn?new TextDecoder:null,Zn=qn?"undefined"!=typeof process&&"force"!==(null===(Hn=null===process||void 0===process?void 0:process.env)||void 0===Hn?void 0:Hn.TEXT_DECODER)?200:0:Wn,eo=function(e,t){this.type=e,this.data=t},to=(Yn=function(e,t){return Yn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Yn(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Yn(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),no=function(e){function t(n){var o=e.call(this,n)||this,r=Object.create(t.prototype);return Object.setPrototypeOf(o,r),Object.defineProperty(o,"name",{configurable:!0,enumerable:!1,value:t.name}),o}return to(t,e),t}(Error),oo={type:-1,encode:function(e){var t,n,o,r;return e instanceof Date?function(e){var t,n=e.sec,o=e.nsec;if(n>=0&&o>=0&&n<=17179869183){if(0===o&&n<=4294967295){var r=new Uint8Array(4);return(t=new DataView(r.buffer)).setUint32(0,n),r}var i=n/4294967296,s=4294967295&n;return r=new Uint8Array(8),(t=new DataView(r.buffer)).setUint32(0,o<<2|3&i),t.setUint32(4,s),r}return r=new Uint8Array(12),(t=new DataView(r.buffer)).setUint32(0,o),jn(t,4,n),r}((o=1e6*((t=e.getTime())-1e3*(n=Math.floor(t/1e3))),{sec:n+(r=Math.floor(o/1e9)),nsec:o-1e9*r})):null},decode:function(e){var t=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:var n=t.getUint32(0);return{sec:4294967296*(3&n)+t.getUint32(4),nsec:n>>>2};case 12:return{sec:zn(t,4),nsec:t.getUint32(0)};default:throw new no("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(e.length))}}(e);return new Date(1e3*t.sec+t.nsec/1e6)}},ro=function(){function e(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(oo)}return e.prototype.register=function(e){var t=e.type,n=e.encode,o=e.decode;if(t>=0)this.encoders[t]=n,this.decoders[t]=o;else{var r=1+t;this.builtInEncoders[r]=n,this.builtInDecoders[r]=o}},e.prototype.tryToEncode=function(e,t){for(var n=0;nthis.maxDepth)throw new Error("Too deep objects in depth ".concat(t));null==e?this.encodeNil():"boolean"==typeof e?this.encodeBoolean(e):"number"==typeof e?this.encodeNumber(e):"string"==typeof e?this.encodeString(e):this.encodeObject(e,t)},e.prototype.ensureBufferSizeToWrite=function(e){var t=this.pos+e;this.view.byteLength=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):(this.writeU8(211),this.writeI64(e)):this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))},e.prototype.writeStringHeader=function(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else{if(!(e<4294967296))throw new Error("Too long string: ".concat(e," bytes in UTF-8"));this.writeU8(219),this.writeU32(e)}},e.prototype.encodeString=function(e){if(e.length>Vn){var t=Jn(e);this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),Xn(e,this.bytes,this.pos),this.pos+=t}else t=Jn(e),this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),function(e,t,n){for(var o=e.length,r=n,i=0;i>6&31|192;else{if(s>=55296&&s<=56319&&i>12&15|224,t[r++]=s>>6&63|128):(t[r++]=s>>18&7|240,t[r++]=s>>12&63|128,t[r++]=s>>6&63|128)}t[r++]=63&s|128}else t[r++]=s}}(e,this.bytes,this.pos),this.pos+=t},e.prototype.encodeObject=function(e,t){var n=this.extensionCodec.tryToEncode(e,this.context);if(null!=n)this.encodeExtension(n);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else{if("object"!=typeof e)throw new Error("Unrecognized object: ".concat(Object.prototype.toString.apply(e)));this.encodeMap(e,t)}},e.prototype.encodeBinary=function(e){var t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too large binary: ".concat(t));this.writeU8(198),this.writeU32(t)}var n=io(e);this.writeU8a(n)},e.prototype.encodeArray=function(e,t){var n=e.length;if(n<16)this.writeU8(144+n);else if(n<65536)this.writeU8(220),this.writeU16(n);else{if(!(n<4294967296))throw new Error("Too large array: ".concat(n));this.writeU8(221),this.writeU32(n)}for(var o=0,r=e;o0&&e<=this.maxKeyLength},e.prototype.find=function(e,t,n){e:for(var o=0,r=this.caches[n-1];o=this.maxLengthPerKey?n[Math.random()*n.length|0]=o:n.push(o)},e.prototype.decode=function(e,t,n){var o=this.find(e,t,n);if(null!=o)return this.hit++,o;this.miss++;var r=Gn(e,t,n),i=Uint8Array.prototype.slice.call(e,t,t+n);return this.store(i,r),r},e}(),lo=function(e,t){var n,o,r,i,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,o=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]=e},e.prototype.createExtraByteError=function(e){var t=this.view,n=this.pos;return new RangeError("Extra ".concat(t.byteLength-n," of ").concat(t.byteLength," byte(s) found at buffer[").concat(e,"]"))},e.prototype.decode=function(e){this.reinitializeState(),this.setBuffer(e);var t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t},e.prototype.decodeMulti=function(e){return lo(this,(function(t){switch(t.label){case 0:this.reinitializeState(),this.setBuffer(e),t.label=1;case 1:return this.hasRemaining(1)?[4,this.doDecodeSync()]:[3,3];case 2:return t.sent(),[3,1];case 3:return[2]}}))},e.prototype.decodeAsync=function(e){var t,n,o,r,i,s,a;return i=this,void 0,a=function(){var i,s,a,c,l,h,d,u;return lo(this,(function(p){switch(p.label){case 0:i=!1,p.label=1;case 1:p.trys.push([1,6,7,12]),t=ho(e),p.label=2;case 2:return[4,t.next()];case 3:if((n=p.sent()).done)return[3,5];if(a=n.value,i)throw this.createExtraByteError(this.totalPos);this.appendBuffer(a);try{s=this.doDecodeSync(),i=!0}catch(e){if(!(e instanceof go))throw e}this.totalPos+=this.pos,p.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return c=p.sent(),o={error:c},[3,12];case 7:return p.trys.push([7,,10,11]),n&&!n.done&&(r=t.return)?[4,r.call(t)]:[3,9];case 8:p.sent(),p.label=9;case 9:return[3,11];case 10:if(o)throw o.error;return[7];case 11:return[7];case 12:if(i){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return[2,s]}throw h=(l=this).headByte,d=l.pos,u=l.totalPos,new RangeError("Insufficient data in parsing ".concat(ao(h)," at ").concat(u," (").concat(d," in the current buffer)"))}}))},new((s=void 0)||(s=Promise))((function(e,t){function n(e){try{r(a.next(e))}catch(e){t(e)}}function o(e){try{r(a.throw(e))}catch(e){t(e)}}function r(t){var r;t.done?e(t.value):(r=t.value,r instanceof s?r:new s((function(e){e(r)}))).then(n,o)}r((a=a.apply(i,[])).next())}))},e.prototype.decodeArrayStream=function(e){return this.decodeMultiAsync(e,!0)},e.prototype.decodeStream=function(e){return this.decodeMultiAsync(e,!1)},e.prototype.decodeMultiAsync=function(e,t){return function(n,o,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,s=function(){var n,o,r,i,s,a,c,l,h;return lo(this,(function(d){switch(d.label){case 0:n=t,o=-1,d.label=1;case 1:d.trys.push([1,13,14,19]),r=ho(e),d.label=2;case 2:return[4,uo(r.next())];case 3:if((i=d.sent()).done)return[3,12];if(s=i.value,t&&0===o)throw this.createExtraByteError(this.totalPos);this.appendBuffer(s),n&&(o=this.readArraySize(),n=!1,this.complete()),d.label=4;case 4:d.trys.push([4,9,,10]),d.label=5;case 5:return[4,uo(this.doDecodeSync())];case 6:return[4,d.sent()];case 7:return d.sent(),0==--o?[3,8]:[3,5];case 8:return[3,10];case 9:if(!((a=d.sent())instanceof go))throw a;return[3,10];case 10:this.totalPos+=this.pos,d.label=11;case 11:return[3,2];case 12:return[3,19];case 13:return c=d.sent(),l={error:c},[3,19];case 14:return d.trys.push([14,,17,18]),i&&!i.done&&(h=r.return)?[4,uo(h.call(r))]:[3,16];case 15:d.sent(),d.label=16;case 16:return[3,18];case 17:if(l)throw l.error;return[7];case 18:return[7];case 19:return[2]}}))}.apply(n,o||[]),a=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(e){s[e]&&(i[e]=function(t){return new Promise((function(n,o){a.push([e,t,n,o])>1||l(e,t)}))})}function l(e,t){try{(n=s[e](t)).value instanceof uo?Promise.resolve(n.value.v).then(h,d):u(a[0][2],n)}catch(e){u(a[0][3],e)}var n}function h(e){l("next",e)}function d(e){l("throw",e)}function u(e,t){e(t),a.shift(),a.length&&l(a[0][0],a[0][1])}}(this,arguments)},e.prototype.doDecodeSync=function(){e:for(;;){var e=this.readHeadByte(),t=void 0;if(e>=224)t=e-256;else if(e<192)if(e<128)t=e;else if(e<144){if(0!=(o=e-128)){this.pushMapState(o),this.complete();continue e}t={}}else if(e<160){if(0!=(o=e-144)){this.pushArrayState(o),this.complete();continue e}t=[]}else{var n=e-160;t=this.decodeUtf8String(n,0)}else if(192===e)t=null;else if(194===e)t=!1;else if(195===e)t=!0;else if(202===e)t=this.readF32();else if(203===e)t=this.readF64();else if(204===e)t=this.readU8();else if(205===e)t=this.readU16();else if(206===e)t=this.readU32();else if(207===e)t=this.readU64();else if(208===e)t=this.readI8();else if(209===e)t=this.readI16();else if(210===e)t=this.readI32();else if(211===e)t=this.readI64();else if(217===e)n=this.lookU8(),t=this.decodeUtf8String(n,1);else if(218===e)n=this.lookU16(),t=this.decodeUtf8String(n,2);else if(219===e)n=this.lookU32(),t=this.decodeUtf8String(n,4);else if(220===e){if(0!==(o=this.readU16())){this.pushArrayState(o),this.complete();continue e}t=[]}else if(221===e){if(0!==(o=this.readU32())){this.pushArrayState(o),this.complete();continue e}t=[]}else if(222===e){if(0!==(o=this.readU16())){this.pushMapState(o),this.complete();continue e}t={}}else if(223===e){if(0!==(o=this.readU32())){this.pushMapState(o),this.complete();continue e}t={}}else if(196===e){var o=this.lookU8();t=this.decodeBinary(o,1)}else if(197===e)o=this.lookU16(),t=this.decodeBinary(o,2);else if(198===e)o=this.lookU32(),t=this.decodeBinary(o,4);else if(212===e)t=this.decodeExtension(1,0);else if(213===e)t=this.decodeExtension(2,0);else if(214===e)t=this.decodeExtension(4,0);else if(215===e)t=this.decodeExtension(8,0);else if(216===e)t=this.decodeExtension(16,0);else if(199===e)o=this.lookU8(),t=this.decodeExtension(o,1);else if(200===e)o=this.lookU16(),t=this.decodeExtension(o,2);else{if(201!==e)throw new no("Unrecognized type byte: ".concat(ao(e)));o=this.lookU32(),t=this.decodeExtension(o,4)}this.complete();for(var r=this.stack;r.length>0;){var i=r[r.length-1];if(0===i.type){if(i.array[i.position]=t,i.position++,i.position!==i.size)continue e;r.pop(),t=i.array}else{if(1===i.type){if("string"!=(s=typeof t)&&"number"!==s)throw new no("The type of key must be string or number but "+typeof t);if("__proto__"===t)throw new no("The key __proto__ is not allowed");i.key=t,i.type=2;continue e}if(i.map[i.key]=t,i.readCount++,i.readCount!==i.size){i.key=null,i.type=1;continue e}r.pop(),t=i.map}}return t}var s},e.prototype.readHeadByte=function(){return-1===this.headByte&&(this.headByte=this.readU8()),this.headByte},e.prototype.complete=function(){this.headByte=-1},e.prototype.readArraySize=function(){var e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw new no("Unrecognized array type byte: ".concat(ao(e)))}},e.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw new no("Max length exceeded: map length (".concat(e,") > maxMapLengthLength (").concat(this.maxMapLength,")"));this.stack.push({type:1,size:e,key:null,readCount:0,map:{}})},e.prototype.pushArrayState=function(e){if(e>this.maxArrayLength)throw new no("Max length exceeded: array length (".concat(e,") > maxArrayLength (").concat(this.maxArrayLength,")"));this.stack.push({type:0,size:e,array:new Array(e),position:0})},e.prototype.decodeUtf8String=function(e,t){var n;if(e>this.maxStrLength)throw new no("Max length exceeded: UTF-8 byte length (".concat(e,") > maxStrLength (").concat(this.maxStrLength,")"));if(this.bytes.byteLengthZn?function(e,t,n){var o=e.subarray(t,t+n);return Qn.decode(o)}(this.bytes,r,e):Gn(this.bytes,r,e),this.pos+=t+e,o},e.prototype.stateIsMapKey=function(){return this.stack.length>0&&1===this.stack[this.stack.length-1].type},e.prototype.decodeBinary=function(e,t){if(e>this.maxBinLength)throw new no("Max length exceeded: bin length (".concat(e,") > maxBinLength (").concat(this.maxBinLength,")"));if(!this.hasRemaining(e+t))throw mo;var n=this.pos+t,o=this.bytes.subarray(n,n+e);return this.pos+=t+e,o},e.prototype.decodeExtension=function(e,t){if(e>this.maxExtLength)throw new no("Max length exceeded: ext length (".concat(e,") > maxExtLength (").concat(this.maxExtLength,")"));var n=this.view.getInt8(this.pos+t),o=this.decodeBinary(e,t+1);return this.extensionCodec.decode(o,n,this.context)},e.prototype.lookU8=function(){return this.view.getUint8(this.pos)},e.prototype.lookU16=function(){return this.view.getUint16(this.pos)},e.prototype.lookU32=function(){return this.view.getUint32(this.pos)},e.prototype.readU8=function(){var e=this.view.getUint8(this.pos);return this.pos++,e},e.prototype.readI8=function(){var e=this.view.getInt8(this.pos);return this.pos++,e},e.prototype.readU16=function(){var e=this.view.getUint16(this.pos);return this.pos+=2,e},e.prototype.readI16=function(){var e=this.view.getInt16(this.pos);return this.pos+=2,e},e.prototype.readU32=function(){var e=this.view.getUint32(this.pos);return this.pos+=4,e},e.prototype.readI32=function(){var e=this.view.getInt32(this.pos);return this.pos+=4,e},e.prototype.readU64=function(){var e,t,n=(e=this.view,t=this.pos,4294967296*e.getUint32(t)+e.getUint32(t+4));return this.pos+=8,n},e.prototype.readI64=function(){var e=zn(this.view,this.pos);return this.pos+=8,e},e.prototype.readF32=function(){var e=this.view.getFloat32(this.pos);return this.pos+=4,e},e.prototype.readF64=function(){var e=this.view.getFloat64(this.pos);return this.pos+=8,e},e}();class wo{static write(e){let t=e.byteLength||e.length;const n=[];do{let e=127&t;t>>=7,t>0&&(e|=128),n.push(e)}while(t>0);t=e.byteLength||e.length;const o=new Uint8Array(n.length+t);return o.set(n,0),o.set(e,n.length),o.buffer}static parse(e){const t=[],n=new Uint8Array(e),o=[0,7,14,21,28];for(let r=0;r7)throw new Error("Messages bigger than 2GB are not supported.");if(!(n.byteLength>=r+s+a))throw new Error("Incomplete message.");t.push(n.slice?n.slice(r+s,r+s+a):n.subarray(r+s,r+s+a)),r=r+s+a}return t}}const bo=new Uint8Array([145,hn.Ping]);class _o{constructor(e){this.name="messagepack",this.version=2,this.transferFormat=Tn.Binary,this._errorResult=1,this._voidResult=2,this._nonVoidResult=3,e=e||{},this._encoder=new so(e.extensionCodec,e.context,e.maxDepth,e.initialBufferSize,e.sortKeys,e.forceFloat32,e.ignoreUndefined,e.forceIntegerToFloat),this._decoder=new yo(e.extensionCodec,e.context,e.maxStrLength,e.maxBinLength,e.maxArrayLength,e.maxMapLength,e.maxExtLength)}parseMessages(e,t){if(!(n=e)||"undefined"==typeof ArrayBuffer||!(n instanceof ArrayBuffer||n.constructor&&"ArrayBuffer"===n.constructor.name))throw new Error("Invalid input for MessagePack hub protocol. Expected an ArrayBuffer.");var n;null===t&&(t=$t.instance);const o=wo.parse(e),r=[];for(const e of o){const n=this._parseMessage(e,t);n&&r.push(n)}return r}writeMessage(e){switch(e.type){case hn.Invocation:return this._writeInvocation(e);case hn.StreamInvocation:return this._writeStreamInvocation(e);case hn.StreamItem:return this._writeStreamItem(e);case hn.Completion:return this._writeCompletion(e);case hn.Ping:return wo.write(bo);case hn.CancelInvocation:return this._writeCancelInvocation(e);case hn.Close:return this._writeClose();case hn.Ack:return this._writeAck(e);case hn.Sequence:return this._writeSequence(e);default:throw new Error("Invalid message type.")}}_parseMessage(e,t){if(0===e.length)throw new Error("Invalid payload.");const n=this._decoder.decode(e);if(0===n.length||!(n instanceof Array))throw new Error("Invalid payload.");const o=n[0];switch(o){case hn.Invocation:return this._createInvocationMessage(this._readHeaders(n),n);case hn.StreamItem:return this._createStreamItemMessage(this._readHeaders(n),n);case hn.Completion:return this._createCompletionMessage(this._readHeaders(n),n);case hn.Ping:return this._createPingMessage(n);case hn.Close:return this._createCloseMessage(n);case hn.Ack:return this._createAckMessage(n);case hn.Sequence:return this._createSequenceMessage(n);default:return t.log(Ft.Information,"Unknown message type '"+o+"' ignored."),null}}_createCloseMessage(e){if(e.length<2)throw new Error("Invalid payload for Close message.");return{allowReconnect:e.length>=3?e[2]:void 0,error:e[1],type:hn.Close}}_createPingMessage(e){if(e.length<1)throw new Error("Invalid payload for Ping message.");return{type:hn.Ping}}_createInvocationMessage(e,t){if(t.length<5)throw new Error("Invalid payload for Invocation message.");const n=t[2];return n?{arguments:t[4],headers:e,invocationId:n,streamIds:[],target:t[3],type:hn.Invocation}:{arguments:t[4],headers:e,streamIds:[],target:t[3],type:hn.Invocation}}_createStreamItemMessage(e,t){if(t.length<4)throw new Error("Invalid payload for StreamItem message.");return{headers:e,invocationId:t[2],item:t[3],type:hn.StreamItem}}_createCompletionMessage(e,t){if(t.length<4)throw new Error("Invalid payload for Completion message.");const n=t[3];if(n!==this._voidResult&&t.length<5)throw new Error("Invalid payload for Completion message.");let o,r;switch(n){case this._errorResult:o=t[4];break;case this._nonVoidResult:r=t[4]}return{error:o,headers:e,invocationId:t[2],result:r,type:hn.Completion}}_createAckMessage(e){if(e.length<1)throw new Error("Invalid payload for Ack message.");return{sequenceId:e[1],type:hn.Ack}}_createSequenceMessage(e){if(e.length<1)throw new Error("Invalid payload for Sequence message.");return{sequenceId:e[1],type:hn.Sequence}}_writeInvocation(e){let t;return t=e.streamIds?this._encoder.encode([hn.Invocation,e.headers||{},e.invocationId||null,e.target,e.arguments,e.streamIds]):this._encoder.encode([hn.Invocation,e.headers||{},e.invocationId||null,e.target,e.arguments]),wo.write(t.slice())}_writeStreamInvocation(e){let t;return t=e.streamIds?this._encoder.encode([hn.StreamInvocation,e.headers||{},e.invocationId,e.target,e.arguments,e.streamIds]):this._encoder.encode([hn.StreamInvocation,e.headers||{},e.invocationId,e.target,e.arguments]),wo.write(t.slice())}_writeStreamItem(e){const t=this._encoder.encode([hn.StreamItem,e.headers||{},e.invocationId,e.item]);return wo.write(t.slice())}_writeCompletion(e){const t=e.error?this._errorResult:void 0!==e.result?this._nonVoidResult:this._voidResult;let n;switch(t){case this._errorResult:n=this._encoder.encode([hn.Completion,e.headers||{},e.invocationId,t,e.error]);break;case this._voidResult:n=this._encoder.encode([hn.Completion,e.headers||{},e.invocationId,t]);break;case this._nonVoidResult:n=this._encoder.encode([hn.Completion,e.headers||{},e.invocationId,t,e.result])}return wo.write(n.slice())}_writeCancelInvocation(e){const t=this._encoder.encode([hn.CancelInvocation,e.headers||{},e.invocationId]);return wo.write(t.slice())}_writeClose(){const e=this._encoder.encode([hn.Close,null]);return wo.write(e.slice())}_writeAck(e){const t=this._encoder.encode([hn.Ack,e.sequenceId]);return wo.write(t.slice())}_writeSequence(e){const t=this._encoder.encode([hn.Sequence,e.sequenceId]);return wo.write(t.slice())}_readHeaders(e){const t=e[1];if("object"!=typeof t)throw new Error("Invalid headers.");return t}}const So="function"==typeof TextDecoder?new TextDecoder("utf-8"):null,Co=So?So.decode.bind(So):function(e){let t=0;const n=e.length,o=[],r=[];for(;t65535&&(r-=65536,o.push(r>>>10&1023|55296),r=56320|1023&r),o.push(r)}o.length>1024&&(r.push(String.fromCharCode.apply(null,o)),o.length=0)}return r.push(String.fromCharCode.apply(null,o)),r.join("")},Eo=Math.pow(2,32),Io=Math.pow(2,21)-1;function ko(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}function To(e,t){return e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24>>>0)}function Ro(e,t){const n=To(e,t+4);if(n>Io)throw new Error(`Cannot read uint64 with high order part ${n}, because the result would exceed Number.MAX_SAFE_INTEGER.`);return n*Eo+To(e,t)}class Ao{constructor(e){this.batchData=e;const t=new Mo(e);this.arrayRangeReader=new Po(e),this.arrayBuilderSegmentReader=new Uo(e),this.diffReader=new Do(e),this.editReader=new xo(e,t),this.frameReader=new No(e,t)}updatedComponents(){return ko(this.batchData,this.batchData.length-20)}referenceFrames(){return ko(this.batchData,this.batchData.length-16)}disposedComponentIds(){return ko(this.batchData,this.batchData.length-12)}disposedEventHandlerIds(){return ko(this.batchData,this.batchData.length-8)}updatedComponentsEntry(e,t){const n=e+4*t;return ko(this.batchData,n)}referenceFramesEntry(e,t){return e+20*t}disposedComponentIdsEntry(e,t){const n=e+4*t;return ko(this.batchData,n)}disposedEventHandlerIdsEntry(e,t){const n=e+8*t;return Ro(this.batchData,n)}}class Do{constructor(e){this.batchDataUint8=e}componentId(e){return ko(this.batchDataUint8,e)}edits(e){return e+4}editsEntry(e,t){return e+16*t}}class xo{constructor(e,t){this.batchDataUint8=e,this.stringReader=t}editType(e){return ko(this.batchDataUint8,e)}siblingIndex(e){return ko(this.batchDataUint8,e+4)}newTreeIndex(e){return ko(this.batchDataUint8,e+8)}moveToSiblingIndex(e){return ko(this.batchDataUint8,e+8)}removedAttributeName(e){const t=ko(this.batchDataUint8,e+12);return this.stringReader.readString(t)}}class No{constructor(e,t){this.batchDataUint8=e,this.stringReader=t}frameType(e){return ko(this.batchDataUint8,e)}subtreeLength(e){return ko(this.batchDataUint8,e+4)}elementReferenceCaptureId(e){const t=ko(this.batchDataUint8,e+4);return this.stringReader.readString(t)}componentId(e){return ko(this.batchDataUint8,e+8)}elementName(e){const t=ko(this.batchDataUint8,e+8);return this.stringReader.readString(t)}textContent(e){const t=ko(this.batchDataUint8,e+4);return this.stringReader.readString(t)}markupContent(e){const t=ko(this.batchDataUint8,e+4);return this.stringReader.readString(t)}attributeName(e){const t=ko(this.batchDataUint8,e+4);return this.stringReader.readString(t)}attributeValue(e){const t=ko(this.batchDataUint8,e+8);return this.stringReader.readString(t)}attributeEventHandlerId(e){return Ro(this.batchDataUint8,e+12)}}class Mo{constructor(e){this.batchDataUint8=e,this.stringTableStartIndex=ko(e,e.length-4)}readString(e){if(-1===e)return null;{const n=ko(this.batchDataUint8,this.stringTableStartIndex+4*e),o=function(e,t){let n=0,o=0;for(let r=0;r<4;r++){const i=e[t+r];if(n|=(127&i)<this.nextBatchId)return this.fatalError?(this.logger.log(wt.Debug,`Received a new batch ${e} but errored out on a previous batch ${this.nextBatchId-1}`),void await n.send("OnRenderCompleted",this.nextBatchId-1,this.fatalError.toString())):void this.logger.log(wt.Debug,`Waiting for batch ${this.nextBatchId}. Batch ${e} not processed.`);try{this.nextBatchId++,this.logger.log(wt.Debug,`Applying batch ${e}.`),xe(On.Server,new Ao(t)),await this.completeBatch(n,e)}catch(t){throw this.fatalError=t.toString(),this.logger.log(wt.Error,`There was an error applying batch ${e}.`),n.send("OnRenderCompleted",e,t.toString()),t}}getLastBatchid(){return this.nextBatchId-1}async completeBatch(e,t){try{await e.send("OnRenderCompleted",t,null)}catch{this.logger.log(wt.Warning,`Failed to deliver completion notification for render '${t}'.`)}}}let Bo=!1;function Oo(){const e=document.querySelector("#blazor-error-ui");e&&(e.style.display="block"),Bo||(Bo=!0,document.querySelectorAll("#blazor-error-ui .reload").forEach((e=>{e.onclick=function(e){location.reload(),e.preventDefault()}})),document.querySelectorAll("#blazor-error-ui .dismiss").forEach((e=>{e.onclick=function(e){const t=document.querySelector("#blazor-error-ui");t&&(t.style.display="none"),e.preventDefault()}})))}class Fo{constructor(t,n,o,r){this._firstUpdate=!0,this._renderingFailed=!1,this._disposed=!1,this._circuitId=void 0,this._applicationState=n,this._componentManager=t,this._options=o,this._logger=r,this._renderQueue=new Lo(this._logger),this._dispatcher=e.attachDispatcher(this)}start(){if(this.isDisposedOrDisposing())throw new Error("Cannot start a disposed circuit.");return this._startPromise||(this._startPromise=this.startCore()),this._startPromise}updateRootComponents(e){var t,n;return this._firstUpdate?(this._firstUpdate=!1,null===(t=this._connection)||void 0===t?void 0:t.send("UpdateRootComponents",e,this._applicationState)):null===(n=this._connection)||void 0===n?void 0:n.send("UpdateRootComponents",e,"")}async startCore(){if(this._connection=await this.startConnection(),this._connection.state!==dn.Connected)return!1;const e=JSON.stringify(this._componentManager.initialComponents.map((e=>Lt(e))));if(this._circuitId=await this._connection.invoke("StartCircuit",Ve.getBaseURI(),Ve.getLocationHref(),e,this._applicationState||""),!this._circuitId)return!1;for(const e of this._options.circuitHandlers)e.onCircuitOpened&&e.onCircuitOpened();return!0}async startConnection(){var e,t;const n=new _o;n.name="blazorpack";const o=(new Bn).withUrl("_blazor").withHubProtocol(n);this._options.configureSignalR(o);const r=o.build();r.on("JS.AttachComponent",((e,t)=>Ae(On.Server,this.resolveElement(t),e,!1))),r.on("JS.BeginInvokeJS",this._dispatcher.beginInvokeJSFromDotNet.bind(this._dispatcher)),r.on("JS.EndInvokeDotNet",this._dispatcher.endInvokeDotNetFromJS.bind(this._dispatcher)),r.on("JS.ReceiveByteArray",this._dispatcher.receiveByteArray.bind(this._dispatcher)),r.on("JS.BeginTransmitStream",(e=>{const t=new ReadableStream({start:t=>{r.stream("SendDotNetStreamToJS",e).subscribe({next:e=>t.enqueue(e),complete:()=>t.close(),error:e=>t.error(e)})}});this._dispatcher.supplyDotNetStream(e,t)})),r.on("JS.RenderBatch",(async(e,t)=>{var n,o;this._logger.log(Ft.Debug,`Received render batch with id ${e} and ${t.byteLength} bytes.`),await this._renderQueue.processBatch(e,t,this._connection),null===(o=(n=this._componentManager).onAfterRenderBatch)||void 0===o||o.call(n,On.Server)})),r.on("JS.EndUpdateRootComponents",(e=>{var t,n;null===(n=(t=this._componentManager).onAfterUpdateRootComponents)||void 0===n||n.call(t,e)})),r.on("JS.EndLocationChanging",yt._internal.navigationManager.endLocationChanging),r.onclose((e=>{this._interopMethodsForReconnection=function(e){const t=C.get(e);if(!t)throw new Error(`Interop methods are not registered for renderer ${e}`);return C.delete(e),t}(On.Server),this._disposed||this._renderingFailed||this._options.reconnectionHandler.onConnectionDown(this._options.reconnectionOptions,e)})),r.on("JS.Error",(e=>{this._renderingFailed=!0,this.unhandledError(e),Oo()}));try{await r.start()}catch(e){if(this.unhandledError(e),"FailedToNegotiateWithServerError"===e.errorType)throw e;Oo(),e.innerErrors&&(e.innerErrors.some((e=>"UnsupportedTransportError"===e.errorType&&e.transport===kn.WebSockets))?this._logger.log(Ft.Error,"Unable to connect, please ensure you are using an updated browser that supports WebSockets."):e.innerErrors.some((e=>"FailedToStartTransportError"===e.errorType&&e.transport===kn.WebSockets))?this._logger.log(Ft.Error,"Unable to connect, please ensure WebSockets are available. A VPN or proxy may be blocking the connection."):e.innerErrors.some((e=>"DisabledTransportError"===e.errorType&&e.transport===kn.LongPolling))&&this._logger.log(Ft.Error,"Unable to initiate a SignalR connection to the server. This might be because the server is not configured to support WebSockets. For additional details, visit https://aka.ms/blazor-server-websockets-error."))}return(null===(t=null===(e=r.connection)||void 0===e?void 0:e.features)||void 0===t?void 0:t.inherentKeepAlive)&&this._logger.log(Ft.Warning,"Failed to connect via WebSockets, using the Long Polling fallback transport. This may be due to a VPN or proxy blocking the connection. To troubleshoot this, visit https://aka.ms/blazor-server-using-fallback-long-polling."),r}async disconnect(){var e;await(null===(e=this._connection)||void 0===e?void 0:e.stop())}async reconnect(){if(!this._circuitId)throw new Error("Circuit host not initialized.");return this._connection.state===dn.Connected||(this._connection=await this.startConnection(),this._interopMethodsForReconnection&&(k(On.Server,this._interopMethodsForReconnection),this._interopMethodsForReconnection=void 0),!!await this._connection.invoke("ConnectCircuit",this._circuitId)&&(this._options.reconnectionHandler.onConnectionUp(),!0))}beginInvokeDotNetFromJS(e,t,n,o,r){this.throwIfDispatchingWhenDisposed(),this._connection.send("BeginInvokeDotNetFromJS",e?e.toString():null,t,n,o||0,r)}endInvokeJSFromDotNet(e,t,n){this.throwIfDispatchingWhenDisposed(),this._connection.send("EndInvokeJSFromDotNet",e,t,n)}sendByteArray(e,t){this.throwIfDispatchingWhenDisposed(),this._connection.send("ReceiveByteArray",e,t)}throwIfDispatchingWhenDisposed(){if(this._disposed)throw new Error("The circuit associated with this dispatcher is no longer available.")}sendLocationChanged(e,t,n){return this._connection.send("OnLocationChanged",e,t,n)}sendLocationChanging(e,t,n,o){return this._connection.send("OnLocationChanging",e,t,n,o)}sendJsDataStream(e,t,n){return function(e,t,n,o){setTimeout((async()=>{let r=5,i=(new Date).valueOf();try{const s=t instanceof Blob?t.size:t.byteLength;let a=0,c=0;for(;a1)await e.send("ReceiveJSDataChunk",n,c,h,null);else{if(!await e.invoke("ReceiveJSDataChunk",n,c,h,null))break;const t=(new Date).valueOf(),o=t-i;i=t,r=Math.max(1,Math.round(500/Math.max(1,o)))}a+=l,c++}}catch(t){await e.send("ReceiveJSDataChunk",n,-1,null,t.toString())}}),0)}(this._connection,e,t,n)}resolveElement(e){const t=w(e);if(t)return W(t,!0);const n=Number.parseInt(e);if(!Number.isNaN(n))return H(this._componentManager.resolveRootComponent(n));throw new Error(`Invalid sequence number or identifier '${e}'.`)}getRootComponentManager(){return this._componentManager}unhandledError(e){this._logger.log(Ft.Error,e),this.disconnect()}getDisconnectFormData(){const e=new FormData,t=this._circuitId;return e.append("circuitId",t),e}didRenderingFail(){return this._renderingFailed}isDisposedOrDisposing(){return void 0!==this._disposePromise}sendDisconnectBeacon(){if(this._disposed)return;const e=this.getDisconnectFormData();this._disposed=navigator.sendBeacon("_blazor/disconnect",e)}dispose(){return this._disposePromise||(this._disposePromise=this.disposeCore()),this._disposePromise}async disposeCore(){var e;if(!this._startPromise)return void(this._disposed=!0);await this._startPromise,this._disposed=!0,null===(e=this._connection)||void 0===e||e.stop();const t=this.getDisconnectFormData();fetch("_blazor/disconnect",{method:"POST",body:t});for(const e of this._options.circuitHandlers)e.onCircuitClosed&&e.onCircuitClosed()}}function $o(e){const t={...Ho,...e};return e&&e.reconnectionOptions&&(t.reconnectionOptions={...Ho.reconnectionOptions,...e.reconnectionOptions}),t}const Ho={configureSignalR:e=>{},logLevel:wt.Warning,initializers:void 0,circuitHandlers:[],reconnectionOptions:{maxRetries:8,retryIntervalMilliseconds:2e4,dialogId:"components-reconnect-modal"}};class Wo{constructor(e,t,n,o){this.maxRetries=t,this.document=n,this.logger=o,this.modal=this.document.createElement("div"),this.modal.id=e,this.maxRetries=t,this.modal.style.cssText=["position: fixed","top: 0","right: 0","bottom: 0","left: 0","z-index: 1050","display: none","overflow: hidden","background-color: #fff","opacity: 0.8","text-align: center","font-weight: bold","transition: visibility 0s linear 500ms"].join(";"),this.message=this.document.createElement("h5"),this.message.style.cssText="margin-top: 20px",this.button=this.document.createElement("button"),this.button.style.cssText="margin:5px auto 5px",this.button.textContent="Retry";const r=this.document.createElement("a");r.addEventListener("click",(()=>location.reload())),r.textContent="reload",this.reloadParagraph=this.document.createElement("p"),this.reloadParagraph.textContent="Alternatively, ",this.reloadParagraph.appendChild(r),this.modal.appendChild(this.message),this.modal.appendChild(this.button),this.modal.appendChild(this.reloadParagraph),this.loader=this.getLoader(),this.message.after(this.loader),this.button.addEventListener("click",(async()=>{this.show();try{await yt.reconnect()||this.rejected()}catch(e){this.logger.log(wt.Error,e),this.failed()}}))}show(){this.document.contains(this.modal)||this.document.body.appendChild(this.modal),this.modal.style.display="block",this.loader.style.display="inline-block",this.button.style.display="none",this.reloadParagraph.style.display="none",this.message.textContent="Attempting to reconnect to the server...",this.modal.style.visibility="hidden",setTimeout((()=>{this.modal.style.visibility="visible"}),0)}update(e){this.message.textContent=`Attempting to reconnect to the server: ${e} of ${this.maxRetries}`}hide(){this.modal.style.display="none"}failed(){this.button.style.display="block",this.reloadParagraph.style.display="none",this.loader.style.display="none";const e=this.document.createTextNode("Reconnection failed. Try "),t=this.document.createElement("a");t.textContent="reloading",t.setAttribute("href",""),t.addEventListener("click",(()=>location.reload()));const n=this.document.createTextNode(" the page if you're unable to reconnect.");this.message.replaceChildren(e,t,n)}rejected(){this.button.style.display="none",this.reloadParagraph.style.display="none",this.loader.style.display="none";const e=this.document.createTextNode("Could not reconnect to the server. "),t=this.document.createElement("a");t.textContent="Reload",t.setAttribute("href",""),t.addEventListener("click",(()=>location.reload()));const n=this.document.createTextNode(" the page to restore functionality.");this.message.replaceChildren(e,t,n)}getLoader(){const e=this.document.createElement("div");return e.style.cssText=["border: 0.3em solid #f3f3f3","border-top: 0.3em solid #3498db","border-radius: 50%","width: 2em","height: 2em","display: inline-block"].join(";"),e.animate([{transform:"rotate(0deg)"},{transform:"rotate(360deg)"}],{duration:2e3,iterations:1/0}),e}}class jo{constructor(e,t,n){this.dialog=e,this.maxRetries=t,this.document=n,this.document=n;const o=this.document.getElementById(jo.MaxRetriesId);o&&(o.innerText=this.maxRetries.toString())}show(){this.removeClasses(),this.dialog.classList.add(jo.ShowClassName)}update(e){const t=this.document.getElementById(jo.CurrentAttemptId);t&&(t.innerText=e.toString())}hide(){this.removeClasses(),this.dialog.classList.add(jo.HideClassName)}failed(){this.removeClasses(),this.dialog.classList.add(jo.FailedClassName)}rejected(){this.removeClasses(),this.dialog.classList.add(jo.RejectedClassName)}removeClasses(){this.dialog.classList.remove(jo.ShowClassName,jo.HideClassName,jo.FailedClassName,jo.RejectedClassName)}}jo.ShowClassName="components-reconnect-show",jo.HideClassName="components-reconnect-hide",jo.FailedClassName="components-reconnect-failed",jo.RejectedClassName="components-reconnect-rejected",jo.MaxRetriesId="components-reconnect-max-retries",jo.CurrentAttemptId="components-reconnect-current-attempt";class zo{constructor(e,t,n){this._currentReconnectionProcess=null,this._logger=e,this._reconnectionDisplay=t,this._reconnectCallback=n||yt.reconnect}onConnectionDown(e,t){if(!this._reconnectionDisplay){const t=document.getElementById(e.dialogId);this._reconnectionDisplay=t?new jo(t,e.maxRetries,document):new Wo(e.dialogId,e.maxRetries,document,this._logger)}this._currentReconnectionProcess||(this._currentReconnectionProcess=new qo(e,this._logger,this._reconnectCallback,this._reconnectionDisplay))}onConnectionUp(){this._currentReconnectionProcess&&(this._currentReconnectionProcess.dispose(),this._currentReconnectionProcess=null)}}class qo{constructor(e,t,n,o){this.logger=t,this.reconnectCallback=n,this.isDisposed=!1,this.reconnectDisplay=o,this.reconnectDisplay.show(),this.attemptPeriodicReconnection(e)}dispose(){this.isDisposed=!0,this.reconnectDisplay.hide()}async attemptPeriodicReconnection(e){for(let t=0;tqo.MaximumFirstRetryInterval?qo.MaximumFirstRetryInterval:e.retryIntervalMilliseconds;if(await this.delay(n),this.isDisposed)break;try{return await this.reconnectCallback()?void 0:void this.reconnectDisplay.rejected()}catch(e){this.logger.log(wt.Error,e)}}this.reconnectDisplay.failed()}delay(e){return new Promise((t=>setTimeout(t,e)))}}qo.MaximumFirstRetryInterval=3e3;class Jo{constructor(e=!0,t,n,o=0){this.singleRuntime=e,this.logger=t,this.webRendererId=o,this.afterStartedCallbacks=[],n&&this.afterStartedCallbacks.push(...n)}async importInitializersAsync(e,t){await Promise.all(e.map((e=>async function(e,n){const o=function(e){const t=document.baseURI;return t.endsWith("/")?`${t}${e}`:`${t}/${e}`}(n),r=await import(o);if(void 0!==r){if(e.singleRuntime){const{beforeStart:n,afterStarted:o,beforeWebAssemblyStart:s,afterWebAssemblyStarted:a,beforeServerStart:c,afterServerStarted:l}=r;let h=n;e.webRendererId===On.Server&&c&&(h=c),e.webRendererId===On.WebAssembly&&s&&(h=s);let d=o;return e.webRendererId===On.Server&&l&&(d=l),e.webRendererId===On.WebAssembly&&a&&(d=a),i(e,h,d,t)}return function(e,t,n){var r;const s=n[0],{beforeStart:a,afterStarted:c,beforeWebStart:l,afterWebStarted:h,beforeWebAssemblyStart:d,afterWebAssemblyStarted:u,beforeServerStart:p,afterServerStarted:f}=t,g=!(l||h||d||u||p||f||!a&&!c),m=g&&s.enableClassicInitializers;if(g&&!s.enableClassicInitializers)null===(r=e.logger)||void 0===r||r.log(wt.Warning,`Initializer '${o}' will be ignored because multiple runtimes are available. use 'before(web|webAssembly|server)Start' and 'after(web|webAssembly|server)Started?' instead.)`);else if(m)return i(e,a,c,n);if(function(e){e.webAssembly?e.webAssembly.initializers||(e.webAssembly.initializers={beforeStart:[],afterStarted:[]}):e.webAssembly={initializers:{beforeStart:[],afterStarted:[]}},e.circuit?e.circuit.initializers||(e.circuit.initializers={beforeStart:[],afterStarted:[]}):e.circuit={initializers:{beforeStart:[],afterStarted:[]}}}(s),d&&s.webAssembly.initializers.beforeStart.push(d),u&&s.webAssembly.initializers.afterStarted.push(u),p&&s.circuit.initializers.beforeStart.push(p),f&&s.circuit.initializers.afterStarted.push(f),h&&e.afterStartedCallbacks.push(h),l)return l(s)}(e,r,t)}function i(e,t,n,o){if(n&&e.afterStartedCallbacks.push(n),t)return t(...o)}}(this,e))))}async invokeAfterStartedCallbacks(e){const t=function(e){var t;return null===(t=I.get(e))||void 0===t?void 0:t[1]}(this.webRendererId);t&&await t,await Promise.all(this.afterStartedCallbacks.map((t=>t(e))))}}let Ko,Vo,Xo,Go,Yo,Qo,Zo,er;function tr(e){if(Go)throw new Error("Circuit options have already been configured.");if(Go)throw new Error("WebAssembly options have already been configured.");Ko=async function(e){const t=await e;Go=$o(t)}(e)}function nr(e){if(void 0!==Qo)throw new Error("Blazor Server has already started.");return Qo=new Promise(or.bind(null,e)),Qo}async function or(e,t,n){await Ko;const o=await async function(e){if(e.initializers)return await Promise.all(e.initializers.beforeStart.map((t=>t(e)))),new Jo(!1,void 0,e.initializers.afterStarted,On.Server);const t=await fetch("_blazor/initializers",{method:"GET",credentials:"include",cache:"no-cache"}),n=await t.json(),o=new Jo(!0,void 0,void 0,On.Server);return await o.importInitializersAsync(n,[e]),o}(Go);if(Vo=kt(document)||"",Yo=new _t(Go.logLevel),Xo=new Fo(e,Vo,Go,Yo),Yo.log(wt.Information,"Starting up Blazor server-side application."),yt.reconnect=async()=>!(Xo.didRenderingFail()||!await Xo.reconnect()&&(Yo.log(wt.Information,"Reconnection attempt to the circuit was rejected by the server. This may indicate that the associated state is no longer available on the server."),1)),yt.defaultReconnectionHandler=new zo(Yo),Go.reconnectionHandler=Go.reconnectionHandler||yt.defaultReconnectionHandler,yt._internal.navigationManager.listenForNavigationEvents(On.Server,((e,t,n)=>Xo.sendLocationChanged(e,t,n)),((e,t,n,o)=>Xo.sendLocationChanging(e,t,n,o))),yt._internal.forceCloseConnection=()=>Xo.disconnect(),yt._internal.sendJSDataStream=(e,t,n)=>Xo.sendJsDataStream(e,t,n),!await Xo.start())return Yo.log(wt.Error,"Failed to start the circuit."),void t();const r=()=>{Xo.sendDisconnectBeacon()};yt.disconnect=r,window.addEventListener("unload",r,{capture:!1,once:!0}),Yo.log(wt.Information,"Blazor server-side application started."),o.invokeAfterStartedCallbacks(yt),t()}async function rr(){if(!Qo)throw new Error("Cannot start the circuit until Blazor Server has started.");return!(!Xo||Xo.isDisposedOrDisposing())||(Zo?await Zo:(await Qo,(!Xo||!Xo.didRenderingFail())&&(Xo&&Xo.isDisposedOrDisposing()&&(Vo=kt(document)||"",Xo=new Fo(Xo.getRootComponentManager(),Vo,Go,Yo)),Zo=Xo.start(),async function(e){await e,Zo===e&&(Zo=void 0)}(Zo),Zo)))}function ir(e){if(Xo&&!Xo.isDisposedOrDisposing())return Xo.updateRootComponents(e);!async function(e){await Qo,await rr()&&Xo.updateRootComponents(e)}(e)}function sr(e){return er=e,er}var ar,cr;const lr=navigator,hr=lr.userAgentData&&lr.userAgentData.brands,dr=hr&&hr.length>0?hr.some((e=>"Google Chrome"===e.brand||"Microsoft Edge"===e.brand||"Chromium"===e.brand)):window.chrome,ur=null!==(cr=null===(ar=lr.userAgentData)||void 0===ar?void 0:ar.platform)&&void 0!==cr?cr:navigator.platform;function pr(e){return 0!==e.debugLevel&&(dr||navigator.userAgent.includes("Firefox"))}let fr,gr,mr,vr,yr,wr,br;const _r=Math.pow(2,32),Sr=Math.pow(2,21)-1;let Cr=null;function Er(e){return gr.getI32(e)}const Ir={load:function(e,t){return async function(e,t){const{dotnet:n}=await async function(e){if("undefined"==typeof WebAssembly||!WebAssembly.validate)throw new Error("This browser does not support WebAssembly.");let t="_framework/dotnet.js";if(e.loadBootResource){const n="dotnetjs",o=e.loadBootResource(n,"dotnet.js",t,"","js-module-dotnet");if("string"==typeof o)t=o;else if(o)throw new Error(`For a ${n} resource, custom loaders must supply a URI string.`)}const n=new URL(t,document.baseURI).toString();return await import(n)}(e),o=function(e,t){const n={maxParallelDownloads:1e6,enableDownloadRetry:!1,applicationEnvironment:e.environment},o={...window.Module||{},onConfigLoaded:async n=>{n.environmentVariables||(n.environmentVariables={}),"sharded"===n.globalizationMode&&(n.environmentVariables.__BLAZOR_SHARDED_ICU="1"),yt._internal.getApplicationEnvironment=()=>n.applicationEnvironment,null==t||t(n),br=await async function(e,t){var n,o,r;if(e.initializers)return await Promise.all(e.initializers.beforeStart.map((t=>t(e)))),new Jo(!1,void 0,e.initializers.afterStarted,On.WebAssembly);{const i=[e,null!==(o=null===(n=t.resources)||void 0===n?void 0:n.extensions)&&void 0!==o?o:{}],s=new Jo(!0,void 0,void 0,On.WebAssembly),a=Object.keys((null===(r=null==t?void 0:t.resources)||void 0===r?void 0:r.libraryInitializers)||{});return await s.importInitializersAsync(a,i),s}}(e,n)},onDownloadResourceProgress:kr,config:n,disableDotnet6Compatibility:!1,out:Rr,err:Ar};return o}(e,t);e.applicationCulture&&n.withApplicationCulture(e.applicationCulture),e.environment&&n.withApplicationEnvironment(e.environment),e.loadBootResource&&n.withResourceLoader(e.loadBootResource),n.withModuleConfig(o),e.configureRuntime&&e.configureRuntime(n),wr=await n.create()}(e,t)},start:function(){return async function(){if(!wr)throw new Error("The runtime must be loaded it gets configured.");const{MONO:t,BINDING:n,Module:o,setModuleImports:r,INTERNAL:i,getConfig:s,invokeLibraryInitializers:a}=wr;mr=o,fr=n,gr=t,yr=i,function(e){const t=ur.match(/^Mac/i)?"Cmd":"Alt";pr(e)&&console.info(`Debugging hotkey: Shift+${t}+D (when application has focus)`),document.addEventListener("keydown",(t=>{t.shiftKey&&(t.metaKey||t.altKey)&&"KeyD"===t.code&&(pr(e)?navigator.userAgent.includes("Firefox")?async function(){const e=await fetch(`_framework/debug?url=${encodeURIComponent(location.href)}&isFirefox=true`);200!==e.status&&console.warn(await e.text())}():dr?function(){const e=document.createElement("a");e.href=`_framework/debug?url=${encodeURIComponent(location.href)}`,e.target="_blank",e.rel="noopener noreferrer",e.click()}():console.error("Currently, only Microsoft Edge (80+), Google Chrome, or Chromium, are supported for debugging."):console.error("Cannot start debugging, because the application was not compiled with debugging enabled."))}))}(s()),yt.runtime=wr,yt._internal.dotNetCriticalError=Ar,r("blazor-internal",{Blazor:{_internal:yt._internal}});const c=await wr.getAssemblyExports("Microsoft.AspNetCore.Components.WebAssembly");return Object.assign(yt._internal,{dotNetExports:{...c.Microsoft.AspNetCore.Components.WebAssembly.Services.DefaultWebAssemblyJSRuntime}}),vr=e.attachDispatcher({beginInvokeDotNetFromJS:(e,t,n,o,r)=>{if(xr(),!o&&!t)throw new Error("Either assemblyName or dotNetObjectId must have a non null value.");const i=o?o.toString():t;yt._internal.dotNetExports.BeginInvokeDotNet(e?e.toString():null,i,n,r)},endInvokeJSFromDotNet:(e,t,n)=>{yt._internal.dotNetExports.EndInvokeJS(n)},sendByteArray:(e,t)=>{yt._internal.dotNetExports.ReceiveByteArrayFromJS(e,t)},invokeDotNetFromJS:(e,t,n,o)=>(xr(),yt._internal.dotNetExports.InvokeDotNet(e||null,t,null!=n?n:0,o))}),{invokeLibraryInitializers:a}}()},callEntryPoint:async function(){try{await wr.runMain(wr.getConfig().mainAssemblyName,[])}catch(e){console.error(e),Oo()}},toUint8Array:function(e){const t=Dr(e),n=Er(t),o=new Uint8Array(n);return o.set(mr.HEAPU8.subarray(t+4,t+4+n)),o},getArrayLength:function(e){return Er(Dr(e))},getArrayEntryPtr:function(e,t,n){return Dr(e)+4+t*n},getObjectFieldsBaseAddress:function(e){return e+8},readInt16Field:function(e,t){return n=e+(t||0),gr.getI16(n);var n},readInt32Field:function(e,t){return Er(e+(t||0))},readUint64Field:function(e,t){return function(e){const t=e>>2,n=mr.HEAPU32[t+1];if(n>Sr)throw new Error(`Cannot read uint64 with high order part ${n}, because the result would exceed Number.MAX_SAFE_INTEGER.`);return n*_r+mr.HEAPU32[t]}(e+(t||0))},readFloatField:function(e,t){return n=e+(t||0),gr.getF32(n);var n},readObjectField:function(e,t){return Er(e+(t||0))},readStringField:function(e,t,n){const o=Er(e+(t||0));if(0===o)return null;if(n){const e=fr.unbox_mono_obj(o);return"boolean"==typeof e?e?"":null:e}return fr.conv_string(o)},readStructField:function(e,t){return e+(t||0)},beginHeapLock:function(){return xr(),Cr=Nr.create(),Cr},invokeWhenHeapUnlocked:function(e){Cr?Cr.enqueuePostReleaseAction(e):e()}};function kr(e,t){const n=e/t*100;document.documentElement.style.setProperty("--blazor-load-percentage",`${n}%`),document.documentElement.style.setProperty("--blazor-load-percentage-text",`"${Math.floor(n)}%"`)}const Tr=["DEBUGGING ENABLED"],Rr=e=>Tr.indexOf(e)<0&&console.log(e),Ar=e=>{console.error(e||"(null)"),Oo()};function Dr(e){return e+12}function xr(){if(Cr)throw new Error("Assertion failed - heap is currently locked")}class Nr{enqueuePostReleaseAction(e){this.postReleaseActions||(this.postReleaseActions=[]),this.postReleaseActions.push(e)}release(){var e;if(Cr!==this)throw new Error("Trying to release a lock which isn't current");for(yr.mono_wasm_gc_unlock(),Cr=null;null===(e=this.postReleaseActions)||void 0===e?void 0:e.length;)this.postReleaseActions.shift()(),xr()}static create(){return yr.mono_wasm_gc_lock(),new Nr}}class Mr{constructor(e){this.batchAddress=e,this.arrayRangeReader=Pr,this.arrayBuilderSegmentReader=Ur,this.diffReader=Lr,this.editReader=Br,this.frameReader=Or}updatedComponents(){return er.readStructField(this.batchAddress,0)}referenceFrames(){return er.readStructField(this.batchAddress,Pr.structLength)}disposedComponentIds(){return er.readStructField(this.batchAddress,2*Pr.structLength)}disposedEventHandlerIds(){return er.readStructField(this.batchAddress,3*Pr.structLength)}updatedComponentsEntry(e,t){return Fr(e,t,Lr.structLength)}referenceFramesEntry(e,t){return Fr(e,t,Or.structLength)}disposedComponentIdsEntry(e,t){const n=Fr(e,t,4);return er.readInt32Field(n)}disposedEventHandlerIdsEntry(e,t){const n=Fr(e,t,8);return er.readUint64Field(n)}}const Pr={structLength:8,values:e=>er.readObjectField(e,0),count:e=>er.readInt32Field(e,4)},Ur={structLength:12,values:e=>{const t=er.readObjectField(e,0),n=er.getObjectFieldsBaseAddress(t);return er.readObjectField(n,0)},offset:e=>er.readInt32Field(e,4),count:e=>er.readInt32Field(e,8)},Lr={structLength:4+Ur.structLength,componentId:e=>er.readInt32Field(e,0),edits:e=>er.readStructField(e,4),editsEntry:(e,t)=>Fr(e,t,Br.structLength)},Br={structLength:20,editType:e=>er.readInt32Field(e,0),siblingIndex:e=>er.readInt32Field(e,4),newTreeIndex:e=>er.readInt32Field(e,8),moveToSiblingIndex:e=>er.readInt32Field(e,8),removedAttributeName:e=>er.readStringField(e,16)},Or={structLength:36,frameType:e=>er.readInt16Field(e,4),subtreeLength:e=>er.readInt32Field(e,8),elementReferenceCaptureId:e=>er.readStringField(e,16),componentId:e=>er.readInt32Field(e,12),elementName:e=>er.readStringField(e,16),textContent:e=>er.readStringField(e,16),markupContent:e=>er.readStringField(e,16),attributeName:e=>er.readStringField(e,16),attributeValue:e=>er.readStringField(e,24,!0),attributeEventHandlerId:e=>er.readUint64Field(e,8)};function Fr(e,t,n){return er.getArrayEntryPtr(e,t,n)}class $r{constructor(e){this.componentManager=e}resolveRegisteredElement(e){const t=Number.parseInt(e);if(!Number.isNaN(t))return H(this.componentManager.resolveRootComponent(t))}getParameterValues(e){return this.componentManager.initialComponents[e].parameterValues}getParameterDefinitions(e){return this.componentManager.initialComponents[e].parameterDefinitions}getTypeName(e){return this.componentManager.initialComponents[e].typeName}getAssembly(e){return this.componentManager.initialComponents[e].assembly}getCount(){return this.componentManager.initialComponents.length}}let Hr,Wr,jr,zr,qr,Jr=!1,Kr=!1,Vr=!0,Xr=!1;const Gr=new Promise((e=>{qr=e}));let Yr;const Qr=new Promise((e=>{Yr=e}));let Zr;function ei(e){if(void 0!==zr)throw new Error("Blazor WebAssembly has already started.");return zr=new Promise(ti.bind(null,e)),zr}async function ti(e,t,n){(function(){if(window.parent!==window&&!window.opener&&window.frameElement){const e=window.sessionStorage&&window.sessionStorage["Microsoft.AspNetCore.Components.WebAssembly.Authentication.CachedAuthSettings"],t=e&&JSON.parse(e);return t&&t.redirect_uri&&location.href.startsWith(t.redirect_uri)}return!1})()&&await new Promise((()=>{}));const o=ni();!function(e){const t=D;D=(e,n,o)=>{((e,t,n)=>{const o=De(e);(null==o?void 0:o.eventDelegator.getHandler(t))&&Ir.invokeWhenHeapUnlocked(n)})(e,n,(()=>t(e,n,o)))}}(),yt._internal.applyHotReload=(e,t,n,o)=>{vr.invokeDotNetStaticMethod("Microsoft.AspNetCore.Components.WebAssembly","ApplyHotReloadDelta",e,t,n,o)},yt._internal.getApplyUpdateCapabilities=()=>vr.invokeDotNetStaticMethod("Microsoft.AspNetCore.Components.WebAssembly","GetApplyUpdateCapabilities"),yt._internal.invokeJSFromDotNet=ri,yt._internal.invokeJSJson=ii,yt._internal.endInvokeDotNetFromJS=si,yt._internal.receiveWebAssemblyDotNetDataStream=ai,yt._internal.receiveByteArray=ci;const r=sr(Ir);yt.platform=r,yt._internal.renderBatch=(e,t)=>{const n=Ir.beginHeapLock();try{xe(e,new Mr(t))}finally{n.release()}},yt._internal.navigationManager.listenForNavigationEvents(On.WebAssembly,(async(e,t,n)=>{await vr.invokeDotNetStaticMethodAsync("Microsoft.AspNetCore.Components.WebAssembly","NotifyLocationChanged",e,t,n)}),(async(e,t,n,o)=>{const r=await vr.invokeDotNetStaticMethodAsync("Microsoft.AspNetCore.Components.WebAssembly","NotifyLocationChangingAsync",t,n,o);yt._internal.navigationManager.endLocationChanging(e,r)}));const i=new $r(e);let s;yt._internal.registeredComponents={getRegisteredComponentsCount:()=>i.getCount(),getAssembly:e=>i.getAssembly(e),getTypeName:e=>i.getTypeName(e),getParameterDefinitions:e=>i.getParameterDefinitions(e)||"",getParameterValues:e=>i.getParameterValues(e)||""},yt._internal.getPersistedState=()=>Tt(document,Et)||"",yt._internal.getInitialComponentsUpdate=()=>Qr,yt._internal.updateRootComponents=e=>{var t;return null===(t=yt._internal.dotNetExports)||void 0===t?void 0:t.UpdateRootComponentsCore(e)},yt._internal.endUpdateRootComponents=t=>{var n;return null===(n=e.onAfterUpdateRootComponents)||void 0===n?void 0:n.call(e,t)},yt._internal.attachRootComponentToElement=(e,t,n)=>{const o=i.resolveRegisteredElement(e);o?Ae(n,o,t,!1):function(e,t,n){const o="::before";let r=!1;if(e.endsWith("::after"))e=e.slice(0,-7),r=!0;else if(e.endsWith(o))throw new Error(`The '${o}' selector is not supported.`);const i=w(e)||document.querySelector(e);if(!i)throw new Error(`Could not find any element matching selector '${e}'.`);Ae(n,W(i,!0),t,r)}(e,t,n)};try{await o,s=await r.start()}catch(e){throw new Error(`Failed to start platform. Reason: ${e}`)}r.callEntryPoint(),br.invokeAfterStartedCallbacks(yt),Kr=!0,t()}function ni(){return null!=jr||(jr=(async()=>{await Wr;const e=null!=Hr?Hr:{},t=null==Hr?void 0:Hr.configureRuntime;e.configureRuntime=e=>{null==t||t(e),Xr&&e.withEnvironmentVariable("__BLAZOR_WEBASSEMBLY_WAIT_FOR_ROOT_COMPONENTS","true")},await Ir.load(e,qr),Jr=!0})()),jr}function oi(){return Jr}function ri(t,n,o,r){const i=Ir.readStringField(t,0),s=Ir.readInt32Field(t,4),a=Ir.readStringField(t,8),c=Ir.readUint64Field(t,20);if(null!==a){const e=Ir.readUint64Field(t,12);if(0!==e)return vr.beginInvokeJSFromDotNet(e,i,a,s,c),0;{const e=vr.invokeJSFromDotNet(i,a,s,c);return null===e?0:fr.js_string_to_mono_string(e)}}{const t=e.findJSFunction(i,c).call(null,n,o,r);switch(s){case e.JSCallResultType.Default:return t;case e.JSCallResultType.JSObjectReference:return e.createJSObjectReference(t).__jsObjectId;case e.JSCallResultType.JSStreamReference:{const n=e.createJSStreamReference(t),o=JSON.stringify(n);return fr.js_string_to_mono_string(o)}case e.JSCallResultType.JSVoidResult:return null;default:throw new Error(`Invalid JS call result type '${s}'.`)}}}function ii(e,t,n,o,r){return 0!==r?(vr.beginInvokeJSFromDotNet(r,e,o,n,t),null):vr.invokeJSFromDotNet(e,o,n,t)}function si(e,t,n){vr.endInvokeDotNetFromJS(e,t,n)}function ai(e,t,n,o){!function(e,t,n,o,r){let i=vt.get(t);if(!i){const n=new ReadableStream({start(e){vt.set(t,e),i=e}});e.supplyDotNetStream(t,n)}r?(i.error(r),vt.delete(t)):0===o?(i.close(),vt.delete(t)):i.enqueue(n.length===o?n:n.subarray(0,o))}(vr,e,t,n,o)}function ci(e,t){vr.receiveByteArray(e,t)}function li(e,t){t.namespaceURI?e.setAttributeNS(t.namespaceURI,t.name,t.value):e.setAttribute(t.name,t.value)}Wr=new Promise((e=>{Zr=e}));const hi="data-permanent";var di,ui;!function(e){e[e.None=0]="None",e[e.Some=1]="Some",e[e.Infinite=2]="Infinite"}(di||(di={})),function(e){e.Keep="keep",e.Update="update",e.Insert="insert",e.Delete="delete"}(ui||(ui={}));class pi{static create(e,t,n){return 0===t&&n===e.length?e:new pi(e,t,n)}constructor(e,t,n){this.source=e,this.startIndex=t,this.length=n}item(e){return this.source.item(e+this.startIndex)}forEach(e,t){for(let t=0;t=n&&s>=o&&r(e.item(i),t.item(s))===di.None;)i--,s--,a++;return a}(e,t,o,o,n),i=function(e){var t;const n=[];let o=e.length-1,r=(null===(t=e[o])||void 0===t?void 0:t.length)-1;for(;o>0||r>0;){const t=0===o?ui.Insert:0===r?ui.Delete:e[o][r];switch(n.unshift(t),t){case ui.Keep:case ui.Update:o--,r--;break;case ui.Insert:r--;break;case ui.Delete:o--}}return n}(function(e,t,n){const o=[],r=[],i=e.length,s=t.length;if(0===i&&0===s)return[];for(let e=0;e<=i;e++)(o[e]=Array(s+1))[0]=e,r[e]=Array(s+1);const a=o[0];for(let e=1;e<=s;e++)a[e]=e;for(let a=1;a<=i;a++)for(let i=1;i<=s;i++){const s=n(e.item(a-1),t.item(i-1)),c=o[a-1][i]+1,l=o[a][i-1]+1;let h;switch(s){case di.None:h=o[a-1][i-1];break;case di.Some:h=o[a-1][i-1]+1;break;case di.Infinite:h=Number.MAX_VALUE}h{const t=Pe(e);history.pushState(null,"",e),t?Ue(e):Li(e,!0)}))}function Pi(e){$e()||Li(location.href,!1)}function Ui(e){var t,n,o,r,i;if($e()||e.defaultPrevented)return;const s=e.target;if(s instanceof HTMLFormElement){if(!function(e){const t=e.getAttribute("data-enhance");return"string"==typeof t&&""===t||"true"===(null==t?void 0:t.toLowerCase())}(s))return;const a=(null===(t=e.submitter)||void 0===t?void 0:t.getAttribute("formmethod"))||s.method;if("dialog"===a)return void console.warn('A form cannot be enhanced when its method is "dialog".');const c=(null===(n=e.submitter)||void 0===n?void 0:n.getAttribute("formtarget"))||s.target;if(""!==c&&"_self"!==c)return void console.warn('A form cannot be enhanced when its target is different from the default value "_self".');e.preventDefault();const l=new URL((null===(o=e.submitter)||void 0===o?void 0:o.getAttribute("formaction"))||s.action,document.baseURI),h={method:a},d=new FormData(s),u=null===(r=e.submitter)||void 0===r?void 0:r.getAttribute("name"),p=e.submitter.getAttribute("value");u&&p&&d.append(u,p);const f=new URLSearchParams(d).toString();if("get"===h.method)l.search=f,history.pushState(null,"",l.toString());else{const t=(null===(i=e.submitter)||void 0===i?void 0:i.getAttribute("formenctype"))||s.enctype;"multipart/form-data"===t?h.body=d:(h.body=f,h.headers={"content-type":t,accept:ki})}Li(l.toString(),!1,h)}}async function Li(e,t,n,o){Ai=!0,null==Ti||Ti.abort(),function(e,t){null==ke||ke(e,t)}(e,t),Ti=new AbortController;const r=Ti.signal,i=fetch(e,Object.assign({signal:r,mode:"no-cors",headers:{accept:ki}},n));let s=null;if(await async function(e,t,n,o){let r;try{if(r=await e,!r.body)return void n(r,"");const t=r.headers.get("ssr-framing");if(!t){const e=await r.text();return void n(r,e)}let o=!0;await r.body.pipeThrough(new TextDecoderStream).pipeThrough(function(e){let t="";return new TransformStream({transform(n,o){if(t+=n,t.indexOf(e,t.length-n.length-e.length)>=0){const n=t.split(e);n.slice(0,-1).forEach((e=>o.enqueue(e))),t=n[n.length-1]}},flush(e){e.enqueue(t)}})}(`\x3c!--${t}--\x3e`)).pipeTo(new WritableStream({write(e){o?(o=!1,n(r,e)):(e=>{const t=document.createRange().createContextualFragment(e);for(;t.firstChild;)document.body.appendChild(t.firstChild)})(e)}}))}catch(e){if("AbortError"===e.name&&t.aborted)return;throw e}}(i,r,((t,r)=>{const i=!(null==n?void 0:n.method)||"get"===n.method,a=t.status>=200&&t.status<300;if("opaque"===t.type){if(i)return void Oi(e);throw new Error("Enhanced navigation does not support making a non-GET request to an endpoint that redirects to an external origin. Avoid enabling enhanced navigation for form posts that may perform external redirections.")}if(a&&"allow"!==t.headers.get("blazor-enhanced-nav")){if(i)return void Oi(e);throw new Error("Enhanced navigation does not support making a non-GET request to a non-Blazor endpoint. Avoid enabling enhanced navigation for forms that post to a non-Blazor endpoint.")}(t.redirected||o)&&((o?"get"===o:i)?history.replaceState(null,"",t.url):t.url!==location.href&&history.pushState(null,"",t.url),e=t.url);const c=t.headers.get("blazor-enhanced-nav-redirect-location");if(c)return void location.replace(c);t.redirected||i||!a||(function(e){const t=new URL(e.url),n=new URL(Di);return t.protocol===n.protocol&&t.host===n.host&&t.port===n.port&&t.pathname===n.pathname}(t)?location.href!==Di&&history.pushState(null,"",Di):s=`Cannot perform enhanced form submission that changes the URL (except via a redirection), because then back/forward would not work. Either remove this form's 'action' attribute, or change its method to 'get', or do not mark it as enhanced.\nOld URL: ${location.href}\nNew URL: ${t.url}`),Di=t.url;const l=t.headers.get("content-type");if((null==l?void 0:l.startsWith("text/html"))&&r){const e=(new DOMParser).parseFromString(r,"text/html");gi(document,e),Ri.documentUpdated()}else(null==l?void 0:l.startsWith("text/"))&&r?Bi(r):a||r?i?Oi(e):Bi(`Error: ${n.method} request to ${e} returned non-HTML content of type ${l||"unspecified"}.`):Bi(`Error: ${t.status} ${t.statusText}`)})),!r.aborted){const t=e.indexOf("#");if(t>=0){const n=e.substring(t+1),o=document.getElementById(n);null==o||o.scrollIntoView()}if(Ai=!1,Ri.enhancedNavigationCompleted(),s)throw new Error(s)}}function Bi(e){document.documentElement.textContent=e;const t=document.documentElement.style;t.fontFamily="consolas, monospace",t.whiteSpace="pre-wrap",t.padding="1rem"}function Oi(e){history.replaceState(null,"",e+"?"),location.replace(e)}let Fi,$i=!0;class Hi extends HTMLElement{connectedCallback(){var e;const t=this.parentNode;null===(e=t.parentNode)||void 0===e||e.removeChild(t),t.childNodes.forEach((e=>{if(e instanceof HTMLTemplateElement){const t=e.getAttribute("blazor-component-id");if(t)"true"!==e.getAttribute("enhanced-nav")&&Ti||function(e,t){const n=function(e){const t=`bl:${e}`,n=document.createNodeIterator(document,NodeFilter.SHOW_COMMENT);let o=null;for(;(o=n.nextNode())&&o.textContent!==t;);if(!o)return null;const r=`/bl:${e}`;let i=null;for(;(i=n.nextNode())&&i.textContent!==r;);return i?{startMarker:o,endMarker:i}:null}(e);if(n){const{startMarker:e,endMarker:o}=n;if($i)gi({startExclusive:e,endExclusive:o},t);else{const n=o.parentNode,r=new Range;for(r.setStart(e,e.textContent.length),r.setEnd(o,0),r.deleteContents();t.childNodes[0];)n.insertBefore(t.childNodes[0],o)}Fi.documentUpdated()}}(t,e.content);else switch(e.getAttribute("type")){case"redirection":const t=Fe(e.content.textContent),n="form-post"===e.getAttribute("from");"true"===e.getAttribute("enhanced")&&Me(t)?Li(t,!1,void 0,n?"post":"get"):n?t!==location.href&&location.assign(t):location.replace(t);break;case"error":Bi(e.content.textContent||"Error")}}}))}}class Wi{constructor(e){var t;this._circuitInactivityTimeoutMs=e,this._rootComponentsBySsrComponentId=new Map,this._seenDescriptors=new Set,this._pendingOperationBatches={},this._nextOperationBatchId=1,this._nextSsrComponentId=1,this._didWebAssemblyFailToLoadQuickly=!1,this._isComponentRefreshPending=!1,this.initialComponents=[],t=()=>{this.rootComponentsMayRequireRefresh()},E.push(t)}onAfterRenderBatch(e){e===On.Server&&this.circuitMayHaveNoRootComponents()}onDocumentUpdated(){this.rootComponentsMayRequireRefresh()}onEnhancedNavigationCompleted(){this.rootComponentsMayRequireRefresh()}registerComponent(e){if(this._seenDescriptors.has(e))return;"auto"!==e.type&&"webassembly"!==e.type||this.startLoadingWebAssemblyIfNotStarted();const t=this._nextSsrComponentId++;this._seenDescriptors.add(e),this._rootComponentsBySsrComponentId.set(t,{descriptor:e,ssrComponentId:t})}unregisterComponent(e){this._seenDescriptors.delete(e.descriptor),this._rootComponentsBySsrComponentId.delete(e.ssrComponentId),this.circuitMayHaveNoRootComponents()}async startLoadingWebAssemblyIfNotStarted(){if(void 0!==jr)return;Xr=!0;const e=ni();setTimeout((()=>{oi()||this.onWebAssemblyFailedToLoadQuickly()}),yt._internal.loadWebAssemblyQuicklyTimeout);const t=await Gr;(function(e){if(!e.cacheBootResources)return!1;const t=ji(e);if(!t)return!1;const n=window.localStorage.getItem(t.key);return t.value===n})(t)||this.onWebAssemblyFailedToLoadQuickly(),await e,function(e){const t=ji(e);t&&window.localStorage.setItem(t.key,t.value)}(t),this.rootComponentsMayRequireRefresh()}onWebAssemblyFailedToLoadQuickly(){this._didWebAssemblyFailToLoadQuickly||(this._didWebAssemblyFailToLoadQuickly=!0,this.rootComponentsMayRequireRefresh())}startCircutIfNotStarted(){return void 0===Qo?nr(this):!Xo||Xo.isDisposedOrDisposing()?rr():void 0}async startWebAssemblyIfNotStarted(){this.startLoadingWebAssemblyIfNotStarted(),void 0===zr&&await ei(this)}rootComponentsMayRequireRefresh(){this._isComponentRefreshPending||(this._isComponentRefreshPending=!0,setTimeout((()=>{this._isComponentRefreshPending=!1,this.refreshRootComponents(this._rootComponentsBySsrComponentId.values())}),0))}circuitMayHaveNoRootComponents(){if(this.rendererHasExistingOrPendingComponents(On.Server,"server","auto"))return clearTimeout(this._circuitInactivityTimeoutId),void(this._circuitInactivityTimeoutId=void 0);void 0===this._circuitInactivityTimeoutId&&(this._circuitInactivityTimeoutId=setTimeout((()=>{this.rendererHasExistingOrPendingComponents(On.Server,"server","auto")||(async function(){await(null==Xo?void 0:Xo.dispose())}(),this._circuitInactivityTimeoutId=void 0)}),this._circuitInactivityTimeoutMs))}rendererHasComponents(e){const t=De(e);return void 0!==t&&t.getRootComponentCount()>0}rendererHasExistingOrPendingComponents(e,...t){if(this.rendererHasComponents(e))return!0;for(const{descriptor:{type:n},assignedRendererId:o}of this._rootComponentsBySsrComponentId.values()){if(o===e)return!0;if(void 0===o&&-1!==t.indexOf(n))return!0}return!1}refreshRootComponents(e){const t=new Map;for(const n of e){const e=this.determinePendingOperation(n);if(!e)continue;const o=n.assignedRendererId;if(!o)throw new Error("Descriptors must be assigned a renderer ID before getting used as root components");let r=t.get(o);r||(r=[],t.set(o,r)),r.push(e)}for(const[e,n]of t){const t={batchId:this._nextOperationBatchId++,operations:n};this._pendingOperationBatches[t.batchId]=t;const o=JSON.stringify(t);e===On.Server?ir(o):this.updateWebAssemblyRootComponents(o)}}updateWebAssemblyRootComponents(e){Vr?(Yr(e),Vr=!1):function(e){if(!zr)throw new Error("Blazor WebAssembly has not started.");if(!yt._internal.updateRootComponents)throw new Error("Blazor WebAssembly has not initialized.");Kr?yt._internal.updateRootComponents(e):async function(e){if(await zr,!yt._internal.updateRootComponents)throw new Error("Blazor WebAssembly has not initialized.");yt._internal.updateRootComponents(e)}(e)}(e)}resolveRendererIdForDescriptor(e){switch("auto"===e.type?this.getAutoRenderMode():e.type){case"server":return this.startCircutIfNotStarted(),On.Server;case"webassembly":return this.startWebAssemblyIfNotStarted(),On.WebAssembly;case null:return null}}getAutoRenderMode(){return this.rendererHasExistingOrPendingComponents(On.WebAssembly,"webassembly")?"webassembly":this.rendererHasExistingOrPendingComponents(On.Server,"server")?"server":oi()?"webassembly":this._didWebAssemblyFailToLoadQuickly?"server":null}determinePendingOperation(e){if(t=e.descriptor,document.contains(t.start)){if(void 0===e.assignedRendererId){if(Ai||"loading"===document.readyState)return null;const t=this.resolveRendererIdForDescriptor(e.descriptor);return null===t?null:T(t)?(be(e.descriptor.start,!0),e.assignedRendererId=t,e.uniqueIdAtLastUpdate=e.descriptor.uniqueId,{type:"add",ssrComponentId:e.ssrComponentId,marker:Lt(e.descriptor)}):null}return T(e.assignedRendererId)?e.uniqueIdAtLastUpdate===e.descriptor.uniqueId?null:(e.uniqueIdAtLastUpdate=e.descriptor.uniqueId,{type:"update",ssrComponentId:e.ssrComponentId,marker:Lt(e.descriptor)}):null}return e.hasPendingRemoveOperation?null:void 0===e.assignedRendererId?(this.unregisterComponent(e),null):T(e.assignedRendererId)?(be(e.descriptor.start,!1),e.hasPendingRemoveOperation=!0,{type:"remove",ssrComponentId:e.ssrComponentId}):null;var t}resolveRootComponent(e){const t=this._rootComponentsBySsrComponentId.get(e);if(!t)throw new Error(`Could not resolve a root component with SSR component ID '${e}'.`);return t.descriptor}onAfterUpdateRootComponents(e){const t=this._pendingOperationBatches[e];delete this._pendingOperationBatches[e];for(const e of t.operations)switch(e.type){case"remove":{const t=this._rootComponentsBySsrComponentId.get(e.ssrComponentId);t&&this.unregisterComponent(t);break}}}}function ji(e){var t;const n=null===(t=e.resources)||void 0===t?void 0:t.hash,o=e.mainAssemblyName;return n&&o?{key:`blazor-resource-hash:${o}`,value:n}:null}class zi{constructor(){this._eventListeners=new Map}static create(e){const t=new zi;return e.addEventListener=t.addEventListener.bind(t),e.removeEventListener=t.removeEventListener.bind(t),t}addEventListener(e,t){let n=this._eventListeners.get(e);n||(n=new Set,this._eventListeners.set(e,n)),n.add(t)}removeEventListener(e,t){var n;null===(n=this._eventListeners.get(e))||void 0===n||n.delete(t)}dispatchEvent(e,t){const n=this._eventListeners.get(e);if(!n)return;const o={...t,type:e};for(const e of n)e(o)}}let qi,Ji=!1;function Ki(e){var t,n,o,r;if(Ji)throw new Error("Blazor has already started.");Ji=!0,null!==(t=(e=e||{}).logLevel)&&void 0!==t||(e.logLevel=wt.Error),yt._internal.loadWebAssemblyQuicklyTimeout=3e3,yt._internal.isBlazorWeb=!0,yt._internal.hotReloadApplied=()=>{Be()&&Oe(location.href,!0)},qi=new Wi(null!==(o=null===(n=null==e?void 0:e.ssr)||void 0===n?void 0:n.circuitInactivityTimeoutMs)&&void 0!==o?o:2e3);const i=zi.create(yt),s={documentUpdated:()=>{qi.onDocumentUpdated(),i.dispatchEvent("enhancedload",{})},enhancedNavigationCompleted(){qi.onEnhancedNavigationCompleted()}};return fi=qi,function(e,t){Fi=t,(null==e?void 0:e.disableDomPreservation)&&($i=!1),customElements.define("blazor-ssr-end",Hi)}(null==e?void 0:e.ssr,s),(null===(r=null==e?void 0:e.ssr)||void 0===r?void 0:r.disableDomPreservation)||xi(s),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Vi.bind(null,e)):Vi(e),Promise.resolve()}function Vi(e){const t=$o((null==e?void 0:e.circuit)||{});e.circuit=t;const n=async function(e,t){var n;const o=Tt(document,It,"initializers");if(!o)return new Jo(!1,t);const r=null!==(n=JSON.parse(atob(o)))&&void 0!==n?n:[],i=new Jo(!1,t);return await i.importInitializersAsync(r,[e]),i}(e,new _t(t.logLevel));tr(Xi(n,t)),function(e){if(Hr)throw new Error("WebAssembly options have already been configured.");!async function(e){const t=await e;Hr=t,Zr()}(e)}(Xi(n,(null==e?void 0:e.webAssembly)||{})),function(e){const t=_i(document);for(const e of t)null==fi||fi.registerComponent(e)}(),qi.onDocumentUpdated(),async function(e){const t=await e;await t.invokeAfterStartedCallbacks(yt)}(n)}async function Xi(e,t){return await e,t}yt.start=Ki,window.DotNet=e,document&&document.currentScript&&"false"!==document.currentScript.getAttribute("autostart")&&Ki()})()})();
\ No newline at end of file
diff --git a/src/Components/Web.JS/dist/Release/blazor.webview.js b/src/Components/Web.JS/dist/Release/blazor.webview.js
index cf7436dfd197..71cbd004128e 100644
--- a/src/Components/Web.JS/dist/Release/blazor.webview.js
+++ b/src/Components/Web.JS/dist/Release/blazor.webview.js
@@ -1 +1 @@
-(()=>{"use strict";var e,t,n,r={d:(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};r.d({},{e:()=>_t}),function(e){const t=[],n="__jsObjectId",r="__dotNetObject",o="__byte[]",a="__dotNetStream",i="__jsStreamReferenceLength";let s,c;class l{constructor(e){this._jsObject=e,this._cachedFunctions=new Map}findFunction(e){const t=this._cachedFunctions.get(e);if(t)return t;let n,r=this._jsObject;if(e.split(".").forEach((t=>{if(!(t in r))throw new Error(`Could not find '${e}' ('${t}' was undefined).`);n=r,r=r[t]})),r instanceof Function)return r=r.bind(n),this._cachedFunctions.set(e,r),r;throw new Error(`The value '${e}' is not a function.`)}getWrappedObject(){return this._jsObject}}const u={0:new l(window)};u[0]._cachedFunctions.set("import",(e=>("string"==typeof e&&e.startsWith("./")&&(e=new URL(e.substr(2),document.baseURI).toString()),import(e))));let d,h=1;function f(e){t.push(e)}function m(e){if(e&&"object"==typeof e){u[h]=new l(e);const t={[n]:h};return h++,t}throw new Error(`Cannot create a JSObjectReference from the value '${e}'.`)}function p(e){let t=-1;if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Blob)t=e.size;else{if(!(e.buffer instanceof ArrayBuffer))throw new Error("Supplied value is not a typed array or blob.");if(void 0===e.byteLength)throw new Error(`Cannot create a JSStreamReference from the value '${e}' as it doesn't have a byteLength.`);t=e.byteLength}const r={[i]:t};try{const t=m(e);r[n]=t[n]}catch(t){throw new Error(`Cannot create a JSStreamReference from the value '${e}'.`)}return r}function b(e,n){c=e;const r=n?JSON.parse(n,((e,n)=>t.reduce(((t,n)=>n(e,t)),n))):null;return c=void 0,r}function v(){if(void 0===s)throw new Error("No call dispatcher has been set.");if(null===s)throw new Error("There are multiple .NET runtimes present, so a default dispatcher could not be resolved. Use DotNetObject to invoke .NET instance methods.");return s}e.attachDispatcher=function(e){const t=new g(e);return void 0===s?s=t:s&&(s=null),t},e.attachReviver=f,e.invokeMethod=function(e,t,...n){return v().invokeDotNetStaticMethod(e,t,...n)},e.invokeMethodAsync=function(e,t,...n){return v().invokeDotNetStaticMethodAsync(e,t,...n)},e.createJSObjectReference=m,e.createJSStreamReference=p,e.disposeJSObjectReference=function(e){const t=e&&e[n];"number"==typeof t&&E(t)},function(e){e[e.Default=0]="Default",e[e.JSObjectReference=1]="JSObjectReference",e[e.JSStreamReference=2]="JSStreamReference",e[e.JSVoidResult=3]="JSVoidResult"}(d=e.JSCallResultType||(e.JSCallResultType={}));class g{constructor(e){this._dotNetCallDispatcher=e,this._byteArraysToBeRevived=new Map,this._pendingDotNetToJSStreams=new Map,this._pendingAsyncCalls={},this._nextAsyncCallId=1}getDotNetCallDispatcher(){return this._dotNetCallDispatcher}invokeJSFromDotNet(e,t,n,r){const o=b(this,t),a=D(w(e,r)(...o||[]),n);return null==a?null:N(this,a)}beginInvokeJSFromDotNet(e,t,n,r,o){const a=new Promise((e=>{const r=b(this,n);e(w(t,o)(...r||[]))}));e&&a.then((t=>N(this,[e,!0,D(t,r)]))).then((t=>this._dotNetCallDispatcher.endInvokeJSFromDotNet(e,!0,t)),(t=>this._dotNetCallDispatcher.endInvokeJSFromDotNet(e,!1,JSON.stringify([e,!1,y(t)]))))}endInvokeDotNetFromJS(e,t,n){const r=t?b(this,n):new Error(n);this.completePendingCall(parseInt(e,10),t,r)}invokeDotNetStaticMethod(e,t,...n){return this.invokeDotNetMethod(e,t,null,n)}invokeDotNetStaticMethodAsync(e,t,...n){return this.invokeDotNetMethodAsync(e,t,null,n)}invokeDotNetMethod(e,t,n,r){if(this._dotNetCallDispatcher.invokeDotNetFromJS){const o=N(this,r),a=this._dotNetCallDispatcher.invokeDotNetFromJS(e,t,n,o);return a?b(this,a):null}throw new Error("The current dispatcher does not support synchronous calls from JS to .NET. Use invokeDotNetMethodAsync instead.")}invokeDotNetMethodAsync(e,t,n,r){if(e&&n)throw new Error(`For instance method calls, assemblyName should be null. Received '${e}'.`);const o=this._nextAsyncCallId++,a=new Promise(((e,t)=>{this._pendingAsyncCalls[o]={resolve:e,reject:t}}));try{const a=N(this,r);this._dotNetCallDispatcher.beginInvokeDotNetFromJS(o,e,t,n,a)}catch(e){this.completePendingCall(o,!1,e)}return a}receiveByteArray(e,t){this._byteArraysToBeRevived.set(e,t)}processByteArray(e){const t=this._byteArraysToBeRevived.get(e);return t?(this._byteArraysToBeRevived.delete(e),t):null}supplyDotNetStream(e,t){if(this._pendingDotNetToJSStreams.has(e)){const n=this._pendingDotNetToJSStreams.get(e);this._pendingDotNetToJSStreams.delete(e),n.resolve(t)}else{const n=new C;n.resolve(t),this._pendingDotNetToJSStreams.set(e,n)}}getDotNetStreamPromise(e){let t;if(this._pendingDotNetToJSStreams.has(e))t=this._pendingDotNetToJSStreams.get(e).streamPromise,this._pendingDotNetToJSStreams.delete(e);else{const n=new C;this._pendingDotNetToJSStreams.set(e,n),t=n.streamPromise}return t}completePendingCall(e,t,n){if(!this._pendingAsyncCalls.hasOwnProperty(e))throw new Error(`There is no pending async call with ID ${e}.`);const r=this._pendingAsyncCalls[e];delete this._pendingAsyncCalls[e],t?r.resolve(n):r.reject(n)}}function y(e){return e instanceof Error?`${e.message}\n${e.stack}`:e?e.toString():"null"}function w(e,t){const n=u[t];if(n)return n.findFunction(e);throw new Error(`JS object instance with ID ${t} does not exist (has it been disposed?).`)}function E(e){delete u[e]}e.findJSFunction=w,e.disposeJSObjectReferenceById=E;class S{constructor(e,t){this._id=e,this._callDispatcher=t}invokeMethod(e,...t){return this._callDispatcher.invokeDotNetMethod(null,e,this._id,t)}invokeMethodAsync(e,...t){return this._callDispatcher.invokeDotNetMethodAsync(null,e,this._id,t)}dispose(){this._callDispatcher.invokeDotNetMethodAsync(null,"__Dispose",this._id,null).catch((e=>console.error(e)))}serializeAsArg(){return{[r]:this._id}}}e.DotNetObject=S,f((function(e,t){if(t&&"object"==typeof t){if(t.hasOwnProperty(r))return new S(t[r],c);if(t.hasOwnProperty(n)){const e=t[n],r=u[e];if(r)return r.getWrappedObject();throw new Error(`JS object instance with Id '${e}' does not exist. It may have been disposed.`)}if(t.hasOwnProperty(o)){const e=t[o],n=c.processByteArray(e);if(void 0===n)throw new Error(`Byte array index '${e}' does not exist.`);return n}if(t.hasOwnProperty(a)){const e=t[a],n=c.getDotNetStreamPromise(e);return new I(n)}}return t}));class I{constructor(e){this._streamPromise=e}stream(){return this._streamPromise}async arrayBuffer(){return new Response(await this.stream()).arrayBuffer()}}class C{constructor(){this.streamPromise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}function D(e,t){switch(t){case d.Default:return e;case d.JSObjectReference:return m(e);case d.JSStreamReference:return p(e);case d.JSVoidResult:return null;default:throw new Error(`Invalid JS call result type '${t}'.`)}}let A=0;function N(e,t){A=0,c=e;const n=JSON.stringify(t,k);return c=void 0,n}function k(e,t){if(t instanceof S)return t.serializeAsArg();if(t instanceof Uint8Array){c.getDotNetCallDispatcher().sendByteArray(A,t);const e={[o]:A};return A++,e}return t}}(e||(e={})),function(e){e[e.prependFrame=1]="prependFrame",e[e.removeFrame=2]="removeFrame",e[e.setAttribute=3]="setAttribute",e[e.removeAttribute=4]="removeAttribute",e[e.updateText=5]="updateText",e[e.stepIn=6]="stepIn",e[e.stepOut=7]="stepOut",e[e.updateMarkup=8]="updateMarkup",e[e.permutationListEntry=9]="permutationListEntry",e[e.permutationListEnd=10]="permutationListEnd"}(t||(t={})),function(e){e[e.element=1]="element",e[e.text=2]="text",e[e.attribute=3]="attribute",e[e.component=4]="component",e[e.region=5]="region",e[e.elementReferenceCapture=6]="elementReferenceCapture",e[e.markup=8]="markup",e[e.namedEvent=10]="namedEvent"}(n||(n={}));class o{constructor(e,t){this.componentId=e,this.fieldValue=t}static fromEvent(e,t){const n=t.target;if(n instanceof Element){const t=function(e){return e instanceof HTMLInputElement?e.type&&"checkbox"===e.type.toLowerCase()?{value:e.checked}:{value:e.value}:e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement?{value:e.value}:null}(n);if(t)return new o(e,t.value)}return null}}const a=new Map,i=new Map,s=[];function c(e){return a.get(e)}function l(e){const t=a.get(e);return(null==t?void 0:t.browserEventName)||e}function u(e,t){e.forEach((e=>a.set(e,t)))}function d(e){const t=[];for(let n=0;ne.selected)).map((e=>e.value))}}{const e=function(e){return!!e&&"INPUT"===e.tagName&&"checkbox"===e.getAttribute("type")}(t);return{value:e?!!t.checked:t.value}}}}),u(["copy","cut","paste"],{createEventArgs:e=>({type:e.type})}),u(["drag","dragend","dragenter","dragleave","dragover","dragstart","drop"],{createEventArgs:e=>{return{...h(t=e),dataTransfer:t.dataTransfer?{dropEffect:t.dataTransfer.dropEffect,effectAllowed:t.dataTransfer.effectAllowed,files:Array.from(t.dataTransfer.files).map((e=>e.name)),items:Array.from(t.dataTransfer.items).map((e=>({kind:e.kind,type:e.type}))),types:t.dataTransfer.types}:null};var t}}),u(["focus","blur","focusin","focusout"],{createEventArgs:e=>({type:e.type})}),u(["keydown","keyup","keypress"],{createEventArgs:e=>{return{key:(t=e).key,code:t.code,location:t.location,repeat:t.repeat,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,type:t.type};var t}}),u(["contextmenu","click","mouseover","mouseout","mousemove","mousedown","mouseup","mouseleave","mouseenter","dblclick"],{createEventArgs:e=>h(e)}),u(["error"],{createEventArgs:e=>{return{message:(t=e).message,filename:t.filename,lineno:t.lineno,colno:t.colno,type:t.type};var t}}),u(["loadstart","timeout","abort","load","loadend","progress"],{createEventArgs:e=>{return{lengthComputable:(t=e).lengthComputable,loaded:t.loaded,total:t.total,type:t.type};var t}}),u(["touchcancel","touchend","touchmove","touchenter","touchleave","touchstart"],{createEventArgs:e=>{return{detail:(t=e).detail,touches:d(t.touches),targetTouches:d(t.targetTouches),changedTouches:d(t.changedTouches),ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,type:t.type};var t}}),u(["gotpointercapture","lostpointercapture","pointercancel","pointerdown","pointerenter","pointerleave","pointermove","pointerout","pointerover","pointerup"],{createEventArgs:e=>{return{...h(t=e),pointerId:t.pointerId,width:t.width,height:t.height,pressure:t.pressure,tiltX:t.tiltX,tiltY:t.tiltY,pointerType:t.pointerType,isPrimary:t.isPrimary};var t}}),u(["wheel","mousewheel"],{createEventArgs:e=>{return{...h(t=e),deltaX:t.deltaX,deltaY:t.deltaY,deltaZ:t.deltaZ,deltaMode:t.deltaMode};var t}}),u(["cancel","close","toggle"],{createEventArgs:()=>({})});const f=["date","datetime-local","month","time","week"],m=new Map;let p,b,v=0;const g={async add(e,t,n){if(!n)throw new Error("initialParameters must be an object, even if empty.");const r="__bl-dynamic-root:"+(++v).toString();m.set(r,e);const o=await E().invokeMethodAsync("AddRootComponent",t,r),a=new w(o,b[t]);return await a.setParameters(n),a}};class y{invoke(e){return this._callback(e)}setCallback(t){this._selfJSObjectReference||(this._selfJSObjectReference=e.createJSObjectReference(this)),this._callback=t}getJSObjectReference(){return this._selfJSObjectReference}dispose(){this._selfJSObjectReference&&e.disposeJSObjectReference(this._selfJSObjectReference)}}class w{constructor(e,t){this._jsEventCallbackWrappers=new Map,this._componentId=e;for(const e of t)"eventcallback"===e.type&&this._jsEventCallbackWrappers.set(e.name.toLowerCase(),new y)}setParameters(e){const t={},n=Object.entries(e||{}),r=n.length;for(const[e,r]of n){const n=this._jsEventCallbackWrappers.get(e.toLowerCase());n&&r?(n.setCallback(r),t[e]=n.getJSObjectReference()):t[e]=r}return E().invokeMethodAsync("SetRootComponentParameters",this._componentId,r,t)}async dispose(){if(null!==this._componentId){await E().invokeMethodAsync("RemoveRootComponent",this._componentId),this._componentId=null;for(const e of this._jsEventCallbackWrappers.values())e.dispose()}}}function E(){if(!p)throw new Error("Dynamic root components have not been enabled in this application.");return p}const S=new Map,I=[],C=new Map;function D(e,t,n){return N(e,t.eventHandlerId,(()=>A(e).invokeMethodAsync("DispatchEventAsync",t,n)))}function A(e){const t=S.get(e);if(!t)throw new Error(`No interop methods are registered for renderer ${e}`);return t}let N=(e,t,n)=>n();const k=x(["abort","blur","cancel","canplay","canplaythrough","change","close","cuechange","durationchange","emptied","ended","error","focus","load","loadeddata","loadedmetadata","loadend","loadstart","mouseenter","mouseleave","pointerenter","pointerleave","pause","play","playing","progress","ratechange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeupdate","toggle","unload","volumechange","waiting","DOMNodeInsertedIntoDocument","DOMNodeRemovedFromDocument"]),R={submit:!0},T=x(["click","dblclick","mousedown","mousemove","mouseup"]);class _{constructor(e){this.browserRendererId=e,this.afterClickCallbacks=[];const t=++_.nextEventDelegatorId;this.eventsCollectionKey=`_blazorEvents_${t}`,this.eventInfoStore=new O(this.onGlobalEvent.bind(this))}setListener(e,t,n,r){const o=this.getEventHandlerInfosForElement(e,!0),a=o.getHandler(t);if(a)this.eventInfoStore.update(a.eventHandlerId,n);else{const a={element:e,eventName:t,eventHandlerId:n,renderingComponentId:r};this.eventInfoStore.add(a),o.setHandler(t,a)}}getHandler(e){return this.eventInfoStore.get(e)}removeListener(e){const t=this.eventInfoStore.remove(e);if(t){const e=t.element,n=this.getEventHandlerInfosForElement(e,!1);n&&n.removeHandler(t.eventName)}}notifyAfterClick(e){this.afterClickCallbacks.push(e),this.eventInfoStore.addGlobalListener("click")}setStopPropagation(e,t,n){this.getEventHandlerInfosForElement(e,!0).stopPropagation(t,n)}setPreventDefault(e,t,n){this.getEventHandlerInfosForElement(e,!0).preventDefault(t,n)}onGlobalEvent(e){if(!(e.target instanceof Element))return;this.dispatchGlobalEventToAllElements(e.type,e);const t=(n=e.type,i.get(n));var n;t&&t.forEach((t=>this.dispatchGlobalEventToAllElements(t,e))),"click"===e.type&&this.afterClickCallbacks.forEach((t=>t(e)))}dispatchGlobalEventToAllElements(e,t){const n=t.composedPath();let r=n.shift(),a=null,i=!1;const s=Object.prototype.hasOwnProperty.call(k,e);let l=!1;for(;r;){const h=r,f=this.getEventHandlerInfosForElement(h,!1);if(f){const n=f.getHandler(e);if(n&&(u=h,d=t.type,!((u instanceof HTMLButtonElement||u instanceof HTMLInputElement||u instanceof HTMLTextAreaElement||u instanceof HTMLSelectElement)&&Object.prototype.hasOwnProperty.call(T,d)&&u.disabled))){if(!i){const n=c(e);a=(null==n?void 0:n.createEventArgs)?n.createEventArgs(t):{},i=!0}Object.prototype.hasOwnProperty.call(R,t.type)&&t.preventDefault(),D(this.browserRendererId,{eventHandlerId:n.eventHandlerId,eventName:e,eventFieldInfo:o.fromEvent(n.renderingComponentId,t)},a)}f.stopPropagation(e)&&(l=!0),f.preventDefault(e)&&t.preventDefault()}r=s||l?void 0:n.shift()}var u,d}getEventHandlerInfosForElement(e,t){return Object.prototype.hasOwnProperty.call(e,this.eventsCollectionKey)?e[this.eventsCollectionKey]:t?e[this.eventsCollectionKey]=new L:null}}_.nextEventDelegatorId=0;class O{constructor(e){this.globalListener=e,this.infosByEventHandlerId={},this.countByEventName={},s.push(this.handleEventNameAliasAdded.bind(this))}add(e){if(this.infosByEventHandlerId[e.eventHandlerId])throw new Error(`Event ${e.eventHandlerId} is already tracked`);this.infosByEventHandlerId[e.eventHandlerId]=e,this.addGlobalListener(e.eventName)}get(e){return this.infosByEventHandlerId[e]}addGlobalListener(e){if(e=l(e),Object.prototype.hasOwnProperty.call(this.countByEventName,e))this.countByEventName[e]++;else{this.countByEventName[e]=1;const t=Object.prototype.hasOwnProperty.call(k,e);document.addEventListener(e,this.globalListener,t)}}update(e,t){if(Object.prototype.hasOwnProperty.call(this.infosByEventHandlerId,t))throw new Error(`Event ${t} is already tracked`);const n=this.infosByEventHandlerId[e];delete this.infosByEventHandlerId[e],n.eventHandlerId=t,this.infosByEventHandlerId[t]=n}remove(e){const t=this.infosByEventHandlerId[e];if(t){delete this.infosByEventHandlerId[e];const n=l(t.eventName);0==--this.countByEventName[n]&&(delete this.countByEventName[n],document.removeEventListener(n,this.globalListener))}return t}handleEventNameAliasAdded(e,t){if(Object.prototype.hasOwnProperty.call(this.countByEventName,e)){const n=this.countByEventName[e];delete this.countByEventName[e],document.removeEventListener(e,this.globalListener),this.addGlobalListener(t),this.countByEventName[t]+=n-1}}}class L{constructor(){this.handlers={},this.preventDefaultFlags=null,this.stopPropagationFlags=null}getHandler(e){return Object.prototype.hasOwnProperty.call(this.handlers,e)?this.handlers[e]:null}setHandler(e,t){this.handlers[e]=t}removeHandler(e){delete this.handlers[e]}preventDefault(e,t){return void 0!==t&&(this.preventDefaultFlags=this.preventDefaultFlags||{},this.preventDefaultFlags[e]=t),!!this.preventDefaultFlags&&this.preventDefaultFlags[e]}stopPropagation(e,t){return void 0!==t&&(this.stopPropagationFlags=this.stopPropagationFlags||{},this.stopPropagationFlags[e]=t),!!this.stopPropagationFlags&&this.stopPropagationFlags[e]}}function x(e){const t={};return e.forEach((e=>{t[e]=!0})),t}const F=Symbol(),M=Symbol();function P(e,t){if(F in e)return e;const n=[];if(e.childNodes.length>0){if(!t)throw new Error("New logical elements must start empty, or allowExistingContents must be true");e.childNodes.forEach((t=>{const r=P(t,!0);r[M]=e,n.push(r)}))}return e[F]=n,e}function B(e){const t=W(e);for(;t.length;)J(e,0)}function j(e,t){const n=document.createComment("!");return H(n,e,t),n}function H(e,t,n){const r=e;let o=e;if(e instanceof Comment){const t=W(r);if((null==t?void 0:t.length)>0){const t=G(r),n=new Range;n.setStartBefore(e),n.setEndAfter(t),o=n.extractContents()}}const a=U(r);if(a){const e=W(a),t=Array.prototype.indexOf.call(e,r);e.splice(t,1),delete r[M]}const i=W(t);if(n0;)J(n,0)}const r=n;r.parentNode.removeChild(r)}function U(e){return e[M]||null}function z(e,t){return W(e)[t]}function $(e){const t=X(e);return"http://www.w3.org/2000/svg"===t.namespaceURI&&"foreignObject"!==t.tagName}function W(e){return e[F]}function K(e){const t=W(U(e));return t[Array.prototype.indexOf.call(t,e)+1]||null}function V(e,t){const n=W(e);t.forEach((e=>{e.moveRangeStart=n[e.fromSiblingIndex],e.moveRangeEnd=G(e.moveRangeStart)})),t.forEach((t=>{const r=document.createComment("marker");t.moveToBeforeMarker=r;const o=n[t.toSiblingIndex+1];o?o.parentNode.insertBefore(r,o):Y(r,e)})),t.forEach((e=>{const t=e.moveToBeforeMarker,n=t.parentNode,r=e.moveRangeStart,o=e.moveRangeEnd;let a=r;for(;a;){const e=a.nextSibling;if(n.insertBefore(a,t),a===o)break;a=e}n.removeChild(t)})),t.forEach((e=>{n[e.toSiblingIndex]=e.moveRangeStart}))}function X(e){if(e instanceof Element||e instanceof DocumentFragment)return e;if(e instanceof Comment)return e.parentNode;throw new Error("Not a valid logical element")}function Y(e,t){if(t instanceof Element||t instanceof DocumentFragment)t.appendChild(e);else{if(!(t instanceof Comment))throw new Error(`Cannot append node because the parent is not a valid logical element. Parent: ${t}`);{const n=K(t);n?n.parentNode.insertBefore(e,n):Y(e,U(t))}}}function G(e){if(e instanceof Element||e instanceof DocumentFragment)return e;const t=K(e);if(t)return t.previousSibling;{const t=U(e);return t instanceof Element||t instanceof DocumentFragment?t.lastChild:G(t)}}function q(e){return`_bl_${e}`}Symbol();const Z="__internalId";e.attachReviver(((e,t)=>t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,Z)&&"string"==typeof t[Z]?function(e){const t=`[${q(e)}]`;return document.querySelector(t)}(t[Z]):t));const Q="_blazorDeferredValue";function ee(e){return"select-multiple"===e.type}function te(e,t){e.value=t||""}function ne(e,t){e instanceof HTMLSelectElement?ee(e)?function(e,t){t||(t=[]);for(let n=0;n{Ie()&&function(e,t){if(0!==e.button||function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e))return;if(e.defaultPrevented)return;const n=function(e){const t=e.composedPath&&e.composedPath();if(t)for(let e=0;e{const t=document.createElement("script");t.textContent=e.textContent,e.getAttributeNames().forEach((n=>{t.setAttribute(n,e.getAttribute(n))})),e.parentNode.replaceChild(t,e)})),oe.content));var i;let s=0;for(;a.firstChild;)H(a.firstChild,o,s++)}applyAttribute(e,t,n,r){const o=e.frameReader,a=o.attributeName(r),i=o.attributeEventHandlerId(r);if(i){const e=he(a);return void this.eventDelegator.setListener(n,e,i,t)}const s=o.attributeValue(r);this.setOrRemoveAttributeOrProperty(n,a,s)}insertFrameRange(e,t,n,r,o,a,i){const s=r;for(let s=a;s{je(t,e)})},enableNavigationInterception:function(e){if(void 0!==me&&me!==e)throw new Error("Only one interactive runtime may enable navigation interception at a time.");me=e},setHasLocationChangingListeners:function(e,t){const n=ke.get(e);if(!n)throw new Error(`Renderer with ID '${e}' is not listening for navigation events`);n.hasLocationChangingEventListeners=t},endLocationChanging:function(e,t){Te&&e===Ne&&(Te(t),Te=null)},navigateTo:function(e,t){Le(e,t,!0)},refresh:function(e){!e&&we()?Ee(location.href,!0):location.reload()},getBaseURI:()=>document.baseURI,getLocationHref:()=>location.href,scrollToElement:Oe};function Oe(e){const t=document.getElementById(e);return!!t&&(t.scrollIntoView(),!0)}function Le(e,t,n=!1){const r=Se(e),o=Ue();if(t.forceLoad||!ye(r)||"serverside-fullpageload"===o)!function(e,t){if(location.href===e){const t=e+"?";history.replaceState(null,"",t),location.replace(e)}else t?location.replace(e):location.href=e}(e,t.replaceHistoryEntry);else if("clientside-router"===o)xe(r,!1,t.replaceHistoryEntry,t.historyEntryState,n);else{if("serverside-enhanced"!==o)throw new Error(`Unsupported page load mechanism: ${o}`);Ee(r,t.replaceHistoryEntry)}}async function xe(e,t,n,r=void 0,o=!1){if(Pe(),function(e){const t=e.indexOf("#");return t>-1&&location.href.replace(location.hash,"")===e.substring(0,t)}(e))return void function(e,t,n){Fe(e,t,n);const r=e.indexOf("#");r!==e.length-1&&Oe(e.substring(r+1))}(e,n,r);const a=Je();(o||!(null==a?void 0:a.hasLocationChangingEventListeners)||await Be(e,r,t,a))&&(ge=!0,Fe(e,n,r),await je(t))}function Fe(e,t,n=void 0){t?history.replaceState({userState:n,_index:Ae},"",e):(Ae++,history.pushState({userState:n,_index:Ae},"",e))}function Me(e){return new Promise((t=>{const n=Re;Re=()=>{Re=n,t()},history.go(e)}))}function Pe(){Te&&(Te(!1),Te=null)}function Be(e,t,n,r){return new Promise((o=>{Pe(),Ne++,Te=o,r.locationChanging(Ne,e,t,n)}))}async function je(e,t){const n=null!=t?t:location.href;await Promise.all(Array.from(ke,(async([t,r])=>{var o,a;a=t,S.has(a)&&await r.locationChanged(n,null===(o=history.state)||void 0===o?void 0:o.userState,e)})))}async function He(e){var t,n;Re&&"serverside-enhanced"!==Ue()&&await Re(e),Ae=null!==(n=null===(t=history.state)||void 0===t?void 0:t._index)&&void 0!==n?n:0}function Je(){const e=Ce();if(void 0!==e)return ke.get(e)}function Ue(){return Ie()?"clientside-router":we()?"serverside-enhanced":window.Blazor._internal.isBlazorWeb?"serverside-fullpageload":"clientside-router"}const ze={focus:function(e,t){if(e instanceof HTMLElement)e.focus({preventScroll:t});else{if(!(e instanceof SVGElement))throw new Error("Unable to focus an invalid element.");if(!e.hasAttribute("tabindex"))throw new Error("Unable to focus an SVG element that does not have a tabindex.");e.focus({preventScroll:t})}},focusBySelector:function(e,t){const n=document.querySelector(e);n&&(n.hasAttribute("tabindex")||(n.tabIndex=-1),n.focus({preventScroll:!0}))}},$e={init:function(e,t,n,r=50){const o=Ke(t);(o||document.documentElement).style.overflowAnchor="none";const a=document.createRange();h(n.parentElement)&&(t.style.display="table-row",n.style.display="table-row");const i=new IntersectionObserver((function(r){r.forEach((r=>{var o;if(!r.isIntersecting)return;a.setStartAfter(t),a.setEndBefore(n);const i=a.getBoundingClientRect().height,s=null===(o=r.rootBounds)||void 0===o?void 0:o.height;r.target===t?e.invokeMethodAsync("OnSpacerBeforeVisible",r.intersectionRect.top-r.boundingClientRect.top,i,s):r.target===n&&n.offsetHeight>0&&e.invokeMethodAsync("OnSpacerAfterVisible",r.boundingClientRect.bottom-r.intersectionRect.bottom,i,s)}))}),{root:o,rootMargin:`${r}px`});i.observe(t),i.observe(n);const s=d(t),c=d(n),{observersByDotNetObjectId:l,id:u}=Ve(e);function d(e){const t={attributes:!0},n=new MutationObserver(((n,r)=>{h(e.parentElement)&&(r.disconnect(),e.style.display="table-row",r.observe(e,t)),i.unobserve(e),i.observe(e)}));return n.observe(e,t),n}function h(e){return null!==e&&(e instanceof HTMLTableElement&&""===e.style.display||"table"===e.style.display||e instanceof HTMLTableSectionElement&&""===e.style.display||"table-row-group"===e.style.display)}l[u]={intersectionObserver:i,mutationObserverBefore:s,mutationObserverAfter:c}},dispose:function(e){const{observersByDotNetObjectId:t,id:n}=Ve(e),r=t[n];r&&(r.intersectionObserver.disconnect(),r.mutationObserverBefore.disconnect(),r.mutationObserverAfter.disconnect(),e.dispose(),delete t[n])}},We=Symbol();function Ke(e){return e&&e!==document.body&&e!==document.documentElement?"visible"!==getComputedStyle(e).overflowY?e:Ke(e.parentElement):null}function Ve(e){var t;const n=e._callDispatcher,r=e._id;return null!==(t=n[We])&&void 0!==t||(n[We]={}),{observersByDotNetObjectId:n[We],id:r}}const Xe={getAndRemoveExistingTitle:function(){var e;const t=document.head?document.head.getElementsByTagName("title"):[];if(0===t.length)return null;let n=null;for(let r=t.length-1;r>=0;r--){const o=t[r],a=o.previousSibling;a instanceof Comment&&null!==U(a)||(null===n&&(n=o.textContent),null===(e=o.parentNode)||void 0===e||e.removeChild(o))}return n}},Ye={init:function(e,t){t._blazorInputFileNextFileId=0,t.addEventListener("click",(function(){t.value=""})),t.addEventListener("change",(function(){t._blazorFilesById={};const n=Array.prototype.map.call(t.files,(function(e){const n={id:++t._blazorInputFileNextFileId,lastModified:new Date(e.lastModified).toISOString(),name:e.name,size:e.size,contentType:e.type,readPromise:void 0,arrayBuffer:void 0,blob:e};return t._blazorFilesById[n.id]=n,n}));e.invokeMethodAsync("NotifyChange",n)}))},toImageFile:async function(e,t,n,r,o){const a=Ge(e,t),i=await new Promise((function(e){const t=new Image;t.onload=function(){URL.revokeObjectURL(t.src),e(t)},t.onerror=function(){t.onerror=null,URL.revokeObjectURL(t.src)},t.src=URL.createObjectURL(a.blob)})),s=await new Promise((function(e){var t;const a=Math.min(1,r/i.width),s=Math.min(1,o/i.height),c=Math.min(a,s),l=document.createElement("canvas");l.width=Math.round(i.width*c),l.height=Math.round(i.height*c),null===(t=l.getContext("2d"))||void 0===t||t.drawImage(i,0,0,l.width,l.height),l.toBlob(e,n)})),c={id:++e._blazorInputFileNextFileId,lastModified:a.lastModified,name:a.name,size:(null==s?void 0:s.size)||0,contentType:n,blob:s||a.blob};return e._blazorFilesById[c.id]=c,c},readFileData:async function(e,t){return Ge(e,t).blob}};function Ge(e,t){const n=e._blazorFilesById[t];if(!n)throw new Error(`There is no file with ID ${t}. The file list may have changed. See https://aka.ms/aspnet/blazor-input-file-multiple-selections.`);return n}const qe=new Set,Ze={enableNavigationPrompt:function(e){0===qe.size&&window.addEventListener("beforeunload",Qe),qe.add(e)},disableNavigationPrompt:function(e){qe.delete(e),0===qe.size&&window.removeEventListener("beforeunload",Qe)}};function Qe(e){e.preventDefault(),e.returnValue=!0}const et=new Map,tt={navigateTo:function(e,t,n=!1){Le(e,t instanceof Object?t:{forceLoad:t,replaceHistoryEntry:n})},registerCustomEventType:function(e,t){if(!t)throw new Error("The options parameter is required.");if(a.has(e))throw new Error(`The event '${e}' is already registered.`);if(t.browserEventName){const n=i.get(t.browserEventName);n?n.push(e):i.set(t.browserEventName,[e]),s.forEach((n=>n(e,t.browserEventName)))}a.set(e,t)},rootComponents:g,runtime:{},_internal:{navigationManager:_e,domWrapper:ze,Virtualize:$e,PageTitle:Xe,InputFile:Ye,NavigationLock:Ze,getJSDataStreamChunk:async function(e,t,n){return e instanceof Blob?await async function(e,t,n){const r=e.slice(t,t+n),o=await r.arrayBuffer();return new Uint8Array(o)}(e,t,n):function(e,t,n){return new Uint8Array(e.buffer,e.byteOffset+t,n)}(e,t,n)},attachWebRendererInterop:function(t,n,r,o){var a,i;if(S.has(t))throw new Error(`Interop methods are already registered for renderer ${t}`);S.set(t,n),r&&o&&Object.keys(r).length>0&&function(t,n,r){if(p)throw new Error("Dynamic root components have already been enabled.");p=t,b=n;for(const[t,o]of Object.entries(r)){const r=e.findJSFunction(t,0);for(const e of o)r(e,n[e])}}(A(t),r,o),null===(i=null===(a=C.get(t))||void 0===a?void 0:a[0])||void 0===i||i.call(a),function(e){for(const t of I)t(e)}(t)}}};window.Blazor=tt;let nt=!1;const rt="function"==typeof TextDecoder?new TextDecoder("utf-8"):null,ot=rt?rt.decode.bind(rt):function(e){let t=0;const n=e.length,r=[],o=[];for(;t65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o)}r.length>1024&&(o.push(String.fromCharCode.apply(null,r)),r.length=0)}return o.push(String.fromCharCode.apply(null,r)),o.join("")},at=Math.pow(2,32),it=Math.pow(2,21)-1;function st(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}function ct(e,t){return e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24>>>0)}function lt(e,t){const n=ct(e,t+4);if(n>it)throw new Error(`Cannot read uint64 with high order part ${n}, because the result would exceed Number.MAX_SAFE_INTEGER.`);return n*at+ct(e,t)}class ut{constructor(e){this.batchData=e;const t=new mt(e);this.arrayRangeReader=new pt(e),this.arrayBuilderSegmentReader=new bt(e),this.diffReader=new dt(e),this.editReader=new ht(e,t),this.frameReader=new ft(e,t)}updatedComponents(){return st(this.batchData,this.batchData.length-20)}referenceFrames(){return st(this.batchData,this.batchData.length-16)}disposedComponentIds(){return st(this.batchData,this.batchData.length-12)}disposedEventHandlerIds(){return st(this.batchData,this.batchData.length-8)}updatedComponentsEntry(e,t){const n=e+4*t;return st(this.batchData,n)}referenceFramesEntry(e,t){return e+20*t}disposedComponentIdsEntry(e,t){const n=e+4*t;return st(this.batchData,n)}disposedEventHandlerIdsEntry(e,t){const n=e+8*t;return lt(this.batchData,n)}}class dt{constructor(e){this.batchDataUint8=e}componentId(e){return st(this.batchDataUint8,e)}edits(e){return e+4}editsEntry(e,t){return e+16*t}}class ht{constructor(e,t){this.batchDataUint8=e,this.stringReader=t}editType(e){return st(this.batchDataUint8,e)}siblingIndex(e){return st(this.batchDataUint8,e+4)}newTreeIndex(e){return st(this.batchDataUint8,e+8)}moveToSiblingIndex(e){return st(this.batchDataUint8,e+8)}removedAttributeName(e){const t=st(this.batchDataUint8,e+12);return this.stringReader.readString(t)}}class ft{constructor(e,t){this.batchDataUint8=e,this.stringReader=t}frameType(e){return st(this.batchDataUint8,e)}subtreeLength(e){return st(this.batchDataUint8,e+4)}elementReferenceCaptureId(e){const t=st(this.batchDataUint8,e+4);return this.stringReader.readString(t)}componentId(e){return st(this.batchDataUint8,e+8)}elementName(e){const t=st(this.batchDataUint8,e+8);return this.stringReader.readString(t)}textContent(e){const t=st(this.batchDataUint8,e+4);return this.stringReader.readString(t)}markupContent(e){const t=st(this.batchDataUint8,e+4);return this.stringReader.readString(t)}attributeName(e){const t=st(this.batchDataUint8,e+4);return this.stringReader.readString(t)}attributeValue(e){const t=st(this.batchDataUint8,e+8);return this.stringReader.readString(t)}attributeEventHandlerId(e){return lt(this.batchDataUint8,e+12)}}class mt{constructor(e){this.batchDataUint8=e,this.stringTableStartIndex=st(e,e.length-4)}readString(e){if(-1===e)return null;{const n=st(this.batchDataUint8,this.stringTableStartIndex+4*e),r=function(e,t){let n=0,r=0;for(let o=0;o<4;o++){const a=e[t+o];if(n|=(127&a)<async function(e,n){const r=function(e){const t=document.baseURI;return t.endsWith("/")?`${t}${e}`:`${t}/${e}`}(n),o=await import(r);if(void 0!==o){if(e.singleRuntime){const{beforeStart:n,afterStarted:r,beforeWebAssemblyStart:i,afterWebAssemblyStarted:s,beforeServerStart:c,afterServerStarted:l}=o;let u=n;e.webRendererId===At.Server&&c&&(u=c),e.webRendererId===At.WebAssembly&&i&&(u=i);let d=r;return e.webRendererId===At.Server&&l&&(d=l),e.webRendererId===At.WebAssembly&&s&&(d=s),a(e,u,d,t)}return function(e,t,n){var o;const i=n[0],{beforeStart:s,afterStarted:c,beforeWebStart:l,afterWebStarted:u,beforeWebAssemblyStart:d,afterWebAssemblyStarted:h,beforeServerStart:f,afterServerStarted:m}=t,p=!(l||u||d||h||f||m||!s&&!c),b=p&&i.enableClassicInitializers;if(p&&!i.enableClassicInitializers)null===(o=e.logger)||void 0===o||o.log(Nt.Warning,`Initializer '${r}' will be ignored because multiple runtimes are available. use 'before(web|webAssembly|server)Start' and 'after(web|webAssembly|server)Started?' instead.)`);else if(b)return a(e,s,c,n);if(function(e){e.webAssembly?e.webAssembly.initializers||(e.webAssembly.initializers={beforeStart:[],afterStarted:[]}):e.webAssembly={initializers:{beforeStart:[],afterStarted:[]}},e.circuit?e.circuit.initializers||(e.circuit.initializers={beforeStart:[],afterStarted:[]}):e.circuit={initializers:{beforeStart:[],afterStarted:[]}}}(i),d&&i.webAssembly.initializers.beforeStart.push(d),h&&i.webAssembly.initializers.afterStarted.push(h),f&&i.circuit.initializers.beforeStart.push(f),m&&i.circuit.initializers.afterStarted.push(m),u&&e.afterStartedCallbacks.push(u),l)return l(i)}(e,o,t)}function a(e,t,n,r){if(n&&e.afterStartedCallbacks.push(n),t)return t(...r)}}(this,e))))}async invokeAfterStartedCallbacks(e){const t=(n=this.webRendererId,null===(r=C.get(n))||void 0===r?void 0:r[1]);var n,r;t&&await t,await Promise.all(this.afterStartedCallbacks.map((t=>t(e))))}}let _t,Ot=!1;async function Lt(){if(Ot)throw new Error("Blazor has already started.");Ot=!0,_t=e.attachDispatcher({beginInvokeDotNetFromJS:wt,endInvokeJSFromDotNet:Et,sendByteArray:St});const t=await async function(){const e=await fetch("_framework/blazor.modules.json",{method:"GET",credentials:"include",cache:"no-cache"}),t=await e.json(),n=new Tt;return await n.importInitializersAsync(t,[]),n}();(function(){const e={AttachToDocument:(e,t)=>{!function(e,t,n){const r="::before";let o=!1;if(e.endsWith("::after"))e=e.slice(0,-7),o=!0;else if(e.endsWith(r))throw new Error(`The '${r}' selector is not supported.`);const a=function(e){const t=m.get(e);if(t)return m.delete(e),t}(e)||document.querySelector(e);if(!a)throw new Error(`Could not find any element matching selector '${e}'.`);!function(e,t,n,r){let o=fe[e];o||(o=new le(e),fe[e]=o),o.attachRootComponentToLogicalElement(n,t,r)}(n,P(a,!0),t,o)}(t,e,At.WebView)},RenderBatch:(e,t)=>{try{const n=Rt(t);(function(e,t){const n=fe[e];if(!n)throw new Error(`There is no browser renderer with ID ${e}.`);const r=t.arrayRangeReader,o=t.updatedComponents(),a=r.values(o),i=r.count(o),s=t.referenceFrames(),c=r.values(s),l=t.diffReader;for(let e=0;e{gt=!0,console.error(`${e}\n${t}`),function(){const e=document.querySelector("#blazor-error-ui");e&&(e.style.display="block"),nt||(nt=!0,document.querySelectorAll("#blazor-error-ui .reload").forEach((e=>{e.onclick=function(e){location.reload(),e.preventDefault()}})),document.querySelectorAll("#blazor-error-ui .dismiss").forEach((e=>{e.onclick=function(e){const t=document.querySelector("#blazor-error-ui");t&&(t.style.display="none"),e.preventDefault()}})))}()},BeginInvokeJS:_t.beginInvokeJSFromDotNet.bind(_t),EndInvokeDotNet:_t.endInvokeDotNetFromJS.bind(_t),SendByteArrayToJS:kt,Navigate:_e.navigateTo,Refresh:_e.refresh,SetHasLocationChangingListeners:e=>{_e.setHasLocationChangingListeners(At.WebView,e)},EndLocationChanging:_e.endLocationChanging};window.external.receiveMessage((t=>{const n=function(e){if(gt||!e||!e.startsWith(vt))return null;const t=e.substring(vt.length),[n,...r]=JSON.parse(t);return{messageType:n,args:r}}(t);if(n){if(!Object.prototype.hasOwnProperty.call(e,n.messageType))throw new Error(`Unsupported IPC message type '${n.messageType}'`);e[n.messageType].apply(null,n.args)}}))})(),tt._internal.receiveWebViewDotNetDataStream=xt,_e.enableNavigationInterception(At.WebView),_e.listenForNavigationEvents(At.WebView,It,Ct),Dt("AttachPage",_e.getBaseURI(),_e.getLocationHref()),await t.invokeAfterStartedCallbacks(tt)}function xt(e,t,n,r){!function(e,t,n,r,o){let a=et.get(t);if(!a){const n=new ReadableStream({start(e){et.set(t,e),a=e}});e.supplyDotNetStream(t,n)}o?(a.error(o),et.delete(t)):0===r?(a.close(),et.delete(t)):a.enqueue(n.length===r?n:n.subarray(0,r))}(_t,e,t,n,r)}tt.start=Lt,window.DotNet=e,document&&document.currentScript&&"false"!==document.currentScript.getAttribute("autostart")&&Lt()})();
\ No newline at end of file
+(()=>{"use strict";var e,t,n,r={d:(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};r.d({},{e:()=>_t}),function(e){const t=[],n="__jsObjectId",r="__dotNetObject",o="__byte[]",a="__dotNetStream",i="__jsStreamReferenceLength";let s,c;class l{constructor(e){this._jsObject=e,this._cachedFunctions=new Map}findFunction(e){const t=this._cachedFunctions.get(e);if(t)return t;let n,r=this._jsObject;if(e.split(".").forEach((t=>{if(!(t in r))throw new Error(`Could not find '${e}' ('${t}' was undefined).`);n=r,r=r[t]})),r instanceof Function)return r=r.bind(n),this._cachedFunctions.set(e,r),r;throw new Error(`The value '${e}' is not a function.`)}getWrappedObject(){return this._jsObject}}const u={0:new l(window)};u[0]._cachedFunctions.set("import",(e=>("string"==typeof e&&e.startsWith("./")&&(e=new URL(e.substr(2),document.baseURI).toString()),import(e))));let d,h=1;function f(e){t.push(e)}function m(e){if(e&&"object"==typeof e){u[h]=new l(e);const t={[n]:h};return h++,t}throw new Error(`Cannot create a JSObjectReference from the value '${e}'.`)}function p(e){let t=-1;if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Blob)t=e.size;else{if(!(e.buffer instanceof ArrayBuffer))throw new Error("Supplied value is not a typed array or blob.");if(void 0===e.byteLength)throw new Error(`Cannot create a JSStreamReference from the value '${e}' as it doesn't have a byteLength.`);t=e.byteLength}const r={[i]:t};try{const t=m(e);r[n]=t[n]}catch(t){throw new Error(`Cannot create a JSStreamReference from the value '${e}'.`)}return r}function b(e,n){c=e;const r=n?JSON.parse(n,((e,n)=>t.reduce(((t,n)=>n(e,t)),n))):null;return c=void 0,r}function v(){if(void 0===s)throw new Error("No call dispatcher has been set.");if(null===s)throw new Error("There are multiple .NET runtimes present, so a default dispatcher could not be resolved. Use DotNetObject to invoke .NET instance methods.");return s}e.attachDispatcher=function(e){const t=new g(e);return void 0===s?s=t:s&&(s=null),t},e.attachReviver=f,e.invokeMethod=function(e,t,...n){return v().invokeDotNetStaticMethod(e,t,...n)},e.invokeMethodAsync=function(e,t,...n){return v().invokeDotNetStaticMethodAsync(e,t,...n)},e.createJSObjectReference=m,e.createJSStreamReference=p,e.disposeJSObjectReference=function(e){const t=e&&e[n];"number"==typeof t&&E(t)},function(e){e[e.Default=0]="Default",e[e.JSObjectReference=1]="JSObjectReference",e[e.JSStreamReference=2]="JSStreamReference",e[e.JSVoidResult=3]="JSVoidResult"}(d=e.JSCallResultType||(e.JSCallResultType={}));class g{constructor(e){this._dotNetCallDispatcher=e,this._byteArraysToBeRevived=new Map,this._pendingDotNetToJSStreams=new Map,this._pendingAsyncCalls={},this._nextAsyncCallId=1}getDotNetCallDispatcher(){return this._dotNetCallDispatcher}invokeJSFromDotNet(e,t,n,r){const o=b(this,t),a=D(w(e,r)(...o||[]),n);return null==a?null:N(this,a)}beginInvokeJSFromDotNet(e,t,n,r,o){const a=new Promise((e=>{const r=b(this,n);e(w(t,o)(...r||[]))}));e&&a.then((t=>N(this,[e,!0,D(t,r)]))).then((t=>this._dotNetCallDispatcher.endInvokeJSFromDotNet(e,!0,t)),(t=>this._dotNetCallDispatcher.endInvokeJSFromDotNet(e,!1,JSON.stringify([e,!1,y(t)]))))}endInvokeDotNetFromJS(e,t,n){const r=t?b(this,n):new Error(n);this.completePendingCall(parseInt(e,10),t,r)}invokeDotNetStaticMethod(e,t,...n){return this.invokeDotNetMethod(e,t,null,n)}invokeDotNetStaticMethodAsync(e,t,...n){return this.invokeDotNetMethodAsync(e,t,null,n)}invokeDotNetMethod(e,t,n,r){if(this._dotNetCallDispatcher.invokeDotNetFromJS){const o=N(this,r),a=this._dotNetCallDispatcher.invokeDotNetFromJS(e,t,n,o);return a?b(this,a):null}throw new Error("The current dispatcher does not support synchronous calls from JS to .NET. Use invokeDotNetMethodAsync instead.")}invokeDotNetMethodAsync(e,t,n,r){if(e&&n)throw new Error(`For instance method calls, assemblyName should be null. Received '${e}'.`);const o=this._nextAsyncCallId++,a=new Promise(((e,t)=>{this._pendingAsyncCalls[o]={resolve:e,reject:t}}));try{const a=N(this,r);this._dotNetCallDispatcher.beginInvokeDotNetFromJS(o,e,t,n,a)}catch(e){this.completePendingCall(o,!1,e)}return a}receiveByteArray(e,t){this._byteArraysToBeRevived.set(e,t)}processByteArray(e){const t=this._byteArraysToBeRevived.get(e);return t?(this._byteArraysToBeRevived.delete(e),t):null}supplyDotNetStream(e,t){if(this._pendingDotNetToJSStreams.has(e)){const n=this._pendingDotNetToJSStreams.get(e);this._pendingDotNetToJSStreams.delete(e),n.resolve(t)}else{const n=new C;n.resolve(t),this._pendingDotNetToJSStreams.set(e,n)}}getDotNetStreamPromise(e){let t;if(this._pendingDotNetToJSStreams.has(e))t=this._pendingDotNetToJSStreams.get(e).streamPromise,this._pendingDotNetToJSStreams.delete(e);else{const n=new C;this._pendingDotNetToJSStreams.set(e,n),t=n.streamPromise}return t}completePendingCall(e,t,n){if(!this._pendingAsyncCalls.hasOwnProperty(e))throw new Error(`There is no pending async call with ID ${e}.`);const r=this._pendingAsyncCalls[e];delete this._pendingAsyncCalls[e],t?r.resolve(n):r.reject(n)}}function y(e){return e instanceof Error?`${e.message}\n${e.stack}`:e?e.toString():"null"}function w(e,t){const n=u[t];if(n)return n.findFunction(e);throw new Error(`JS object instance with ID ${t} does not exist (has it been disposed?).`)}function E(e){delete u[e]}e.findJSFunction=w,e.disposeJSObjectReferenceById=E;class S{constructor(e,t){this._id=e,this._callDispatcher=t}invokeMethod(e,...t){return this._callDispatcher.invokeDotNetMethod(null,e,this._id,t)}invokeMethodAsync(e,...t){return this._callDispatcher.invokeDotNetMethodAsync(null,e,this._id,t)}dispose(){this._callDispatcher.invokeDotNetMethodAsync(null,"__Dispose",this._id,null).catch((e=>console.error(e)))}serializeAsArg(){return{[r]:this._id}}}e.DotNetObject=S,f((function(e,t){if(t&&"object"==typeof t){if(t.hasOwnProperty(r))return new S(t[r],c);if(t.hasOwnProperty(n)){const e=t[n],r=u[e];if(r)return r.getWrappedObject();throw new Error(`JS object instance with Id '${e}' does not exist. It may have been disposed.`)}if(t.hasOwnProperty(o)){const e=t[o],n=c.processByteArray(e);if(void 0===n)throw new Error(`Byte array index '${e}' does not exist.`);return n}if(t.hasOwnProperty(a)){const e=t[a],n=c.getDotNetStreamPromise(e);return new I(n)}}return t}));class I{constructor(e){this._streamPromise=e}stream(){return this._streamPromise}async arrayBuffer(){return new Response(await this.stream()).arrayBuffer()}}class C{constructor(){this.streamPromise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}function D(e,t){switch(t){case d.Default:return e;case d.JSObjectReference:return m(e);case d.JSStreamReference:return p(e);case d.JSVoidResult:return null;default:throw new Error(`Invalid JS call result type '${t}'.`)}}let A=0;function N(e,t){A=0,c=e;const n=JSON.stringify(t,R);return c=void 0,n}function R(e,t){if(t instanceof S)return t.serializeAsArg();if(t instanceof Uint8Array){c.getDotNetCallDispatcher().sendByteArray(A,t);const e={[o]:A};return A++,e}return t}}(e||(e={})),function(e){e[e.prependFrame=1]="prependFrame",e[e.removeFrame=2]="removeFrame",e[e.setAttribute=3]="setAttribute",e[e.removeAttribute=4]="removeAttribute",e[e.updateText=5]="updateText",e[e.stepIn=6]="stepIn",e[e.stepOut=7]="stepOut",e[e.updateMarkup=8]="updateMarkup",e[e.permutationListEntry=9]="permutationListEntry",e[e.permutationListEnd=10]="permutationListEnd"}(t||(t={})),function(e){e[e.element=1]="element",e[e.text=2]="text",e[e.attribute=3]="attribute",e[e.component=4]="component",e[e.region=5]="region",e[e.elementReferenceCapture=6]="elementReferenceCapture",e[e.markup=8]="markup",e[e.namedEvent=10]="namedEvent"}(n||(n={}));class o{constructor(e,t){this.componentId=e,this.fieldValue=t}static fromEvent(e,t){const n=t.target;if(n instanceof Element){const t=function(e){return e instanceof HTMLInputElement?e.type&&"checkbox"===e.type.toLowerCase()?{value:e.checked}:{value:e.value}:e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement?{value:e.value}:null}(n);if(t)return new o(e,t.value)}return null}}const a=new Map,i=new Map,s=[];function c(e){return a.get(e)}function l(e){const t=a.get(e);return(null==t?void 0:t.browserEventName)||e}function u(e,t){e.forEach((e=>a.set(e,t)))}function d(e){const t=[];for(let n=0;ne.selected)).map((e=>e.value))}}{const e=function(e){return!!e&&"INPUT"===e.tagName&&"checkbox"===e.getAttribute("type")}(t);return{value:e?!!t.checked:t.value}}}}),u(["copy","cut","paste"],{createEventArgs:e=>({type:e.type})}),u(["drag","dragend","dragenter","dragleave","dragover","dragstart","drop"],{createEventArgs:e=>{return{...h(t=e),dataTransfer:t.dataTransfer?{dropEffect:t.dataTransfer.dropEffect,effectAllowed:t.dataTransfer.effectAllowed,files:Array.from(t.dataTransfer.files).map((e=>e.name)),items:Array.from(t.dataTransfer.items).map((e=>({kind:e.kind,type:e.type}))),types:t.dataTransfer.types}:null};var t}}),u(["focus","blur","focusin","focusout"],{createEventArgs:e=>({type:e.type})}),u(["keydown","keyup","keypress"],{createEventArgs:e=>{return{key:(t=e).key,code:t.code,location:t.location,repeat:t.repeat,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,type:t.type};var t}}),u(["contextmenu","click","mouseover","mouseout","mousemove","mousedown","mouseup","mouseleave","mouseenter","dblclick"],{createEventArgs:e=>h(e)}),u(["error"],{createEventArgs:e=>{return{message:(t=e).message,filename:t.filename,lineno:t.lineno,colno:t.colno,type:t.type};var t}}),u(["loadstart","timeout","abort","load","loadend","progress"],{createEventArgs:e=>{return{lengthComputable:(t=e).lengthComputable,loaded:t.loaded,total:t.total,type:t.type};var t}}),u(["touchcancel","touchend","touchmove","touchenter","touchleave","touchstart"],{createEventArgs:e=>{return{detail:(t=e).detail,touches:d(t.touches),targetTouches:d(t.targetTouches),changedTouches:d(t.changedTouches),ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,type:t.type};var t}}),u(["gotpointercapture","lostpointercapture","pointercancel","pointerdown","pointerenter","pointerleave","pointermove","pointerout","pointerover","pointerup"],{createEventArgs:e=>{return{...h(t=e),pointerId:t.pointerId,width:t.width,height:t.height,pressure:t.pressure,tiltX:t.tiltX,tiltY:t.tiltY,pointerType:t.pointerType,isPrimary:t.isPrimary};var t}}),u(["wheel","mousewheel"],{createEventArgs:e=>{return{...h(t=e),deltaX:t.deltaX,deltaY:t.deltaY,deltaZ:t.deltaZ,deltaMode:t.deltaMode};var t}}),u(["cancel","close","toggle"],{createEventArgs:()=>({})});const f=["date","datetime-local","month","time","week"],m=new Map;let p,b,v=0;const g={async add(e,t,n){if(!n)throw new Error("initialParameters must be an object, even if empty.");const r="__bl-dynamic-root:"+(++v).toString();m.set(r,e);const o=await E().invokeMethodAsync("AddRootComponent",t,r),a=new w(o,b[t]);return await a.setParameters(n),a}};class y{invoke(e){return this._callback(e)}setCallback(t){this._selfJSObjectReference||(this._selfJSObjectReference=e.createJSObjectReference(this)),this._callback=t}getJSObjectReference(){return this._selfJSObjectReference}dispose(){this._selfJSObjectReference&&e.disposeJSObjectReference(this._selfJSObjectReference)}}class w{constructor(e,t){this._jsEventCallbackWrappers=new Map,this._componentId=e;for(const e of t)"eventcallback"===e.type&&this._jsEventCallbackWrappers.set(e.name.toLowerCase(),new y)}setParameters(e){const t={},n=Object.entries(e||{}),r=n.length;for(const[e,r]of n){const n=this._jsEventCallbackWrappers.get(e.toLowerCase());n&&r?(n.setCallback(r),t[e]=n.getJSObjectReference()):t[e]=r}return E().invokeMethodAsync("SetRootComponentParameters",this._componentId,r,t)}async dispose(){if(null!==this._componentId){await E().invokeMethodAsync("RemoveRootComponent",this._componentId),this._componentId=null;for(const e of this._jsEventCallbackWrappers.values())e.dispose()}}}function E(){if(!p)throw new Error("Dynamic root components have not been enabled in this application.");return p}const S=new Map,I=[],C=new Map;function D(e,t,n){return N(e,t.eventHandlerId,(()=>A(e).invokeMethodAsync("DispatchEventAsync",t,n)))}function A(e){const t=S.get(e);if(!t)throw new Error(`No interop methods are registered for renderer ${e}`);return t}let N=(e,t,n)=>n();const R=x(["abort","blur","cancel","canplay","canplaythrough","change","close","cuechange","durationchange","emptied","ended","error","focus","load","loadeddata","loadedmetadata","loadend","loadstart","mouseenter","mouseleave","pointerenter","pointerleave","pause","play","playing","progress","ratechange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeupdate","toggle","unload","volumechange","waiting","DOMNodeInsertedIntoDocument","DOMNodeRemovedFromDocument"]),k={submit:!0},T=x(["click","dblclick","mousedown","mousemove","mouseup"]);class _{constructor(e){this.browserRendererId=e,this.afterClickCallbacks=[];const t=++_.nextEventDelegatorId;this.eventsCollectionKey=`_blazorEvents_${t}`,this.eventInfoStore=new O(this.onGlobalEvent.bind(this))}setListener(e,t,n,r){const o=this.getEventHandlerInfosForElement(e,!0),a=o.getHandler(t);if(a)this.eventInfoStore.update(a.eventHandlerId,n);else{const a={element:e,eventName:t,eventHandlerId:n,renderingComponentId:r};this.eventInfoStore.add(a),o.setHandler(t,a)}}getHandler(e){return this.eventInfoStore.get(e)}removeListener(e){const t=this.eventInfoStore.remove(e);if(t){const e=t.element,n=this.getEventHandlerInfosForElement(e,!1);n&&n.removeHandler(t.eventName)}}notifyAfterClick(e){this.afterClickCallbacks.push(e),this.eventInfoStore.addGlobalListener("click")}setStopPropagation(e,t,n){this.getEventHandlerInfosForElement(e,!0).stopPropagation(t,n)}setPreventDefault(e,t,n){this.getEventHandlerInfosForElement(e,!0).preventDefault(t,n)}onGlobalEvent(e){if(!(e.target instanceof Element))return;this.dispatchGlobalEventToAllElements(e.type,e);const t=(n=e.type,i.get(n));var n;t&&t.forEach((t=>this.dispatchGlobalEventToAllElements(t,e))),"click"===e.type&&this.afterClickCallbacks.forEach((t=>t(e)))}dispatchGlobalEventToAllElements(e,t){const n=t.composedPath();let r=n.shift(),a=null,i=!1;const s=Object.prototype.hasOwnProperty.call(R,e);let l=!1;for(;r;){const h=r,f=this.getEventHandlerInfosForElement(h,!1);if(f){const n=f.getHandler(e);if(n&&(u=h,d=t.type,!((u instanceof HTMLButtonElement||u instanceof HTMLInputElement||u instanceof HTMLTextAreaElement||u instanceof HTMLSelectElement)&&Object.prototype.hasOwnProperty.call(T,d)&&u.disabled))){if(!i){const n=c(e);a=(null==n?void 0:n.createEventArgs)?n.createEventArgs(t):{},i=!0}Object.prototype.hasOwnProperty.call(k,t.type)&&t.preventDefault(),D(this.browserRendererId,{eventHandlerId:n.eventHandlerId,eventName:e,eventFieldInfo:o.fromEvent(n.renderingComponentId,t)},a)}f.stopPropagation(e)&&(l=!0),f.preventDefault(e)&&t.preventDefault()}r=s||l?void 0:n.shift()}var u,d}getEventHandlerInfosForElement(e,t){return Object.prototype.hasOwnProperty.call(e,this.eventsCollectionKey)?e[this.eventsCollectionKey]:t?e[this.eventsCollectionKey]=new L:null}}_.nextEventDelegatorId=0;class O{constructor(e){this.globalListener=e,this.infosByEventHandlerId={},this.countByEventName={},s.push(this.handleEventNameAliasAdded.bind(this))}add(e){if(this.infosByEventHandlerId[e.eventHandlerId])throw new Error(`Event ${e.eventHandlerId} is already tracked`);this.infosByEventHandlerId[e.eventHandlerId]=e,this.addGlobalListener(e.eventName)}get(e){return this.infosByEventHandlerId[e]}addGlobalListener(e){if(e=l(e),Object.prototype.hasOwnProperty.call(this.countByEventName,e))this.countByEventName[e]++;else{this.countByEventName[e]=1;const t=Object.prototype.hasOwnProperty.call(R,e);document.addEventListener(e,this.globalListener,t)}}update(e,t){if(Object.prototype.hasOwnProperty.call(this.infosByEventHandlerId,t))throw new Error(`Event ${t} is already tracked`);const n=this.infosByEventHandlerId[e];delete this.infosByEventHandlerId[e],n.eventHandlerId=t,this.infosByEventHandlerId[t]=n}remove(e){const t=this.infosByEventHandlerId[e];if(t){delete this.infosByEventHandlerId[e];const n=l(t.eventName);0==--this.countByEventName[n]&&(delete this.countByEventName[n],document.removeEventListener(n,this.globalListener))}return t}handleEventNameAliasAdded(e,t){if(Object.prototype.hasOwnProperty.call(this.countByEventName,e)){const n=this.countByEventName[e];delete this.countByEventName[e],document.removeEventListener(e,this.globalListener),this.addGlobalListener(t),this.countByEventName[t]+=n-1}}}class L{constructor(){this.handlers={},this.preventDefaultFlags=null,this.stopPropagationFlags=null}getHandler(e){return Object.prototype.hasOwnProperty.call(this.handlers,e)?this.handlers[e]:null}setHandler(e,t){this.handlers[e]=t}removeHandler(e){delete this.handlers[e]}preventDefault(e,t){return void 0!==t&&(this.preventDefaultFlags=this.preventDefaultFlags||{},this.preventDefaultFlags[e]=t),!!this.preventDefaultFlags&&this.preventDefaultFlags[e]}stopPropagation(e,t){return void 0!==t&&(this.stopPropagationFlags=this.stopPropagationFlags||{},this.stopPropagationFlags[e]=t),!!this.stopPropagationFlags&&this.stopPropagationFlags[e]}}function x(e){const t={};return e.forEach((e=>{t[e]=!0})),t}const F=Symbol(),M=Symbol();function P(e,t){if(F in e)return e;const n=[];if(e.childNodes.length>0){if(!t)throw new Error("New logical elements must start empty, or allowExistingContents must be true");e.childNodes.forEach((t=>{const r=P(t,!0);r[M]=e,n.push(r)}))}return e[F]=n,e}function B(e){const t=W(e);for(;t.length;)J(e,0)}function j(e,t){const n=document.createComment("!");return H(n,e,t),n}function H(e,t,n){const r=e;let o=e;if(e instanceof Comment){const t=W(r);if((null==t?void 0:t.length)>0){const t=G(r),n=new Range;n.setStartBefore(e),n.setEndAfter(t),o=n.extractContents()}}const a=U(r);if(a){const e=W(a),t=Array.prototype.indexOf.call(e,r);e.splice(t,1),delete r[M]}const i=W(t);if(n0;)J(n,0)}const r=n;r.parentNode.removeChild(r)}function U(e){return e[M]||null}function z(e,t){return W(e)[t]}function $(e){const t=X(e);return"http://www.w3.org/2000/svg"===t.namespaceURI&&"foreignObject"!==t.tagName}function W(e){return e[F]}function K(e){const t=W(U(e));return t[Array.prototype.indexOf.call(t,e)+1]||null}function V(e,t){const n=W(e);t.forEach((e=>{e.moveRangeStart=n[e.fromSiblingIndex],e.moveRangeEnd=G(e.moveRangeStart)})),t.forEach((t=>{const r=document.createComment("marker");t.moveToBeforeMarker=r;const o=n[t.toSiblingIndex+1];o?o.parentNode.insertBefore(r,o):Y(r,e)})),t.forEach((e=>{const t=e.moveToBeforeMarker,n=t.parentNode,r=e.moveRangeStart,o=e.moveRangeEnd;let a=r;for(;a;){const e=a.nextSibling;if(n.insertBefore(a,t),a===o)break;a=e}n.removeChild(t)})),t.forEach((e=>{n[e.toSiblingIndex]=e.moveRangeStart}))}function X(e){if(e instanceof Element||e instanceof DocumentFragment)return e;if(e instanceof Comment)return e.parentNode;throw new Error("Not a valid logical element")}function Y(e,t){if(t instanceof Element||t instanceof DocumentFragment)t.appendChild(e);else{if(!(t instanceof Comment))throw new Error(`Cannot append node because the parent is not a valid logical element. Parent: ${t}`);{const n=K(t);n?n.parentNode.insertBefore(e,n):Y(e,U(t))}}}function G(e){if(e instanceof Element||e instanceof DocumentFragment)return e;const t=K(e);if(t)return t.previousSibling;{const t=U(e);return t instanceof Element||t instanceof DocumentFragment?t.lastChild:G(t)}}function q(e){return`_bl_${e}`}Symbol();const Z="__internalId";e.attachReviver(((e,t)=>t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,Z)&&"string"==typeof t[Z]?function(e){const t=`[${q(e)}]`;return document.querySelector(t)}(t[Z]):t));const Q="_blazorDeferredValue";function ee(e){return"select-multiple"===e.type}function te(e,t){e.value=t||""}function ne(e,t){e instanceof HTMLSelectElement?ee(e)?function(e,t){t||(t=[]);for(let n=0;n{Ce()&&function(e,t){if(0!==e.button||function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e))return;if(e.defaultPrevented)return;const n=function(e){const t=e.composedPath&&e.composedPath();if(t)for(let e=0;e{const t=document.createElement("script");t.textContent=e.textContent,e.getAttributeNames().forEach((n=>{t.setAttribute(n,e.getAttribute(n))})),e.parentNode.replaceChild(t,e)})),oe.content));var i;let s=0;for(;a.firstChild;)H(a.firstChild,o,s++)}applyAttribute(e,t,n,r){const o=e.frameReader,a=o.attributeName(r),i=o.attributeEventHandlerId(r);if(i){const e=he(a);return void this.eventDelegator.setListener(n,e,i,t)}const s=o.attributeValue(r);this.setOrRemoveAttributeOrProperty(n,a,s)}insertFrameRange(e,t,n,r,o,a,i){const s=r;for(let s=a;s{je(t,e)})},enableNavigationInterception:function(e){if(void 0!==me&&me!==e)throw new Error("Only one interactive runtime may enable navigation interception at a time.");me=e},setHasLocationChangingListeners:function(e,t){const n=ke.get(e);if(!n)throw new Error(`Renderer with ID '${e}' is not listening for navigation events`);n.hasLocationChangingEventListeners=t},endLocationChanging:function(e,t){_e&&e===Re&&(_e(t),_e=null)},navigateTo:function(e,t){Le(e,t,!0)},refresh:function(e){!e&&Ee()?Se(location.href,!0):location.reload()},getBaseURI:()=>document.baseURI,getLocationHref:()=>location.href,scrollToElement:we};function Le(e,t,n=!1){const r=Ie(e),o=Ue();if(t.forceLoad||!ye(r)||"serverside-fullpageload"===o)!function(e,t){if(location.href===e){const t=e+"?";history.replaceState(null,"",t),location.replace(e)}else t?location.replace(e):location.href=e}(e,t.replaceHistoryEntry);else if("clientside-router"===o)xe(r,!1,t.replaceHistoryEntry,t.historyEntryState,n);else{if("serverside-enhanced"!==o)throw new Error(`Unsupported page load mechanism: ${o}`);Se(r,t.replaceHistoryEntry)}}async function xe(e,t,n,r=void 0,o=!1){if(Pe(),function(e){const t=new URL(e);return""!==t.hash&&location.origin===t.origin&&location.pathname===t.pathname&&location.search===t.search}(e))return Fe(e,n,r),void function(e){const t=e.indexOf("#");t!==e.length-1&&we(e.substring(t+1))}(e);const a=Je();(o||!(null==a?void 0:a.hasLocationChangingEventListeners)||await Be(e,r,t,a))&&(ge=!0,Fe(e,n,r),await je(t))}function Fe(e,t,n=void 0){t?history.replaceState({userState:n,_index:Ne},"",e):(Ne++,history.pushState({userState:n,_index:Ne},"",e))}function Me(e){return new Promise((t=>{const n=Te;Te=()=>{Te=n,t()},history.go(e)}))}function Pe(){_e&&(_e(!1),_e=null)}function Be(e,t,n,r){return new Promise((o=>{Pe(),Re++,_e=o,r.locationChanging(Re,e,t,n)}))}async function je(e,t){const n=null!=t?t:location.href;await Promise.all(Array.from(ke,(async([t,r])=>{var o,a;a=t,S.has(a)&&await r.locationChanged(n,null===(o=history.state)||void 0===o?void 0:o.userState,e)})))}async function He(e){var t,n;Te&&"serverside-enhanced"!==Ue()&&await Te(e),Ne=null!==(n=null===(t=history.state)||void 0===t?void 0:t._index)&&void 0!==n?n:0}function Je(){const e=De();if(void 0!==e)return ke.get(e)}function Ue(){return Ce()?"clientside-router":Ee()?"serverside-enhanced":window.Blazor._internal.isBlazorWeb?"serverside-fullpageload":"clientside-router"}const ze={focus:function(e,t){if(e instanceof HTMLElement)e.focus({preventScroll:t});else{if(!(e instanceof SVGElement))throw new Error("Unable to focus an invalid element.");if(!e.hasAttribute("tabindex"))throw new Error("Unable to focus an SVG element that does not have a tabindex.");e.focus({preventScroll:t})}},focusBySelector:function(e,t){const n=document.querySelector(e);n&&(n.hasAttribute("tabindex")||(n.tabIndex=-1),n.focus({preventScroll:!0}))}},$e={init:function(e,t,n,r=50){const o=Ke(t);(o||document.documentElement).style.overflowAnchor="none";const a=document.createRange();h(n.parentElement)&&(t.style.display="table-row",n.style.display="table-row");const i=new IntersectionObserver((function(r){r.forEach((r=>{var o;if(!r.isIntersecting)return;a.setStartAfter(t),a.setEndBefore(n);const i=a.getBoundingClientRect().height,s=null===(o=r.rootBounds)||void 0===o?void 0:o.height;r.target===t?e.invokeMethodAsync("OnSpacerBeforeVisible",r.intersectionRect.top-r.boundingClientRect.top,i,s):r.target===n&&n.offsetHeight>0&&e.invokeMethodAsync("OnSpacerAfterVisible",r.boundingClientRect.bottom-r.intersectionRect.bottom,i,s)}))}),{root:o,rootMargin:`${r}px`});i.observe(t),i.observe(n);const s=d(t),c=d(n),{observersByDotNetObjectId:l,id:u}=Ve(e);function d(e){const t={attributes:!0},n=new MutationObserver(((n,r)=>{h(e.parentElement)&&(r.disconnect(),e.style.display="table-row",r.observe(e,t)),i.unobserve(e),i.observe(e)}));return n.observe(e,t),n}function h(e){return null!==e&&(e instanceof HTMLTableElement&&""===e.style.display||"table"===e.style.display||e instanceof HTMLTableSectionElement&&""===e.style.display||"table-row-group"===e.style.display)}l[u]={intersectionObserver:i,mutationObserverBefore:s,mutationObserverAfter:c}},dispose:function(e){const{observersByDotNetObjectId:t,id:n}=Ve(e),r=t[n];r&&(r.intersectionObserver.disconnect(),r.mutationObserverBefore.disconnect(),r.mutationObserverAfter.disconnect(),e.dispose(),delete t[n])}},We=Symbol();function Ke(e){return e&&e!==document.body&&e!==document.documentElement?"visible"!==getComputedStyle(e).overflowY?e:Ke(e.parentElement):null}function Ve(e){var t;const n=e._callDispatcher,r=e._id;return null!==(t=n[We])&&void 0!==t||(n[We]={}),{observersByDotNetObjectId:n[We],id:r}}const Xe={getAndRemoveExistingTitle:function(){var e;const t=document.head?document.head.getElementsByTagName("title"):[];if(0===t.length)return null;let n=null;for(let r=t.length-1;r>=0;r--){const o=t[r],a=o.previousSibling;a instanceof Comment&&null!==U(a)||(null===n&&(n=o.textContent),null===(e=o.parentNode)||void 0===e||e.removeChild(o))}return n}},Ye={init:function(e,t){t._blazorInputFileNextFileId=0,t.addEventListener("click",(function(){t.value=""})),t.addEventListener("change",(function(){t._blazorFilesById={};const n=Array.prototype.map.call(t.files,(function(e){const n={id:++t._blazorInputFileNextFileId,lastModified:new Date(e.lastModified).toISOString(),name:e.name,size:e.size,contentType:e.type,readPromise:void 0,arrayBuffer:void 0,blob:e};return t._blazorFilesById[n.id]=n,n}));e.invokeMethodAsync("NotifyChange",n)}))},toImageFile:async function(e,t,n,r,o){const a=Ge(e,t),i=await new Promise((function(e){const t=new Image;t.onload=function(){URL.revokeObjectURL(t.src),e(t)},t.onerror=function(){t.onerror=null,URL.revokeObjectURL(t.src)},t.src=URL.createObjectURL(a.blob)})),s=await new Promise((function(e){var t;const a=Math.min(1,r/i.width),s=Math.min(1,o/i.height),c=Math.min(a,s),l=document.createElement("canvas");l.width=Math.round(i.width*c),l.height=Math.round(i.height*c),null===(t=l.getContext("2d"))||void 0===t||t.drawImage(i,0,0,l.width,l.height),l.toBlob(e,n)})),c={id:++e._blazorInputFileNextFileId,lastModified:a.lastModified,name:a.name,size:(null==s?void 0:s.size)||0,contentType:n,blob:s||a.blob};return e._blazorFilesById[c.id]=c,c},readFileData:async function(e,t){return Ge(e,t).blob}};function Ge(e,t){const n=e._blazorFilesById[t];if(!n)throw new Error(`There is no file with ID ${t}. The file list may have changed. See https://aka.ms/aspnet/blazor-input-file-multiple-selections.`);return n}const qe=new Set,Ze={enableNavigationPrompt:function(e){0===qe.size&&window.addEventListener("beforeunload",Qe),qe.add(e)},disableNavigationPrompt:function(e){qe.delete(e),0===qe.size&&window.removeEventListener("beforeunload",Qe)}};function Qe(e){e.preventDefault(),e.returnValue=!0}const et=new Map,tt={navigateTo:function(e,t,n=!1){Le(e,t instanceof Object?t:{forceLoad:t,replaceHistoryEntry:n})},registerCustomEventType:function(e,t){if(!t)throw new Error("The options parameter is required.");if(a.has(e))throw new Error(`The event '${e}' is already registered.`);if(t.browserEventName){const n=i.get(t.browserEventName);n?n.push(e):i.set(t.browserEventName,[e]),s.forEach((n=>n(e,t.browserEventName)))}a.set(e,t)},rootComponents:g,runtime:{},_internal:{navigationManager:Oe,domWrapper:ze,Virtualize:$e,PageTitle:Xe,InputFile:Ye,NavigationLock:Ze,getJSDataStreamChunk:async function(e,t,n){return e instanceof Blob?await async function(e,t,n){const r=e.slice(t,t+n),o=await r.arrayBuffer();return new Uint8Array(o)}(e,t,n):function(e,t,n){return new Uint8Array(e.buffer,e.byteOffset+t,n)}(e,t,n)},attachWebRendererInterop:function(t,n,r,o){var a,i;if(S.has(t))throw new Error(`Interop methods are already registered for renderer ${t}`);S.set(t,n),r&&o&&Object.keys(r).length>0&&function(t,n,r){if(p)throw new Error("Dynamic root components have already been enabled.");p=t,b=n;for(const[t,o]of Object.entries(r)){const r=e.findJSFunction(t,0);for(const e of o)r(e,n[e])}}(A(t),r,o),null===(i=null===(a=C.get(t))||void 0===a?void 0:a[0])||void 0===i||i.call(a),function(e){for(const t of I)t(e)}(t)}}};window.Blazor=tt;let nt=!1;const rt="function"==typeof TextDecoder?new TextDecoder("utf-8"):null,ot=rt?rt.decode.bind(rt):function(e){let t=0;const n=e.length,r=[],o=[];for(;t65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o)}r.length>1024&&(o.push(String.fromCharCode.apply(null,r)),r.length=0)}return o.push(String.fromCharCode.apply(null,r)),o.join("")},at=Math.pow(2,32),it=Math.pow(2,21)-1;function st(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}function ct(e,t){return e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24>>>0)}function lt(e,t){const n=ct(e,t+4);if(n>it)throw new Error(`Cannot read uint64 with high order part ${n}, because the result would exceed Number.MAX_SAFE_INTEGER.`);return n*at+ct(e,t)}class ut{constructor(e){this.batchData=e;const t=new mt(e);this.arrayRangeReader=new pt(e),this.arrayBuilderSegmentReader=new bt(e),this.diffReader=new dt(e),this.editReader=new ht(e,t),this.frameReader=new ft(e,t)}updatedComponents(){return st(this.batchData,this.batchData.length-20)}referenceFrames(){return st(this.batchData,this.batchData.length-16)}disposedComponentIds(){return st(this.batchData,this.batchData.length-12)}disposedEventHandlerIds(){return st(this.batchData,this.batchData.length-8)}updatedComponentsEntry(e,t){const n=e+4*t;return st(this.batchData,n)}referenceFramesEntry(e,t){return e+20*t}disposedComponentIdsEntry(e,t){const n=e+4*t;return st(this.batchData,n)}disposedEventHandlerIdsEntry(e,t){const n=e+8*t;return lt(this.batchData,n)}}class dt{constructor(e){this.batchDataUint8=e}componentId(e){return st(this.batchDataUint8,e)}edits(e){return e+4}editsEntry(e,t){return e+16*t}}class ht{constructor(e,t){this.batchDataUint8=e,this.stringReader=t}editType(e){return st(this.batchDataUint8,e)}siblingIndex(e){return st(this.batchDataUint8,e+4)}newTreeIndex(e){return st(this.batchDataUint8,e+8)}moveToSiblingIndex(e){return st(this.batchDataUint8,e+8)}removedAttributeName(e){const t=st(this.batchDataUint8,e+12);return this.stringReader.readString(t)}}class ft{constructor(e,t){this.batchDataUint8=e,this.stringReader=t}frameType(e){return st(this.batchDataUint8,e)}subtreeLength(e){return st(this.batchDataUint8,e+4)}elementReferenceCaptureId(e){const t=st(this.batchDataUint8,e+4);return this.stringReader.readString(t)}componentId(e){return st(this.batchDataUint8,e+8)}elementName(e){const t=st(this.batchDataUint8,e+8);return this.stringReader.readString(t)}textContent(e){const t=st(this.batchDataUint8,e+4);return this.stringReader.readString(t)}markupContent(e){const t=st(this.batchDataUint8,e+4);return this.stringReader.readString(t)}attributeName(e){const t=st(this.batchDataUint8,e+4);return this.stringReader.readString(t)}attributeValue(e){const t=st(this.batchDataUint8,e+8);return this.stringReader.readString(t)}attributeEventHandlerId(e){return lt(this.batchDataUint8,e+12)}}class mt{constructor(e){this.batchDataUint8=e,this.stringTableStartIndex=st(e,e.length-4)}readString(e){if(-1===e)return null;{const n=st(this.batchDataUint8,this.stringTableStartIndex+4*e),r=function(e,t){let n=0,r=0;for(let o=0;o<4;o++){const a=e[t+o];if(n|=(127&a)<async function(e,n){const r=function(e){const t=document.baseURI;return t.endsWith("/")?`${t}${e}`:`${t}/${e}`}(n),o=await import(r);if(void 0!==o){if(e.singleRuntime){const{beforeStart:n,afterStarted:r,beforeWebAssemblyStart:i,afterWebAssemblyStarted:s,beforeServerStart:c,afterServerStarted:l}=o;let u=n;e.webRendererId===At.Server&&c&&(u=c),e.webRendererId===At.WebAssembly&&i&&(u=i);let d=r;return e.webRendererId===At.Server&&l&&(d=l),e.webRendererId===At.WebAssembly&&s&&(d=s),a(e,u,d,t)}return function(e,t,n){var o;const i=n[0],{beforeStart:s,afterStarted:c,beforeWebStart:l,afterWebStarted:u,beforeWebAssemblyStart:d,afterWebAssemblyStarted:h,beforeServerStart:f,afterServerStarted:m}=t,p=!(l||u||d||h||f||m||!s&&!c),b=p&&i.enableClassicInitializers;if(p&&!i.enableClassicInitializers)null===(o=e.logger)||void 0===o||o.log(Nt.Warning,`Initializer '${r}' will be ignored because multiple runtimes are available. use 'before(web|webAssembly|server)Start' and 'after(web|webAssembly|server)Started?' instead.)`);else if(b)return a(e,s,c,n);if(function(e){e.webAssembly?e.webAssembly.initializers||(e.webAssembly.initializers={beforeStart:[],afterStarted:[]}):e.webAssembly={initializers:{beforeStart:[],afterStarted:[]}},e.circuit?e.circuit.initializers||(e.circuit.initializers={beforeStart:[],afterStarted:[]}):e.circuit={initializers:{beforeStart:[],afterStarted:[]}}}(i),d&&i.webAssembly.initializers.beforeStart.push(d),h&&i.webAssembly.initializers.afterStarted.push(h),f&&i.circuit.initializers.beforeStart.push(f),m&&i.circuit.initializers.afterStarted.push(m),u&&e.afterStartedCallbacks.push(u),l)return l(i)}(e,o,t)}function a(e,t,n,r){if(n&&e.afterStartedCallbacks.push(n),t)return t(...r)}}(this,e))))}async invokeAfterStartedCallbacks(e){const t=(n=this.webRendererId,null===(r=C.get(n))||void 0===r?void 0:r[1]);var n,r;t&&await t,await Promise.all(this.afterStartedCallbacks.map((t=>t(e))))}}let _t,Ot=!1;async function Lt(){if(Ot)throw new Error("Blazor has already started.");Ot=!0,_t=e.attachDispatcher({beginInvokeDotNetFromJS:wt,endInvokeJSFromDotNet:Et,sendByteArray:St});const t=await async function(){const e=await fetch("_framework/blazor.modules.json",{method:"GET",credentials:"include",cache:"no-cache"}),t=await e.json(),n=new Tt;return await n.importInitializersAsync(t,[]),n}();(function(){const e={AttachToDocument:(e,t)=>{!function(e,t,n){const r="::before";let o=!1;if(e.endsWith("::after"))e=e.slice(0,-7),o=!0;else if(e.endsWith(r))throw new Error(`The '${r}' selector is not supported.`);const a=function(e){const t=m.get(e);if(t)return m.delete(e),t}(e)||document.querySelector(e);if(!a)throw new Error(`Could not find any element matching selector '${e}'.`);!function(e,t,n,r){let o=fe[e];o||(o=new le(e),fe[e]=o),o.attachRootComponentToLogicalElement(n,t,r)}(n,P(a,!0),t,o)}(t,e,At.WebView)},RenderBatch:(e,t)=>{try{const n=kt(t);(function(e,t){const n=fe[e];if(!n)throw new Error(`There is no browser renderer with ID ${e}.`);const r=t.arrayRangeReader,o=t.updatedComponents(),a=r.values(o),i=r.count(o),s=t.referenceFrames(),c=r.values(s),l=t.diffReader;for(let e=0;e{gt=!0,console.error(`${e}\n${t}`),function(){const e=document.querySelector("#blazor-error-ui");e&&(e.style.display="block"),nt||(nt=!0,document.querySelectorAll("#blazor-error-ui .reload").forEach((e=>{e.onclick=function(e){location.reload(),e.preventDefault()}})),document.querySelectorAll("#blazor-error-ui .dismiss").forEach((e=>{e.onclick=function(e){const t=document.querySelector("#blazor-error-ui");t&&(t.style.display="none"),e.preventDefault()}})))}()},BeginInvokeJS:_t.beginInvokeJSFromDotNet.bind(_t),EndInvokeDotNet:_t.endInvokeDotNetFromJS.bind(_t),SendByteArrayToJS:Rt,Navigate:Oe.navigateTo,Refresh:Oe.refresh,SetHasLocationChangingListeners:e=>{Oe.setHasLocationChangingListeners(At.WebView,e)},EndLocationChanging:Oe.endLocationChanging};window.external.receiveMessage((t=>{const n=function(e){if(gt||!e||!e.startsWith(vt))return null;const t=e.substring(vt.length),[n,...r]=JSON.parse(t);return{messageType:n,args:r}}(t);if(n){if(!Object.prototype.hasOwnProperty.call(e,n.messageType))throw new Error(`Unsupported IPC message type '${n.messageType}'`);e[n.messageType].apply(null,n.args)}}))})(),tt._internal.receiveWebViewDotNetDataStream=xt,Oe.enableNavigationInterception(At.WebView),Oe.listenForNavigationEvents(At.WebView,It,Ct),Dt("AttachPage",Oe.getBaseURI(),Oe.getLocationHref()),await t.invokeAfterStartedCallbacks(tt)}function xt(e,t,n,r){!function(e,t,n,r,o){let a=et.get(t);if(!a){const n=new ReadableStream({start(e){et.set(t,e),a=e}});e.supplyDotNetStream(t,n)}o?(a.error(o),et.delete(t)):0===r?(a.close(),et.delete(t)):a.enqueue(n.length===r?n:n.subarray(0,r))}(_t,e,t,n,r)}tt.start=Lt,window.DotNet=e,document&&document.currentScript&&"false"!==document.currentScript.getAttribute("autostart")&&Lt()})();
\ No newline at end of file
diff --git a/src/Components/Web.JS/src/Services/NavigationEnhancement.ts b/src/Components/Web.JS/src/Services/NavigationEnhancement.ts
index 5fc4a19eeb83..9e14c74c6020 100644
--- a/src/Components/Web.JS/src/Services/NavigationEnhancement.ts
+++ b/src/Components/Web.JS/src/Services/NavigationEnhancement.ts
@@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
import { synchronizeDomContent } from '../Rendering/DomMerging/DomSync';
-import { attachProgrammaticEnhancedNavigationHandler, handleClickForNavigationInterception, hasInteractiveRouter, notifyEnhancedNavigationListners } from './NavigationUtils';
+import { attachProgrammaticEnhancedNavigationHandler, handleClickForNavigationInterception, hasInteractiveRouter, isSamePageWithHash, notifyEnhancedNavigationListners, performScrollToElementOnTheSamePage } from './NavigationUtils';
/*
In effect, we have two separate client-side navigation mechanisms:
@@ -89,8 +89,14 @@ function onDocumentClick(event: MouseEvent) {
}
handleClickForNavigationInterception(event, absoluteInternalHref => {
+ const shouldScrollToHash = isSamePageWithHash(absoluteInternalHref);
history.pushState(null, /* ignored title */ '', absoluteInternalHref);
- performEnhancedPageLoad(absoluteInternalHref, /* interceptedLink */ true);
+
+ if (shouldScrollToHash) {
+ performScrollToElementOnTheSamePage(absoluteInternalHref);
+ } else {
+ performEnhancedPageLoad(absoluteInternalHref, /* interceptedLink */ true);
+ }
});
}
diff --git a/src/Components/Web.JS/src/Services/NavigationManager.ts b/src/Components/Web.JS/src/Services/NavigationManager.ts
index 7a6e0bbbbfd6..a31c2ff82f9d 100644
--- a/src/Components/Web.JS/src/Services/NavigationManager.ts
+++ b/src/Components/Web.JS/src/Services/NavigationManager.ts
@@ -4,7 +4,7 @@
import '@microsoft/dotnet-js-interop';
import { resetScrollAfterNextBatch } from '../Rendering/Renderer';
import { EventDelegator } from '../Rendering/Events/EventDelegator';
-import { attachEnhancedNavigationListener, getInteractiveRouterRendererId, handleClickForNavigationInterception, hasInteractiveRouter, hasProgrammaticEnhancedNavigationHandler, isWithinBaseUriSpace, performProgrammaticEnhancedNavigation, setHasInteractiveRouter, toAbsoluteUri } from './NavigationUtils';
+import { attachEnhancedNavigationListener, getInteractiveRouterRendererId, handleClickForNavigationInterception, hasInteractiveRouter, hasProgrammaticEnhancedNavigationHandler, isSamePageWithHash, isWithinBaseUriSpace, performProgrammaticEnhancedNavigation, performScrollToElementOnTheSamePage, scrollToElement, setHasInteractiveRouter, toAbsoluteUri } from './NavigationUtils';
import { WebRendererId } from '../Rendering/WebRendererId';
import { isRendererAttached } from '../Rendering/WebRendererInteropMethods';
import { IBlazor } from '../GlobalExports';
@@ -71,16 +71,6 @@ function setHasLocationChangingListeners(rendererId: WebRendererId, hasListeners
callbacks.hasLocationChangingEventListeners = hasListeners;
}
-export function scrollToElement(identifier: string): boolean {
- const element = document.getElementById(identifier);
-
- if (element) {
- element.scrollIntoView();
- return true;
- }
-
- return false;
-}
export function attachToEventDelegator(eventDelegator: EventDelegator): void {
// We need to respond to clicks on elements *after* the EventDelegator has finished
@@ -97,22 +87,6 @@ export function attachToEventDelegator(eventDelegator: EventDelegator): void {
});
}
-function isSamePageWithHash(absoluteHref: string): boolean {
- const hashIndex = absoluteHref.indexOf('#');
- return hashIndex > -1 && location.href.replace(location.hash, '') === absoluteHref.substring(0, hashIndex);
-}
-
-function performScrollToElementOnTheSamePage(absoluteHref : string, replace: boolean, state: string | undefined = undefined): void {
- saveToBrowserHistory(absoluteHref, replace, state);
-
- const hashIndex = absoluteHref.indexOf('#');
- if (hashIndex === absoluteHref.length - 1) {
- return;
- }
-
- const identifier = absoluteHref.substring(hashIndex + 1);
- scrollToElement(identifier);
-}
function refresh(forceReload: boolean): void {
if (!forceReload && hasProgrammaticEnhancedNavigationHandler()) {
@@ -181,7 +155,8 @@ async function performInternalNavigation(absoluteInternalHref: string, intercept
ignorePendingNavigation();
if (isSamePageWithHash(absoluteInternalHref)) {
- performScrollToElementOnTheSamePage(absoluteInternalHref, replace, state);
+ saveToBrowserHistory(absoluteInternalHref, replace, state);
+ performScrollToElementOnTheSamePage(absoluteInternalHref);
return;
}
diff --git a/src/Components/Web.JS/src/Services/NavigationUtils.ts b/src/Components/Web.JS/src/Services/NavigationUtils.ts
index 334a1920d065..4ce44461ecc8 100644
--- a/src/Components/Web.JS/src/Services/NavigationUtils.ts
+++ b/src/Components/Web.JS/src/Services/NavigationUtils.ts
@@ -47,6 +47,25 @@ export function isWithinBaseUriSpace(href: string) {
&& (nextChar === '' || nextChar === '/' || nextChar === '?' || nextChar === '#');
}
+export function isSamePageWithHash(absoluteHref: string): boolean {
+ const url = new URL(absoluteHref);
+ return url.hash !== '' && location.origin === url.origin && location.pathname === url.pathname && location.search === url.search;
+}
+
+export function performScrollToElementOnTheSamePage(absoluteHref : string): void {
+ const hashIndex = absoluteHref.indexOf('#');
+ if (hashIndex === absoluteHref.length - 1) {
+ return;
+ }
+
+ const identifier = absoluteHref.substring(hashIndex + 1);
+ scrollToElement(identifier);
+}
+
+export function scrollToElement(identifier: string): void {
+ document.getElementById(identifier)?.scrollIntoView();
+}
+
export function attachEnhancedNavigationListener(listener: typeof enhancedNavigationListener) {
enhancedNavigationListener = listener;
}
diff --git a/src/Components/test/E2ETest/ServerRenderingTests/EnhancedNavigationTest.cs b/src/Components/test/E2ETest/ServerRenderingTests/EnhancedNavigationTest.cs
index 0c65602c0275..158cc2d42c8d 100644
--- a/src/Components/test/E2ETest/ServerRenderingTests/EnhancedNavigationTest.cs
+++ b/src/Components/test/E2ETest/ServerRenderingTests/EnhancedNavigationTest.cs
@@ -35,7 +35,7 @@ public void CanNavigateToAnotherPageWhilePreservingCommonDOMElements()
var h1Elem = Browser.Exists(By.TagName("h1"));
Browser.Equal("Hello", () => h1Elem.Text);
-
+
Browser.Exists(By.TagName("nav")).FindElement(By.LinkText("Streaming")).Click();
// Important: we're checking the *same* element as earlier, showing that we got to the
@@ -172,6 +172,20 @@ public void ScrollsToHashWithContentAddedAsynchronously()
Browser.True(() => Browser.GetScrollY() > 500);
}
+ [Fact]
+ public void CanScrollToHashWithoutPerformingFullNavigation()
+ {
+ Navigate($"{ServerPathBase}/nav/scroll-to-hash");
+ Browser.Equal("Scroll to hash", () => Browser.Exists(By.TagName("h1")).Text);
+
+ Browser.Exists(By.Id("scroll-anchor")).Click();
+ Browser.True(() => Browser.GetScrollY() > 500);
+ Browser.True(() => Browser
+ .Exists(By.Id("uri-on-page-load"))
+ .GetAttribute("data-value")
+ .EndsWith("scroll-to-hash", StringComparison.Ordinal));
+ }
+
[Theory]
[InlineData("server")]
[InlineData("webassembly")]
@@ -327,7 +341,7 @@ public void RefreshWithForceReloadDoesFullPageReload(string renderMode)
Browser.Exists(By.TagName("nav")).FindElement(By.LinkText($"Interactive component navigation ({renderMode})")).Click();
Browser.Equal("Page with interactive components that navigate", () => Browser.Exists(By.TagName("h1")).Text);
-
+
// Normally, you shouldn't store references to elements because they could become stale references
// after the page re-renders. However, we want to explicitly test that the element becomes stale
// across renders to ensure that a full page reload occurs.
@@ -602,7 +616,7 @@ public void LocationChangingEventGetsInvokedOnEnhancedNavigationOnlyForRuntimeTh
[InlineData("wasm")]
public void CanReceiveNullParameterValueOnEnhancedNavigation(string renderMode)
{
- // See: https://github.com/dotnet/aspnetcore/issues/52434
+ // See: https://github.com/dotnet/aspnetcore/issues/52434
Navigate($"{ServerPathBase}/nav");
Browser.Equal("Hello", () => Browser.Exists(By.TagName("h1")).Text);
diff --git a/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/EnhancedNav/PageForScrollingToHash.razor b/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/EnhancedNav/PageForScrollingToHash.razor
index b49d40f28e14..102e18a84807 100644
--- a/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/EnhancedNav/PageForScrollingToHash.razor
+++ b/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/EnhancedNav/PageForScrollingToHash.razor
@@ -1,5 +1,6 @@
@page "/nav/scroll-to-hash"
@attribute [StreamRendering]
+@inject NavigationManager NavigationManager
Page for scrolling to hash
@@ -7,6 +8,11 @@
If you scroll down a long way, you'll find more content. We add it asynchronously via streaming rendering.
+
+ Scroll via anchor
+
+
+
spacer
@if (showContent)
@@ -18,9 +24,11 @@
@code {
bool showContent;
+ string uriOnPageLoad;
protected override async Task OnInitializedAsync()
{
+ uriOnPageLoad = NavigationManager.Uri;
await Task.Delay(1000);
showContent = true;
}