diff --git a/src/Components/Web.JS/dist/Release/blazor.server.js b/src/Components/Web.JS/dist/Release/blazor.server.js index 40e7ed951141..4211bd38b8cd 100644 --- a/src/Components/Web.JS/dist/Release/blazor.server.js +++ b/src/Components/Web.JS/dist/Release/blazor.server.js @@ -1 +1 @@ -(()=>{"use strict";var e,t,n,r={};r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),function(e){window.DotNet=e;const t=[],n=new Map,r=new Map,o="__jsObjectId",i="__byte[]";class s{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 a={},c={0:new s(window)};c[0]._cachedFunctions.set("import",(e=>("string"==typeof e&&e.startsWith("./")&&(e=document.baseURI+e.substr(2)),import(e))));let l,h=1,u=1,d=null;function p(e){t.push(e)}function f(e){if(e&&"object"==typeof e){c[u]=new s(e);const t={[o]: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 n={__jsStreamReferenceLength:t};try{const t=f(e);n.__jsObjectId=t.__jsObjectId}catch(t){throw new Error(`Cannot create a JSStreamReference from the value '${e}'.`)}return n}function m(e){return e?JSON.parse(e,((e,n)=>t.reduce(((t,n)=>n(e,t)),n))):null}function y(e,t,n,r){const o=v();if(o.invokeDotNetFromJS){const i=D(r),s=o.invokeDotNetFromJS(e,t,n,i);return s?m(s):null}throw new Error("The current dispatcher does not support synchronous calls from JS to .NET. Use invokeMethodAsync instead.")}function w(e,t,n,r){if(e&&n)throw new Error(`For instance method calls, assemblyName should be null. Received '${e}'.`);const o=h++,i=new Promise(((e,t)=>{a[o]={resolve:e,reject:t}}));try{const i=D(r);v().beginInvokeDotNetFromJS(o,e,t,n,i)}catch(e){b(o,!1,e)}return i}function v(){if(null!==d)return d;throw new Error("No .NET call dispatcher has been set.")}function b(e,t,n){if(!a.hasOwnProperty(e))throw new Error(`There is no pending async call with ID ${e}.`);const r=a[e];delete a[e],t?r.resolve(n):r.reject(n)}function _(e){return e instanceof Error?`${e.message}\n${e.stack}`:e?e.toString():"null"}function E(e,t){const n=c[t];if(n)return n.findFunction(e);throw new Error(`JS object instance with ID ${t} does not exist (has it been disposed?).`)}function S(e){delete c[e]}e.attachDispatcher=function(e){d=e},e.attachReviver=p,e.invokeMethod=function(e,t,...n){return y(e,t,null,n)},e.invokeMethodAsync=function(e,t,...n){return w(e,t,null,n)},e.createJSObjectReference=f,e.createJSStreamReference=g,e.disposeJSObjectReference=function(e){const t=e&&e.__jsObjectId;"number"==typeof t&&S(t)},function(e){e[e.Default=0]="Default",e[e.JSObjectReference=1]="JSObjectReference",e[e.JSStreamReference=2]="JSStreamReference",e[e.JSVoidResult=3]="JSVoidResult"}(l=e.JSCallResultType||(e.JSCallResultType={})),e.jsCallDispatcher={findJSFunction:E,disposeJSObjectReferenceById:S,invokeJSFromDotNet:(e,t,n,r)=>{const o=T(E(e,r).apply(null,m(t)),n);return null==o?null:D(o)},beginInvokeJSFromDotNet:(e,t,n,r,o)=>{const i=new Promise((e=>{e(E(t,o).apply(null,m(n)))}));e&&i.then((t=>D([e,!0,T(t,r)]))).then((t=>v().endInvokeJSFromDotNet(e,!0,t)),(t=>v().endInvokeJSFromDotNet(e,!1,JSON.stringify([e,!1,_(t)]))))},endInvokeDotNetFromJS:(e,t,n)=>{const r=t?m(n):new Error(n);b(parseInt(e,10),t,r)},receiveByteArray:(e,t)=>{n.set(e,t)},supplyDotNetStream:(e,t)=>{if(r.has(e)){const n=r.get(e);r.delete(e),n.resolve(t)}else{const n=new k;n.resolve(t),r.set(e,n)}}};class C{constructor(e){this._id=e}invokeMethod(e,...t){return y(null,e,this._id,t)}invokeMethodAsync(e,...t){return w(null,e,this._id,t)}dispose(){w(null,"__Dispose",this._id,null).catch((e=>console.error(e)))}serializeAsArg(){return{__dotNetObject:this._id}}}e.DotNetObject=C,p((function(e,t){if(t&&"object"==typeof t){if(t.hasOwnProperty("__dotNetObject"))return new C(t.__dotNetObject);if(t.hasOwnProperty(o)){const e=t.__jsObjectId,n=c[e];if(n)return n.getWrappedObject();throw new Error(`JS object instance with Id '${e}' does not exist. It may have been disposed.`)}if(t.hasOwnProperty(i)){const e=t["__byte[]"],r=n.get(e);if(void 0===r)throw new Error(`Byte array index '${e}' does not exist.`);return n.delete(e),r}if(t.hasOwnProperty("__dotNetStream"))return new I(t.__dotNetStream)}return t}));class I{constructor(e){if(r.has(e))this._streamPromise=r.get(e).streamPromise,r.delete(e);else{const t=new k;r.set(e,t),this._streamPromise=t.streamPromise}}stream(){return this._streamPromise}async arrayBuffer(){return new Response(await this.stream()).arrayBuffer()}}class k{constructor(){this.streamPromise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}function T(e,t){switch(t){case l.Default:return e;case l.JSObjectReference:return f(e);case l.JSStreamReference:return g(e);case l.JSVoidResult:return null;default:throw new Error(`Invalid JS call result type '${t}'.`)}}let x=0;function D(e){return x=0,JSON.stringify(e,R)}function R(e,t){if(t instanceof C)return t.serializeAsArg();if(t instanceof Uint8Array){d.sendByteArray(x,t);const e={[i]:x};return x++,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"}(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 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 u(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{...d(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=>d(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:u(t.touches),targetTouches:u(t.targetTouches),changedTouches:u(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{...d(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{...d(t=e),deltaX:t.deltaX,deltaY:t.deltaY,deltaZ:t.deltaZ,deltaMode:t.deltaMode};var t}}),h(["toggle"],{createEventArgs:()=>({})});const p=["date","datetime-local","month","time","week"],f=new Map;let g,m,y=0;const w={async add(e,t,n){if(!n)throw new Error("initialParameters must be an object, even if empty.");const r="__bl-dynamic-root:"+(++y).toString();f.set(r,e);const o=await _().invokeMethodAsync("AddRootComponent",t,r),i=new b(o,m[t]);return await i.setParameters(n),i}};class v{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 b{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 v)}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 _().invokeMethodAsync("SetRootComponentParameters",this._componentId,r,t)}async dispose(){if(null!==this._componentId){await _().invokeMethodAsync("RemoveRootComponent",this._componentId),this._componentId=null;for(const e of this._jsEventCallbackWrappers.values())e.dispose()}}}function _(){if(!g)throw new Error("Dynamic root components have not been enabled in this application.");return g}const E=new Map;let S;const C=new Promise((e=>{S=e}));function I(e,t,n){return T(e,t.eventHandlerId,(()=>k(e).invokeMethodAsync("DispatchEventAsync",t,n)))}function k(e){const t=E.get(e);if(!t)throw new Error(`No interop methods are registered for renderer ${e}`);return t}let T=(e,t,n)=>n();const x=N(["abort","blur","canplay","canplaythrough","change","cuechange","durationchange","emptied","ended","error","focus","load","loadeddata","loadedmetadata","loadend","loadstart","mouseenter","mouseleave","pause","play","playing","progress","ratechange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeupdate","toggle","unload","volumechange","waiting","DOMNodeInsertedIntoDocument","DOMNodeRemovedFromDocument"]),D={submit:!0},R=N(["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),i=o.getHandler(t);if(i)this.eventInfoStore.update(i.eventHandlerId,n);else{const i={element:e,eventName:t,eventHandlerId:n,renderingComponentId:r};this.eventInfoStore.add(i),o.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 r=n.shift(),i=null,s=!1;const a=Object.prototype.hasOwnProperty.call(x,e);let l=!1;for(;r;){const d=r,p=this.getEventHandlerInfosForElement(d,!1);if(p){const n=p.getHandler(e);if(n&&(h=d,u=t.type,!((h instanceof HTMLButtonElement||h instanceof HTMLInputElement||h instanceof HTMLTextAreaElement||h instanceof HTMLSelectElement)&&Object.prototype.hasOwnProperty.call(R,u)&&h.disabled))){if(!s){const n=c(e);i=(null==n?void 0:n.createEventArgs)?n.createEventArgs(t):{},s=!0}Object.prototype.hasOwnProperty.call(D,t.type)&&t.preventDefault(),I(this.browserRendererId,{eventHandlerId:n.eventHandlerId,eventName:e,eventFieldInfo:o.fromEvent(n.renderingComponentId,t)},i)}p.stopPropagation(e)&&(l=!0),p.preventDefault(e)&&t.preventDefault()}r=a||l?void 0:n.shift()}var h,u}getEventHandlerInfosForElement(e,t){return Object.prototype.hasOwnProperty.call(e,this.eventsCollectionKey)?e[this.eventsCollectionKey]:t?e[this.eventsCollectionKey]=new A: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 A{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 N(e){const t={};return e.forEach((e=>{t[e]=!0})),t}const $=G("_blazorLogicalChildren"),B=G("_blazorLogicalParent"),L=G("_blazorLogicalEnd");function M(e,t){if(e.childNodes.length>0&&!t)throw new Error("New logical elements must start empty, or allowExistingContents must be true");return $ in e||(e[$]=[]),e}function O(e,t){const n=document.createComment("!");return F(n,e,t),n}function F(e,t,n){const r=e;if(e instanceof Comment&&J(r)&&J(r).length>0)throw new Error("Not implemented: inserting non-empty logical container");if(H(r))throw new Error("Not implemented: moving existing logical children");const o=J(t);if(n0;)j(n,0)}const r=n;r.parentNode.removeChild(r)}function H(e){return e[B]||null}function W(e,t){return J(e)[t]}function z(e){const t=V(e);return"http://www.w3.org/2000/svg"===t.namespaceURI&&"foreignObject"!==t.tagName}function J(e){return e[$]}function q(e,t){const n=J(e);t.forEach((e=>{e.moveRangeStart=n[e.fromSiblingIndex],e.moveRangeEnd=Y(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):X(r,e)})),t.forEach((e=>{const t=e.moveToBeforeMarker,n=t.parentNode,r=e.moveRangeStart,o=e.moveRangeEnd;let i=r;for(;i;){const e=i.nextSibling;if(n.insertBefore(i,t),i===o)break;i=e}n.removeChild(t)})),t.forEach((e=>{n[e.toSiblingIndex]=e.moveRangeStart}))}function V(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 K(e){const t=J(H(e));return t[Array.prototype.indexOf.call(t,e)+1]||null}function X(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):X(e,H(t))}}}function Y(e){if(e instanceof Element||e instanceof DocumentFragment)return e;const t=K(e);if(t)return t.previousSibling;{const t=H(e);return t instanceof Element||t instanceof DocumentFragment?t.lastChild:Y(t)}}function G(e){return"function"==typeof Symbol?Symbol():e}function Q(e){return`_bl_${e}`}e.attachReviver(((e,t)=>t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"__internalId")&&"string"==typeof t.__internalId?function(e){const t=`[${Q(e)}]`;return document.querySelector(t)}(t.__internalId):t));const Z="_blazorDeferredValue",ee=document.createElement("template"),te=document.createElementNS("http://www.w3.org/2000/svg","g"),ne={},re="__internal_",oe="preventDefault_",ie="stopPropagation_";class se{constructor(e){this.rootComponentIds=new Set,this.childComponentLocations={},this.eventDelegator=new P(e),this.eventDelegator.notifyAfterClick((e=>{if(!fe)return;if(0!==e.button||function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e))return;if(e.defaultPrevented)return;const t=function(e){const t=!window._blazorDisableComposedPath&&e.composedPath&&e.composedPath();if(t){for(let e=0;ebe(!1))))},enableNavigationInterception:function(){fe=!0},navigateTo:we,getBaseURI:()=>document.baseURI,getLocationHref:()=>location.href};function we(e,t,n=!1){const r=Ee(e),o=t instanceof Object?t:{forceLoad:t,replaceHistoryEntry:n};!o.forceLoad&&Ce(r)?ve(r,!1,o.replaceHistoryEntry):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,o.replaceHistoryEntry)}function ve(e,t,n){pe=!0,n?history.replaceState(null,"",e):history.pushState(null,"",e),be(t)}async function be(e){me&&await me(location.href,e)}let _e;function Ee(e){return _e=_e||document.createElement("a"),_e.href=e,_e.href}function Se(e,t){return e?e.tagName===t?e:Se(e.parentElement,t):null}function Ce(e){const t=(n=document.baseURI).substring(0,n.lastIndexOf("/"));var n;const r=e.charAt(t.length);return e.startsWith(t)&&(""===r||"/"===r||"?"===r||"#"===r)}const Ie={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){const t=document.querySelector(e);t&&(t.hasAttribute("tabindex")||(t.tabIndex=-1),t.focus())}},ke={init:function(e,t,n,r=50){const o=xe(t);(o||document.documentElement).style.overflowAnchor="none";const i=document.createRange();h(n.parentElement)&&(t.style.display="table-row",n.style.display="table-row");const s=new IntersectionObserver((function(r){r.forEach((r=>{var o;if(!r.isIntersecting)return;i.setStartAfter(t),i.setEndBefore(n);const s=i.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,s,a):r.target===n&&n.offsetHeight>0&&e.invokeMethodAsync("OnSpacerAfterVisible",r.boundingClientRect.bottom-r.intersectionRect.bottom,s,a)}))}),{root:o,rootMargin:`${r}px`});s.observe(t),s.observe(n);const a=l(t),c=l(n);function l(e){const t={attributes:!0},n=new MutationObserver(((n,r)=>{h(e.parentElement)&&(r.disconnect(),e.style.display="table-row",r.observe(e,t)),s.unobserve(e),s.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)}Te[e._id]={intersectionObserver:s,mutationObserverBefore:a,mutationObserverAfter:c}},dispose:function(e){const t=Te[e._id];t&&(t.intersectionObserver.disconnect(),t.mutationObserverBefore.disconnect(),t.mutationObserverAfter.disconnect(),e.dispose(),delete Te[e._id])}},Te={};function xe(e){return e?"visible"!==getComputedStyle(e).overflowY?e:xe(e.parentElement):null}const De={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],i=o.previousSibling;i instanceof Comment&&null!==H(i)||(null===n&&(n=o.textContent),null===(e=o.parentNode)||void 0===e||e.removeChild(o))}return n}},Re={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 i=Pe(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,r/s.width),a=Math.min(1,o/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 Pe(e,t).blob}};function Pe(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}async function Ue(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)}const Ae=new Map,Ne={navigateTo:we,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:w,_internal:{navigationManager:ye,domWrapper:Ie,Virtualize:ke,PageTitle:De,InputFile:Re,getJSDataStreamChunk:Ue,receiveDotNetDataStream:function(t,n,r,o){let i=Ae.get(t);if(!i){const n=new ReadableStream({start(e){Ae.set(t,e),i=e}});e.jsCallDispatcher.supplyDotNetStream(t,n)}o?(i.error(o),Ae.delete(t)):0===r?(i.close(),Ae.delete(t)):i.enqueue(n.length===r?n:n.subarray(0,r))},attachWebRendererInterop:function(t,n,r,o){if(E.has(t))throw new Error(`Interop methods are already registered for renderer ${t}`);E.set(t,n),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.jsCallDispatcher.findJSFunction(t,0);for(const e of o)r(e,n[e])}}(k(t),r,o),S()}}};window.Blazor=Ne;const $e=[0,2e3,1e4,3e4,null];class Be{constructor(e){this._retryDelays=void 0!==e?[...e,null]:$e}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}}class Le extends Error{constructor(e,t){const n=new.target.prototype;super(`${e}: Status code '${t}'`),this.statusCode=t,this.__proto__=n}}class Me extends Error{constructor(e="A timeout occurred."){const t=new.target.prototype;super(e),this.__proto__=t}}class Oe extends Error{constructor(e="An abort occurred."){const t=new.target.prototype;super(e),this.__proto__=t}}class Fe extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.transport=t,this.errorType="UnsupportedTransportError",this.__proto__=n}}class je extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.transport=t,this.errorType="DisabledTransportError",this.__proto__=n}}class He extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.transport=t,this.errorType="FailedToStartTransportError",this.__proto__=n}}class We extends Error{constructor(e){const t=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=t}}class ze extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.innerErrors=t,this.__proto__=n}}class Je{constructor(e,t,n){this.statusCode=e,this.statusText=t,this.content=n}}class qe{get(e,t){return this.send({...t,method:"GET",url:e})}post(e,t){return this.send({...t,method:"POST",url:e})}delete(e,t){return this.send({...t,method:"DELETE",url:e})}getCookieString(e){return""}}var Ve,Ke,Xe,Ye,Ge;!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"}(Ve||(Ve={}));class Qe{constructor(){}log(e,t){}}Qe.instance=new Qe;class Ze{static isRequired(e,t){if(null==e)throw new Error(`The '${t}' argument is required.`)}static isNotEmpty(e,t){if(!e||e.match(/^\s*$/))throw new Error(`The '${t}' argument should not be empty.`)}static isIn(e,t,n){if(!(e in t))throw new Error(`Unknown ${n} value: ${e}.`)}}class et{static get isBrowser(){return"object"==typeof window&&"object"==typeof window.document}static get isWebWorker(){return"object"==typeof self&&"importScripts"in self}static get isReactNative(){return"object"==typeof window&&void 0===window.document}static get isNode(){return!this.isBrowser&&!this.isWebWorker&&!this.isReactNative}}function tt(e,t){let n="";return nt(e)?(n=`Binary data of length ${e.byteLength}`,t&&(n+=`. Content: '${function(e){const t=new Uint8Array(e);let n="";return t.forEach((e=>{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 nt(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}async function rt(e,t,n,r,o,i,s){let a={};if(o){const e=await o();e&&(a={Authorization:`Bearer ${e}`})}const[c,l]=st();a[c]=l,e.log(Ve.Trace,`(${t} transport) sending data. ${tt(i,s.logMessageContent)}.`);const h=nt(i)?"arraybuffer":"text",u=await n.post(r,{content:i,headers:{...a,...s.headers},responseType:h,timeout:s.timeout,withCredentials:s.withCredentials});e.log(Ve.Trace,`(${t} transport) request complete. Response status: ${u.statusCode}.`)}class ot{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 it{constructor(e){this._minLevel=e,this.out=console}log(e,t){if(e>=this._minLevel){const n=`[${(new Date).toISOString()}] ${Ve[e]}: ${t}`;switch(e){case Ve.Critical:case Ve.Error:this.out.error(n);break;case Ve.Warning:this.out.warn(n);break;case Ve.Information:this.out.info(n);break;default:this.out.log(n)}}}}function st(){let e="X-SignalR-User-Agent";return et.isNode&&(e="User-Agent"),[e,at("0.0.0-DEV_BUILD",ct(),et.isNode?"NodeJS":"Browser",lt())]}function at(e,t,n,r){let o="Microsoft SignalR/";const i=e.split(".");return o+=`${i[0]}.${i[1]}`,o+=` (${e}; `,o+=t&&""!==t?`${t}; `:"Unknown OS; ",o+=`${n}`,o+=r?`; ${r}`:"; Unknown Runtime Version",o+=")",o}function ct(){if(!et.isNode)return"";switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}}function lt(){if(et.isNode)return process.versions.node}function ht(e){return e.stack?e.stack:e.message?e.message:`${e}`}class ut extends qe{constructor(e){if(super(),this._logger=e,"undefined"==typeof fetch){const e=require;this._jar=new(e("tough-cookie").CookieJar),this._fetchType=e("node-fetch"),this._fetchType=e("fetch-cookie")(this._fetchType,this._jar)}else 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!==r.g)return r.g;throw new Error("could not find global")}());if("undefined"==typeof AbortController){const e=require;this._abortControllerType=e("abort-controller")}else this._abortControllerType=AbortController}async send(e){if(e.abortSignal&&e.abortSignal.aborted)throw new Oe;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 Oe});let r,o=null;if(e.timeout){const r=e.timeout;o=setTimeout((()=>{t.abort(),this._logger.log(Ve.Warning,"Timeout from HTTP request."),n=new Me}),r)}""===e.content&&(e.content=void 0),e.content&&(e.headers=e.headers||{},nt(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(Ve.Warning,`Error from HTTP request. ${e}.`),e}finally{o&&clearTimeout(o),e.abortSignal&&(e.abortSignal.onabort=null)}if(!r.ok){const e=await dt(r,"text");throw new Le(e||r.statusText,r.status)}const i=dt(r,e.responseType),s=await i;return new Je(r.status,r.statusText,s)}getCookieString(e){return""}}function dt(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 pt extends qe{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new Oe):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&&(nt(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 Oe)}),e.timeout&&(r.timeout=e.timeout),r.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),r.status>=200&&r.status<300?t(new Je(r.status,r.statusText,r.response||r.responseText)):n(new Le(r.response||r.responseText||r.statusText,r.status))},r.onerror=()=>{this._logger.log(Ve.Warning,`Error from HTTP request. ${r.status}: ${r.statusText}.`),n(new Le(r.statusText,r.status))},r.ontimeout=()=>{this._logger.log(Ve.Warning,"Timeout from HTTP request."),n(new Me)},r.send(e.content)})):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class ft extends qe{constructor(e){if(super(),"undefined"!=typeof fetch)this._httpClient=new ut(e);else{if("undefined"==typeof XMLHttpRequest)throw new Error("No usable HttpClient found.");this._httpClient=new pt(e)}}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new Oe):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)}}class gt{}gt.Authorization="Authorization",gt.Cookie="Cookie",function(e){e[e.None=0]="None",e[e.WebSockets=1]="WebSockets",e[e.ServerSentEvents=2]="ServerSentEvents",e[e.LongPolling=4]="LongPolling"}(Ke||(Ke={})),function(e){e[e.Text=1]="Text",e[e.Binary=2]="Binary"}(Xe||(Xe={}));class mt{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 yt{constructor(e,t,n,r){this._httpClient=e,this._accessTokenFactory=t,this._logger=n,this._pollAbort=new mt,this._options=r,this._running=!1,this.onreceive=null,this.onclose=null}get pollAborted(){return this._pollAbort.aborted}async connect(e,t){if(Ze.isRequired(e,"url"),Ze.isRequired(t,"transferFormat"),Ze.isIn(t,Xe,"transferFormat"),this._url=e,this._logger.log(Ve.Trace,"(LongPolling transport) Connecting."),t===Xe.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]=st(),o={[n]:r,...this._options.headers},i={abortSignal:this._pollAbort.signal,headers:o,timeout:1e5,withCredentials:this._options.withCredentials};t===Xe.Binary&&(i.responseType="arraybuffer"),await this._updateHeaderToken(i);const s=`${e}&_=${Date.now()}`;this._logger.log(Ve.Trace,`(LongPolling transport) polling: ${s}.`);const a=await this._httpClient.get(s,i);200!==a.statusCode?(this._logger.log(Ve.Error,`(LongPolling transport) Unexpected response code: ${a.statusCode}.`),this._closeError=new Le(a.statusText||"",a.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,i)}async _updateHeaderToken(e){if(e.headers||(e.headers={}),this._accessTokenFactory){const t=await this._accessTokenFactory();t?e.headers[gt.Authorization]=`Bearer ${t}`:e.headers[gt.Authorization]&&delete e.headers[gt.Authorization]}}async _poll(e,t){try{for(;this._running;){await this._updateHeaderToken(t);try{const n=`${e}&_=${Date.now()}`;this._logger.log(Ve.Trace,`(LongPolling transport) polling: ${n}.`);const r=await this._httpClient.get(n,t);204===r.statusCode?(this._logger.log(Ve.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):200!==r.statusCode?(this._logger.log(Ve.Error,`(LongPolling transport) Unexpected response code: ${r.statusCode}.`),this._closeError=new Le(r.statusText||"",r.statusCode),this._running=!1):r.content?(this._logger.log(Ve.Trace,`(LongPolling transport) data received. ${tt(r.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(r.content)):this._logger.log(Ve.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(e){this._running?e instanceof Me?this._logger.log(Ve.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=e,this._running=!1):this._logger.log(Ve.Trace,`(LongPolling transport) Poll errored after shutdown: ${e.message}`)}}}finally{this._logger.log(Ve.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(e){return this._running?rt(this._logger,"LongPolling",this._httpClient,this._url,this._accessTokenFactory,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this._logger.log(Ve.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(Ve.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const e={},[t,n]=st();e[t]=n;const r={headers:{...e,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials};await this._updateHeaderToken(r),await this._httpClient.delete(this._url,r),this._logger.log(Ve.Trace,"(LongPolling transport) DELETE request sent.")}finally{this._logger.log(Ve.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(Ve.Trace,e),this.onclose(this._closeError)}}}class wt{constructor(e,t,n,r){this._httpClient=e,this._accessTokenFactory=t,this._logger=n,this._options=r,this.onreceive=null,this.onclose=null}async connect(e,t){if(Ze.isRequired(e,"url"),Ze.isRequired(t,"transferFormat"),Ze.isIn(t,Xe,"transferFormat"),this._logger.log(Ve.Trace,"(SSE transport) Connecting."),this._url=e,this._accessTokenFactory){const t=await this._accessTokenFactory();t&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(t)}`)}return new Promise(((n,r)=>{let o,i=!1;if(t===Xe.Text){if(et.isBrowser||et.isWebWorker)o=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{const t=this._httpClient.getCookieString(e),n={};n.Cookie=t;const[r,i]=st();n[r]=i,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(Ve.Trace,`(SSE transport) data received. ${tt(e.data,this._options.logMessageContent)}.`),this.onreceive(e.data)}catch(e){return void this._close(e)}},o.onerror=e=>{i?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(Ve.Information,`SSE connected to ${this._url}`),this._eventSource=o,i=!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?rt(this._logger,"SSE",this._httpClient,this._url,this._accessTokenFactory,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 vt{constructor(e,t,n,r,o,i){this._logger=n,this._accessTokenFactory=t,this._logMessageContent=r,this._webSocketConstructor=o,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=i}async connect(e,t){let n;return Ze.isRequired(e,"url"),Ze.isRequired(t,"transferFormat"),Ze.isIn(t,Xe,"transferFormat"),this._logger.log(Ve.Trace,"(WebSockets transport) Connecting."),this._accessTokenFactory&&(n=await this._accessTokenFactory()),new Promise(((r,o)=>{let i;e=e.replace(/^http/,"ws");const s=this._httpClient.getCookieString(e);let a=!1;if(et.isReactNative){const t={},[r,o]=st();t[r]=o,n&&(t[gt.Authorization]=`Bearer ${n}`),s&&(t[gt.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===Xe.Binary&&(i.binaryType="arraybuffer"),i.onopen=t=>{this._logger.log(Ve.Information,`WebSocket connected to ${e}.`),this._webSocket=i,a=!0,r()},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(Ve.Information,`(WebSockets transport) ${t}.`)},i.onmessage=e=>{if(this._logger.log(Ve.Trace,`(WebSockets transport) data received. ${tt(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.",o(new Error(t))}}}))}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(Ve.Trace,`(WebSockets transport) sending data. ${tt(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(Ve.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 bt{constructor(e,t={}){var n;if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,Ze.isRequired(e,"url"),this._logger=void 0===(n=t.logger)?new it(Ve.Information):null===n?Qe.instance:void 0!==n.log?n:new it(n),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=t.httpClient||new ft(this._logger),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=t,this.onreceive=null,this.onclose=null}async start(e){if(e=e||Xe.Binary,Ze.isIn(e,Xe,"transferFormat"),this._logger.log(Ve.Debug,`Starting connection with transfer format '${Xe[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(Ve.Error,e),await this._stopPromise,Promise.reject(new Oe(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(Ve.Error,e),Promise.reject(new Oe(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 _t(this.transport)),this._sendQueue.send(e))}async stop(e){return"Disconnected"===this._connectionState?(this._logger.log(Ve.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):"Disconnecting"===this._connectionState?(this._logger.log(Ve.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(Ve.Error,`HttpConnection.transport.stop() threw error '${e}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(Ve.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async _startInternal(e){let t=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport!==Ke.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(Ke.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 Oe("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}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 yt&&(this.features.inherentKeepAlive=!0),"Connecting"===this._connectionState&&(this._logger.log(Ve.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(e){return this._logger.log(Ve.Error,"Failed to start the connection: "+e),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(e)}}async _getNegotiationResponse(e){const t={};if(this._accessTokenFactory){const e=await this._accessTokenFactory();e&&(t[gt.Authorization]=`Bearer ${e}`)}const[n,r]=st();t[n]=r;const o=this._resolveNegotiateUrl(e);this._logger.log(Ve.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}catch(e){let t="Failed to complete negotiation with the server: "+e;return e instanceof Le&&404===e.statusCode&&(t+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(Ve.Error,t),Promise.reject(new We(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(Ve.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 i=[],s=n.availableTransports||[];let a=n;for(const n of s){const s=this._resolveTransportOrError(n,t,r);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)}o=this._createConnectUrl(e,a.connectionToken)}try{return await this._startTransport(o,r),void(this.connectionId=a.connectionId)}catch(e){if(this._logger.log(Ve.Error,`Failed to start the transport '${n.transport}': ${e}`),a=void 0,i.push(new He(`${n.transport} failed: ${e}`,Ke[n.transport])),"Connecting"!==this._connectionState){const e="Failed to select transport before stop() was called.";return this._logger.log(Ve.Debug,e),Promise.reject(new Oe(e))}}}}return i.length>0?Promise.reject(new ze(`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 Ke.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new vt(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case Ke.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new wt(this._httpClient,this._accessTokenFactory,this._logger,this._options);case Ke.LongPolling:return new yt(this._httpClient,this._accessTokenFactory,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,t){return this.transport.onreceive=this.onreceive,this.transport.onclose=e=>this._stopConnection(e),this.transport.connect(e,t)}_resolveTransportOrError(e,t,n){const r=Ke[e.transport];if(null==r)return this._logger.log(Ve.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(Ve.Debug,`Skipping transport '${Ke[r]}' because it was disabled by the client.`),new je(`'${Ke[r]}' is disabled by the client.`,r);if(!(e.transferFormats.map((e=>Xe[e])).indexOf(n)>=0))return this._logger.log(Ve.Debug,`Skipping transport '${Ke[r]}' because it does not support the requested transfer format '${Xe[n]}'.`),new Error(`'${Ke[r]}' does not support ${Xe[n]}.`);if(r===Ke.WebSockets&&!this._options.WebSocket||r===Ke.ServerSentEvents&&!this._options.EventSource)return this._logger.log(Ve.Debug,`Skipping transport '${Ke[r]}' because it is not supported in your environment.'`),new Fe(`'${Ke[r]}' is not supported in your environment.`,r);this._logger.log(Ve.Debug,`Selecting transport '${Ke[r]}'.`);try{return this._constructTransport(r)}catch(e){return e}}_isITransport(e){return e&&"object"==typeof e&&"connect"in e}_stopConnection(e){if(this._logger.log(Ve.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(Ve.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(Ve.Error,`Connection disconnected with error '${e}'.`):this._logger.log(Ve.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch((e=>{this._logger.log(Ve.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(Ve.Error,`HttpConnection.onclose(${e}) threw error '${t}'.`)}}}else this._logger.log(Ve.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(!et.isBrowser)throw new Error(`Cannot resolve '${e}'.`);const t=window.document.createElement("a");return t.href=e,this._logger.log(Ve.Information,`Normalizing '${e}' to '${t.href}'.`),t.href}_resolveNegotiateUrl(e){const t=e.indexOf("?");let n=e.substring(0,-1===t?e.length:t);return"/"!==n[n.length-1]&&(n+="/"),n+="negotiate",n+=-1===t?"":e.substring(t),-1===n.indexOf("negotiateVersion")&&(n+=-1===t?"?":"&",n+="negotiateVersion="+this._negotiateVersion),n}}class _t{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new Et,this._transportResult=new Et,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new Et),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 Et;const e=this._transportResult;this._transportResult=void 0;const t="string"==typeof this._buffer[0]?this._buffer.join(""):_t._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 Et{constructor(){this.promise=new Promise(((e,t)=>[this._resolver,this._rejecter]=[e,t]))}resolve(){this._resolver()}reject(e){this._rejecter(e)}}class St{static write(e){return`${e}${St.RecordSeparator}`}static parse(e){if(e[e.length-1]!==St.RecordSeparator)throw new Error("Message is incomplete.");const t=e.split(St.RecordSeparator);return t.pop(),t}}St.RecordSeparatorCode=30,St.RecordSeparator=String.fromCharCode(St.RecordSeparatorCode);class Ct{writeHandshakeRequest(e){return St.write(JSON.stringify(e))}parseHandshakeResponse(e){let t,n;if(nt(e)){const r=new Uint8Array(e),o=r.indexOf(St.RecordSeparatorCode);if(-1===o)throw new Error("Message is incomplete.");const i=o+1;t=String.fromCharCode.apply(null,Array.prototype.slice.call(r.slice(0,i))),n=r.byteLength>i?r.slice(i).buffer:null}else{const r=e,o=r.indexOf(St.RecordSeparator);if(-1===o)throw new Error("Message is incomplete.");const i=o+1;t=r.substring(0,i),n=r.length>i?r.substring(i):null}const r=St.parse(t),o=JSON.parse(r[0]);if(o.type)throw new Error("Expected a handshake response from the server.");return[n,o]}}!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"}(Ye||(Ye={}));class It{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 ot(this,e)}}!function(e){e.Disconnected="Disconnected",e.Connecting="Connecting",e.Connected="Connected",e.Disconnecting="Disconnecting",e.Reconnecting="Reconnecting"}(Ge||(Ge={}));class kt{constructor(e,t,n,r){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(Ve.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://docs.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},Ze.isRequired(e,"connection"),Ze.isRequired(t,"logger"),Ze.isRequired(n,"protocol"),this.serverTimeoutInMilliseconds=3e4,this.keepAliveIntervalInMilliseconds=15e3,this._logger=t,this._protocol=n,this.connection=e,this._reconnectPolicy=r,this._handshakeProtocol=new Ct,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=Ge.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:Ye.Ping})}static create(e,t,n,r){return new kt(e,t,n,r)}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!==Ge.Disconnected&&this._connectionState!==Ge.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!==Ge.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=Ge.Connecting,this._logger.log(Ve.Debug,"Starting HubConnection.");try{await this._startInternal(),et.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=Ge.Connected,this._connectionStarted=!0,this._logger.log(Ve.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=Ge.Disconnected,this._logger.log(Ve.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{const t={protocol:this._protocol.name,version:this._protocol.version};if(this._logger.log(Ve.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(t)),this._logger.log(Ve.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await e,this._stopDuringStartError)throw this._stopDuringStartError}catch(e){throw this._logger.log(Ve.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._stopPromise=this._stopInternal(),await this._stopPromise;try{await e}catch(e){}}_stopInternal(e){return this._connectionState===Ge.Disconnected?(this._logger.log(Ve.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve()):this._connectionState===Ge.Disconnecting?(this._logger.log(Ve.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState=Ge.Disconnecting,this._logger.log(Ve.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(Ve.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new Oe("The connection was stopped before the hub handshake could complete."),this.connection.stop(e)))}stream(e,...t){const[n,r]=this._replaceStreamingParams(t),o=this._createStreamInvocation(e,t,r);let i;const s=new It;return s.cancelCallback=()=>{const e=this._createCancelInvocation(o.invocationId);return delete this._callbacks[o.invocationId],i.then((()=>this._sendWithProtocol(e)))},this._callbacks[o.invocationId]=(e,t)=>{t?s.error(t):e&&(e.type===Ye.Completion?e.error?s.error(new Error(e.error)):s.complete():s.next(e.item))},i=this._sendWithProtocol(o).catch((e=>{s.error(e),delete this._callbacks[o.invocationId]})),this._launchStreams(n,i),s}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return 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===Ye.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)switch(e.type){case Ye.Invocation:this._invokeClientMethod(e);break;case Ye.StreamItem:case Ye.Completion:{const t=this._callbacks[e.invocationId];if(t){e.type===Ye.Completion&&delete this._callbacks[e.invocationId];try{t(e)}catch(e){this._logger.log(Ve.Error,`Stream callback threw error: ${ht(e)}`)}}break}case Ye.Ping:break;case Ye.Close:{this._logger.log(Ve.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}default:this._logger.log(Ve.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(Ve.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(Ve.Error,e);const n=new Error(e);throw this._handshakeRejecter(n),n}return this._logger.log(Ve.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===Ge.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(Ve.Warning,`No client method with the name '${t}' found.`),void(e.invocationId&&(this._logger.log(Ve.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 i,s,a;for(const n of r)try{const r=i;i=await n.apply(this,e.arguments),o&&i&&r&&(this._logger.log(Ve.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(Ve.Error,`A callback for the method '${t}' threw error '${e}'.`)}a?await this._sendWithProtocol(a):o?(s?a=this._createCompletionMessage(e.invocationId,`${s}`,null):void 0!==i?a=this._createCompletionMessage(e.invocationId,null,i):(this._logger.log(Ve.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(Ve.Error,`Result given for '${t}' method but server is not expecting a result.`)}_connectionClosed(e){this._logger.log(Ve.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new Oe("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===Ge.Disconnecting?this._completeClose(e):this._connectionState===Ge.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===Ge.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=Ge.Disconnected,this._connectionStarted=!1,et.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach((t=>t.apply(this,[e])))}catch(t){this._logger.log(Ve.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(Ve.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this._completeClose(e);if(this._connectionState=Ge.Reconnecting,e?this._logger.log(Ve.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(Ve.Information,"Connection reconnecting."),0!==this._reconnectingCallbacks.length){try{this._reconnectingCallbacks.forEach((t=>t.apply(this,[e])))}catch(t){this._logger.log(Ve.Error,`An onreconnecting callback called with error '${e}' threw error '${t}'.`)}if(this._connectionState!==Ge.Reconnecting)return void this._logger.log(Ve.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;null!==o;){if(this._logger.log(Ve.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!==Ge.Reconnecting)return void this._logger.log(Ve.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this._startInternal(),this._connectionState=Ge.Connected,this._logger.log(Ve.Information,"HubConnection reconnected successfully."),0!==this._reconnectedCallbacks.length)try{this._reconnectedCallbacks.forEach((e=>e.apply(this,[this.connection.connectionId])))}catch(e){this._logger.log(Ve.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${e}'.`)}return}catch(e){if(this._logger.log(Ve.Information,`Reconnect attempt failed because of error '${e}'.`),this._connectionState!==Ge.Reconnecting)return this._logger.log(Ve.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this._connectionState===Ge.Disconnecting&&this._completeClose());r=e instanceof Error?e:new Error(e.toString()),o=this._getNextRetryDelay(n++,Date.now()-t,r)}}this._logger.log(Ve.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(Ve.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(Ve.Error,`Stream 'error' callback called with '${e}' threw error: ${ht(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:Ye.Invocation}:{arguments:t,target:e,type:Ye.Invocation};{const n=this._invocationId;return this._invocationId++,0!==r.length?{arguments:t,invocationId:n.toString(),streamIds:r,target:e,type:Ye.Invocation}:{arguments:t,invocationId:n.toString(),target:e,type:Ye.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;r=55296&&o<=56319&&r65535&&(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 Ot,Ft=At?new TextDecoder:null,jt=At?"undefined"!=typeof process&&"force"!==process.env.TEXT_DECODER?200:0:Rt,Ht=function(e,t){this.type=e,this.data=t},Wt=(Ot=function(e,t){return Ot=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])},Ot(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}Ot(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),zt=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 Wt(t,e),t}(Error),Jt={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 i=n/4294967296,s=4294967295&n;return o=new Uint8Array(8),(t=new DataView(o.buffer)).setUint32(0,r<<2|3&i),t.setUint32(4,s),o}return o=new Uint8Array(12),(t=new DataView(o.buffer)).setUint32(0,r),Pt(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:Ut(t,4),nsec:t.getUint32(0)};default:throw new zt("Unrecognized data size for timestamp (expected 4, 8, or 12): "+e.length)}}(e);return new Date(1e3*t.sec+t.nsec/1e6)}},qt=function(){function e(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(Jt)}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 "+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: "+e+" bytes in UTF-8");this.writeU8(219),this.writeU32(e)}},e.prototype.encodeString=function(e){if(e.length>Bt){var t=Nt(e);this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),Lt(e,this.bytes,this.pos),this.pos+=t}else t=Nt(e),this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),function(e,t,n){for(var r=e.length,o=n,i=0;i>6&31|192;else{if(s>=55296&&s<=56319&&i>12&15|224,t[o++]=s>>6&63|128):(t[o++]=s>>18&7|240,t[o++]=s>>12&63|128,t[o++]=s>>6&63|128)}t[o++]=63&s|128}else t[o++]=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: "+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: "+t);this.writeU8(198),this.writeU32(t)}var n=Vt(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: "+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=Mt(e,t,n),i=Uint8Array.prototype.slice.call(e,t,t+n);return this.store(i,o),o},e}(),Gt=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[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,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]1||a(e,t)}))})}function a(e,t){try{(n=o[e](t)).value instanceof Zt?Promise.resolve(n.value.v).then(c,l):h(i[0][2],n)}catch(e){h(i[0][3],e)}var n}function c(e){a("next",e)}function l(e){a("throw",e)}function h(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}},tn=new DataView(new ArrayBuffer(0)),nn=new Uint8Array(tn.buffer),rn=function(){try{tn.getInt8(0)}catch(e){return e.constructor}throw new Error("never reached")}(),on=new rn("Insufficient data"),sn=new Yt,an=function(){function e(e,t,n,r,o,i,s,a){void 0===e&&(e=qt.defaultCodec),void 0===t&&(t=void 0),void 0===n&&(n=Rt),void 0===r&&(r=Rt),void 0===o&&(o=Rt),void 0===i&&(i=Rt),void 0===s&&(s=Rt),void 0===a&&(a=sn),this.extensionCodec=e,this.context=t,this.maxStrLength=n,this.maxBinLength=r,this.maxArrayLength=o,this.maxMapLength=i,this.maxExtLength=s,this.keyDecoder=a,this.totalPos=0,this.pos=0,this.view=tn,this.bytes=nn,this.headByte=-1,this.stack=[]}return e.prototype.reinitializeState=function(){this.totalPos=0,this.headByte=-1,this.stack.length=0},e.prototype.setBuffer=function(e){this.bytes=Vt(e),this.view=function(e){if(e instanceof ArrayBuffer)return new DataView(e);var t=Vt(e);return new DataView(t.buffer,t.byteOffset,t.byteLength)}(this.bytes),this.pos=0},e.prototype.appendBuffer=function(e){if(-1!==this.headByte||this.hasRemaining(1)){var t=this.bytes.subarray(this.pos),n=Vt(e),r=new Uint8Array(t.length+n.length);r.set(t),r.set(n,t.length),this.setBuffer(r)}else this.setBuffer(e)},e.prototype.hasRemaining=function(e){return this.view.byteLength-this.pos>=e},e.prototype.createExtraByteError=function(e){var t=this.view,n=this.pos;return new RangeError("Extra "+(t.byteLength-n)+" of "+t.byteLength+" byte(s) found at buffer["+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 Gt(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,i,s,a;return i=this,void 0,a=function(){var i,s,a,c,l,h,u,d;return Gt(this,(function(p){switch(p.label){case 0:i=!1,p.label=1;case 1:p.trys.push([1,6,7,12]),t=Qt(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 rn))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(i){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return[2,s]}throw h=(l=this).headByte,u=l.pos,d=l.totalPos,new RangeError("Insufficient data in parsing "+Xt(h)+" at "+d+" ("+u+" in the current buffer)")}}))},new((s=void 0)||(s=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 s?o:new s((function(e){e(o)}))).then(n,r)}o((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 en(this,arguments,(function(){var n,r,o,i,s,a,c,l,h;return Gt(this,(function(u){switch(u.label){case 0:n=t,r=-1,u.label=1;case 1:u.trys.push([1,13,14,19]),o=Qt(e),u.label=2;case 2:return[4,Zt(o.next())];case 3:if((i=u.sent()).done)return[3,12];if(s=i.value,t&&0===r)throw this.createExtraByteError(this.totalPos);this.appendBuffer(s),n&&(r=this.readArraySize(),n=!1,this.complete()),u.label=4;case 4:u.trys.push([4,9,,10]),u.label=5;case 5:return[4,Zt(this.doDecodeSync())];case 6:return[4,u.sent()];case 7:return u.sent(),0==--r?[3,8]:[3,5];case 8:return[3,10];case 9:if(!((a=u.sent())instanceof rn))throw a;return[3,10];case 10:this.totalPos+=this.pos,u.label=11;case 11:return[3,2];case 12:return[3,19];case 13:return c=u.sent(),l={error:c},[3,19];case 14:return u.trys.push([14,,17,18]),i&&!i.done&&(h=o.return)?[4,Zt(h.call(o))]:[3,16];case 15:u.sent(),u.label=16;case 16:return[3,18];case 17:if(l)throw l.error;return[7];case 18:return[7];case 19:return[2]}}))}))},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 zt("Unrecognized type byte: "+Xt(e));r=this.lookU32(),t=this.decodeExtension(r,4)}this.complete();for(var o=this.stack;o.length>0;){var i=o[o.length-1];if(0===i.type){if(i.array[i.position]=t,i.position++,i.position!==i.size)continue e;o.pop(),t=i.array}else{if(1===i.type){if("string"!=(s=typeof t)&&"number"!==s)throw new zt("The type of key must be string or number but "+typeof t);if("__proto__"===t)throw new zt("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}o.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 zt("Unrecognized array type byte: "+Xt(e))}},e.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw new zt("Max length exceeded: map length ("+e+") > maxMapLengthLength ("+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 zt("Max length exceeded: array length ("+e+") > maxArrayLength ("+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 zt("Max length exceeded: UTF-8 byte length ("+e+") > maxStrLength ("+this.maxStrLength+")");if(this.bytes.byteLengthjt?function(e,t,n){var r=e.subarray(t,t+n);return Ft.decode(r)}(this.bytes,o,e):Mt(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 zt("Max length exceeded: bin length ("+e+") > maxBinLength ("+this.maxBinLength+")");if(!this.hasRemaining(e+t))throw on;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 zt("Max length exceeded: ext length ("+e+") > maxExtLength ("+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=Ut(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 cn{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+s+a))throw new Error("Incomplete message.");t.push(n.slice?n.slice(o+s,o+s+a):n.subarray(o+s,o+s+a)),o=o+s+a}return t}}const ln=new Uint8Array([145,Ye.Ping]);class hn{constructor(e){this.name="messagepack",this.version=1,this.transferFormat=Xe.Binary,this._errorResult=1,this._voidResult=2,this._nonVoidResult=3,e=e||{},this._encoder=new Kt(e.extensionCodec,e.context,e.maxDepth,e.initialBufferSize,e.sortKeys,e.forceFloat32,e.ignoreUndefined,e.forceIntegerToFloat),this._decoder=new an(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=Qe.instance);const r=cn.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 Ye.Invocation:return this._writeInvocation(e);case Ye.StreamInvocation:return this._writeStreamInvocation(e);case Ye.StreamItem:return this._writeStreamItem(e);case Ye.Completion:return this._writeCompletion(e);case Ye.Ping:return cn.write(ln);case Ye.CancelInvocation:return this._writeCancelInvocation(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 Ye.Invocation:return this._createInvocationMessage(this._readHeaders(n),n);case Ye.StreamItem:return this._createStreamItemMessage(this._readHeaders(n),n);case Ye.Completion:return this._createCompletionMessage(this._readHeaders(n),n);case Ye.Ping:return this._createPingMessage(n);case Ye.Close:return this._createCloseMessage(n);default:return t.log(Ve.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:Ye.Close}}_createPingMessage(e){if(e.length<1)throw new Error("Invalid payload for Ping message.");return{type:Ye.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:Ye.Invocation}:{arguments:t[4],headers:e,streamIds:[],target:t[3],type:Ye.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:Ye.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:Ye.Completion}}_writeInvocation(e){let t;return t=e.streamIds?this._encoder.encode([Ye.Invocation,e.headers||{},e.invocationId||null,e.target,e.arguments,e.streamIds]):this._encoder.encode([Ye.Invocation,e.headers||{},e.invocationId||null,e.target,e.arguments]),cn.write(t.slice())}_writeStreamInvocation(e){let t;return t=e.streamIds?this._encoder.encode([Ye.StreamInvocation,e.headers||{},e.invocationId,e.target,e.arguments,e.streamIds]):this._encoder.encode([Ye.StreamInvocation,e.headers||{},e.invocationId,e.target,e.arguments]),cn.write(t.slice())}_writeStreamItem(e){const t=this._encoder.encode([Ye.StreamItem,e.headers||{},e.invocationId,e.item]);return cn.write(t.slice())}_writeCompletion(e){const t=e.error?this._errorResult:e.result?this._nonVoidResult:this._voidResult;let n;switch(t){case this._errorResult:n=this._encoder.encode([Ye.Completion,e.headers||{},e.invocationId,t,e.error]);break;case this._voidResult:n=this._encoder.encode([Ye.Completion,e.headers||{},e.invocationId,t]);break;case this._nonVoidResult:n=this._encoder.encode([Ye.Completion,e.headers||{},e.invocationId,t,e.result])}return cn.write(n.slice())}_writeCancelInvocation(e){const t=this._encoder.encode([Ye.CancelInvocation,e.headers||{},e.invocationId]);return cn.write(t.slice())}_readHeaders(e){const t=e[1];if("object"!=typeof t)throw new Error("Invalid headers.");return t}}let un=!1;function dn(){const e=document.querySelector("#blazor-error-ui");e&&(e.style.display="block"),un||(un=!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()}})))}const pn="function"==typeof TextDecoder?new TextDecoder("utf-8"):null,fn=pn?pn.decode.bind(pn):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("")},gn=Math.pow(2,32),mn=Math.pow(2,21)-1;function yn(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}function wn(e,t){return e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24>>>0)}function vn(e,t){const n=wn(e,t+4);if(n>mn)throw new Error(`Cannot read uint64 with high order part ${n}, because the result would exceed Number.MAX_SAFE_INTEGER.`);return n*gn+wn(e,t)}class bn{constructor(e){this.batchData=e;const t=new Cn(e);this.arrayRangeReader=new In(e),this.arrayBuilderSegmentReader=new kn(e),this.diffReader=new _n(e),this.editReader=new En(e,t),this.frameReader=new Sn(e,t)}updatedComponents(){return yn(this.batchData,this.batchData.length-20)}referenceFrames(){return yn(this.batchData,this.batchData.length-16)}disposedComponentIds(){return yn(this.batchData,this.batchData.length-12)}disposedEventHandlerIds(){return yn(this.batchData,this.batchData.length-8)}updatedComponentsEntry(e,t){const n=e+4*t;return yn(this.batchData,n)}referenceFramesEntry(e,t){return e+20*t}disposedComponentIdsEntry(e,t){const n=e+4*t;return yn(this.batchData,n)}disposedEventHandlerIdsEntry(e,t){const n=e+8*t;return vn(this.batchData,n)}}class _n{constructor(e){this.batchDataUint8=e}componentId(e){return yn(this.batchDataUint8,e)}edits(e){return e+4}editsEntry(e,t){return e+16*t}}class En{constructor(e,t){this.batchDataUint8=e,this.stringReader=t}editType(e){return yn(this.batchDataUint8,e)}siblingIndex(e){return yn(this.batchDataUint8,e+4)}newTreeIndex(e){return yn(this.batchDataUint8,e+8)}moveToSiblingIndex(e){return yn(this.batchDataUint8,e+8)}removedAttributeName(e){const t=yn(this.batchDataUint8,e+12);return this.stringReader.readString(t)}}class Sn{constructor(e,t){this.batchDataUint8=e,this.stringReader=t}frameType(e){return yn(this.batchDataUint8,e)}subtreeLength(e){return yn(this.batchDataUint8,e+4)}elementReferenceCaptureId(e){const t=yn(this.batchDataUint8,e+4);return this.stringReader.readString(t)}componentId(e){return yn(this.batchDataUint8,e+8)}elementName(e){const t=yn(this.batchDataUint8,e+8);return this.stringReader.readString(t)}textContent(e){const t=yn(this.batchDataUint8,e+4);return this.stringReader.readString(t)}markupContent(e){const t=yn(this.batchDataUint8,e+4);return this.stringReader.readString(t)}attributeName(e){const t=yn(this.batchDataUint8,e+4);return this.stringReader.readString(t)}attributeValue(e){const t=yn(this.batchDataUint8,e+8);return this.stringReader.readString(t)}attributeEventHandlerId(e){return vn(this.batchDataUint8,e+12)}}class Cn{constructor(e){this.batchDataUint8=e,this.stringTableStartIndex=yn(e,e.length-4)}readString(e){if(-1===e)return null;{const n=yn(this.batchDataUint8,this.stringTableStartIndex+4*e),r=function(e,t){let n=0,r=0;for(let o=0;o<4;o++){const i=e[t+o];if(n|=(127&i)<this.nextBatchId)return this.fatalError?(this.logger.log(Tn.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(Tn.Debug,`Waiting for batch ${this.nextBatchId}. Batch ${e} not processed.`);try{this.nextBatchId++,this.logger.log(Tn.Debug,`Applying batch ${e}.`),function(e,t){const n=de[e];if(!n)throw new Error(`There is no browser renderer with ID ${e}.`);const r=t.arrayRangeReader,o=t.updatedComponents(),i=r.values(o),s=r.count(o),a=t.referenceFrames(),c=r.values(a),l=t.diffReader;for(let e=0;e=this.minLevel){const n=`[${(new Date).toISOString()}] ${Tn[e]}: ${t}`;switch(e){case Tn.Critical:case Tn.Error:console.error(n);break;case Tn.Warning:console.warn(n);break;case Tn.Information:console.info(n);break;default:console.log(n)}}}}class Pn{constructor(e,t){this.circuitId=void 0,this.components=e,this.applicationState=t}reconnect(e){if(!this.circuitId)throw new Error("Circuit host not initialized.");return e.state!==Ge.Connected?Promise.resolve(!1):e.invoke("ConnectCircuit",this.circuitId)}initialize(e){if(this.circuitId)throw new Error(`Circuit host '${this.circuitId}' already initialized.`);this.circuitId=e}async startCircuit(e){if(e.state!==Ge.Connected)return!1;const t=await e.invoke("StartCircuit",ye.getBaseURI(),ye.getLocationHref(),JSON.stringify(this.components.map((e=>e.toRecord()))),this.applicationState||"");return!!t&&(this.initialize(t),!0)}resolveElement(e){const t=function(e){const t=f.get(e);if(t)return f.delete(e),t}(e);if(t)return M(t,!0);const n=Number.parseInt(e);if(!Number.isNaN(n))return function(e,t){if(!e.parentNode)throw new Error(`Comment not connected to the DOM ${e.textContent}`);const n=e.parentNode,r=M(n,!0),o=J(r);return Array.from(n.childNodes).forEach((e=>o.push(e))),e[B]=r,t&&(e[L]=t,M(t)),M(e)}(this.components[n].start,this.components[n].end);throw new Error(`Invalid sequence number or identifier '${e}'.`)}}const Un={configureSignalR:e=>{},logLevel:Tn.Warning,reconnectionOptions:{maxRetries:8,retryIntervalMilliseconds:2e4,dialogId:"components-reconnect-modal"}};class An{constructor(e,t,n,r){this.maxRetries=t,this.document=n,this.logger=r,this.addedToDom=!1,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 Ne.reconnect()||this.rejected()}catch(e){this.logger.log(Tn.Error,e),this.failed()}}))}show(){this.addedToDom||(this.addedToDom=!0,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 Nn{constructor(e,t,n){this.dialog=e,this.maxRetries=t,this.document=n,this.document=n;const r=this.document.getElementById(Nn.MaxRetriesId);r&&(r.innerText=this.maxRetries.toString())}show(){this.removeClasses(),this.dialog.classList.add(Nn.ShowClassName)}update(e){const t=this.document.getElementById(Nn.CurrentAttemptId);t&&(t.innerText=e.toString())}hide(){this.removeClasses(),this.dialog.classList.add(Nn.HideClassName)}failed(){this.removeClasses(),this.dialog.classList.add(Nn.FailedClassName)}rejected(){this.removeClasses(),this.dialog.classList.add(Nn.RejectedClassName)}removeClasses(){this.dialog.classList.remove(Nn.ShowClassName,Nn.HideClassName,Nn.FailedClassName,Nn.RejectedClassName)}}Nn.ShowClassName="components-reconnect-show",Nn.HideClassName="components-reconnect-hide",Nn.FailedClassName="components-reconnect-failed",Nn.RejectedClassName="components-reconnect-rejected",Nn.MaxRetriesId="components-reconnect-max-retries",Nn.CurrentAttemptId="components-reconnect-current-attempt";class $n{constructor(e,t,n){this._currentReconnectionProcess=null,this._logger=e,this._reconnectionDisplay=t,this._reconnectCallback=n||Ne.reconnect}onConnectionDown(e,t){if(!this._reconnectionDisplay){const t=document.getElementById(e.dialogId);this._reconnectionDisplay=t?new Nn(t,e.maxRetries,document):new An(e.dialogId,e.maxRetries,document,this._logger)}this._currentReconnectionProcess||(this._currentReconnectionProcess=new Bn(e,this._logger,this._reconnectCallback,this._reconnectionDisplay))}onConnectionUp(){this._currentReconnectionProcess&&(this._currentReconnectionProcess.dispose(),this._currentReconnectionProcess=null)}}class Bn{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;tBn.MaximumFirstRetryInterval?Bn.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(Tn.Error,e)}}this.reconnectDisplay.failed()}delay(e){return new Promise((t=>setTimeout(t,e)))}}Bn.MaximumFirstRetryInterval=3e3;const Ln=/^\s*Blazor-Component-State:(?[a-zA-Z0-9+/=]+)$/;function Mn(e){var t;if(e.nodeType===Node.COMMENT_NODE){const n=e.textContent||"",r=Ln.exec(n),o=r&&r.groups&&r.groups.state;return o&&(null===(t=e.parentNode)||void 0===t||t.removeChild(e)),o}if(!e.hasChildNodes())return;const n=e.childNodes;for(let e=0;e.*)$/);function jn(e,t){const n=e.currentElement;if(n&&n.nodeType===Node.COMMENT_NODE&&n.textContent){const r=Fn.exec(n.textContent),o=r&&r.groups&&r.groups.descriptor;if(!o)return;try{const r=function(e){const t=JSON.parse(e),{type:n}=t;if("server"!==n&&"webassembly"!==n)throw new Error(`Invalid component type '${n}'.`);return t}(o);switch(t){case"webassembly":return function(e,t,n){const{type:r,assembly:o,typeName:i,parameterDefinitions:s,parameterValues:a,prerenderId:c}=e;if("webassembly"===r){if(!o)throw new Error("assembly must be defined when using a descriptor.");if(!i)throw new Error("typeName must be defined when using a descriptor.");if(c){const e=Hn(c,n);if(!e)throw new Error(`Could not find an end component comment for '${t}'`);return{type:r,assembly:o,typeName:i,parameterDefinitions:s&&atob(s),parameterValues:a&&atob(a),start:t,prerenderId:c,end:e}}return{type:r,assembly:o,typeName:i,parameterDefinitions:s&&atob(s),parameterValues:a&&atob(a),start:t}}}(r,n,e);case"server":return function(e,t,n){const{type:r,descriptor:o,sequence:i,prerenderId:s}=e;if("server"===r){if(!o)throw new Error("descriptor must be defined when using a descriptor.");if(void 0===i)throw new Error("sequence must be defined when using a descriptor.");if(!Number.isInteger(i))throw new Error(`Error parsing the sequence '${i}' for component '${JSON.stringify(e)}'`);if(s){const e=Hn(s,n);if(!e)throw new Error(`Could not find an end component comment for '${t}'`);return{type:r,sequence:i,descriptor:o,start:t,prerenderId:s,end:e}}return{type:r,sequence:i,descriptor:o,start:t}}}(r,n,e)}}catch(e){throw new Error(`Found malformed component comment at ${n.textContent}`)}}}function Hn(e,t){for(;t.next()&&t.currentElement;){const n=t.currentElement;if(n.nodeType!==Node.COMMENT_NODE)continue;if(!n.textContent)continue;const r=Fn.exec(n.textContent),o=r&&r[1];if(o)return Wn(o,e),n}}function Wn(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 zn{constructor(e){this.childNodes=e,this.currentIndex=-1,this.length=e.length}next(){return this.currentIndex++,this.currentIndexasync 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)return;const{beforeStart:i,afterStarted:s}=o;return s&&e.afterStartedCallbacks.push(s),i?i(...t):void 0}(this,e))))}async invokeAfterStartedCallbacks(e){await C,await Promise.all(this.afterStartedCallbacks.map((t=>t(e))))}}let Kn,Xn=!1,Yn=!1;async function Gn(e){if(Yn)throw new Error("Blazor has already started.");Yn=!0;const t=function(e){const t={...Un,...e};return e&&e.reconnectionOptions&&(t.reconnectionOptions={...Un.reconnectionOptions,...e.reconnectionOptions}),t}(e),n=await async function(e){const t=await fetch("_blazor/initializers",{method:"GET",credentials:"include",cache:"no-cache"}),n=await t.json(),r=new Vn;return await r.importInitializersAsync(n,[e]),r}(t),r=new Rn(t.logLevel);Ne.reconnect=async e=>{if(Xn)return!1;const n=e||await Qn(t,r,s);return await s.reconnect(n)?(t.reconnectionHandler.onConnectionUp(),!0):(r.log(Tn.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)},Ne.defaultReconnectionHandler=new $n(r),t.reconnectionHandler=t.reconnectionHandler||Ne.defaultReconnectionHandler,r.log(Tn.Information,"Starting up Blazor server-side application.");const o=function(e,t){return function(e){const t=On(e,"server"),n=[];for(let e=0;ee.sequence-t.sequence))}(e)}(document),i=Mn(document),s=new Pn(o,i||"");Ne._internal.navigationManager.listenForNavigationEvents(((e,t)=>Kn.send("OnLocationChanged",e,t))),Ne._internal.forceCloseConnection=()=>Kn.stop(),Ne._internal.sendJSDataStream=(e,t,n)=>function(e,t,n,r){setTimeout((async()=>{let o=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(),r=t-i;i=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)}(Kn,e,t,n);const a=await Qn(t,r,s);if(!await s.startCircuit(a))return void r.log(Tn.Error,"Failed to start the circuit.");let c=!1;const l=()=>{if(!c){const e=new FormData,t=s.circuitId;e.append("circuitId",t),c=navigator.sendBeacon("_blazor/disconnect",e)}};Ne.disconnect=l,window.addEventListener("unload",l,{capture:!1,once:!0}),r.log(Tn.Information,"Blazor server-side application started."),n.invokeAfterStartedCallbacks(Ne)}async function Qn(t,n,r){var o,i;const s=new hn;s.name="blazorpack";const a=(new Dt).withUrl("_blazor").withHubProtocol(s);t.configureSignalR(a);const c=a.build();c.on("JS.AttachComponent",((e,t)=>function(e,t,n,r){let o=de[0];o||(o=new se(0),de[0]=o),o.attachRootComponentToLogicalElement(n,t,!1)}(0,r.resolveElement(t),e))),c.on("JS.BeginInvokeJS",e.jsCallDispatcher.beginInvokeJSFromDotNet),c.on("JS.EndInvokeDotNet",e.jsCallDispatcher.endInvokeDotNetFromJS),c.on("JS.ReceiveByteArray",e.jsCallDispatcher.receiveByteArray),c.on("JS.BeginTransmitStream",(t=>{const n=new ReadableStream({start(e){c.stream("SendDotNetStreamToJS",t).subscribe({next:t=>e.enqueue(t),complete:()=>e.close(),error:t=>e.error(t)})}});e.jsCallDispatcher.supplyDotNetStream(t,n)}));const l=xn.getOrCreate(n);c.on("JS.RenderBatch",((e,t)=>{n.log(Tn.Debug,`Received render batch with id ${e} and ${t.byteLength} bytes.`),l.processBatch(e,t,c)})),c.onclose((e=>!Xn&&t.reconnectionHandler.onConnectionDown(t.reconnectionOptions,e))),c.on("JS.Error",(e=>{Xn=!0,Zn(c,e,n),dn()}));try{await c.start(),Kn=c}catch(e){if(Zn(c,e,n),"FailedToNegotiateWithServerError"===e.errorType)throw e;dn(),e.innerErrors&&(e.innerErrors.some((e=>"UnsupportedTransportError"===e.errorType&&e.transport===Ke.WebSockets))?n.log(Tn.Error,"Unable to connect, please ensure you are using an updated browser that supports WebSockets."):e.innerErrors.some((e=>"FailedToStartTransportError"===e.errorType&&e.transport===Ke.WebSockets))?n.log(Tn.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===Ke.LongPolling))&&n.log(Tn.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===(i=null===(o=c.connection)||void 0===o?void 0:o.features)||void 0===i?void 0:i.inherentKeepAlive)&&n.log(Tn.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."),e.attachDispatcher({beginInvokeDotNetFromJS:(e,t,n,r,o)=>{c.send("BeginInvokeDotNetFromJS",e?e.toString():null,t,n,r||0,o)},endInvokeJSFromDotNet:(e,t,n)=>{c.send("EndInvokeJSFromDotNet",e,t,n)},sendByteArray:(e,t)=>{c.send("ReceiveByteArray",e,t)}}),c}function Zn(e,t,n){n.log(Tn.Error,t),e&&e.stop()}Ne.start=Gn,document&&document.currentScript&&"false"!==document.currentScript.getAttribute("autostart")&&Gn()})(); \ No newline at end of file +(()=>{"use strict";var t,e,n,i={};i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),function(t){window.DotNet=t;const e=[],n=new Map,i=new Map,r="__jsObjectId",s="__byte[]";class o{constructor(t){this.t=t,this.i=new Map}findFunction(t){const e=this.i.get(t);if(e)return e;let n,i=this.t;if(t.split(".").forEach((e=>{if(!(e in i))throw new Error(`Could not find '${t}' ('${e}' was undefined).`);n=i,i=i[e]})),i instanceof Function)return i=i.bind(n),this.i.set(t,i),i;throw new Error(`The value '${t}' is not a function.`)}getWrappedObject(){return this.t}}const c={},a={0:new o(window)};a[0].i.set("import",(t=>("string"==typeof t&&t.startsWith("./")&&(t=document.baseURI+t.substr(2)),import(t))));let h,u=1,l=1,f=null;function d(t){e.push(t)}function w(t){if(t&&"object"==typeof t){a[l]=new o(t);const e={[r]:l};return l++,e}throw new Error(`Cannot create a JSObjectReference from the value '${t}'.`)}function p(t){let e=-1;if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t instanceof Blob)e=t.size;else{if(!(t.buffer instanceof ArrayBuffer))throw new Error("Supplied value is not a typed array or blob.");if(void 0===t.byteLength)throw new Error(`Cannot create a JSStreamReference from the value '${t}' as it doesn't have a byteLength.`);e=t.byteLength}const n={o:e};try{const e=w(t);n.h=e.h}catch(e){throw new Error(`Cannot create a JSStreamReference from the value '${t}'.`)}return n}function m(t){return t?JSON.parse(t,((t,n)=>e.reduce(((e,n)=>n(t,e)),n))):null}function v(t,e,n,i){const r=y();if(r.invokeDotNetFromJS){const s=_(i),o=r.invokeDotNetFromJS(t,e,n,s);return o?m(o):null}throw new Error("The current dispatcher does not support synchronous calls from JS to .NET. Use invokeMethodAsync instead.")}function g(t,e,n,i){if(t&&n)throw new Error(`For instance method calls, assemblyName should be null. Received '${t}'.`);const r=u++,s=new Promise(((t,e)=>{c[r]={resolve:t,reject:e}}));try{const s=_(i);y().beginInvokeDotNetFromJS(r,t,e,n,s)}catch(t){b(r,!1,t)}return s}function y(){if(null!==f)return f;throw new Error("No .NET call dispatcher has been set.")}function b(t,e,n){if(!c.hasOwnProperty(t))throw new Error(`There is no pending async call with ID ${t}.`);const i=c[t];delete c[t],e?i.resolve(n):i.reject(n)}function E(t){return t instanceof Error?`${t.message}\n${t.stack}`:t?t.toString():"null"}function S(t,e){const n=a[e];if(n)return n.findFunction(t);throw new Error(`JS object instance with ID ${e} does not exist (has it been disposed?).`)}function $(t){delete a[t]}t.attachDispatcher=function(t){f=t},t.attachReviver=d,t.invokeMethod=function(t,e,...n){return v(t,e,null,n)},t.invokeMethodAsync=function(t,e,...n){return g(t,e,null,n)},t.createJSObjectReference=w,t.createJSStreamReference=p,t.disposeJSObjectReference=function(t){const e=t&&t.h;"number"==typeof e&&$(e)},function(t){t[t.Default=0]="Default",t[t.JSObjectReference=1]="JSObjectReference",t[t.JSStreamReference=2]="JSStreamReference",t[t.JSVoidResult=3]="JSVoidResult"}(h=t.JSCallResultType||(t.JSCallResultType={})),t.jsCallDispatcher={findJSFunction:S,disposeJSObjectReferenceById:$,invokeJSFromDotNet:(t,e,n,i)=>{const r=I(S(t,i).apply(null,m(e)),n);return null==r?null:_(r)},beginInvokeJSFromDotNet:(t,e,n,i,r)=>{const s=new Promise((t=>{t(S(e,r).apply(null,m(n)))}));t&&s.then((e=>_([t,!0,I(e,i)]))).then((e=>y().endInvokeJSFromDotNet(t,!0,e)),(e=>y().endInvokeJSFromDotNet(t,!1,JSON.stringify([t,!1,E(e)]))))},endInvokeDotNetFromJS:(t,e,n)=>{const i=e?m(n):new Error(n);b(parseInt(t,10),e,i)},receiveByteArray:(t,e)=>{n.set(t,e)},supplyDotNetStream:(t,e)=>{if(i.has(t)){const n=i.get(t);i.delete(t),n.resolve(e)}else{const n=new T;n.resolve(e),i.set(t,n)}}};class C{constructor(t){this.u=t}invokeMethod(t,...e){return v(null,t,this.u,e)}invokeMethodAsync(t,...e){return g(null,t,this.u,e)}dispose(){g(null,"__Dispose",this.u,null).catch((t=>console.error(t)))}serializeAsArg(){return{l:this.u}}}t.DotNetObject=C,d((function(t,e){if(e&&"object"==typeof e){if(e.hasOwnProperty("__dotNetObject"))return new C(e.l);if(e.hasOwnProperty(r)){const t=e.h,n=a[t];if(n)return n.getWrappedObject();throw new Error(`JS object instance with Id '${t}' does not exist. It may have been disposed.`)}if(e.hasOwnProperty(s)){const t=e["p"],i=n.get(t);if(void 0===i)throw new Error(`Byte array index '${t}' does not exist.`);return n.delete(t),i}if(e.hasOwnProperty("__dotNetStream"))return new k(e.m)}return e}));class k{constructor(t){if(i.has(t))this.S=i.get(t).streamPromise,i.delete(t);else{const e=new T;i.set(t,e),this.S=e.streamPromise}}stream(){return this.S}async arrayBuffer(){return new Response(await this.stream()).arrayBuffer()}}class T{constructor(){this.streamPromise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}}function I(t,e){switch(e){case h.Default:return t;case h.JSObjectReference:return w(t);case h.JSStreamReference:return p(t);case h.JSVoidResult:return null;default:throw new Error(`Invalid JS call result type '${e}'.`)}}let A=0;function _(t){return A=0,JSON.stringify(t,P)}function P(t,e){if(e instanceof C)return e.serializeAsArg();if(e instanceof Uint8Array){f.sendByteArray(A,e);const t={[s]:A};return A++,t}return e}}(t||(t={})),function(t){t[t.prependFrame=1]="prependFrame",t[t.removeFrame=2]="removeFrame",t[t.setAttribute=3]="setAttribute",t[t.removeAttribute=4]="removeAttribute",t[t.updateText=5]="updateText",t[t.stepIn=6]="stepIn",t[t.stepOut=7]="stepOut",t[t.updateMarkup=8]="updateMarkup",t[t.permutationListEntry=9]="permutationListEntry",t[t.permutationListEnd=10]="permutationListEnd"}(e||(e={})),function(t){t[t.element=1]="element",t[t.text=2]="text",t[t.attribute=3]="attribute",t[t.component=4]="component",t[t.region=5]="region",t[t.elementReferenceCapture=6]="elementReferenceCapture",t[t.markup=8]="markup"}(n||(n={}));class r{constructor(t,e){this.componentId=t,this.fieldValue=e}static fromEvent(t,e){const n=e.target;if(n instanceof Element){const e=function(t){return t instanceof HTMLInputElement?t.type&&"checkbox"===t.type.toLowerCase()?{value:t.checked}:{value:t.value}:t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement?{value:t.value}:null}(n);if(e)return new r(t,e.value)}return null}}const s=new Map,o=new Map,c=[];function a(t){return s.get(t)}function h(t){const e=s.get(t);return(null==e?void 0:e.browserEventName)||t}function u(t,e){t.forEach((t=>s.set(t,e)))}function l(t){const e=[];for(let n=0;nt.selected)).map((t=>t.value))}}{const t=function(t){return!!t&&"INPUT"===t.tagName&&"checkbox"===t.getAttribute("type")}(e);return{value:t?!!e.checked:e.value}}}}),u(["copy","cut","paste"],{createEventArgs:t=>({type:t.type})}),u(["drag","dragend","dragenter","dragleave","dragover","dragstart","drop"],{createEventArgs:t=>{return{...f(e=t),dataTransfer:e.dataTransfer?{dropEffect:e.dataTransfer.dropEffect,effectAllowed:e.dataTransfer.effectAllowed,files:Array.from(e.dataTransfer.files).map((t=>t.name)),items:Array.from(e.dataTransfer.items).map((t=>({kind:t.kind,type:t.type}))),types:e.dataTransfer.types}:null};var e}}),u(["focus","blur","focusin","focusout"],{createEventArgs:t=>({type:t.type})}),u(["keydown","keyup","keypress"],{createEventArgs:t=>{return{key:(e=t).key,code:e.code,location:e.location,repeat:e.repeat,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,type:e.type};var e}}),u(["contextmenu","click","mouseover","mouseout","mousemove","mousedown","mouseup","mouseleave","mouseenter","dblclick"],{createEventArgs:t=>f(t)}),u(["error"],{createEventArgs:t=>{return{message:(e=t).message,filename:e.filename,lineno:e.lineno,colno:e.colno,type:e.type};var e}}),u(["loadstart","timeout","abort","load","loadend","progress"],{createEventArgs:t=>{return{lengthComputable:(e=t).lengthComputable,loaded:e.loaded,total:e.total,type:e.type};var e}}),u(["touchcancel","touchend","touchmove","touchenter","touchleave","touchstart"],{createEventArgs:t=>{return{detail:(e=t).detail,touches:l(e.touches),targetTouches:l(e.targetTouches),changedTouches:l(e.changedTouches),ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,type:e.type};var e}}),u(["gotpointercapture","lostpointercapture","pointercancel","pointerdown","pointerenter","pointerleave","pointermove","pointerout","pointerover","pointerup"],{createEventArgs:t=>{return{...f(e=t),pointerId:e.pointerId,width:e.width,height:e.height,pressure:e.pressure,tiltX:e.tiltX,tiltY:e.tiltY,pointerType:e.pointerType,isPrimary:e.isPrimary};var e}}),u(["wheel","mousewheel"],{createEventArgs:t=>{return{...f(e=t),deltaX:e.deltaX,deltaY:e.deltaY,deltaZ:e.deltaZ,deltaMode:e.deltaMode};var e}}),u(["toggle"],{createEventArgs:()=>({})});const d=["date","datetime-local","month","time","week"],w=new Map;let p,m,v=0;const g={async add(t,e,n){if(!n)throw new Error("initialParameters must be an object, even if empty.");const i="__bl-dynamic-root:"+(++v).toString();w.set(i,t);const r=await E().invokeMethodAsync("AddRootComponent",e,i),s=new b(r,m[e]);return await s.setParameters(n),s}};class y{invoke(t){return this.$(t)}setCallback(e){this.C||(this.C=t.createJSObjectReference(this)),this.$=e}getJSObjectReference(){return this.C}dispose(){this.C&&t.disposeJSObjectReference(this.C)}}class b{constructor(t,e){this.k=new Map,this.T=t;for(const t of e)"eventcallback"===t.type&&this.k.set(t.name.toLowerCase(),new y)}setParameters(t){const e={},n=Object.entries(t||{}),i=n.length;for(const[t,i]of n){const n=this.k.get(t.toLowerCase());n&&i?(n.setCallback(i),e[t]=n.getJSObjectReference()):e[t]=i}return E().invokeMethodAsync("SetRootComponentParameters",this.T,i,e)}async dispose(){if(null!==this.T){await E().invokeMethodAsync("RemoveRootComponent",this.T),this.T=null;for(const t of this.k.values())t.dispose()}}}function E(){if(!p)throw new Error("Dynamic root components have not been enabled in this application.");return p}const S=new Map;let $;const C=new Promise((t=>{$=t}));function k(t,e,n){return I(t,e.eventHandlerId,(()=>T(t).invokeMethodAsync("DispatchEventAsync",e,n)))}function T(t){const e=S.get(t);if(!e)throw new Error(`No interop methods are registered for renderer ${t}`);return e}let I=(t,e,n)=>n();const A=M(["abort","blur","canplay","canplaythrough","change","cuechange","durationchange","emptied","ended","error","focus","load","loadeddata","loadedmetadata","loadend","loadstart","mouseenter","mouseleave","pause","play","playing","progress","ratechange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeupdate","toggle","unload","volumechange","waiting","DOMNodeInsertedIntoDocument","DOMNodeRemovedFromDocument"]),_={submit:!0},P=M(["click","dblclick","mousedown","mousemove","mouseup"]);class x{constructor(t){this.browserRendererId=t,this.afterClickCallbacks=[];const e=++x.nextEventDelegatorId;this.eventsCollectionKey=`_blazorEvents_${e}`,this.eventInfoStore=new D(this.onGlobalEvent.bind(this))}setListener(t,e,n,i){const r=this.getEventHandlerInfosForElement(t,!0),s=r.getHandler(e);if(s)this.eventInfoStore.update(s.eventHandlerId,n);else{const s={element:t,eventName:e,eventHandlerId:n,renderingComponentId:i};this.eventInfoStore.add(s),r.setHandler(e,s)}}getHandler(t){return this.eventInfoStore.get(t)}removeListener(t){const e=this.eventInfoStore.remove(t);if(e){const t=e.element,n=this.getEventHandlerInfosForElement(t,!1);n&&n.removeHandler(e.eventName)}}notifyAfterClick(t){this.afterClickCallbacks.push(t),this.eventInfoStore.addGlobalListener("click")}setStopPropagation(t,e,n){this.getEventHandlerInfosForElement(t,!0).stopPropagation(e,n)}setPreventDefault(t,e,n){this.getEventHandlerInfosForElement(t,!0).preventDefault(e,n)}onGlobalEvent(t){if(!(t.target instanceof Element))return;this.dispatchGlobalEventToAllElements(t.type,t);const e=(n=t.type,o.get(n));var n;e&&e.forEach((e=>this.dispatchGlobalEventToAllElements(e,t))),"click"===t.type&&this.afterClickCallbacks.forEach((e=>e(t)))}dispatchGlobalEventToAllElements(t,e){const n=e.composedPath();let i=n.shift(),s=null,o=!1;const c=Object.prototype.hasOwnProperty.call(A,t);let h=!1;for(;i;){const f=i,d=this.getEventHandlerInfosForElement(f,!1);if(d){const n=d.getHandler(t);if(n&&(u=f,l=e.type,!((u instanceof HTMLButtonElement||u instanceof HTMLInputElement||u instanceof HTMLTextAreaElement||u instanceof HTMLSelectElement)&&Object.prototype.hasOwnProperty.call(P,l)&&u.disabled))){if(!o){const n=a(t);s=(null==n?void 0:n.createEventArgs)?n.createEventArgs(e):{},o=!0}Object.prototype.hasOwnProperty.call(_,e.type)&&e.preventDefault(),k(this.browserRendererId,{eventHandlerId:n.eventHandlerId,eventName:t,eventFieldInfo:r.fromEvent(n.renderingComponentId,e)},s)}d.stopPropagation(t)&&(h=!0),d.preventDefault(t)&&e.preventDefault()}i=c||h?void 0:n.shift()}var u,l}getEventHandlerInfosForElement(t,e){return Object.prototype.hasOwnProperty.call(t,this.eventsCollectionKey)?t[this.eventsCollectionKey]:e?t[this.eventsCollectionKey]=new N:null}}x.nextEventDelegatorId=0;class D{constructor(t){this.globalListener=t,this.infosByEventHandlerId={},this.countByEventName={},c.push(this.handleEventNameAliasAdded.bind(this))}add(t){if(this.infosByEventHandlerId[t.eventHandlerId])throw new Error(`Event ${t.eventHandlerId} is already tracked`);this.infosByEventHandlerId[t.eventHandlerId]=t,this.addGlobalListener(t.eventName)}get(t){return this.infosByEventHandlerId[t]}addGlobalListener(t){if(t=h(t),Object.prototype.hasOwnProperty.call(this.countByEventName,t))this.countByEventName[t]++;else{this.countByEventName[t]=1;const e=Object.prototype.hasOwnProperty.call(A,t);document.addEventListener(t,this.globalListener,e)}}update(t,e){if(Object.prototype.hasOwnProperty.call(this.infosByEventHandlerId,e))throw new Error(`Event ${e} is already tracked`);const n=this.infosByEventHandlerId[t];delete this.infosByEventHandlerId[t],n.eventHandlerId=e,this.infosByEventHandlerId[e]=n}remove(t){const e=this.infosByEventHandlerId[t];if(e){delete this.infosByEventHandlerId[t];const n=h(e.eventName);0==--this.countByEventName[n]&&(delete this.countByEventName[n],document.removeEventListener(n,this.globalListener))}return e}handleEventNameAliasAdded(t,e){if(Object.prototype.hasOwnProperty.call(this.countByEventName,t)){const n=this.countByEventName[t];delete this.countByEventName[t],document.removeEventListener(t,this.globalListener),this.addGlobalListener(e),this.countByEventName[e]+=n-1}}}class N{constructor(){this.handlers={},this.preventDefaultFlags=null,this.stopPropagationFlags=null}getHandler(t){return Object.prototype.hasOwnProperty.call(this.handlers,t)?this.handlers[t]:null}setHandler(t,e){this.handlers[t]=e}removeHandler(t){delete this.handlers[t]}preventDefault(t,e){return void 0!==e&&(this.preventDefaultFlags=this.preventDefaultFlags||{},this.preventDefaultFlags[t]=e),!!this.preventDefaultFlags&&this.preventDefaultFlags[t]}stopPropagation(t,e){return void 0!==e&&(this.stopPropagationFlags=this.stopPropagationFlags||{},this.stopPropagationFlags[t]=e),!!this.stopPropagationFlags&&this.stopPropagationFlags[t]}}function M(t){const e={};return t.forEach((t=>{e[t]=!0})),e}const R=Y("_blazorLogicalChildren"),U=Y("_blazorLogicalParent"),H=Y("_blazorLogicalEnd");function L(t,e){if(t.childNodes.length>0&&!e)throw new Error("New logical elements must start empty, or allowExistingContents must be true");return R in t||(t[R]=[]),t}function O(t,e){const n=document.createComment("!");return j(n,t,e),n}function j(t,e,n){const i=t;if(t instanceof Comment&&W(i)&&W(i).length>0)throw new Error("Not implemented: inserting non-empty logical container");if(F(i))throw new Error("Not implemented: moving existing logical children");const r=W(e);if(n0;)B(n,0)}const i=n;i.parentNode.removeChild(i)}function F(t){return t[U]||null}function J(t,e){return W(t)[e]}function z(t){const e=V(t);return"http://www.w3.org/2000/svg"===e.namespaceURI&&"foreignObject"!==e.tagName}function W(t){return t[R]}function q(t,e){const n=W(t);e.forEach((t=>{t.moveRangeStart=n[t.fromSiblingIndex],t.moveRangeEnd=G(t.moveRangeStart)})),e.forEach((e=>{const i=document.createComment("marker");e.moveToBeforeMarker=i;const r=n[e.toSiblingIndex+1];r?r.parentNode.insertBefore(i,r):K(i,t)})),e.forEach((t=>{const e=t.moveToBeforeMarker,n=e.parentNode,i=t.moveRangeStart,r=t.moveRangeEnd;let s=i;for(;s;){const t=s.nextSibling;if(n.insertBefore(s,e),s===r)break;s=t}n.removeChild(e)})),e.forEach((t=>{n[t.toSiblingIndex]=t.moveRangeStart}))}function V(t){if(t instanceof Element||t instanceof DocumentFragment)return t;if(t instanceof Comment)return t.parentNode;throw new Error("Not a valid logical element")}function X(t){const e=W(F(t));return e[Array.prototype.indexOf.call(e,t)+1]||null}function K(t,e){if(e instanceof Element||e instanceof DocumentFragment)e.appendChild(t);else{if(!(e instanceof Comment))throw new Error(`Cannot append node because the parent is not a valid logical element. Parent: ${e}`);{const n=X(e);n?n.parentNode.insertBefore(t,n):K(t,F(e))}}}function G(t){if(t instanceof Element||t instanceof DocumentFragment)return t;const e=X(t);if(e)return e.previousSibling;{const e=F(t);return e instanceof Element||e instanceof DocumentFragment?e.lastChild:G(e)}}function Y(t){return"function"==typeof Symbol?Symbol():t}function Z(t){return`_bl_${t}`}t.attachReviver(((t,e)=>e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"__internalId")&&"string"==typeof e.I?function(t){const e=`[${Z(t)}]`;return document.querySelector(e)}(e.I):e));const Q="_blazorDeferredValue",tt=document.createElement("template"),et=document.createElementNS("http://www.w3.org/2000/svg","g"),nt={},it="__internal_",rt="preventDefault_",st="stopPropagation_";class ot{constructor(t){this.rootComponentIds=new Set,this.childComponentLocations={},this.eventDelegator=new x(t),this.eventDelegator.notifyAfterClick((t=>{if(!wt)return;if(0!==t.button||function(t){return t.ctrlKey||t.shiftKey||t.altKey||t.metaKey}(t))return;if(t.defaultPrevented)return;const e=function(t){const e=!window._blazorDisableComposedPath&&t.composedPath&&t.composedPath();if(e){for(let t=0;tbt(!1))))},enableNavigationInterception:function(){wt=!0},navigateTo:gt,getBaseURI:()=>document.baseURI,getLocationHref:()=>location.href};function gt(t,e,n=!1){const i=St(t),r=e instanceof Object?e:{forceLoad:e,replaceHistoryEntry:n};!r.forceLoad&&Ct(i)?yt(i,!1,r.replaceHistoryEntry):function(t,e){if(location.href===t){const e=t+"?";history.replaceState(null,"",e),location.replace(t)}else e?location.replace(t):location.href=t}(t,r.replaceHistoryEntry)}function yt(t,e,n){dt=!0,n?history.replaceState(null,"",t):history.pushState(null,"",t),bt(e)}async function bt(t){mt&&await mt(location.href,t)}let Et;function St(t){return Et=Et||document.createElement("a"),Et.href=t,Et.href}function $t(t,e){return t?t.tagName===e?t:$t(t.parentElement,e):null}function Ct(t){const e=(n=document.baseURI).substring(0,n.lastIndexOf("/"));var n;const i=t.charAt(e.length);return t.startsWith(e)&&(""===i||"/"===i||"?"===i||"#"===i)}const kt={focus:function(t,e){if(t instanceof HTMLElement)t.focus({preventScroll:e});else{if(!(t instanceof SVGElement))throw new Error("Unable to focus an invalid element.");if(!t.hasAttribute("tabindex"))throw new Error("Unable to focus an SVG element that does not have a tabindex.");t.focus({preventScroll:e})}},focusBySelector:function(t){const e=document.querySelector(t);e&&(e.hasAttribute("tabindex")||(e.tabIndex=-1),e.focus())}},Tt={init:function(t,e,n,i=50){const r=At(e);(r||document.documentElement).style.overflowAnchor="none";const s=document.createRange();u(n.parentElement)&&(e.style.display="table-row",n.style.display="table-row");const o=new IntersectionObserver((function(i){i.forEach((i=>{var r;if(!i.isIntersecting)return;s.setStartAfter(e),s.setEndBefore(n);const o=s.getBoundingClientRect().height,c=null===(r=i.rootBounds)||void 0===r?void 0:r.height;i.target===e?t.invokeMethodAsync("OnSpacerBeforeVisible",i.intersectionRect.top-i.boundingClientRect.top,o,c):i.target===n&&n.offsetHeight>0&&t.invokeMethodAsync("OnSpacerAfterVisible",i.boundingClientRect.bottom-i.intersectionRect.bottom,o,c)}))}),{root:r,rootMargin:`${i}px`});o.observe(e),o.observe(n);const c=h(e),a=h(n);function h(t){const e={attributes:!0},n=new MutationObserver(((n,i)=>{u(t.parentElement)&&(i.disconnect(),t.style.display="table-row",i.observe(t,e)),o.unobserve(t),o.observe(t)}));return n.observe(t,e),n}function u(t){return null!==t&&(t instanceof HTMLTableElement&&""===t.style.display||"table"===t.style.display||t instanceof HTMLTableSectionElement&&""===t.style.display||"table-row-group"===t.style.display)}It[t.u]={intersectionObserver:o,mutationObserverBefore:c,mutationObserverAfter:a}},dispose:function(t){const e=It[t.u];e&&(e.intersectionObserver.disconnect(),e.mutationObserverBefore.disconnect(),e.mutationObserverAfter.disconnect(),t.dispose(),delete It[t.u])}},It={};function At(t){return t?"visible"!==getComputedStyle(t).overflowY?t:At(t.parentElement):null}const _t={getAndRemoveExistingTitle:function(){var t;const e=document.head?document.head.getElementsByTagName("title"):[];if(0===e.length)return null;let n=null;for(let i=e.length-1;i>=0;i--){const r=e[i],s=r.previousSibling;s instanceof Comment&&null!==F(s)||(null===n&&(n=r.textContent),null===(t=r.parentNode)||void 0===t||t.removeChild(r))}return n}},Pt={init:function(t,e){e._=0,e.addEventListener("click",(function(){e.value=""})),e.addEventListener("change",(function(){e.P={};const n=Array.prototype.map.call(e.files,(function(t){const n={id:++e._,lastModified:new Date(t.lastModified).toISOString(),name:t.name,size:t.size,contentType:t.type,readPromise:void 0,arrayBuffer:void 0,blob:t};return e.P[n.id]=n,n}));t.invokeMethodAsync("NotifyChange",n)}))},toImageFile:async function(t,e,n,i,r){const s=xt(t,e),o=await new Promise((function(t){const e=new Image;e.onload=function(){URL.revokeObjectURL(e.src),t(e)},e.onerror=function(){e.onerror=null,URL.revokeObjectURL(e.src)},e.src=URL.createObjectURL(s.blob)})),c=await new Promise((function(t){var e;const s=Math.min(1,i/o.width),c=Math.min(1,r/o.height),a=Math.min(s,c),h=document.createElement("canvas");h.width=Math.round(o.width*a),h.height=Math.round(o.height*a),null===(e=h.getContext("2d"))||void 0===e||e.drawImage(o,0,0,h.width,h.height),h.toBlob(t,n)})),a={id:++t._,lastModified:s.lastModified,name:s.name,size:(null==c?void 0:c.size)||0,contentType:n,blob:c||s.blob};return t.P[a.id]=a,a},readFileData:async function(t,e){return xt(t,e).blob}};function xt(t,e){const n=t.P[e];if(!n)throw new Error(`There is no file with ID ${e}. The file list may have changed. See https://aka.ms/aspnet/blazor-input-file-multiple-selections.`);return n}async function Dt(t,e,n){return t instanceof Blob?await async function(t,e,n){const i=t.slice(e,e+n),r=await i.arrayBuffer();return new Uint8Array(r)}(t,e,n):function(t,e,n){return new Uint8Array(t.buffer,t.byteOffset+e,n)}(t,e,n)}const Nt=new Map,Mt={navigateTo:gt,registerCustomEventType:function(t,e){if(!e)throw new Error("The options parameter is required.");if(s.has(t))throw new Error(`The event '${t}' is already registered.`);if(e.browserEventName){const n=o.get(e.browserEventName);n?n.push(t):o.set(e.browserEventName,[t]),c.forEach((n=>n(t,e.browserEventName)))}s.set(t,e)},rootComponents:g,D:{navigationManager:vt,domWrapper:kt,Virtualize:Tt,PageTitle:_t,InputFile:Pt,getJSDataStreamChunk:Dt,receiveDotNetDataStream:function(e,n,i,r){let s=Nt.get(e);if(!s){const n=new ReadableStream({start(t){Nt.set(e,t),s=t}});t.jsCallDispatcher.supplyDotNetStream(e,n)}r?(s.error(r),Nt.delete(e)):0===i?(s.close(),Nt.delete(e)):s.enqueue(n.length===i?n:n.subarray(0,i))},attachWebRendererInterop:function(e,n,i,r){if(S.has(e))throw new Error(`Interop methods are already registered for renderer ${e}`);S.set(e,n),Object.keys(i).length>0&&function(e,n,i){if(p)throw new Error("Dynamic root components have already been enabled.");p=e,m=n;for(const[e,r]of Object.entries(i)){const i=t.jsCallDispatcher.findJSFunction(e,0);for(const t of r)i(t,n[t])}}(T(e),i,r),$()}}};window.Blazor=Mt;const Rt=[0,2e3,1e4,3e4,null];class Ut{constructor(t){this.N=void 0!==t?[...t,null]:Rt}nextRetryDelayInMilliseconds(t){return this.N[t.previousRetryCount]}}class Ht extends Error{constructor(t,e){const n=new.target.prototype;super(`${t}: Status code '${e}'`),this.statusCode=e,this.__proto__=n}}class Lt extends Error{constructor(t="A timeout occurred."){const e=new.target.prototype;super(t),this.__proto__=e}}class Ot extends Error{constructor(t="An abort occurred."){const e=new.target.prototype;super(t),this.__proto__=e}}class jt extends Error{constructor(t,e){const n=new.target.prototype;super(t),this.transport=e,this.errorType="UnsupportedTransportError",this.__proto__=n}}class Bt extends Error{constructor(t,e){const n=new.target.prototype;super(t),this.transport=e,this.errorType="DisabledTransportError",this.__proto__=n}}class Ft extends Error{constructor(t,e){const n=new.target.prototype;super(t),this.transport=e,this.errorType="FailedToStartTransportError",this.__proto__=n}}class Jt extends Error{constructor(t){const e=new.target.prototype;super(t),this.errorType="FailedToNegotiateWithServerError",this.__proto__=e}}class zt extends Error{constructor(t,e){const n=new.target.prototype;super(t),this.innerErrors=e,this.__proto__=n}}class Wt{constructor(t,e,n){this.statusCode=t,this.statusText=e,this.content=n}}class qt{get(t,e){return this.send({...e,method:"GET",url:t})}post(t,e){return this.send({...e,method:"POST",url:t})}delete(t,e){return this.send({...e,method:"DELETE",url:t})}getCookieString(t){return""}}var Vt,Xt,Kt,Gt,Yt;!function(t){t[t.Trace=0]="Trace",t[t.Debug=1]="Debug",t[t.Information=2]="Information",t[t.Warning=3]="Warning",t[t.Error=4]="Error",t[t.Critical=5]="Critical",t[t.None=6]="None"}(Vt||(Vt={}));class Zt{constructor(){}log(t,e){}}Zt.instance=new Zt;class Qt{static isRequired(t,e){if(null==t)throw new Error(`The '${e}' argument is required.`)}static isNotEmpty(t,e){if(!t||t.match(/^\s*$/))throw new Error(`The '${e}' argument should not be empty.`)}static isIn(t,e,n){if(!(t in e))throw new Error(`Unknown ${n} value: ${t}.`)}}class te{static get isBrowser(){return"object"==typeof window&&"object"==typeof window.document}static get isWebWorker(){return"object"==typeof self&&"importScripts"in self}static get isReactNative(){return"object"==typeof window&&void 0===window.document}static get isNode(){return!this.isBrowser&&!this.isWebWorker&&!this.isReactNative}}function ee(t,e){let n="";return ne(t)?(n=`Binary data of length ${t.byteLength}`,e&&(n+=`. Content: '${function(t){const e=new Uint8Array(t);let n="";return e.forEach((t=>{n+=`0x${t<16?"0":""}${t.toString(16)} `})),n.substr(0,n.length-1)}(t)}'`)):"string"==typeof t&&(n=`String data of length ${t.length}`,e&&(n+=`. Content: '${t}'`)),n}function ne(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}async function ie(t,e,n,i,r,s,o){let c={};if(r){const t=await r();t&&(c={Authorization:`Bearer ${t}`})}const[a,h]=oe();c[a]=h,t.log(Vt.Trace,`(${e} transport) sending data. ${ee(s,o.logMessageContent)}.`);const u=ne(s)?"arraybuffer":"text",l=await n.post(i,{content:s,headers:{...c,...o.headers},responseType:u,timeout:o.timeout,withCredentials:o.withCredentials});t.log(Vt.Trace,`(${e} transport) request complete. Response status: ${l.statusCode}.`)}class re{constructor(t,e){this.M=t,this.R=e}dispose(){const t=this.M.observers.indexOf(this.R);t>-1&&this.M.observers.splice(t,1),0===this.M.observers.length&&this.M.cancelCallback&&this.M.cancelCallback().catch((t=>{}))}}class se{constructor(t){this.U=t,this.out=console}log(t,e){if(t>=this.U){const n=`[${(new Date).toISOString()}] ${Vt[t]}: ${e}`;switch(t){case Vt.Critical:case Vt.Error:this.out.error(n);break;case Vt.Warning:this.out.warn(n);break;case Vt.Information:this.out.info(n);break;default:this.out.log(n)}}}}function oe(){let t="X-SignalR-User-Agent";return te.isNode&&(t="User-Agent"),[t,ce("0.0.0-DEV_BUILD",ae(),te.isNode?"NodeJS":"Browser",he())]}function ce(t,e,n,i){let r="Microsoft SignalR/";const s=t.split(".");return r+=`${s[0]}.${s[1]}`,r+=` (${t}; `,r+=e&&""!==e?`${e}; `:"Unknown OS; ",r+=`${n}`,r+=i?`; ${i}`:"; Unknown Runtime Version",r+=")",r}function ae(){if(!te.isNode)return"";switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}}function he(){if(te.isNode)return process.versions.node}function ue(t){return t.stack?t.stack:t.message?t.message:`${t}`}class le extends qt{constructor(t){if(super(),this.H=t,"undefined"==typeof fetch){const t=require;this.L=new(t("tough-cookie").CookieJar),this.O=t("node-fetch"),this.O=t("fetch-cookie")(this.O,this.L)}else this.O=fetch.bind(function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==i.g)return i.g;throw new Error("could not find global")}());if("undefined"==typeof AbortController){const t=require;this.j=t("abort-controller")}else this.j=AbortController}async send(t){if(t.abortSignal&&t.abortSignal.aborted)throw new Ot;if(!t.method)throw new Error("No method defined.");if(!t.url)throw new Error("No url defined.");const e=new this.j;let n;t.abortSignal&&(t.abortSignal.onabort=()=>{e.abort(),n=new Ot});let i,r=null;if(t.timeout){const i=t.timeout;r=setTimeout((()=>{e.abort(),this.H.log(Vt.Warning,"Timeout from HTTP request."),n=new Lt}),i)}""===t.content&&(t.content=void 0),t.content&&(t.headers=t.headers||{},ne(t.content)?t.headers["Content-Type"]="application/octet-stream":t.headers["Content-Type"]="text/plain;charset=UTF-8");try{i=await this.O(t.url,{body:t.content,cache:"no-cache",credentials:!0===t.withCredentials?"include":"same-origin",headers:{"X-Requested-With":"XMLHttpRequest",...t.headers},method:t.method,mode:"cors",redirect:"follow",signal:e.signal})}catch(t){if(n)throw n;throw this.H.log(Vt.Warning,`Error from HTTP request. ${t}.`),t}finally{r&&clearTimeout(r),t.abortSignal&&(t.abortSignal.onabort=null)}if(!i.ok){const t=await fe(i,"text");throw new Ht(t||i.statusText,i.status)}const s=fe(i,t.responseType),o=await s;return new Wt(i.status,i.statusText,o)}getCookieString(t){return""}}function fe(t,e){let n;switch(e){case"arraybuffer":n=t.arrayBuffer();break;case"text":default:n=t.text();break;case"blob":case"document":case"json":throw new Error(`${e} is not supported.`)}return n}class de extends qt{constructor(t){super(),this.H=t}send(t){return t.abortSignal&&t.abortSignal.aborted?Promise.reject(new Ot):t.method?t.url?new Promise(((e,n)=>{const i=new XMLHttpRequest;i.open(t.method,t.url,!0),i.withCredentials=void 0===t.withCredentials||t.withCredentials,i.setRequestHeader("X-Requested-With","XMLHttpRequest"),""===t.content&&(t.content=void 0),t.content&&(ne(t.content)?i.setRequestHeader("Content-Type","application/octet-stream"):i.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const r=t.headers;r&&Object.keys(r).forEach((t=>{i.setRequestHeader(t,r[t])})),t.responseType&&(i.responseType=t.responseType),t.abortSignal&&(t.abortSignal.onabort=()=>{i.abort(),n(new Ot)}),t.timeout&&(i.timeout=t.timeout),i.onload=()=>{t.abortSignal&&(t.abortSignal.onabort=null),i.status>=200&&i.status<300?e(new Wt(i.status,i.statusText,i.response||i.responseText)):n(new Ht(i.response||i.responseText||i.statusText,i.status))},i.onerror=()=>{this.H.log(Vt.Warning,`Error from HTTP request. ${i.status}: ${i.statusText}.`),n(new Ht(i.statusText,i.status))},i.ontimeout=()=>{this.H.log(Vt.Warning,"Timeout from HTTP request."),n(new Lt)},i.send(t.content)})):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class we extends qt{constructor(t){if(super(),"undefined"!=typeof fetch)this.B=new le(t);else{if("undefined"==typeof XMLHttpRequest)throw new Error("No usable HttpClient found.");this.B=new de(t)}}send(t){return t.abortSignal&&t.abortSignal.aborted?Promise.reject(new Ot):t.method?t.url?this.B.send(t):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(t){return this.B.getCookieString(t)}}class pe{}pe.Authorization="Authorization",pe.Cookie="Cookie",function(t){t[t.None=0]="None",t[t.WebSockets=1]="WebSockets",t[t.ServerSentEvents=2]="ServerSentEvents",t[t.LongPolling=4]="LongPolling"}(Xt||(Xt={})),function(t){t[t.Text=1]="Text",t[t.Binary=2]="Binary"}(Kt||(Kt={}));class me{constructor(){this.F=!1,this.onabort=null}abort(){this.F||(this.F=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this.F}}class ve{constructor(t,e,n,i){this.B=t,this.J=e,this.H=n,this.W=new me,this.q=i,this.V=!1,this.onreceive=null,this.onclose=null}get pollAborted(){return this.W.aborted}async connect(t,e){if(Qt.isRequired(t,"url"),Qt.isRequired(e,"transferFormat"),Qt.isIn(e,Kt,"transferFormat"),this.X=t,this.H.log(Vt.Trace,"(LongPolling transport) Connecting."),e===Kt.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,i]=oe(),r={[n]:i,...this.q.headers},s={abortSignal:this.W.signal,headers:r,timeout:1e5,withCredentials:this.q.withCredentials};e===Kt.Binary&&(s.responseType="arraybuffer"),await this.K(s);const o=`${t}&_=${Date.now()}`;this.H.log(Vt.Trace,`(LongPolling transport) polling: ${o}.`);const c=await this.B.get(o,s);200!==c.statusCode?(this.H.log(Vt.Error,`(LongPolling transport) Unexpected response code: ${c.statusCode}.`),this.G=new Ht(c.statusText||"",c.statusCode),this.V=!1):this.V=!0,this.Y=this.Z(this.X,s)}async K(t){if(t.headers||(t.headers={}),this.J){const e=await this.J();e?t.headers[pe.Authorization]=`Bearer ${e}`:t.headers[pe.Authorization]&&delete t.headers[pe.Authorization]}}async Z(t,e){try{for(;this.V;){await this.K(e);try{const n=`${t}&_=${Date.now()}`;this.H.log(Vt.Trace,`(LongPolling transport) polling: ${n}.`);const i=await this.B.get(n,e);204===i.statusCode?(this.H.log(Vt.Information,"(LongPolling transport) Poll terminated by server."),this.V=!1):200!==i.statusCode?(this.H.log(Vt.Error,`(LongPolling transport) Unexpected response code: ${i.statusCode}.`),this.G=new Ht(i.statusText||"",i.statusCode),this.V=!1):i.content?(this.H.log(Vt.Trace,`(LongPolling transport) data received. ${ee(i.content,this.q.logMessageContent)}.`),this.onreceive&&this.onreceive(i.content)):this.H.log(Vt.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(t){this.V?t instanceof Lt?this.H.log(Vt.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this.G=t,this.V=!1):this.H.log(Vt.Trace,`(LongPolling transport) Poll errored after shutdown: ${t.message}`)}}}finally{this.H.log(Vt.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this.tt()}}async send(t){return this.V?ie(this.H,"LongPolling",this.B,this.X,this.J,t,this.q):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this.H.log(Vt.Trace,"(LongPolling transport) Stopping polling."),this.V=!1,this.W.abort();try{await this.Y,this.H.log(Vt.Trace,`(LongPolling transport) sending DELETE request to ${this.X}.`);const t={},[e,n]=oe();t[e]=n;const i={headers:{...t,...this.q.headers},timeout:this.q.timeout,withCredentials:this.q.withCredentials};await this.K(i),await this.B.delete(this.X,i),this.H.log(Vt.Trace,"(LongPolling transport) DELETE request sent.")}finally{this.H.log(Vt.Trace,"(LongPolling transport) Stop finished."),this.tt()}}tt(){if(this.onclose){let t="(LongPolling transport) Firing onclose event.";this.G&&(t+=" Error: "+this.G),this.H.log(Vt.Trace,t),this.onclose(this.G)}}}class ge{constructor(t,e,n,i){this.B=t,this.J=e,this.H=n,this.q=i,this.onreceive=null,this.onclose=null}async connect(t,e){if(Qt.isRequired(t,"url"),Qt.isRequired(e,"transferFormat"),Qt.isIn(e,Kt,"transferFormat"),this.H.log(Vt.Trace,"(SSE transport) Connecting."),this.X=t,this.J){const e=await this.J();e&&(t+=(t.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(e)}`)}return new Promise(((n,i)=>{let r,s=!1;if(e===Kt.Text){if(te.isBrowser||te.isWebWorker)r=new this.q.EventSource(t,{withCredentials:this.q.withCredentials});else{const e=this.B.getCookieString(t),n={};n.Cookie=e;const[i,s]=oe();n[i]=s,r=new this.q.EventSource(t,{withCredentials:this.q.withCredentials,headers:{...n,...this.q.headers}})}try{r.onmessage=t=>{if(this.onreceive)try{this.H.log(Vt.Trace,`(SSE transport) data received. ${ee(t.data,this.q.logMessageContent)}.`),this.onreceive(t.data)}catch(t){return void this.et(t)}},r.onerror=t=>{s?this.et():i(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},r.onopen=()=>{this.H.log(Vt.Information,`SSE connected to ${this.X}`),this.nt=r,s=!0,n()}}catch(t){return void i(t)}}else i(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))}))}async send(t){return this.nt?ie(this.H,"SSE",this.B,this.X,this.J,t,this.q):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this.et(),Promise.resolve()}et(t){this.nt&&(this.nt.close(),this.nt=void 0,this.onclose&&this.onclose(t))}}class ye{constructor(t,e,n,i,r,s){this.H=n,this.J=e,this.it=i,this.rt=r,this.B=t,this.onreceive=null,this.onclose=null,this.st=s}async connect(t,e){let n;return Qt.isRequired(t,"url"),Qt.isRequired(e,"transferFormat"),Qt.isIn(e,Kt,"transferFormat"),this.H.log(Vt.Trace,"(WebSockets transport) Connecting."),this.J&&(n=await this.J()),new Promise(((i,r)=>{let s;t=t.replace(/^http/,"ws");const o=this.B.getCookieString(t);let c=!1;if(te.isReactNative){const e={},[i,r]=oe();e[i]=r,n&&(e[pe.Authorization]=`Bearer ${n}`),o&&(e[pe.Cookie]=o),s=new this.rt(t,void 0,{headers:{...e,...this.st}})}else n&&(t+=(t.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(n)}`);s||(s=new this.rt(t)),e===Kt.Binary&&(s.binaryType="arraybuffer"),s.onopen=e=>{this.H.log(Vt.Information,`WebSocket connected to ${t}.`),this.ot=s,c=!0,i()},s.onerror=t=>{let e=null;e="undefined"!=typeof ErrorEvent&&t instanceof ErrorEvent?t.error:"There was an error with the transport",this.H.log(Vt.Information,`(WebSockets transport) ${e}.`)},s.onmessage=t=>{if(this.H.log(Vt.Trace,`(WebSockets transport) data received. ${ee(t.data,this.it)}.`),this.onreceive)try{this.onreceive(t.data)}catch(t){return void this.et(t)}},s.onclose=t=>{if(c)this.et(t);else{let e=null;e="undefined"!=typeof ErrorEvent&&t instanceof ErrorEvent?t.error:"WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",r(new Error(e))}}}))}send(t){return this.ot&&this.ot.readyState===this.rt.OPEN?(this.H.log(Vt.Trace,`(WebSockets transport) sending data. ${ee(t,this.it)}.`),this.ot.send(t),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this.ot&&this.et(void 0),Promise.resolve()}et(t){this.ot&&(this.ot.onclose=()=>{},this.ot.onmessage=()=>{},this.ot.onerror=()=>{},this.ot.close(),this.ot=void 0),this.H.log(Vt.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this.ct(t)||!1!==t.wasClean&&1e3===t.code?t instanceof Error?this.onclose(t):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${t.code} (${t.reason||"no reason given"}).`)))}ct(t){return t&&"boolean"==typeof t.wasClean&&"number"==typeof t.code}}class be{constructor(t,e={}){var n;if(this.ht=()=>{},this.features={},this.ut=1,Qt.isRequired(t,"url"),this.H=void 0===(n=e.logger)?new se(Vt.Information):null===n?Zt.instance:void 0!==n.log?n:new se(n),this.baseUrl=this.lt(t),(e=e||{}).logMessageContent=void 0!==e.logMessageContent&&e.logMessageContent,"boolean"!=typeof e.withCredentials&&void 0!==e.withCredentials)throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");e.withCredentials=void 0===e.withCredentials||e.withCredentials,e.timeout=void 0===e.timeout?1e5:e.timeout,"undefined"==typeof WebSocket||e.WebSocket||(e.WebSocket=WebSocket),"undefined"==typeof EventSource||e.EventSource||(e.EventSource=EventSource),this.B=e.httpClient||new we(this.H),this.ft="Disconnected",this.dt=!1,this.q=e,this.onreceive=null,this.onclose=null}async start(t){if(t=t||Kt.Binary,Qt.isIn(t,Kt,"transferFormat"),this.H.log(Vt.Debug,`Starting connection with transfer format '${Kt[t]}'.`),"Disconnected"!==this.ft)return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this.ft="Connecting",this.wt=this.vt(t),await this.wt,"Disconnecting"===this.ft){const t="Failed to start the HttpConnection before stop() was called.";return this.H.log(Vt.Error,t),await this.gt,Promise.reject(new Ot(t))}if("Connected"!==this.ft){const t="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this.H.log(Vt.Error,t),Promise.reject(new Ot(t))}this.dt=!0}send(t){return"Connected"!==this.ft?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this.yt||(this.yt=new Ee(this.transport)),this.yt.send(t))}async stop(t){return"Disconnected"===this.ft?(this.H.log(Vt.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):"Disconnecting"===this.ft?(this.H.log(Vt.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnecting state.`),this.gt):(this.ft="Disconnecting",this.gt=new Promise((t=>{this.ht=t})),await this.bt(t),void await this.gt)}async bt(t){this.Et=t;try{await this.wt}catch(t){}if(this.transport){try{await this.transport.stop()}catch(t){this.H.log(Vt.Error,`HttpConnection.transport.stop() threw error '${t}'.`),this.St()}this.transport=void 0}else this.H.log(Vt.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async vt(t){let e=this.baseUrl;this.J=this.q.accessTokenFactory;try{if(this.q.skipNegotiation){if(this.q.transport!==Xt.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this.$t(Xt.WebSockets),await this.Ct(e,t)}else{let n=null,i=0;do{if(n=await this.kt(e),"Disconnecting"===this.ft||"Disconnected"===this.ft)throw new Ot("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&&(e=n.url),n.accessToken){const t=n.accessToken;this.J=()=>t}i++}while(n.url&&i<100);if(100===i&&n.url)throw new Error("Negotiate redirection limit exceeded.");await this.Tt(e,this.q.transport,n,t)}this.transport instanceof ve&&(this.features.inherentKeepAlive=!0),"Connecting"===this.ft&&(this.H.log(Vt.Debug,"The HttpConnection connected successfully."),this.ft="Connected")}catch(t){return this.H.log(Vt.Error,"Failed to start the connection: "+t),this.ft="Disconnected",this.transport=void 0,this.ht(),Promise.reject(t)}}async kt(t){const e={};if(this.J){const t=await this.J();t&&(e[pe.Authorization]=`Bearer ${t}`)}const[n,i]=oe();e[n]=i;const r=this.It(t);this.H.log(Vt.Debug,`Sending negotiation request: ${r}.`);try{const t=await this.B.post(r,{content:"",headers:{...e,...this.q.headers},timeout:this.q.timeout,withCredentials:this.q.withCredentials});if(200!==t.statusCode)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${t.statusCode}'`));const n=JSON.parse(t.content);return(!n.negotiateVersion||n.negotiateVersion<1)&&(n.connectionToken=n.connectionId),n}catch(t){let e="Failed to complete negotiation with the server: "+t;return t instanceof Ht&&404===t.statusCode&&(e+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this.H.log(Vt.Error,e),Promise.reject(new Jt(e))}}At(t,e){return e?t+(-1===t.indexOf("?")?"?":"&")+`id=${e}`:t}async Tt(t,e,n,i){let r=this.At(t,n.connectionToken);if(this._t(e))return this.H.log(Vt.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=e,await this.Ct(r,i),void(this.connectionId=n.connectionId);const s=[],o=n.availableTransports||[];let c=n;for(const n of o){const o=this.Pt(n,e,i);if(o instanceof Error)s.push(`${n.transport} failed:`),s.push(o);else if(this._t(o)){if(this.transport=o,!c){try{c=await this.kt(t)}catch(t){return Promise.reject(t)}r=this.At(t,c.connectionToken)}try{return await this.Ct(r,i),void(this.connectionId=c.connectionId)}catch(t){if(this.H.log(Vt.Error,`Failed to start the transport '${n.transport}': ${t}`),c=void 0,s.push(new Ft(`${n.transport} failed: ${t}`,Xt[n.transport])),"Connecting"!==this.ft){const t="Failed to select transport before stop() was called.";return this.H.log(Vt.Debug,t),Promise.reject(new Ot(t))}}}}return s.length>0?Promise.reject(new zt(`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."))}$t(t){switch(t){case Xt.WebSockets:if(!this.q.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new ye(this.B,this.J,this.H,this.q.logMessageContent,this.q.WebSocket,this.q.headers||{});case Xt.ServerSentEvents:if(!this.q.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new ge(this.B,this.J,this.H,this.q);case Xt.LongPolling:return new ve(this.B,this.J,this.H,this.q);default:throw new Error(`Unknown transport: ${t}.`)}}Ct(t,e){return this.transport.onreceive=this.onreceive,this.transport.onclose=t=>this.St(t),this.transport.connect(t,e)}Pt(t,e,n){const i=Xt[t.transport];if(null==i)return this.H.log(Vt.Debug,`Skipping transport '${t.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${t.transport}' because it is not supported by this client.`);if(!function(t,e){return!t||0!=(e&t)}(e,i))return this.H.log(Vt.Debug,`Skipping transport '${Xt[i]}' because it was disabled by the client.`),new Bt(`'${Xt[i]}' is disabled by the client.`,i);if(!(t.transferFormats.map((t=>Kt[t])).indexOf(n)>=0))return this.H.log(Vt.Debug,`Skipping transport '${Xt[i]}' because it does not support the requested transfer format '${Kt[n]}'.`),new Error(`'${Xt[i]}' does not support ${Kt[n]}.`);if(i===Xt.WebSockets&&!this.q.WebSocket||i===Xt.ServerSentEvents&&!this.q.EventSource)return this.H.log(Vt.Debug,`Skipping transport '${Xt[i]}' because it is not supported in your environment.'`),new jt(`'${Xt[i]}' is not supported in your environment.`,i);this.H.log(Vt.Debug,`Selecting transport '${Xt[i]}'.`);try{return this.$t(i)}catch(t){return t}}_t(t){return t&&"object"==typeof t&&"connect"in t}St(t){if(this.H.log(Vt.Debug,`HttpConnection.stopConnection(${t}) called while in state ${this.ft}.`),this.transport=void 0,t=this.Et||t,this.Et=void 0,"Disconnected"!==this.ft){if("Connecting"===this.ft)throw this.H.log(Vt.Warning,`Call to HttpConnection.stopConnection(${t}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${t}) was called while the connection is still in the connecting state.`);if("Disconnecting"===this.ft&&this.ht(),t?this.H.log(Vt.Error,`Connection disconnected with error '${t}'.`):this.H.log(Vt.Information,"Connection disconnected."),this.yt&&(this.yt.stop().catch((t=>{this.H.log(Vt.Error,`TransportSendQueue.stop() threw error '${t}'.`)})),this.yt=void 0),this.connectionId=void 0,this.ft="Disconnected",this.dt){this.dt=!1;try{this.onclose&&this.onclose(t)}catch(e){this.H.log(Vt.Error,`HttpConnection.onclose(${t}) threw error '${e}'.`)}}}else this.H.log(Vt.Debug,`Call to HttpConnection.stopConnection(${t}) was ignored because the connection is already in the disconnected state.`)}lt(t){if(0===t.lastIndexOf("https://",0)||0===t.lastIndexOf("http://",0))return t;if(!te.isBrowser)throw new Error(`Cannot resolve '${t}'.`);const e=window.document.createElement("a");return e.href=t,this.H.log(Vt.Information,`Normalizing '${t}' to '${e.href}'.`),e.href}It(t){const e=t.indexOf("?");let n=t.substring(0,-1===e?t.length:e);return"/"!==n[n.length-1]&&(n+="/"),n+="negotiate",n+=-1===e?"":t.substring(e),-1===n.indexOf("negotiateVersion")&&(n+=-1===e?"?":"&",n+="negotiateVersion="+this.ut),n}}class Ee{constructor(t){this.xt=t,this.Dt=[],this.Nt=!0,this.Mt=new Se,this.Rt=new Se,this.Ut=this.Ht()}send(t){return this.Lt(t),this.Rt||(this.Rt=new Se),this.Rt.promise}stop(){return this.Nt=!1,this.Mt.resolve(),this.Ut}Lt(t){if(this.Dt.length&&typeof this.Dt[0]!=typeof t)throw new Error(`Expected data to be of type ${typeof this.Dt} but was of type ${typeof t}`);this.Dt.push(t),this.Mt.resolve()}async Ht(){for(;;){if(await this.Mt.promise,!this.Nt){this.Rt&&this.Rt.reject("Connection stopped.");break}this.Mt=new Se;const t=this.Rt;this.Rt=void 0;const e="string"==typeof this.Dt[0]?this.Dt.join(""):Ee.Ot(this.Dt);this.Dt.length=0;try{await this.xt.send(e),t.resolve()}catch(e){t.reject(e)}}}static Ot(t){const e=t.map((t=>t.byteLength)).reduce(((t,e)=>t+e)),n=new Uint8Array(e);let i=0;for(const e of t)n.set(new Uint8Array(e),i),i+=e.byteLength;return n.buffer}}class Se{constructor(){this.promise=new Promise(((t,e)=>[this.jt,this.Bt]=[t,e]))}resolve(){this.jt()}reject(t){this.Bt(t)}}class $e{static write(t){return`${t}${$e.RecordSeparator}`}static parse(t){if(t[t.length-1]!==$e.RecordSeparator)throw new Error("Message is incomplete.");const e=t.split($e.RecordSeparator);return e.pop(),e}}$e.RecordSeparatorCode=30,$e.RecordSeparator=String.fromCharCode($e.RecordSeparatorCode);class Ce{writeHandshakeRequest(t){return $e.write(JSON.stringify(t))}parseHandshakeResponse(t){let e,n;if(ne(t)){const i=new Uint8Array(t),r=i.indexOf($e.RecordSeparatorCode);if(-1===r)throw new Error("Message is incomplete.");const s=r+1;e=String.fromCharCode.apply(null,Array.prototype.slice.call(i.slice(0,s))),n=i.byteLength>s?i.slice(s).buffer:null}else{const i=t,r=i.indexOf($e.RecordSeparator);if(-1===r)throw new Error("Message is incomplete.");const s=r+1;e=i.substring(0,s),n=i.length>s?i.substring(s):null}const i=$e.parse(e),r=JSON.parse(i[0]);if(r.type)throw new Error("Expected a handshake response from the server.");return[n,r]}}!function(t){t[t.Invocation=1]="Invocation",t[t.StreamItem=2]="StreamItem",t[t.Completion=3]="Completion",t[t.StreamInvocation=4]="StreamInvocation",t[t.CancelInvocation=5]="CancelInvocation",t[t.Ping=6]="Ping",t[t.Close=7]="Close"}(Gt||(Gt={}));class ke{constructor(){this.observers=[]}next(t){for(const e of this.observers)e.next(t)}error(t){for(const e of this.observers)e.error&&e.error(t)}complete(){for(const t of this.observers)t.complete&&t.complete()}subscribe(t){return this.observers.push(t),new re(this,t)}}!function(t){t.Disconnected="Disconnected",t.Connecting="Connecting",t.Connected="Connected",t.Disconnecting="Disconnecting",t.Reconnecting="Reconnecting"}(Yt||(Yt={}));class Te{constructor(t,e,n,i){this.Ft=0,this.Jt=()=>{this.H.log(Vt.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://docs.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},Qt.isRequired(t,"connection"),Qt.isRequired(e,"logger"),Qt.isRequired(n,"protocol"),this.serverTimeoutInMilliseconds=3e4,this.keepAliveIntervalInMilliseconds=15e3,this.H=e,this.zt=n,this.connection=t,this.Wt=i,this.qt=new Ce,this.connection.onreceive=t=>this.Vt(t),this.connection.onclose=t=>this.Xt(t),this.Kt={},this.Gt={},this.Yt=[],this.Zt=[],this.Qt=[],this.te=0,this.ee=!1,this.ft=Yt.Disconnected,this.dt=!1,this.ne=this.zt.writeMessage({type:Gt.Ping})}static create(t,e,n,i){return new Te(t,e,n,i)}get state(){return this.ft}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(t){if(this.ft!==Yt.Disconnected&&this.ft!==Yt.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!t)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=t}start(){return this.ie=this.re(),this.ie}async re(){if(this.ft!==Yt.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this.ft=Yt.Connecting,this.H.log(Vt.Debug,"Starting HubConnection.");try{await this.vt(),te.isBrowser&&window.document.addEventListener("freeze",this.Jt),this.ft=Yt.Connected,this.dt=!0,this.H.log(Vt.Debug,"HubConnection connected successfully.")}catch(t){return this.ft=Yt.Disconnected,this.H.log(Vt.Debug,`HubConnection failed to start successfully because of error '${t}'.`),Promise.reject(t)}}async vt(){this.se=void 0,this.ee=!1;const t=new Promise(((t,e)=>{this.oe=t,this.ce=e}));await this.connection.start(this.zt.transferFormat);try{const e={protocol:this.zt.name,version:this.zt.version};if(this.H.log(Vt.Debug,"Sending handshake request."),await this.ae(this.qt.writeHandshakeRequest(e)),this.H.log(Vt.Information,`Using HubProtocol '${this.zt.name}'.`),this.he(),this.ue(),this.le(),await t,this.se)throw this.se}catch(t){throw this.H.log(Vt.Debug,`Hub handshake failed with error '${t}' during start(). Stopping HubConnection.`),this.he(),this.fe(),await this.connection.stop(t),t}}async stop(){const t=this.ie;this.gt=this.bt(),await this.gt;try{await t}catch(t){}}bt(t){return this.ft===Yt.Disconnected?(this.H.log(Vt.Debug,`Call to HubConnection.stop(${t}) ignored because it is already in the disconnected state.`),Promise.resolve()):this.ft===Yt.Disconnecting?(this.H.log(Vt.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnecting state.`),this.gt):(this.ft=Yt.Disconnecting,this.H.log(Vt.Debug,"Stopping HubConnection."),this.de?(this.H.log(Vt.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this.de),this.de=void 0,this.we(),Promise.resolve()):(this.he(),this.fe(),this.se=t||new Ot("The connection was stopped before the hub handshake could complete."),this.connection.stop(t)))}stream(t,...e){const[n,i]=this.pe(e),r=this.me(t,e,i);let s;const o=new ke;return o.cancelCallback=()=>{const t=this.ve(r.invocationId);return delete this.Kt[r.invocationId],s.then((()=>this.ge(t)))},this.Kt[r.invocationId]=(t,e)=>{e?o.error(e):t&&(t.type===Gt.Completion?t.error?o.error(new Error(t.error)):o.complete():o.next(t.item))},s=this.ge(r).catch((t=>{o.error(t),delete this.Kt[r.invocationId]})),this.ye(n,s),o}ae(t){return this.le(),this.connection.send(t)}ge(t){return this.ae(this.zt.writeMessage(t))}send(t,...e){const[n,i]=this.pe(e),r=this.ge(this.be(t,e,!0,i));return this.ye(n,r),r}invoke(t,...e){const[n,i]=this.pe(e),r=this.be(t,e,!1,i);return new Promise(((t,e)=>{this.Kt[r.invocationId]=(n,i)=>{i?e(i):n&&(n.type===Gt.Completion?n.error?e(new Error(n.error)):t(n.result):e(new Error(`Unexpected message type: ${n.type}`)))};const i=this.ge(r).catch((t=>{e(t),delete this.Kt[r.invocationId]}));this.ye(n,i)}))}on(t,e){t&&e&&(t=t.toLowerCase(),this.Gt[t]||(this.Gt[t]=[]),-1===this.Gt[t].indexOf(e)&&this.Gt[t].push(e))}off(t,e){if(!t)return;t=t.toLowerCase();const n=this.Gt[t];if(n)if(e){const i=n.indexOf(e);-1!==i&&(n.splice(i,1),0===n.length&&delete this.Gt[t])}else delete this.Gt[t]}onclose(t){t&&this.Yt.push(t)}onreconnecting(t){t&&this.Zt.push(t)}onreconnected(t){t&&this.Qt.push(t)}Vt(t){if(this.he(),this.ee||(t=this.Ee(t),this.ee=!0),t){const e=this.zt.parseMessages(t,this.H);for(const t of e)switch(t.type){case Gt.Invocation:this.Se(t);break;case Gt.StreamItem:case Gt.Completion:{const e=this.Kt[t.invocationId];if(e){t.type===Gt.Completion&&delete this.Kt[t.invocationId];try{e(t)}catch(t){this.H.log(Vt.Error,`Stream callback threw error: ${ue(t)}`)}}break}case Gt.Ping:break;case Gt.Close:{this.H.log(Vt.Information,"Close message received from server.");const e=t.error?new Error("Server returned an error on close: "+t.error):void 0;!0===t.allowReconnect?this.connection.stop(e):this.gt=this.bt(e);break}default:this.H.log(Vt.Warning,`Invalid message type: ${t.type}.`)}}this.ue()}Ee(t){let e,n;try{[n,e]=this.qt.parseHandshakeResponse(t)}catch(t){const e="Error parsing handshake response: "+t;this.H.log(Vt.Error,e);const n=new Error(e);throw this.ce(n),n}if(e.error){const t="Server returned handshake error: "+e.error;this.H.log(Vt.Error,t);const n=new Error(t);throw this.ce(n),n}return this.H.log(Vt.Debug,"Server handshake complete."),this.oe(),n}le(){this.connection.features.inherentKeepAlive||(this.Ft=(new Date).getTime()+this.keepAliveIntervalInMilliseconds,this.fe())}ue(){if(!(this.connection.features&&this.connection.features.inherentKeepAlive||(this.$e=setTimeout((()=>this.serverTimeout()),this.serverTimeoutInMilliseconds),void 0!==this.Ce))){let t=this.Ft-(new Date).getTime();t<0&&(t=0),this.Ce=setTimeout((async()=>{if(this.ft===Yt.Connected)try{await this.ae(this.ne)}catch{this.fe()}}),t)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}async Se(t){const e=t.target.toLowerCase(),n=this.Gt[e];if(!n)return this.H.log(Vt.Warning,`No client method with the name '${e}' found.`),void(t.invocationId&&(this.H.log(Vt.Warning,`No result given for '${e}' method and invocation ID '${t.invocationId}'.`),await this.ge(this.ke(t.invocationId,"Client didn't provide a result.",null))));const i=n.slice(),r=!!t.invocationId;let s,o,c;for(const n of i)try{const i=s;s=await n.apply(this,t.arguments),r&&s&&i&&(this.H.log(Vt.Error,`Multiple results provided for '${e}'. Sending error to server.`),c=this.ke(t.invocationId,"Client provided multiple results.",null)),o=void 0}catch(t){o=t,this.H.log(Vt.Error,`A callback for the method '${e}' threw error '${t}'.`)}c?await this.ge(c):r?(o?c=this.ke(t.invocationId,`${o}`,null):void 0!==s?c=this.ke(t.invocationId,null,s):(this.H.log(Vt.Warning,`No result given for '${e}' method and invocation ID '${t.invocationId}'.`),c=this.ke(t.invocationId,"Client didn't provide a result.",null)),await this.ge(c)):s&&this.H.log(Vt.Error,`Result given for '${e}' method but server is not expecting a result.`)}Xt(t){this.H.log(Vt.Debug,`HubConnection.connectionClosed(${t}) called while in state ${this.ft}.`),this.se=this.se||t||new Ot("The underlying connection was closed before the hub handshake could complete."),this.oe&&this.oe(),this.Te(t||new Error("Invocation canceled due to the underlying connection being closed.")),this.he(),this.fe(),this.ft===Yt.Disconnecting?this.we(t):this.ft===Yt.Connected&&this.Wt?this.Ie(t):this.ft===Yt.Connected&&this.we(t)}we(t){if(this.dt){this.ft=Yt.Disconnected,this.dt=!1,te.isBrowser&&window.document.removeEventListener("freeze",this.Jt);try{this.Yt.forEach((e=>e.apply(this,[t])))}catch(e){this.H.log(Vt.Error,`An onclose callback called with error '${t}' threw error '${e}'.`)}}}async Ie(t){const e=Date.now();let n=0,i=void 0!==t?t:new Error("Attempting to reconnect due to a unknown error."),r=this.Ae(n++,0,i);if(null===r)return this.H.log(Vt.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this.we(t);if(this.ft=Yt.Reconnecting,t?this.H.log(Vt.Information,`Connection reconnecting because of error '${t}'.`):this.H.log(Vt.Information,"Connection reconnecting."),0!==this.Zt.length){try{this.Zt.forEach((e=>e.apply(this,[t])))}catch(e){this.H.log(Vt.Error,`An onreconnecting callback called with error '${t}' threw error '${e}'.`)}if(this.ft!==Yt.Reconnecting)return void this.H.log(Vt.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;null!==r;){if(this.H.log(Vt.Information,`Reconnect attempt number ${n} will start in ${r} ms.`),await new Promise((t=>{this.de=setTimeout(t,r)})),this.de=void 0,this.ft!==Yt.Reconnecting)return void this.H.log(Vt.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this.vt(),this.ft=Yt.Connected,this.H.log(Vt.Information,"HubConnection reconnected successfully."),0!==this.Qt.length)try{this.Qt.forEach((t=>t.apply(this,[this.connection.connectionId])))}catch(t){this.H.log(Vt.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${t}'.`)}return}catch(t){if(this.H.log(Vt.Information,`Reconnect attempt failed because of error '${t}'.`),this.ft!==Yt.Reconnecting)return this.H.log(Vt.Debug,`Connection moved to the '${this.ft}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this.ft===Yt.Disconnecting&&this.we());i=t instanceof Error?t:new Error(t.toString()),r=this.Ae(n++,Date.now()-e,i)}}this.H.log(Vt.Information,`Reconnect retries have been exhausted after ${Date.now()-e} ms and ${n} failed attempts. Connection disconnecting.`),this.we()}Ae(t,e,n){try{return this.Wt.nextRetryDelayInMilliseconds({elapsedMilliseconds:e,previousRetryCount:t,retryReason:n})}catch(n){return this.H.log(Vt.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${t}, ${e}) threw error '${n}'.`),null}}Te(t){const e=this.Kt;this.Kt={},Object.keys(e).forEach((n=>{const i=e[n];try{i(null,t)}catch(e){this.H.log(Vt.Error,`Stream 'error' callback called with '${t}' threw error: ${ue(e)}`)}}))}fe(){this.Ce&&(clearTimeout(this.Ce),this.Ce=void 0)}he(){this.$e&&clearTimeout(this.$e)}be(t,e,n,i){if(n)return 0!==i.length?{arguments:e,streamIds:i,target:t,type:Gt.Invocation}:{arguments:e,target:t,type:Gt.Invocation};{const n=this.te;return this.te++,0!==i.length?{arguments:e,invocationId:n.toString(),streamIds:i,target:t,type:Gt.Invocation}:{arguments:e,invocationId:n.toString(),target:t,type:Gt.Invocation}}}ye(t,e){if(0!==t.length){e||(e=Promise.resolve());for(const n in t)t[n].subscribe({complete:()=>{e=e.then((()=>this.ge(this.ke(n))))},error:t=>{let i;i=t instanceof Error?t.message:t&&t.toString?t.toString():"Unknown error",e=e.then((()=>this.ge(this.ke(n,i))))},next:t=>{e=e.then((()=>this.ge(this._e(n,t))))}})}}pe(t){const e=[],n=[];for(let i=0;i=55296&&r<=56319&&i65535&&(u-=65536,s.push(u>>>10&1023|55296),u=56320|1023&u),s.push(u)}else s.push(c);s.length>=4096&&(o+=String.fromCharCode.apply(String,s),s.length=0)}return s.length>0&&(o+=String.fromCharCode.apply(String,s)),o}var Oe,je=Ne?new TextDecoder:null,Be=Ne?"undefined"!=typeof process&&"force"!==process.env.TEXT_DECODER?200:0:Pe,Fe=function(t,e){this.type=t,this.data=e},Je=(Oe=function(t,e){return Oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Oe(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Oe(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),ze=function(t){function e(n){var i=t.call(this,n)||this,r=Object.create(e.prototype);return Object.setPrototypeOf(i,r),Object.defineProperty(i,"name",{configurable:!0,enumerable:!1,value:e.name}),i}return Je(e,t),e}(Error),We={type:-1,encode:function(t){var e,n,i,r;return t instanceof Date?function(t){var e,n=t.sec,i=t.nsec;if(n>=0&&i>=0&&n<=17179869183){if(0===i&&n<=4294967295){var r=new Uint8Array(4);return(e=new DataView(r.buffer)).setUint32(0,n),r}var s=n/4294967296,o=4294967295&n;return r=new Uint8Array(8),(e=new DataView(r.buffer)).setUint32(0,i<<2|3&s),e.setUint32(4,o),r}return r=new Uint8Array(12),(e=new DataView(r.buffer)).setUint32(0,i),xe(e,4,n),r}((i=1e6*((e=t.getTime())-1e3*(n=Math.floor(e/1e3))),{sec:n+(r=Math.floor(i/1e9)),nsec:i-1e9*r})):null},decode:function(t){var e=function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:var n=e.getUint32(0);return{sec:4294967296*(3&n)+e.getUint32(4),nsec:n>>>2};case 12:return{sec:De(e,4),nsec:e.getUint32(0)};default:throw new ze("Unrecognized data size for timestamp (expected 4, 8, or 12): "+t.length)}}(t);return new Date(1e3*e.sec+e.nsec/1e6)}},qe=function(){function t(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(We)}return t.prototype.register=function(t){var e=t.type,n=t.encode,i=t.decode;if(e>=0)this.encoders[e]=n,this.decoders[e]=i;else{var r=1+e;this.builtInEncoders[r]=n,this.builtInDecoders[r]=i}},t.prototype.tryToEncode=function(t,e){for(var n=0;nthis.maxDepth)throw new Error("Too deep objects in depth "+e);null==t?this.encodeNil():"boolean"==typeof t?this.encodeBoolean(t):"number"==typeof t?this.encodeNumber(t):"string"==typeof t?this.encodeString(t):this.encodeObject(t,e)},t.prototype.ensureBufferSizeToWrite=function(t){var e=this.pos+t;this.view.byteLength=0?t<128?this.writeU8(t):t<256?(this.writeU8(204),this.writeU8(t)):t<65536?(this.writeU8(205),this.writeU16(t)):t<4294967296?(this.writeU8(206),this.writeU32(t)):(this.writeU8(207),this.writeU64(t)):t>=-32?this.writeU8(224|t+32):t>=-128?(this.writeU8(208),this.writeI8(t)):t>=-32768?(this.writeU8(209),this.writeI16(t)):t>=-2147483648?(this.writeU8(210),this.writeI32(t)):(this.writeU8(211),this.writeI64(t)):this.forceFloat32?(this.writeU8(202),this.writeF32(t)):(this.writeU8(203),this.writeF64(t))},t.prototype.writeStringHeader=function(t){if(t<32)this.writeU8(160+t);else if(t<256)this.writeU8(217),this.writeU8(t);else if(t<65536)this.writeU8(218),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too long string: "+t+" bytes in UTF-8");this.writeU8(219),this.writeU32(t)}},t.prototype.encodeString=function(t){if(t.length>Ue){var e=Me(t);this.ensureBufferSizeToWrite(5+e),this.writeStringHeader(e),He(t,this.bytes,this.pos),this.pos+=e}else e=Me(t),this.ensureBufferSizeToWrite(5+e),this.writeStringHeader(e),function(t,e,n){for(var i=t.length,r=n,s=0;s>6&31|192;else{if(o>=55296&&o<=56319&&s>12&15|224,e[r++]=o>>6&63|128):(e[r++]=o>>18&7|240,e[r++]=o>>12&63|128,e[r++]=o>>6&63|128)}e[r++]=63&o|128}else e[r++]=o}}(t,this.bytes,this.pos),this.pos+=e},t.prototype.encodeObject=function(t,e){var n=this.extensionCodec.tryToEncode(t,this.context);if(null!=n)this.encodeExtension(n);else if(Array.isArray(t))this.encodeArray(t,e);else if(ArrayBuffer.isView(t))this.encodeBinary(t);else{if("object"!=typeof t)throw new Error("Unrecognized object: "+Object.prototype.toString.apply(t));this.encodeMap(t,e)}},t.prototype.encodeBinary=function(t){var e=t.byteLength;if(e<256)this.writeU8(196),this.writeU8(e);else if(e<65536)this.writeU8(197),this.writeU16(e);else{if(!(e<4294967296))throw new Error("Too large binary: "+e);this.writeU8(198),this.writeU32(e)}var n=Ve(t);this.writeU8a(n)},t.prototype.encodeArray=function(t,e){var n=t.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: "+n);this.writeU8(221),this.writeU32(n)}for(var i=0,r=t;i0&&t<=this.maxKeyLength},t.prototype.find=function(t,e,n){t:for(var i=0,r=this.caches[n-1];i=this.maxLengthPerKey?n[Math.random()*n.length|0]=i:n.push(i)},t.prototype.decode=function(t,e,n){var i=this.find(t,e,n);if(null!=i)return this.hit++,i;this.miss++;var r=Le(t,e,n),s=Uint8Array.prototype.slice.call(t,e,e+n);return this.store(s,r),r},t}(),Ye=function(t,e){var n,i,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function c(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]1||c(t,e)}))})}function c(t,e){try{(n=r[t](e)).value instanceof Qe?Promise.resolve(n.value.v).then(a,h):u(s[0][2],n)}catch(t){u(s[0][3],t)}var n}function a(t){c("next",t)}function h(t){c("throw",t)}function u(t,e){t(e),s.shift(),s.length&&c(s[0][0],s[0][1])}},en=new DataView(new ArrayBuffer(0)),nn=new Uint8Array(en.buffer),rn=function(){try{en.getInt8(0)}catch(t){return t.constructor}throw new Error("never reached")}(),sn=new rn("Insufficient data"),on=new Ge,cn=function(){function t(t,e,n,i,r,s,o,c){void 0===t&&(t=qe.defaultCodec),void 0===e&&(e=void 0),void 0===n&&(n=Pe),void 0===i&&(i=Pe),void 0===r&&(r=Pe),void 0===s&&(s=Pe),void 0===o&&(o=Pe),void 0===c&&(c=on),this.extensionCodec=t,this.context=e,this.maxStrLength=n,this.maxBinLength=i,this.maxArrayLength=r,this.maxMapLength=s,this.maxExtLength=o,this.keyDecoder=c,this.totalPos=0,this.pos=0,this.view=en,this.bytes=nn,this.headByte=-1,this.stack=[]}return t.prototype.reinitializeState=function(){this.totalPos=0,this.headByte=-1,this.stack.length=0},t.prototype.setBuffer=function(t){this.bytes=Ve(t),this.view=function(t){if(t instanceof ArrayBuffer)return new DataView(t);var e=Ve(t);return new DataView(e.buffer,e.byteOffset,e.byteLength)}(this.bytes),this.pos=0},t.prototype.appendBuffer=function(t){if(-1!==this.headByte||this.hasRemaining(1)){var e=this.bytes.subarray(this.pos),n=Ve(t),i=new Uint8Array(e.length+n.length);i.set(e),i.set(n,e.length),this.setBuffer(i)}else this.setBuffer(t)},t.prototype.hasRemaining=function(t){return this.view.byteLength-this.pos>=t},t.prototype.createExtraByteError=function(t){var e=this.view,n=this.pos;return new RangeError("Extra "+(e.byteLength-n)+" of "+e.byteLength+" byte(s) found at buffer["+t+"]")},t.prototype.decode=function(t){this.reinitializeState(),this.setBuffer(t);var e=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return e},t.prototype.decodeMulti=function(t){return Ye(this,(function(e){switch(e.label){case 0:this.reinitializeState(),this.setBuffer(t),e.label=1;case 1:return this.hasRemaining(1)?[4,this.doDecodeSync()]:[3,3];case 2:return e.sent(),[3,1];case 3:return[2]}}))},t.prototype.decodeAsync=function(t){var e,n,i,r,s,o,c;return s=this,void 0,c=function(){var s,o,c,a,h,u,l,f;return Ye(this,(function(d){switch(d.label){case 0:s=!1,d.label=1;case 1:d.trys.push([1,6,7,12]),e=Ze(t),d.label=2;case 2:return[4,e.next()];case 3:if((n=d.sent()).done)return[3,5];if(c=n.value,s)throw this.createExtraByteError(this.totalPos);this.appendBuffer(c);try{o=this.doDecodeSync(),s=!0}catch(t){if(!(t instanceof rn))throw t}this.totalPos+=this.pos,d.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return a=d.sent(),i={error:a},[3,12];case 7:return d.trys.push([7,,10,11]),n&&!n.done&&(r=e.return)?[4,r.call(e)]:[3,9];case 8:d.sent(),d.label=9;case 9:return[3,11];case 10:if(i)throw i.error;return[7];case 11:return[7];case 12:if(s){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return[2,o]}throw u=(h=this).headByte,l=h.pos,f=h.totalPos,new RangeError("Insufficient data in parsing "+Ke(u)+" at "+f+" ("+l+" in the current buffer)")}}))},new((o=void 0)||(o=Promise))((function(t,e){function n(t){try{r(c.next(t))}catch(t){e(t)}}function i(t){try{r(c.throw(t))}catch(t){e(t)}}function r(e){var r;e.done?t(e.value):(r=e.value,r instanceof o?r:new o((function(t){t(r)}))).then(n,i)}r((c=c.apply(s,[])).next())}))},t.prototype.decodeArrayStream=function(t){return this.decodeMultiAsync(t,!0)},t.prototype.decodeStream=function(t){return this.decodeMultiAsync(t,!1)},t.prototype.decodeMultiAsync=function(t,e){return tn(this,arguments,(function(){var n,i,r,s,o,c,a,h,u;return Ye(this,(function(l){switch(l.label){case 0:n=e,i=-1,l.label=1;case 1:l.trys.push([1,13,14,19]),r=Ze(t),l.label=2;case 2:return[4,Qe(r.next())];case 3:if((s=l.sent()).done)return[3,12];if(o=s.value,e&&0===i)throw this.createExtraByteError(this.totalPos);this.appendBuffer(o),n&&(i=this.readArraySize(),n=!1,this.complete()),l.label=4;case 4:l.trys.push([4,9,,10]),l.label=5;case 5:return[4,Qe(this.doDecodeSync())];case 6:return[4,l.sent()];case 7:return l.sent(),0==--i?[3,8]:[3,5];case 8:return[3,10];case 9:if(!((c=l.sent())instanceof rn))throw c;return[3,10];case 10:this.totalPos+=this.pos,l.label=11;case 11:return[3,2];case 12:return[3,19];case 13:return a=l.sent(),h={error:a},[3,19];case 14:return l.trys.push([14,,17,18]),s&&!s.done&&(u=r.return)?[4,Qe(u.call(r))]:[3,16];case 15:l.sent(),l.label=16;case 16:return[3,18];case 17:if(h)throw h.error;return[7];case 18:return[7];case 19:return[2]}}))}))},t.prototype.doDecodeSync=function(){t:for(;;){var t=this.readHeadByte(),e=void 0;if(t>=224)e=t-256;else if(t<192)if(t<128)e=t;else if(t<144){if(0!=(i=t-128)){this.pushMapState(i),this.complete();continue t}e={}}else if(t<160){if(0!=(i=t-144)){this.pushArrayState(i),this.complete();continue t}e=[]}else{var n=t-160;e=this.decodeUtf8String(n,0)}else if(192===t)e=null;else if(194===t)e=!1;else if(195===t)e=!0;else if(202===t)e=this.readF32();else if(203===t)e=this.readF64();else if(204===t)e=this.readU8();else if(205===t)e=this.readU16();else if(206===t)e=this.readU32();else if(207===t)e=this.readU64();else if(208===t)e=this.readI8();else if(209===t)e=this.readI16();else if(210===t)e=this.readI32();else if(211===t)e=this.readI64();else if(217===t)n=this.lookU8(),e=this.decodeUtf8String(n,1);else if(218===t)n=this.lookU16(),e=this.decodeUtf8String(n,2);else if(219===t)n=this.lookU32(),e=this.decodeUtf8String(n,4);else if(220===t){if(0!==(i=this.readU16())){this.pushArrayState(i),this.complete();continue t}e=[]}else if(221===t){if(0!==(i=this.readU32())){this.pushArrayState(i),this.complete();continue t}e=[]}else if(222===t){if(0!==(i=this.readU16())){this.pushMapState(i),this.complete();continue t}e={}}else if(223===t){if(0!==(i=this.readU32())){this.pushMapState(i),this.complete();continue t}e={}}else if(196===t){var i=this.lookU8();e=this.decodeBinary(i,1)}else if(197===t)i=this.lookU16(),e=this.decodeBinary(i,2);else if(198===t)i=this.lookU32(),e=this.decodeBinary(i,4);else if(212===t)e=this.decodeExtension(1,0);else if(213===t)e=this.decodeExtension(2,0);else if(214===t)e=this.decodeExtension(4,0);else if(215===t)e=this.decodeExtension(8,0);else if(216===t)e=this.decodeExtension(16,0);else if(199===t)i=this.lookU8(),e=this.decodeExtension(i,1);else if(200===t)i=this.lookU16(),e=this.decodeExtension(i,2);else{if(201!==t)throw new ze("Unrecognized type byte: "+Ke(t));i=this.lookU32(),e=this.decodeExtension(i,4)}this.complete();for(var r=this.stack;r.length>0;){var s=r[r.length-1];if(0===s.type){if(s.array[s.position]=e,s.position++,s.position!==s.size)continue t;r.pop(),e=s.array}else{if(1===s.type){if("string"!=(o=typeof e)&&"number"!==o)throw new ze("The type of key must be string or number but "+typeof e);if("__proto__"===e)throw new ze("The key __proto__ is not allowed");s.key=e,s.type=2;continue t}if(s.map[s.key]=e,s.readCount++,s.readCount!==s.size){s.key=null,s.type=1;continue t}r.pop(),e=s.map}}return e}var o},t.prototype.readHeadByte=function(){return-1===this.headByte&&(this.headByte=this.readU8()),this.headByte},t.prototype.complete=function(){this.headByte=-1},t.prototype.readArraySize=function(){var t=this.readHeadByte();switch(t){case 220:return this.readU16();case 221:return this.readU32();default:if(t<160)return t-144;throw new ze("Unrecognized array type byte: "+Ke(t))}},t.prototype.pushMapState=function(t){if(t>this.maxMapLength)throw new ze("Max length exceeded: map length ("+t+") > maxMapLengthLength ("+this.maxMapLength+")");this.stack.push({type:1,size:t,key:null,readCount:0,map:{}})},t.prototype.pushArrayState=function(t){if(t>this.maxArrayLength)throw new ze("Max length exceeded: array length ("+t+") > maxArrayLength ("+this.maxArrayLength+")");this.stack.push({type:0,size:t,array:new Array(t),position:0})},t.prototype.decodeUtf8String=function(t,e){var n;if(t>this.maxStrLength)throw new ze("Max length exceeded: UTF-8 byte length ("+t+") > maxStrLength ("+this.maxStrLength+")");if(this.bytes.byteLengthBe?function(t,e,n){var i=t.subarray(e,e+n);return je.decode(i)}(this.bytes,r,t):Le(this.bytes,r,t),this.pos+=e+t,i},t.prototype.stateIsMapKey=function(){return this.stack.length>0&&1===this.stack[this.stack.length-1].type},t.prototype.decodeBinary=function(t,e){if(t>this.maxBinLength)throw new ze("Max length exceeded: bin length ("+t+") > maxBinLength ("+this.maxBinLength+")");if(!this.hasRemaining(t+e))throw sn;var n=this.pos+e,i=this.bytes.subarray(n,n+t);return this.pos+=e+t,i},t.prototype.decodeExtension=function(t,e){if(t>this.maxExtLength)throw new ze("Max length exceeded: ext length ("+t+") > maxExtLength ("+this.maxExtLength+")");var n=this.view.getInt8(this.pos+e),i=this.decodeBinary(t,e+1);return this.extensionCodec.decode(i,n,this.context)},t.prototype.lookU8=function(){return this.view.getUint8(this.pos)},t.prototype.lookU16=function(){return this.view.getUint16(this.pos)},t.prototype.lookU32=function(){return this.view.getUint32(this.pos)},t.prototype.readU8=function(){var t=this.view.getUint8(this.pos);return this.pos++,t},t.prototype.readI8=function(){var t=this.view.getInt8(this.pos);return this.pos++,t},t.prototype.readU16=function(){var t=this.view.getUint16(this.pos);return this.pos+=2,t},t.prototype.readI16=function(){var t=this.view.getInt16(this.pos);return this.pos+=2,t},t.prototype.readU32=function(){var t=this.view.getUint32(this.pos);return this.pos+=4,t},t.prototype.readI32=function(){var t=this.view.getInt32(this.pos);return this.pos+=4,t},t.prototype.readU64=function(){var t,e,n=(t=this.view,e=this.pos,4294967296*t.getUint32(e)+t.getUint32(e+4));return this.pos+=8,n},t.prototype.readI64=function(){var t=De(this.view,this.pos);return this.pos+=8,t},t.prototype.readF32=function(){var t=this.view.getFloat32(this.pos);return this.pos+=4,t},t.prototype.readF64=function(){var t=this.view.getFloat64(this.pos);return this.pos+=8,t},t}();class an{static write(t){let e=t.byteLength||t.length;const n=[];do{let t=127&e;e>>=7,e>0&&(t|=128),n.push(t)}while(e>0);e=t.byteLength||t.length;const i=new Uint8Array(n.length+e);return i.set(n,0),i.set(t,n.length),i.buffer}static parse(t){const e=[],n=new Uint8Array(t),i=[0,7,14,21,28];for(let r=0;r7)throw new Error("Messages bigger than 2GB are not supported.");if(!(n.byteLength>=r+o+c))throw new Error("Incomplete message.");e.push(n.slice?n.slice(r+o,r+o+c):n.subarray(r+o,r+o+c)),r=r+o+c}return e}}const hn=new Uint8Array([145,Gt.Ping]);class un{constructor(t){this.name="messagepack",this.version=1,this.transferFormat=Kt.Binary,this.Re=1,this.Ue=2,this.He=3,t=t||{},this.Le=new Xe(t.extensionCodec,t.context,t.maxDepth,t.initialBufferSize,t.sortKeys,t.forceFloat32,t.ignoreUndefined,t.forceIntegerToFloat),this.Oe=new cn(t.extensionCodec,t.context,t.maxStrLength,t.maxBinLength,t.maxArrayLength,t.maxMapLength,t.maxExtLength)}parseMessages(t,e){if(!(n=t)||"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===e&&(e=Zt.instance);const i=an.parse(t),r=[];for(const t of i){const n=this.je(t,e);n&&r.push(n)}return r}writeMessage(t){switch(t.type){case Gt.Invocation:return this.Be(t);case Gt.StreamInvocation:return this.Fe(t);case Gt.StreamItem:return this.Je(t);case Gt.Completion:return this.ze(t);case Gt.Ping:return an.write(hn);case Gt.CancelInvocation:return this.We(t);default:throw new Error("Invalid message type.")}}je(t,e){if(0===t.length)throw new Error("Invalid payload.");const n=this.Oe.decode(t);if(0===n.length||!(n instanceof Array))throw new Error("Invalid payload.");const i=n[0];switch(i){case Gt.Invocation:return this.qe(this.Ve(n),n);case Gt.StreamItem:return this._e(this.Ve(n),n);case Gt.Completion:return this.ke(this.Ve(n),n);case Gt.Ping:return this.Xe(n);case Gt.Close:return this.Ke(n);default:return e.log(Vt.Information,"Unknown message type '"+i+"' ignored."),null}}Ke(t){if(t.length<2)throw new Error("Invalid payload for Close message.");return{allowReconnect:t.length>=3?t[2]:void 0,error:t[1],type:Gt.Close}}Xe(t){if(t.length<1)throw new Error("Invalid payload for Ping message.");return{type:Gt.Ping}}qe(t,e){if(e.length<5)throw new Error("Invalid payload for Invocation message.");const n=e[2];return n?{arguments:e[4],headers:t,invocationId:n,streamIds:[],target:e[3],type:Gt.Invocation}:{arguments:e[4],headers:t,streamIds:[],target:e[3],type:Gt.Invocation}}_e(t,e){if(e.length<4)throw new Error("Invalid payload for StreamItem message.");return{headers:t,invocationId:e[2],item:e[3],type:Gt.StreamItem}}ke(t,e){if(e.length<4)throw new Error("Invalid payload for Completion message.");const n=e[3];if(n!==this.Ue&&e.length<5)throw new Error("Invalid payload for Completion message.");let i,r;switch(n){case this.Re:i=e[4];break;case this.He:r=e[4]}return{error:i,headers:t,invocationId:e[2],result:r,type:Gt.Completion}}Be(t){let e;return e=t.streamIds?this.Le.encode([Gt.Invocation,t.headers||{},t.invocationId||null,t.target,t.arguments,t.streamIds]):this.Le.encode([Gt.Invocation,t.headers||{},t.invocationId||null,t.target,t.arguments]),an.write(e.slice())}Fe(t){let e;return e=t.streamIds?this.Le.encode([Gt.StreamInvocation,t.headers||{},t.invocationId,t.target,t.arguments,t.streamIds]):this.Le.encode([Gt.StreamInvocation,t.headers||{},t.invocationId,t.target,t.arguments]),an.write(e.slice())}Je(t){const e=this.Le.encode([Gt.StreamItem,t.headers||{},t.invocationId,t.item]);return an.write(e.slice())}ze(t){const e=t.error?this.Re:t.result?this.He:this.Ue;let n;switch(e){case this.Re:n=this.Le.encode([Gt.Completion,t.headers||{},t.invocationId,e,t.error]);break;case this.Ue:n=this.Le.encode([Gt.Completion,t.headers||{},t.invocationId,e]);break;case this.He:n=this.Le.encode([Gt.Completion,t.headers||{},t.invocationId,e,t.result])}return an.write(n.slice())}We(t){const e=this.Le.encode([Gt.CancelInvocation,t.headers||{},t.invocationId]);return an.write(e.slice())}Ve(t){const e=t[1];if("object"!=typeof e)throw new Error("Invalid headers.");return e}}let ln=!1;function fn(){const t=document.querySelector("#blazor-error-ui");t&&(t.style.display="block"),ln||(ln=!0,document.querySelectorAll("#blazor-error-ui .reload").forEach((t=>{t.onclick=function(t){location.reload(),t.preventDefault()}})),document.querySelectorAll("#blazor-error-ui .dismiss").forEach((t=>{t.onclick=function(t){const e=document.querySelector("#blazor-error-ui");e&&(e.style.display="none"),t.preventDefault()}})))}const dn="function"==typeof TextDecoder?new TextDecoder("utf-8"):null,wn=dn?dn.decode.bind(dn):function(t){let e=0;const n=t.length,i=[],r=[];for(;e65535&&(r-=65536,i.push(r>>>10&1023|55296),r=56320|1023&r),i.push(r)}i.length>1024&&(r.push(String.fromCharCode.apply(null,i)),i.length=0)}return r.push(String.fromCharCode.apply(null,i)),r.join("")},pn=Math.pow(2,32),mn=Math.pow(2,21)-1;function vn(t,e){return t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24}function gn(t,e){return t[e]+(t[e+1]<<8)+(t[e+2]<<16)+(t[e+3]<<24>>>0)}function yn(t,e){const n=gn(t,e+4);if(n>mn)throw new Error(`Cannot read uint64 with high order part ${n}, because the result would exceed Number.MAX_SAFE_INTEGER.`);return n*pn+gn(t,e)}class bn{constructor(t){this.batchData=t;const e=new Cn(t);this.arrayRangeReader=new kn(t),this.arrayBuilderSegmentReader=new Tn(t),this.diffReader=new En(t),this.editReader=new Sn(t,e),this.frameReader=new $n(t,e)}updatedComponents(){return vn(this.batchData,this.batchData.length-20)}referenceFrames(){return vn(this.batchData,this.batchData.length-16)}disposedComponentIds(){return vn(this.batchData,this.batchData.length-12)}disposedEventHandlerIds(){return vn(this.batchData,this.batchData.length-8)}updatedComponentsEntry(t,e){const n=t+4*e;return vn(this.batchData,n)}referenceFramesEntry(t,e){return t+20*e}disposedComponentIdsEntry(t,e){const n=t+4*e;return vn(this.batchData,n)}disposedEventHandlerIdsEntry(t,e){const n=t+8*e;return yn(this.batchData,n)}}class En{constructor(t){this.batchDataUint8=t}componentId(t){return vn(this.batchDataUint8,t)}edits(t){return t+4}editsEntry(t,e){return t+16*e}}class Sn{constructor(t,e){this.batchDataUint8=t,this.stringReader=e}editType(t){return vn(this.batchDataUint8,t)}siblingIndex(t){return vn(this.batchDataUint8,t+4)}newTreeIndex(t){return vn(this.batchDataUint8,t+8)}moveToSiblingIndex(t){return vn(this.batchDataUint8,t+8)}removedAttributeName(t){const e=vn(this.batchDataUint8,t+12);return this.stringReader.readString(e)}}class $n{constructor(t,e){this.batchDataUint8=t,this.stringReader=e}frameType(t){return vn(this.batchDataUint8,t)}subtreeLength(t){return vn(this.batchDataUint8,t+4)}elementReferenceCaptureId(t){const e=vn(this.batchDataUint8,t+4);return this.stringReader.readString(e)}componentId(t){return vn(this.batchDataUint8,t+8)}elementName(t){const e=vn(this.batchDataUint8,t+8);return this.stringReader.readString(e)}textContent(t){const e=vn(this.batchDataUint8,t+4);return this.stringReader.readString(e)}markupContent(t){const e=vn(this.batchDataUint8,t+4);return this.stringReader.readString(e)}attributeName(t){const e=vn(this.batchDataUint8,t+4);return this.stringReader.readString(e)}attributeValue(t){const e=vn(this.batchDataUint8,t+8);return this.stringReader.readString(e)}attributeEventHandlerId(t){return yn(this.batchDataUint8,t+12)}}class Cn{constructor(t){this.batchDataUint8=t,this.stringTableStartIndex=vn(t,t.length-4)}readString(t){if(-1===t)return null;{const n=vn(this.batchDataUint8,this.stringTableStartIndex+4*t),i=function(t,e){let n=0,i=0;for(let r=0;r<4;r++){const s=t[e+r];if(n|=(127&s)<this.nextBatchId)return this.fatalError?(this.logger.log(In.Debug,`Received a new batch ${t} 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(In.Debug,`Waiting for batch ${this.nextBatchId}. Batch ${t} not processed.`);try{this.nextBatchId++,this.logger.log(In.Debug,`Applying batch ${t}.`),function(t,e){const n=ft[t];if(!n)throw new Error(`There is no browser renderer with ID ${t}.`);const i=e.arrayRangeReader,r=e.updatedComponents(),s=i.values(r),o=i.count(r),c=e.referenceFrames(),a=i.values(c),h=e.diffReader;for(let t=0;t=this.minLevel){const n=`[${(new Date).toISOString()}] ${In[t]}: ${e}`;switch(t){case In.Critical:case In.Error:console.error(n);break;case In.Warning:console.warn(n);break;case In.Information:console.info(n);break;default:console.log(n)}}}}class xn{constructor(t,e){this.circuitId=void 0,this.components=t,this.applicationState=e}reconnect(t){if(!this.circuitId)throw new Error("Circuit host not initialized.");return t.state!==Yt.Connected?Promise.resolve(!1):t.invoke("ConnectCircuit",this.circuitId)}initialize(t){if(this.circuitId)throw new Error(`Circuit host '${this.circuitId}' already initialized.`);this.circuitId=t}async startCircuit(t){if(t.state!==Yt.Connected)return!1;const e=await t.invoke("StartCircuit",vt.getBaseURI(),vt.getLocationHref(),JSON.stringify(this.components.map((t=>t.toRecord()))),this.applicationState||"");return!!e&&(this.initialize(e),!0)}resolveElement(t){const e=function(t){const e=w.get(t);if(e)return w.delete(t),e}(t);if(e)return L(e,!0);const n=Number.parseInt(t);if(!Number.isNaN(n))return function(t,e){if(!t.parentNode)throw new Error(`Comment not connected to the DOM ${t.textContent}`);const n=t.parentNode,i=L(n,!0),r=W(i);return Array.from(n.childNodes).forEach((t=>r.push(t))),t[U]=i,e&&(t[H]=e,L(e)),L(t)}(this.components[n].start,this.components[n].end);throw new Error(`Invalid sequence number or identifier '${t}'.`)}}const Dn={configureSignalR:t=>{},logLevel:In.Warning,reconnectionOptions:{maxRetries:8,retryIntervalMilliseconds:2e4,dialogId:"components-reconnect-modal"}};class Nn{constructor(t,e,n,i){this.maxRetries=e,this.document=n,this.logger=i,this.addedToDom=!1,this.modal=this.document.createElement("div"),this.modal.id=t,this.maxRetries=e,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(t){this.logger.log(In.Error,t),this.failed()}}))}show(){this.addedToDom||(this.addedToDom=!0,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(t){this.message.textContent=`Attempting to reconnect to the server: ${t} 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 t=this.document.createTextNode("Reconnection failed. Try "),e=this.document.createElement("a");e.textContent="reloading",e.setAttribute("href",""),e.addEventListener("click",(()=>location.reload()));const n=this.document.createTextNode(" the page if you're unable to reconnect.");this.message.replaceChildren(t,e,n)}rejected(){this.button.style.display="none",this.reloadParagraph.style.display="none",this.loader.style.display="none";const t=this.document.createTextNode("Could not reconnect to the server. "),e=this.document.createElement("a");e.textContent="Reload",e.setAttribute("href",""),e.addEventListener("click",(()=>location.reload()));const n=this.document.createTextNode(" the page to restore functionality.");this.message.replaceChildren(t,e,n)}getLoader(){const t=this.document.createElement("div");return t.style.cssText=["border: 0.3em solid #f3f3f3","border-top: 0.3em solid #3498db","border-radius: 50%","width: 2em","height: 2em","display: inline-block"].join(";"),t.animate([{transform:"rotate(0deg)"},{transform:"rotate(360deg)"}],{duration:2e3,iterations:1/0}),t}}class Mn{constructor(t,e,n){this.dialog=t,this.maxRetries=e,this.document=n,this.document=n;const i=this.document.getElementById(Mn.MaxRetriesId);i&&(i.innerText=this.maxRetries.toString())}show(){this.removeClasses(),this.dialog.classList.add(Mn.ShowClassName)}update(t){const e=this.document.getElementById(Mn.CurrentAttemptId);e&&(e.innerText=t.toString())}hide(){this.removeClasses(),this.dialog.classList.add(Mn.HideClassName)}failed(){this.removeClasses(),this.dialog.classList.add(Mn.FailedClassName)}rejected(){this.removeClasses(),this.dialog.classList.add(Mn.RejectedClassName)}removeClasses(){this.dialog.classList.remove(Mn.ShowClassName,Mn.HideClassName,Mn.FailedClassName,Mn.RejectedClassName)}}Mn.ShowClassName="components-reconnect-show",Mn.HideClassName="components-reconnect-hide",Mn.FailedClassName="components-reconnect-failed",Mn.RejectedClassName="components-reconnect-rejected",Mn.MaxRetriesId="components-reconnect-max-retries",Mn.CurrentAttemptId="components-reconnect-current-attempt";class Rn{constructor(t,e,n){this.Ge=null,this.H=t,this.Ye=e,this.Ze=n||Mt.reconnect}onConnectionDown(t,e){if(!this.Ye){const e=document.getElementById(t.dialogId);this.Ye=e?new Mn(e,t.maxRetries,document):new Nn(t.dialogId,t.maxRetries,document,this.H)}this.Ge||(this.Ge=new Un(t,this.H,this.Ze,this.Ye))}onConnectionUp(){this.Ge&&(this.Ge.dispose(),this.Ge=null)}}class Un{constructor(t,e,n,i){this.logger=e,this.reconnectCallback=n,this.isDisposed=!1,this.reconnectDisplay=i,this.reconnectDisplay.show(),this.attemptPeriodicReconnection(t)}dispose(){this.isDisposed=!0,this.reconnectDisplay.hide()}async attemptPeriodicReconnection(t){for(let e=0;eUn.MaximumFirstRetryInterval?Un.MaximumFirstRetryInterval:t.retryIntervalMilliseconds;if(await this.delay(n),this.isDisposed)break;try{return await this.reconnectCallback()?void 0:void this.reconnectDisplay.rejected()}catch(t){this.logger.log(In.Error,t)}}this.reconnectDisplay.failed()}delay(t){return new Promise((e=>setTimeout(e,t)))}}Un.MaximumFirstRetryInterval=3e3;const Hn=/^\s*Blazor-Component-State:(?[a-zA-Z0-9+/=]+)$/;function Ln(t){var e;if(t.nodeType===Node.COMMENT_NODE){const n=t.textContent||"",i=Hn.exec(n),r=i&&i.groups&&i.groups.state;return r&&(null===(e=t.parentNode)||void 0===e||e.removeChild(t)),r}if(!t.hasChildNodes())return;const n=t.childNodes;for(let t=0;t.*)$/);function Bn(t,e){const n=t.currentElement;if(n&&n.nodeType===Node.COMMENT_NODE&&n.textContent){const i=jn.exec(n.textContent),r=i&&i.groups&&i.groups.descriptor;if(!r)return;try{const i=function(t){const e=JSON.parse(t),{type:n}=e;if("server"!==n&&"webassembly"!==n)throw new Error(`Invalid component type '${n}'.`);return e}(r);switch(e){case"webassembly":return function(t,e,n){const{type:i,assembly:r,typeName:s,parameterDefinitions:o,parameterValues:c,prerenderId:a}=t;if("webassembly"===i){if(!r)throw new Error("assembly must be defined when using a descriptor.");if(!s)throw new Error("typeName must be defined when using a descriptor.");if(a){const t=Fn(a,n);if(!t)throw new Error(`Could not find an end component comment for '${e}'`);return{type:i,assembly:r,typeName:s,parameterDefinitions:o&&atob(o),parameterValues:c&&atob(c),start:e,prerenderId:a,end:t}}return{type:i,assembly:r,typeName:s,parameterDefinitions:o&&atob(o),parameterValues:c&&atob(c),start:e}}}(i,n,t);case"server":return function(t,e,n){const{type:i,descriptor:r,sequence:s,prerenderId:o}=t;if("server"===i){if(!r)throw new Error("descriptor must be defined when using a descriptor.");if(void 0===s)throw new Error("sequence must be defined when using a descriptor.");if(!Number.isInteger(s))throw new Error(`Error parsing the sequence '${s}' for component '${JSON.stringify(t)}'`);if(o){const t=Fn(o,n);if(!t)throw new Error(`Could not find an end component comment for '${e}'`);return{type:i,sequence:s,descriptor:r,start:e,prerenderId:o,end:t}}return{type:i,sequence:s,descriptor:r,start:e}}}(i,n,t)}}catch(t){throw new Error(`Found malformed component comment at ${n.textContent}`)}}}function Fn(t,e){for(;e.next()&&e.currentElement;){const n=e.currentElement;if(n.nodeType!==Node.COMMENT_NODE)continue;if(!n.textContent)continue;const i=jn.exec(n.textContent),r=i&&i[1];if(r)return Jn(r,t),n}}function Jn(t,e){const n=JSON.parse(t);if(1!==Object.keys(n).length)throw new Error(`Invalid end of component comment: '${t}'`);const i=n.prerenderId;if(!i)throw new Error(`End of component comment must have a value for the prerendered property: '${t}'`);if(i!==e)throw new Error(`End of component comment prerendered property must match the start comment prerender id: '${e}', '${i}'`)}class zn{constructor(t){this.childNodes=t,this.currentIndex=-1,this.length=t.length}next(){return this.currentIndex++,this.currentIndexasync function(t,n){const i=function(t){const e=document.baseURI;return e.endsWith("/")?`${e}${t}`:`${e}/${t}`}(n),r=await import(i);if(void 0===r)return;const{beforeStart:s,afterStarted:o}=r;return o&&t.afterStartedCallbacks.push(o),s?s(...e):void 0}(this,t))))}async invokeAfterStartedCallbacks(t){await C,await Promise.all(this.afterStartedCallbacks.map((e=>e(t))))}}let Xn,Kn=!1,Gn=!1;async function Yn(t){if(Gn)throw new Error("Blazor has already started.");Gn=!0;const e=function(t){const e={...Dn,...t};return t&&t.reconnectionOptions&&(e.reconnectionOptions={...Dn.reconnectionOptions,...t.reconnectionOptions}),e}(t),n=await async function(t){const e=await fetch("_blazor/initializers",{method:"GET",credentials:"include",cache:"no-cache"}),n=await e.json(),i=new Vn;return await i.importInitializersAsync(n,[t]),i}(e),i=new Pn(e.logLevel);Mt.reconnect=async t=>{if(Kn)return!1;const n=t||await Zn(e,i,o);return await o.reconnect(n)?(e.reconnectionHandler.onConnectionUp(),!0):(i.log(In.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 Rn(i),e.reconnectionHandler=e.reconnectionHandler||Mt.defaultReconnectionHandler,i.log(In.Information,"Starting up Blazor server-side application.");const r=function(t,e){return function(t){const e=On(t,"server"),n=[];for(let t=0;tt.sequence-e.sequence))}(t)}(document),s=Ln(document),o=new xn(r,s||"");Mt.D.navigationManager.listenForNavigationEvents(((t,e)=>Xn.send("OnLocationChanged",t,e))),Mt.D.forceCloseConnection=()=>Xn.stop(),Mt.D.sendJSDataStream=(t,e,n)=>function(t,e,n,i){setTimeout((async()=>{let r=5,s=(new Date).valueOf();try{const o=e instanceof Blob?e.size:e.byteLength;let c=0,a=0;for(;c1)await t.send("ReceiveJSDataChunk",n,a,u,null);else{if(!await t.invoke("ReceiveJSDataChunk",n,a,u,null))break;const e=(new Date).valueOf(),i=e-s;s=e,r=Math.max(1,Math.round(500/Math.max(1,i)))}c+=h,a++}}catch(e){await t.send("ReceiveJSDataChunk",n,-1,null,e.toString())}}),0)}(Xn,t,e,n);const c=await Zn(e,i,o);if(!await o.startCircuit(c))return void i.log(In.Error,"Failed to start the circuit.");let a=!1;const h=()=>{if(!a){const t=new FormData,e=o.circuitId;t.append("circuitId",e),a=navigator.sendBeacon("_blazor/disconnect",t)}};Mt.disconnect=h,window.addEventListener("unload",h,{capture:!1,once:!0}),i.log(In.Information,"Blazor server-side application started."),n.invokeAfterStartedCallbacks(Mt)}async function Zn(e,n,i){var r,s;const o=new un;o.name="blazorpack";const c=(new _e).withUrl("_blazor").withHubProtocol(o);e.configureSignalR(c);const a=c.build();a.on("JS.AttachComponent",((t,e)=>function(t,e,n,i){let r=ft[0];r||(r=new ot(0),ft[0]=r),r.attachRootComponentToLogicalElement(n,e,!1)}(0,i.resolveElement(e),t))),a.on("JS.BeginInvokeJS",t.jsCallDispatcher.beginInvokeJSFromDotNet),a.on("JS.EndInvokeDotNet",t.jsCallDispatcher.endInvokeDotNetFromJS),a.on("JS.ReceiveByteArray",t.jsCallDispatcher.receiveByteArray),a.on("JS.BeginTransmitStream",(e=>{const n=new ReadableStream({start(t){a.stream("SendDotNetStreamToJS",e).subscribe({next:e=>t.enqueue(e),complete:()=>t.close(),error:e=>t.error(e)})}});t.jsCallDispatcher.supplyDotNetStream(e,n)}));const h=An.getOrCreate(n);a.on("JS.RenderBatch",((t,e)=>{n.log(In.Debug,`Received render batch with id ${t} and ${e.byteLength} bytes.`),h.processBatch(t,e,a)})),a.onclose((t=>!Kn&&e.reconnectionHandler.onConnectionDown(e.reconnectionOptions,t))),a.on("JS.Error",(t=>{Kn=!0,Qn(a,t,n),fn()}));try{await a.start(),Xn=a}catch(t){if(Qn(a,t,n),"FailedToNegotiateWithServerError"===t.errorType)throw t;fn(),t.innerErrors&&(t.innerErrors.some((t=>"UnsupportedTransportError"===t.errorType&&t.transport===Xt.WebSockets))?n.log(In.Error,"Unable to connect, please ensure you are using an updated browser that supports WebSockets."):t.innerErrors.some((t=>"FailedToStartTransportError"===t.errorType&&t.transport===Xt.WebSockets))?n.log(In.Error,"Unable to connect, please ensure WebSockets are available. A VPN or proxy may be blocking the connection."):t.innerErrors.some((t=>"DisabledTransportError"===t.errorType&&t.transport===Xt.LongPolling))&&n.log(In.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===(s=null===(r=a.connection)||void 0===r?void 0:r.features)||void 0===s?void 0:s.inherentKeepAlive)&&n.log(In.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."),t.attachDispatcher({beginInvokeDotNetFromJS:(t,e,n,i,r)=>{a.send("BeginInvokeDotNetFromJS",t?t.toString():null,e,n,i||0,r)},endInvokeJSFromDotNet:(t,e,n)=>{a.send("EndInvokeJSFromDotNet",t,e,n)},sendByteArray:(t,e)=>{a.send("ReceiveByteArray",t,e)}}),a}function Qn(t,e,n){n.log(In.Error,e),t&&t.stop()}Mt.start=Yn,document&&document.currentScript&&"false"!==document.currentScript.getAttribute("autostart")&&Yn()})(); \ 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 860bcf1e3974..1e17bf6108cb 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;!function(e){window.DotNet=e;const t=[],n=new Map,r=new Map,o="__jsObjectId",a="__byte[]";class s{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 i={},c={0:new s(window)};c[0]._cachedFunctions.set("import",(e=>("string"==typeof e&&e.startsWith("./")&&(e=document.baseURI+e.substr(2)),import(e))));let l,u=1,d=1,f=null;function h(e){t.push(e)}function p(e){if(e&&"object"==typeof e){c[d]=new s(e);const t={[o]:d};return d++,t}throw new Error(`Cannot create a JSObjectReference from the value '${e}'.`)}function m(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 n={__jsStreamReferenceLength:t};try{const t=p(e);n.__jsObjectId=t.__jsObjectId}catch(t){throw new Error(`Cannot create a JSStreamReference from the value '${e}'.`)}return n}function b(e){return e?JSON.parse(e,((e,n)=>t.reduce(((t,n)=>n(e,t)),n))):null}function y(e,t,n,r){const o=v();if(o.invokeDotNetFromJS){const a=T(r),s=o.invokeDotNetFromJS(e,t,n,a);return s?b(s):null}throw new Error("The current dispatcher does not support synchronous calls from JS to .NET. Use invokeMethodAsync instead.")}function g(e,t,n,r){if(e&&n)throw new Error(`For instance method calls, assemblyName should be null. Received '${e}'.`);const o=u++,a=new Promise(((e,t)=>{i[o]={resolve:e,reject:t}}));try{const a=T(r);v().beginInvokeDotNetFromJS(o,e,t,n,a)}catch(e){w(o,!1,e)}return a}function v(){if(null!==f)return f;throw new Error("No .NET call dispatcher has been set.")}function w(e,t,n){if(!i.hasOwnProperty(e))throw new Error(`There is no pending async call with ID ${e}.`);const r=i[e];delete i[e],t?r.resolve(n):r.reject(n)}function E(e){return e instanceof Error?`${e.message}\n${e.stack}`:e?e.toString():"null"}function S(e,t){const n=c[t];if(n)return n.findFunction(e);throw new Error(`JS object instance with ID ${t} does not exist (has it been disposed?).`)}function I(e){delete c[e]}e.attachDispatcher=function(e){f=e},e.attachReviver=h,e.invokeMethod=function(e,t,...n){return y(e,t,null,n)},e.invokeMethodAsync=function(e,t,...n){return g(e,t,null,n)},e.createJSObjectReference=p,e.createJSStreamReference=m,e.disposeJSObjectReference=function(e){const t=e&&e.__jsObjectId;"number"==typeof t&&I(t)},function(e){e[e.Default=0]="Default",e[e.JSObjectReference=1]="JSObjectReference",e[e.JSStreamReference=2]="JSStreamReference",e[e.JSVoidResult=3]="JSVoidResult"}(l=e.JSCallResultType||(e.JSCallResultType={})),e.jsCallDispatcher={findJSFunction:S,disposeJSObjectReferenceById:I,invokeJSFromDotNet:(e,t,n,r)=>{const o=k(S(e,r).apply(null,b(t)),n);return null==o?null:T(o)},beginInvokeJSFromDotNet:(e,t,n,r,o)=>{const a=new Promise((e=>{e(S(t,o).apply(null,b(n)))}));e&&a.then((t=>T([e,!0,k(t,r)]))).then((t=>v().endInvokeJSFromDotNet(e,!0,t)),(t=>v().endInvokeJSFromDotNet(e,!1,JSON.stringify([e,!1,E(t)]))))},endInvokeDotNetFromJS:(e,t,n)=>{const r=t?b(n):new Error(n);w(parseInt(e,10),t,r)},receiveByteArray:(e,t)=>{n.set(e,t)},supplyDotNetStream:(e,t)=>{if(r.has(e)){const n=r.get(e);r.delete(e),n.resolve(t)}else{const n=new D;n.resolve(t),r.set(e,n)}}};class C{constructor(e){this._id=e}invokeMethod(e,...t){return y(null,e,this._id,t)}invokeMethodAsync(e,...t){return g(null,e,this._id,t)}dispose(){g(null,"__Dispose",this._id,null).catch((e=>console.error(e)))}serializeAsArg(){return{__dotNetObject:this._id}}}e.DotNetObject=C,h((function(e,t){if(t&&"object"==typeof t){if(t.hasOwnProperty("__dotNetObject"))return new C(t.__dotNetObject);if(t.hasOwnProperty(o)){const e=t.__jsObjectId,n=c[e];if(n)return n.getWrappedObject();throw new Error(`JS object instance with Id '${e}' does not exist. It may have been disposed.`)}if(t.hasOwnProperty(a)){const e=t["__byte[]"],r=n.get(e);if(void 0===r)throw new Error(`Byte array index '${e}' does not exist.`);return n.delete(e),r}if(t.hasOwnProperty("__dotNetStream"))return new A(t.__dotNetStream)}return t}));class A{constructor(e){if(r.has(e))this._streamPromise=r.get(e).streamPromise,r.delete(e);else{const t=new D;r.set(e,t),this._streamPromise=t.streamPromise}}stream(){return this._streamPromise}async arrayBuffer(){return new Response(await this.stream()).arrayBuffer()}}class D{constructor(){this.streamPromise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}function k(e,t){switch(t){case l.Default:return e;case l.JSObjectReference:return p(e);case l.JSStreamReference:return m(e);case l.JSVoidResult:return null;default:throw new Error(`Invalid JS call result type '${t}'.`)}}let R=0;function T(e){return R=0,JSON.stringify(e,N)}function N(e,t){if(t instanceof C)return t.serializeAsArg();if(t instanceof Uint8Array){f.sendByteArray(R,t);const e={[a]:R};return R++,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"}(n||(n={}));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 o=new Map,a=new Map,s=[];function i(e){return o.get(e)}function c(e){const t=o.get(e);return(null==t?void 0:t.browserEventName)||e}function l(e,t){e.forEach((e=>o.set(e,t)))}function u(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}}}}),l(["copy","cut","paste"],{createEventArgs:e=>({type:e.type})}),l(["drag","dragend","dragenter","dragleave","dragover","dragstart","drop"],{createEventArgs:e=>{return{...d(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}}),l(["focus","blur","focusin","focusout"],{createEventArgs:e=>({type:e.type})}),l(["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}}),l(["contextmenu","click","mouseover","mouseout","mousemove","mousedown","mouseup","mouseleave","mouseenter","dblclick"],{createEventArgs:e=>d(e)}),l(["error"],{createEventArgs:e=>{return{message:(t=e).message,filename:t.filename,lineno:t.lineno,colno:t.colno,type:t.type};var t}}),l(["loadstart","timeout","abort","load","loadend","progress"],{createEventArgs:e=>{return{lengthComputable:(t=e).lengthComputable,loaded:t.loaded,total:t.total,type:t.type};var t}}),l(["touchcancel","touchend","touchmove","touchenter","touchleave","touchstart"],{createEventArgs:e=>{return{detail:(t=e).detail,touches:u(t.touches),targetTouches:u(t.targetTouches),changedTouches:u(t.changedTouches),ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,type:t.type};var t}}),l(["gotpointercapture","lostpointercapture","pointercancel","pointerdown","pointerenter","pointerleave","pointermove","pointerout","pointerover","pointerup"],{createEventArgs:e=>{return{...d(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}}),l(["wheel","mousewheel"],{createEventArgs:e=>{return{...d(t=e),deltaX:t.deltaX,deltaY:t.deltaY,deltaZ:t.deltaZ,deltaMode:t.deltaMode};var t}}),l(["toggle"],{createEventArgs:()=>({})});const f=["date","datetime-local","month","time","week"],h=new Map;let p,m,b=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:"+(++b).toString();h.set(r,e);const o=await w().invokeMethodAsync("AddRootComponent",t,r),a=new v(o,m[t]);return await a.setParameters(n),a}};class g{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 v{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 g)}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 w().invokeMethodAsync("SetRootComponentParameters",this._componentId,r,t)}async dispose(){if(null!==this._componentId){await w().invokeMethodAsync("RemoveRootComponent",this._componentId),this._componentId=null;for(const e of this._jsEventCallbackWrappers.values())e.dispose()}}}function w(){if(!p)throw new Error("Dynamic root components have not been enabled in this application.");return p}const E=new Map;let S;const I=new Promise((e=>{S=e}));function C(e,t,n){return D(e,t.eventHandlerId,(()=>A(e).invokeMethodAsync("DispatchEventAsync",t,n)))}function A(e){const t=E.get(e);if(!t)throw new Error(`No interop methods are registered for renderer ${e}`);return t}let D=(e,t,n)=>n();const k=F(["abort","blur","canplay","canplaythrough","change","cuechange","durationchange","emptied","ended","error","focus","load","loadeddata","loadedmetadata","loadend","loadstart","mouseenter","mouseleave","pause","play","playing","progress","ratechange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeupdate","toggle","unload","volumechange","waiting","DOMNodeInsertedIntoDocument","DOMNodeRemovedFromDocument"]),R={submit:!0},T=F(["click","dblclick","mousedown","mousemove","mouseup"]);class N{constructor(e){this.browserRendererId=e,this.afterClickCallbacks=[];const t=++N.nextEventDelegatorId;this.eventsCollectionKey=`_blazorEvents_${t}`,this.eventInfoStore=new _(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,a.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(),a=null,s=!1;const c=Object.prototype.hasOwnProperty.call(k,e);let l=!1;for(;o;){const f=o,h=this.getEventHandlerInfosForElement(f,!1);if(h){const n=h.getHandler(e);if(n&&(u=f,d=t.type,!((u instanceof HTMLButtonElement||u instanceof HTMLInputElement||u instanceof HTMLTextAreaElement||u instanceof HTMLSelectElement)&&Object.prototype.hasOwnProperty.call(T,d)&&u.disabled))){if(!s){const n=i(e);a=(null==n?void 0:n.createEventArgs)?n.createEventArgs(t):{},s=!0}Object.prototype.hasOwnProperty.call(R,t.type)&&t.preventDefault(),C(this.browserRendererId,{eventHandlerId:n.eventHandlerId,eventName:e,eventFieldInfo:r.fromEvent(n.renderingComponentId,t)},a)}h.stopPropagation(e)&&(l=!0),h.preventDefault(e)&&t.preventDefault()}o=c||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 O:null}}N.nextEventDelegatorId=0;class _{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=c(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=c(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 O{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 F(e){const t={};return e.forEach((e=>{t[e]=!0})),t}const j=G("_blazorLogicalChildren"),x=G("_blazorLogicalParent"),L=G("_blazorLogicalEnd");function P(e,t){if(e.childNodes.length>0&&!t)throw new Error("New logical elements must start empty, or allowExistingContents must be true");return j in e||(e[j]=[]),e}function M(e,t){const n=document.createComment("!");return H(n,e,t),n}function H(e,t,n){const r=e;if(e instanceof Comment&&z(r)&&z(r).length>0)throw new Error("Not implemented: inserting non-empty logical container");if(U(r))throw new Error("Not implemented: moving existing logical children");const o=z(t);if(n0;)B(n,0)}const r=n;r.parentNode.removeChild(r)}function U(e){return e[x]||null}function J(e,t){return z(e)[t]}function $(e){const t=V(e);return"http://www.w3.org/2000/svg"===t.namespaceURI&&"foreignObject"!==t.tagName}function z(e){return e[j]}function K(e,t){const n=z(e);t.forEach((e=>{e.moveRangeStart=n[e.fromSiblingIndex],e.moveRangeEnd=Y(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):X(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 V(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 W(e){const t=z(U(e));return t[Array.prototype.indexOf.call(t,e)+1]||null}function X(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=W(t);n?n.parentNode.insertBefore(e,n):X(e,U(t))}}}function Y(e){if(e instanceof Element||e instanceof DocumentFragment)return e;const t=W(e);if(t)return t.previousSibling;{const t=U(e);return t instanceof Element||t instanceof DocumentFragment?t.lastChild:Y(t)}}function G(e){return"function"==typeof Symbol?Symbol():e}function q(e){return`_bl_${e}`}e.attachReviver(((e,t)=>t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"__internalId")&&"string"==typeof t.__internalId?function(e){const t=`[${q(e)}]`;return document.querySelector(t)}(t.__internalId):t));const Z="_blazorDeferredValue",Q=document.createElement("template"),ee=document.createElementNS("http://www.w3.org/2000/svg","g"),te={},ne="__internal_",re="preventDefault_",oe="stopPropagation_";class ae{constructor(e){this.rootComponentIds=new Set,this.childComponentLocations={},this.eventDelegator=new N(e),this.eventDelegator.notifyAfterClick((e=>{if(!he)return;if(0!==e.button||function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e))return;if(e.defaultPrevented)return;const t=function(e){const t=!window._blazorDisableComposedPath&&e.composedPath&&e.composedPath();if(t){for(let e=0;eve(!1))))},enableNavigationInterception:function(){he=!0},navigateTo:ye,getBaseURI:()=>document.baseURI,getLocationHref:()=>location.href};function ye(e,t,n=!1){const r=Ee(e),o=t instanceof Object?t:{forceLoad:t,replaceHistoryEntry:n};!o.forceLoad&&Ie(r)?ge(r,!1,o.replaceHistoryEntry):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,o.replaceHistoryEntry)}function ge(e,t,n){fe=!0,n?history.replaceState(null,"",e):history.pushState(null,"",e),ve(t)}async function ve(e){me&&await me(location.href,e)}let we;function Ee(e){return we=we||document.createElement("a"),we.href=e,we.href}function Se(e,t){return e?e.tagName===t?e:Se(e.parentElement,t):null}function Ie(e){const t=(n=document.baseURI).substring(0,n.lastIndexOf("/"));var n;const r=e.charAt(t.length);return e.startsWith(t)&&(""===r||"/"===r||"?"===r||"#"===r)}const Ce={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){const t=document.querySelector(e);t&&(t.hasAttribute("tabindex")||(t.tabIndex=-1),t.focus())}},Ae={init:function(e,t,n,r=50){const o=ke(t);(o||document.documentElement).style.overflowAnchor="none";const a=document.createRange();u(n.parentElement)&&(t.style.display="table-row",n.style.display="table-row");const s=new IntersectionObserver((function(r){r.forEach((r=>{var o;if(!r.isIntersecting)return;a.setStartAfter(t),a.setEndBefore(n);const s=a.getBoundingClientRect().height,i=null===(o=r.rootBounds)||void 0===o?void 0:o.height;r.target===t?e.invokeMethodAsync("OnSpacerBeforeVisible",r.intersectionRect.top-r.boundingClientRect.top,s,i):r.target===n&&n.offsetHeight>0&&e.invokeMethodAsync("OnSpacerAfterVisible",r.boundingClientRect.bottom-r.intersectionRect.bottom,s,i)}))}),{root:o,rootMargin:`${r}px`});s.observe(t),s.observe(n);const i=l(t),c=l(n);function l(e){const t={attributes:!0},n=new MutationObserver(((n,r)=>{u(e.parentElement)&&(r.disconnect(),e.style.display="table-row",r.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)}De[e._id]={intersectionObserver:s,mutationObserverBefore:i,mutationObserverAfter:c}},dispose:function(e){const t=De[e._id];t&&(t.intersectionObserver.disconnect(),t.mutationObserverBefore.disconnect(),t.mutationObserverAfter.disconnect(),e.dispose(),delete De[e._id])}},De={};function ke(e){return e?"visible"!==getComputedStyle(e).overflowY?e:ke(e.parentElement):null}const Re={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}},Te={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=Ne(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(a.blob)})),i=await new Promise((function(e){var t;const a=Math.min(1,r/s.width),i=Math.min(1,o/s.height),c=Math.min(a,i),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:a.lastModified,name:a.name,size:(null==i?void 0:i.size)||0,contentType:n,blob:i||a.blob};return e._blazorFilesById[c.id]=c,c},readFileData:async function(e,t){return Ne(e,t).blob}};function Ne(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 _e=new Map,Oe={navigateTo:ye,registerCustomEventType:function(e,t){if(!t)throw new Error("The options parameter is required.");if(o.has(e))throw new Error(`The event '${e}' is already registered.`);if(t.browserEventName){const n=a.get(t.browserEventName);n?n.push(e):a.set(t.browserEventName,[e]),s.forEach((n=>n(e,t.browserEventName)))}o.set(e,t)},rootComponents:y,_internal:{navigationManager:be,domWrapper:Ce,Virtualize:Ae,PageTitle:Re,InputFile:Te,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)},receiveDotNetDataStream:function(t,n,r,o){let a=_e.get(t);if(!a){const n=new ReadableStream({start(e){_e.set(t,e),a=e}});e.jsCallDispatcher.supplyDotNetStream(t,n)}o?(a.error(o),_e.delete(t)):0===r?(a.close(),_e.delete(t)):a.enqueue(n.length===r?n:n.subarray(0,r))},attachWebRendererInterop:function(t,n,r,o){if(E.has(t))throw new Error(`Interop methods are already registered for renderer ${t}`);E.set(t,n),Object.keys(r).length>0&&function(t,n,r){if(p)throw new Error("Dynamic root components have already been enabled.");p=t,m=n;for(const[t,o]of Object.entries(r)){const r=e.jsCallDispatcher.findJSFunction(t,0);for(const e of o)r(e,n[e])}}(A(t),r,o),S()}}};window.Blazor=Oe;let Fe=!1;const je="function"==typeof TextDecoder?new TextDecoder("utf-8"):null,xe=je?je.decode.bind(je):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("")},Le=Math.pow(2,32),Pe=Math.pow(2,21)-1;function Me(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}function He(e,t){return e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24>>>0)}function Be(e,t){const n=He(e,t+4);if(n>Pe)throw new Error(`Cannot read uint64 with high order part ${n}, because the result would exceed Number.MAX_SAFE_INTEGER.`);return n*Le+He(e,t)}class Ue{constructor(e){this.batchData=e;const t=new Ke(e);this.arrayRangeReader=new Ve(e),this.arrayBuilderSegmentReader=new We(e),this.diffReader=new Je(e),this.editReader=new $e(e,t),this.frameReader=new ze(e,t)}updatedComponents(){return Me(this.batchData,this.batchData.length-20)}referenceFrames(){return Me(this.batchData,this.batchData.length-16)}disposedComponentIds(){return Me(this.batchData,this.batchData.length-12)}disposedEventHandlerIds(){return Me(this.batchData,this.batchData.length-8)}updatedComponentsEntry(e,t){const n=e+4*t;return Me(this.batchData,n)}referenceFramesEntry(e,t){return e+20*t}disposedComponentIdsEntry(e,t){const n=e+4*t;return Me(this.batchData,n)}disposedEventHandlerIdsEntry(e,t){const n=e+8*t;return Be(this.batchData,n)}}class Je{constructor(e){this.batchDataUint8=e}componentId(e){return Me(this.batchDataUint8,e)}edits(e){return e+4}editsEntry(e,t){return e+16*t}}class $e{constructor(e,t){this.batchDataUint8=e,this.stringReader=t}editType(e){return Me(this.batchDataUint8,e)}siblingIndex(e){return Me(this.batchDataUint8,e+4)}newTreeIndex(e){return Me(this.batchDataUint8,e+8)}moveToSiblingIndex(e){return Me(this.batchDataUint8,e+8)}removedAttributeName(e){const t=Me(this.batchDataUint8,e+12);return this.stringReader.readString(t)}}class ze{constructor(e,t){this.batchDataUint8=e,this.stringReader=t}frameType(e){return Me(this.batchDataUint8,e)}subtreeLength(e){return Me(this.batchDataUint8,e+4)}elementReferenceCaptureId(e){const t=Me(this.batchDataUint8,e+4);return this.stringReader.readString(t)}componentId(e){return Me(this.batchDataUint8,e+8)}elementName(e){const t=Me(this.batchDataUint8,e+8);return this.stringReader.readString(t)}textContent(e){const t=Me(this.batchDataUint8,e+4);return this.stringReader.readString(t)}markupContent(e){const t=Me(this.batchDataUint8,e+4);return this.stringReader.readString(t)}attributeName(e){const t=Me(this.batchDataUint8,e+4);return this.stringReader.readString(t)}attributeValue(e){const t=Me(this.batchDataUint8,e+8);return this.stringReader.readString(t)}attributeEventHandlerId(e){return Be(this.batchDataUint8,e+12)}}class Ke{constructor(e){this.batchDataUint8=e,this.stringTableStartIndex=Me(e,e.length-4)}readString(e){if(-1===e)return null;{const n=Me(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)return;const{beforeStart:a,afterStarted:s}=o;return s&&e.afterStartedCallbacks.push(s),a?a(...t):void 0}(this,e))))}async invokeAfterStartedCallbacks(e){await I,await Promise.all(this.afterStartedCallbacks.map((t=>t(e))))}}let at=!1;async function st(){if(at)throw new Error("Blazor has already started.");at=!0;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 ot;return await n.importInitializersAsync(t,[]),n}();(function(){const t={AttachToDocument:(e,t)=>{!function(e,t,n){const r="::after";let o=!1;if(e.endsWith(r))e=e.slice(0,-r.length),o=!0;else if(e.endsWith("::before"))throw new Error("The '::before' selector is not supported.");const a=function(e){const t=h.get(e);if(t)return h.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=de[0];o||(o=new ae(0),de[0]=o),o.attachRootComponentToLogicalElement(n,t,r)}(0,P(a,!0),t,o)}(t,e)},RenderBatch:(e,t)=>{try{const n=rt(t);(function(e,t){const n=de[0];if(!n)throw new Error("There is no browser renderer with ID 0.");const r=t.arrayRangeReader,o=t.updatedComponents(),a=r.values(o),s=r.count(o),i=t.referenceFrames(),c=r.values(i),l=t.diffReader;for(let e=0;e{Ye=!0,console.error(`${e}\n${t}`),function(){const e=document.querySelector("#blazor-error-ui");e&&(e.style.display="block"),Fe||(Fe=!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:e.jsCallDispatcher.beginInvokeJSFromDotNet,EndInvokeDotNet:e.jsCallDispatcher.endInvokeDotNetFromJS,SendByteArrayToJS:nt,Navigate:be.navigateTo};window.external.receiveMessage((e=>{const n=function(e){if(Ye||!e||!e.startsWith(Xe))return null;const t=e.substring(Xe.length),[n,...r]=JSON.parse(t);return{messageType:n,args:r}}(e);if(n){if(!Object.prototype.hasOwnProperty.call(t,n.messageType))throw new Error(`Unsupported IPC message type '${n.messageType}'`);t[n.messageType].apply(null,n.args)}}))})(),e.attachDispatcher({beginInvokeDotNetFromJS:qe,endInvokeJSFromDotNet:Ze,sendByteArray:Qe}),be.enableNavigationInterception(),be.listenForNavigationEvents(et),tt("AttachPage",be.getBaseURI(),be.getLocationHref()),await t.invokeAfterStartedCallbacks(Oe)}Oe.start=st,document&&document.currentScript&&"false"!==document.currentScript.getAttribute("autostart")&&st()})(); \ No newline at end of file +(()=>{"use strict";var t,e,n;!function(t){window.DotNet=t;const e=[],n=new Map,r=new Map,o="__jsObjectId",i="__byte[]";class s{constructor(t){this.t=t,this.o=new Map}findFunction(t){const e=this.o.get(t);if(e)return e;let n,r=this.t;if(t.split(".").forEach((e=>{if(!(e in r))throw new Error(`Could not find '${t}' ('${e}' was undefined).`);n=r,r=r[e]})),r instanceof Function)return r=r.bind(n),this.o.set(t,r),r;throw new Error(`The value '${t}' is not a function.`)}getWrappedObject(){return this.t}}const c={},a={0:new s(window)};a[0].o.set("import",(t=>("string"==typeof t&&t.startsWith("./")&&(t=document.baseURI+t.substr(2)),import(t))));let u,l=1,f=1,h=null;function d(t){e.push(t)}function m(t){if(t&&"object"==typeof t){a[f]=new s(t);const e={[o]:f};return f++,e}throw new Error(`Cannot create a JSObjectReference from the value '${t}'.`)}function w(t){let e=-1;if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t instanceof Blob)e=t.size;else{if(!(t.buffer instanceof ArrayBuffer))throw new Error("Supplied value is not a typed array or blob.");if(void 0===t.byteLength)throw new Error(`Cannot create a JSStreamReference from the value '${t}' as it doesn't have a byteLength.`);e=t.byteLength}const n={i:e};try{const e=m(t);n.u=e.u}catch(e){throw new Error(`Cannot create a JSStreamReference from the value '${t}'.`)}return n}function p(t){return t?JSON.parse(t,((t,n)=>e.reduce(((e,n)=>n(t,e)),n))):null}function v(t,e,n,r){const o=y();if(o.invokeDotNetFromJS){const i=M(r),s=o.invokeDotNetFromJS(t,e,n,i);return s?p(s):null}throw new Error("The current dispatcher does not support synchronous calls from JS to .NET. Use invokeMethodAsync instead.")}function b(t,e,n,r){if(t&&n)throw new Error(`For instance method calls, assemblyName should be null. Received '${t}'.`);const o=l++,i=new Promise(((t,e)=>{c[o]={resolve:t,reject:e}}));try{const i=M(r);y().beginInvokeDotNetFromJS(o,t,e,n,i)}catch(t){E(o,!1,t)}return i}function y(){if(null!==h)return h;throw new Error("No .NET call dispatcher has been set.")}function E(t,e,n){if(!c.hasOwnProperty(t))throw new Error(`There is no pending async call with ID ${t}.`);const r=c[t];delete c[t],e?r.resolve(n):r.reject(n)}function g(t){return t instanceof Error?`${t.message}\n${t.stack}`:t?t.toString():"null"}function S(t,e){const n=a[e];if(n)return n.findFunction(t);throw new Error(`JS object instance with ID ${e} does not exist (has it been disposed?).`)}function T(t){delete a[t]}t.attachDispatcher=function(t){h=t},t.attachReviver=d,t.invokeMethod=function(t,e,...n){return v(t,e,null,n)},t.invokeMethodAsync=function(t,e,...n){return b(t,e,null,n)},t.createJSObjectReference=m,t.createJSStreamReference=w,t.disposeJSObjectReference=function(t){const e=t&&t.u;"number"==typeof e&&T(e)},function(t){t[t.Default=0]="Default",t[t.JSObjectReference=1]="JSObjectReference",t[t.JSStreamReference=2]="JSStreamReference",t[t.JSVoidResult=3]="JSVoidResult"}(u=t.JSCallResultType||(t.JSCallResultType={})),t.jsCallDispatcher={findJSFunction:S,disposeJSObjectReferenceById:T,invokeJSFromDotNet:(t,e,n,r)=>{const o=C(S(t,r).apply(null,p(e)),n);return null==o?null:M(o)},beginInvokeJSFromDotNet:(t,e,n,r,o)=>{const i=new Promise((t=>{t(S(e,o).apply(null,p(n)))}));t&&i.then((e=>M([t,!0,C(e,r)]))).then((e=>y().endInvokeJSFromDotNet(t,!0,e)),(e=>y().endInvokeJSFromDotNet(t,!1,JSON.stringify([t,!1,g(e)]))))},endInvokeDotNetFromJS:(t,e,n)=>{const r=e?p(n):new Error(n);E(parseInt(t,10),e,r)},receiveByteArray:(t,e)=>{n.set(t,e)},supplyDotNetStream:(t,e)=>{if(r.has(t)){const n=r.get(t);r.delete(t),n.resolve(e)}else{const n=new I;n.resolve(e),r.set(t,n)}}};class A{constructor(t){this.l=t}invokeMethod(t,...e){return v(null,t,this.l,e)}invokeMethodAsync(t,...e){return b(null,t,this.l,e)}dispose(){b(null,"__Dispose",this.l,null).catch((t=>console.error(t)))}serializeAsArg(){return{h:this.l}}}t.DotNetObject=A,d((function(t,e){if(e&&"object"==typeof e){if(e.hasOwnProperty("__dotNetObject"))return new A(e.h);if(e.hasOwnProperty(o)){const t=e.u,n=a[t];if(n)return n.getWrappedObject();throw new Error(`JS object instance with Id '${t}' does not exist. It may have been disposed.`)}if(e.hasOwnProperty(i)){const t=e["m"],r=n.get(t);if(void 0===r)throw new Error(`Byte array index '${t}' does not exist.`);return n.delete(t),r}if(e.hasOwnProperty("__dotNetStream"))return new k(e.p)}return e}));class k{constructor(t){if(r.has(t))this.v=r.get(t).streamPromise,r.delete(t);else{const e=new I;r.set(t,e),this.v=e.streamPromise}}stream(){return this.v}async arrayBuffer(){return new Response(await this.stream()).arrayBuffer()}}class I{constructor(){this.streamPromise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}}function C(t,e){switch(e){case u.Default:return t;case u.JSObjectReference:return m(t);case u.JSStreamReference:return w(t);case u.JSVoidResult:return null;default:throw new Error(`Invalid JS call result type '${e}'.`)}}let N=0;function M(t){return N=0,JSON.stringify(t,O)}function O(t,e){if(e instanceof A)return e.serializeAsArg();if(e instanceof Uint8Array){h.sendByteArray(N,e);const t={[i]:N};return N++,t}return e}}(t||(t={})),function(t){t[t.prependFrame=1]="prependFrame",t[t.removeFrame=2]="removeFrame",t[t.setAttribute=3]="setAttribute",t[t.removeAttribute=4]="removeAttribute",t[t.updateText=5]="updateText",t[t.stepIn=6]="stepIn",t[t.stepOut=7]="stepOut",t[t.updateMarkup=8]="updateMarkup",t[t.permutationListEntry=9]="permutationListEntry",t[t.permutationListEnd=10]="permutationListEnd"}(e||(e={})),function(t){t[t.element=1]="element",t[t.text=2]="text",t[t.attribute=3]="attribute",t[t.component=4]="component",t[t.region=5]="region",t[t.elementReferenceCapture=6]="elementReferenceCapture",t[t.markup=8]="markup"}(n||(n={}));class r{constructor(t,e){this.componentId=t,this.fieldValue=e}static fromEvent(t,e){const n=e.target;if(n instanceof Element){const e=function(t){return t instanceof HTMLInputElement?t.type&&"checkbox"===t.type.toLowerCase()?{value:t.checked}:{value:t.value}:t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement?{value:t.value}:null}(n);if(e)return new r(t,e.value)}return null}}const o=new Map,i=new Map,s=[];function c(t){return o.get(t)}function a(t){const e=o.get(t);return(null==e?void 0:e.browserEventName)||t}function u(t,e){t.forEach((t=>o.set(t,e)))}function l(t){const e=[];for(let n=0;nt.selected)).map((t=>t.value))}}{const t=function(t){return!!t&&"INPUT"===t.tagName&&"checkbox"===t.getAttribute("type")}(e);return{value:t?!!e.checked:e.value}}}}),u(["copy","cut","paste"],{createEventArgs:t=>({type:t.type})}),u(["drag","dragend","dragenter","dragleave","dragover","dragstart","drop"],{createEventArgs:t=>{return{...f(e=t),dataTransfer:e.dataTransfer?{dropEffect:e.dataTransfer.dropEffect,effectAllowed:e.dataTransfer.effectAllowed,files:Array.from(e.dataTransfer.files).map((t=>t.name)),items:Array.from(e.dataTransfer.items).map((t=>({kind:t.kind,type:t.type}))),types:e.dataTransfer.types}:null};var e}}),u(["focus","blur","focusin","focusout"],{createEventArgs:t=>({type:t.type})}),u(["keydown","keyup","keypress"],{createEventArgs:t=>{return{key:(e=t).key,code:e.code,location:e.location,repeat:e.repeat,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,type:e.type};var e}}),u(["contextmenu","click","mouseover","mouseout","mousemove","mousedown","mouseup","mouseleave","mouseenter","dblclick"],{createEventArgs:t=>f(t)}),u(["error"],{createEventArgs:t=>{return{message:(e=t).message,filename:e.filename,lineno:e.lineno,colno:e.colno,type:e.type};var e}}),u(["loadstart","timeout","abort","load","loadend","progress"],{createEventArgs:t=>{return{lengthComputable:(e=t).lengthComputable,loaded:e.loaded,total:e.total,type:e.type};var e}}),u(["touchcancel","touchend","touchmove","touchenter","touchleave","touchstart"],{createEventArgs:t=>{return{detail:(e=t).detail,touches:l(e.touches),targetTouches:l(e.targetTouches),changedTouches:l(e.changedTouches),ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,type:e.type};var e}}),u(["gotpointercapture","lostpointercapture","pointercancel","pointerdown","pointerenter","pointerleave","pointermove","pointerout","pointerover","pointerup"],{createEventArgs:t=>{return{...f(e=t),pointerId:e.pointerId,width:e.width,height:e.height,pressure:e.pressure,tiltX:e.tiltX,tiltY:e.tiltY,pointerType:e.pointerType,isPrimary:e.isPrimary};var e}}),u(["wheel","mousewheel"],{createEventArgs:t=>{return{...f(e=t),deltaX:e.deltaX,deltaY:e.deltaY,deltaZ:e.deltaZ,deltaMode:e.deltaMode};var e}}),u(["toggle"],{createEventArgs:()=>({})});const h=["date","datetime-local","month","time","week"],d=new Map;let m,w,p=0;const v={async add(t,e,n){if(!n)throw new Error("initialParameters must be an object, even if empty.");const r="__bl-dynamic-root:"+(++p).toString();d.set(r,t);const o=await E().invokeMethodAsync("AddRootComponent",e,r),i=new y(o,w[e]);return await i.setParameters(n),i}};class b{invoke(t){return this.g(t)}setCallback(e){this.S||(this.S=t.createJSObjectReference(this)),this.g=e}getJSObjectReference(){return this.S}dispose(){this.S&&t.disposeJSObjectReference(this.S)}}class y{constructor(t,e){this.T=new Map,this.A=t;for(const t of e)"eventcallback"===t.type&&this.T.set(t.name.toLowerCase(),new b)}setParameters(t){const e={},n=Object.entries(t||{}),r=n.length;for(const[t,r]of n){const n=this.T.get(t.toLowerCase());n&&r?(n.setCallback(r),e[t]=n.getJSObjectReference()):e[t]=r}return E().invokeMethodAsync("SetRootComponentParameters",this.A,r,e)}async dispose(){if(null!==this.A){await E().invokeMethodAsync("RemoveRootComponent",this.A),this.A=null;for(const t of this.T.values())t.dispose()}}}function E(){if(!m)throw new Error("Dynamic root components have not been enabled in this application.");return m}const g=new Map;let S;const T=new Promise((t=>{S=t}));function A(t,e,n){return I(t,e.eventHandlerId,(()=>k(t).invokeMethodAsync("DispatchEventAsync",e,n)))}function k(t){const e=g.get(t);if(!e)throw new Error(`No interop methods are registered for renderer ${t}`);return e}let I=(t,e,n)=>n();const C=D(["abort","blur","canplay","canplaythrough","change","cuechange","durationchange","emptied","ended","error","focus","load","loadeddata","loadedmetadata","loadend","loadstart","mouseenter","mouseleave","pause","play","playing","progress","ratechange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeupdate","toggle","unload","volumechange","waiting","DOMNodeInsertedIntoDocument","DOMNodeRemovedFromDocument"]),N={submit:!0},M=D(["click","dblclick","mousedown","mousemove","mouseup"]);class O{constructor(t){this.browserRendererId=t,this.afterClickCallbacks=[];const e=++O.nextEventDelegatorId;this.eventsCollectionKey=`_blazorEvents_${e}`,this.eventInfoStore=new $(this.onGlobalEvent.bind(this))}setListener(t,e,n,r){const o=this.getEventHandlerInfosForElement(t,!0),i=o.getHandler(e);if(i)this.eventInfoStore.update(i.eventHandlerId,n);else{const i={element:t,eventName:e,eventHandlerId:n,renderingComponentId:r};this.eventInfoStore.add(i),o.setHandler(e,i)}}getHandler(t){return this.eventInfoStore.get(t)}removeListener(t){const e=this.eventInfoStore.remove(t);if(e){const t=e.element,n=this.getEventHandlerInfosForElement(t,!1);n&&n.removeHandler(e.eventName)}}notifyAfterClick(t){this.afterClickCallbacks.push(t),this.eventInfoStore.addGlobalListener("click")}setStopPropagation(t,e,n){this.getEventHandlerInfosForElement(t,!0).stopPropagation(e,n)}setPreventDefault(t,e,n){this.getEventHandlerInfosForElement(t,!0).preventDefault(e,n)}onGlobalEvent(t){if(!(t.target instanceof Element))return;this.dispatchGlobalEventToAllElements(t.type,t);const e=(n=t.type,i.get(n));var n;e&&e.forEach((e=>this.dispatchGlobalEventToAllElements(e,t))),"click"===t.type&&this.afterClickCallbacks.forEach((e=>e(t)))}dispatchGlobalEventToAllElements(t,e){const n=e.composedPath();let o=n.shift(),i=null,s=!1;const a=Object.prototype.hasOwnProperty.call(C,t);let u=!1;for(;o;){const h=o,d=this.getEventHandlerInfosForElement(h,!1);if(d){const n=d.getHandler(t);if(n&&(l=h,f=e.type,!((l instanceof HTMLButtonElement||l instanceof HTMLInputElement||l instanceof HTMLTextAreaElement||l instanceof HTMLSelectElement)&&Object.prototype.hasOwnProperty.call(M,f)&&l.disabled))){if(!s){const n=c(t);i=(null==n?void 0:n.createEventArgs)?n.createEventArgs(e):{},s=!0}Object.prototype.hasOwnProperty.call(N,e.type)&&e.preventDefault(),A(this.browserRendererId,{eventHandlerId:n.eventHandlerId,eventName:t,eventFieldInfo:r.fromEvent(n.renderingComponentId,e)},i)}d.stopPropagation(t)&&(u=!0),d.preventDefault(t)&&e.preventDefault()}o=a||u?void 0:n.shift()}var l,f}getEventHandlerInfosForElement(t,e){return Object.prototype.hasOwnProperty.call(t,this.eventsCollectionKey)?t[this.eventsCollectionKey]:e?t[this.eventsCollectionKey]=new _:null}}O.nextEventDelegatorId=0;class ${constructor(t){this.globalListener=t,this.infosByEventHandlerId={},this.countByEventName={},s.push(this.handleEventNameAliasAdded.bind(this))}add(t){if(this.infosByEventHandlerId[t.eventHandlerId])throw new Error(`Event ${t.eventHandlerId} is already tracked`);this.infosByEventHandlerId[t.eventHandlerId]=t,this.addGlobalListener(t.eventName)}get(t){return this.infosByEventHandlerId[t]}addGlobalListener(t){if(t=a(t),Object.prototype.hasOwnProperty.call(this.countByEventName,t))this.countByEventName[t]++;else{this.countByEventName[t]=1;const e=Object.prototype.hasOwnProperty.call(C,t);document.addEventListener(t,this.globalListener,e)}}update(t,e){if(Object.prototype.hasOwnProperty.call(this.infosByEventHandlerId,e))throw new Error(`Event ${e} is already tracked`);const n=this.infosByEventHandlerId[t];delete this.infosByEventHandlerId[t],n.eventHandlerId=e,this.infosByEventHandlerId[e]=n}remove(t){const e=this.infosByEventHandlerId[t];if(e){delete this.infosByEventHandlerId[t];const n=a(e.eventName);0==--this.countByEventName[n]&&(delete this.countByEventName[n],document.removeEventListener(n,this.globalListener))}return e}handleEventNameAliasAdded(t,e){if(Object.prototype.hasOwnProperty.call(this.countByEventName,t)){const n=this.countByEventName[t];delete this.countByEventName[t],document.removeEventListener(t,this.globalListener),this.addGlobalListener(e),this.countByEventName[e]+=n-1}}}class _{constructor(){this.handlers={},this.preventDefaultFlags=null,this.stopPropagationFlags=null}getHandler(t){return Object.prototype.hasOwnProperty.call(this.handlers,t)?this.handlers[t]:null}setHandler(t,e){this.handlers[t]=e}removeHandler(t){delete this.handlers[t]}preventDefault(t,e){return void 0!==e&&(this.preventDefaultFlags=this.preventDefaultFlags||{},this.preventDefaultFlags[t]=e),!!this.preventDefaultFlags&&this.preventDefaultFlags[t]}stopPropagation(t,e){return void 0!==e&&(this.stopPropagationFlags=this.stopPropagationFlags||{},this.stopPropagationFlags[t]=e),!!this.stopPropagationFlags&&this.stopPropagationFlags[t]}}function D(t){const e={};return t.forEach((t=>{e[t]=!0})),e}const L=W("_blazorLogicalChildren"),j=W("_blazorLogicalParent"),R=W("_blazorLogicalEnd");function x(t,e){if(t.childNodes.length>0&&!e)throw new Error("New logical elements must start empty, or allowExistingContents must be true");return L in t||(t[L]=[]),t}function P(t,e){const n=document.createComment("!");return H(n,t,e),n}function H(t,e,n){const r=t;if(t instanceof Comment&&z(r)&&z(r).length>0)throw new Error("Not implemented: inserting non-empty logical container");if(J(r))throw new Error("Not implemented: moving existing logical children");const o=z(e);if(n0;)F(n,0)}const r=n;r.parentNode.removeChild(r)}function J(t){return t[j]||null}function U(t,e){return z(t)[e]}function B(t){const e=V(t);return"http://www.w3.org/2000/svg"===e.namespaceURI&&"foreignObject"!==e.tagName}function z(t){return t[L]}function K(t,e){const n=z(t);e.forEach((t=>{t.moveRangeStart=n[t.fromSiblingIndex],t.moveRangeEnd=G(t.moveRangeStart)})),e.forEach((e=>{const r=document.createComment("marker");e.moveToBeforeMarker=r;const o=n[e.toSiblingIndex+1];o?o.parentNode.insertBefore(r,o):Y(r,t)})),e.forEach((t=>{const e=t.moveToBeforeMarker,n=e.parentNode,r=t.moveRangeStart,o=t.moveRangeEnd;let i=r;for(;i;){const t=i.nextSibling;if(n.insertBefore(i,e),i===o)break;i=t}n.removeChild(e)})),e.forEach((t=>{n[t.toSiblingIndex]=t.moveRangeStart}))}function V(t){if(t instanceof Element||t instanceof DocumentFragment)return t;if(t instanceof Comment)return t.parentNode;throw new Error("Not a valid logical element")}function X(t){const e=z(J(t));return e[Array.prototype.indexOf.call(e,t)+1]||null}function Y(t,e){if(e instanceof Element||e instanceof DocumentFragment)e.appendChild(t);else{if(!(e instanceof Comment))throw new Error(`Cannot append node because the parent is not a valid logical element. Parent: ${e}`);{const n=X(e);n?n.parentNode.insertBefore(t,n):Y(t,J(e))}}}function G(t){if(t instanceof Element||t instanceof DocumentFragment)return t;const e=X(t);if(e)return e.previousSibling;{const e=J(t);return e instanceof Element||e instanceof DocumentFragment?e.lastChild:G(e)}}function W(t){return"function"==typeof Symbol?Symbol():t}function q(t){return`_bl_${t}`}t.attachReviver(((t,e)=>e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"__internalId")&&"string"==typeof e.k?function(t){const e=`[${q(t)}]`;return document.querySelector(e)}(e.k):e));const Z="_blazorDeferredValue",Q=document.createElement("template"),tt=document.createElementNS("http://www.w3.org/2000/svg","g"),et={},nt="__internal_",rt="preventDefault_",ot="stopPropagation_";class it{constructor(t){this.rootComponentIds=new Set,this.childComponentLocations={},this.eventDelegator=new O(t),this.eventDelegator.notifyAfterClick((t=>{if(!dt)return;if(0!==t.button||function(t){return t.ctrlKey||t.shiftKey||t.altKey||t.metaKey}(t))return;if(t.defaultPrevented)return;const e=function(t){const e=!window._blazorDisableComposedPath&&t.composedPath&&t.composedPath();if(e){for(let t=0;tyt(!1))))},enableNavigationInterception:function(){dt=!0},navigateTo:vt,getBaseURI:()=>document.baseURI,getLocationHref:()=>location.href};function vt(t,e,n=!1){const r=gt(t),o=e instanceof Object?e:{forceLoad:e,replaceHistoryEntry:n};!o.forceLoad&&Tt(r)?bt(r,!1,o.replaceHistoryEntry):function(t,e){if(location.href===t){const e=t+"?";history.replaceState(null,"",e),location.replace(t)}else e?location.replace(t):location.href=t}(t,o.replaceHistoryEntry)}function bt(t,e,n){ht=!0,n?history.replaceState(null,"",t):history.pushState(null,"",t),yt(e)}async function yt(t){wt&&await wt(location.href,t)}let Et;function gt(t){return Et=Et||document.createElement("a"),Et.href=t,Et.href}function St(t,e){return t?t.tagName===e?t:St(t.parentElement,e):null}function Tt(t){const e=(n=document.baseURI).substring(0,n.lastIndexOf("/"));var n;const r=t.charAt(e.length);return t.startsWith(e)&&(""===r||"/"===r||"?"===r||"#"===r)}const At={focus:function(t,e){if(t instanceof HTMLElement)t.focus({preventScroll:e});else{if(!(t instanceof SVGElement))throw new Error("Unable to focus an invalid element.");if(!t.hasAttribute("tabindex"))throw new Error("Unable to focus an SVG element that does not have a tabindex.");t.focus({preventScroll:e})}},focusBySelector:function(t){const e=document.querySelector(t);e&&(e.hasAttribute("tabindex")||(e.tabIndex=-1),e.focus())}},kt={init:function(t,e,n,r=50){const o=Ct(e);(o||document.documentElement).style.overflowAnchor="none";const i=document.createRange();l(n.parentElement)&&(e.style.display="table-row",n.style.display="table-row");const s=new IntersectionObserver((function(r){r.forEach((r=>{var o;if(!r.isIntersecting)return;i.setStartAfter(e),i.setEndBefore(n);const s=i.getBoundingClientRect().height,c=null===(o=r.rootBounds)||void 0===o?void 0:o.height;r.target===e?t.invokeMethodAsync("OnSpacerBeforeVisible",r.intersectionRect.top-r.boundingClientRect.top,s,c):r.target===n&&n.offsetHeight>0&&t.invokeMethodAsync("OnSpacerAfterVisible",r.boundingClientRect.bottom-r.intersectionRect.bottom,s,c)}))}),{root:o,rootMargin:`${r}px`});s.observe(e),s.observe(n);const c=u(e),a=u(n);function u(t){const e={attributes:!0},n=new MutationObserver(((n,r)=>{l(t.parentElement)&&(r.disconnect(),t.style.display="table-row",r.observe(t,e)),s.unobserve(t),s.observe(t)}));return n.observe(t,e),n}function l(t){return null!==t&&(t instanceof HTMLTableElement&&""===t.style.display||"table"===t.style.display||t instanceof HTMLTableSectionElement&&""===t.style.display||"table-row-group"===t.style.display)}It[t.l]={intersectionObserver:s,mutationObserverBefore:c,mutationObserverAfter:a}},dispose:function(t){const e=It[t.l];e&&(e.intersectionObserver.disconnect(),e.mutationObserverBefore.disconnect(),e.mutationObserverAfter.disconnect(),t.dispose(),delete It[t.l])}},It={};function Ct(t){return t?"visible"!==getComputedStyle(t).overflowY?t:Ct(t.parentElement):null}const Nt={getAndRemoveExistingTitle:function(){var t;const e=document.head?document.head.getElementsByTagName("title"):[];if(0===e.length)return null;let n=null;for(let r=e.length-1;r>=0;r--){const o=e[r],i=o.previousSibling;i instanceof Comment&&null!==J(i)||(null===n&&(n=o.textContent),null===(t=o.parentNode)||void 0===t||t.removeChild(o))}return n}},Mt={init:function(t,e){e.C=0,e.addEventListener("click",(function(){e.value=""})),e.addEventListener("change",(function(){e.N={};const n=Array.prototype.map.call(e.files,(function(t){const n={id:++e.C,lastModified:new Date(t.lastModified).toISOString(),name:t.name,size:t.size,contentType:t.type,readPromise:void 0,arrayBuffer:void 0,blob:t};return e.N[n.id]=n,n}));t.invokeMethodAsync("NotifyChange",n)}))},toImageFile:async function(t,e,n,r,o){const i=Ot(t,e),s=await new Promise((function(t){const e=new Image;e.onload=function(){URL.revokeObjectURL(e.src),t(e)},e.onerror=function(){e.onerror=null,URL.revokeObjectURL(e.src)},e.src=URL.createObjectURL(i.blob)})),c=await new Promise((function(t){var e;const i=Math.min(1,r/s.width),c=Math.min(1,o/s.height),a=Math.min(i,c),u=document.createElement("canvas");u.width=Math.round(s.width*a),u.height=Math.round(s.height*a),null===(e=u.getContext("2d"))||void 0===e||e.drawImage(s,0,0,u.width,u.height),u.toBlob(t,n)})),a={id:++t.C,lastModified:i.lastModified,name:i.name,size:(null==c?void 0:c.size)||0,contentType:n,blob:c||i.blob};return t.N[a.id]=a,a},readFileData:async function(t,e){return Ot(t,e).blob}};function Ot(t,e){const n=t.N[e];if(!n)throw new Error(`There is no file with ID ${e}. The file list may have changed. See https://aka.ms/aspnet/blazor-input-file-multiple-selections.`);return n}const $t=new Map,_t={navigateTo:vt,registerCustomEventType:function(t,e){if(!e)throw new Error("The options parameter is required.");if(o.has(t))throw new Error(`The event '${t}' is already registered.`);if(e.browserEventName){const n=i.get(e.browserEventName);n?n.push(t):i.set(e.browserEventName,[t]),s.forEach((n=>n(t,e.browserEventName)))}o.set(t,e)},rootComponents:v,M:{navigationManager:pt,domWrapper:At,Virtualize:kt,PageTitle:Nt,InputFile:Mt,getJSDataStreamChunk:async function(t,e,n){return t instanceof Blob?await async function(t,e,n){const r=t.slice(e,e+n),o=await r.arrayBuffer();return new Uint8Array(o)}(t,e,n):function(t,e,n){return new Uint8Array(t.buffer,t.byteOffset+e,n)}(t,e,n)},receiveDotNetDataStream:function(e,n,r,o){let i=$t.get(e);if(!i){const n=new ReadableStream({start(t){$t.set(e,t),i=t}});t.jsCallDispatcher.supplyDotNetStream(e,n)}o?(i.error(o),$t.delete(e)):0===r?(i.close(),$t.delete(e)):i.enqueue(n.length===r?n:n.subarray(0,r))},attachWebRendererInterop:function(e,n,r,o){if(g.has(e))throw new Error(`Interop methods are already registered for renderer ${e}`);g.set(e,n),Object.keys(r).length>0&&function(e,n,r){if(m)throw new Error("Dynamic root components have already been enabled.");m=e,w=n;for(const[e,o]of Object.entries(r)){const r=t.jsCallDispatcher.findJSFunction(e,0);for(const t of o)r(t,n[t])}}(k(e),r,o),S()}}};window.Blazor=_t;let Dt=!1;const Lt="function"==typeof TextDecoder?new TextDecoder("utf-8"):null,jt=Lt?Lt.decode.bind(Lt):function(t){let e=0;const n=t.length,r=[],o=[];for(;e65535&&(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("")},Rt=Math.pow(2,32),xt=Math.pow(2,21)-1;function Pt(t,e){return t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24}function Ht(t,e){return t[e]+(t[e+1]<<8)+(t[e+2]<<16)+(t[e+3]<<24>>>0)}function Ft(t,e){const n=Ht(t,e+4);if(n>xt)throw new Error(`Cannot read uint64 with high order part ${n}, because the result would exceed Number.MAX_SAFE_INTEGER.`);return n*Rt+Ht(t,e)}class Jt{constructor(t){this.batchData=t;const e=new Kt(t);this.arrayRangeReader=new Vt(t),this.arrayBuilderSegmentReader=new Xt(t),this.diffReader=new Ut(t),this.editReader=new Bt(t,e),this.frameReader=new zt(t,e)}updatedComponents(){return Pt(this.batchData,this.batchData.length-20)}referenceFrames(){return Pt(this.batchData,this.batchData.length-16)}disposedComponentIds(){return Pt(this.batchData,this.batchData.length-12)}disposedEventHandlerIds(){return Pt(this.batchData,this.batchData.length-8)}updatedComponentsEntry(t,e){const n=t+4*e;return Pt(this.batchData,n)}referenceFramesEntry(t,e){return t+20*e}disposedComponentIdsEntry(t,e){const n=t+4*e;return Pt(this.batchData,n)}disposedEventHandlerIdsEntry(t,e){const n=t+8*e;return Ft(this.batchData,n)}}class Ut{constructor(t){this.batchDataUint8=t}componentId(t){return Pt(this.batchDataUint8,t)}edits(t){return t+4}editsEntry(t,e){return t+16*e}}class Bt{constructor(t,e){this.batchDataUint8=t,this.stringReader=e}editType(t){return Pt(this.batchDataUint8,t)}siblingIndex(t){return Pt(this.batchDataUint8,t+4)}newTreeIndex(t){return Pt(this.batchDataUint8,t+8)}moveToSiblingIndex(t){return Pt(this.batchDataUint8,t+8)}removedAttributeName(t){const e=Pt(this.batchDataUint8,t+12);return this.stringReader.readString(e)}}class zt{constructor(t,e){this.batchDataUint8=t,this.stringReader=e}frameType(t){return Pt(this.batchDataUint8,t)}subtreeLength(t){return Pt(this.batchDataUint8,t+4)}elementReferenceCaptureId(t){const e=Pt(this.batchDataUint8,t+4);return this.stringReader.readString(e)}componentId(t){return Pt(this.batchDataUint8,t+8)}elementName(t){const e=Pt(this.batchDataUint8,t+8);return this.stringReader.readString(e)}textContent(t){const e=Pt(this.batchDataUint8,t+4);return this.stringReader.readString(e)}markupContent(t){const e=Pt(this.batchDataUint8,t+4);return this.stringReader.readString(e)}attributeName(t){const e=Pt(this.batchDataUint8,t+4);return this.stringReader.readString(e)}attributeValue(t){const e=Pt(this.batchDataUint8,t+8);return this.stringReader.readString(e)}attributeEventHandlerId(t){return Ft(this.batchDataUint8,t+12)}}class Kt{constructor(t){this.batchDataUint8=t,this.stringTableStartIndex=Pt(t,t.length-4)}readString(t){if(-1===t)return null;{const n=Pt(this.batchDataUint8,this.stringTableStartIndex+4*t),r=function(t,e){let n=0,r=0;for(let o=0;o<4;o++){const i=t[e+o];if(n|=(127&i)<async function(t,n){const r=function(t){const e=document.baseURI;return e.endsWith("/")?`${e}${t}`:`${e}/${t}`}(n),o=await import(r);if(void 0===o)return;const{beforeStart:i,afterStarted:s}=o;return s&&t.afterStartedCallbacks.push(s),i?i(...e):void 0}(this,t))))}async invokeAfterStartedCallbacks(t){await T,await Promise.all(this.afterStartedCallbacks.map((e=>e(t))))}}let ie=!1;async function se(){if(ie)throw new Error("Blazor has already started.");ie=!0;const e=await async function(){const t=await fetch("_framework/blazor.modules.json",{method:"GET",credentials:"include",cache:"no-cache"}),e=await t.json(),n=new oe;return await n.importInitializersAsync(e,[]),n}();(function(){const e={AttachToDocument:(t,e)=>{!function(t,e,n){const r="::after";let o=!1;if(t.endsWith(r))t=t.slice(0,-r.length),o=!0;else if(t.endsWith("::before"))throw new Error("The '::before' selector is not supported.");const i=function(t){const e=d.get(t);if(e)return d.delete(t),e}(t)||document.querySelector(t);if(!i)throw new Error(`Could not find any element matching selector '${t}'.`);!function(t,e,n,r){let o=ft[0];o||(o=new it(0),ft[0]=o),o.attachRootComponentToLogicalElement(n,e,r)}(0,x(i,!0),e,o)}(e,t)},RenderBatch:(t,e)=>{try{const n=re(e);(function(t,e){const n=ft[0];if(!n)throw new Error("There is no browser renderer with ID 0.");const r=e.arrayRangeReader,o=e.updatedComponents(),i=r.values(o),s=r.count(o),c=e.referenceFrames(),a=r.values(c),u=e.diffReader;for(let t=0;t{Gt=!0,console.error(`${t}\n${e}`),function(){const t=document.querySelector("#blazor-error-ui");t&&(t.style.display="block"),Dt||(Dt=!0,document.querySelectorAll("#blazor-error-ui .reload").forEach((t=>{t.onclick=function(t){location.reload(),t.preventDefault()}})),document.querySelectorAll("#blazor-error-ui .dismiss").forEach((t=>{t.onclick=function(t){const e=document.querySelector("#blazor-error-ui");e&&(e.style.display="none"),t.preventDefault()}})))}()},BeginInvokeJS:t.jsCallDispatcher.beginInvokeJSFromDotNet,EndInvokeDotNet:t.jsCallDispatcher.endInvokeDotNetFromJS,SendByteArrayToJS:ne,Navigate:pt.navigateTo};window.external.receiveMessage((t=>{const n=function(t){if(Gt||!t||!t.startsWith(Yt))return null;const e=t.substring(Yt.length),[n,...r]=JSON.parse(e);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)}}))})(),t.attachDispatcher({beginInvokeDotNetFromJS:qt,endInvokeJSFromDotNet:Zt,sendByteArray:Qt}),pt.enableNavigationInterception(),pt.listenForNavigationEvents(te),ee("AttachPage",pt.getBaseURI(),pt.getLocationHref()),await e.invokeAfterStartedCallbacks(_t)}_t.start=se,document&&document.currentScript&&"false"!==document.currentScript.getAttribute("autostart")&&se()})(); \ No newline at end of file diff --git a/src/Components/Web.JS/src/webpack.config.js b/src/Components/Web.JS/src/webpack.config.js index fe5cf842121a..82159d483ac7 100644 --- a/src/Components/Web.JS/src/webpack.config.js +++ b/src/Components/Web.JS/src/webpack.config.js @@ -37,6 +37,9 @@ module.exports = (env, args) => ({ passes: 3 }, mangle: { + properties: { + regex: /^_/ + } }, module: false, format: {