diff --git a/src/Components/Web.JS/dist/Release/blazor.web.js b/src/Components/Web.JS/dist/Release/blazor.web.js index 13a77fc22d78..ce789af76e5f 100644 --- a/src/Components/Web.JS/dist/Release/blazor.web.js +++ b/src/Components/Web.JS/dist/Release/blazor.web.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){const t=[],n="__jsObjectId",r="__dotNetObject",o="__byte[]",i="__dotNetStream",s="__jsStreamReferenceLength";let a,c;class l{constructor(e){this._jsObject=e,this._cachedFunctions=new Map}findFunction(e){const t=this._cachedFunctions.get(e);if(t)return t;let n,r=this._jsObject;if(e.split(".").forEach((t=>{if(!(t in r))throw new Error(`Could not find '${e}' ('${t}' was undefined).`);n=r,r=r[t]})),r instanceof Function)return r=r.bind(n),this._cachedFunctions.set(e,r),r;throw new Error(`The value '${e}' is not a function.`)}getWrappedObject(){return this._jsObject}}const h={0:new l(window)};h[0]._cachedFunctions.set("import",(e=>("string"==typeof e&&e.startsWith("./")&&(e=new URL(e.substr(2),document.baseURI).toString()),import(e))));let d,u=1;function p(e){t.push(e)}function f(e){if(e&&"object"==typeof e){h[u]=new l(e);const t={[n]:u};return u++,t}throw new Error(`Cannot create a JSObjectReference from the value '${e}'.`)}function g(e){let t=-1;if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Blob)t=e.size;else{if(!(e.buffer instanceof ArrayBuffer))throw new Error("Supplied value is not a typed array or blob.");if(void 0===e.byteLength)throw new Error(`Cannot create a JSStreamReference from the value '${e}' as it doesn't have a byteLength.`);t=e.byteLength}const r={[s]:t};try{const t=f(e);r[n]=t[n]}catch(t){throw new Error(`Cannot create a JSStreamReference from the value '${e}'.`)}return r}function m(e,n){c=e;const r=n?JSON.parse(n,((e,n)=>t.reduce(((t,n)=>n(e,t)),n))):null;return c=void 0,r}function y(){if(void 0===a)throw new Error("No call dispatcher has been set.");if(null===a)throw new Error("There are multiple .NET runtimes present, so a default dispatcher could not be resolved. Use DotNetObject to invoke .NET instance methods.");return a}e.attachDispatcher=function(e){const t=new w(e);return void 0===a?a=t:a&&(a=null),t},e.attachReviver=p,e.invokeMethod=function(e,t,...n){return y().invokeDotNetStaticMethod(e,t,...n)},e.invokeMethodAsync=function(e,t,...n){return y().invokeDotNetStaticMethodAsync(e,t,...n)},e.createJSObjectReference=f,e.createJSStreamReference=g,e.disposeJSObjectReference=function(e){const t=e&&e[n];"number"==typeof t&&_(t)},function(e){e[e.Default=0]="Default",e[e.JSObjectReference=1]="JSObjectReference",e[e.JSStreamReference=2]="JSStreamReference",e[e.JSVoidResult=3]="JSVoidResult"}(d=e.JSCallResultType||(e.JSCallResultType={}));class w{constructor(e){this._dotNetCallDispatcher=e,this._byteArraysToBeRevived=new Map,this._pendingDotNetToJSStreams=new Map,this._pendingAsyncCalls={},this._nextAsyncCallId=1}getDotNetCallDispatcher(){return this._dotNetCallDispatcher}invokeJSFromDotNet(e,t,n,r){const o=m(this,t),i=I(b(e,r)(...o||[]),n);return null==i?null:T(this,i)}beginInvokeJSFromDotNet(e,t,n,r,o){const i=new Promise((e=>{const r=m(this,n);e(b(t,o)(...r||[]))}));e&&i.then((t=>T(this,[e,!0,I(t,r)]))).then((t=>this._dotNetCallDispatcher.endInvokeJSFromDotNet(e,!0,t)),(t=>this._dotNetCallDispatcher.endInvokeJSFromDotNet(e,!1,JSON.stringify([e,!1,v(t)]))))}endInvokeDotNetFromJS(e,t,n){const r=t?m(this,n):new Error(n);this.completePendingCall(parseInt(e,10),t,r)}invokeDotNetStaticMethod(e,t,...n){return this.invokeDotNetMethod(e,t,null,n)}invokeDotNetStaticMethodAsync(e,t,...n){return this.invokeDotNetMethodAsync(e,t,null,n)}invokeDotNetMethod(e,t,n,r){if(this._dotNetCallDispatcher.invokeDotNetFromJS){const o=T(this,r),i=this._dotNetCallDispatcher.invokeDotNetFromJS(e,t,n,o);return i?m(this,i):null}throw new Error("The current dispatcher does not support synchronous calls from JS to .NET. Use invokeDotNetMethodAsync instead.")}invokeDotNetMethodAsync(e,t,n,r){if(e&&n)throw new Error(`For instance method calls, assemblyName should be null. Received '${e}'.`);const o=this._nextAsyncCallId++,i=new Promise(((e,t)=>{this._pendingAsyncCalls[o]={resolve:e,reject:t}}));try{const i=T(this,r);this._dotNetCallDispatcher.beginInvokeDotNetFromJS(o,e,t,n,i)}catch(e){this.completePendingCall(o,!1,e)}return i}receiveByteArray(e,t){this._byteArraysToBeRevived.set(e,t)}processByteArray(e){const t=this._byteArraysToBeRevived.get(e);return t?(this._byteArraysToBeRevived.delete(e),t):null}supplyDotNetStream(e,t){if(this._pendingDotNetToJSStreams.has(e)){const n=this._pendingDotNetToJSStreams.get(e);this._pendingDotNetToJSStreams.delete(e),n.resolve(t)}else{const n=new C;n.resolve(t),this._pendingDotNetToJSStreams.set(e,n)}}getDotNetStreamPromise(e){let t;if(this._pendingDotNetToJSStreams.has(e))t=this._pendingDotNetToJSStreams.get(e).streamPromise,this._pendingDotNetToJSStreams.delete(e);else{const n=new C;this._pendingDotNetToJSStreams.set(e,n),t=n.streamPromise}return t}completePendingCall(e,t,n){if(!this._pendingAsyncCalls.hasOwnProperty(e))throw new Error(`There is no pending async call with ID ${e}.`);const r=this._pendingAsyncCalls[e];delete this._pendingAsyncCalls[e],t?r.resolve(n):r.reject(n)}}function v(e){return e instanceof Error?`${e.message}\n${e.stack}`:e?e.toString():"null"}function b(e,t){const n=h[t];if(n)return n.findFunction(e);throw new Error(`JS object instance with ID ${t} does not exist (has it been disposed?).`)}function _(e){delete h[e]}e.findJSFunction=b,e.disposeJSObjectReferenceById=_;class E{constructor(e,t){this._id=e,this._callDispatcher=t}invokeMethod(e,...t){return this._callDispatcher.invokeDotNetMethod(null,e,this._id,t)}invokeMethodAsync(e,...t){return this._callDispatcher.invokeDotNetMethodAsync(null,e,this._id,t)}dispose(){this._callDispatcher.invokeDotNetMethodAsync(null,"__Dispose",this._id,null).catch((e=>console.error(e)))}serializeAsArg(){return{[r]:this._id}}}e.DotNetObject=E,p((function(e,t){if(t&&"object"==typeof t){if(t.hasOwnProperty(r))return new E(t[r],c);if(t.hasOwnProperty(n)){const e=t[n],r=h[e];if(r)return r.getWrappedObject();throw new Error(`JS object instance with Id '${e}' does not exist. It may have been disposed.`)}if(t.hasOwnProperty(o)){const e=t[o],n=c.processByteArray(e);if(void 0===n)throw new Error(`Byte array index '${e}' does not exist.`);return n}if(t.hasOwnProperty(i)){const e=t[i],n=c.getDotNetStreamPromise(e);return new S(n)}}return t}));class S{constructor(e){this._streamPromise=e}stream(){return this._streamPromise}async arrayBuffer(){return new Response(await this.stream()).arrayBuffer()}}class C{constructor(){this.streamPromise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}function I(e,t){switch(t){case d.Default:return e;case d.JSObjectReference:return f(e);case d.JSStreamReference:return g(e);case d.JSVoidResult:return null;default:throw new Error(`Invalid JS call result type '${t}'.`)}}let k=0;function T(e,t){k=0,c=e;const n=JSON.stringify(t,x);return c=void 0,n}function x(e,t){if(t instanceof E)return t.serializeAsArg();if(t instanceof Uint8Array){c.getDotNetCallDispatcher().sendByteArray(k,t);const e={[o]:k};return k++,e}return t}}(e||(e={})),function(e){e[e.prependFrame=1]="prependFrame",e[e.removeFrame=2]="removeFrame",e[e.setAttribute=3]="setAttribute",e[e.removeAttribute=4]="removeAttribute",e[e.updateText=5]="updateText",e[e.stepIn=6]="stepIn",e[e.stepOut=7]="stepOut",e[e.updateMarkup=8]="updateMarkup",e[e.permutationListEntry=9]="permutationListEntry",e[e.permutationListEnd=10]="permutationListEnd"}(t||(t={})),function(e){e[e.element=1]="element",e[e.text=2]="text",e[e.attribute=3]="attribute",e[e.component=4]="component",e[e.region=5]="region",e[e.elementReferenceCapture=6]="elementReferenceCapture",e[e.markup=8]="markup"}(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 d(e){const t=[];for(let n=0;ne.selected)).map((e=>e.value))}}{const e=function(e){return!!e&&"INPUT"===e.tagName&&"checkbox"===e.getAttribute("type")}(t);return{value:e?!!t.checked:t.value}}}}),h(["copy","cut","paste"],{createEventArgs:e=>({type:e.type})}),h(["drag","dragend","dragenter","dragleave","dragover","dragstart","drop"],{createEventArgs:e=>{return{...u(t=e),dataTransfer:t.dataTransfer?{dropEffect:t.dataTransfer.dropEffect,effectAllowed:t.dataTransfer.effectAllowed,files:Array.from(t.dataTransfer.files).map((e=>e.name)),items:Array.from(t.dataTransfer.items).map((e=>({kind:e.kind,type:e.type}))),types:t.dataTransfer.types}:null};var t}}),h(["focus","blur","focusin","focusout"],{createEventArgs:e=>({type:e.type})}),h(["keydown","keyup","keypress"],{createEventArgs:e=>{return{key:(t=e).key,code:t.code,location:t.location,repeat:t.repeat,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,type:t.type};var t}}),h(["contextmenu","click","mouseover","mouseout","mousemove","mousedown","mouseup","mouseleave","mouseenter","dblclick"],{createEventArgs:e=>u(e)}),h(["error"],{createEventArgs:e=>{return{message:(t=e).message,filename:t.filename,lineno:t.lineno,colno:t.colno,type:t.type};var t}}),h(["loadstart","timeout","abort","load","loadend","progress"],{createEventArgs:e=>{return{lengthComputable:(t=e).lengthComputable,loaded:t.loaded,total:t.total,type:t.type};var t}}),h(["touchcancel","touchend","touchmove","touchenter","touchleave","touchstart"],{createEventArgs:e=>{return{detail:(t=e).detail,touches:d(t.touches),targetTouches:d(t.targetTouches),changedTouches:d(t.changedTouches),ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,type:t.type};var t}}),h(["gotpointercapture","lostpointercapture","pointercancel","pointerdown","pointerenter","pointerleave","pointermove","pointerout","pointerover","pointerup"],{createEventArgs:e=>{return{...u(t=e),pointerId:t.pointerId,width:t.width,height:t.height,pressure:t.pressure,tiltX:t.tiltX,tiltY:t.tiltY,pointerType:t.pointerType,isPrimary:t.isPrimary};var t}}),h(["wheel","mousewheel"],{createEventArgs:e=>{return{...u(t=e),deltaX:t.deltaX,deltaY:t.deltaY,deltaZ:t.deltaZ,deltaMode:t.deltaMode};var t}}),h(["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 E().invokeMethodAsync("AddRootComponent",t,r),i=new _(o,m[t]);return await i.setParameters(n),i}};function v(e){const t=f.get(e);if(t)return f.delete(e),t}class b{invoke(e){return this._callback(e)}setCallback(t){this._selfJSObjectReference||(this._selfJSObjectReference=e.createJSObjectReference(this)),this._callback=t}getJSObjectReference(){return this._selfJSObjectReference}dispose(){this._selfJSObjectReference&&e.disposeJSObjectReference(this._selfJSObjectReference)}}class _{constructor(e,t){this._jsEventCallbackWrappers=new Map,this._componentId=e;for(const e of t)"eventcallback"===e.type&&this._jsEventCallbackWrappers.set(e.name.toLowerCase(),new b)}setParameters(e){const t={},n=Object.entries(e||{}),r=n.length;for(const[e,r]of n){const n=this._jsEventCallbackWrappers.get(e.toLowerCase());n&&r?(n.setCallback(r),t[e]=n.getJSObjectReference()):t[e]=r}return E().invokeMethodAsync("SetRootComponentParameters",this._componentId,r,t)}async dispose(){if(null!==this._componentId){await E().invokeMethodAsync("RemoveRootComponent",this._componentId),this._componentId=null;for(const e of this._jsEventCallbackWrappers.values())e.dispose()}}}function E(){if(!g)throw new Error("Dynamic root components have not been enabled in this application.");return g}const S=[];let C;const I=new Promise((e=>{C=e}));function k(e,t,n){return x(e,t.eventHandlerId,(()=>T(e).invokeMethodAsync("DispatchEventAsync",t,n)))}function T(e){const t=S[e];if(!t)throw new Error(`No interop methods are registered for renderer ${e}`);return t}let x=(e,t,n)=>n();const D=M(["abort","blur","canplay","canplaythrough","change","cuechange","durationchange","emptied","ended","error","focus","load","loadeddata","loadedmetadata","loadend","loadstart","mouseenter","mouseleave","pointerenter","pointerleave","pause","play","playing","progress","ratechange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeupdate","toggle","unload","volumechange","waiting","DOMNodeInsertedIntoDocument","DOMNodeRemovedFromDocument"]),N={submit:!0},A=M(["click","dblclick","mousedown","mousemove","mouseup"]);class R{constructor(e){this.browserRendererId=e,this.afterClickCallbacks=[];const t=++R.nextEventDelegatorId;this.eventsCollectionKey=`_blazorEvents_${t}`,this.eventInfoStore=new P(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(D,e);let l=!1;for(;r;){const u=r,p=this.getEventHandlerInfosForElement(u,!1);if(p){const n=p.getHandler(e);if(n&&(h=u,d=t.type,!((h instanceof HTMLButtonElement||h instanceof HTMLInputElement||h instanceof HTMLTextAreaElement||h instanceof HTMLSelectElement)&&Object.prototype.hasOwnProperty.call(A,d)&&h.disabled))){if(!s){const n=c(e);i=(null==n?void 0:n.createEventArgs)?n.createEventArgs(t):{},s=!0}Object.prototype.hasOwnProperty.call(N,t.type)&&t.preventDefault(),k(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,d}getEventHandlerInfosForElement(e,t){return Object.prototype.hasOwnProperty.call(e,this.eventsCollectionKey)?e[this.eventsCollectionKey]:t?e[this.eventsCollectionKey]=new U:null}}R.nextEventDelegatorId=0;class P{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(D,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 U{constructor(){this.handlers={},this.preventDefaultFlags=null,this.stopPropagationFlags=null}getHandler(e){return Object.prototype.hasOwnProperty.call(this.handlers,e)?this.handlers[e]:null}setHandler(e,t){this.handlers[e]=t}removeHandler(e){delete this.handlers[e]}preventDefault(e,t){return void 0!==t&&(this.preventDefaultFlags=this.preventDefaultFlags||{},this.preventDefaultFlags[e]=t),!!this.preventDefaultFlags&&this.preventDefaultFlags[e]}stopPropagation(e,t){return void 0!==t&&(this.stopPropagationFlags=this.stopPropagationFlags||{},this.stopPropagationFlags[e]=t),!!this.stopPropagationFlags&&this.stopPropagationFlags[e]}}function M(e){const t={};return e.forEach((e=>{t[e]=!0})),t}const L=Z("_blazorLogicalChildren"),B=Z("_blazorLogicalParent"),O=Z("_blazorLogicalEnd");function F(e,t){if(!e.parentNode)throw new Error(`Comment not connected to the DOM ${e.textContent}`);const n=e.parentNode,r=$(n,!0),o=K(r);return Array.from(n.childNodes).forEach((e=>o.push(e))),e[B]=r,t&&(e[O]=t,$(t)),$(e)}function $(e,t){if(e.childNodes.length>0&&!t)throw new Error("New logical elements must start empty, or allowExistingContents must be true");return L in e||(e[L]=[]),e}function H(e,t){const n=document.createComment("!");return j(n,e,t),n}function j(e,t,n){const r=e;if(e instanceof Comment&&K(r)&&K(r).length>0)throw new Error("Not implemented: inserting non-empty logical container");if(z(r))throw new Error("Not implemented: moving existing logical children");const o=K(t);if(n0;)W(n,0)}const r=n;r.parentNode.removeChild(r)}function z(e){return e[B]||null}function J(e,t){return K(e)[t]}function q(e){const t=X(e);return"http://www.w3.org/2000/svg"===t.namespaceURI&&"foreignObject"!==t.tagName}function K(e){return e[L]}function V(e,t){const n=K(e);t.forEach((e=>{e.moveRangeStart=n[e.fromSiblingIndex],e.moveRangeEnd=Q(e.moveRangeStart)})),t.forEach((t=>{const r=document.createComment("marker");t.moveToBeforeMarker=r;const o=n[t.toSiblingIndex+1];o?o.parentNode.insertBefore(r,o):Y(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 X(e){if(e instanceof Element||e instanceof DocumentFragment)return e;if(e instanceof Comment)return e.parentNode;throw new Error("Not a valid logical element")}function G(e){const t=K(z(e));return t[Array.prototype.indexOf.call(t,e)+1]||null}function Y(e,t){if(t instanceof Element||t instanceof DocumentFragment)t.appendChild(e);else{if(!(t instanceof Comment))throw new Error(`Cannot append node because the parent is not a valid logical element. Parent: ${t}`);{const n=G(t);n?n.parentNode.insertBefore(e,n):Y(e,z(t))}}}function Q(e){if(e instanceof Element||e instanceof DocumentFragment)return e;const t=G(e);if(t)return t.previousSibling;{const t=z(e);return t instanceof Element||t instanceof DocumentFragment?t.lastChild:Q(t)}}function Z(e){return"function"==typeof Symbol?Symbol():e}function ee(e){return`_bl_${e}`}const te="__internalId";e.attachReviver(((e,t)=>t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,te)&&"string"==typeof t[te]?function(e){const t=`[${ee(e)}]`;return document.querySelector(t)}(t[te]):t));const ne="_blazorDeferredValue";function re(e,t,n){switch(t){case"value":return function(e,t){switch(t&&"INPUT"===e.tagName&&(t=function(e,t){switch(t.getAttribute("type")){case"time":return 8!==e.length||!e.endsWith("00")&&t.hasAttribute("step")?e:e.substring(0,5);case"datetime-local":return 19!==e.length||!e.endsWith("00")&&t.hasAttribute("step")?e:e.substring(0,16);default:return e}}(t,e)),e.tagName){case"INPUT":case"SELECT":case"TEXTAREA":return t&&e instanceof HTMLSelectElement&&se(e)&&(t=JSON.parse(t)),ce(e,t),e[ne]=t,!0;case"OPTION":return t||""===t?e.setAttribute("value",t):e.removeAttribute("value"),le(e),!0;default:return!1}}(e,n);case"checked":return function(e,t){return"INPUT"===e.tagName&&(e.checked=null!==t,!0)}(e,n);default:return!1}}function oe(e){switch(e.name){case"value":{const t=e.ownerElement;switch(t.tagName){case"INPUT":case"SELECT":case"TEXTAREA":return t.value}break}case"checked":{const t=e.ownerElement;if("INPUT"===t.tagName){const e=t;return e.checked?e.value:""}break}}return e.value}function ie(e){e instanceof HTMLOptionElement?le(e):ne in e&&ce(e,e[ne])}function se(e){return"select-multiple"===e.type}function ae(e,t){e.value=t||""}function ce(e,t){e instanceof HTMLSelectElement?se(e)?function(e,t){t||(t=[]);for(let n=0;n{ke()&&Ee(e,(e=>{Oe(e,!0,!1)}))}))}attachRootComponentToLogicalElement(e,t,n){this.attachComponentToElement(e,t),this.rootComponentIds.add(e),n||(ue[e]=t)}updateComponent(e,t,n,r){var o;const i=this.childComponentLocations[t];if(!i)throw new Error(`No element is currently associated with component ${t}`);const s=ue[t];if(s){const e=function(e){return e[O]||null}(s);delete ue[t],e?function(e,t){const n=z(e);if(!n)throw new Error("Can't clear between nodes. The start node does not have a logical parent.");const r=K(n),o=r.indexOf(e)+1,i=r.indexOf(t);for(let e=o;e<=i;e++)W(n,o);e.textContent="!"}(s,e):function(e){let t;for(;t=e.firstChild;)e.removeChild(t)}(s)}const a=null===(o=X(i))||void 0===o?void 0:o.getRootNode(),c=a&&a.activeElement;this.applyEdits(e,t,i,0,n,r),c instanceof HTMLElement&&a&&a.activeElement!==c&&c.focus()}disposeComponent(e){this.rootComponentIds.delete(e)&&function(e){const t=K(e);for(;t.length;)W(e,0)}(this.childComponentLocations[e]),delete this.childComponentLocations[e]}disposeEventHandler(e){this.eventDelegator.removeListener(e)}attachComponentToElement(e,t){this.childComponentLocations[e]=t}applyEdits(e,n,r,o,i,s){let a,c=0,l=o;const h=e.arrayBuilderSegmentReader,d=e.editReader,u=e.frameReader,p=h.values(i),f=h.offset(i),g=f+h.count(i);for(let i=f;idocument.baseURI,getLocationHref:()=>location.href,scrollToElement:Le};function Le(e){const t=document.getElementById(e);return!!t&&(t.scrollIntoView(),!0)}function Be(e,t,n=!1){const r=Ce(e);!t.forceLoad&&Se(r)?Oe(r,!1,t.replaceHistoryEntry,t.historyEntryState,n):function(e,t){if(location.href===e){const t=e+"?";history.replaceState(null,"",t),location.replace(e)}else t?location.replace(e):location.href=e}(e,t.replaceHistoryEntry)}async function Oe(e,t,n,r=void 0,o=!1){if(He(),function(e){const t=e.indexOf("#");return t>-1&&location.href.replace(location.hash,"")===e.substring(0,t)}(e))!function(e,t,n){Fe(e,t,n);const r=e.indexOf("#");r!==e.length-1&&Le(e.substring(r+1))}(e,n,r);else{if(!o&&xe&&!await je(e,r,t))return;ye=!0,Fe(e,n,r),await We(t)}}function Fe(e,t,n=void 0){t?history.replaceState({userState:n,_index:De},"",e):(De++,history.pushState({userState:n,_index:De},"",e))}function $e(e){return new Promise((t=>{const n=Pe;Pe=()=>{Pe=n,t()},history.go(e)}))}function He(){Ue&&(Ue(!1),Ue=null)}function je(e,t,n){return new Promise((r=>{He(),Re?(Ne++,Ue=r,Re(Ne,e,t,n)):r(!1)}))}async function We(e){var t;Ae&&await Ae(location.href,null===(t=history.state)||void 0===t?void 0:t.userState,e)}async function ze(e){var t,n;Pe&&await Pe(e),De=null!==(n=null===(t=history.state)||void 0===t?void 0:t._index)&&void 0!==n?n:0}const Je={focus:function(e,t){if(e instanceof HTMLElement)e.focus({preventScroll:t});else{if(!(e instanceof SVGElement))throw new Error("Unable to focus an invalid element.");if(!e.hasAttribute("tabindex"))throw new Error("Unable to focus an SVG element that does not have a tabindex.");e.focus({preventScroll:t})}},focusBySelector:function(e,t){const n=document.querySelector(e);n&&(n.hasAttribute("tabindex")||(n.tabIndex=-1),n.focus({preventScroll:!0}))}},qe={init:function(e,t,n,r=50){const o=Ve(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)}Ke[e._id]={intersectionObserver:s,mutationObserverBefore:a,mutationObserverAfter:c}},dispose:function(e){const t=Ke[e._id];t&&(t.intersectionObserver.disconnect(),t.mutationObserverBefore.disconnect(),t.mutationObserverAfter.disconnect(),e.dispose(),delete Ke[e._id])}},Ke={};function Ve(e){return e&&e!==document.body&&e!==document.documentElement?"visible"!==getComputedStyle(e).overflowY?e:Ve(e.parentElement):null}const Xe={getAndRemoveExistingTitle:function(){var e;const t=document.head?document.head.getElementsByTagName("title"):[];if(0===t.length)return null;let n=null;for(let r=t.length-1;r>=0;r--){const o=t[r],i=o.previousSibling;i instanceof Comment&&null!==z(i)||(null===n&&(n=o.textContent),null===(e=o.parentNode)||void 0===e||e.removeChild(o))}return n}},Ge={init:function(e,t){t._blazorInputFileNextFileId=0,t.addEventListener("click",(function(){t.value=""})),t.addEventListener("change",(function(){t._blazorFilesById={};const n=Array.prototype.map.call(t.files,(function(e){const n={id:++t._blazorInputFileNextFileId,lastModified:new Date(e.lastModified).toISOString(),name:e.name,size:e.size,contentType:e.type,readPromise:void 0,arrayBuffer:void 0,blob:e};return t._blazorFilesById[n.id]=n,n}));e.invokeMethodAsync("NotifyChange",n)}))},toImageFile:async function(e,t,n,r,o){const i=Ye(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 Ye(e,t).blob}};function Ye(e,t){const n=e._blazorFilesById[t];if(!n)throw new Error(`There is no file with ID ${t}. The file list may have changed. See https://aka.ms/aspnet/blazor-input-file-multiple-selections.`);return n}const Qe=new Set,Ze={enableNavigationPrompt:function(e){0===Qe.size&&window.addEventListener("beforeunload",et),Qe.add(e)},disableNavigationPrompt:function(e){Qe.delete(e),0===Qe.size&&window.removeEventListener("beforeunload",et)}};function et(e){e.preventDefault(),e.returnValue=!0}async function tt(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 nt=new Map,rt={navigateTo:function(e,t,n=!1){Be(e,t instanceof Object?t:{forceLoad:t,replaceHistoryEntry:n})},registerCustomEventType:function(e,t){if(!t)throw new Error("The options parameter is required.");if(i.has(e))throw new Error(`The event '${e}' is already registered.`);if(t.browserEventName){const n=s.get(t.browserEventName);n?n.push(e):s.set(t.browserEventName,[e]),a.forEach((n=>n(e,t.browserEventName)))}i.set(e,t)},rootComponents:w,_internal:{navigationManager:Me,domWrapper:Je,Virtualize:qe,PageTitle:Xe,InputFile:Ge,NavigationLock:Ze,getJSDataStreamChunk:tt,attachWebRendererInterop:function(t,n,r){const o=S.length;return S.push(t),Object.keys(n).length>0&&function(t,n,r){if(g)throw new Error("Dynamic root components have already been enabled.");g=t,m=n;for(const[t,o]of Object.entries(r)){const r=e.findJSFunction(t,0);for(const e of o)r(e,n[e])}}(T(o),n,r),C(),o}}};window.Blazor=rt;const ot=[0,2e3,1e4,3e4,null];class it{constructor(e){this._retryDelays=void 0!==e?[...e,null]:ot}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}}class st{}st.Authorization="Authorization",st.Cookie="Cookie";class at{constructor(e,t,n){this.statusCode=e,this.statusText=t,this.content=n}}class ct{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""}}class lt extends ct{constructor(e,t){super(),this._innerClient=e,this._accessTokenFactory=t}async send(e){let t=!0;this._accessTokenFactory&&(!this._accessToken||e.url&&e.url.indexOf("/negotiate?")>0)&&(t=!1,this._accessToken=await this._accessTokenFactory()),this._setAuthorizationHeader(e);const n=await this._innerClient.send(e);return t&&401===n.statusCode&&this._accessTokenFactory?(this._accessToken=await this._accessTokenFactory(),this._setAuthorizationHeader(e),await this._innerClient.send(e)):n}_setAuthorizationHeader(e){e.headers||(e.headers={}),this._accessToken?e.headers[st.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[st.Authorization]&&delete e.headers[st.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}}class ht extends Error{constructor(e,t){const n=new.target.prototype;super(`${e}: Status code '${t}'`),this.statusCode=t,this.__proto__=n}}class dt extends Error{constructor(e="A timeout occurred."){const t=new.target.prototype;super(e),this.__proto__=t}}class ut extends Error{constructor(e="An abort occurred."){const t=new.target.prototype;super(e),this.__proto__=t}}class pt extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.transport=t,this.errorType="UnsupportedTransportError",this.__proto__=n}}class ft extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.transport=t,this.errorType="DisabledTransportError",this.__proto__=n}}class gt extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.transport=t,this.errorType="FailedToStartTransportError",this.__proto__=n}}class mt extends Error{constructor(e){const t=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=t}}class yt extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.innerErrors=t,this.__proto__=n}}var wt;!function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Information=2]="Information",e[e.Warning=3]="Warning",e[e.Error=4]="Error",e[e.Critical=5]="Critical",e[e.None=6]="None"}(wt||(wt={}));class vt{constructor(){}log(e,t){}}vt.instance=new vt;const bt="0.0.0-DEV_BUILD";class _t{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 St(e,t){let n="";return Ct(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 Ct(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}async function It(e,t,n,r,o,i){const s={},[a,c]=xt();s[a]=c,e.log(wt.Trace,`(${t} transport) sending data. ${St(o,i.logMessageContent)}.`);const l=Ct(o)?"arraybuffer":"text",h=await n.post(r,{content:o,headers:{...s,...i.headers},responseType:l,timeout:i.timeout,withCredentials:i.withCredentials});e.log(wt.Trace,`(${t} transport) request complete. Response status: ${h.statusCode}.`)}class kt{constructor(e,t){this._subject=e,this._observer=t}dispose(){const e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),0===this._subject.observers.length&&this._subject.cancelCallback&&this._subject.cancelCallback().catch((e=>{}))}}class Tt{constructor(e){this._minLevel=e,this.out=console}log(e,t){if(e>=this._minLevel){const n=`[${(new Date).toISOString()}] ${wt[e]}: ${t}`;switch(e){case wt.Critical:case wt.Error:this.out.error(n);break;case wt.Warning:this.out.warn(n);break;case wt.Information:this.out.info(n);break;default:this.out.log(n)}}}}function xt(){let e="X-SignalR-User-Agent";return Et.isNode&&(e="User-Agent"),[e,Dt(bt,Nt(),Et.isNode?"NodeJS":"Browser",At())]}function Dt(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 Nt(){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 At(){if(Et.isNode)return process.versions.node}function Rt(e){return e.stack?e.stack:e.message?e.message:`${e}`}class Pt extends ct{constructor(e){if(super(),this._logger=e,"undefined"==typeof fetch){const e=require;this._jar=new(e("tough-cookie").CookieJar),"undefined"==typeof fetch?this._fetchType=e("node-fetch"):this._fetchType=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 ut;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 ut});let r,o=null;if(e.timeout){const r=e.timeout;o=setTimeout((()=>{t.abort(),this._logger.log(wt.Warning,"Timeout from HTTP request."),n=new dt}),r)}""===e.content&&(e.content=void 0),e.content&&(e.headers=e.headers||{},Ct(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(wt.Warning,`Error from HTTP request. ${e}.`),e}finally{o&&clearTimeout(o),e.abortSignal&&(e.abortSignal.onabort=null)}if(!r.ok){const e=await Ut(r,"text");throw new ht(e||r.statusText,r.status)}const i=Ut(r,e.responseType),s=await i;return new at(r.status,r.statusText,s)}getCookieString(e){return""}}function Ut(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 Mt extends ct{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new ut):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&&(Ct(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 ut)}),e.timeout&&(r.timeout=e.timeout),r.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),r.status>=200&&r.status<300?t(new at(r.status,r.statusText,r.response||r.responseText)):n(new ht(r.response||r.responseText||r.statusText,r.status))},r.onerror=()=>{this._logger.log(wt.Warning,`Error from HTTP request. ${r.status}: ${r.statusText}.`),n(new ht(r.statusText,r.status))},r.ontimeout=()=>{this._logger.log(wt.Warning,"Timeout from HTTP request."),n(new dt)},r.send(e.content)})):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class Lt extends ct{constructor(e){if(super(),"undefined"!=typeof fetch)this._httpClient=new Pt(e);else{if("undefined"==typeof XMLHttpRequest)throw new Error("No usable HttpClient found.");this._httpClient=new Mt(e)}}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new ut):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}}var Bt,Ot,Ft,$t;!function(e){e[e.None=0]="None",e[e.WebSockets=1]="WebSockets",e[e.ServerSentEvents=2]="ServerSentEvents",e[e.LongPolling=4]="LongPolling"}(Bt||(Bt={})),function(e){e[e.Text=1]="Text",e[e.Binary=2]="Binary"}(Ot||(Ot={}));class Ht{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 jt{get pollAborted(){return this._pollAbort.aborted}constructor(e,t,n){this._httpClient=e,this._logger=t,this._pollAbort=new Ht,this._options=n,this._running=!1,this.onreceive=null,this.onclose=null}async connect(e,t){if(_t.isRequired(e,"url"),_t.isRequired(t,"transferFormat"),_t.isIn(t,Ot,"transferFormat"),this._url=e,this._logger.log(wt.Trace,"(LongPolling transport) Connecting."),t===Ot.Binary&&"undefined"!=typeof XMLHttpRequest&&"string"!=typeof(new XMLHttpRequest).responseType)throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[n,r]=xt(),o={[n]:r,...this._options.headers},i={abortSignal:this._pollAbort.signal,headers:o,timeout:1e5,withCredentials:this._options.withCredentials};t===Ot.Binary&&(i.responseType="arraybuffer");const s=`${e}&_=${Date.now()}`;this._logger.log(wt.Trace,`(LongPolling transport) polling: ${s}.`);const a=await this._httpClient.get(s,i);200!==a.statusCode?(this._logger.log(wt.Error,`(LongPolling transport) Unexpected response code: ${a.statusCode}.`),this._closeError=new ht(a.statusText||"",a.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,i)}async _poll(e,t){try{for(;this._running;)try{const n=`${e}&_=${Date.now()}`;this._logger.log(wt.Trace,`(LongPolling transport) polling: ${n}.`);const r=await this._httpClient.get(n,t);204===r.statusCode?(this._logger.log(wt.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):200!==r.statusCode?(this._logger.log(wt.Error,`(LongPolling transport) Unexpected response code: ${r.statusCode}.`),this._closeError=new ht(r.statusText||"",r.statusCode),this._running=!1):r.content?(this._logger.log(wt.Trace,`(LongPolling transport) data received. ${St(r.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(r.content)):this._logger.log(wt.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(e){this._running?e instanceof dt?this._logger.log(wt.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=e,this._running=!1):this._logger.log(wt.Trace,`(LongPolling transport) Poll errored after shutdown: ${e.message}`)}}finally{this._logger.log(wt.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(e){return this._running?It(this._logger,"LongPolling",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this._logger.log(wt.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(wt.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const e={},[t,n]=xt();e[t]=n;const r={headers:{...e,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials};await this._httpClient.delete(this._url,r),this._logger.log(wt.Trace,"(LongPolling transport) DELETE request sent.")}finally{this._logger.log(wt.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(wt.Trace,e),this.onclose(this._closeError)}}}class Wt{constructor(e,t,n,r){this._httpClient=e,this._accessToken=t,this._logger=n,this._options=r,this.onreceive=null,this.onclose=null}async connect(e,t){return _t.isRequired(e,"url"),_t.isRequired(t,"transferFormat"),_t.isIn(t,Ot,"transferFormat"),this._logger.log(wt.Trace,"(SSE transport) Connecting."),this._url=e,this._accessToken&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise(((n,r)=>{let o,i=!1;if(t===Ot.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]=xt();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(wt.Trace,`(SSE transport) data received. ${St(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(wt.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?It(this._logger,"SSE",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}}class zt{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 _t.isRequired(e,"url"),_t.isRequired(t,"transferFormat"),_t.isIn(t,Ot,"transferFormat"),this._logger.log(wt.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]=xt();t[r]=o,n&&(t[st.Authorization]=`Bearer ${n}`),s&&(t[st.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===Ot.Binary&&(i.binaryType="arraybuffer"),i.onopen=t=>{this._logger.log(wt.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(wt.Information,`(WebSockets transport) ${t}.`)},i.onmessage=e=>{if(this._logger.log(wt.Trace,`(WebSockets transport) data received. ${St(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(wt.Trace,`(WebSockets transport) sending data. ${St(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(wt.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 Jt{constructor(e,t={}){var n;if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,_t.isRequired(e,"url"),this._logger=void 0===(n=t.logger)?new Tt(wt.Information):null===n?vt.instance:void 0!==n.log?n:new Tt(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=new lt(t.httpClient||new Lt(this._logger),t.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=t,this.onreceive=null,this.onclose=null}async start(e){if(e=e||Ot.Binary,_t.isIn(e,Ot,"transferFormat"),this._logger.log(wt.Debug,`Starting connection with transfer format '${Ot[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(wt.Error,e),await this._stopPromise,Promise.reject(new ut(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(wt.Error,e),Promise.reject(new ut(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 qt(this.transport)),this._sendQueue.send(e))}async stop(e){return"Disconnected"===this._connectionState?(this._logger.log(wt.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):"Disconnecting"===this._connectionState?(this._logger.log(wt.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(wt.Error,`HttpConnection.transport.stop() threw error '${e}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(wt.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async _startInternal(e){let t=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport!==Bt.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(Bt.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 ut("The connection was stopped during negotiation.");if(n.error)throw new Error(n.error);if(n.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(n.url&&(t=n.url),n.accessToken){const e=n.accessToken;this._accessTokenFactory=()=>e,this._httpClient._accessToken=e,this._httpClient._accessTokenFactory=void 0}r++}while(n.url&&r<100);if(100===r&&n.url)throw new Error("Negotiate redirection limit exceeded.");await this._createTransport(t,this._options.transport,n,e)}this.transport instanceof jt&&(this.features.inherentKeepAlive=!0),"Connecting"===this._connectionState&&(this._logger.log(wt.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(e){return this._logger.log(wt.Error,"Failed to start the connection: "+e),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(e)}}async _getNegotiationResponse(e){const t={},[n,r]=xt();t[n]=r;const o=this._resolveNegotiateUrl(e);this._logger.log(wt.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 ht&&404===e.statusCode&&(t+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(wt.Error,t),Promise.reject(new mt(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(wt.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(wt.Error,`Failed to start the transport '${n.transport}': ${e}`),a=void 0,i.push(new gt(`${n.transport} failed: ${e}`,Bt[n.transport])),"Connecting"!==this._connectionState){const e="Failed to select transport before stop() was called.";return this._logger.log(wt.Debug,e),Promise.reject(new ut(e))}}}}return i.length>0?Promise.reject(new yt(`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 Bt.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new zt(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case Bt.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new Wt(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case Bt.LongPolling:return new jt(this._httpClient,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=Bt[e.transport];if(null==r)return this._logger.log(wt.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(wt.Debug,`Skipping transport '${Bt[r]}' because it was disabled by the client.`),new ft(`'${Bt[r]}' is disabled by the client.`,r);if(!(e.transferFormats.map((e=>Ot[e])).indexOf(n)>=0))return this._logger.log(wt.Debug,`Skipping transport '${Bt[r]}' because it does not support the requested transfer format '${Ot[n]}'.`),new Error(`'${Bt[r]}' does not support ${Ot[n]}.`);if(r===Bt.WebSockets&&!this._options.WebSocket||r===Bt.ServerSentEvents&&!this._options.EventSource)return this._logger.log(wt.Debug,`Skipping transport '${Bt[r]}' because it is not supported in your environment.'`),new pt(`'${Bt[r]}' is not supported in your environment.`,r);this._logger.log(wt.Debug,`Selecting transport '${Bt[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(wt.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(wt.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(wt.Error,`Connection disconnected with error '${e}'.`):this._logger.log(wt.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch((e=>{this._logger.log(wt.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(wt.Error,`HttpConnection.onclose(${e}) threw error '${t}'.`)}}}else this._logger.log(wt.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(wt.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 qt{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new Kt,this._transportResult=new Kt,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new Kt),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 Kt;const e=this._transportResult;this._transportResult=void 0;const t="string"==typeof this._buffer[0]?this._buffer.join(""):qt._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 Kt{constructor(){this.promise=new Promise(((e,t)=>[this._resolver,this._rejecter]=[e,t]))}resolve(){this._resolver()}reject(e){this._rejecter(e)}}class Vt{static write(e){return`${e}${Vt.RecordSeparator}`}static parse(e){if(e[e.length-1]!==Vt.RecordSeparator)throw new Error("Message is incomplete.");const t=e.split(Vt.RecordSeparator);return t.pop(),t}}Vt.RecordSeparatorCode=30,Vt.RecordSeparator=String.fromCharCode(Vt.RecordSeparatorCode);class Xt{writeHandshakeRequest(e){return Vt.write(JSON.stringify(e))}parseHandshakeResponse(e){let t,n;if(Ct(e)){const r=new Uint8Array(e),o=r.indexOf(Vt.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(Vt.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=Vt.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"}(Ft||(Ft={}));class Gt{constructor(){this.observers=[]}next(e){for(const t of this.observers)t.next(e)}error(e){for(const t of this.observers)t.error&&t.error(e)}complete(){for(const e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new kt(this,e)}}!function(e){e.Disconnected="Disconnected",e.Connecting="Connecting",e.Connected="Connected",e.Disconnecting="Disconnecting",e.Reconnecting="Reconnecting"}($t||($t={}));class Yt{static create(e,t,n,r,o,i){return new Yt(e,t,n,r,o,i)}constructor(e,t,n,r,o,i){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(wt.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},_t.isRequired(e,"connection"),_t.isRequired(t,"logger"),_t.isRequired(n,"protocol"),this.serverTimeoutInMilliseconds=null!=o?o:3e4,this.keepAliveIntervalInMilliseconds=null!=i?i:15e3,this._logger=t,this._protocol=n,this.connection=e,this._reconnectPolicy=r,this._handshakeProtocol=new Xt,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=$t.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:Ft.Ping})}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(e){if(this._connectionState!==$t.Disconnected&&this._connectionState!==$t.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!==$t.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=$t.Connecting,this._logger.log(wt.Debug,"Starting HubConnection.");try{await this._startInternal(),Et.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=$t.Connected,this._connectionStarted=!0,this._logger.log(wt.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=$t.Disconnected,this._logger.log(wt.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(wt.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(t)),this._logger.log(wt.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await e,this._stopDuringStartError)throw this._stopDuringStartError;this.connection.features.inherentKeepAlive||await this._sendMessage(this._cachedPingMessage)}catch(e){throw this._logger.log(wt.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===$t.Disconnected?(this._logger.log(wt.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve()):this._connectionState===$t.Disconnecting?(this._logger.log(wt.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState=$t.Disconnecting,this._logger.log(wt.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(wt.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 ut("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 Gt;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===Ft.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===Ft.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 Ft.Invocation:this._invokeClientMethod(e);break;case Ft.StreamItem:case Ft.Completion:{const t=this._callbacks[e.invocationId];if(t){e.type===Ft.Completion&&delete this._callbacks[e.invocationId];try{t(e)}catch(e){this._logger.log(wt.Error,`Stream callback threw error: ${Rt(e)}`)}}break}case Ft.Ping:break;case Ft.Close:{this._logger.log(wt.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(wt.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(wt.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(wt.Error,e);const n=new Error(e);throw this._handshakeRejecter(n),n}return this._logger.log(wt.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===$t.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(wt.Warning,`No client method with the name '${t}' found.`),void(e.invocationId&&(this._logger.log(wt.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(wt.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(wt.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(wt.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(wt.Error,`Result given for '${t}' method but server is not expecting a result.`)}_connectionClosed(e){this._logger.log(wt.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new ut("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===$t.Disconnecting?this._completeClose(e):this._connectionState===$t.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===$t.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=$t.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(wt.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(wt.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this._completeClose(e);if(this._connectionState=$t.Reconnecting,e?this._logger.log(wt.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(wt.Information,"Connection reconnecting."),0!==this._reconnectingCallbacks.length){try{this._reconnectingCallbacks.forEach((t=>t.apply(this,[e])))}catch(t){this._logger.log(wt.Error,`An onreconnecting callback called with error '${e}' threw error '${t}'.`)}if(this._connectionState!==$t.Reconnecting)return void this._logger.log(wt.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;null!==o;){if(this._logger.log(wt.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!==$t.Reconnecting)return void this._logger.log(wt.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this._startInternal(),this._connectionState=$t.Connected,this._logger.log(wt.Information,"HubConnection reconnected successfully."),0!==this._reconnectedCallbacks.length)try{this._reconnectedCallbacks.forEach((e=>e.apply(this,[this.connection.connectionId])))}catch(e){this._logger.log(wt.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${e}'.`)}return}catch(e){if(this._logger.log(wt.Information,`Reconnect attempt failed because of error '${e}'.`),this._connectionState!==$t.Reconnecting)return this._logger.log(wt.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this._connectionState===$t.Disconnecting&&this._completeClose());r=e instanceof Error?e:new Error(e.toString()),o=this._getNextRetryDelay(n++,Date.now()-t,r)}}this._logger.log(wt.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(wt.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(wt.Error,`Stream 'error' callback called with '${e}' threw error: ${Rt(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:Ft.Invocation}:{arguments:t,target:e,type:Ft.Invocation};{const n=this._invocationId;return this._invocationId++,0!==r.length?{arguments:t,invocationId:n.toString(),streamIds:r,target:e,type:Ft.Invocation}:{arguments:t,invocationId:n.toString(),target:e,type:Ft.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 fn,gn=cn?new TextDecoder:null,mn=cn?"undefined"!=typeof process&&"force"!==(null===(rn=null===process||void 0===process?void 0:process.env)||void 0===rn?void 0:rn.TEXT_DECODER)?200:0:on,yn=function(e,t){this.type=e,this.data=t},wn=(fn=function(e,t){return fn=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])},fn(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}fn(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),vn=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 wn(t,e),t}(Error),bn={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),sn(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:an(t,4),nsec:t.getUint32(0)};default:throw new vn("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(e.length))}}(e);return new Date(1e3*t.sec+t.nsec/1e6)}},_n=function(){function e(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(bn)}return e.prototype.register=function(e){var t=e.type,n=e.encode,r=e.decode;if(t>=0)this.encoders[t]=n,this.decoders[t]=r;else{var o=1+t;this.builtInEncoders[o]=n,this.builtInDecoders[o]=r}},e.prototype.tryToEncode=function(e,t){for(var n=0;nthis.maxDepth)throw new Error("Too deep objects in depth ".concat(t));null==e?this.encodeNil():"boolean"==typeof e?this.encodeBoolean(e):"number"==typeof e?this.encodeNumber(e):"string"==typeof e?this.encodeString(e):this.encodeObject(e,t)},e.prototype.ensureBufferSizeToWrite=function(e){var t=this.pos+e;this.view.byteLength=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):(this.writeU8(211),this.writeI64(e)):this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))},e.prototype.writeStringHeader=function(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else{if(!(e<4294967296))throw new Error("Too long string: ".concat(e," bytes in UTF-8"));this.writeU8(219),this.writeU32(e)}},e.prototype.encodeString=function(e){if(e.length>dn){var t=ln(e);this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),un(e,this.bytes,this.pos),this.pos+=t}else t=ln(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: ".concat(Object.prototype.toString.apply(e)));this.encodeMap(e,t)}},e.prototype.encodeBinary=function(e){var t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too large binary: ".concat(t));this.writeU8(198),this.writeU32(t)}var n=En(e);this.writeU8a(n)},e.prototype.encodeArray=function(e,t){var n=e.length;if(n<16)this.writeU8(144+n);else if(n<65536)this.writeU8(220),this.writeU16(n);else{if(!(n<4294967296))throw new Error("Too large array: ".concat(n));this.writeU8(221),this.writeU32(n)}for(var r=0,o=e;r0&&e<=this.maxKeyLength},e.prototype.find=function(e,t,n){e:for(var r=0,o=this.caches[n-1];r=this.maxLengthPerKey?n[Math.random()*n.length|0]=r:n.push(r)},e.prototype.decode=function(e,t,n){var r=this.find(e,t,n);if(null!=r)return this.hit++,r;this.miss++;var o=pn(e,t,n),i=Uint8Array.prototype.slice.call(e,t,t+n);return this.store(i,o),o},e}(),Nn=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]=e},e.prototype.createExtraByteError=function(e){var t=this.view,n=this.pos;return new RangeError("Extra ".concat(t.byteLength-n," of ").concat(t.byteLength," byte(s) found at buffer[").concat(e,"]"))},e.prototype.decode=function(e){this.reinitializeState(),this.setBuffer(e);var t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t},e.prototype.decodeMulti=function(e){return Nn(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,d,u;return Nn(this,(function(p){switch(p.label){case 0:i=!1,p.label=1;case 1:p.trys.push([1,6,7,12]),t=An(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 Mn))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,d=l.pos,u=l.totalPos,new RangeError("Insufficient data in parsing ".concat(Cn(h)," at ").concat(u," (").concat(d," 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 function(n,r,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,s=function(){var n,r,o,i,s,a,c,l,h;return Nn(this,(function(d){switch(d.label){case 0:n=t,r=-1,d.label=1;case 1:d.trys.push([1,13,14,19]),o=An(e),d.label=2;case 2:return[4,Rn(o.next())];case 3:if((i=d.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()),d.label=4;case 4:d.trys.push([4,9,,10]),d.label=5;case 5:return[4,Rn(this.doDecodeSync())];case 6:return[4,d.sent()];case 7:return d.sent(),0==--r?[3,8]:[3,5];case 8:return[3,10];case 9:if(!((a=d.sent())instanceof Mn))throw a;return[3,10];case 10:this.totalPos+=this.pos,d.label=11;case 11:return[3,2];case 12:return[3,19];case 13:return c=d.sent(),l={error:c},[3,19];case 14:return d.trys.push([14,,17,18]),i&&!i.done&&(h=o.return)?[4,Rn(h.call(o))]:[3,16];case 15:d.sent(),d.label=16;case 16:return[3,18];case 17:if(l)throw l.error;return[7];case 18:return[7];case 19:return[2]}}))}.apply(n,r||[]),a=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(e){s[e]&&(i[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||l(e,t)}))})}function l(e,t){try{(n=s[e](t)).value instanceof Rn?Promise.resolve(n.value.v).then(h,d):u(a[0][2],n)}catch(e){u(a[0][3],e)}var n}function h(e){l("next",e)}function d(e){l("throw",e)}function u(e,t){e(t),a.shift(),a.length&&l(a[0][0],a[0][1])}}(this,arguments)},e.prototype.doDecodeSync=function(){e:for(;;){var e=this.readHeadByte(),t=void 0;if(e>=224)t=e-256;else if(e<192)if(e<128)t=e;else if(e<144){if(0!=(r=e-128)){this.pushMapState(r),this.complete();continue e}t={}}else if(e<160){if(0!=(r=e-144)){this.pushArrayState(r),this.complete();continue e}t=[]}else{var n=e-160;t=this.decodeUtf8String(n,0)}else if(192===e)t=null;else if(194===e)t=!1;else if(195===e)t=!0;else if(202===e)t=this.readF32();else if(203===e)t=this.readF64();else if(204===e)t=this.readU8();else if(205===e)t=this.readU16();else if(206===e)t=this.readU32();else if(207===e)t=this.readU64();else if(208===e)t=this.readI8();else if(209===e)t=this.readI16();else if(210===e)t=this.readI32();else if(211===e)t=this.readI64();else if(217===e)n=this.lookU8(),t=this.decodeUtf8String(n,1);else if(218===e)n=this.lookU16(),t=this.decodeUtf8String(n,2);else if(219===e)n=this.lookU32(),t=this.decodeUtf8String(n,4);else if(220===e){if(0!==(r=this.readU16())){this.pushArrayState(r),this.complete();continue e}t=[]}else if(221===e){if(0!==(r=this.readU32())){this.pushArrayState(r),this.complete();continue e}t=[]}else if(222===e){if(0!==(r=this.readU16())){this.pushMapState(r),this.complete();continue e}t={}}else if(223===e){if(0!==(r=this.readU32())){this.pushMapState(r),this.complete();continue e}t={}}else if(196===e){var r=this.lookU8();t=this.decodeBinary(r,1)}else if(197===e)r=this.lookU16(),t=this.decodeBinary(r,2);else if(198===e)r=this.lookU32(),t=this.decodeBinary(r,4);else if(212===e)t=this.decodeExtension(1,0);else if(213===e)t=this.decodeExtension(2,0);else if(214===e)t=this.decodeExtension(4,0);else if(215===e)t=this.decodeExtension(8,0);else if(216===e)t=this.decodeExtension(16,0);else if(199===e)r=this.lookU8(),t=this.decodeExtension(r,1);else if(200===e)r=this.lookU16(),t=this.decodeExtension(r,2);else{if(201!==e)throw new vn("Unrecognized type byte: ".concat(Cn(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 vn("The type of key must be string or number but "+typeof t);if("__proto__"===t)throw new vn("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 vn("Unrecognized array type byte: ".concat(Cn(e)))}},e.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw new vn("Max length exceeded: map length (".concat(e,") > maxMapLengthLength (").concat(this.maxMapLength,")"));this.stack.push({type:1,size:e,key:null,readCount:0,map:{}})},e.prototype.pushArrayState=function(e){if(e>this.maxArrayLength)throw new vn("Max length exceeded: array length (".concat(e,") > maxArrayLength (").concat(this.maxArrayLength,")"));this.stack.push({type:0,size:e,array:new Array(e),position:0})},e.prototype.decodeUtf8String=function(e,t){var n;if(e>this.maxStrLength)throw new vn("Max length exceeded: UTF-8 byte length (".concat(e,") > maxStrLength (").concat(this.maxStrLength,")"));if(this.bytes.byteLengthmn?function(e,t,n){var r=e.subarray(t,t+n);return gn.decode(r)}(this.bytes,o,e):pn(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 vn("Max length exceeded: bin length (".concat(e,") > maxBinLength (").concat(this.maxBinLength,")"));if(!this.hasRemaining(e+t))throw Ln;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 vn("Max length exceeded: ext length (".concat(e,") > maxExtLength (").concat(this.maxExtLength,")"));var n=this.view.getInt8(this.pos+t),r=this.decodeBinary(e,t+1);return this.extensionCodec.decode(r,n,this.context)},e.prototype.lookU8=function(){return this.view.getUint8(this.pos)},e.prototype.lookU16=function(){return this.view.getUint16(this.pos)},e.prototype.lookU32=function(){return this.view.getUint32(this.pos)},e.prototype.readU8=function(){var e=this.view.getUint8(this.pos);return this.pos++,e},e.prototype.readI8=function(){var e=this.view.getInt8(this.pos);return this.pos++,e},e.prototype.readU16=function(){var e=this.view.getUint16(this.pos);return this.pos+=2,e},e.prototype.readI16=function(){var e=this.view.getInt16(this.pos);return this.pos+=2,e},e.prototype.readU32=function(){var e=this.view.getUint32(this.pos);return this.pos+=4,e},e.prototype.readI32=function(){var e=this.view.getInt32(this.pos);return this.pos+=4,e},e.prototype.readU64=function(){var e,t,n=(e=this.view,t=this.pos,4294967296*e.getUint32(t)+e.getUint32(t+4));return this.pos+=8,n},e.prototype.readI64=function(){var e=an(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}();!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"}(In||(In={})),function(e){e[e.None=0]="None",e[e.WebSockets=1]="WebSockets",e[e.ServerSentEvents=2]="ServerSentEvents",e[e.LongPolling=4]="LongPolling"}(kn||(kn={})),function(e){e[e.Text=1]="Text",e[e.Binary=2]="Binary"}(Tn||(Tn={}));class Fn{constructor(){}log(e,t){}}Fn.instance=new Fn,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"}(xn||(xn={}));class $n{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 Hn=new Uint8Array([145,In.Ping]);class jn{constructor(e){this.name="messagepack",this.version=1,this.transferFormat=Tn.Binary,this._errorResult=1,this._voidResult=2,this._nonVoidResult=3,e=e||{},this._encoder=new Sn(e.extensionCodec,e.context,e.maxDepth,e.initialBufferSize,e.sortKeys,e.forceFloat32,e.ignoreUndefined,e.forceIntegerToFloat),this._decoder=new On(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=Fn.instance);const r=$n.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 In.Invocation:return this._writeInvocation(e);case In.StreamInvocation:return this._writeStreamInvocation(e);case In.StreamItem:return this._writeStreamItem(e);case In.Completion:return this._writeCompletion(e);case In.Ping:return $n.write(Hn);case In.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 In.Invocation:return this._createInvocationMessage(this._readHeaders(n),n);case In.StreamItem:return this._createStreamItemMessage(this._readHeaders(n),n);case In.Completion:return this._createCompletionMessage(this._readHeaders(n),n);case In.Ping:return this._createPingMessage(n);case In.Close:return this._createCloseMessage(n);default:return t.log(xn.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:In.Close}}_createPingMessage(e){if(e.length<1)throw new Error("Invalid payload for Ping message.");return{type:In.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:In.Invocation}:{arguments:t[4],headers:e,streamIds:[],target:t[3],type:In.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:In.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:In.Completion}}_writeInvocation(e){let t;return t=e.streamIds?this._encoder.encode([In.Invocation,e.headers||{},e.invocationId||null,e.target,e.arguments,e.streamIds]):this._encoder.encode([In.Invocation,e.headers||{},e.invocationId||null,e.target,e.arguments]),$n.write(t.slice())}_writeStreamInvocation(e){let t;return t=e.streamIds?this._encoder.encode([In.StreamInvocation,e.headers||{},e.invocationId,e.target,e.arguments,e.streamIds]):this._encoder.encode([In.StreamInvocation,e.headers||{},e.invocationId,e.target,e.arguments]),$n.write(t.slice())}_writeStreamItem(e){const t=this._encoder.encode([In.StreamItem,e.headers||{},e.invocationId,e.item]);return $n.write(t.slice())}_writeCompletion(e){const t=e.error?this._errorResult:void 0!==e.result?this._nonVoidResult:this._voidResult;let n;switch(t){case this._errorResult:n=this._encoder.encode([In.Completion,e.headers||{},e.invocationId,t,e.error]);break;case this._voidResult:n=this._encoder.encode([In.Completion,e.headers||{},e.invocationId,t]);break;case this._nonVoidResult:n=this._encoder.encode([In.Completion,e.headers||{},e.invocationId,t,e.result])}return $n.write(n.slice())}_writeCancelInvocation(e){const t=this._encoder.encode([In.CancelInvocation,e.headers||{},e.invocationId]);return $n.write(t.slice())}_readHeaders(e){const t=e[1];if("object"!=typeof t)throw new Error("Invalid headers.");return t}}let Wn=!1;function zn(){const e=document.querySelector("#blazor-error-ui");e&&(e.style.display="block"),Wn||(Wn=!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 Jn="function"==typeof TextDecoder?new TextDecoder("utf-8"):null,qn=Jn?Jn.decode.bind(Jn):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("")},Kn=Math.pow(2,32),Vn=Math.pow(2,21)-1;function Xn(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}function Gn(e,t){return e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24>>>0)}function Yn(e,t){const n=Gn(e,t+4);if(n>Vn)throw new Error(`Cannot read uint64 with high order part ${n}, because the result would exceed Number.MAX_SAFE_INTEGER.`);return n*Kn+Gn(e,t)}class Qn{constructor(e){this.batchData=e;const t=new nr(e);this.arrayRangeReader=new rr(e),this.arrayBuilderSegmentReader=new or(e),this.diffReader=new Zn(e),this.editReader=new er(e,t),this.frameReader=new tr(e,t)}updatedComponents(){return Xn(this.batchData,this.batchData.length-20)}referenceFrames(){return Xn(this.batchData,this.batchData.length-16)}disposedComponentIds(){return Xn(this.batchData,this.batchData.length-12)}disposedEventHandlerIds(){return Xn(this.batchData,this.batchData.length-8)}updatedComponentsEntry(e,t){const n=e+4*t;return Xn(this.batchData,n)}referenceFramesEntry(e,t){return e+20*t}disposedComponentIdsEntry(e,t){const n=e+4*t;return Xn(this.batchData,n)}disposedEventHandlerIdsEntry(e,t){const n=e+8*t;return Yn(this.batchData,n)}}class Zn{constructor(e){this.batchDataUint8=e}componentId(e){return Xn(this.batchDataUint8,e)}edits(e){return e+4}editsEntry(e,t){return e+16*t}}class er{constructor(e,t){this.batchDataUint8=e,this.stringReader=t}editType(e){return Xn(this.batchDataUint8,e)}siblingIndex(e){return Xn(this.batchDataUint8,e+4)}newTreeIndex(e){return Xn(this.batchDataUint8,e+8)}moveToSiblingIndex(e){return Xn(this.batchDataUint8,e+8)}removedAttributeName(e){const t=Xn(this.batchDataUint8,e+12);return this.stringReader.readString(t)}}class tr{constructor(e,t){this.batchDataUint8=e,this.stringReader=t}frameType(e){return Xn(this.batchDataUint8,e)}subtreeLength(e){return Xn(this.batchDataUint8,e+4)}elementReferenceCaptureId(e){const t=Xn(this.batchDataUint8,e+4);return this.stringReader.readString(t)}componentId(e){return Xn(this.batchDataUint8,e+8)}elementName(e){const t=Xn(this.batchDataUint8,e+8);return this.stringReader.readString(t)}textContent(e){const t=Xn(this.batchDataUint8,e+4);return this.stringReader.readString(t)}markupContent(e){const t=Xn(this.batchDataUint8,e+4);return this.stringReader.readString(t)}attributeName(e){const t=Xn(this.batchDataUint8,e+4);return this.stringReader.readString(t)}attributeValue(e){const t=Xn(this.batchDataUint8,e+8);return this.stringReader.readString(t)}attributeEventHandlerId(e){return Yn(this.batchDataUint8,e+12)}}class nr{constructor(e){this.batchDataUint8=e,this.stringTableStartIndex=Xn(e,e.length-4)}readString(e){if(-1===e)return null;{const n=Xn(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(ir.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(ir.Debug,`Waiting for batch ${this.nextBatchId}. Batch ${e} not processed.`);try{this.nextBatchId++,this.logger.log(ir.Debug,`Applying batch ${e}.`),ve(this.browserRendererId,new Qn(t)),await this.completeBatch(n,e)}catch(t){throw this.fatalError=t.toString(),this.logger.log(ir.Error,`There was an error applying batch ${e}.`),n.send("OnRenderCompleted",e,t.toString()),t}}getLastBatchid(){return this.nextBatchId-1}async completeBatch(e,t){try{await e.send("OnRenderCompleted",t,null)}catch{this.logger.log(ir.Warning,`Failed to deliver completion notification for render '${t}'.`)}}}class ar{log(e,t){}}ar.instance=new ar;class cr{constructor(e){this.minLevel=e}log(e,t){if(e>=this.minLevel){const n=`[${(new Date).toISOString()}] ${ir[e]}: ${t}`;switch(e){case ir.Critical:case ir.Error:console.error(n);break;case ir.Warning:console.warn(n);break;case ir.Information:console.info(n);break;default:console.log(n)}}}}class lr{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!==$t.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!==$t.Connected)return!1;const t=await e.invoke("StartCircuit",Me.getBaseURI(),Me.getLocationHref(),JSON.stringify(this.components.map((e=>e.toRecord()))),this.applicationState||"");return!!t&&(this.initialize(t),!0)}resolveElement(e){const t=v(e);if(t)return $(t,!0);const n=Number.parseInt(e);if(!Number.isNaN(n))return F(this.components[n].start,this.components[n].end);throw new Error(`Invalid sequence number or identifier '${e}'.`)}}const hr={configureSignalR:e=>{},logLevel:ir.Warning,reconnectionOptions:{maxRetries:8,retryIntervalMilliseconds:2e4,dialogId:"components-reconnect-modal"}};class dr{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 rt.reconnect()||this.rejected()}catch(e){this.logger.log(ir.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 ur{constructor(e,t,n){this.dialog=e,this.maxRetries=t,this.document=n,this.document=n;const r=this.document.getElementById(ur.MaxRetriesId);r&&(r.innerText=this.maxRetries.toString())}show(){this.removeClasses(),this.dialog.classList.add(ur.ShowClassName)}update(e){const t=this.document.getElementById(ur.CurrentAttemptId);t&&(t.innerText=e.toString())}hide(){this.removeClasses(),this.dialog.classList.add(ur.HideClassName)}failed(){this.removeClasses(),this.dialog.classList.add(ur.FailedClassName)}rejected(){this.removeClasses(),this.dialog.classList.add(ur.RejectedClassName)}removeClasses(){this.dialog.classList.remove(ur.ShowClassName,ur.HideClassName,ur.FailedClassName,ur.RejectedClassName)}}ur.ShowClassName="components-reconnect-show",ur.HideClassName="components-reconnect-hide",ur.FailedClassName="components-reconnect-failed",ur.RejectedClassName="components-reconnect-rejected",ur.MaxRetriesId="components-reconnect-max-retries",ur.CurrentAttemptId="components-reconnect-current-attempt";class pr{constructor(e,t,n){this._currentReconnectionProcess=null,this._logger=e,this._reconnectionDisplay=t,this._reconnectCallback=n||rt.reconnect}onConnectionDown(e,t){if(!this._reconnectionDisplay){const t=document.getElementById(e.dialogId);this._reconnectionDisplay=t?new ur(t,e.maxRetries,document):new dr(e.dialogId,e.maxRetries,document,this._logger)}this._currentReconnectionProcess||(this._currentReconnectionProcess=new fr(e,this._logger,this._reconnectCallback,this._reconnectionDisplay))}onConnectionUp(){this._currentReconnectionProcess&&(this._currentReconnectionProcess.dispose(),this._currentReconnectionProcess=null)}}class fr{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;tfr.MaximumFirstRetryInterval?fr.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(ir.Error,e)}}this.reconnectDisplay.failed()}delay(e){return new Promise((t=>setTimeout(t,e)))}}function gr(e,t){switch(t){case"webassembly":return function(e){const t=wr(e,"webassembly"),n=[];for(let e=0;ee.id-t.id))}(e);case"server":return function(e){const t=wr(e,"server"),n=[];for(let e=0;ee.sequence-t.sequence))}(e)}}fr.MaximumFirstRetryInterval=3e3;const mr=/^\s*Blazor-Component-State:(?[a-zA-Z0-9+/=]+)$/;function yr(e){var t;if(e.nodeType===Node.COMMENT_NODE){const n=e.textContent||"",r=mr.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 br(e,t){const n=e.currentElement;if(n&&n.nodeType===Node.COMMENT_NODE&&n.textContent){const r=vr.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,l=c?_r(c,n):void 0;if(c&&!l)throw new Error(`Could not find an end component comment for '${t}'.`);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.");return{type:r,assembly:o,typeName:i,parameterDefinitions:s&&atob(s),parameterValues:a&&atob(a),start:t,prerenderId:c,end:l}}}(r,n,e);case"server":return function(e,t,n){const{type:r,descriptor:o,sequence:i,prerenderId:s}=e,a=s?_r(s,n):void 0;if(s&&!a)throw new Error(`Could not find an end component comment for '${t}'.`);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)}'`);return{type:r,sequence:i,descriptor:o,start:t,prerenderId:s,end:a}}}(r,n,e)}}catch(e){throw new Error(`Found malformed component comment at ${n.textContent}`)}}}function _r(e,t){for(;t.next()&&t.currentElement;){const n=t.currentElement;if(n.nodeType!==Node.COMMENT_NODE)continue;if(!n.textContent)continue;const r=vr.exec(n.textContent),o=r&&r[1];if(o)return Er(o,e),n}}function Er(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 Sr{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 I,await Promise.all(this.afterStartedCallbacks.map((t=>t(e))))}}let Tr,xr,Dr,Nr,Ar=!1;async function Rr(e,t,n){var r,o;const i=new jn;i.name="blazorpack";const s=(new en).withUrl("_blazor").withHubProtocol(i);e.configureSignalR(s);const a=s.build();a.on("JS.AttachComponent",((e,t)=>we(0,n.resolveElement(t),e,!1))),a.on("JS.BeginInvokeJS",Dr.beginInvokeJSFromDotNet.bind(Dr)),a.on("JS.EndInvokeDotNet",Dr.endInvokeDotNetFromJS.bind(Dr)),a.on("JS.ReceiveByteArray",Dr.receiveByteArray.bind(Dr)),a.on("JS.BeginTransmitStream",(e=>{const t=new ReadableStream({start(t){a.stream("SendDotNetStreamToJS",e).subscribe({next:e=>t.enqueue(e),complete:()=>t.close(),error:e=>t.error(e)})}});Dr.supplyDotNetStream(e,t)}));const c=sr.getOrCreate(t);a.on("JS.RenderBatch",((e,n)=>{t.log(ir.Debug,`Received render batch with id ${e} and ${n.byteLength} bytes.`),c.processBatch(e,n,a)})),a.on("JS.EndLocationChanging",rt._internal.navigationManager.endLocationChanging),a.onclose((t=>!Ar&&e.reconnectionHandler.onConnectionDown(e.reconnectionOptions,t))),a.on("JS.Error",(e=>{Ar=!0,Pr(a,e,t),zn()}));try{await a.start(),Tr=a}catch(e){if(Pr(a,e,t),"FailedToNegotiateWithServerError"===e.errorType)throw e;zn(),e.innerErrors&&(e.innerErrors.some((e=>"UnsupportedTransportError"===e.errorType&&e.transport===Bt.WebSockets))?t.log(ir.Error,"Unable to connect, please ensure you are using an updated browser that supports WebSockets."):e.innerErrors.some((e=>"FailedToStartTransportError"===e.errorType&&e.transport===Bt.WebSockets))?t.log(ir.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===Bt.LongPolling))&&t.log(ir.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===(o=null===(r=a.connection)||void 0===r?void 0:r.features)||void 0===o?void 0:o.inherentKeepAlive)&&t.log(ir.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."),a}function Pr(e,t,n){n.log(ir.Error,t),e&&e.stop()}function Ur(e){return Nr=e,Nr}var Mr,Lr;const Br=navigator,Or=Br.userAgentData&&Br.userAgentData.brands,Fr=Or?Or.some((e=>"Google Chrome"===e.brand||"Microsoft Edge"===e.brand||"Chromium"===e.brand)):window.chrome,$r=null!==(Lr=null===(Mr=Br.userAgentData)||void 0===Mr?void 0:Mr.platform)&&void 0!==Lr?Lr:navigator.platform;let Hr,jr,Wr,zr,Jr,qr,Kr=!1,Vr=!1;function Xr(){return(Kr||Vr)&&(Fr||navigator.userAgent.includes("Firefox"))}const Gr=Math.pow(2,32),Yr=Math.pow(2,21)-1;let Qr=null,Zr="Production";function eo(e){return jr.getI32(e)}const to={start:function(t){return async function(t){const n={},{dotnet:r}=await async function(e){if("undefined"==typeof WebAssembly||!WebAssembly.validate)throw new Error("This browser does not support WebAssembly.");const t=await async function(e,t){const n=void 0!==e?e("manifest","blazor.boot.json","_framework/blazor.boot.json",""):i("_framework/blazor.boot.json");let r;r=n?"string"==typeof n?await i(n):await n:await i("_framework/blazor.boot.json"),Zr=t||r.headers.get("Blazor-Environment")||"Production";const o=await r.json();return o.modifiableAssemblies=r.headers.get("DOTNET-MODIFIABLE-ASSEMBLIES"),o.aspnetCoreBrowserTools=r.headers.get("ASPNETCORE-BROWSER-TOOLS"),o;function i(e){return fetch(e,{method:"GET",credentials:"include",cache:"no-cache"})}}(e.loadBootResource,e.environment),n=Object.keys(t.resources.runtime).filter((e=>e.startsWith("dotnet.")&&e.endsWith(".js")))[0],r=t.resources.runtime[n];let o=`_framework/${n}`;if(e.loadBootResource){const t="dotnetjs",i=e.loadBootResource(t,n,o,r);if("string"==typeof i)o=i;else if(i)throw new Error(`For a ${t} resource, custom loaders must supply a URI string.`)}if(t.cacheBootResources){const e=document.createElement("link");e.rel="modulepreload",e.href=o,e.crossOrigin="anonymous",e.integrity=r,document.head.appendChild(e)}const i=new URL(o,document.baseURI).toString();return await import(i)}(t),o=function(e,t){const n={maxParallelDownloads:1e6,enableDownloadRetry:!1,applicationEnvironment:Zr},r={...window.Module||{},onConfigLoaded:async n=>{n.environmentVariables||(n.environmentVariables={}),0===n.icuDataMode&&(n.environmentVariables.__BLAZOR_SHARDED_ICU="1"),n.aspnetCoreBrowserTools&&(n.environmentVariables.__ASPNETCORE_BROWSER_TOOLS=n.aspnetCoreBrowserTools),rt._internal.getApplicationEnvironment=()=>n.applicationEnvironment,t.jsInitializer=await async function(e,t){const n=e.resources.libraryInitializers,r=new kr;return n&&await r.importInitializersAsync(Object.keys(n),[t,e.resources.extensions]),r}(n,e)},onDownloadResourceProgress:no,config:n,disableDotnet6Compatibility:!1,print:oo,printErr:io};return r}(t,n);r.withStartupOptions(t).withModuleConfig(o),qr=await r.create();const{MONO:i,BINDING:s,Module:a,setModuleImports:c,INTERNAL:l}=qr;Wr=a,Hr=s,jr=i,Jr=l;const h=Jr.resourceLoader;n.resourceLoader=h,function(e){Kr=!!e.bootConfig.resources.pdb,Vr=e.bootConfig.debugBuild;const t=$r.match(/^Mac/i)?"Cmd":"Alt";Xr()&&console.info(`Debugging hotkey: Shift+${t}+D (when application has focus)`),document.addEventListener("keydown",(e=>{e.shiftKey&&(e.metaKey||e.altKey)&&"KeyD"===e.code&&(Vr||Kr?navigator.userAgent.includes("Firefox")?async function(){const e=await fetch(`_framework/debug?url=${encodeURIComponent(location.href)}&isFirefox=true`);200!==e.status&&console.warn(await e.text())}():Fr?function(){const e=document.createElement("a");e.href=`_framework/debug?url=${encodeURIComponent(location.href)}`,e.target="_blank",e.rel="noopener noreferrer",e.click()}():console.error("Currently, only Microsoft Edge (80+), Google Chrome, or Chromium, are supported for debugging."):console.error("Cannot start debugging, because the application was not compiled with debugging enabled."))}))}(h),rt._internal.dotNetCriticalError=io,rt._internal.loadLazyAssembly=e=>async function(e,t){const n=e.bootConfig.resources,r=n.lazyAssembly;if(!r)throw new Error("No assemblies have been marked as lazy-loadable. Use the 'BlazorWebAssemblyLazyLoad' item group in your project file to enable lazy loading an assembly.");if(!r.hasOwnProperty(t))throw new Error(`${t} must be marked with 'BlazorWebAssemblyLazyLoad' item group in your project file to allow lazy-loading.`);const o=t,i=function(e,t){const n=e.lastIndexOf(".");if(n<0)throw new Error(`No extension to replace in '${e}'`);return e.substr(0,n)+".pdb"}(t),s=Xr()&&n.pdb&&r.hasOwnProperty(i),a=e.loadResource(o,`_framework/${o}`,r[o],"assembly").response.then((e=>e.arrayBuffer()));if(s){const t=await e.loadResource(i,`_framework/${i}`,r[i],"pdb").response.then((e=>e.arrayBuffer())),[n,o]=await Promise.all([a,t]);return{dll:new Uint8Array(n),pdb:new Uint8Array(o)}}{const e=await a;return{dll:new Uint8Array(e),pdb:null}}}(Jr.resourceLoader,e),rt._internal.loadSatelliteAssemblies=(e,t)=>async function(e,t,n){const r=e.bootConfig.resources.satelliteResources;r&&await Promise.all(t.filter((e=>r.hasOwnProperty(e))).map((t=>e.loadResources(r[t],(e=>`_framework/${e}`),"assembly"))).reduce(((e,t)=>e.concat(t)),new Array).map((async e=>{const t=await e.response,r=await t.arrayBuffer(),o={dll:new Uint8Array(r)};n(o)})))}(h,e,t),c("blazor-internal",{Blazor:{_internal:rt._internal}});const d=await qr.getAssemblyExports("Microsoft.AspNetCore.Components.WebAssembly");return Object.assign(rt._internal,{dotNetExports:{...d.Microsoft.AspNetCore.Components.WebAssembly.Services.DefaultWebAssemblyJSRuntime}}),zr=e.attachDispatcher({beginInvokeDotNetFromJS:(e,t,n,r,o)=>{if(ao(),!r&&!t)throw new Error("Either assemblyName or dotNetObjectId must have a non null value.");const i=r?r.toString():t;rt._internal.dotNetExports.BeginInvokeDotNet(e?e.toString():null,i,n,o)},endInvokeJSFromDotNet:(e,t,n)=>{rt._internal.dotNetExports.EndInvokeJS(n)},sendByteArray:(e,t)=>{rt._internal.dotNetExports.ReceiveByteArrayFromJS(e,t)},invokeDotNetFromJS:(e,t,n,r)=>(ao(),rt._internal.dotNetExports.InvokeDotNet(e||null,t,null!=n?n:0,r))}),n}(t)},callEntryPoint:async function(e){try{await qr.runMain(e,[])}catch(e){console.error(e),zn()}},toUint8Array:function(e){const t=so(e),n=eo(t),r=new Uint8Array(n);return r.set(Wr.HEAPU8.subarray(t+4,t+4+n)),r},getArrayLength:function(e){return eo(so(e))},getArrayEntryPtr:function(e,t,n){return so(e)+4+t*n},getObjectFieldsBaseAddress:function(e){return e+8},readInt16Field:function(e,t){return n=e+(t||0),jr.getI16(n);var n},readInt32Field:function(e,t){return eo(e+(t||0))},readUint64Field:function(e,t){return function(e){const t=e>>2,n=Wr.HEAPU32[t+1];if(n>Yr)throw new Error(`Cannot read uint64 with high order part ${n}, because the result would exceed Number.MAX_SAFE_INTEGER.`);return n*Gr+Wr.HEAPU32[t]}(e+(t||0))},readFloatField:function(e,t){return n=e+(t||0),jr.getF32(n);var n},readObjectField:function(e,t){return eo(e+(t||0))},readStringField:function(e,t,n){const r=eo(e+(t||0));if(0===r)return null;if(n){const e=Hr.unbox_mono_obj(r);return"boolean"==typeof e?e?"":null:e}return Hr.conv_string(r)},readStructField:function(e,t){return e+(t||0)},beginHeapLock:function(){return ao(),Qr=co.create(),Qr},invokeWhenHeapUnlocked:function(e){Qr?Qr.enqueuePostReleaseAction(e):e()}};function no(e,t){const n=e/t*100;document.documentElement.style.setProperty("--blazor-load-percentage",`${n}%`),document.documentElement.style.setProperty("--blazor-load-percentage-text",`"${Math.floor(n)}%"`)}const ro=["DEBUGGING ENABLED"],oo=e=>ro.indexOf(e)<0&&console.log(e),io=e=>{console.error(e||"(null)"),zn()};function so(e){return e+12}function ao(){if(Qr)throw new Error("Assertion failed - heap is currently locked")}class co{enqueuePostReleaseAction(e){this.postReleaseActions||(this.postReleaseActions=[]),this.postReleaseActions.push(e)}release(){var e;if(Qr!==this)throw new Error("Trying to release a lock which isn't current");for(Jr.mono_wasm_gc_unlock(),Qr=null;null===(e=this.postReleaseActions)||void 0===e?void 0:e.length;)this.postReleaseActions.shift()(),ao()}static create(){return Jr.mono_wasm_gc_lock(),new co}}class lo{constructor(e){this.batchAddress=e,this.arrayRangeReader=ho,this.arrayBuilderSegmentReader=uo,this.diffReader=po,this.editReader=fo,this.frameReader=go}updatedComponents(){return Nr.readStructField(this.batchAddress,0)}referenceFrames(){return Nr.readStructField(this.batchAddress,ho.structLength)}disposedComponentIds(){return Nr.readStructField(this.batchAddress,2*ho.structLength)}disposedEventHandlerIds(){return Nr.readStructField(this.batchAddress,3*ho.structLength)}updatedComponentsEntry(e,t){return mo(e,t,po.structLength)}referenceFramesEntry(e,t){return mo(e,t,go.structLength)}disposedComponentIdsEntry(e,t){const n=mo(e,t,4);return Nr.readInt32Field(n)}disposedEventHandlerIdsEntry(e,t){const n=mo(e,t,8);return Nr.readUint64Field(n)}}const ho={structLength:8,values:e=>Nr.readObjectField(e,0),count:e=>Nr.readInt32Field(e,4)},uo={structLength:12,values:e=>{const t=Nr.readObjectField(e,0),n=Nr.getObjectFieldsBaseAddress(t);return Nr.readObjectField(n,0)},offset:e=>Nr.readInt32Field(e,4),count:e=>Nr.readInt32Field(e,8)},po={structLength:4+uo.structLength,componentId:e=>Nr.readInt32Field(e,0),edits:e=>Nr.readStructField(e,4),editsEntry:(e,t)=>mo(e,t,fo.structLength)},fo={structLength:20,editType:e=>Nr.readInt32Field(e,0),siblingIndex:e=>Nr.readInt32Field(e,4),newTreeIndex:e=>Nr.readInt32Field(e,8),moveToSiblingIndex:e=>Nr.readInt32Field(e,8),removedAttributeName:e=>Nr.readStringField(e,16)},go={structLength:36,frameType:e=>Nr.readInt16Field(e,4),subtreeLength:e=>Nr.readInt32Field(e,8),elementReferenceCaptureId:e=>Nr.readStringField(e,16),componentId:e=>Nr.readInt32Field(e,12),elementName:e=>Nr.readStringField(e,16),textContent:e=>Nr.readStringField(e,16),markupContent:e=>Nr.readStringField(e,16),attributeName:e=>Nr.readStringField(e,16),attributeValue:e=>Nr.readStringField(e,24,!0),attributeEventHandlerId:e=>Nr.readUint64Field(e,8)};function mo(e,t,n){return Nr.getArrayEntryPtr(e,t,n)}class yo{constructor(e){this.preregisteredComponents=e;const t={};for(let n=0;n=n&&s>=r&&o(e.item(i),t.item(s))===Co.None;)i--,s--,a++;return a}(e,t,r,r,n),i=function(e){var t;const n=[];let r=e.length-1,o=(null===(t=e[r])||void 0===t?void 0:t.length)-1;for(;r>0||o>0;){const t=0===r?Io.Insert:0===o?Io.Delete:e[r][o];switch(n.unshift(t),t){case Io.Keep:case Io.Update:r--,o--;break;case Io.Insert:o--;break;case Io.Delete:r--}}return n}(function(e,t,n){const r=[],o=[],i=e.length,s=t.length;if(0===i&&0===s)return[];for(let e=0;e<=i;e++)(r[e]=Array(s+1))[0]=e,o[e]=Array(s+1);const a=r[0];for(let e=1;e<=s;e++)a[e]=e;for(let a=1;a<=i;a++)for(let i=1;i<=s;i++){const s=n(e.item(a-1),t.item(i-1)),c=r[a-1][i]+1,l=r[a][i-1]+1;let h;switch(s){case Co.None:h=r[a-1][i-1];break;case Co.Some:h=r[a-1][i-1]+1;break;case Co.Infinite:h=Number.MAX_VALUE}h{};function Uo(){document.body.removeEventListener("click",Mo),window.removeEventListener("popstate",Lo)}function Mo(e){ke()||Ee(e,(e=>{history.pushState(null,"",e),Bo(e)}))}function Lo(e){ke()||Bo(location.href)}async function Bo(e){null==Ro||Ro.abort(),Ro=new AbortController;const t=Ro.signal,n=fetch(e,{signal:t,headers:{"blazor-enhanced-nav":"on"}});if(await async function(e,t,n,r){let o;try{o=await e;const t=o.headers.get("blazor-enhanced-nav-redirect-location");if(t)return void location.replace(t);if(!o.body)return void n(o,"");const r=o.headers.get("ssr-framing");if(!r){const e=await o.text();return void n(o,e)}let i=!0;await o.body.pipeThrough(new TextDecoderStream).pipeThrough(function(e){let t="";return new TransformStream({transform(n,r){if(t+=n,t.indexOf(e,t.length-n.length-e.length)>=0){const n=t.split(e);n.slice(0,-1).forEach((e=>r.enqueue(e))),t=n[n.length-1]}},flush(e){t&&e.enqueue(t)}})}(`\x3c!--${r}--\x3e`)).pipeTo(new WritableStream({write(e){i?(i=!1,n(o,e)):(e=>{const t=document.createRange().createContextualFragment(e);for(;t.firstChild;)document.body.appendChild(t.firstChild)})(e)}}))}catch(e){if("AbortError"===e.name&&t.aborted)return;throw e}}(n,t,((t,n)=>{var r;if(t.redirected&&(history.replaceState(null,"",t.url),e=t.url),null===(r=t.headers.get("content-type"))||void 0===r?void 0:r.startsWith("text/html")){const e=(new DOMParser).parseFromString(n,"text/html");To(document,e)}else(t.status<200||t.status>=300)&&!n?document.documentElement.innerHTML=`Error: ${t.status} ${t.statusText}`:(history.replaceState(null,"",e+"?"),location.replace(e))})),!t.aborted){Po();const t=e.indexOf("#");if(t>=0){const n=e.substring(t+1),r=document.getElementById(n);null==r||r.scrollIntoView()}}}let Oo=!0;class Fo extends HTMLElement{connectedCallback(){var e;null===(e=this.parentNode)||void 0===e||e.removeChild(this);const t=this.attachShadow({mode:"open"}),n=document.createElement("slot");t.appendChild(n),n.addEventListener("slotchange",(e=>{this.childNodes.forEach((e=>{if(e instanceof HTMLTemplateElement){const t=e.getAttribute("blazor-component-id");if(t)!function(e,t){const n=function(e){const t=`bl:${e}`,n=document.createNodeIterator(document,NodeFilter.SHOW_COMMENT);let r=null;for(;(r=n.nextNode())&&r.textContent!==t;);if(!r)return null;const o=`/bl:${e}`;let i=null;for(;(i=n.nextNode())&&i.textContent!==o;);return i?{startMarker:r,endMarker:i}:null}(e);if(n)if(Oo)To({startExclusive:n.startMarker,endExclusive:n.endMarker},t);else{const{startMarker:e,endMarker:r}=n,o=new Range;for(o.setStart(e,e.textContent.length),o.setEnd(r,0),o.deleteContents();t.childNodes[0];)r.parentNode.insertBefore(t.childNodes[0],r)}}(t,e.content);else switch(e.getAttribute("type")){case"redirection":const t=e.content.textContent;Se(t)?(history.replaceState(null,"",t),Bo(t)):location.replace(t);break;case"error":document.documentElement.textContent=e.content.textContent;const n=document.documentElement.style;n.fontFamily="consolas, monospace",n.whiteSpace="pre-wrap",n.padding="1rem"}}}))}))}}let $o,Ho=!1;async function jo(e){var t;if(Ho)throw new Error("Blazor has already started.");Ho=!0,$o=e,function(e){(null==e?void 0:e.disableDomPreservation)&&(Oo=!1),customElements.define("blazor-ssr",Fo)}(null==e?void 0:e.ssr),(null===(t=null==e?void 0:e.ssr)||void 0===t?void 0:t.disableDomPreservation)||(Po=Wo,document.body.addEventListener("click",Mo),window.addEventListener("popstate",Lo)),await Wo()}async function Wo(){const t=gr(document,"server"),n=gr(document,"webassembly");t.length&&(Uo(),await async function(t,n){const r=function(e){const t={...hr,...e};return e&&e.reconnectionOptions&&(t.reconnectionOptions={...hr.reconnectionOptions,...e.reconnectionOptions}),t}(t),o=await async function(e){const t=await fetch("_blazor/initializers",{method:"GET",credentials:"include",cache:"no-cache"}),n=await t.json(),r=new kr;return await r.importInitializersAsync(n,[e]),r}(r),i=new cr(r.logLevel);rt.reconnect=async e=>{if(Ar)return!1;const t=e||await Rr(r,i,xr);return await xr.reconnect(t)?(r.reconnectionHandler.onConnectionUp(),!0):(i.log(ir.Information,"Reconnection attempt to the circuit was rejected by the server. This may indicate that the associated state is no longer available on the server."),!1)},rt.defaultReconnectionHandler=new pr(i),r.reconnectionHandler=r.reconnectionHandler||rt.defaultReconnectionHandler,i.log(ir.Information,"Starting up Blazor server-side application.");const s=yr(document);xr=new lr(n||[],s||""),rt._internal.navigationManager.listenForNavigationEvents(((e,t,n)=>Tr.send("OnLocationChanged",e,t,n)),((e,t,n,r)=>Tr.send("OnLocationChanging",e,t,n,r))),rt._internal.forceCloseConnection=()=>Tr.stop(),rt._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)}(Tr,e,t,n),Dr=e.attachDispatcher({beginInvokeDotNetFromJS:(e,t,n,r,o)=>{Tr.send("BeginInvokeDotNetFromJS",e?e.toString():null,t,n,r||0,o)},endInvokeJSFromDotNet:(e,t,n)=>{Tr.send("EndInvokeJSFromDotNet",e,t,n)},sendByteArray:(e,t)=>{Tr.send("ReceiveByteArray",e,t)}});const a=await Rr(r,i,xr);if(!await xr.startCircuit(a))return void i.log(ir.Error,"Failed to start the circuit.");let c=!1;const l=()=>{if(!c){const e=new FormData,t=xr.circuitId;e.append("circuitId",t),c=navigator.sendBeacon("_blazor/disconnect",e)}};rt.disconnect=l,window.addEventListener("unload",l,{capture:!1,once:!0}),i.log(ir.Information,"Blazor server-side application started."),o.invokeAfterStartedCallbacks(rt)}(null==$o?void 0:$o.circuit,t)),n.length&&(Uo(),await async function(e,t){(function(){if(window.parent!==window&&!window.opener&&window.frameElement){const e=window.sessionStorage&&window.sessionStorage["Microsoft.AspNetCore.Components.WebAssembly.Authentication.CachedAuthSettings"],t=e&&JSON.parse(e);return t&&t.redirect_uri&&location.href.startsWith(t.redirect_uri)}return!1})()&&await new Promise((()=>{})),function(e){const t=x;x=(e,n,r)=>{((e,t,n)=>{const r=function(e){return me[e]}(e);r.eventDelegator.getHandler(t)&&to.invokeWhenHeapUnlocked(n)})(e,n,(()=>t(e,n,r)))}}(),rt._internal.applyHotReload=(e,t,n,r)=>{zr.invokeDotNetStaticMethod("Microsoft.AspNetCore.Components.WebAssembly","ApplyHotReloadDelta",e,t,n,r)},rt._internal.getApplyUpdateCapabilities=()=>zr.invokeDotNetStaticMethod("Microsoft.AspNetCore.Components.WebAssembly","GetApplyUpdateCapabilities"),rt._internal.invokeJSFromDotNet=wo,rt._internal.invokeJSJson=vo,rt._internal.endInvokeDotNetFromJS=bo,rt._internal.receiveWebAssemblyDotNetDataStream=_o,rt._internal.receiveByteArray=Eo;const n=Ur(to);rt.platform=n,rt._internal.renderBatch=(e,t)=>{const n=to.beginHeapLock();try{ve(e,new lo(t))}finally{n.release()}},rt._internal.navigationManager.listenForNavigationEvents((async(e,t,n)=>{await zr.invokeDotNetStaticMethodAsync("Microsoft.AspNetCore.Components.WebAssembly","NotifyLocationChanged",e,t,n)}),(async(e,t,n,r)=>{const o=await zr.invokeDotNetStaticMethodAsync("Microsoft.AspNetCore.Components.WebAssembly","NotifyLocationChangingAsync",t,n,r);rt._internal.navigationManager.endLocationChanging(e,o)}));const r=new yo(t||[]);let o,i;rt._internal.registeredComponents={getRegisteredComponentsCount:()=>r.getCount(),getId:e=>r.getId(e),getAssembly:e=>r.getAssembly(e),getTypeName:e=>r.getTypeName(e),getParameterDefinitions:e=>r.getParameterDefinitions(e)||"",getParameterValues:e=>r.getParameterValues(e)||""},rt._internal.getPersistedState=()=>yr(document)||"",rt._internal.attachRootComponentToElement=(e,t,n)=>{const o=r.resolveRegisteredElement(e);o?we(n,o,t,!1):function(e,t,n){const r="::before";let o=!1;if(e.endsWith("::after"))e=e.slice(0,-7),o=!0;else if(e.endsWith(r))throw new Error(`The '${r}' selector is not supported.`);const i=v(e)||document.querySelector(e);if(!i)throw new Error(`Could not find any element matching selector '${e}'.`);we(n||0,$(i,!0),t,o)}(e,t,n)};try{const t=await n.start(null!=e?e:{});o=t.resourceLoader,i=t.jsInitializer}catch(e){throw new Error(`Failed to start platform. Reason: ${e}`)}n.callEntryPoint(o.bootConfig.entryAssembly),i.invokeAfterStartedCallbacks(rt)}(null==$o?void 0:$o.webAssembly,n))}rt.start=jo,window.DotNet=e,document&&document.currentScript&&"false"!==document.currentScript.getAttribute("autostart")&&jo()})(); \ No newline at end of file +(()=>{"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){const t=[],n="__jsObjectId",r="__dotNetObject",o="__byte[]",i="__dotNetStream",s="__jsStreamReferenceLength";let a,c;class l{constructor(e){this._jsObject=e,this._cachedFunctions=new Map}findFunction(e){const t=this._cachedFunctions.get(e);if(t)return t;let n,r=this._jsObject;if(e.split(".").forEach((t=>{if(!(t in r))throw new Error(`Could not find '${e}' ('${t}' was undefined).`);n=r,r=r[t]})),r instanceof Function)return r=r.bind(n),this._cachedFunctions.set(e,r),r;throw new Error(`The value '${e}' is not a function.`)}getWrappedObject(){return this._jsObject}}const h={0:new l(window)};h[0]._cachedFunctions.set("import",(e=>("string"==typeof e&&e.startsWith("./")&&(e=new URL(e.substr(2),document.baseURI).toString()),import(e))));let d,u=1;function p(e){t.push(e)}function f(e){if(e&&"object"==typeof e){h[u]=new l(e);const t={[n]:u};return u++,t}throw new Error(`Cannot create a JSObjectReference from the value '${e}'.`)}function g(e){let t=-1;if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Blob)t=e.size;else{if(!(e.buffer instanceof ArrayBuffer))throw new Error("Supplied value is not a typed array or blob.");if(void 0===e.byteLength)throw new Error(`Cannot create a JSStreamReference from the value '${e}' as it doesn't have a byteLength.`);t=e.byteLength}const r={[s]:t};try{const t=f(e);r[n]=t[n]}catch(t){throw new Error(`Cannot create a JSStreamReference from the value '${e}'.`)}return r}function m(e,n){c=e;const r=n?JSON.parse(n,((e,n)=>t.reduce(((t,n)=>n(e,t)),n))):null;return c=void 0,r}function y(){if(void 0===a)throw new Error("No call dispatcher has been set.");if(null===a)throw new Error("There are multiple .NET runtimes present, so a default dispatcher could not be resolved. Use DotNetObject to invoke .NET instance methods.");return a}e.attachDispatcher=function(e){const t=new w(e);return void 0===a?a=t:a&&(a=null),t},e.attachReviver=p,e.invokeMethod=function(e,t,...n){return y().invokeDotNetStaticMethod(e,t,...n)},e.invokeMethodAsync=function(e,t,...n){return y().invokeDotNetStaticMethodAsync(e,t,...n)},e.createJSObjectReference=f,e.createJSStreamReference=g,e.disposeJSObjectReference=function(e){const t=e&&e[n];"number"==typeof t&&_(t)},function(e){e[e.Default=0]="Default",e[e.JSObjectReference=1]="JSObjectReference",e[e.JSStreamReference=2]="JSStreamReference",e[e.JSVoidResult=3]="JSVoidResult"}(d=e.JSCallResultType||(e.JSCallResultType={}));class w{constructor(e){this._dotNetCallDispatcher=e,this._byteArraysToBeRevived=new Map,this._pendingDotNetToJSStreams=new Map,this._pendingAsyncCalls={},this._nextAsyncCallId=1}getDotNetCallDispatcher(){return this._dotNetCallDispatcher}invokeJSFromDotNet(e,t,n,r){const o=m(this,t),i=I(b(e,r)(...o||[]),n);return null==i?null:T(this,i)}beginInvokeJSFromDotNet(e,t,n,r,o){const i=new Promise((e=>{const r=m(this,n);e(b(t,o)(...r||[]))}));e&&i.then((t=>T(this,[e,!0,I(t,r)]))).then((t=>this._dotNetCallDispatcher.endInvokeJSFromDotNet(e,!0,t)),(t=>this._dotNetCallDispatcher.endInvokeJSFromDotNet(e,!1,JSON.stringify([e,!1,v(t)]))))}endInvokeDotNetFromJS(e,t,n){const r=t?m(this,n):new Error(n);this.completePendingCall(parseInt(e,10),t,r)}invokeDotNetStaticMethod(e,t,...n){return this.invokeDotNetMethod(e,t,null,n)}invokeDotNetStaticMethodAsync(e,t,...n){return this.invokeDotNetMethodAsync(e,t,null,n)}invokeDotNetMethod(e,t,n,r){if(this._dotNetCallDispatcher.invokeDotNetFromJS){const o=T(this,r),i=this._dotNetCallDispatcher.invokeDotNetFromJS(e,t,n,o);return i?m(this,i):null}throw new Error("The current dispatcher does not support synchronous calls from JS to .NET. Use invokeDotNetMethodAsync instead.")}invokeDotNetMethodAsync(e,t,n,r){if(e&&n)throw new Error(`For instance method calls, assemblyName should be null. Received '${e}'.`);const o=this._nextAsyncCallId++,i=new Promise(((e,t)=>{this._pendingAsyncCalls[o]={resolve:e,reject:t}}));try{const i=T(this,r);this._dotNetCallDispatcher.beginInvokeDotNetFromJS(o,e,t,n,i)}catch(e){this.completePendingCall(o,!1,e)}return i}receiveByteArray(e,t){this._byteArraysToBeRevived.set(e,t)}processByteArray(e){const t=this._byteArraysToBeRevived.get(e);return t?(this._byteArraysToBeRevived.delete(e),t):null}supplyDotNetStream(e,t){if(this._pendingDotNetToJSStreams.has(e)){const n=this._pendingDotNetToJSStreams.get(e);this._pendingDotNetToJSStreams.delete(e),n.resolve(t)}else{const n=new C;n.resolve(t),this._pendingDotNetToJSStreams.set(e,n)}}getDotNetStreamPromise(e){let t;if(this._pendingDotNetToJSStreams.has(e))t=this._pendingDotNetToJSStreams.get(e).streamPromise,this._pendingDotNetToJSStreams.delete(e);else{const n=new C;this._pendingDotNetToJSStreams.set(e,n),t=n.streamPromise}return t}completePendingCall(e,t,n){if(!this._pendingAsyncCalls.hasOwnProperty(e))throw new Error(`There is no pending async call with ID ${e}.`);const r=this._pendingAsyncCalls[e];delete this._pendingAsyncCalls[e],t?r.resolve(n):r.reject(n)}}function v(e){return e instanceof Error?`${e.message}\n${e.stack}`:e?e.toString():"null"}function b(e,t){const n=h[t];if(n)return n.findFunction(e);throw new Error(`JS object instance with ID ${t} does not exist (has it been disposed?).`)}function _(e){delete h[e]}e.findJSFunction=b,e.disposeJSObjectReferenceById=_;class E{constructor(e,t){this._id=e,this._callDispatcher=t}invokeMethod(e,...t){return this._callDispatcher.invokeDotNetMethod(null,e,this._id,t)}invokeMethodAsync(e,...t){return this._callDispatcher.invokeDotNetMethodAsync(null,e,this._id,t)}dispose(){this._callDispatcher.invokeDotNetMethodAsync(null,"__Dispose",this._id,null).catch((e=>console.error(e)))}serializeAsArg(){return{[r]:this._id}}}e.DotNetObject=E,p((function(e,t){if(t&&"object"==typeof t){if(t.hasOwnProperty(r))return new E(t[r],c);if(t.hasOwnProperty(n)){const e=t[n],r=h[e];if(r)return r.getWrappedObject();throw new Error(`JS object instance with Id '${e}' does not exist. It may have been disposed.`)}if(t.hasOwnProperty(o)){const e=t[o],n=c.processByteArray(e);if(void 0===n)throw new Error(`Byte array index '${e}' does not exist.`);return n}if(t.hasOwnProperty(i)){const e=t[i],n=c.getDotNetStreamPromise(e);return new S(n)}}return t}));class S{constructor(e){this._streamPromise=e}stream(){return this._streamPromise}async arrayBuffer(){return new Response(await this.stream()).arrayBuffer()}}class C{constructor(){this.streamPromise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}function I(e,t){switch(t){case d.Default:return e;case d.JSObjectReference:return f(e);case d.JSStreamReference:return g(e);case d.JSVoidResult:return null;default:throw new Error(`Invalid JS call result type '${t}'.`)}}let k=0;function T(e,t){k=0,c=e;const n=JSON.stringify(t,D);return c=void 0,n}function D(e,t){if(t instanceof E)return t.serializeAsArg();if(t instanceof Uint8Array){c.getDotNetCallDispatcher().sendByteArray(k,t);const e={[o]:k};return k++,e}return t}}(e||(e={})),function(e){e[e.prependFrame=1]="prependFrame",e[e.removeFrame=2]="removeFrame",e[e.setAttribute=3]="setAttribute",e[e.removeAttribute=4]="removeAttribute",e[e.updateText=5]="updateText",e[e.stepIn=6]="stepIn",e[e.stepOut=7]="stepOut",e[e.updateMarkup=8]="updateMarkup",e[e.permutationListEntry=9]="permutationListEntry",e[e.permutationListEnd=10]="permutationListEnd"}(t||(t={})),function(e){e[e.element=1]="element",e[e.text=2]="text",e[e.attribute=3]="attribute",e[e.component=4]="component",e[e.region=5]="region",e[e.elementReferenceCapture=6]="elementReferenceCapture",e[e.markup=8]="markup"}(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 d(e){const t=[];for(let n=0;ne.selected)).map((e=>e.value))}}{const e=function(e){return!!e&&"INPUT"===e.tagName&&"checkbox"===e.getAttribute("type")}(t);return{value:e?!!t.checked:t.value}}}}),h(["copy","cut","paste"],{createEventArgs:e=>({type:e.type})}),h(["drag","dragend","dragenter","dragleave","dragover","dragstart","drop"],{createEventArgs:e=>{return{...u(t=e),dataTransfer:t.dataTransfer?{dropEffect:t.dataTransfer.dropEffect,effectAllowed:t.dataTransfer.effectAllowed,files:Array.from(t.dataTransfer.files).map((e=>e.name)),items:Array.from(t.dataTransfer.items).map((e=>({kind:e.kind,type:e.type}))),types:t.dataTransfer.types}:null};var t}}),h(["focus","blur","focusin","focusout"],{createEventArgs:e=>({type:e.type})}),h(["keydown","keyup","keypress"],{createEventArgs:e=>{return{key:(t=e).key,code:t.code,location:t.location,repeat:t.repeat,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,type:t.type};var t}}),h(["contextmenu","click","mouseover","mouseout","mousemove","mousedown","mouseup","mouseleave","mouseenter","dblclick"],{createEventArgs:e=>u(e)}),h(["error"],{createEventArgs:e=>{return{message:(t=e).message,filename:t.filename,lineno:t.lineno,colno:t.colno,type:t.type};var t}}),h(["loadstart","timeout","abort","load","loadend","progress"],{createEventArgs:e=>{return{lengthComputable:(t=e).lengthComputable,loaded:t.loaded,total:t.total,type:t.type};var t}}),h(["touchcancel","touchend","touchmove","touchenter","touchleave","touchstart"],{createEventArgs:e=>{return{detail:(t=e).detail,touches:d(t.touches),targetTouches:d(t.targetTouches),changedTouches:d(t.changedTouches),ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,type:t.type};var t}}),h(["gotpointercapture","lostpointercapture","pointercancel","pointerdown","pointerenter","pointerleave","pointermove","pointerout","pointerover","pointerup"],{createEventArgs:e=>{return{...u(t=e),pointerId:t.pointerId,width:t.width,height:t.height,pressure:t.pressure,tiltX:t.tiltX,tiltY:t.tiltY,pointerType:t.pointerType,isPrimary:t.isPrimary};var t}}),h(["wheel","mousewheel"],{createEventArgs:e=>{return{...u(t=e),deltaX:t.deltaX,deltaY:t.deltaY,deltaZ:t.deltaZ,deltaMode:t.deltaMode};var t}}),h(["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 E().invokeMethodAsync("AddRootComponent",t,r),i=new _(o,m[t]);return await i.setParameters(n),i}};function v(e){const t=f.get(e);if(t)return f.delete(e),t}class b{invoke(e){return this._callback(e)}setCallback(t){this._selfJSObjectReference||(this._selfJSObjectReference=e.createJSObjectReference(this)),this._callback=t}getJSObjectReference(){return this._selfJSObjectReference}dispose(){this._selfJSObjectReference&&e.disposeJSObjectReference(this._selfJSObjectReference)}}class _{constructor(e,t){this._jsEventCallbackWrappers=new Map,this._componentId=e;for(const e of t)"eventcallback"===e.type&&this._jsEventCallbackWrappers.set(e.name.toLowerCase(),new b)}setParameters(e){const t={},n=Object.entries(e||{}),r=n.length;for(const[e,r]of n){const n=this._jsEventCallbackWrappers.get(e.toLowerCase());n&&r?(n.setCallback(r),t[e]=n.getJSObjectReference()):t[e]=r}return E().invokeMethodAsync("SetRootComponentParameters",this._componentId,r,t)}async dispose(){if(null!==this._componentId){await E().invokeMethodAsync("RemoveRootComponent",this._componentId),this._componentId=null;for(const e of this._jsEventCallbackWrappers.values())e.dispose()}}}function E(){if(!g)throw new Error("Dynamic root components have not been enabled in this application.");return g}const S=[];let C;const I=new Promise((e=>{C=e}));function k(e,t,n){return D(e,t.eventHandlerId,(()=>T(e).invokeMethodAsync("DispatchEventAsync",t,n)))}function T(e){const t=S[e];if(!t)throw new Error(`No interop methods are registered for renderer ${e}`);return t}let D=(e,t,n)=>n();const x=M(["abort","blur","canplay","canplaythrough","change","cuechange","durationchange","emptied","ended","error","focus","load","loadeddata","loadedmetadata","loadend","loadstart","mouseenter","mouseleave","pointerenter","pointerleave","pause","play","playing","progress","ratechange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeupdate","toggle","unload","volumechange","waiting","DOMNodeInsertedIntoDocument","DOMNodeRemovedFromDocument"]),N={submit:!0},A=M(["click","dblclick","mousedown","mousemove","mouseup"]);class R{constructor(e){this.browserRendererId=e,this.afterClickCallbacks=[];const t=++R.nextEventDelegatorId;this.eventsCollectionKey=`_blazorEvents_${t}`,this.eventInfoStore=new P(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 u=r,p=this.getEventHandlerInfosForElement(u,!1);if(p){const n=p.getHandler(e);if(n&&(h=u,d=t.type,!((h instanceof HTMLButtonElement||h instanceof HTMLInputElement||h instanceof HTMLTextAreaElement||h instanceof HTMLSelectElement)&&Object.prototype.hasOwnProperty.call(A,d)&&h.disabled))){if(!s){const n=c(e);i=(null==n?void 0:n.createEventArgs)?n.createEventArgs(t):{},s=!0}Object.prototype.hasOwnProperty.call(N,t.type)&&t.preventDefault(),k(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,d}getEventHandlerInfosForElement(e,t){return Object.prototype.hasOwnProperty.call(e,this.eventsCollectionKey)?e[this.eventsCollectionKey]:t?e[this.eventsCollectionKey]=new U:null}}R.nextEventDelegatorId=0;class P{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 U{constructor(){this.handlers={},this.preventDefaultFlags=null,this.stopPropagationFlags=null}getHandler(e){return Object.prototype.hasOwnProperty.call(this.handlers,e)?this.handlers[e]:null}setHandler(e,t){this.handlers[e]=t}removeHandler(e){delete this.handlers[e]}preventDefault(e,t){return void 0!==t&&(this.preventDefaultFlags=this.preventDefaultFlags||{},this.preventDefaultFlags[e]=t),!!this.preventDefaultFlags&&this.preventDefaultFlags[e]}stopPropagation(e,t){return void 0!==t&&(this.stopPropagationFlags=this.stopPropagationFlags||{},this.stopPropagationFlags[e]=t),!!this.stopPropagationFlags&&this.stopPropagationFlags[e]}}function M(e){const t={};return e.forEach((e=>{t[e]=!0})),t}const L=Z("_blazorLogicalChildren"),B=Z("_blazorLogicalParent"),O=Z("_blazorLogicalEnd");function F(e,t){if(!e.parentNode)throw new Error(`Comment not connected to the DOM ${e.textContent}`);const n=e.parentNode,r=$(n,!0),o=K(r);return Array.from(n.childNodes).forEach((e=>o.push(e))),e[B]=r,t&&(e[O]=t,$(t)),$(e)}function $(e,t){if(e.childNodes.length>0&&!t)throw new Error("New logical elements must start empty, or allowExistingContents must be true");return L in e||(e[L]=[]),e}function H(e,t){const n=document.createComment("!");return j(n,e,t),n}function j(e,t,n){const r=e;if(e instanceof Comment&&K(r)&&K(r).length>0)throw new Error("Not implemented: inserting non-empty logical container");if(z(r))throw new Error("Not implemented: moving existing logical children");const o=K(t);if(n0;)W(n,0)}const r=n;r.parentNode.removeChild(r)}function z(e){return e[B]||null}function J(e,t){return K(e)[t]}function q(e){const t=X(e);return"http://www.w3.org/2000/svg"===t.namespaceURI&&"foreignObject"!==t.tagName}function K(e){return e[L]}function V(e,t){const n=K(e);t.forEach((e=>{e.moveRangeStart=n[e.fromSiblingIndex],e.moveRangeEnd=Q(e.moveRangeStart)})),t.forEach((t=>{const r=document.createComment("marker");t.moveToBeforeMarker=r;const o=n[t.toSiblingIndex+1];o?o.parentNode.insertBefore(r,o):Y(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 X(e){if(e instanceof Element||e instanceof DocumentFragment)return e;if(e instanceof Comment)return e.parentNode;throw new Error("Not a valid logical element")}function G(e){const t=K(z(e));return t[Array.prototype.indexOf.call(t,e)+1]||null}function Y(e,t){if(t instanceof Element||t instanceof DocumentFragment)t.appendChild(e);else{if(!(t instanceof Comment))throw new Error(`Cannot append node because the parent is not a valid logical element. Parent: ${t}`);{const n=G(t);n?n.parentNode.insertBefore(e,n):Y(e,z(t))}}}function Q(e){if(e instanceof Element||e instanceof DocumentFragment)return e;const t=G(e);if(t)return t.previousSibling;{const t=z(e);return t instanceof Element||t instanceof DocumentFragment?t.lastChild:Q(t)}}function Z(e){return"function"==typeof Symbol?Symbol():e}function ee(e){return`_bl_${e}`}const te="__internalId";e.attachReviver(((e,t)=>t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,te)&&"string"==typeof t[te]?function(e){const t=`[${ee(e)}]`;return document.querySelector(t)}(t[te]):t));const ne="_blazorDeferredValue";function re(e,t,n){switch(t){case"value":return function(e,t){switch(t&&"INPUT"===e.tagName&&(t=function(e,t){switch(t.getAttribute("type")){case"time":return 8!==e.length||!e.endsWith("00")&&t.hasAttribute("step")?e:e.substring(0,5);case"datetime-local":return 19!==e.length||!e.endsWith("00")&&t.hasAttribute("step")?e:e.substring(0,16);default:return e}}(t,e)),e.tagName){case"INPUT":case"SELECT":case"TEXTAREA":return t&&e instanceof HTMLSelectElement&&se(e)&&(t=JSON.parse(t)),ce(e,t),e[ne]=t,!0;case"OPTION":return t||""===t?e.setAttribute("value",t):e.removeAttribute("value"),le(e),!0;default:return!1}}(e,n);case"checked":return function(e,t){return"INPUT"===e.tagName&&(e.checked=null!==t,!0)}(e,n);default:return!1}}function oe(e){switch(e.name){case"value":{const t=e.ownerElement;switch(t.tagName){case"INPUT":case"SELECT":case"TEXTAREA":return t.value}break}case"checked":{const t=e.ownerElement;if("INPUT"===t.tagName){const e=t;return e.checked?e.value:""}break}}return e.value}function ie(e){e instanceof HTMLOptionElement?le(e):ne in e&&ce(e,e[ne])}function se(e){return"select-multiple"===e.type}function ae(e,t){e.value=t||""}function ce(e,t){e instanceof HTMLSelectElement?se(e)?function(e,t){t||(t=[]);for(let n=0;n{ke()&&Ee(e,(e=>{Oe(e,!0,!1)}))}))}attachRootComponentToLogicalElement(e,t,n){this.attachComponentToElement(e,t),this.rootComponentIds.add(e),n||(ue[e]=t)}updateComponent(e,t,n,r){var o;const i=this.childComponentLocations[t];if(!i)throw new Error(`No element is currently associated with component ${t}`);const s=ue[t];if(s){const e=function(e){return e[O]||null}(s);delete ue[t],e?function(e,t){const n=z(e);if(!n)throw new Error("Can't clear between nodes. The start node does not have a logical parent.");const r=K(n),o=r.indexOf(e)+1,i=r.indexOf(t);for(let e=o;e<=i;e++)W(n,o);e.textContent="!"}(s,e):function(e){let t;for(;t=e.firstChild;)e.removeChild(t)}(s)}const a=null===(o=X(i))||void 0===o?void 0:o.getRootNode(),c=a&&a.activeElement;this.applyEdits(e,t,i,0,n,r),c instanceof HTMLElement&&a&&a.activeElement!==c&&c.focus()}disposeComponent(e){this.rootComponentIds.delete(e)&&function(e){const t=K(e);for(;t.length;)W(e,0)}(this.childComponentLocations[e]),delete this.childComponentLocations[e]}disposeEventHandler(e){this.eventDelegator.removeListener(e)}attachComponentToElement(e,t){this.childComponentLocations[e]=t}applyEdits(e,n,r,o,i,s){let a,c=0,l=o;const h=e.arrayBuilderSegmentReader,d=e.editReader,u=e.frameReader,p=h.values(i),f=h.offset(i),g=f+h.count(i);for(let i=f;idocument.baseURI,getLocationHref:()=>location.href,scrollToElement:Le};function Le(e){const t=document.getElementById(e);return!!t&&(t.scrollIntoView(),!0)}function Be(e,t,n=!1){const r=Ce(e);!t.forceLoad&&Se(r)?Oe(r,!1,t.replaceHistoryEntry,t.historyEntryState,n):function(e,t){if(location.href===e){const t=e+"?";history.replaceState(null,"",t),location.replace(e)}else t?location.replace(e):location.href=e}(e,t.replaceHistoryEntry)}async function Oe(e,t,n,r=void 0,o=!1){if(He(),function(e){const t=e.indexOf("#");return t>-1&&location.href.replace(location.hash,"")===e.substring(0,t)}(e))!function(e,t,n){Fe(e,t,n);const r=e.indexOf("#");r!==e.length-1&&Le(e.substring(r+1))}(e,n,r);else{if(!o&&De&&!await je(e,r,t))return;ye=!0,Fe(e,n,r),await We(t)}}function Fe(e,t,n=void 0){t?history.replaceState({userState:n,_index:xe},"",e):(xe++,history.pushState({userState:n,_index:xe},"",e))}function $e(e){return new Promise((t=>{const n=Pe;Pe=()=>{Pe=n,t()},history.go(e)}))}function He(){Ue&&(Ue(!1),Ue=null)}function je(e,t,n){return new Promise((r=>{He(),Re?(Ne++,Ue=r,Re(Ne,e,t,n)):r(!1)}))}async function We(e){var t;Ae&&await Ae(location.href,null===(t=history.state)||void 0===t?void 0:t.userState,e)}async function ze(e){var t,n;Pe&&await Pe(e),xe=null!==(n=null===(t=history.state)||void 0===t?void 0:t._index)&&void 0!==n?n:0}const Je={focus:function(e,t){if(e instanceof HTMLElement)e.focus({preventScroll:t});else{if(!(e instanceof SVGElement))throw new Error("Unable to focus an invalid element.");if(!e.hasAttribute("tabindex"))throw new Error("Unable to focus an SVG element that does not have a tabindex.");e.focus({preventScroll:t})}},focusBySelector:function(e,t){const n=document.querySelector(e);n&&(n.hasAttribute("tabindex")||(n.tabIndex=-1),n.focus({preventScroll:!0}))}},qe={init:function(e,t,n,r=50){const o=Ve(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)}Ke[e._id]={intersectionObserver:s,mutationObserverBefore:a,mutationObserverAfter:c}},dispose:function(e){const t=Ke[e._id];t&&(t.intersectionObserver.disconnect(),t.mutationObserverBefore.disconnect(),t.mutationObserverAfter.disconnect(),e.dispose(),delete Ke[e._id])}},Ke={};function Ve(e){return e&&e!==document.body&&e!==document.documentElement?"visible"!==getComputedStyle(e).overflowY?e:Ve(e.parentElement):null}const Xe={getAndRemoveExistingTitle:function(){var e;const t=document.head?document.head.getElementsByTagName("title"):[];if(0===t.length)return null;let n=null;for(let r=t.length-1;r>=0;r--){const o=t[r],i=o.previousSibling;i instanceof Comment&&null!==z(i)||(null===n&&(n=o.textContent),null===(e=o.parentNode)||void 0===e||e.removeChild(o))}return n}},Ge={init:function(e,t){t._blazorInputFileNextFileId=0,t.addEventListener("click",(function(){t.value=""})),t.addEventListener("change",(function(){t._blazorFilesById={};const n=Array.prototype.map.call(t.files,(function(e){const n={id:++t._blazorInputFileNextFileId,lastModified:new Date(e.lastModified).toISOString(),name:e.name,size:e.size,contentType:e.type,readPromise:void 0,arrayBuffer:void 0,blob:e};return t._blazorFilesById[n.id]=n,n}));e.invokeMethodAsync("NotifyChange",n)}))},toImageFile:async function(e,t,n,r,o){const i=Ye(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 Ye(e,t).blob}};function Ye(e,t){const n=e._blazorFilesById[t];if(!n)throw new Error(`There is no file with ID ${t}. The file list may have changed. See https://aka.ms/aspnet/blazor-input-file-multiple-selections.`);return n}const Qe=new Set,Ze={enableNavigationPrompt:function(e){0===Qe.size&&window.addEventListener("beforeunload",et),Qe.add(e)},disableNavigationPrompt:function(e){Qe.delete(e),0===Qe.size&&window.removeEventListener("beforeunload",et)}};function et(e){e.preventDefault(),e.returnValue=!0}async function tt(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 nt=new Map,rt={navigateTo:function(e,t,n=!1){Be(e,t instanceof Object?t:{forceLoad:t,replaceHistoryEntry:n})},registerCustomEventType:function(e,t){if(!t)throw new Error("The options parameter is required.");if(i.has(e))throw new Error(`The event '${e}' is already registered.`);if(t.browserEventName){const n=s.get(t.browserEventName);n?n.push(e):s.set(t.browserEventName,[e]),a.forEach((n=>n(e,t.browserEventName)))}i.set(e,t)},rootComponents:w,_internal:{navigationManager:Me,domWrapper:Je,Virtualize:qe,PageTitle:Xe,InputFile:Ge,NavigationLock:Ze,getJSDataStreamChunk:tt,attachWebRendererInterop:function(t,n,r){const o=S.length;return S.push(t),Object.keys(n).length>0&&function(t,n,r){if(g)throw new Error("Dynamic root components have already been enabled.");g=t,m=n;for(const[t,o]of Object.entries(r)){const r=e.findJSFunction(t,0);for(const e of o)r(e,n[e])}}(T(o),n,r),C(),o}}};window.Blazor=rt;const ot=[0,2e3,1e4,3e4,null];class it{constructor(e){this._retryDelays=void 0!==e?[...e,null]:ot}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}}class st{}st.Authorization="Authorization",st.Cookie="Cookie";class at{constructor(e,t,n){this.statusCode=e,this.statusText=t,this.content=n}}class ct{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""}}class lt extends ct{constructor(e,t){super(),this._innerClient=e,this._accessTokenFactory=t}async send(e){let t=!0;this._accessTokenFactory&&(!this._accessToken||e.url&&e.url.indexOf("/negotiate?")>0)&&(t=!1,this._accessToken=await this._accessTokenFactory()),this._setAuthorizationHeader(e);const n=await this._innerClient.send(e);return t&&401===n.statusCode&&this._accessTokenFactory?(this._accessToken=await this._accessTokenFactory(),this._setAuthorizationHeader(e),await this._innerClient.send(e)):n}_setAuthorizationHeader(e){e.headers||(e.headers={}),this._accessToken?e.headers[st.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[st.Authorization]&&delete e.headers[st.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}}class ht extends Error{constructor(e,t){const n=new.target.prototype;super(`${e}: Status code '${t}'`),this.statusCode=t,this.__proto__=n}}class dt extends Error{constructor(e="A timeout occurred."){const t=new.target.prototype;super(e),this.__proto__=t}}class ut extends Error{constructor(e="An abort occurred."){const t=new.target.prototype;super(e),this.__proto__=t}}class pt extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.transport=t,this.errorType="UnsupportedTransportError",this.__proto__=n}}class ft extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.transport=t,this.errorType="DisabledTransportError",this.__proto__=n}}class gt extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.transport=t,this.errorType="FailedToStartTransportError",this.__proto__=n}}class mt extends Error{constructor(e){const t=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=t}}class yt extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.innerErrors=t,this.__proto__=n}}var wt;!function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Information=2]="Information",e[e.Warning=3]="Warning",e[e.Error=4]="Error",e[e.Critical=5]="Critical",e[e.None=6]="None"}(wt||(wt={}));class vt{constructor(){}log(e,t){}}vt.instance=new vt;const bt="0.0.0-DEV_BUILD";class _t{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 St(e,t){let n="";return Ct(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 Ct(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}async function It(e,t,n,r,o,i){const s={},[a,c]=Dt();s[a]=c,e.log(wt.Trace,`(${t} transport) sending data. ${St(o,i.logMessageContent)}.`);const l=Ct(o)?"arraybuffer":"text",h=await n.post(r,{content:o,headers:{...s,...i.headers},responseType:l,timeout:i.timeout,withCredentials:i.withCredentials});e.log(wt.Trace,`(${t} transport) request complete. Response status: ${h.statusCode}.`)}class kt{constructor(e,t){this._subject=e,this._observer=t}dispose(){const e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),0===this._subject.observers.length&&this._subject.cancelCallback&&this._subject.cancelCallback().catch((e=>{}))}}class Tt{constructor(e){this._minLevel=e,this.out=console}log(e,t){if(e>=this._minLevel){const n=`[${(new Date).toISOString()}] ${wt[e]}: ${t}`;switch(e){case wt.Critical:case wt.Error:this.out.error(n);break;case wt.Warning:this.out.warn(n);break;case wt.Information:this.out.info(n);break;default:this.out.log(n)}}}}function Dt(){let e="X-SignalR-User-Agent";return Et.isNode&&(e="User-Agent"),[e,xt(bt,Nt(),Et.isNode?"NodeJS":"Browser",At())]}function xt(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 Nt(){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 At(){if(Et.isNode)return process.versions.node}function Rt(e){return e.stack?e.stack:e.message?e.message:`${e}`}class Pt extends ct{constructor(e){if(super(),this._logger=e,"undefined"==typeof fetch){const e=require;this._jar=new(e("tough-cookie").CookieJar),"undefined"==typeof fetch?this._fetchType=e("node-fetch"):this._fetchType=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 ut;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 ut});let r,o=null;if(e.timeout){const r=e.timeout;o=setTimeout((()=>{t.abort(),this._logger.log(wt.Warning,"Timeout from HTTP request."),n=new dt}),r)}""===e.content&&(e.content=void 0),e.content&&(e.headers=e.headers||{},Ct(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(wt.Warning,`Error from HTTP request. ${e}.`),e}finally{o&&clearTimeout(o),e.abortSignal&&(e.abortSignal.onabort=null)}if(!r.ok){const e=await Ut(r,"text");throw new ht(e||r.statusText,r.status)}const i=Ut(r,e.responseType),s=await i;return new at(r.status,r.statusText,s)}getCookieString(e){return""}}function Ut(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 Mt extends ct{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new ut):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&&(Ct(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 ut)}),e.timeout&&(r.timeout=e.timeout),r.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),r.status>=200&&r.status<300?t(new at(r.status,r.statusText,r.response||r.responseText)):n(new ht(r.response||r.responseText||r.statusText,r.status))},r.onerror=()=>{this._logger.log(wt.Warning,`Error from HTTP request. ${r.status}: ${r.statusText}.`),n(new ht(r.statusText,r.status))},r.ontimeout=()=>{this._logger.log(wt.Warning,"Timeout from HTTP request."),n(new dt)},r.send(e.content)})):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class Lt extends ct{constructor(e){if(super(),"undefined"!=typeof fetch)this._httpClient=new Pt(e);else{if("undefined"==typeof XMLHttpRequest)throw new Error("No usable HttpClient found.");this._httpClient=new Mt(e)}}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new ut):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}}var Bt,Ot,Ft,$t;!function(e){e[e.None=0]="None",e[e.WebSockets=1]="WebSockets",e[e.ServerSentEvents=2]="ServerSentEvents",e[e.LongPolling=4]="LongPolling"}(Bt||(Bt={})),function(e){e[e.Text=1]="Text",e[e.Binary=2]="Binary"}(Ot||(Ot={}));class Ht{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 jt{get pollAborted(){return this._pollAbort.aborted}constructor(e,t,n){this._httpClient=e,this._logger=t,this._pollAbort=new Ht,this._options=n,this._running=!1,this.onreceive=null,this.onclose=null}async connect(e,t){if(_t.isRequired(e,"url"),_t.isRequired(t,"transferFormat"),_t.isIn(t,Ot,"transferFormat"),this._url=e,this._logger.log(wt.Trace,"(LongPolling transport) Connecting."),t===Ot.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]=Dt(),o={[n]:r,...this._options.headers},i={abortSignal:this._pollAbort.signal,headers:o,timeout:1e5,withCredentials:this._options.withCredentials};t===Ot.Binary&&(i.responseType="arraybuffer");const s=`${e}&_=${Date.now()}`;this._logger.log(wt.Trace,`(LongPolling transport) polling: ${s}.`);const a=await this._httpClient.get(s,i);200!==a.statusCode?(this._logger.log(wt.Error,`(LongPolling transport) Unexpected response code: ${a.statusCode}.`),this._closeError=new ht(a.statusText||"",a.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,i)}async _poll(e,t){try{for(;this._running;)try{const n=`${e}&_=${Date.now()}`;this._logger.log(wt.Trace,`(LongPolling transport) polling: ${n}.`);const r=await this._httpClient.get(n,t);204===r.statusCode?(this._logger.log(wt.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):200!==r.statusCode?(this._logger.log(wt.Error,`(LongPolling transport) Unexpected response code: ${r.statusCode}.`),this._closeError=new ht(r.statusText||"",r.statusCode),this._running=!1):r.content?(this._logger.log(wt.Trace,`(LongPolling transport) data received. ${St(r.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(r.content)):this._logger.log(wt.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(e){this._running?e instanceof dt?this._logger.log(wt.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=e,this._running=!1):this._logger.log(wt.Trace,`(LongPolling transport) Poll errored after shutdown: ${e.message}`)}}finally{this._logger.log(wt.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(e){return this._running?It(this._logger,"LongPolling",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this._logger.log(wt.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(wt.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const e={},[t,n]=Dt();e[t]=n;const r={headers:{...e,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials};await this._httpClient.delete(this._url,r),this._logger.log(wt.Trace,"(LongPolling transport) DELETE request sent.")}finally{this._logger.log(wt.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(wt.Trace,e),this.onclose(this._closeError)}}}class Wt{constructor(e,t,n,r){this._httpClient=e,this._accessToken=t,this._logger=n,this._options=r,this.onreceive=null,this.onclose=null}async connect(e,t){return _t.isRequired(e,"url"),_t.isRequired(t,"transferFormat"),_t.isIn(t,Ot,"transferFormat"),this._logger.log(wt.Trace,"(SSE transport) Connecting."),this._url=e,this._accessToken&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise(((n,r)=>{let o,i=!1;if(t===Ot.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]=Dt();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(wt.Trace,`(SSE transport) data received. ${St(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(wt.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?It(this._logger,"SSE",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}}class zt{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 _t.isRequired(e,"url"),_t.isRequired(t,"transferFormat"),_t.isIn(t,Ot,"transferFormat"),this._logger.log(wt.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]=Dt();t[r]=o,n&&(t[st.Authorization]=`Bearer ${n}`),s&&(t[st.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===Ot.Binary&&(i.binaryType="arraybuffer"),i.onopen=t=>{this._logger.log(wt.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(wt.Information,`(WebSockets transport) ${t}.`)},i.onmessage=e=>{if(this._logger.log(wt.Trace,`(WebSockets transport) data received. ${St(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(wt.Trace,`(WebSockets transport) sending data. ${St(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(wt.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 Jt{constructor(e,t={}){var n;if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,_t.isRequired(e,"url"),this._logger=void 0===(n=t.logger)?new Tt(wt.Information):null===n?vt.instance:void 0!==n.log?n:new Tt(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=new lt(t.httpClient||new Lt(this._logger),t.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=t,this.onreceive=null,this.onclose=null}async start(e){if(e=e||Ot.Binary,_t.isIn(e,Ot,"transferFormat"),this._logger.log(wt.Debug,`Starting connection with transfer format '${Ot[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(wt.Error,e),await this._stopPromise,Promise.reject(new ut(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(wt.Error,e),Promise.reject(new ut(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 qt(this.transport)),this._sendQueue.send(e))}async stop(e){return"Disconnected"===this._connectionState?(this._logger.log(wt.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):"Disconnecting"===this._connectionState?(this._logger.log(wt.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(wt.Error,`HttpConnection.transport.stop() threw error '${e}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(wt.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async _startInternal(e){let t=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport!==Bt.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(Bt.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 ut("The connection was stopped during negotiation.");if(n.error)throw new Error(n.error);if(n.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(n.url&&(t=n.url),n.accessToken){const e=n.accessToken;this._accessTokenFactory=()=>e,this._httpClient._accessToken=e,this._httpClient._accessTokenFactory=void 0}r++}while(n.url&&r<100);if(100===r&&n.url)throw new Error("Negotiate redirection limit exceeded.");await this._createTransport(t,this._options.transport,n,e)}this.transport instanceof jt&&(this.features.inherentKeepAlive=!0),"Connecting"===this._connectionState&&(this._logger.log(wt.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(e){return this._logger.log(wt.Error,"Failed to start the connection: "+e),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(e)}}async _getNegotiationResponse(e){const t={},[n,r]=Dt();t[n]=r;const o=this._resolveNegotiateUrl(e);this._logger.log(wt.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 ht&&404===e.statusCode&&(t+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(wt.Error,t),Promise.reject(new mt(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(wt.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(wt.Error,`Failed to start the transport '${n.transport}': ${e}`),a=void 0,i.push(new gt(`${n.transport} failed: ${e}`,Bt[n.transport])),"Connecting"!==this._connectionState){const e="Failed to select transport before stop() was called.";return this._logger.log(wt.Debug,e),Promise.reject(new ut(e))}}}}return i.length>0?Promise.reject(new yt(`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 Bt.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new zt(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case Bt.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new Wt(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case Bt.LongPolling:return new jt(this._httpClient,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=Bt[e.transport];if(null==r)return this._logger.log(wt.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(wt.Debug,`Skipping transport '${Bt[r]}' because it was disabled by the client.`),new ft(`'${Bt[r]}' is disabled by the client.`,r);if(!(e.transferFormats.map((e=>Ot[e])).indexOf(n)>=0))return this._logger.log(wt.Debug,`Skipping transport '${Bt[r]}' because it does not support the requested transfer format '${Ot[n]}'.`),new Error(`'${Bt[r]}' does not support ${Ot[n]}.`);if(r===Bt.WebSockets&&!this._options.WebSocket||r===Bt.ServerSentEvents&&!this._options.EventSource)return this._logger.log(wt.Debug,`Skipping transport '${Bt[r]}' because it is not supported in your environment.'`),new pt(`'${Bt[r]}' is not supported in your environment.`,r);this._logger.log(wt.Debug,`Selecting transport '${Bt[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(wt.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(wt.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(wt.Error,`Connection disconnected with error '${e}'.`):this._logger.log(wt.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch((e=>{this._logger.log(wt.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(wt.Error,`HttpConnection.onclose(${e}) threw error '${t}'.`)}}}else this._logger.log(wt.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(wt.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 qt{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new Kt,this._transportResult=new Kt,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new Kt),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 Kt;const e=this._transportResult;this._transportResult=void 0;const t="string"==typeof this._buffer[0]?this._buffer.join(""):qt._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 Kt{constructor(){this.promise=new Promise(((e,t)=>[this._resolver,this._rejecter]=[e,t]))}resolve(){this._resolver()}reject(e){this._rejecter(e)}}class Vt{static write(e){return`${e}${Vt.RecordSeparator}`}static parse(e){if(e[e.length-1]!==Vt.RecordSeparator)throw new Error("Message is incomplete.");const t=e.split(Vt.RecordSeparator);return t.pop(),t}}Vt.RecordSeparatorCode=30,Vt.RecordSeparator=String.fromCharCode(Vt.RecordSeparatorCode);class Xt{writeHandshakeRequest(e){return Vt.write(JSON.stringify(e))}parseHandshakeResponse(e){let t,n;if(Ct(e)){const r=new Uint8Array(e),o=r.indexOf(Vt.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(Vt.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=Vt.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"}(Ft||(Ft={}));class Gt{constructor(){this.observers=[]}next(e){for(const t of this.observers)t.next(e)}error(e){for(const t of this.observers)t.error&&t.error(e)}complete(){for(const e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new kt(this,e)}}!function(e){e.Disconnected="Disconnected",e.Connecting="Connecting",e.Connected="Connected",e.Disconnecting="Disconnecting",e.Reconnecting="Reconnecting"}($t||($t={}));class Yt{static create(e,t,n,r,o,i){return new Yt(e,t,n,r,o,i)}constructor(e,t,n,r,o,i){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(wt.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},_t.isRequired(e,"connection"),_t.isRequired(t,"logger"),_t.isRequired(n,"protocol"),this.serverTimeoutInMilliseconds=null!=o?o:3e4,this.keepAliveIntervalInMilliseconds=null!=i?i:15e3,this._logger=t,this._protocol=n,this.connection=e,this._reconnectPolicy=r,this._handshakeProtocol=new Xt,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=$t.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:Ft.Ping})}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(e){if(this._connectionState!==$t.Disconnected&&this._connectionState!==$t.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!==$t.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=$t.Connecting,this._logger.log(wt.Debug,"Starting HubConnection.");try{await this._startInternal(),Et.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=$t.Connected,this._connectionStarted=!0,this._logger.log(wt.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=$t.Disconnected,this._logger.log(wt.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(wt.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(t)),this._logger.log(wt.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await e,this._stopDuringStartError)throw this._stopDuringStartError;this.connection.features.inherentKeepAlive||await this._sendMessage(this._cachedPingMessage)}catch(e){throw this._logger.log(wt.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===$t.Disconnected?(this._logger.log(wt.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve()):this._connectionState===$t.Disconnecting?(this._logger.log(wt.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState=$t.Disconnecting,this._logger.log(wt.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(wt.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 ut("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 Gt;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===Ft.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===Ft.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 Ft.Invocation:this._invokeClientMethod(e);break;case Ft.StreamItem:case Ft.Completion:{const t=this._callbacks[e.invocationId];if(t){e.type===Ft.Completion&&delete this._callbacks[e.invocationId];try{t(e)}catch(e){this._logger.log(wt.Error,`Stream callback threw error: ${Rt(e)}`)}}break}case Ft.Ping:break;case Ft.Close:{this._logger.log(wt.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(wt.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(wt.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(wt.Error,e);const n=new Error(e);throw this._handshakeRejecter(n),n}return this._logger.log(wt.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===$t.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(wt.Warning,`No client method with the name '${t}' found.`),void(e.invocationId&&(this._logger.log(wt.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(wt.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(wt.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(wt.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(wt.Error,`Result given for '${t}' method but server is not expecting a result.`)}_connectionClosed(e){this._logger.log(wt.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new ut("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===$t.Disconnecting?this._completeClose(e):this._connectionState===$t.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===$t.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=$t.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(wt.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(wt.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this._completeClose(e);if(this._connectionState=$t.Reconnecting,e?this._logger.log(wt.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(wt.Information,"Connection reconnecting."),0!==this._reconnectingCallbacks.length){try{this._reconnectingCallbacks.forEach((t=>t.apply(this,[e])))}catch(t){this._logger.log(wt.Error,`An onreconnecting callback called with error '${e}' threw error '${t}'.`)}if(this._connectionState!==$t.Reconnecting)return void this._logger.log(wt.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;null!==o;){if(this._logger.log(wt.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!==$t.Reconnecting)return void this._logger.log(wt.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this._startInternal(),this._connectionState=$t.Connected,this._logger.log(wt.Information,"HubConnection reconnected successfully."),0!==this._reconnectedCallbacks.length)try{this._reconnectedCallbacks.forEach((e=>e.apply(this,[this.connection.connectionId])))}catch(e){this._logger.log(wt.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${e}'.`)}return}catch(e){if(this._logger.log(wt.Information,`Reconnect attempt failed because of error '${e}'.`),this._connectionState!==$t.Reconnecting)return this._logger.log(wt.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this._connectionState===$t.Disconnecting&&this._completeClose());r=e instanceof Error?e:new Error(e.toString()),o=this._getNextRetryDelay(n++,Date.now()-t,r)}}this._logger.log(wt.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(wt.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(wt.Error,`Stream 'error' callback called with '${e}' threw error: ${Rt(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:Ft.Invocation}:{arguments:t,target:e,type:Ft.Invocation};{const n=this._invocationId;return this._invocationId++,0!==r.length?{arguments:t,invocationId:n.toString(),streamIds:r,target:e,type:Ft.Invocation}:{arguments:t,invocationId:n.toString(),target:e,type:Ft.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 fn,gn=cn?new TextDecoder:null,mn=cn?"undefined"!=typeof process&&"force"!==(null===(rn=null===process||void 0===process?void 0:process.env)||void 0===rn?void 0:rn.TEXT_DECODER)?200:0:on,yn=function(e,t){this.type=e,this.data=t},wn=(fn=function(e,t){return fn=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])},fn(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}fn(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),vn=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 wn(t,e),t}(Error),bn={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),sn(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:an(t,4),nsec:t.getUint32(0)};default:throw new vn("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(e.length))}}(e);return new Date(1e3*t.sec+t.nsec/1e6)}},_n=function(){function e(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(bn)}return e.prototype.register=function(e){var t=e.type,n=e.encode,r=e.decode;if(t>=0)this.encoders[t]=n,this.decoders[t]=r;else{var o=1+t;this.builtInEncoders[o]=n,this.builtInDecoders[o]=r}},e.prototype.tryToEncode=function(e,t){for(var n=0;nthis.maxDepth)throw new Error("Too deep objects in depth ".concat(t));null==e?this.encodeNil():"boolean"==typeof e?this.encodeBoolean(e):"number"==typeof e?this.encodeNumber(e):"string"==typeof e?this.encodeString(e):this.encodeObject(e,t)},e.prototype.ensureBufferSizeToWrite=function(e){var t=this.pos+e;this.view.byteLength=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):(this.writeU8(211),this.writeI64(e)):this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))},e.prototype.writeStringHeader=function(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else{if(!(e<4294967296))throw new Error("Too long string: ".concat(e," bytes in UTF-8"));this.writeU8(219),this.writeU32(e)}},e.prototype.encodeString=function(e){if(e.length>dn){var t=ln(e);this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),un(e,this.bytes,this.pos),this.pos+=t}else t=ln(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: ".concat(Object.prototype.toString.apply(e)));this.encodeMap(e,t)}},e.prototype.encodeBinary=function(e){var t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too large binary: ".concat(t));this.writeU8(198),this.writeU32(t)}var n=En(e);this.writeU8a(n)},e.prototype.encodeArray=function(e,t){var n=e.length;if(n<16)this.writeU8(144+n);else if(n<65536)this.writeU8(220),this.writeU16(n);else{if(!(n<4294967296))throw new Error("Too large array: ".concat(n));this.writeU8(221),this.writeU32(n)}for(var r=0,o=e;r0&&e<=this.maxKeyLength},e.prototype.find=function(e,t,n){e:for(var r=0,o=this.caches[n-1];r=this.maxLengthPerKey?n[Math.random()*n.length|0]=r:n.push(r)},e.prototype.decode=function(e,t,n){var r=this.find(e,t,n);if(null!=r)return this.hit++,r;this.miss++;var o=pn(e,t,n),i=Uint8Array.prototype.slice.call(e,t,t+n);return this.store(i,o),o},e}(),Nn=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]=e},e.prototype.createExtraByteError=function(e){var t=this.view,n=this.pos;return new RangeError("Extra ".concat(t.byteLength-n," of ").concat(t.byteLength," byte(s) found at buffer[").concat(e,"]"))},e.prototype.decode=function(e){this.reinitializeState(),this.setBuffer(e);var t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t},e.prototype.decodeMulti=function(e){return Nn(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,d,u;return Nn(this,(function(p){switch(p.label){case 0:i=!1,p.label=1;case 1:p.trys.push([1,6,7,12]),t=An(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 Mn))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,d=l.pos,u=l.totalPos,new RangeError("Insufficient data in parsing ".concat(Cn(h)," at ").concat(u," (").concat(d," 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 function(n,r,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,s=function(){var n,r,o,i,s,a,c,l,h;return Nn(this,(function(d){switch(d.label){case 0:n=t,r=-1,d.label=1;case 1:d.trys.push([1,13,14,19]),o=An(e),d.label=2;case 2:return[4,Rn(o.next())];case 3:if((i=d.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()),d.label=4;case 4:d.trys.push([4,9,,10]),d.label=5;case 5:return[4,Rn(this.doDecodeSync())];case 6:return[4,d.sent()];case 7:return d.sent(),0==--r?[3,8]:[3,5];case 8:return[3,10];case 9:if(!((a=d.sent())instanceof Mn))throw a;return[3,10];case 10:this.totalPos+=this.pos,d.label=11;case 11:return[3,2];case 12:return[3,19];case 13:return c=d.sent(),l={error:c},[3,19];case 14:return d.trys.push([14,,17,18]),i&&!i.done&&(h=o.return)?[4,Rn(h.call(o))]:[3,16];case 15:d.sent(),d.label=16;case 16:return[3,18];case 17:if(l)throw l.error;return[7];case 18:return[7];case 19:return[2]}}))}.apply(n,r||[]),a=[];return i={},c("next"),c("throw"),c("return"),i[Symbol.asyncIterator]=function(){return this},i;function c(e){s[e]&&(i[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||l(e,t)}))})}function l(e,t){try{(n=s[e](t)).value instanceof Rn?Promise.resolve(n.value.v).then(h,d):u(a[0][2],n)}catch(e){u(a[0][3],e)}var n}function h(e){l("next",e)}function d(e){l("throw",e)}function u(e,t){e(t),a.shift(),a.length&&l(a[0][0],a[0][1])}}(this,arguments)},e.prototype.doDecodeSync=function(){e:for(;;){var e=this.readHeadByte(),t=void 0;if(e>=224)t=e-256;else if(e<192)if(e<128)t=e;else if(e<144){if(0!=(r=e-128)){this.pushMapState(r),this.complete();continue e}t={}}else if(e<160){if(0!=(r=e-144)){this.pushArrayState(r),this.complete();continue e}t=[]}else{var n=e-160;t=this.decodeUtf8String(n,0)}else if(192===e)t=null;else if(194===e)t=!1;else if(195===e)t=!0;else if(202===e)t=this.readF32();else if(203===e)t=this.readF64();else if(204===e)t=this.readU8();else if(205===e)t=this.readU16();else if(206===e)t=this.readU32();else if(207===e)t=this.readU64();else if(208===e)t=this.readI8();else if(209===e)t=this.readI16();else if(210===e)t=this.readI32();else if(211===e)t=this.readI64();else if(217===e)n=this.lookU8(),t=this.decodeUtf8String(n,1);else if(218===e)n=this.lookU16(),t=this.decodeUtf8String(n,2);else if(219===e)n=this.lookU32(),t=this.decodeUtf8String(n,4);else if(220===e){if(0!==(r=this.readU16())){this.pushArrayState(r),this.complete();continue e}t=[]}else if(221===e){if(0!==(r=this.readU32())){this.pushArrayState(r),this.complete();continue e}t=[]}else if(222===e){if(0!==(r=this.readU16())){this.pushMapState(r),this.complete();continue e}t={}}else if(223===e){if(0!==(r=this.readU32())){this.pushMapState(r),this.complete();continue e}t={}}else if(196===e){var r=this.lookU8();t=this.decodeBinary(r,1)}else if(197===e)r=this.lookU16(),t=this.decodeBinary(r,2);else if(198===e)r=this.lookU32(),t=this.decodeBinary(r,4);else if(212===e)t=this.decodeExtension(1,0);else if(213===e)t=this.decodeExtension(2,0);else if(214===e)t=this.decodeExtension(4,0);else if(215===e)t=this.decodeExtension(8,0);else if(216===e)t=this.decodeExtension(16,0);else if(199===e)r=this.lookU8(),t=this.decodeExtension(r,1);else if(200===e)r=this.lookU16(),t=this.decodeExtension(r,2);else{if(201!==e)throw new vn("Unrecognized type byte: ".concat(Cn(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 vn("The type of key must be string or number but "+typeof t);if("__proto__"===t)throw new vn("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 vn("Unrecognized array type byte: ".concat(Cn(e)))}},e.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw new vn("Max length exceeded: map length (".concat(e,") > maxMapLengthLength (").concat(this.maxMapLength,")"));this.stack.push({type:1,size:e,key:null,readCount:0,map:{}})},e.prototype.pushArrayState=function(e){if(e>this.maxArrayLength)throw new vn("Max length exceeded: array length (".concat(e,") > maxArrayLength (").concat(this.maxArrayLength,")"));this.stack.push({type:0,size:e,array:new Array(e),position:0})},e.prototype.decodeUtf8String=function(e,t){var n;if(e>this.maxStrLength)throw new vn("Max length exceeded: UTF-8 byte length (".concat(e,") > maxStrLength (").concat(this.maxStrLength,")"));if(this.bytes.byteLengthmn?function(e,t,n){var r=e.subarray(t,t+n);return gn.decode(r)}(this.bytes,o,e):pn(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 vn("Max length exceeded: bin length (".concat(e,") > maxBinLength (").concat(this.maxBinLength,")"));if(!this.hasRemaining(e+t))throw Ln;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 vn("Max length exceeded: ext length (".concat(e,") > maxExtLength (").concat(this.maxExtLength,")"));var n=this.view.getInt8(this.pos+t),r=this.decodeBinary(e,t+1);return this.extensionCodec.decode(r,n,this.context)},e.prototype.lookU8=function(){return this.view.getUint8(this.pos)},e.prototype.lookU16=function(){return this.view.getUint16(this.pos)},e.prototype.lookU32=function(){return this.view.getUint32(this.pos)},e.prototype.readU8=function(){var e=this.view.getUint8(this.pos);return this.pos++,e},e.prototype.readI8=function(){var e=this.view.getInt8(this.pos);return this.pos++,e},e.prototype.readU16=function(){var e=this.view.getUint16(this.pos);return this.pos+=2,e},e.prototype.readI16=function(){var e=this.view.getInt16(this.pos);return this.pos+=2,e},e.prototype.readU32=function(){var e=this.view.getUint32(this.pos);return this.pos+=4,e},e.prototype.readI32=function(){var e=this.view.getInt32(this.pos);return this.pos+=4,e},e.prototype.readU64=function(){var e,t,n=(e=this.view,t=this.pos,4294967296*e.getUint32(t)+e.getUint32(t+4));return this.pos+=8,n},e.prototype.readI64=function(){var e=an(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}();!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"}(In||(In={})),function(e){e[e.None=0]="None",e[e.WebSockets=1]="WebSockets",e[e.ServerSentEvents=2]="ServerSentEvents",e[e.LongPolling=4]="LongPolling"}(kn||(kn={})),function(e){e[e.Text=1]="Text",e[e.Binary=2]="Binary"}(Tn||(Tn={}));class Fn{constructor(){}log(e,t){}}Fn.instance=new Fn,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"}(Dn||(Dn={}));class $n{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 Hn=new Uint8Array([145,In.Ping]);class jn{constructor(e){this.name="messagepack",this.version=1,this.transferFormat=Tn.Binary,this._errorResult=1,this._voidResult=2,this._nonVoidResult=3,e=e||{},this._encoder=new Sn(e.extensionCodec,e.context,e.maxDepth,e.initialBufferSize,e.sortKeys,e.forceFloat32,e.ignoreUndefined,e.forceIntegerToFloat),this._decoder=new On(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=Fn.instance);const r=$n.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 In.Invocation:return this._writeInvocation(e);case In.StreamInvocation:return this._writeStreamInvocation(e);case In.StreamItem:return this._writeStreamItem(e);case In.Completion:return this._writeCompletion(e);case In.Ping:return $n.write(Hn);case In.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 In.Invocation:return this._createInvocationMessage(this._readHeaders(n),n);case In.StreamItem:return this._createStreamItemMessage(this._readHeaders(n),n);case In.Completion:return this._createCompletionMessage(this._readHeaders(n),n);case In.Ping:return this._createPingMessage(n);case In.Close:return this._createCloseMessage(n);default:return t.log(Dn.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:In.Close}}_createPingMessage(e){if(e.length<1)throw new Error("Invalid payload for Ping message.");return{type:In.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:In.Invocation}:{arguments:t[4],headers:e,streamIds:[],target:t[3],type:In.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:In.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:In.Completion}}_writeInvocation(e){let t;return t=e.streamIds?this._encoder.encode([In.Invocation,e.headers||{},e.invocationId||null,e.target,e.arguments,e.streamIds]):this._encoder.encode([In.Invocation,e.headers||{},e.invocationId||null,e.target,e.arguments]),$n.write(t.slice())}_writeStreamInvocation(e){let t;return t=e.streamIds?this._encoder.encode([In.StreamInvocation,e.headers||{},e.invocationId,e.target,e.arguments,e.streamIds]):this._encoder.encode([In.StreamInvocation,e.headers||{},e.invocationId,e.target,e.arguments]),$n.write(t.slice())}_writeStreamItem(e){const t=this._encoder.encode([In.StreamItem,e.headers||{},e.invocationId,e.item]);return $n.write(t.slice())}_writeCompletion(e){const t=e.error?this._errorResult:void 0!==e.result?this._nonVoidResult:this._voidResult;let n;switch(t){case this._errorResult:n=this._encoder.encode([In.Completion,e.headers||{},e.invocationId,t,e.error]);break;case this._voidResult:n=this._encoder.encode([In.Completion,e.headers||{},e.invocationId,t]);break;case this._nonVoidResult:n=this._encoder.encode([In.Completion,e.headers||{},e.invocationId,t,e.result])}return $n.write(n.slice())}_writeCancelInvocation(e){const t=this._encoder.encode([In.CancelInvocation,e.headers||{},e.invocationId]);return $n.write(t.slice())}_readHeaders(e){const t=e[1];if("object"!=typeof t)throw new Error("Invalid headers.");return t}}let Wn=!1;function zn(){const e=document.querySelector("#blazor-error-ui");e&&(e.style.display="block"),Wn||(Wn=!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 Jn="function"==typeof TextDecoder?new TextDecoder("utf-8"):null,qn=Jn?Jn.decode.bind(Jn):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("")},Kn=Math.pow(2,32),Vn=Math.pow(2,21)-1;function Xn(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}function Gn(e,t){return e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24>>>0)}function Yn(e,t){const n=Gn(e,t+4);if(n>Vn)throw new Error(`Cannot read uint64 with high order part ${n}, because the result would exceed Number.MAX_SAFE_INTEGER.`);return n*Kn+Gn(e,t)}class Qn{constructor(e){this.batchData=e;const t=new nr(e);this.arrayRangeReader=new rr(e),this.arrayBuilderSegmentReader=new or(e),this.diffReader=new Zn(e),this.editReader=new er(e,t),this.frameReader=new tr(e,t)}updatedComponents(){return Xn(this.batchData,this.batchData.length-20)}referenceFrames(){return Xn(this.batchData,this.batchData.length-16)}disposedComponentIds(){return Xn(this.batchData,this.batchData.length-12)}disposedEventHandlerIds(){return Xn(this.batchData,this.batchData.length-8)}updatedComponentsEntry(e,t){const n=e+4*t;return Xn(this.batchData,n)}referenceFramesEntry(e,t){return e+20*t}disposedComponentIdsEntry(e,t){const n=e+4*t;return Xn(this.batchData,n)}disposedEventHandlerIdsEntry(e,t){const n=e+8*t;return Yn(this.batchData,n)}}class Zn{constructor(e){this.batchDataUint8=e}componentId(e){return Xn(this.batchDataUint8,e)}edits(e){return e+4}editsEntry(e,t){return e+16*t}}class er{constructor(e,t){this.batchDataUint8=e,this.stringReader=t}editType(e){return Xn(this.batchDataUint8,e)}siblingIndex(e){return Xn(this.batchDataUint8,e+4)}newTreeIndex(e){return Xn(this.batchDataUint8,e+8)}moveToSiblingIndex(e){return Xn(this.batchDataUint8,e+8)}removedAttributeName(e){const t=Xn(this.batchDataUint8,e+12);return this.stringReader.readString(t)}}class tr{constructor(e,t){this.batchDataUint8=e,this.stringReader=t}frameType(e){return Xn(this.batchDataUint8,e)}subtreeLength(e){return Xn(this.batchDataUint8,e+4)}elementReferenceCaptureId(e){const t=Xn(this.batchDataUint8,e+4);return this.stringReader.readString(t)}componentId(e){return Xn(this.batchDataUint8,e+8)}elementName(e){const t=Xn(this.batchDataUint8,e+8);return this.stringReader.readString(t)}textContent(e){const t=Xn(this.batchDataUint8,e+4);return this.stringReader.readString(t)}markupContent(e){const t=Xn(this.batchDataUint8,e+4);return this.stringReader.readString(t)}attributeName(e){const t=Xn(this.batchDataUint8,e+4);return this.stringReader.readString(t)}attributeValue(e){const t=Xn(this.batchDataUint8,e+8);return this.stringReader.readString(t)}attributeEventHandlerId(e){return Yn(this.batchDataUint8,e+12)}}class nr{constructor(e){this.batchDataUint8=e,this.stringTableStartIndex=Xn(e,e.length-4)}readString(e){if(-1===e)return null;{const n=Xn(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(ir.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(ir.Debug,`Waiting for batch ${this.nextBatchId}. Batch ${e} not processed.`);try{this.nextBatchId++,this.logger.log(ir.Debug,`Applying batch ${e}.`),ve(this.browserRendererId,new Qn(t)),await this.completeBatch(n,e)}catch(t){throw this.fatalError=t.toString(),this.logger.log(ir.Error,`There was an error applying batch ${e}.`),n.send("OnRenderCompleted",e,t.toString()),t}}getLastBatchid(){return this.nextBatchId-1}async completeBatch(e,t){try{await e.send("OnRenderCompleted",t,null)}catch{this.logger.log(ir.Warning,`Failed to deliver completion notification for render '${t}'.`)}}}class ar{log(e,t){}}ar.instance=new ar;class cr{constructor(e){this.minLevel=e}log(e,t){if(e>=this.minLevel){const n=`[${(new Date).toISOString()}] ${ir[e]}: ${t}`;switch(e){case ir.Critical:case ir.Error:console.error(n);break;case ir.Warning:console.warn(n);break;case ir.Information:console.info(n);break;default:console.log(n)}}}}class lr{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!==$t.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!==$t.Connected)return!1;const t=await e.invoke("StartCircuit",Me.getBaseURI(),Me.getLocationHref(),JSON.stringify(this.components.map((e=>e.toRecord()))),this.applicationState||"");return!!t&&(this.initialize(t),!0)}resolveElement(e){const t=v(e);if(t)return $(t,!0);const n=Number.parseInt(e);if(!Number.isNaN(n))return F(this.components[n].start,this.components[n].end);throw new Error(`Invalid sequence number or identifier '${e}'.`)}}const hr={configureSignalR:e=>{},logLevel:ir.Warning,reconnectionOptions:{maxRetries:8,retryIntervalMilliseconds:2e4,dialogId:"components-reconnect-modal"}};class dr{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 rt.reconnect()||this.rejected()}catch(e){this.logger.log(ir.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 ur{constructor(e,t,n){this.dialog=e,this.maxRetries=t,this.document=n,this.document=n;const r=this.document.getElementById(ur.MaxRetriesId);r&&(r.innerText=this.maxRetries.toString())}show(){this.removeClasses(),this.dialog.classList.add(ur.ShowClassName)}update(e){const t=this.document.getElementById(ur.CurrentAttemptId);t&&(t.innerText=e.toString())}hide(){this.removeClasses(),this.dialog.classList.add(ur.HideClassName)}failed(){this.removeClasses(),this.dialog.classList.add(ur.FailedClassName)}rejected(){this.removeClasses(),this.dialog.classList.add(ur.RejectedClassName)}removeClasses(){this.dialog.classList.remove(ur.ShowClassName,ur.HideClassName,ur.FailedClassName,ur.RejectedClassName)}}ur.ShowClassName="components-reconnect-show",ur.HideClassName="components-reconnect-hide",ur.FailedClassName="components-reconnect-failed",ur.RejectedClassName="components-reconnect-rejected",ur.MaxRetriesId="components-reconnect-max-retries",ur.CurrentAttemptId="components-reconnect-current-attempt";class pr{constructor(e,t,n){this._currentReconnectionProcess=null,this._logger=e,this._reconnectionDisplay=t,this._reconnectCallback=n||rt.reconnect}onConnectionDown(e,t){if(!this._reconnectionDisplay){const t=document.getElementById(e.dialogId);this._reconnectionDisplay=t?new ur(t,e.maxRetries,document):new dr(e.dialogId,e.maxRetries,document,this._logger)}this._currentReconnectionProcess||(this._currentReconnectionProcess=new fr(e,this._logger,this._reconnectCallback,this._reconnectionDisplay))}onConnectionUp(){this._currentReconnectionProcess&&(this._currentReconnectionProcess.dispose(),this._currentReconnectionProcess=null)}}class fr{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;tfr.MaximumFirstRetryInterval?fr.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(ir.Error,e)}}this.reconnectDisplay.failed()}delay(e){return new Promise((t=>setTimeout(t,e)))}}function gr(e,t){switch(t){case"webassembly":return function(e){const t=wr(e,"webassembly"),n=[];for(let e=0;ee.id-t.id))}(e);case"server":return function(e){const t=wr(e,"server"),n=[];for(let e=0;ee.sequence-t.sequence))}(e)}}fr.MaximumFirstRetryInterval=3e3;const mr=/^\s*Blazor-Component-State:(?[a-zA-Z0-9+/=]+)$/;function yr(e){var t;if(e.nodeType===Node.COMMENT_NODE){const n=e.textContent||"",r=mr.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 br(e,t){const n=e.currentElement;if(n&&n.nodeType===Node.COMMENT_NODE&&n.textContent){const r=vr.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,l=c?_r(c,n):void 0;if(c&&!l)throw new Error(`Could not find an end component comment for '${t}'.`);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.");return{type:r,assembly:o,typeName:i,parameterDefinitions:s&&atob(s),parameterValues:a&&atob(a),start:t,prerenderId:c,end:l}}}(r,n,e);case"server":return function(e,t,n){const{type:r,descriptor:o,sequence:i,prerenderId:s}=e,a=s?_r(s,n):void 0;if(s&&!a)throw new Error(`Could not find an end component comment for '${t}'.`);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)}'`);return{type:r,sequence:i,descriptor:o,start:t,prerenderId:s,end:a}}}(r,n,e)}}catch(e){throw new Error(`Found malformed component comment at ${n.textContent}`)}}}function _r(e,t){for(;t.next()&&t.currentElement;){const n=t.currentElement;if(n.nodeType!==Node.COMMENT_NODE)continue;if(!n.textContent)continue;const r=vr.exec(n.textContent),o=r&&r[1];if(o)return Er(o,e),n}}function Er(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 Sr{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 I,await Promise.all(this.afterStartedCallbacks.map((t=>t(e))))}}let Tr,Dr,xr,Nr,Ar=!1;async function Rr(e,t,n){var r,o;const i=new jn;i.name="blazorpack";const s=(new en).withUrl("_blazor").withHubProtocol(i);e.configureSignalR(s);const a=s.build();a.on("JS.AttachComponent",((e,t)=>we(0,n.resolveElement(t),e,!1))),a.on("JS.BeginInvokeJS",xr.beginInvokeJSFromDotNet.bind(xr)),a.on("JS.EndInvokeDotNet",xr.endInvokeDotNetFromJS.bind(xr)),a.on("JS.ReceiveByteArray",xr.receiveByteArray.bind(xr)),a.on("JS.BeginTransmitStream",(e=>{const t=new ReadableStream({start(t){a.stream("SendDotNetStreamToJS",e).subscribe({next:e=>t.enqueue(e),complete:()=>t.close(),error:e=>t.error(e)})}});xr.supplyDotNetStream(e,t)}));const c=sr.getOrCreate(t);a.on("JS.RenderBatch",((e,n)=>{t.log(ir.Debug,`Received render batch with id ${e} and ${n.byteLength} bytes.`),c.processBatch(e,n,a)})),a.on("JS.EndLocationChanging",rt._internal.navigationManager.endLocationChanging),a.onclose((t=>!Ar&&e.reconnectionHandler.onConnectionDown(e.reconnectionOptions,t))),a.on("JS.Error",(e=>{Ar=!0,Pr(a,e,t),zn()}));try{await a.start(),Tr=a}catch(e){if(Pr(a,e,t),"FailedToNegotiateWithServerError"===e.errorType)throw e;zn(),e.innerErrors&&(e.innerErrors.some((e=>"UnsupportedTransportError"===e.errorType&&e.transport===Bt.WebSockets))?t.log(ir.Error,"Unable to connect, please ensure you are using an updated browser that supports WebSockets."):e.innerErrors.some((e=>"FailedToStartTransportError"===e.errorType&&e.transport===Bt.WebSockets))?t.log(ir.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===Bt.LongPolling))&&t.log(ir.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===(o=null===(r=a.connection)||void 0===r?void 0:r.features)||void 0===o?void 0:o.inherentKeepAlive)&&t.log(ir.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."),a}function Pr(e,t,n){n.log(ir.Error,t),e&&e.stop()}function Ur(e){return Nr=e,Nr}var Mr,Lr;const Br=navigator,Or=Br.userAgentData&&Br.userAgentData.brands,Fr=Or&&Or.length>0?Or.some((e=>"Google Chrome"===e.brand||"Microsoft Edge"===e.brand||"Chromium"===e.brand)):window.chrome,$r=null!==(Lr=null===(Mr=Br.userAgentData)||void 0===Mr?void 0:Mr.platform)&&void 0!==Lr?Lr:navigator.platform;let Hr,jr,Wr,zr,Jr,qr,Kr=!1,Vr=!1;function Xr(){return(Kr||Vr)&&(Fr||navigator.userAgent.includes("Firefox"))}const Gr=Math.pow(2,32),Yr=Math.pow(2,21)-1;let Qr=null,Zr="Production";function eo(e){return jr.getI32(e)}const to={start:function(t){return async function(t){const n={},{dotnet:r}=await async function(e){if("undefined"==typeof WebAssembly||!WebAssembly.validate)throw new Error("This browser does not support WebAssembly.");const t=await async function(e,t){const n=void 0!==e?e("manifest","blazor.boot.json","_framework/blazor.boot.json",""):i("_framework/blazor.boot.json");let r;r=n?"string"==typeof n?await i(n):await n:await i("_framework/blazor.boot.json"),Zr=t||r.headers.get("Blazor-Environment")||"Production";const o=await r.json();return o.modifiableAssemblies=r.headers.get("DOTNET-MODIFIABLE-ASSEMBLIES"),o.aspnetCoreBrowserTools=r.headers.get("ASPNETCORE-BROWSER-TOOLS"),o;function i(e){return fetch(e,{method:"GET",credentials:"include",cache:"no-cache"})}}(e.loadBootResource,e.environment),n=Object.keys(t.resources.runtime).filter((e=>e.startsWith("dotnet.")&&e.endsWith(".js")))[0],r=t.resources.runtime[n];let o=`_framework/${n}`;if(e.loadBootResource){const t="dotnetjs",i=e.loadBootResource(t,n,o,r);if("string"==typeof i)o=i;else if(i)throw new Error(`For a ${t} resource, custom loaders must supply a URI string.`)}if(t.cacheBootResources){const e=document.createElement("link");e.rel="modulepreload",e.href=o,e.crossOrigin="anonymous",e.integrity=r,document.head.appendChild(e)}const i=new URL(o,document.baseURI).toString();return await import(i)}(t),o=function(e,t){const n={maxParallelDownloads:1e6,enableDownloadRetry:!1,applicationEnvironment:Zr},r={...window.Module||{},onConfigLoaded:async n=>{n.environmentVariables||(n.environmentVariables={}),0===n.icuDataMode&&(n.environmentVariables.__BLAZOR_SHARDED_ICU="1"),n.aspnetCoreBrowserTools&&(n.environmentVariables.__ASPNETCORE_BROWSER_TOOLS=n.aspnetCoreBrowserTools),rt._internal.getApplicationEnvironment=()=>n.applicationEnvironment,t.jsInitializer=await async function(e,t){const n=e.resources.libraryInitializers,r=new kr;return n&&await r.importInitializersAsync(Object.keys(n),[t,e.resources.extensions]),r}(n,e)},onDownloadResourceProgress:no,config:n,disableDotnet6Compatibility:!1,print:oo,printErr:io};return r}(t,n);r.withStartupOptions(t).withModuleConfig(o),qr=await r.create();const{MONO:i,BINDING:s,Module:a,setModuleImports:c,INTERNAL:l}=qr;Wr=a,Hr=s,jr=i,Jr=l;const h=Jr.resourceLoader;n.resourceLoader=h,function(e){Kr=!!e.bootConfig.resources.pdb,Vr=e.bootConfig.debugBuild;const t=$r.match(/^Mac/i)?"Cmd":"Alt";Xr()&&console.info(`Debugging hotkey: Shift+${t}+D (when application has focus)`),document.addEventListener("keydown",(e=>{e.shiftKey&&(e.metaKey||e.altKey)&&"KeyD"===e.code&&(Vr||Kr?navigator.userAgent.includes("Firefox")?async function(){const e=await fetch(`_framework/debug?url=${encodeURIComponent(location.href)}&isFirefox=true`);200!==e.status&&console.warn(await e.text())}():Fr?function(){const e=document.createElement("a");e.href=`_framework/debug?url=${encodeURIComponent(location.href)}`,e.target="_blank",e.rel="noopener noreferrer",e.click()}():console.error("Currently, only Microsoft Edge (80+), Google Chrome, or Chromium, are supported for debugging."):console.error("Cannot start debugging, because the application was not compiled with debugging enabled."))}))}(h),rt._internal.dotNetCriticalError=io,rt._internal.loadLazyAssembly=e=>async function(e,t){const n=e.bootConfig.resources,r=n.lazyAssembly;if(!r)throw new Error("No assemblies have been marked as lazy-loadable. Use the 'BlazorWebAssemblyLazyLoad' item group in your project file to enable lazy loading an assembly.");if(!r.hasOwnProperty(t))throw new Error(`${t} must be marked with 'BlazorWebAssemblyLazyLoad' item group in your project file to allow lazy-loading.`);const o=t,i=function(e,t){const n=e.lastIndexOf(".");if(n<0)throw new Error(`No extension to replace in '${e}'`);return e.substr(0,n)+".pdb"}(t),s=Xr()&&n.pdb&&r.hasOwnProperty(i),a=e.loadResource(o,`_framework/${o}`,r[o],"assembly").response.then((e=>e.arrayBuffer()));if(s){const t=await e.loadResource(i,`_framework/${i}`,r[i],"pdb").response.then((e=>e.arrayBuffer())),[n,o]=await Promise.all([a,t]);return{dll:new Uint8Array(n),pdb:new Uint8Array(o)}}{const e=await a;return{dll:new Uint8Array(e),pdb:null}}}(Jr.resourceLoader,e),rt._internal.loadSatelliteAssemblies=(e,t)=>async function(e,t,n){const r=e.bootConfig.resources.satelliteResources;r&&await Promise.all(t.filter((e=>r.hasOwnProperty(e))).map((t=>e.loadResources(r[t],(e=>`_framework/${e}`),"assembly"))).reduce(((e,t)=>e.concat(t)),new Array).map((async e=>{const t=await e.response,r=await t.arrayBuffer(),o={dll:new Uint8Array(r)};n(o)})))}(h,e,t),c("blazor-internal",{Blazor:{_internal:rt._internal}});const d=await qr.getAssemblyExports("Microsoft.AspNetCore.Components.WebAssembly");return Object.assign(rt._internal,{dotNetExports:{...d.Microsoft.AspNetCore.Components.WebAssembly.Services.DefaultWebAssemblyJSRuntime}}),zr=e.attachDispatcher({beginInvokeDotNetFromJS:(e,t,n,r,o)=>{if(ao(),!r&&!t)throw new Error("Either assemblyName or dotNetObjectId must have a non null value.");const i=r?r.toString():t;rt._internal.dotNetExports.BeginInvokeDotNet(e?e.toString():null,i,n,o)},endInvokeJSFromDotNet:(e,t,n)=>{rt._internal.dotNetExports.EndInvokeJS(n)},sendByteArray:(e,t)=>{rt._internal.dotNetExports.ReceiveByteArrayFromJS(e,t)},invokeDotNetFromJS:(e,t,n,r)=>(ao(),rt._internal.dotNetExports.InvokeDotNet(e||null,t,null!=n?n:0,r))}),n}(t)},callEntryPoint:async function(e){try{await qr.runMain(e,[])}catch(e){console.error(e),zn()}},toUint8Array:function(e){const t=so(e),n=eo(t),r=new Uint8Array(n);return r.set(Wr.HEAPU8.subarray(t+4,t+4+n)),r},getArrayLength:function(e){return eo(so(e))},getArrayEntryPtr:function(e,t,n){return so(e)+4+t*n},getObjectFieldsBaseAddress:function(e){return e+8},readInt16Field:function(e,t){return n=e+(t||0),jr.getI16(n);var n},readInt32Field:function(e,t){return eo(e+(t||0))},readUint64Field:function(e,t){return function(e){const t=e>>2,n=Wr.HEAPU32[t+1];if(n>Yr)throw new Error(`Cannot read uint64 with high order part ${n}, because the result would exceed Number.MAX_SAFE_INTEGER.`);return n*Gr+Wr.HEAPU32[t]}(e+(t||0))},readFloatField:function(e,t){return n=e+(t||0),jr.getF32(n);var n},readObjectField:function(e,t){return eo(e+(t||0))},readStringField:function(e,t,n){const r=eo(e+(t||0));if(0===r)return null;if(n){const e=Hr.unbox_mono_obj(r);return"boolean"==typeof e?e?"":null:e}return Hr.conv_string(r)},readStructField:function(e,t){return e+(t||0)},beginHeapLock:function(){return ao(),Qr=co.create(),Qr},invokeWhenHeapUnlocked:function(e){Qr?Qr.enqueuePostReleaseAction(e):e()}};function no(e,t){const n=e/t*100;document.documentElement.style.setProperty("--blazor-load-percentage",`${n}%`),document.documentElement.style.setProperty("--blazor-load-percentage-text",`"${Math.floor(n)}%"`)}const ro=["DEBUGGING ENABLED"],oo=e=>ro.indexOf(e)<0&&console.log(e),io=e=>{console.error(e||"(null)"),zn()};function so(e){return e+12}function ao(){if(Qr)throw new Error("Assertion failed - heap is currently locked")}class co{enqueuePostReleaseAction(e){this.postReleaseActions||(this.postReleaseActions=[]),this.postReleaseActions.push(e)}release(){var e;if(Qr!==this)throw new Error("Trying to release a lock which isn't current");for(Jr.mono_wasm_gc_unlock(),Qr=null;null===(e=this.postReleaseActions)||void 0===e?void 0:e.length;)this.postReleaseActions.shift()(),ao()}static create(){return Jr.mono_wasm_gc_lock(),new co}}class lo{constructor(e){this.batchAddress=e,this.arrayRangeReader=ho,this.arrayBuilderSegmentReader=uo,this.diffReader=po,this.editReader=fo,this.frameReader=go}updatedComponents(){return Nr.readStructField(this.batchAddress,0)}referenceFrames(){return Nr.readStructField(this.batchAddress,ho.structLength)}disposedComponentIds(){return Nr.readStructField(this.batchAddress,2*ho.structLength)}disposedEventHandlerIds(){return Nr.readStructField(this.batchAddress,3*ho.structLength)}updatedComponentsEntry(e,t){return mo(e,t,po.structLength)}referenceFramesEntry(e,t){return mo(e,t,go.structLength)}disposedComponentIdsEntry(e,t){const n=mo(e,t,4);return Nr.readInt32Field(n)}disposedEventHandlerIdsEntry(e,t){const n=mo(e,t,8);return Nr.readUint64Field(n)}}const ho={structLength:8,values:e=>Nr.readObjectField(e,0),count:e=>Nr.readInt32Field(e,4)},uo={structLength:12,values:e=>{const t=Nr.readObjectField(e,0),n=Nr.getObjectFieldsBaseAddress(t);return Nr.readObjectField(n,0)},offset:e=>Nr.readInt32Field(e,4),count:e=>Nr.readInt32Field(e,8)},po={structLength:4+uo.structLength,componentId:e=>Nr.readInt32Field(e,0),edits:e=>Nr.readStructField(e,4),editsEntry:(e,t)=>mo(e,t,fo.structLength)},fo={structLength:20,editType:e=>Nr.readInt32Field(e,0),siblingIndex:e=>Nr.readInt32Field(e,4),newTreeIndex:e=>Nr.readInt32Field(e,8),moveToSiblingIndex:e=>Nr.readInt32Field(e,8),removedAttributeName:e=>Nr.readStringField(e,16)},go={structLength:36,frameType:e=>Nr.readInt16Field(e,4),subtreeLength:e=>Nr.readInt32Field(e,8),elementReferenceCaptureId:e=>Nr.readStringField(e,16),componentId:e=>Nr.readInt32Field(e,12),elementName:e=>Nr.readStringField(e,16),textContent:e=>Nr.readStringField(e,16),markupContent:e=>Nr.readStringField(e,16),attributeName:e=>Nr.readStringField(e,16),attributeValue:e=>Nr.readStringField(e,24,!0),attributeEventHandlerId:e=>Nr.readUint64Field(e,8)};function mo(e,t,n){return Nr.getArrayEntryPtr(e,t,n)}class yo{constructor(e){this.preregisteredComponents=e;const t={};for(let n=0;n=n&&s>=r&&o(e.item(i),t.item(s))===Co.None;)i--,s--,a++;return a}(e,t,r,r,n),i=function(e){var t;const n=[];let r=e.length-1,o=(null===(t=e[r])||void 0===t?void 0:t.length)-1;for(;r>0||o>0;){const t=0===r?Io.Insert:0===o?Io.Delete:e[r][o];switch(n.unshift(t),t){case Io.Keep:case Io.Update:r--,o--;break;case Io.Insert:o--;break;case Io.Delete:r--}}return n}(function(e,t,n){const r=[],o=[],i=e.length,s=t.length;if(0===i&&0===s)return[];for(let e=0;e<=i;e++)(r[e]=Array(s+1))[0]=e,o[e]=Array(s+1);const a=r[0];for(let e=1;e<=s;e++)a[e]=e;for(let a=1;a<=i;a++)for(let i=1;i<=s;i++){const s=n(e.item(a-1),t.item(i-1)),c=r[a-1][i]+1,l=r[a][i-1]+1;let h;switch(s){case Co.None:h=r[a-1][i-1];break;case Co.Some:h=r[a-1][i-1]+1;break;case Co.Infinite:h=Number.MAX_VALUE}h{};function Uo(){document.removeEventListener("click",Mo),document.removeEventListener("submit",Bo),window.removeEventListener("popstate",Lo)}function Mo(e){ke()||Ee(e,(e=>{history.pushState(null,"",e),Oo(e)}))}function Lo(e){ke()||Oo(location.href)}function Bo(e){if(ke()||e.defaultPrevented)return;const t=e.target;if(t instanceof HTMLFormElement){e.preventDefault();const n=new URL(t.action),r={method:t.method},o=new FormData(t),i=e.submitter;i&&i.name&&o.append(i.name,i.value),"get"===r.method?n.search=new URLSearchParams(o).toString():r.body=o,Oo(n.toString(),r)}}async function Oo(e,t){null==Ro||Ro.abort(),Ro=new AbortController;const n=Ro.signal,r=fetch(e,Object.assign({signal:n,headers:{"blazor-enhanced-nav":"on"}},t));if(await async function(e,t,n,r){let o;try{o=await e;const t=o.headers.get("blazor-enhanced-nav-redirect-location");if(t)return void location.replace(t);if(!o.body)return void n(o,"");const r=o.headers.get("ssr-framing");if(!r){const e=await o.text();return void n(o,e)}let i=!0;await o.body.pipeThrough(new TextDecoderStream).pipeThrough(function(e){let t="";return new TransformStream({transform(n,r){if(t+=n,t.indexOf(e,t.length-n.length-e.length)>=0){const n=t.split(e);n.slice(0,-1).forEach((e=>r.enqueue(e))),t=n[n.length-1]}},flush(e){t&&e.enqueue(t)}})}(`\x3c!--${r}--\x3e`)).pipeTo(new WritableStream({write(e){i?(i=!1,n(o,e)):(e=>{const t=document.createRange().createContextualFragment(e);for(;t.firstChild;)document.body.appendChild(t.firstChild)})(e)}}))}catch(e){if("AbortError"===e.name&&t.aborted)return;throw e}}(r,n,((n,r)=>{n.redirected&&(history.replaceState(null,"",n.url),e=n.url);const o=n.headers.get("content-type");if(null==o?void 0:o.startsWith("text/html")){const e=(new DOMParser).parseFromString(r,"text/html");To(document,e)}else(null==o?void 0:o.startsWith("text/"))?Fo(r):(n.status<200||n.status>=300)&&!r?Fo(`Error: ${n.status} ${n.statusText}`):(null==t?void 0:t.method)&&"get"!==t.method?Fo(`Error: ${t.method} request to ${e} returned non-HTML content of type ${o||"unspecified"}.`):(history.replaceState(null,"",e+"?"),location.replace(e))})),!n.aborted){Po();const t=e.indexOf("#");if(t>=0){const n=e.substring(t+1),r=document.getElementById(n);null==r||r.scrollIntoView()}}}function Fo(e){document.documentElement.textContent=e;const t=document.documentElement.style;t.fontFamily="consolas, monospace",t.whiteSpace="pre-wrap",t.padding="1rem"}let $o=!0;class Ho extends HTMLElement{connectedCallback(){var e;null===(e=this.parentNode)||void 0===e||e.removeChild(this);const t=this.attachShadow({mode:"open"}),n=document.createElement("slot");t.appendChild(n),n.addEventListener("slotchange",(e=>{this.childNodes.forEach((e=>{if(e instanceof HTMLTemplateElement){const t=e.getAttribute("blazor-component-id");if(t)!function(e,t){const n=function(e){const t=`bl:${e}`,n=document.createNodeIterator(document,NodeFilter.SHOW_COMMENT);let r=null;for(;(r=n.nextNode())&&r.textContent!==t;);if(!r)return null;const o=`/bl:${e}`;let i=null;for(;(i=n.nextNode())&&i.textContent!==o;);return i?{startMarker:r,endMarker:i}:null}(e);if(n)if($o)To({startExclusive:n.startMarker,endExclusive:n.endMarker},t);else{const{startMarker:e,endMarker:r}=n,o=new Range;for(o.setStart(e,e.textContent.length),o.setEnd(r,0),o.deleteContents();t.childNodes[0];)r.parentNode.insertBefore(t.childNodes[0],r)}}(t,e.content);else switch(e.getAttribute("type")){case"redirection":const t=e.content.textContent;Se(t)?(history.replaceState(null,"",t),Oo(t)):location.replace(t);break;case"error":Fo(e.content.textContent||"Error")}}}))}))}}let jo,Wo=!1;async function zo(e){var t;if(Wo)throw new Error("Blazor has already started.");Wo=!0,jo=e,function(e){(null==e?void 0:e.disableDomPreservation)&&($o=!1),customElements.define("blazor-ssr",Ho)}(null==e?void 0:e.ssr),(null===(t=null==e?void 0:e.ssr)||void 0===t?void 0:t.disableDomPreservation)||(Po=Jo,document.addEventListener("click",Mo),document.addEventListener("submit",Bo),window.addEventListener("popstate",Lo)),await Jo()}async function Jo(){const t=gr(document,"server"),n=gr(document,"webassembly");t.length&&(Uo(),await async function(t,n){const r=function(e){const t={...hr,...e};return e&&e.reconnectionOptions&&(t.reconnectionOptions={...hr.reconnectionOptions,...e.reconnectionOptions}),t}(t),o=await async function(e){const t=await fetch("_blazor/initializers",{method:"GET",credentials:"include",cache:"no-cache"}),n=await t.json(),r=new kr;return await r.importInitializersAsync(n,[e]),r}(r),i=new cr(r.logLevel);rt.reconnect=async e=>{if(Ar)return!1;const t=e||await Rr(r,i,Dr);return await Dr.reconnect(t)?(r.reconnectionHandler.onConnectionUp(),!0):(i.log(ir.Information,"Reconnection attempt to the circuit was rejected by the server. This may indicate that the associated state is no longer available on the server."),!1)},rt.defaultReconnectionHandler=new pr(i),r.reconnectionHandler=r.reconnectionHandler||rt.defaultReconnectionHandler,i.log(ir.Information,"Starting up Blazor server-side application.");const s=yr(document);Dr=new lr(n||[],s||""),rt._internal.navigationManager.listenForNavigationEvents(((e,t,n)=>Tr.send("OnLocationChanged",e,t,n)),((e,t,n,r)=>Tr.send("OnLocationChanging",e,t,n,r))),rt._internal.forceCloseConnection=()=>Tr.stop(),rt._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)}(Tr,e,t,n),xr=e.attachDispatcher({beginInvokeDotNetFromJS:(e,t,n,r,o)=>{Tr.send("BeginInvokeDotNetFromJS",e?e.toString():null,t,n,r||0,o)},endInvokeJSFromDotNet:(e,t,n)=>{Tr.send("EndInvokeJSFromDotNet",e,t,n)},sendByteArray:(e,t)=>{Tr.send("ReceiveByteArray",e,t)}});const a=await Rr(r,i,Dr);if(!await Dr.startCircuit(a))return void i.log(ir.Error,"Failed to start the circuit.");let c=!1;const l=()=>{if(!c){const e=new FormData,t=Dr.circuitId;e.append("circuitId",t),c=navigator.sendBeacon("_blazor/disconnect",e)}};rt.disconnect=l,window.addEventListener("unload",l,{capture:!1,once:!0}),i.log(ir.Information,"Blazor server-side application started."),o.invokeAfterStartedCallbacks(rt)}(null==jo?void 0:jo.circuit,t)),n.length&&(Uo(),await async function(e,t){(function(){if(window.parent!==window&&!window.opener&&window.frameElement){const e=window.sessionStorage&&window.sessionStorage["Microsoft.AspNetCore.Components.WebAssembly.Authentication.CachedAuthSettings"],t=e&&JSON.parse(e);return t&&t.redirect_uri&&location.href.startsWith(t.redirect_uri)}return!1})()&&await new Promise((()=>{})),function(e){const t=D;D=(e,n,r)=>{((e,t,n)=>{const r=function(e){return me[e]}(e);r.eventDelegator.getHandler(t)&&to.invokeWhenHeapUnlocked(n)})(e,n,(()=>t(e,n,r)))}}(),rt._internal.applyHotReload=(e,t,n,r)=>{zr.invokeDotNetStaticMethod("Microsoft.AspNetCore.Components.WebAssembly","ApplyHotReloadDelta",e,t,n,r)},rt._internal.getApplyUpdateCapabilities=()=>zr.invokeDotNetStaticMethod("Microsoft.AspNetCore.Components.WebAssembly","GetApplyUpdateCapabilities"),rt._internal.invokeJSFromDotNet=wo,rt._internal.invokeJSJson=vo,rt._internal.endInvokeDotNetFromJS=bo,rt._internal.receiveWebAssemblyDotNetDataStream=_o,rt._internal.receiveByteArray=Eo;const n=Ur(to);rt.platform=n,rt._internal.renderBatch=(e,t)=>{const n=to.beginHeapLock();try{ve(e,new lo(t))}finally{n.release()}},rt._internal.navigationManager.listenForNavigationEvents((async(e,t,n)=>{await zr.invokeDotNetStaticMethodAsync("Microsoft.AspNetCore.Components.WebAssembly","NotifyLocationChanged",e,t,n)}),(async(e,t,n,r)=>{const o=await zr.invokeDotNetStaticMethodAsync("Microsoft.AspNetCore.Components.WebAssembly","NotifyLocationChangingAsync",t,n,r);rt._internal.navigationManager.endLocationChanging(e,o)}));const r=new yo(t||[]);let o,i;rt._internal.registeredComponents={getRegisteredComponentsCount:()=>r.getCount(),getId:e=>r.getId(e),getAssembly:e=>r.getAssembly(e),getTypeName:e=>r.getTypeName(e),getParameterDefinitions:e=>r.getParameterDefinitions(e)||"",getParameterValues:e=>r.getParameterValues(e)||""},rt._internal.getPersistedState=()=>yr(document)||"",rt._internal.attachRootComponentToElement=(e,t,n)=>{const o=r.resolveRegisteredElement(e);o?we(n,o,t,!1):function(e,t,n){const r="::before";let o=!1;if(e.endsWith("::after"))e=e.slice(0,-7),o=!0;else if(e.endsWith(r))throw new Error(`The '${r}' selector is not supported.`);const i=v(e)||document.querySelector(e);if(!i)throw new Error(`Could not find any element matching selector '${e}'.`);we(n||0,$(i,!0),t,o)}(e,t,n)};try{const t=await n.start(null!=e?e:{});o=t.resourceLoader,i=t.jsInitializer}catch(e){throw new Error(`Failed to start platform. Reason: ${e}`)}n.callEntryPoint(o.bootConfig.entryAssembly),i.invokeAfterStartedCallbacks(rt)}(null==jo?void 0:jo.webAssembly,n))}rt.start=zo,window.DotNet=e,document&&document.currentScript&&"false"!==document.currentScript.getAttribute("autostart")&&zo()})(); \ No newline at end of file diff --git a/src/Components/Web.JS/src/Rendering/StreamingRendering.ts b/src/Components/Web.JS/src/Rendering/StreamingRendering.ts index 50dc20186222..c804cfc80625 100644 --- a/src/Components/Web.JS/src/Rendering/StreamingRendering.ts +++ b/src/Components/Web.JS/src/Rendering/StreamingRendering.ts @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. import { SsrStartOptions } from "../Platform/SsrStartOptions"; -import { performEnhancedPageLoad } from "../Services/NavigationEnhancement"; +import { performEnhancedPageLoad, replaceDocumentWithPlainText } from "../Services/NavigationEnhancement"; import { isWithinBaseUriSpace } from "../Services/NavigationUtils"; import { synchronizeDomContent } from "./DomMerging/DomSync"; @@ -51,11 +51,7 @@ class BlazorStreamingUpdate extends HTMLElement { break; case 'error': // This is kind of brutal but matches what happens without progressive enhancement - document.documentElement.textContent = node.content.textContent; - const docStyle = document.documentElement.style; - docStyle.fontFamily = 'consolas, monospace'; - docStyle.whiteSpace = 'pre-wrap'; - docStyle.padding = '1rem'; + replaceDocumentWithPlainText(node.content.textContent || 'Error'); break; } } diff --git a/src/Components/Web.JS/src/Services/NavigationEnhancement.ts b/src/Components/Web.JS/src/Services/NavigationEnhancement.ts index ced2051c9dea..e5aa0101563e 100644 --- a/src/Components/Web.JS/src/Services/NavigationEnhancement.ts +++ b/src/Components/Web.JS/src/Services/NavigationEnhancement.ts @@ -33,16 +33,18 @@ let onDocumentUpdatedCallback: Function = () => {}; export function attachProgressivelyEnhancedNavigationListener(onDocumentUpdated: Function) { onDocumentUpdatedCallback = onDocumentUpdated; - document.body.addEventListener('click', onBodyClicked); + document.addEventListener('click', onDocumentClick); + document.addEventListener('submit', onDocumentSubmit); window.addEventListener('popstate', onPopState); } export function detachProgressivelyEnhancedNavigationListener() { - document.body.removeEventListener('click', onBodyClicked); + document.removeEventListener('click', onDocumentClick); + document.removeEventListener('submit', onDocumentSubmit); window.removeEventListener('popstate', onPopState); } -function onBodyClicked(event: MouseEvent) { +function onDocumentClick(event: MouseEvent) { if (hasInteractiveRouter()) { return; } @@ -61,7 +63,41 @@ function onPopState(state: PopStateEvent) { performEnhancedPageLoad(location.href); } -export async function performEnhancedPageLoad(internalDestinationHref: string) { +function onDocumentSubmit(event: SubmitEvent) { + if (hasInteractiveRouter() || event.defaultPrevented) { + return; + } + + // We need to be careful not to interfere with existing interactive forms. As it happens, EventDelegator always + // uses a capturing event handler for 'submit', so it will necessarily run before this handler, and so we won't + // even get here if there's an interactive submit (because it will have set defaultPrevented which we check above). + // However if we ever change that, we would need to change this code to integrate properly with EventDelegator + // to make sure this handler only ever runs after interactive handlers. + const formElem = event.target; + if (formElem instanceof HTMLFormElement) { + event.preventDefault(); + + const url = new URL(formElem.action); + const fetchOptions: RequestInit = { method: formElem.method }; + const formData = new FormData(formElem); + + // Replicate the normal behavior of appending the submitter name/value to the form data + const submitter = event.submitter as HTMLButtonElement; + if (submitter && submitter.name) { + formData.append(submitter.name, submitter.value); + } + + if (fetchOptions.method === 'get') { // method is always returned as lowercase + url.search = new URLSearchParams(formData as any).toString(); + } else { + fetchOptions.body = formData; + } + + performEnhancedPageLoad(url.toString(), fetchOptions); + } +} + +export async function performEnhancedPageLoad(internalDestinationHref: string, fetchOptions?: RequestInit) { // First, stop any preceding enhanced page load currentEnhancedNavigationAbortController?.abort(); @@ -69,10 +105,10 @@ export async function performEnhancedPageLoad(internalDestinationHref: string) { // framing boundaries to distinguish the initial document and each subsequent streaming SSR update. currentEnhancedNavigationAbortController = new AbortController(); const abortSignal = currentEnhancedNavigationAbortController.signal; - const responsePromise = fetch(internalDestinationHref, { + const responsePromise = fetch(internalDestinationHref, Object.assign({ signal: abortSignal, headers: { 'blazor-enhanced-nav': 'on' }, - }); + }, fetchOptions)); await getResponsePartsWithFraming(responsePromise, abortSignal, (response, initialContent) => { if (response.redirected) { @@ -81,21 +117,32 @@ export async function performEnhancedPageLoad(internalDestinationHref: string) { internalDestinationHref = response.url; } - if (response.headers.get('content-type')?.startsWith('text/html')) { + const responseContentType = response.headers.get('content-type'); + if (responseContentType?.startsWith('text/html')) { // For HTML responses, regardless of the status code, display it const parsedHtml = new DOMParser().parseFromString(initialContent, 'text/html'); synchronizeDomContent(document, parsedHtml); + } else if (responseContentType?.startsWith('text/')) { + // For any other text-based content, we'll just display it, because that's what + // would happen if this was a non-enhanced request. + replaceDocumentWithPlainText(initialContent); } else if ((response.status < 200 || response.status >= 300) && !initialContent) { // For any non-success response that has no content at all, make up our own error UI - document.documentElement.innerHTML = `Error: ${response.status} ${response.statusText}`; + replaceDocumentWithPlainText(`Error: ${response.status} ${response.statusText}`); } else { // For any other response, it's not HTML and we don't know what to do. It might be plain text, - // or an image, or something else. So fall back on a full reload, even though that means we - // have to request the content a second time. - // The ? trick here is the same workaround as described in #10839, and without it, the user - // would not be able to use the back button afterwards. - history.replaceState(null, '', internalDestinationHref + '?'); - location.replace(internalDestinationHref); + // or an image, or something else. + if (!fetchOptions?.method || fetchOptions.method === 'get') { + // If it's a get request, we'll trust that it's idempotent and cheap enough to request + // a second time, so we can fall back on a full reload. + // The ? trick here is the same workaround as described in #10839, and without it, the user + // would not be able to use the back button afterwards. + history.replaceState(null, '', internalDestinationHref + '?'); + location.replace(internalDestinationHref); + } else { + // For non-get requests, we can't safely re-request, so just treat it as an error + replaceDocumentWithPlainText(`Error: ${fetchOptions.method} request to ${internalDestinationHref} returned non-HTML content of type ${responseContentType || 'unspecified'}.`); + } } }, (streamingElementMarkup) => { @@ -178,6 +225,14 @@ async function getResponsePartsWithFraming(responsePromise: Promise, a } } +export function replaceDocumentWithPlainText(text: string) { + document.documentElement.textContent = text; + const docStyle = document.documentElement.style; + docStyle.fontFamily = 'consolas, monospace'; + docStyle.whiteSpace = 'pre-wrap'; + docStyle.padding = '1rem'; +} + function splitStream(frameBoundaryMarker: string) { let buffer = ''; diff --git a/src/Components/test/E2ETest/ServerRenderingTests/EnhancedNavigationTest.cs b/src/Components/test/E2ETest/ServerRenderingTests/EnhancedNavigationTest.cs index 60e20195e31d..8db7d01ba932 100644 --- a/src/Components/test/E2ETest/ServerRenderingTests/EnhancedNavigationTest.cs +++ b/src/Components/test/E2ETest/ServerRenderingTests/EnhancedNavigationTest.cs @@ -30,7 +30,7 @@ public override Task InitializeAsync() [Fact] public void CanNavigateToAnotherPageWhilePreservingCommonDOMElements() { - Navigate(ServerPathBase); + Navigate($"{ServerPathBase}/nav"); var h1Elem = Browser.Exists(By.TagName("h1")); Browser.Equal("Hello", () => h1Elem.Text); @@ -48,7 +48,7 @@ public void CanNavigateToAnotherPageWhilePreservingCommonDOMElements() [Fact] public void CanNavigateToAnHtmlPageWithAnErrorStatus() { - Navigate(ServerPathBase); + Navigate($"{ServerPathBase}/nav"); Browser.Exists(By.TagName("nav")).FindElement(By.LinkText("Error page with 404 content")).Click(); Browser.Equal("404", () => Browser.Exists(By.TagName("h1")).Text); } @@ -56,23 +56,23 @@ public void CanNavigateToAnHtmlPageWithAnErrorStatus() [Fact] public void DisplaysStatusCodeIfResponseIsErrorWithNoContent() { - Navigate(ServerPathBase); + Navigate($"{ServerPathBase}/nav"); Browser.Exists(By.TagName("nav")).FindElement(By.LinkText("Error page with no content")).Click(); - Browser.Equal("Error: 404 Not Found", () => Browser.Exists(By.TagName("body")).Text); + Browser.Equal("Error: 404 Not Found", () => Browser.Exists(By.TagName("html")).Text); } [Fact] public void CanNavigateToNonHtmlResponse() { - Navigate(ServerPathBase); + Navigate($"{ServerPathBase}/nav"); Browser.Exists(By.TagName("nav")).FindElement(By.LinkText("Non-HTML page")).Click(); - Browser.Equal("Hello, this is plain text", () => Browser.Exists(By.TagName("body")).Text); + Browser.Equal("Hello, this is plain text", () => Browser.Exists(By.TagName("html")).Text); } [Fact] public void ScrollsToHashWithContentAddedAsynchronously() { - Navigate(ServerPathBase); + Navigate($"{ServerPathBase}/nav"); Browser.Exists(By.TagName("nav")).FindElement(By.LinkText("Scroll to hash")).Click(); Assert.Equal(0, BrowserScrollY); @@ -84,7 +84,7 @@ public void ScrollsToHashWithContentAddedAsynchronously() [Fact] public void CanFollowSynchronousRedirection() { - Navigate(ServerPathBase); + Navigate($"{ServerPathBase}/nav"); var h1Elem = Browser.Exists(By.TagName("h1")); Browser.Equal("Hello", () => h1Elem.Text); @@ -96,18 +96,18 @@ public void CanFollowSynchronousRedirection() // here and instead use the same protocol it uses for external redirections. Browser.Exists(By.TagName("nav")).FindElement(By.LinkText("Redirect")).Click(); Browser.Equal("Scroll to hash", () => h1Elem.Text); - Assert.EndsWith("/subdir/scroll-to-hash", Browser.Url); + Assert.EndsWith("/subdir/nav/scroll-to-hash", Browser.Url); // See that 'back' takes you to the place from before the redirection Browser.Navigate().Back(); Browser.Equal("Hello", () => h1Elem.Text); - Assert.EndsWith("/subdir", Browser.Url); + Assert.EndsWith("/subdir/nav", Browser.Url); } [Fact] public void CanFollowAsynchronousRedirectionWhileStreaming() { - Navigate(ServerPathBase); + Navigate($"{ServerPathBase}/nav"); var h1Elem = Browser.Exists(By.TagName("h1")); Browser.Equal("Hello", () => h1Elem.Text); @@ -116,18 +116,18 @@ public void CanFollowAsynchronousRedirectionWhileStreaming() Browser.Exists(By.TagName("nav")).FindElement(By.LinkText("Redirect while streaming")).Click(); Browser.Equal("Scroll to hash", () => h1Elem.Text); Browser.True(() => BrowserScrollY > 500); - Assert.EndsWith("/subdir/scroll-to-hash#some-content", Browser.Url); + Assert.EndsWith("/subdir/nav/scroll-to-hash#some-content", Browser.Url); // See that 'back' takes you to the place from before the redirection Browser.Navigate().Back(); Browser.Equal("Hello", () => h1Elem.Text); - Assert.EndsWith("/subdir", Browser.Url); + Assert.EndsWith("/subdir/nav", Browser.Url); } [Fact] public void CanFollowSynchronousExternalRedirection() { - Navigate(ServerPathBase); + Navigate($"{ServerPathBase}/nav"); Browser.Equal("Hello", () => Browser.Exists(By.TagName("h1")).Text); Browser.Exists(By.TagName("nav")).FindElement(By.LinkText("Redirect external")).Click(); @@ -137,7 +137,7 @@ public void CanFollowSynchronousExternalRedirection() [Fact] public void CanFollowAsynchronousExternalRedirectionWhileStreaming() { - Navigate(ServerPathBase); + Navigate($"{ServerPathBase}/nav"); Browser.Equal("Hello", () => Browser.Exists(By.TagName("h1")).Text); Browser.Exists(By.TagName("nav")).FindElement(By.LinkText("Redirect external while streaming")).Click(); diff --git a/src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/FormWithParentBindingContextTest.cs b/src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/FormWithParentBindingContextTest.cs index d0799f139fd4..43d3ba18e4ce 100644 --- a/src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/FormWithParentBindingContextTest.cs +++ b/src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/FormWithParentBindingContextTest.cs @@ -12,11 +12,11 @@ namespace Microsoft.AspNetCore.Components.E2ETests.ServerRenderingTests.FormHandlingTests; -public class FormWithParentBindingContextTest : ServerTestBase>> +public class FormWithParentBindingContextTest : ServerTestBase>> { public FormWithParentBindingContextTest( BrowserFixture browserFixture, - BasicTestAppServerSiteFixture> serverFixture, + BasicTestAppServerSiteFixture> serverFixture, ITestOutputHelper output) : base(browserFixture, serverFixture, output) { @@ -25,20 +25,25 @@ public FormWithParentBindingContextTest( public override Task InitializeAsync() => InitializeAsync(BrowserFixture.StreamingContext); - [Fact] - public void CanDispatchToTheDefaultForm() + [Theory] + [InlineData(true)] + [InlineData(false)] + public void CanDispatchToTheDefaultForm(bool suppressEnhancedNavigation) { var dispatchToForm = new DispatchToForm(this) { Url = "forms/default-form", FormCssSelector = "form", ExpectedActionValue = null, + SuppressEnhancedNavigation = suppressEnhancedNavigation, }; DispatchToFormCore(dispatchToForm); } - [Fact] - public void CanDispatchToTheDefaultFormWithBody() + [Theory] + [InlineData(true)] + [InlineData(false)] + public void CanDispatchToTheDefaultFormWithBody(bool suppressEnhancedNavigation) { var dispatchToForm = new DispatchToForm(this) { @@ -46,12 +51,15 @@ public void CanDispatchToTheDefaultFormWithBody() FormCssSelector = "form", InputFieldValue = "stranger", ExpectedActionValue = null, + SuppressEnhancedNavigation = suppressEnhancedNavigation, }; DispatchToFormCore(dispatchToForm); } - [Fact] - public void CanBindParameterToTheDefaultForm() + [Theory] + [InlineData(true)] + [InlineData(false)] + public void CanBindParameterToTheDefaultForm(bool suppressEnhancedNavigation) { var dispatchToForm = new DispatchToForm(this) { @@ -61,12 +69,15 @@ public void CanBindParameterToTheDefaultForm() InputFieldId = "value", InputFieldCssSelector = "input[name=value]", InputFieldValue = "stranger", + SuppressEnhancedNavigation = suppressEnhancedNavigation, }; DispatchToFormCore(dispatchToForm); } - [Fact] - public void CanReadFormValuesDuringOnInitialized() + [Theory] + [InlineData(true)] + [InlineData(false)] + public void CanReadFormValuesDuringOnInitialized(bool suppressEnhancedNavigation) { var dispatchToForm = new DispatchToForm(this) { @@ -74,24 +85,30 @@ public void CanReadFormValuesDuringOnInitialized() FormCssSelector = "form", InputFieldValue = "stranger", ExpectedActionValue = null, + SuppressEnhancedNavigation = suppressEnhancedNavigation, }; DispatchToFormCore(dispatchToForm); } - [Fact] - public void CanDispatchToNamedForm() + [Theory] + [InlineData(true)] + [InlineData(false)] + public void CanDispatchToNamedForm(bool suppressEnhancedNavigation) { var dispatchToForm = new DispatchToForm(this) { Url = "forms/named-form", FormCssSelector = "form[name=named-form-handler]", ExpectedActionValue = "forms/named-form?handler=named-form-handler", + SuppressEnhancedNavigation = suppressEnhancedNavigation, }; DispatchToFormCore(dispatchToForm); } - [Fact] - public void CanBindFormValueFromNamedFormWithBody() + [Theory] + [InlineData(true)] + [InlineData(false)] + public void CanBindFormValueFromNamedFormWithBody(bool suppressEnhancedNavigation) { var dispatchToForm = new DispatchToForm(this) { @@ -101,24 +118,30 @@ public void CanBindFormValueFromNamedFormWithBody() InputFieldId = "value", InputFieldCssSelector = "input[name=value]", InputFieldValue = "stranger", + SuppressEnhancedNavigation = suppressEnhancedNavigation, }; DispatchToFormCore(dispatchToForm); } - [Fact] - public void CanDispatchToNamedFormInNestedContext() + [Theory] + [InlineData(true)] + [InlineData(false)] + public void CanDispatchToNamedFormInNestedContext(bool suppressEnhancedNavigation) { var dispatchToForm = new DispatchToForm(this) { Url = "forms/nested-named-form", FormCssSelector = "form[name=\"parent-context.named-form-handler\"]", ExpectedActionValue = "forms/nested-named-form?handler=parent-context.named-form-handler", + SuppressEnhancedNavigation = suppressEnhancedNavigation, }; DispatchToFormCore(dispatchToForm); } - [Fact] - public void CanBindFormValueFromNestedNamedFormWithBody() + [Theory] + [InlineData(true)] + [InlineData(false)] + public void CanBindFormValueFromNestedNamedFormWithBody(bool suppressEnhancedNavigation) { var dispatchToForm = new DispatchToForm(this) { @@ -128,18 +151,22 @@ public void CanBindFormValueFromNestedNamedFormWithBody() InputFieldId = "value", InputFieldCssSelector = "input[name=value]", InputFieldValue = "stranger", + SuppressEnhancedNavigation = suppressEnhancedNavigation, }; DispatchToFormCore(dispatchToForm); } - [Fact] - public void CanDispatchToFormDefinedInNonPageComponent() + [Theory] + [InlineData(true)] + [InlineData(false)] + public void CanDispatchToFormDefinedInNonPageComponent(bool suppressEnhancedNavigation) { var dispatchToForm = new DispatchToForm(this) { Url = "forms/form-defined-inside-component", FormCssSelector = "form", ExpectedActionValue = null, + SuppressEnhancedNavigation = suppressEnhancedNavigation, }; DispatchToFormCore(dispatchToForm); } @@ -157,8 +184,10 @@ public void CanRenderAmbiguousForms() DispatchToFormCore(dispatchToForm); } - [Fact] - public void DispatchingToAmbiguousFormFails() + [Theory] + [InlineData(true)] + [InlineData(false)] + public void DispatchingToAmbiguousFormFails(bool suppressEnhancedNavigation) { var dispatchToForm = new DispatchToForm(this) { @@ -167,8 +196,8 @@ public void DispatchingToAmbiguousFormFails() ExpectedActionValue = null, DispatchEvent = true, SubmitButtonId = "send-second", - // This is an error ID on the page chrome shows from a 500. - SubmitPassId = "main-frame-error" + ShouldCauseInternalServerError = true, + SuppressEnhancedNavigation = suppressEnhancedNavigation, }; DispatchToFormCore(dispatchToForm); } @@ -194,7 +223,7 @@ public void FormThatDisappearsBeforeQuiesceDoesNotBind() FormCssSelector = "form", ExpectedActionValue = null, SubmitButtonId = "test-send", - SubmitPassId = "main-frame-error" + ShouldCauseInternalServerError = true, }; DispatchToFormCore(dispatchToForm); } @@ -207,7 +236,7 @@ public void ChangingComponentsToDispatchBeforeQuiesceDoesNotBind() Url = "forms/switching-components-does-not-bind", FormCssSelector = "form", ExpectedActionValue = null, - SubmitPassId = "main-frame-error" + ShouldCauseInternalServerError = true, }; DispatchToFormCore(dispatchToForm); } @@ -279,6 +308,13 @@ public async Task CanHandleFormPostNonStreamingRenderingAsyncHandler() private void DispatchToFormCore(DispatchToForm dispatch) { + if (dispatch.SuppressEnhancedNavigation) + { + GoTo(""); + Browser.Equal("Hello", () => Browser.Exists(By.TagName("h1")).Text); + ((IJavaScriptExecutor)Browser).ExecuteScript("sessionStorage.setItem('suppress-enhanced-navigation', 'true')"); + } + GoTo(dispatch.Url); Browser.Exists(By.Id(dispatch.Ready)); @@ -304,10 +340,33 @@ private void DispatchToFormCore(DispatchToForm dispatch) Browser.Click(By.Id(dispatch.SubmitButtonId)); - var text = Browser.Exists(By.Id(dispatch.SubmitPassId)).Text; - if (dispatch.InputFieldValue != null) + if (dispatch.ShouldCauseInternalServerError) + { + if (dispatch.SuppressEnhancedNavigation) + { + // Chrome's built-in error UI for a 500 response when there's no response content + Browser.Exists(By.Id("main-frame-error")); + } + else + { + // The UI generated by enhanced nav when there's no response content + Browser.Contains("Error: 500", () => Browser.Exists(By.TagName("html")).Text); + } + } + else { - Assert.Equal($"Hello {dispatch.InputFieldValue}!", text); + var text = Browser.Exists(By.Id(dispatch.SubmitPassId)).Text; + if (dispatch.InputFieldValue != null) + { + Assert.Equal($"Hello {dispatch.InputFieldValue}!", text); + } + + if (!dispatch.SuppressEnhancedNavigation) + { + // Verify the same form element is still in the page + // We wouldn't be allowed to read the attribute if the element is stale + Assert.Equal(dispatch.ExpectedTarget, form.GetAttribute("action")); + } } } @@ -333,6 +392,8 @@ public DispatchToForm(FormWithParentBindingContextTest test) : this() public string SubmitButtonId { get; internal set; } = "send"; public string InputFieldId { get; internal set; } = "firstName"; public string InputFieldCssSelector { get; internal set; } = null; + public bool ShouldCauseInternalServerError { get; internal set; } + public bool SuppressEnhancedNavigation { get; internal set; } } private void GoTo(string relativePath) diff --git a/src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/FormWithoutBindingContextTest.cs b/src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/FormWithoutBindingContextTest.cs index 51c89583f9d6..24538f2e7f08 100644 --- a/src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/FormWithoutBindingContextTest.cs +++ b/src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/FormWithoutBindingContextTest.cs @@ -40,6 +40,6 @@ public void FormWithoutBindingContextDoesNotBind() Assert.Null(actionValue); Browser.Click(By.Id("send")); - Browser.Exists(By.Id("main-frame-error")); + Browser.Contains("Internal Server Error", () => Browser.FindElement(By.TagName("html")).Text); } } diff --git a/src/Components/test/E2ETest/ServerRenderingTests/StreamingRenderingTest.cs b/src/Components/test/E2ETest/ServerRenderingTests/StreamingRenderingTest.cs index 1a8103432408..215863d8c5db 100644 --- a/src/Components/test/E2ETest/ServerRenderingTests/StreamingRenderingTest.cs +++ b/src/Components/test/E2ETest/ServerRenderingTests/StreamingRenderingTest.cs @@ -43,7 +43,7 @@ public void CanPerformStreamingRendering(bool duringEnhancedNavigation) if (duringEnhancedNavigation) { - Navigate(ServerPathBase); + Navigate($"{ServerPathBase}/nav"); originalH1Elem = Browser.Exists(By.TagName("h1")); Browser.Equal("Hello", () => originalH1Elem.Text); Browser.Exists(By.TagName("nav")).FindElement(By.LinkText("Streaming")).Click(); @@ -90,7 +90,7 @@ public void RetainsDomNodesDuringStreamingRenderingUpdates(bool duringEnhancedNa if (duringEnhancedNavigation) { - Navigate(ServerPathBase); + Navigate($"{ServerPathBase}/nav"); originalH1Elem = Browser.Exists(By.TagName("h1")); Browser.Equal("Hello", () => originalH1Elem.Text); Browser.Exists(By.TagName("nav")).FindElement(By.LinkText("Streaming")).Click(); @@ -122,7 +122,7 @@ public void RetainsDomNodesDuringStreamingRenderingUpdates(bool duringEnhancedNa [Fact] public async Task DisplaysErrorThatOccursWhileStreaming() { - Navigate(ServerPathBase); + Navigate($"{ServerPathBase}/nav"); Browser.Equal("Hello", () => Browser.Exists(By.TagName("h1")).Text); Browser.Exists(By.TagName("nav")).FindElement(By.LinkText("Error while streaming")).Click(); @@ -134,6 +134,6 @@ public async Task DisplaysErrorThatOccursWhileStreaming() // See that 'back' still works Browser.Navigate().Back(); Browser.Equal("Hello", () => Browser.Exists(By.TagName("h1")).Text); - Assert.EndsWith("/subdir", Browser.Url); + Assert.EndsWith("/subdir/nav", Browser.Url); } } diff --git a/src/Components/test/testassets/Components.TestServer/RazorComponentEndpointsStartup.cs b/src/Components/test/testassets/Components.TestServer/RazorComponentEndpointsStartup.cs index 0108878e366e..3c4e60ff478e 100644 --- a/src/Components/test/testassets/Components.TestServer/RazorComponentEndpointsStartup.cs +++ b/src/Components/test/testassets/Components.TestServer/RazorComponentEndpointsStartup.cs @@ -65,10 +65,10 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) private static void MapEnhancedNavigationEndpoints(IEndpointRouteBuilder endpoints) { // Used when testing that enhanced nav can show non-HTML responses (which it does by doing a full navigation) - endpoints.Map("/non-html-response", () => "Hello, this is plain text"); + endpoints.Map("/nav/non-html-response", () => "Hello, this is plain text"); // Used when testing that enhanced nav displays content even if the response is an error status code - endpoints.Map("/give-404-with-content", async (HttpResponse response) => + endpoints.Map("/nav/give-404-with-content", async (HttpResponse response) => { response.StatusCode = 404; response.ContentType = "text/html"; diff --git a/src/Components/test/testassets/Components.TestServer/RazorComponents/App.razor b/src/Components/test/testassets/Components.TestServer/RazorComponents/App.razor index 0dead9f2a484..d1bd22b530f6 100644 --- a/src/Components/test/testassets/Components.TestServer/RazorComponents/App.razor +++ b/src/Components/test/testassets/Components.TestServer/RazorComponents/App.razor @@ -10,7 +10,7 @@ - + @@ -22,7 +22,12 @@ - - diff --git a/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/EnhancedNav/Index.razor b/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/EnhancedNav/Index.razor new file mode 100644 index 000000000000..4926c2e742f9 --- /dev/null +++ b/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/EnhancedNav/Index.razor @@ -0,0 +1,7 @@ +@page "/nav" + +Home + +

Hello

+ +

This is a Razor Component endpoint.

diff --git a/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/PageForScrollingToHash.razor b/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/EnhancedNav/PageForScrollingToHash.razor similarity index 94% rename from src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/PageForScrollingToHash.razor rename to src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/EnhancedNav/PageForScrollingToHash.razor index d246be3517ca..bbb5583d0d92 100644 --- a/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/PageForScrollingToHash.razor +++ b/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/EnhancedNav/PageForScrollingToHash.razor @@ -1,4 +1,4 @@ -@page "/scroll-to-hash" +@page "/nav/scroll-to-hash" @attribute [StreamRendering(true)] Page for scrolling to hash diff --git a/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/PageThatRedirects.razor b/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/EnhancedNav/PageThatRedirects.razor similarity index 63% rename from src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/PageThatRedirects.razor rename to src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/EnhancedNav/PageThatRedirects.razor index c4e7565d4e8b..9bf9a394fb3d 100644 --- a/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/PageThatRedirects.razor +++ b/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/EnhancedNav/PageThatRedirects.razor @@ -1,10 +1,10 @@ -@page "/do-redirection" +@page "/nav/do-redirection" @inject NavigationManager Nav @code { [Parameter, SupplyParameterFromQuery] public string Destination { get; set; } protected override void OnInitialized() { - Nav.NavigateTo(Destination ?? "scroll-to-hash#some-content"); + Nav.NavigateTo(Destination ?? "nav/scroll-to-hash#some-content"); } } diff --git a/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/PageThatRedirectsWhileStreaming.razor b/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/EnhancedNav/PageThatRedirectsWhileStreaming.razor similarity index 69% rename from src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/PageThatRedirectsWhileStreaming.razor rename to src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/EnhancedNav/PageThatRedirectsWhileStreaming.razor index d4ab14922df8..8eb3151a0a96 100644 --- a/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/PageThatRedirectsWhileStreaming.razor +++ b/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/EnhancedNav/PageThatRedirectsWhileStreaming.razor @@ -1,4 +1,4 @@ -@page "/do-redirection-while-streaming" +@page "/nav/do-redirection-while-streaming" @attribute [StreamRendering(true)] @inject NavigationManager Nav

Please wait...

@@ -8,6 +8,6 @@ protected override async Task OnInitializedAsync() { await Task.Delay(2000); - Nav.NavigateTo(Destination ?? "scroll-to-hash#some-content"); + Nav.NavigateTo(Destination ?? "nav/scroll-to-hash#some-content"); } } diff --git a/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/PageThatThrowsWhileStreaming.razor b/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/EnhancedNav/PageThatThrowsWhileStreaming.razor similarity index 86% rename from src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/PageThatThrowsWhileStreaming.razor rename to src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/EnhancedNav/PageThatThrowsWhileStreaming.razor index 11a8480717ef..8c1463cdd86f 100644 --- a/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/PageThatThrowsWhileStreaming.razor +++ b/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/EnhancedNav/PageThatThrowsWhileStreaming.razor @@ -1,4 +1,4 @@ -@page "/throw-while-streaming" +@page "/nav/throw-while-streaming" @attribute [StreamRendering(true)]

Please wait...

@code { diff --git a/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/EnhancedNav/_Imports.razor b/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/EnhancedNav/_Imports.razor new file mode 100644 index 000000000000..b16bca428b30 --- /dev/null +++ b/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/EnhancedNav/_Imports.razor @@ -0,0 +1 @@ +@layout Components.TestServer.RazorComponents.Shared.EnhancedNavLayout diff --git a/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/Forms/_Imports.razor b/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/Forms/_Imports.razor new file mode 100644 index 000000000000..3724991cc519 --- /dev/null +++ b/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/Forms/_Imports.razor @@ -0,0 +1 @@ +@layout Components.TestServer.RazorComponents.Shared.FormsLayout diff --git a/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/SectionsWithStreamingRendering.razor b/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/StreamingRendering/SectionsWithStreamingRendering.razor similarity index 100% rename from src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/SectionsWithStreamingRendering.razor rename to src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/StreamingRendering/SectionsWithStreamingRendering.razor diff --git a/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/StreamingRendering.razor b/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/StreamingRendering/StreamingRendering.razor similarity index 100% rename from src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/StreamingRendering.razor rename to src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/StreamingRendering/StreamingRendering.razor diff --git a/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/StreamingRendering/_Imports.razor b/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/StreamingRendering/_Imports.razor new file mode 100644 index 000000000000..b16bca428b30 --- /dev/null +++ b/src/Components/test/testassets/Components.TestServer/RazorComponents/Pages/StreamingRendering/_Imports.razor @@ -0,0 +1 @@ +@layout Components.TestServer.RazorComponents.Shared.EnhancedNavLayout diff --git a/src/Components/test/testassets/Components.TestServer/RazorComponents/Shared/EnhancedNavLayout.razor b/src/Components/test/testassets/Components.TestServer/RazorComponents/Shared/EnhancedNavLayout.razor new file mode 100644 index 000000000000..b1e0a8cc13ef --- /dev/null +++ b/src/Components/test/testassets/Components.TestServer/RazorComponents/Shared/EnhancedNavLayout.razor @@ -0,0 +1,16 @@ +@inherits LayoutComponentBase + +
+@Body diff --git a/src/Components/test/testassets/Components.TestServer/RazorComponents/Shared/MainLayout.razor b/src/Components/test/testassets/Components.TestServer/RazorComponents/Shared/MainLayout.razor deleted file mode 100644 index 6c7b9ce00e1c..000000000000 --- a/src/Components/test/testassets/Components.TestServer/RazorComponents/Shared/MainLayout.razor +++ /dev/null @@ -1,16 +0,0 @@ -@inherits LayoutComponentBase - -
-@Body