meldivo 2.4.3 → 2.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CeWj4ejR.js","assets/_commonjsHelpers-CqkleIqs.js","assets/browser-CujOq0-h.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var Zd=Object.defineProperty;var eh=(u,l,s)=>l in u?Zd(u,l,{enumerable:!0,configurable:!0,writable:!0,value:s}):u[l]=s;var te=(u,l,s)=>eh(u,typeof l!="symbol"?l+"":l,s);(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))c(d);new MutationObserver(d=>{for(const g of d)if(g.type==="childList")for(const x of g.addedNodes)x.tagName==="LINK"&&x.rel==="modulepreload"&&c(x)}).observe(document,{childList:!0,subtree:!0});function s(d){const g={};return d.integrity&&(g.integrity=d.integrity),d.referrerPolicy&&(g.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?g.credentials="include":d.crossOrigin==="anonymous"?g.credentials="omit":g.credentials="same-origin",g}function c(d){if(d.ep)return;d.ep=!0;const g=s(d);fetch(d.href,g)}})();var wu={exports:{}},Ni={},Su={exports:{}},we={};/**
|
|
3
|
-
* @license React
|
|
4
|
-
* react.production.min.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var tf;function th(){if(tf)return we;tf=1;var u=Symbol.for("react.element"),l=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),x=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),j=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),D=Symbol.iterator;function O(y){return y===null||typeof y!="object"?null:(y=D&&y[D]||y["@@iterator"],typeof y=="function"?y:null)}var $={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},J=Object.assign,le={};function N(y,T,ie){this.props=y,this.context=T,this.refs=le,this.updater=ie||$}N.prototype.isReactComponent={},N.prototype.setState=function(y,T){if(typeof y!="object"&&typeof y!="function"&&y!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,y,T,"setState")},N.prototype.forceUpdate=function(y){this.updater.enqueueForceUpdate(this,y,"forceUpdate")};function b(){}b.prototype=N.prototype;function G(y,T,ie){this.props=y,this.context=T,this.refs=le,this.updater=ie||$}var ge=G.prototype=new b;ge.constructor=G,J(ge,N.prototype),ge.isPureReactComponent=!0;var I=Array.isArray,Q=Object.prototype.hasOwnProperty,U={current:null},ne={key:!0,ref:!0,__self:!0,__source:!0};function me(y,T,ie){var ue,pe={},ye=null,ve=null;if(T!=null)for(ue in T.ref!==void 0&&(ve=T.ref),T.key!==void 0&&(ye=""+T.key),T)Q.call(T,ue)&&!ne.hasOwnProperty(ue)&&(pe[ue]=T[ue]);var ke=arguments.length-2;if(ke===1)pe.children=ie;else if(1<ke){for(var je=Array(ke),rt=0;rt<ke;rt++)je[rt]=arguments[rt+2];pe.children=je}if(y&&y.defaultProps)for(ue in ke=y.defaultProps,ke)pe[ue]===void 0&&(pe[ue]=ke[ue]);return{$$typeof:u,type:y,key:ye,ref:ve,props:pe,_owner:U.current}}function Se(y,T){return{$$typeof:u,type:y.type,key:T,ref:y.ref,props:y.props,_owner:y._owner}}function H(y){return typeof y=="object"&&y!==null&&y.$$typeof===u}function xe(y){var T={"=":"=0",":":"=2"};return"$"+y.replace(/[=:]/g,function(ie){return T[ie]})}var be=/\/+/g;function Je(y,T){return typeof y=="object"&&y!==null&&y.key!=null?xe(""+y.key):T.toString(36)}function qe(y,T,ie,ue,pe){var ye=typeof y;(ye==="undefined"||ye==="boolean")&&(y=null);var ve=!1;if(y===null)ve=!0;else switch(ye){case"string":case"number":ve=!0;break;case"object":switch(y.$$typeof){case u:case l:ve=!0}}if(ve)return ve=y,pe=pe(ve),y=ue===""?"."+Je(ve,0):ue,I(pe)?(ie="",y!=null&&(ie=y.replace(be,"$&/")+"/"),qe(pe,T,ie,"",function(rt){return rt})):pe!=null&&(H(pe)&&(pe=Se(pe,ie+(!pe.key||ve&&ve.key===pe.key?"":(""+pe.key).replace(be,"$&/")+"/")+y)),T.push(pe)),1;if(ve=0,ue=ue===""?".":ue+":",I(y))for(var ke=0;ke<y.length;ke++){ye=y[ke];var je=ue+Je(ye,ke);ve+=qe(ye,T,ie,je,pe)}else if(je=O(y),typeof je=="function")for(y=je.call(y),ke=0;!(ye=y.next()).done;)ye=ye.value,je=ue+Je(ye,ke++),ve+=qe(ye,T,ie,je,pe);else if(ye==="object")throw T=String(y),Error("Objects are not valid as a React child (found: "+(T==="[object Object]"?"object with keys {"+Object.keys(y).join(", ")+"}":T)+"). If you meant to render a collection of children, use an array instead.");return ve}function Ie(y,T,ie){if(y==null)return y;var ue=[],pe=0;return qe(y,ue,"","",function(ye){return T.call(ie,ye,pe++)}),ue}function Ue(y){if(y._status===-1){var T=y._result;T=T(),T.then(function(ie){(y._status===0||y._status===-1)&&(y._status=1,y._result=ie)},function(ie){(y._status===0||y._status===-1)&&(y._status=2,y._result=ie)}),y._status===-1&&(y._status=0,y._result=T)}if(y._status===1)return y._result.default;throw y._result}var _e={current:null},V={transition:null},se={ReactCurrentDispatcher:_e,ReactCurrentBatchConfig:V,ReactCurrentOwner:U};function W(){throw Error("act(...) is not supported in production builds of React.")}return we.Children={map:Ie,forEach:function(y,T,ie){Ie(y,function(){T.apply(this,arguments)},ie)},count:function(y){var T=0;return Ie(y,function(){T++}),T},toArray:function(y){return Ie(y,function(T){return T})||[]},only:function(y){if(!H(y))throw Error("React.Children.only expected to receive a single React element child.");return y}},we.Component=N,we.Fragment=s,we.Profiler=d,we.PureComponent=G,we.StrictMode=c,we.Suspense=L,we.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=se,we.act=W,we.cloneElement=function(y,T,ie){if(y==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+y+".");var ue=J({},y.props),pe=y.key,ye=y.ref,ve=y._owner;if(T!=null){if(T.ref!==void 0&&(ye=T.ref,ve=U.current),T.key!==void 0&&(pe=""+T.key),y.type&&y.type.defaultProps)var ke=y.type.defaultProps;for(je in T)Q.call(T,je)&&!ne.hasOwnProperty(je)&&(ue[je]=T[je]===void 0&&ke!==void 0?ke[je]:T[je])}var je=arguments.length-2;if(je===1)ue.children=ie;else if(1<je){ke=Array(je);for(var rt=0;rt<je;rt++)ke[rt]=arguments[rt+2];ue.children=ke}return{$$typeof:u,type:y.type,key:pe,ref:ye,props:ue,_owner:ve}},we.createContext=function(y){return y={$$typeof:x,_currentValue:y,_currentValue2:y,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},y.Provider={$$typeof:g,_context:y},y.Consumer=y},we.createElement=me,we.createFactory=function(y){var T=me.bind(null,y);return T.type=y,T},we.createRef=function(){return{current:null}},we.forwardRef=function(y){return{$$typeof:_,render:y}},we.isValidElement=H,we.lazy=function(y){return{$$typeof:K,_payload:{_status:-1,_result:y},_init:Ue}},we.memo=function(y,T){return{$$typeof:j,type:y,compare:T===void 0?null:T}},we.startTransition=function(y){var T=V.transition;V.transition={};try{y()}finally{V.transition=T}},we.unstable_act=W,we.useCallback=function(y,T){return _e.current.useCallback(y,T)},we.useContext=function(y){return _e.current.useContext(y)},we.useDebugValue=function(){},we.useDeferredValue=function(y){return _e.current.useDeferredValue(y)},we.useEffect=function(y,T){return _e.current.useEffect(y,T)},we.useId=function(){return _e.current.useId()},we.useImperativeHandle=function(y,T,ie){return _e.current.useImperativeHandle(y,T,ie)},we.useInsertionEffect=function(y,T){return _e.current.useInsertionEffect(y,T)},we.useLayoutEffect=function(y,T){return _e.current.useLayoutEffect(y,T)},we.useMemo=function(y,T){return _e.current.useMemo(y,T)},we.useReducer=function(y,T,ie){return _e.current.useReducer(y,T,ie)},we.useRef=function(y){return _e.current.useRef(y)},we.useState=function(y){return _e.current.useState(y)},we.useSyncExternalStore=function(y,T,ie){return _e.current.useSyncExternalStore(y,T,ie)},we.useTransition=function(){return _e.current.useTransition()},we.version="18.3.1",we}var nf;function Vu(){return nf||(nf=1,Su.exports=th()),Su.exports}/**
|
|
11
|
-
* @license React
|
|
12
|
-
* react-jsx-runtime.production.min.js
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var rf;function nh(){if(rf)return Ni;rf=1;var u=Vu(),l=Symbol.for("react.element"),s=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,d=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,g={key:!0,ref:!0,__self:!0,__source:!0};function x(_,L,j){var K,D={},O=null,$=null;j!==void 0&&(O=""+j),L.key!==void 0&&(O=""+L.key),L.ref!==void 0&&($=L.ref);for(K in L)c.call(L,K)&&!g.hasOwnProperty(K)&&(D[K]=L[K]);if(_&&_.defaultProps)for(K in L=_.defaultProps,L)D[K]===void 0&&(D[K]=L[K]);return{$$typeof:l,type:_,key:O,ref:$,props:D,_owner:d.current}}return Ni.Fragment=s,Ni.jsx=x,Ni.jsxs=x,Ni}var of;function rh(){return of||(of=1,wu.exports=nh()),wu.exports}var h=rh(),zl={},ku={exports:{}},At={},xu={exports:{}},Eu={};/**
|
|
19
|
-
* @license React
|
|
20
|
-
* scheduler.production.min.js
|
|
21
|
-
*
|
|
22
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the MIT license found in the
|
|
25
|
-
* LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/var lf;function oh(){return lf||(lf=1,(function(u){function l(V,se){var W=V.length;V.push(se);e:for(;0<W;){var y=W-1>>>1,T=V[y];if(0<d(T,se))V[y]=se,V[W]=T,W=y;else break e}}function s(V){return V.length===0?null:V[0]}function c(V){if(V.length===0)return null;var se=V[0],W=V.pop();if(W!==se){V[0]=W;e:for(var y=0,T=V.length,ie=T>>>1;y<ie;){var ue=2*(y+1)-1,pe=V[ue],ye=ue+1,ve=V[ye];if(0>d(pe,W))ye<T&&0>d(ve,pe)?(V[y]=ve,V[ye]=W,y=ye):(V[y]=pe,V[ue]=W,y=ue);else if(ye<T&&0>d(ve,W))V[y]=ve,V[ye]=W,y=ye;else break e}}return se}function d(V,se){var W=V.sortIndex-se.sortIndex;return W!==0?W:V.id-se.id}if(typeof performance=="object"&&typeof performance.now=="function"){var g=performance;u.unstable_now=function(){return g.now()}}else{var x=Date,_=x.now();u.unstable_now=function(){return x.now()-_}}var L=[],j=[],K=1,D=null,O=3,$=!1,J=!1,le=!1,N=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function ge(V){for(var se=s(j);se!==null;){if(se.callback===null)c(j);else if(se.startTime<=V)c(j),se.sortIndex=se.expirationTime,l(L,se);else break;se=s(j)}}function I(V){if(le=!1,ge(V),!J)if(s(L)!==null)J=!0,Ue(Q);else{var se=s(j);se!==null&&_e(I,se.startTime-V)}}function Q(V,se){J=!1,le&&(le=!1,b(me),me=-1),$=!0;var W=O;try{for(ge(se),D=s(L);D!==null&&(!(D.expirationTime>se)||V&&!xe());){var y=D.callback;if(typeof y=="function"){D.callback=null,O=D.priorityLevel;var T=y(D.expirationTime<=se);se=u.unstable_now(),typeof T=="function"?D.callback=T:D===s(L)&&c(L),ge(se)}else c(L);D=s(L)}if(D!==null)var ie=!0;else{var ue=s(j);ue!==null&&_e(I,ue.startTime-se),ie=!1}return ie}finally{D=null,O=W,$=!1}}var U=!1,ne=null,me=-1,Se=5,H=-1;function xe(){return!(u.unstable_now()-H<Se)}function be(){if(ne!==null){var V=u.unstable_now();H=V;var se=!0;try{se=ne(!0,V)}finally{se?Je():(U=!1,ne=null)}}else U=!1}var Je;if(typeof G=="function")Je=function(){G(be)};else if(typeof MessageChannel<"u"){var qe=new MessageChannel,Ie=qe.port2;qe.port1.onmessage=be,Je=function(){Ie.postMessage(null)}}else Je=function(){N(be,0)};function Ue(V){ne=V,U||(U=!0,Je())}function _e(V,se){me=N(function(){V(u.unstable_now())},se)}u.unstable_IdlePriority=5,u.unstable_ImmediatePriority=1,u.unstable_LowPriority=4,u.unstable_NormalPriority=3,u.unstable_Profiling=null,u.unstable_UserBlockingPriority=2,u.unstable_cancelCallback=function(V){V.callback=null},u.unstable_continueExecution=function(){J||$||(J=!0,Ue(Q))},u.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Se=0<V?Math.floor(1e3/V):5},u.unstable_getCurrentPriorityLevel=function(){return O},u.unstable_getFirstCallbackNode=function(){return s(L)},u.unstable_next=function(V){switch(O){case 1:case 2:case 3:var se=3;break;default:se=O}var W=O;O=se;try{return V()}finally{O=W}},u.unstable_pauseExecution=function(){},u.unstable_requestPaint=function(){},u.unstable_runWithPriority=function(V,se){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var W=O;O=V;try{return se()}finally{O=W}},u.unstable_scheduleCallback=function(V,se,W){var y=u.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?y+W:y):W=y,V){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=W+T,V={id:K++,callback:se,priorityLevel:V,startTime:W,expirationTime:T,sortIndex:-1},W>y?(V.sortIndex=W,l(j,V),s(L)===null&&V===s(j)&&(le?(b(me),me=-1):le=!0,_e(I,W-y))):(V.sortIndex=T,l(L,V),J||$||(J=!0,Ue(Q))),V},u.unstable_shouldYield=xe,u.unstable_wrapCallback=function(V){var se=O;return function(){var W=O;O=se;try{return V.apply(this,arguments)}finally{O=W}}}})(Eu)),Eu}var sf;function ih(){return sf||(sf=1,xu.exports=oh()),xu.exports}/**
|
|
27
|
-
* @license React
|
|
28
|
-
* react-dom.production.min.js
|
|
29
|
-
*
|
|
30
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
31
|
-
*
|
|
32
|
-
* This source code is licensed under the MIT license found in the
|
|
33
|
-
* LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/var uf;function lh(){if(uf)return At;uf=1;var u=Vu(),l=ih();function s(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var c=new Set,d={};function g(e,t){x(e,t),x(e+"Capture",t)}function x(e,t){for(d[e]=t,e=0;e<t.length;e++)c.add(t[e])}var _=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),L=Object.prototype.hasOwnProperty,j=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,K={},D={};function O(e){return L.call(D,e)?!0:L.call(K,e)?!1:j.test(e)?D[e]=!0:(K[e]=!0,!1)}function $(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function J(e,t,n,r){if(t===null||typeof t>"u"||$(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function le(e,t,n,r,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var N={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){N[e]=new le(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];N[t]=new le(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){N[e]=new le(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){N[e]=new le(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){N[e]=new le(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){N[e]=new le(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){N[e]=new le(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){N[e]=new le(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){N[e]=new le(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function G(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(b,G);N[t]=new le(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(b,G);N[t]=new le(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(b,G);N[t]=new le(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){N[e]=new le(e,1,!1,e.toLowerCase(),null,!1,!1)}),N.xlinkHref=new le("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){N[e]=new le(e,1,!1,e.toLowerCase(),null,!0,!0)});function ge(e,t,n,r){var o=N.hasOwnProperty(t)?N[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(J(t,n,o,r)&&(n=null),r||o===null?O(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var I=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Q=Symbol.for("react.element"),U=Symbol.for("react.portal"),ne=Symbol.for("react.fragment"),me=Symbol.for("react.strict_mode"),Se=Symbol.for("react.profiler"),H=Symbol.for("react.provider"),xe=Symbol.for("react.context"),be=Symbol.for("react.forward_ref"),Je=Symbol.for("react.suspense"),qe=Symbol.for("react.suspense_list"),Ie=Symbol.for("react.memo"),Ue=Symbol.for("react.lazy"),_e=Symbol.for("react.offscreen"),V=Symbol.iterator;function se(e){return e===null||typeof e!="object"?null:(e=V&&e[V]||e["@@iterator"],typeof e=="function"?e:null)}var W=Object.assign,y;function T(e){if(y===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);y=t&&t[1]||""}return`
|
|
35
|
-
`+y+e}var ie=!1;function ue(e,t){if(!e||ie)return"";ie=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(E){var r=E}Reflect.construct(e,[],t)}else{try{t.call()}catch(E){r=E}e.call(t.prototype)}else{try{throw Error()}catch(E){r=E}e()}}catch(E){if(E&&r&&typeof E.stack=="string"){for(var o=E.stack.split(`
|
|
36
|
-
`),i=r.stack.split(`
|
|
37
|
-
`),a=o.length-1,f=i.length-1;1<=a&&0<=f&&o[a]!==i[f];)f--;for(;1<=a&&0<=f;a--,f--)if(o[a]!==i[f]){if(a!==1||f!==1)do if(a--,f--,0>f||o[a]!==i[f]){var m=`
|
|
38
|
-
`+o[a].replace(" at new "," at ");return e.displayName&&m.includes("<anonymous>")&&(m=m.replace("<anonymous>",e.displayName)),m}while(1<=a&&0<=f);break}}}finally{ie=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?T(e):""}function pe(e){switch(e.tag){case 5:return T(e.type);case 16:return T("Lazy");case 13:return T("Suspense");case 19:return T("SuspenseList");case 0:case 2:case 15:return e=ue(e.type,!1),e;case 11:return e=ue(e.type.render,!1),e;case 1:return e=ue(e.type,!0),e;default:return""}}function ye(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ne:return"Fragment";case U:return"Portal";case Se:return"Profiler";case me:return"StrictMode";case Je:return"Suspense";case qe:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case xe:return(e.displayName||"Context")+".Consumer";case H:return(e._context.displayName||"Context")+".Provider";case be:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ie:return t=e.displayName||null,t!==null?t:ye(e.type)||"Memo";case Ue:t=e._payload,e=e._init;try{return ye(e(t))}catch{}}return null}function ve(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ye(t);case 8:return t===me?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ke(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function je(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function rt(e){var t=je(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Kn(e){e._valueTracker||(e._valueTracker=rt(e))}function xr(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=je(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ot(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Qn(e,t){var n=t.checked;return W({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function qn(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ke(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ut(e,t){t=t.checked,t!=null&&ge(e,"checked",t,!1)}function Er(e,t){ut(e,t);var n=ke(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Gn(e,t.type,n):t.hasOwnProperty("defaultValue")&&Gn(e,t.type,ke(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function vn(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Gn(e,t,n){(t!=="number"||Ot(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var gn=Array.isArray;function zt(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ke(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Rn(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(s(91));return W({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function bn(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(s(92));if(gn(n)){if(1<n.length)throw Error(s(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ke(n)}}function Yn(e,t){var n=ke(t.value),r=ke(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Dt(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function no(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function at(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?no(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Xn,ro=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Xn=Xn||document.createElement("div"),Xn.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Xn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function _r(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var yn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Wl=["Webkit","ms","Moz","O"];Object.keys(yn).forEach(function(e){Wl.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),yn[t]=yn[e]})});function vt(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||yn.hasOwnProperty(e)&&yn[e]?(""+t).trim():t+"px"}function oo(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=vt(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var ji=W({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Cr(e,t){if(t){if(ji[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(s(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(s(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(s(61))}if(t.style!=null&&typeof t.style!="object")throw Error(s(62))}}function io(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Wo=null;function gt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ho=null,_t=null,Mn=null;function Ri(e){if(e=fi(e)){if(typeof Ho!="function")throw Error(s(280));var t=e.stateNode;t&&(t=Xi(t),Ho(e.stateNode,e.type,t))}}function Ko(e){_t?Mn?Mn.push(e):Mn=[e]:_t=e}function Qo(){if(_t){var e=_t,t=Mn;if(Mn=_t=null,Ri(e),t)for(e=0;e<t.length;e++)Ri(t[e])}}function Fn(e,t){return e(t)}function Nr(){}var qo=!1;function Jn(e,t,n){if(qo)return e(t,n);qo=!0;try{return Fn(e,t,n)}finally{qo=!1,(_t!==null||Mn!==null)&&(Nr(),Qo())}}function Zn(e,t){var n=e.stateNode;if(n===null)return null;var r=Xi(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(s(231,t,typeof n));return n}var lo=!1;if(_)try{var Ln={};Object.defineProperty(Ln,"passive",{get:function(){lo=!0}}),window.addEventListener("test",Ln,Ln),window.removeEventListener("test",Ln,Ln)}catch{lo=!1}function Mi(e,t,n,r,o,i,a,f,m){var E=Array.prototype.slice.call(arguments,3);try{t.apply(n,E)}catch(F){this.onError(F)}}var er=!1,Ct=null,Pr=!1,tr=null,so={onError:function(e){er=!0,Ct=e}};function Go(e,t,n,r,o,i,a,f,m){er=!1,Ct=null,Mi.apply(so,arguments)}function Hl(e,t,n,r,o,i,a,f,m){if(Go.apply(this,arguments),er){if(er){var E=Ct;er=!1,Ct=null}else throw Error(s(198));Pr||(Pr=!0,tr=E)}}function An(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function nr(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Tr(e){if(An(e)!==e)throw Error(s(188))}function uo(e){var t=e.alternate;if(!t){if(t=An(e),t===null)throw Error(s(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return Tr(o),e;if(i===r)return Tr(o),t;i=i.sibling}throw Error(s(188))}if(n.return!==r.return)n=o,r=i;else{for(var a=!1,f=o.child;f;){if(f===n){a=!0,n=o,r=i;break}if(f===r){a=!0,r=o,n=i;break}f=f.sibling}if(!a){for(f=i.child;f;){if(f===n){a=!0,n=i,r=o;break}if(f===r){a=!0,r=i,n=o;break}f=f.sibling}if(!a)throw Error(s(189))}}if(n.alternate!==r)throw Error(s(190))}if(n.tag!==3)throw Error(s(188));return n.stateNode.current===n?e:t}function bo(e){return e=uo(e),e!==null?Yo(e):null}function Yo(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Yo(e);if(t!==null)return t;e=e.sibling}return null}var Xo=l.unstable_scheduleCallback,Zt=l.unstable_cancelCallback,Kt=l.unstable_shouldYield,en=l.unstable_requestPaint,Fe=l.unstable_now,ao=l.unstable_getCurrentPriorityLevel,It=l.unstable_ImmediatePriority,Ut=l.unstable_UserBlockingPriority,yt=l.unstable_NormalPriority,co=l.unstable_LowPriority,Ze=l.unstable_IdlePriority,On=null,$t=null;function wt(e){if($t&&typeof $t.onCommitFiberRoot=="function")try{$t.onCommitFiberRoot(On,e,void 0,(e.current.flags&128)===128)}catch{}}var St=Math.clz32?Math.clz32:Qt,Fi=Math.log,Kl=Math.LN2;function Qt(e){return e>>>=0,e===0?32:31-(Fi(e)/Kl|0)|0}var fo=64,zn=4194304;function jr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function rr(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var f=a&~o;f!==0?r=jr(f):(i&=a,i!==0&&(r=jr(i)))}else a=n&~o,a!==0?r=jr(a):i!==0&&(r=jr(i));if(r===0)return 0;if(t!==0&&t!==r&&(t&o)===0&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-St(t),o=1<<n,r|=e[n],t&=~o;return r}function Ql(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ql(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-St(i),f=1<<a,m=o[a];m===-1?((f&n)===0||(f&r)!==0)&&(o[a]=Ql(f,t)):m<=t&&(e.expiredLanes|=f),i&=~f}}function ct(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Rr(){var e=fo;return fo<<=1,(fo&4194240)===0&&(fo=64),e}function wn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function tn(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-St(t),e[t]=n}function nn(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-St(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function Jo(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-St(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var Ce=0;function Li(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Ai,Sn,ho,rn,Oi,Zo=!1,or=[],kn=null,xn=null,En=null,Mr=new Map,Fr=new Map,on=[],Gl="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function zi(e,t){switch(e){case"focusin":case"focusout":kn=null;break;case"dragenter":case"dragleave":xn=null;break;case"mouseover":case"mouseout":En=null;break;case"pointerover":case"pointerout":Mr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fr.delete(t.pointerId)}}function Lr(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=fi(t),t!==null&&Sn(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function ei(e,t,n,r,o){switch(t){case"focusin":return kn=Lr(kn,e,t,n,r,o),!0;case"dragenter":return xn=Lr(xn,e,t,n,r,o),!0;case"mouseover":return En=Lr(En,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Mr.set(i,Lr(Mr.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Fr.set(i,Lr(Fr.get(i)||null,e,t,n,r,o)),!0}return!1}function ln(e){var t=Br(e.target);if(t!==null){var n=An(t);if(n!==null){if(t=n.tag,t===13){if(t=nr(n),t!==null){e.blockedOn=t,Oi(e.priority,function(){ho(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Nt(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=zr(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Wo=r,n.target.dispatchEvent(r),Wo=null}else return t=fi(n),t!==null&&Sn(t),e.blockedOn=n,!1;t.shift()}return!0}function Ar(e,t,n){Nt(e)&&n.delete(t)}function Di(){Zo=!1,kn!==null&&Nt(kn)&&(kn=null),xn!==null&&Nt(xn)&&(xn=null),En!==null&&Nt(En)&&(En=null),Mr.forEach(Ar),Fr.forEach(Ar)}function Or(e,t){e.blockedOn===t&&(e.blockedOn=null,Zo||(Zo=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,Di)))}function ir(e){function t(o){return Or(o,e)}if(0<or.length){Or(or[0],e);for(var n=1;n<or.length;n++){var r=or[n];r.blockedOn===e&&(r.blockedOn=null)}}for(kn!==null&&Or(kn,e),xn!==null&&Or(xn,e),En!==null&&Or(En,e),Mr.forEach(t),Fr.forEach(t),n=0;n<on.length;n++)r=on[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<on.length&&(n=on[0],n.blockedOn===null);)ln(n),n.blockedOn===null&&on.shift()}var lr=I.ReactCurrentBatchConfig,po=!0;function bl(e,t,n,r){var o=Ce,i=lr.transition;lr.transition=null;try{Ce=1,ti(e,t,n,r)}finally{Ce=o,lr.transition=i}}function Yl(e,t,n,r){var o=Ce,i=lr.transition;lr.transition=null;try{Ce=4,ti(e,t,n,r)}finally{Ce=o,lr.transition=i}}function ti(e,t,n,r){if(po){var o=zr(e,t,n,r);if(o===null)as(e,t,r,mo,n),zi(e,r);else if(ei(o,e,t,n,r))r.stopPropagation();else if(zi(e,r),t&4&&-1<Gl.indexOf(e)){for(;o!==null;){var i=fi(o);if(i!==null&&Ai(i),i=zr(e,t,n,r),i===null&&as(e,t,r,mo,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else as(e,t,r,null,n)}}var mo=null;function zr(e,t,n,r){if(mo=null,e=gt(r),e=Br(e),e!==null)if(t=An(e),t===null)e=null;else if(n=t.tag,n===13){if(e=nr(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return mo=e,null}function Dr(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ao()){case It:return 1;case Ut:return 4;case yt:case co:return 16;case Ze:return 536870912;default:return 16}default:return 16}}var sn=null,vo=null,p=null;function S(){if(p)return p;var e,t=vo,n=t.length,r,o="value"in sn?sn.value:sn.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===o[i-r];r++);return p=o.slice(e,1<r?1-r:void 0)}function P(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function R(){return!0}function X(){return!1}function B(e){function t(n,r,o,i,a){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var f in e)e.hasOwnProperty(f)&&(n=e[f],this[f]=n?n(i):i[f]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?R:X,this.isPropagationStopped=X,this}return W(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=R)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=R)},persist:function(){},isPersistent:R}),t}var q={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fe=B(q),Me=W({},q,{view:0,detail:0}),Ne=B(Me),ot,Ke,Pe,ft=W({},Me,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$r,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Pe&&(Pe&&e.type==="mousemove"?(ot=e.screenX-Pe.screenX,Ke=e.screenY-Pe.screenY):Ke=ot=0,Pe=e),ot)},movementY:function(e){return"movementY"in e?e.movementY:Ke}}),_n=B(ft),Ir=W({},ft,{dataTransfer:0}),Pt=B(Ir),Tt=W({},Me,{relatedTarget:0}),Ur=B(Tt),Ii=W({},q,{animationName:0,elapsedTime:0,pseudoElement:0}),Ui=B(Ii),Xl=W({},q,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Jl=B(Xl),Cn=W({},q,{data:0}),$i=B(Cn),ni={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},go={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},it={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Vi(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=it[e])?!!t[e]:!1}function $r(){return Vi}var yo=W({},Me,{key:function(e){if(e.key){var t=ni[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=P(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?go[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$r,charCode:function(e){return e.type==="keypress"?P(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?P(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Zl=B(yo),de=W({},ft,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Re=B(de),$e=W({},Me,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$r}),Ve=B($e),kt=W({},q,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vt=B(kt),Vr=W({},ft,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Bi=B(Vr),Wi=[9,13,27,32],wo=_&&"CompositionEvent"in window,sr=null;_&&"documentMode"in document&&(sr=document.documentMode);var bf=_&&"TextEvent"in window&&!sr,qu=_&&(!wo||sr&&8<sr&&11>=sr),Gu=" ",bu=!1;function Yu(e,t){switch(e){case"keyup":return Wi.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var So=!1;function Yf(e,t){switch(e){case"compositionend":return Xu(t);case"keypress":return t.which!==32?null:(bu=!0,Gu);case"textInput":return e=t.data,e===Gu&&bu?null:e;default:return null}}function Xf(e,t){if(So)return e==="compositionend"||!wo&&Yu(e,t)?(e=S(),p=vo=sn=null,So=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return qu&&t.locale!=="ko"?null:t.data;default:return null}}var Jf={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ju(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Jf[e.type]:t==="textarea"}function Zu(e,t,n,r){Ko(r),t=Gi(t,"onChange"),0<t.length&&(n=new fe("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ri=null,oi=null;function Zf(e){ga(e,0)}function Hi(e){var t=Co(e);if(xr(t))return e}function ed(e,t){if(e==="change")return t}var ea=!1;if(_){var es;if(_){var ts="oninput"in document;if(!ts){var ta=document.createElement("div");ta.setAttribute("oninput","return;"),ts=typeof ta.oninput=="function"}es=ts}else es=!1;ea=es&&(!document.documentMode||9<document.documentMode)}function na(){ri&&(ri.detachEvent("onpropertychange",ra),oi=ri=null)}function ra(e){if(e.propertyName==="value"&&Hi(oi)){var t=[];Zu(t,oi,e,gt(e)),Jn(Zf,t)}}function td(e,t,n){e==="focusin"?(na(),ri=t,oi=n,ri.attachEvent("onpropertychange",ra)):e==="focusout"&&na()}function nd(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Hi(oi)}function rd(e,t){if(e==="click")return Hi(t)}function od(e,t){if(e==="input"||e==="change")return Hi(t)}function id(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var un=typeof Object.is=="function"?Object.is:id;function ii(e,t){if(un(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!L.call(t,o)||!un(e[o],t[o]))return!1}return!0}function oa(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ia(e,t){var n=oa(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=oa(n)}}function la(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?la(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function sa(){for(var e=window,t=Ot();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ot(e.document)}return t}function ns(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function ld(e){var t=sa(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&la(n.ownerDocument.documentElement,n)){if(r!==null&&ns(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=ia(n,i);var a=ia(n,r);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var sd=_&&"documentMode"in document&&11>=document.documentMode,ko=null,rs=null,li=null,os=!1;function ua(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;os||ko==null||ko!==Ot(r)||(r=ko,"selectionStart"in r&&ns(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),li&&ii(li,r)||(li=r,r=Gi(rs,"onSelect"),0<r.length&&(t=new fe("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ko)))}function Ki(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var xo={animationend:Ki("Animation","AnimationEnd"),animationiteration:Ki("Animation","AnimationIteration"),animationstart:Ki("Animation","AnimationStart"),transitionend:Ki("Transition","TransitionEnd")},is={},aa={};_&&(aa=document.createElement("div").style,"AnimationEvent"in window||(delete xo.animationend.animation,delete xo.animationiteration.animation,delete xo.animationstart.animation),"TransitionEvent"in window||delete xo.transitionend.transition);function Qi(e){if(is[e])return is[e];if(!xo[e])return e;var t=xo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in aa)return is[e]=t[n];return e}var ca=Qi("animationend"),fa=Qi("animationiteration"),da=Qi("animationstart"),ha=Qi("transitionend"),pa=new Map,ma="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ur(e,t){pa.set(e,t),g(t,[e])}for(var ls=0;ls<ma.length;ls++){var ss=ma[ls],ud=ss.toLowerCase(),ad=ss[0].toUpperCase()+ss.slice(1);ur(ud,"on"+ad)}ur(ca,"onAnimationEnd"),ur(fa,"onAnimationIteration"),ur(da,"onAnimationStart"),ur("dblclick","onDoubleClick"),ur("focusin","onFocus"),ur("focusout","onBlur"),ur(ha,"onTransitionEnd"),x("onMouseEnter",["mouseout","mouseover"]),x("onMouseLeave",["mouseout","mouseover"]),x("onPointerEnter",["pointerout","pointerover"]),x("onPointerLeave",["pointerout","pointerover"]),g("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),g("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),g("onBeforeInput",["compositionend","keypress","textInput","paste"]),g("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),g("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),g("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var si="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),cd=new Set("cancel close invalid load scroll toggle".split(" ").concat(si));function va(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Hl(r,t,void 0,e),e.currentTarget=null}function ga(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var a=r.length-1;0<=a;a--){var f=r[a],m=f.instance,E=f.currentTarget;if(f=f.listener,m!==i&&o.isPropagationStopped())break e;va(o,f,E),i=m}else for(a=0;a<r.length;a++){if(f=r[a],m=f.instance,E=f.currentTarget,f=f.listener,m!==i&&o.isPropagationStopped())break e;va(o,f,E),i=m}}}if(Pr)throw e=tr,Pr=!1,tr=null,e}function Oe(e,t){var n=t[ms];n===void 0&&(n=t[ms]=new Set);var r=e+"__bubble";n.has(r)||(ya(t,e,2,!1),n.add(r))}function us(e,t,n){var r=0;t&&(r|=4),ya(n,e,r,t)}var qi="_reactListening"+Math.random().toString(36).slice(2);function ui(e){if(!e[qi]){e[qi]=!0,c.forEach(function(n){n!=="selectionchange"&&(cd.has(n)||us(n,!1,e),us(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[qi]||(t[qi]=!0,us("selectionchange",!1,t))}}function ya(e,t,n,r){switch(Dr(t)){case 1:var o=bl;break;case 4:o=Yl;break;default:o=ti}n=o.bind(null,t,n,e),o=void 0,!lo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function as(e,t,n,r,o){var i=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var f=r.stateNode.containerInfo;if(f===o||f.nodeType===8&&f.parentNode===o)break;if(a===4)for(a=r.return;a!==null;){var m=a.tag;if((m===3||m===4)&&(m=a.stateNode.containerInfo,m===o||m.nodeType===8&&m.parentNode===o))return;a=a.return}for(;f!==null;){if(a=Br(f),a===null)return;if(m=a.tag,m===5||m===6){r=i=a;continue e}f=f.parentNode}}r=r.return}Jn(function(){var E=i,F=gt(n),A=[];e:{var M=pa.get(e);if(M!==void 0){var Y=fe,ee=e;switch(e){case"keypress":if(P(n)===0)break e;case"keydown":case"keyup":Y=Zl;break;case"focusin":ee="focus",Y=Ur;break;case"focusout":ee="blur",Y=Ur;break;case"beforeblur":case"afterblur":Y=Ur;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Y=_n;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=Pt;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=Ve;break;case ca:case fa:case da:Y=Ui;break;case ha:Y=Vt;break;case"scroll":Y=Ne;break;case"wheel":Y=Bi;break;case"copy":case"cut":case"paste":Y=Jl;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=Re}var re=(t&4)!==0,Qe=!re&&e==="scroll",w=re?M!==null?M+"Capture":null:M;re=[];for(var v=E,k;v!==null;){k=v;var z=k.stateNode;if(k.tag===5&&z!==null&&(k=z,w!==null&&(z=Zn(v,w),z!=null&&re.push(ai(v,z,k)))),Qe)break;v=v.return}0<re.length&&(M=new Y(M,ee,null,n,F),A.push({event:M,listeners:re}))}}if((t&7)===0){e:{if(M=e==="mouseover"||e==="pointerover",Y=e==="mouseout"||e==="pointerout",M&&n!==Wo&&(ee=n.relatedTarget||n.fromElement)&&(Br(ee)||ee[Dn]))break e;if((Y||M)&&(M=F.window===F?F:(M=F.ownerDocument)?M.defaultView||M.parentWindow:window,Y?(ee=n.relatedTarget||n.toElement,Y=E,ee=ee?Br(ee):null,ee!==null&&(Qe=An(ee),ee!==Qe||ee.tag!==5&&ee.tag!==6)&&(ee=null)):(Y=null,ee=E),Y!==ee)){if(re=_n,z="onMouseLeave",w="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(re=Re,z="onPointerLeave",w="onPointerEnter",v="pointer"),Qe=Y==null?M:Co(Y),k=ee==null?M:Co(ee),M=new re(z,v+"leave",Y,n,F),M.target=Qe,M.relatedTarget=k,z=null,Br(F)===E&&(re=new re(w,v+"enter",ee,n,F),re.target=k,re.relatedTarget=Qe,z=re),Qe=z,Y&&ee)t:{for(re=Y,w=ee,v=0,k=re;k;k=Eo(k))v++;for(k=0,z=w;z;z=Eo(z))k++;for(;0<v-k;)re=Eo(re),v--;for(;0<k-v;)w=Eo(w),k--;for(;v--;){if(re===w||w!==null&&re===w.alternate)break t;re=Eo(re),w=Eo(w)}re=null}else re=null;Y!==null&&wa(A,M,Y,re,!1),ee!==null&&Qe!==null&&wa(A,Qe,ee,re,!0)}}e:{if(M=E?Co(E):window,Y=M.nodeName&&M.nodeName.toLowerCase(),Y==="select"||Y==="input"&&M.type==="file")var oe=ed;else if(Ju(M))if(ea)oe=od;else{oe=nd;var ae=td}else(Y=M.nodeName)&&Y.toLowerCase()==="input"&&(M.type==="checkbox"||M.type==="radio")&&(oe=rd);if(oe&&(oe=oe(e,E))){Zu(A,oe,n,F);break e}ae&&ae(e,M,E),e==="focusout"&&(ae=M._wrapperState)&&ae.controlled&&M.type==="number"&&Gn(M,"number",M.value)}switch(ae=E?Co(E):window,e){case"focusin":(Ju(ae)||ae.contentEditable==="true")&&(ko=ae,rs=E,li=null);break;case"focusout":li=rs=ko=null;break;case"mousedown":os=!0;break;case"contextmenu":case"mouseup":case"dragend":os=!1,ua(A,n,F);break;case"selectionchange":if(sd)break;case"keydown":case"keyup":ua(A,n,F)}var ce;if(wo)e:{switch(e){case"compositionstart":var he="onCompositionStart";break e;case"compositionend":he="onCompositionEnd";break e;case"compositionupdate":he="onCompositionUpdate";break e}he=void 0}else So?Yu(e,n)&&(he="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(he="onCompositionStart");he&&(qu&&n.locale!=="ko"&&(So||he!=="onCompositionStart"?he==="onCompositionEnd"&&So&&(ce=S()):(sn=F,vo="value"in sn?sn.value:sn.textContent,So=!0)),ae=Gi(E,he),0<ae.length&&(he=new $i(he,e,null,n,F),A.push({event:he,listeners:ae}),ce?he.data=ce:(ce=Xu(n),ce!==null&&(he.data=ce)))),(ce=bf?Yf(e,n):Xf(e,n))&&(E=Gi(E,"onBeforeInput"),0<E.length&&(F=new $i("onBeforeInput","beforeinput",null,n,F),A.push({event:F,listeners:E}),F.data=ce))}ga(A,t)})}function ai(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Gi(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Zn(e,n),i!=null&&r.unshift(ai(e,i,o)),i=Zn(e,t),i!=null&&r.push(ai(e,i,o))),e=e.return}return r}function Eo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function wa(e,t,n,r,o){for(var i=t._reactName,a=[];n!==null&&n!==r;){var f=n,m=f.alternate,E=f.stateNode;if(m!==null&&m===r)break;f.tag===5&&E!==null&&(f=E,o?(m=Zn(n,i),m!=null&&a.unshift(ai(n,m,f))):o||(m=Zn(n,i),m!=null&&a.push(ai(n,m,f)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var fd=/\r\n?/g,dd=/\u0000|\uFFFD/g;function Sa(e){return(typeof e=="string"?e:""+e).replace(fd,`
|
|
39
|
-
`).replace(dd,"")}function bi(e,t,n){if(t=Sa(t),Sa(e)!==t&&n)throw Error(s(425))}function Yi(){}var cs=null,fs=null;function ds(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var hs=typeof setTimeout=="function"?setTimeout:void 0,hd=typeof clearTimeout=="function"?clearTimeout:void 0,ka=typeof Promise=="function"?Promise:void 0,pd=typeof queueMicrotask=="function"?queueMicrotask:typeof ka<"u"?function(e){return ka.resolve(null).then(e).catch(md)}:hs;function md(e){setTimeout(function(){throw e})}function ps(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),ir(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);ir(t)}function ar(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function xa(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var _o=Math.random().toString(36).slice(2),Nn="__reactFiber$"+_o,ci="__reactProps$"+_o,Dn="__reactContainer$"+_o,ms="__reactEvents$"+_o,vd="__reactListeners$"+_o,gd="__reactHandles$"+_o;function Br(e){var t=e[Nn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Dn]||n[Nn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=xa(e);e!==null;){if(n=e[Nn])return n;e=xa(e)}return t}e=n,n=e.parentNode}return null}function fi(e){return e=e[Nn]||e[Dn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Co(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(s(33))}function Xi(e){return e[ci]||null}var vs=[],No=-1;function cr(e){return{current:e}}function ze(e){0>No||(e.current=vs[No],vs[No]=null,No--)}function Le(e,t){No++,vs[No]=e.current,e.current=t}var fr={},dt=cr(fr),jt=cr(!1),Wr=fr;function Po(e,t){var n=e.type.contextTypes;if(!n)return fr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Rt(e){return e=e.childContextTypes,e!=null}function Ji(){ze(jt),ze(dt)}function Ea(e,t,n){if(dt.current!==fr)throw Error(s(168));Le(dt,t),Le(jt,n)}function _a(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(s(108,ve(e)||"Unknown",o));return W({},n,r)}function Zi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fr,Wr=dt.current,Le(dt,e),Le(jt,jt.current),!0}function Ca(e,t,n){var r=e.stateNode;if(!r)throw Error(s(169));n?(e=_a(e,t,Wr),r.__reactInternalMemoizedMergedChildContext=e,ze(jt),ze(dt),Le(dt,e)):ze(jt),Le(jt,n)}var In=null,el=!1,gs=!1;function Na(e){In===null?In=[e]:In.push(e)}function yd(e){el=!0,Na(e)}function dr(){if(!gs&&In!==null){gs=!0;var e=0,t=Ce;try{var n=In;for(Ce=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}In=null,el=!1}catch(o){throw In!==null&&(In=In.slice(e+1)),Xo(It,dr),o}finally{Ce=t,gs=!1}}return null}var To=[],jo=0,tl=null,nl=0,qt=[],Gt=0,Hr=null,Un=1,$n="";function Kr(e,t){To[jo++]=nl,To[jo++]=tl,tl=e,nl=t}function Pa(e,t,n){qt[Gt++]=Un,qt[Gt++]=$n,qt[Gt++]=Hr,Hr=e;var r=Un;e=$n;var o=32-St(r)-1;r&=~(1<<o),n+=1;var i=32-St(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,Un=1<<32-St(t)+o|n<<o|r,$n=i+e}else Un=1<<i|n<<o|r,$n=e}function ys(e){e.return!==null&&(Kr(e,1),Pa(e,1,0))}function ws(e){for(;e===tl;)tl=To[--jo],To[jo]=null,nl=To[--jo],To[jo]=null;for(;e===Hr;)Hr=qt[--Gt],qt[Gt]=null,$n=qt[--Gt],qt[Gt]=null,Un=qt[--Gt],qt[Gt]=null}var Bt=null,Wt=null,De=!1,an=null;function Ta(e,t){var n=Jt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function ja(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Bt=e,Wt=ar(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Bt=e,Wt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Hr!==null?{id:Un,overflow:$n}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Jt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Bt=e,Wt=null,!0):!1;default:return!1}}function Ss(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ks(e){if(De){var t=Wt;if(t){var n=t;if(!ja(e,t)){if(Ss(e))throw Error(s(418));t=ar(n.nextSibling);var r=Bt;t&&ja(e,t)?Ta(r,n):(e.flags=e.flags&-4097|2,De=!1,Bt=e)}}else{if(Ss(e))throw Error(s(418));e.flags=e.flags&-4097|2,De=!1,Bt=e}}}function Ra(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Bt=e}function rl(e){if(e!==Bt)return!1;if(!De)return Ra(e),De=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ds(e.type,e.memoizedProps)),t&&(t=Wt)){if(Ss(e))throw Ma(),Error(s(418));for(;t;)Ta(e,t),t=ar(t.nextSibling)}if(Ra(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Wt=ar(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Wt=null}}else Wt=Bt?ar(e.stateNode.nextSibling):null;return!0}function Ma(){for(var e=Wt;e;)e=ar(e.nextSibling)}function Ro(){Wt=Bt=null,De=!1}function xs(e){an===null?an=[e]:an.push(e)}var wd=I.ReactCurrentBatchConfig;function di(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(s(309));var r=n.stateNode}if(!r)throw Error(s(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(a){var f=o.refs;a===null?delete f[i]:f[i]=a},t._stringRef=i,t)}if(typeof e!="string")throw Error(s(284));if(!n._owner)throw Error(s(290,e))}return e}function ol(e,t){throw e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Fa(e){var t=e._init;return t(e._payload)}function La(e){function t(w,v){if(e){var k=w.deletions;k===null?(w.deletions=[v],w.flags|=16):k.push(v)}}function n(w,v){if(!e)return null;for(;v!==null;)t(w,v),v=v.sibling;return null}function r(w,v){for(w=new Map;v!==null;)v.key!==null?w.set(v.key,v):w.set(v.index,v),v=v.sibling;return w}function o(w,v){return w=Sr(w,v),w.index=0,w.sibling=null,w}function i(w,v,k){return w.index=k,e?(k=w.alternate,k!==null?(k=k.index,k<v?(w.flags|=2,v):k):(w.flags|=2,v)):(w.flags|=1048576,v)}function a(w){return e&&w.alternate===null&&(w.flags|=2),w}function f(w,v,k,z){return v===null||v.tag!==6?(v=hu(k,w.mode,z),v.return=w,v):(v=o(v,k),v.return=w,v)}function m(w,v,k,z){var oe=k.type;return oe===ne?F(w,v,k.props.children,z,k.key):v!==null&&(v.elementType===oe||typeof oe=="object"&&oe!==null&&oe.$$typeof===Ue&&Fa(oe)===v.type)?(z=o(v,k.props),z.ref=di(w,v,k),z.return=w,z):(z=Tl(k.type,k.key,k.props,null,w.mode,z),z.ref=di(w,v,k),z.return=w,z)}function E(w,v,k,z){return v===null||v.tag!==4||v.stateNode.containerInfo!==k.containerInfo||v.stateNode.implementation!==k.implementation?(v=pu(k,w.mode,z),v.return=w,v):(v=o(v,k.children||[]),v.return=w,v)}function F(w,v,k,z,oe){return v===null||v.tag!==7?(v=Zr(k,w.mode,z,oe),v.return=w,v):(v=o(v,k),v.return=w,v)}function A(w,v,k){if(typeof v=="string"&&v!==""||typeof v=="number")return v=hu(""+v,w.mode,k),v.return=w,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Q:return k=Tl(v.type,v.key,v.props,null,w.mode,k),k.ref=di(w,null,v),k.return=w,k;case U:return v=pu(v,w.mode,k),v.return=w,v;case Ue:var z=v._init;return A(w,z(v._payload),k)}if(gn(v)||se(v))return v=Zr(v,w.mode,k,null),v.return=w,v;ol(w,v)}return null}function M(w,v,k,z){var oe=v!==null?v.key:null;if(typeof k=="string"&&k!==""||typeof k=="number")return oe!==null?null:f(w,v,""+k,z);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case Q:return k.key===oe?m(w,v,k,z):null;case U:return k.key===oe?E(w,v,k,z):null;case Ue:return oe=k._init,M(w,v,oe(k._payload),z)}if(gn(k)||se(k))return oe!==null?null:F(w,v,k,z,null);ol(w,k)}return null}function Y(w,v,k,z,oe){if(typeof z=="string"&&z!==""||typeof z=="number")return w=w.get(k)||null,f(v,w,""+z,oe);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case Q:return w=w.get(z.key===null?k:z.key)||null,m(v,w,z,oe);case U:return w=w.get(z.key===null?k:z.key)||null,E(v,w,z,oe);case Ue:var ae=z._init;return Y(w,v,k,ae(z._payload),oe)}if(gn(z)||se(z))return w=w.get(k)||null,F(v,w,z,oe,null);ol(v,z)}return null}function ee(w,v,k,z){for(var oe=null,ae=null,ce=v,he=v=0,nt=null;ce!==null&&he<k.length;he++){ce.index>he?(nt=ce,ce=null):nt=ce.sibling;var Te=M(w,ce,k[he],z);if(Te===null){ce===null&&(ce=nt);break}e&&ce&&Te.alternate===null&&t(w,ce),v=i(Te,v,he),ae===null?oe=Te:ae.sibling=Te,ae=Te,ce=nt}if(he===k.length)return n(w,ce),De&&Kr(w,he),oe;if(ce===null){for(;he<k.length;he++)ce=A(w,k[he],z),ce!==null&&(v=i(ce,v,he),ae===null?oe=ce:ae.sibling=ce,ae=ce);return De&&Kr(w,he),oe}for(ce=r(w,ce);he<k.length;he++)nt=Y(ce,w,he,k[he],z),nt!==null&&(e&&nt.alternate!==null&&ce.delete(nt.key===null?he:nt.key),v=i(nt,v,he),ae===null?oe=nt:ae.sibling=nt,ae=nt);return e&&ce.forEach(function(kr){return t(w,kr)}),De&&Kr(w,he),oe}function re(w,v,k,z){var oe=se(k);if(typeof oe!="function")throw Error(s(150));if(k=oe.call(k),k==null)throw Error(s(151));for(var ae=oe=null,ce=v,he=v=0,nt=null,Te=k.next();ce!==null&&!Te.done;he++,Te=k.next()){ce.index>he?(nt=ce,ce=null):nt=ce.sibling;var kr=M(w,ce,Te.value,z);if(kr===null){ce===null&&(ce=nt);break}e&&ce&&kr.alternate===null&&t(w,ce),v=i(kr,v,he),ae===null?oe=kr:ae.sibling=kr,ae=kr,ce=nt}if(Te.done)return n(w,ce),De&&Kr(w,he),oe;if(ce===null){for(;!Te.done;he++,Te=k.next())Te=A(w,Te.value,z),Te!==null&&(v=i(Te,v,he),ae===null?oe=Te:ae.sibling=Te,ae=Te);return De&&Kr(w,he),oe}for(ce=r(w,ce);!Te.done;he++,Te=k.next())Te=Y(ce,w,he,Te.value,z),Te!==null&&(e&&Te.alternate!==null&&ce.delete(Te.key===null?he:Te.key),v=i(Te,v,he),ae===null?oe=Te:ae.sibling=Te,ae=Te);return e&&ce.forEach(function(Jd){return t(w,Jd)}),De&&Kr(w,he),oe}function Qe(w,v,k,z){if(typeof k=="object"&&k!==null&&k.type===ne&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case Q:e:{for(var oe=k.key,ae=v;ae!==null;){if(ae.key===oe){if(oe=k.type,oe===ne){if(ae.tag===7){n(w,ae.sibling),v=o(ae,k.props.children),v.return=w,w=v;break e}}else if(ae.elementType===oe||typeof oe=="object"&&oe!==null&&oe.$$typeof===Ue&&Fa(oe)===ae.type){n(w,ae.sibling),v=o(ae,k.props),v.ref=di(w,ae,k),v.return=w,w=v;break e}n(w,ae);break}else t(w,ae);ae=ae.sibling}k.type===ne?(v=Zr(k.props.children,w.mode,z,k.key),v.return=w,w=v):(z=Tl(k.type,k.key,k.props,null,w.mode,z),z.ref=di(w,v,k),z.return=w,w=z)}return a(w);case U:e:{for(ae=k.key;v!==null;){if(v.key===ae)if(v.tag===4&&v.stateNode.containerInfo===k.containerInfo&&v.stateNode.implementation===k.implementation){n(w,v.sibling),v=o(v,k.children||[]),v.return=w,w=v;break e}else{n(w,v);break}else t(w,v);v=v.sibling}v=pu(k,w.mode,z),v.return=w,w=v}return a(w);case Ue:return ae=k._init,Qe(w,v,ae(k._payload),z)}if(gn(k))return ee(w,v,k,z);if(se(k))return re(w,v,k,z);ol(w,k)}return typeof k=="string"&&k!==""||typeof k=="number"?(k=""+k,v!==null&&v.tag===6?(n(w,v.sibling),v=o(v,k),v.return=w,w=v):(n(w,v),v=hu(k,w.mode,z),v.return=w,w=v),a(w)):n(w,v)}return Qe}var Mo=La(!0),Aa=La(!1),il=cr(null),ll=null,Fo=null,Es=null;function _s(){Es=Fo=ll=null}function Cs(e){var t=il.current;ze(il),e._currentValue=t}function Ns(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Lo(e,t){ll=e,Es=Fo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Mt=!0),e.firstContext=null)}function bt(e){var t=e._currentValue;if(Es!==e)if(e={context:e,memoizedValue:t,next:null},Fo===null){if(ll===null)throw Error(s(308));Fo=e,ll.dependencies={lanes:0,firstContext:e}}else Fo=Fo.next=e;return t}var Qr=null;function Ps(e){Qr===null?Qr=[e]:Qr.push(e)}function Oa(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Ps(t)):(n.next=o.next,o.next=n),t.interleaved=n,Vn(e,r)}function Vn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var hr=!1;function Ts(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function za(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Bn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function pr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Ee&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Vn(e,n)}return o=r.interleaved,o===null?(t.next=t,Ps(r)):(t.next=o.next,o.next=t),r.interleaved=t,Vn(e,n)}function sl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Jo(e,n)}}function Da(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ul(e,t,n,r){var o=e.updateQueue;hr=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,f=o.shared.pending;if(f!==null){o.shared.pending=null;var m=f,E=m.next;m.next=null,a===null?i=E:a.next=E,a=m;var F=e.alternate;F!==null&&(F=F.updateQueue,f=F.lastBaseUpdate,f!==a&&(f===null?F.firstBaseUpdate=E:f.next=E,F.lastBaseUpdate=m))}if(i!==null){var A=o.baseState;a=0,F=E=m=null,f=i;do{var M=f.lane,Y=f.eventTime;if((r&M)===M){F!==null&&(F=F.next={eventTime:Y,lane:0,tag:f.tag,payload:f.payload,callback:f.callback,next:null});e:{var ee=e,re=f;switch(M=t,Y=n,re.tag){case 1:if(ee=re.payload,typeof ee=="function"){A=ee.call(Y,A,M);break e}A=ee;break e;case 3:ee.flags=ee.flags&-65537|128;case 0:if(ee=re.payload,M=typeof ee=="function"?ee.call(Y,A,M):ee,M==null)break e;A=W({},A,M);break e;case 2:hr=!0}}f.callback!==null&&f.lane!==0&&(e.flags|=64,M=o.effects,M===null?o.effects=[f]:M.push(f))}else Y={eventTime:Y,lane:M,tag:f.tag,payload:f.payload,callback:f.callback,next:null},F===null?(E=F=Y,m=A):F=F.next=Y,a|=M;if(f=f.next,f===null){if(f=o.shared.pending,f===null)break;M=f,f=M.next,M.next=null,o.lastBaseUpdate=M,o.shared.pending=null}}while(!0);if(F===null&&(m=A),o.baseState=m,o.firstBaseUpdate=E,o.lastBaseUpdate=F,t=o.shared.interleaved,t!==null){o=t;do a|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);br|=a,e.lanes=a,e.memoizedState=A}}function Ia(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(s(191,o));o.call(r)}}}var hi={},Pn=cr(hi),pi=cr(hi),mi=cr(hi);function qr(e){if(e===hi)throw Error(s(174));return e}function js(e,t){switch(Le(mi,t),Le(pi,e),Le(Pn,hi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:at(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=at(t,e)}ze(Pn),Le(Pn,t)}function Ao(){ze(Pn),ze(pi),ze(mi)}function Ua(e){qr(mi.current);var t=qr(Pn.current),n=at(t,e.type);t!==n&&(Le(pi,e),Le(Pn,n))}function Rs(e){pi.current===e&&(ze(Pn),ze(pi))}var Be=cr(0);function al(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ms=[];function Fs(){for(var e=0;e<Ms.length;e++)Ms[e]._workInProgressVersionPrimary=null;Ms.length=0}var cl=I.ReactCurrentDispatcher,Ls=I.ReactCurrentBatchConfig,Gr=0,We=null,Ye=null,et=null,fl=!1,vi=!1,gi=0,Sd=0;function ht(){throw Error(s(321))}function As(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!un(e[n],t[n]))return!1;return!0}function Os(e,t,n,r,o,i){if(Gr=i,We=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,cl.current=e===null||e.memoizedState===null?_d:Cd,e=n(r,o),vi){i=0;do{if(vi=!1,gi=0,25<=i)throw Error(s(301));i+=1,et=Ye=null,t.updateQueue=null,cl.current=Nd,e=n(r,o)}while(vi)}if(cl.current=pl,t=Ye!==null&&Ye.next!==null,Gr=0,et=Ye=We=null,fl=!1,t)throw Error(s(300));return e}function zs(){var e=gi!==0;return gi=0,e}function Tn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return et===null?We.memoizedState=et=e:et=et.next=e,et}function Yt(){if(Ye===null){var e=We.alternate;e=e!==null?e.memoizedState:null}else e=Ye.next;var t=et===null?We.memoizedState:et.next;if(t!==null)et=t,Ye=e;else{if(e===null)throw Error(s(310));Ye=e,e={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},et===null?We.memoizedState=et=e:et=et.next=e}return et}function yi(e,t){return typeof t=="function"?t(e):t}function Ds(e){var t=Yt(),n=t.queue;if(n===null)throw Error(s(311));n.lastRenderedReducer=e;var r=Ye,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var a=o.next;o.next=i.next,i.next=a}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var f=a=null,m=null,E=i;do{var F=E.lane;if((Gr&F)===F)m!==null&&(m=m.next={lane:0,action:E.action,hasEagerState:E.hasEagerState,eagerState:E.eagerState,next:null}),r=E.hasEagerState?E.eagerState:e(r,E.action);else{var A={lane:F,action:E.action,hasEagerState:E.hasEagerState,eagerState:E.eagerState,next:null};m===null?(f=m=A,a=r):m=m.next=A,We.lanes|=F,br|=F}E=E.next}while(E!==null&&E!==i);m===null?a=r:m.next=f,un(r,t.memoizedState)||(Mt=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=m,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,We.lanes|=i,br|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Is(e){var t=Yt(),n=t.queue;if(n===null)throw Error(s(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var a=o=o.next;do i=e(i,a.action),a=a.next;while(a!==o);un(i,t.memoizedState)||(Mt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function $a(){}function Va(e,t){var n=We,r=Yt(),o=t(),i=!un(r.memoizedState,o);if(i&&(r.memoizedState=o,Mt=!0),r=r.queue,Us(Ha.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||et!==null&&et.memoizedState.tag&1){if(n.flags|=2048,wi(9,Wa.bind(null,n,r,o,t),void 0,null),tt===null)throw Error(s(349));(Gr&30)!==0||Ba(n,t,o)}return o}function Ba(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=We.updateQueue,t===null?(t={lastEffect:null,stores:null},We.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Wa(e,t,n,r){t.value=n,t.getSnapshot=r,Ka(t)&&Qa(e)}function Ha(e,t,n){return n(function(){Ka(t)&&Qa(e)})}function Ka(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!un(e,n)}catch{return!0}}function Qa(e){var t=Vn(e,1);t!==null&&hn(t,e,1,-1)}function qa(e){var t=Tn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:yi,lastRenderedState:e},t.queue=e,e=e.dispatch=Ed.bind(null,We,e),[t.memoizedState,e]}function wi(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=We.updateQueue,t===null?(t={lastEffect:null,stores:null},We.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Ga(){return Yt().memoizedState}function dl(e,t,n,r){var o=Tn();We.flags|=e,o.memoizedState=wi(1|t,n,void 0,r===void 0?null:r)}function hl(e,t,n,r){var o=Yt();r=r===void 0?null:r;var i=void 0;if(Ye!==null){var a=Ye.memoizedState;if(i=a.destroy,r!==null&&As(r,a.deps)){o.memoizedState=wi(t,n,i,r);return}}We.flags|=e,o.memoizedState=wi(1|t,n,i,r)}function ba(e,t){return dl(8390656,8,e,t)}function Us(e,t){return hl(2048,8,e,t)}function Ya(e,t){return hl(4,2,e,t)}function Xa(e,t){return hl(4,4,e,t)}function Ja(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Za(e,t,n){return n=n!=null?n.concat([e]):null,hl(4,4,Ja.bind(null,t,e),n)}function $s(){}function ec(e,t){var n=Yt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&As(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function tc(e,t){var n=Yt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&As(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function nc(e,t,n){return(Gr&21)===0?(e.baseState&&(e.baseState=!1,Mt=!0),e.memoizedState=n):(un(n,t)||(n=Rr(),We.lanes|=n,br|=n,e.baseState=!0),t)}function kd(e,t){var n=Ce;Ce=n!==0&&4>n?n:4,e(!0);var r=Ls.transition;Ls.transition={};try{e(!1),t()}finally{Ce=n,Ls.transition=r}}function rc(){return Yt().memoizedState}function xd(e,t,n){var r=yr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},oc(e))ic(t,n);else if(n=Oa(e,t,n,r),n!==null){var o=Et();hn(n,e,r,o),lc(n,t,r)}}function Ed(e,t,n){var r=yr(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(oc(e))ic(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,f=i(a,n);if(o.hasEagerState=!0,o.eagerState=f,un(f,a)){var m=t.interleaved;m===null?(o.next=o,Ps(t)):(o.next=m.next,m.next=o),t.interleaved=o;return}}catch{}finally{}n=Oa(e,t,o,r),n!==null&&(o=Et(),hn(n,e,r,o),lc(n,t,r))}}function oc(e){var t=e.alternate;return e===We||t!==null&&t===We}function ic(e,t){vi=fl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lc(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Jo(e,n)}}var pl={readContext:bt,useCallback:ht,useContext:ht,useEffect:ht,useImperativeHandle:ht,useInsertionEffect:ht,useLayoutEffect:ht,useMemo:ht,useReducer:ht,useRef:ht,useState:ht,useDebugValue:ht,useDeferredValue:ht,useTransition:ht,useMutableSource:ht,useSyncExternalStore:ht,useId:ht,unstable_isNewReconciler:!1},_d={readContext:bt,useCallback:function(e,t){return Tn().memoizedState=[e,t===void 0?null:t],e},useContext:bt,useEffect:ba,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,dl(4194308,4,Ja.bind(null,t,e),n)},useLayoutEffect:function(e,t){return dl(4194308,4,e,t)},useInsertionEffect:function(e,t){return dl(4,2,e,t)},useMemo:function(e,t){var n=Tn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Tn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=xd.bind(null,We,e),[r.memoizedState,e]},useRef:function(e){var t=Tn();return e={current:e},t.memoizedState=e},useState:qa,useDebugValue:$s,useDeferredValue:function(e){return Tn().memoizedState=e},useTransition:function(){var e=qa(!1),t=e[0];return e=kd.bind(null,e[1]),Tn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=We,o=Tn();if(De){if(n===void 0)throw Error(s(407));n=n()}else{if(n=t(),tt===null)throw Error(s(349));(Gr&30)!==0||Ba(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,ba(Ha.bind(null,r,i,e),[e]),r.flags|=2048,wi(9,Wa.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Tn(),t=tt.identifierPrefix;if(De){var n=$n,r=Un;n=(r&~(1<<32-St(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=gi++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Sd++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Cd={readContext:bt,useCallback:ec,useContext:bt,useEffect:Us,useImperativeHandle:Za,useInsertionEffect:Ya,useLayoutEffect:Xa,useMemo:tc,useReducer:Ds,useRef:Ga,useState:function(){return Ds(yi)},useDebugValue:$s,useDeferredValue:function(e){var t=Yt();return nc(t,Ye.memoizedState,e)},useTransition:function(){var e=Ds(yi)[0],t=Yt().memoizedState;return[e,t]},useMutableSource:$a,useSyncExternalStore:Va,useId:rc,unstable_isNewReconciler:!1},Nd={readContext:bt,useCallback:ec,useContext:bt,useEffect:Us,useImperativeHandle:Za,useInsertionEffect:Ya,useLayoutEffect:Xa,useMemo:tc,useReducer:Is,useRef:Ga,useState:function(){return Is(yi)},useDebugValue:$s,useDeferredValue:function(e){var t=Yt();return Ye===null?t.memoizedState=e:nc(t,Ye.memoizedState,e)},useTransition:function(){var e=Is(yi)[0],t=Yt().memoizedState;return[e,t]},useMutableSource:$a,useSyncExternalStore:Va,useId:rc,unstable_isNewReconciler:!1};function cn(e,t){if(e&&e.defaultProps){t=W({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Vs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:W({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ml={isMounted:function(e){return(e=e._reactInternals)?An(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Et(),o=yr(e),i=Bn(r,o);i.payload=t,n!=null&&(i.callback=n),t=pr(e,i,o),t!==null&&(hn(t,e,o,r),sl(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Et(),o=yr(e),i=Bn(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=pr(e,i,o),t!==null&&(hn(t,e,o,r),sl(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Et(),r=yr(e),o=Bn(n,r);o.tag=2,t!=null&&(o.callback=t),t=pr(e,o,r),t!==null&&(hn(t,e,r,n),sl(t,e,r))}};function sc(e,t,n,r,o,i,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,a):t.prototype&&t.prototype.isPureReactComponent?!ii(n,r)||!ii(o,i):!0}function uc(e,t,n){var r=!1,o=fr,i=t.contextType;return typeof i=="object"&&i!==null?i=bt(i):(o=Rt(t)?Wr:dt.current,r=t.contextTypes,i=(r=r!=null)?Po(e,o):fr),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ml,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function ac(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ml.enqueueReplaceState(t,t.state,null)}function Bs(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Ts(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=bt(i):(i=Rt(t)?Wr:dt.current,o.context=Po(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Vs(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&ml.enqueueReplaceState(o,o.state,null),ul(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Oo(e,t){try{var n="",r=t;do n+=pe(r),r=r.return;while(r);var o=n}catch(i){o=`
|
|
40
|
-
Error generating stack: `+i.message+`
|
|
41
|
-
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function Ws(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Hs(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Pd=typeof WeakMap=="function"?WeakMap:Map;function cc(e,t,n){n=Bn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){xl||(xl=!0,iu=r),Hs(e,t)},n}function fc(e,t,n){n=Bn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Hs(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Hs(e,t),typeof r!="function"&&(vr===null?vr=new Set([this]):vr.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function dc(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Pd;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Vd.bind(null,e,t,n),t.then(e,e))}function hc(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function pc(e,t,n,r,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Bn(-1,1),t.tag=2,pr(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var Td=I.ReactCurrentOwner,Mt=!1;function xt(e,t,n,r){t.child=e===null?Aa(t,null,n,r):Mo(t,e.child,n,r)}function mc(e,t,n,r,o){n=n.render;var i=t.ref;return Lo(t,o),r=Os(e,t,n,r,i,o),n=zs(),e!==null&&!Mt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Wn(e,t,o)):(De&&n&&ys(t),t.flags|=1,xt(e,t,r,o),t.child)}function vc(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!du(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,gc(e,t,i,r,o)):(e=Tl(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,(e.lanes&o)===0){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:ii,n(a,r)&&e.ref===t.ref)return Wn(e,t,o)}return t.flags|=1,e=Sr(i,r),e.ref=t.ref,e.return=t,t.child=e}function gc(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(ii(i,r)&&e.ref===t.ref)if(Mt=!1,t.pendingProps=r=i,(e.lanes&o)!==0)(e.flags&131072)!==0&&(Mt=!0);else return t.lanes=e.lanes,Wn(e,t,o)}return Ks(e,t,n,r,o)}function yc(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Le(Do,Ht),Ht|=n;else{if((n&1073741824)===0)return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Le(Do,Ht),Ht|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Le(Do,Ht),Ht|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Le(Do,Ht),Ht|=r;return xt(e,t,o,n),t.child}function wc(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ks(e,t,n,r,o){var i=Rt(n)?Wr:dt.current;return i=Po(t,i),Lo(t,o),n=Os(e,t,n,r,i,o),r=zs(),e!==null&&!Mt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Wn(e,t,o)):(De&&r&&ys(t),t.flags|=1,xt(e,t,n,o),t.child)}function Sc(e,t,n,r,o){if(Rt(n)){var i=!0;Zi(t)}else i=!1;if(Lo(t,o),t.stateNode===null)gl(e,t),uc(t,n,r),Bs(t,n,r,o),r=!0;else if(e===null){var a=t.stateNode,f=t.memoizedProps;a.props=f;var m=a.context,E=n.contextType;typeof E=="object"&&E!==null?E=bt(E):(E=Rt(n)?Wr:dt.current,E=Po(t,E));var F=n.getDerivedStateFromProps,A=typeof F=="function"||typeof a.getSnapshotBeforeUpdate=="function";A||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(f!==r||m!==E)&&ac(t,a,r,E),hr=!1;var M=t.memoizedState;a.state=M,ul(t,r,a,o),m=t.memoizedState,f!==r||M!==m||jt.current||hr?(typeof F=="function"&&(Vs(t,n,F,r),m=t.memoizedState),(f=hr||sc(t,n,f,r,M,m,E))?(A||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=m),a.props=r,a.state=m,a.context=E,r=f):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,za(e,t),f=t.memoizedProps,E=t.type===t.elementType?f:cn(t.type,f),a.props=E,A=t.pendingProps,M=a.context,m=n.contextType,typeof m=="object"&&m!==null?m=bt(m):(m=Rt(n)?Wr:dt.current,m=Po(t,m));var Y=n.getDerivedStateFromProps;(F=typeof Y=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(f!==A||M!==m)&&ac(t,a,r,m),hr=!1,M=t.memoizedState,a.state=M,ul(t,r,a,o);var ee=t.memoizedState;f!==A||M!==ee||jt.current||hr?(typeof Y=="function"&&(Vs(t,n,Y,r),ee=t.memoizedState),(E=hr||sc(t,n,E,r,M,ee,m)||!1)?(F||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,ee,m),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,ee,m)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||f===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=ee),a.props=r,a.state=ee,a.context=m,r=E):(typeof a.componentDidUpdate!="function"||f===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),r=!1)}return Qs(e,t,n,r,i,o)}function Qs(e,t,n,r,o,i){wc(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return o&&Ca(t,n,!1),Wn(e,t,i);r=t.stateNode,Td.current=t;var f=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Mo(t,e.child,null,i),t.child=Mo(t,null,f,i)):xt(e,t,f,i),t.memoizedState=r.state,o&&Ca(t,n,!0),t.child}function kc(e){var t=e.stateNode;t.pendingContext?Ea(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ea(e,t.context,!1),js(e,t.containerInfo)}function xc(e,t,n,r,o){return Ro(),xs(o),t.flags|=256,xt(e,t,n,r),t.child}var qs={dehydrated:null,treeContext:null,retryLane:0};function Gs(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ec(e,t,n){var r=t.pendingProps,o=Be.current,i=!1,a=(t.flags&128)!==0,f;if((f=a)||(f=e!==null&&e.memoizedState===null?!1:(o&2)!==0),f?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Le(Be,o&1),e===null)return ks(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(a=r.children,e=r.fallback,i?(r=t.mode,i=t.child,a={mode:"hidden",children:a},(r&1)===0&&i!==null?(i.childLanes=0,i.pendingProps=a):i=jl(a,r,0,null),e=Zr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Gs(n),t.memoizedState=qs,e):bs(t,a));if(o=e.memoizedState,o!==null&&(f=o.dehydrated,f!==null))return jd(e,t,a,r,f,o,n);if(i){i=r.fallback,a=t.mode,o=e.child,f=o.sibling;var m={mode:"hidden",children:r.children};return(a&1)===0&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=m,t.deletions=null):(r=Sr(o,m),r.subtreeFlags=o.subtreeFlags&14680064),f!==null?i=Sr(f,i):(i=Zr(i,a,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,a=e.child.memoizedState,a=a===null?Gs(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~n,t.memoizedState=qs,r}return i=e.child,e=i.sibling,r=Sr(i,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function bs(e,t){return t=jl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function vl(e,t,n,r){return r!==null&&xs(r),Mo(t,e.child,null,n),e=bs(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function jd(e,t,n,r,o,i,a){if(n)return t.flags&256?(t.flags&=-257,r=Ws(Error(s(422))),vl(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=jl({mode:"visible",children:r.children},o,0,null),i=Zr(i,o,a,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,(t.mode&1)!==0&&Mo(t,e.child,null,a),t.child.memoizedState=Gs(a),t.memoizedState=qs,i);if((t.mode&1)===0)return vl(e,t,a,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var f=r.dgst;return r=f,i=Error(s(419)),r=Ws(i,r,void 0),vl(e,t,a,r)}if(f=(a&e.childLanes)!==0,Mt||f){if(r=tt,r!==null){switch(a&-a){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=(o&(r.suspendedLanes|a))!==0?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,Vn(e,o),hn(r,e,o,-1))}return fu(),r=Ws(Error(s(421))),vl(e,t,a,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Bd.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Wt=ar(o.nextSibling),Bt=t,De=!0,an=null,e!==null&&(qt[Gt++]=Un,qt[Gt++]=$n,qt[Gt++]=Hr,Un=e.id,$n=e.overflow,Hr=t),t=bs(t,r.children),t.flags|=4096,t)}function _c(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ns(e.return,t,n)}function Ys(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function Cc(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(xt(e,t,r.children,n),r=Be.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&_c(e,n,t);else if(e.tag===19)_c(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Le(Be,r),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&al(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Ys(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&al(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Ys(t,!0,n,null,i);break;case"together":Ys(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function gl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Wn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),br|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,n=Sr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Sr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Rd(e,t,n){switch(t.tag){case 3:kc(t),Ro();break;case 5:Ua(t);break;case 1:Rt(t.type)&&Zi(t);break;case 4:js(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Le(il,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Le(Be,Be.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?Ec(e,t,n):(Le(Be,Be.current&1),e=Wn(e,t,n),e!==null?e.sibling:null);Le(Be,Be.current&1);break;case 19:if(r=(n&t.childLanes)!==0,(e.flags&128)!==0){if(r)return Cc(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Le(Be,Be.current),r)break;return null;case 22:case 23:return t.lanes=0,yc(e,t,n)}return Wn(e,t,n)}var Nc,Xs,Pc,Tc;Nc=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Xs=function(){},Pc=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,qr(Pn.current);var i=null;switch(n){case"input":o=Qn(e,o),r=Qn(e,r),i=[];break;case"select":o=W({},o,{value:void 0}),r=W({},r,{value:void 0}),i=[];break;case"textarea":o=Rn(e,o),r=Rn(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Yi)}Cr(n,r);var a;n=null;for(E in o)if(!r.hasOwnProperty(E)&&o.hasOwnProperty(E)&&o[E]!=null)if(E==="style"){var f=o[E];for(a in f)f.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else E!=="dangerouslySetInnerHTML"&&E!=="children"&&E!=="suppressContentEditableWarning"&&E!=="suppressHydrationWarning"&&E!=="autoFocus"&&(d.hasOwnProperty(E)?i||(i=[]):(i=i||[]).push(E,null));for(E in r){var m=r[E];if(f=o!=null?o[E]:void 0,r.hasOwnProperty(E)&&m!==f&&(m!=null||f!=null))if(E==="style")if(f){for(a in f)!f.hasOwnProperty(a)||m&&m.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in m)m.hasOwnProperty(a)&&f[a]!==m[a]&&(n||(n={}),n[a]=m[a])}else n||(i||(i=[]),i.push(E,n)),n=m;else E==="dangerouslySetInnerHTML"?(m=m?m.__html:void 0,f=f?f.__html:void 0,m!=null&&f!==m&&(i=i||[]).push(E,m)):E==="children"?typeof m!="string"&&typeof m!="number"||(i=i||[]).push(E,""+m):E!=="suppressContentEditableWarning"&&E!=="suppressHydrationWarning"&&(d.hasOwnProperty(E)?(m!=null&&E==="onScroll"&&Oe("scroll",e),i||f===m||(i=[])):(i=i||[]).push(E,m))}n&&(i=i||[]).push("style",n);var E=i;(t.updateQueue=E)&&(t.flags|=4)}},Tc=function(e,t,n,r){n!==r&&(t.flags|=4)};function Si(e,t){if(!De)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function pt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Md(e,t,n){var r=t.pendingProps;switch(ws(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pt(t),null;case 1:return Rt(t.type)&&Ji(),pt(t),null;case 3:return r=t.stateNode,Ao(),ze(jt),ze(dt),Fs(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(rl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,an!==null&&(uu(an),an=null))),Xs(e,t),pt(t),null;case 5:Rs(t);var o=qr(mi.current);if(n=t.type,e!==null&&t.stateNode!=null)Pc(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(s(166));return pt(t),null}if(e=qr(Pn.current),rl(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Nn]=t,r[ci]=i,e=(t.mode&1)!==0,n){case"dialog":Oe("cancel",r),Oe("close",r);break;case"iframe":case"object":case"embed":Oe("load",r);break;case"video":case"audio":for(o=0;o<si.length;o++)Oe(si[o],r);break;case"source":Oe("error",r);break;case"img":case"image":case"link":Oe("error",r),Oe("load",r);break;case"details":Oe("toggle",r);break;case"input":qn(r,i),Oe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Oe("invalid",r);break;case"textarea":bn(r,i),Oe("invalid",r)}Cr(n,i),o=null;for(var a in i)if(i.hasOwnProperty(a)){var f=i[a];a==="children"?typeof f=="string"?r.textContent!==f&&(i.suppressHydrationWarning!==!0&&bi(r.textContent,f,e),o=["children",f]):typeof f=="number"&&r.textContent!==""+f&&(i.suppressHydrationWarning!==!0&&bi(r.textContent,f,e),o=["children",""+f]):d.hasOwnProperty(a)&&f!=null&&a==="onScroll"&&Oe("scroll",r)}switch(n){case"input":Kn(r),vn(r,i,!0);break;case"textarea":Kn(r),Dt(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Yi)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=no(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Nn]=t,e[ci]=r,Nc(e,t,!1,!1),t.stateNode=e;e:{switch(a=io(n,r),n){case"dialog":Oe("cancel",e),Oe("close",e),o=r;break;case"iframe":case"object":case"embed":Oe("load",e),o=r;break;case"video":case"audio":for(o=0;o<si.length;o++)Oe(si[o],e);o=r;break;case"source":Oe("error",e),o=r;break;case"img":case"image":case"link":Oe("error",e),Oe("load",e),o=r;break;case"details":Oe("toggle",e),o=r;break;case"input":qn(e,r),o=Qn(e,r),Oe("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=W({},r,{value:void 0}),Oe("invalid",e);break;case"textarea":bn(e,r),o=Rn(e,r),Oe("invalid",e);break;default:o=r}Cr(n,o),f=o;for(i in f)if(f.hasOwnProperty(i)){var m=f[i];i==="style"?oo(e,m):i==="dangerouslySetInnerHTML"?(m=m?m.__html:void 0,m!=null&&ro(e,m)):i==="children"?typeof m=="string"?(n!=="textarea"||m!=="")&&_r(e,m):typeof m=="number"&&_r(e,""+m):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(d.hasOwnProperty(i)?m!=null&&i==="onScroll"&&Oe("scroll",e):m!=null&&ge(e,i,m,a))}switch(n){case"input":Kn(e),vn(e,r,!1);break;case"textarea":Kn(e),Dt(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ke(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?zt(e,!!r.multiple,i,!1):r.defaultValue!=null&&zt(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Yi)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return pt(t),null;case 6:if(e&&t.stateNode!=null)Tc(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(s(166));if(n=qr(mi.current),qr(Pn.current),rl(t)){if(r=t.stateNode,n=t.memoizedProps,r[Nn]=t,(i=r.nodeValue!==n)&&(e=Bt,e!==null))switch(e.tag){case 3:bi(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&bi(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Nn]=t,t.stateNode=r}return pt(t),null;case 13:if(ze(Be),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(De&&Wt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Ma(),Ro(),t.flags|=98560,i=!1;else if(i=rl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(s(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(s(317));i[Nn]=t}else Ro(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;pt(t),i=!1}else an!==null&&(uu(an),an=null),i=!0;if(!i)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Be.current&1)!==0?Xe===0&&(Xe=3):fu())),t.updateQueue!==null&&(t.flags|=4),pt(t),null);case 4:return Ao(),Xs(e,t),e===null&&ui(t.stateNode.containerInfo),pt(t),null;case 10:return Cs(t.type._context),pt(t),null;case 17:return Rt(t.type)&&Ji(),pt(t),null;case 19:if(ze(Be),i=t.memoizedState,i===null)return pt(t),null;if(r=(t.flags&128)!==0,a=i.rendering,a===null)if(r)Si(i,!1);else{if(Xe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(a=al(e),a!==null){for(t.flags|=128,Si(i,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,a=i.alternate,a===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,e=a.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Le(Be,Be.current&1|2),t.child}e=e.sibling}i.tail!==null&&Fe()>Io&&(t.flags|=128,r=!0,Si(i,!1),t.lanes=4194304)}else{if(!r)if(e=al(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Si(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!De)return pt(t),null}else 2*Fe()-i.renderingStartTime>Io&&n!==1073741824&&(t.flags|=128,r=!0,Si(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Fe(),t.sibling=null,n=Be.current,Le(Be,r?n&1|2:n&1),t):(pt(t),null);case 22:case 23:return cu(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Ht&1073741824)!==0&&(pt(t),t.subtreeFlags&6&&(t.flags|=8192)):pt(t),null;case 24:return null;case 25:return null}throw Error(s(156,t.tag))}function Fd(e,t){switch(ws(t),t.tag){case 1:return Rt(t.type)&&Ji(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ao(),ze(jt),ze(dt),Fs(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Rs(t),null;case 13:if(ze(Be),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));Ro()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ze(Be),null;case 4:return Ao(),null;case 10:return Cs(t.type._context),null;case 22:case 23:return cu(),null;case 24:return null;default:return null}}var yl=!1,mt=!1,Ld=typeof WeakSet=="function"?WeakSet:Set,Z=null;function zo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){He(e,t,r)}else n.current=null}function Js(e,t,n){try{n()}catch(r){He(e,t,r)}}var jc=!1;function Ad(e,t){if(cs=po,e=sa(),ns(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,f=-1,m=-1,E=0,F=0,A=e,M=null;t:for(;;){for(var Y;A!==n||o!==0&&A.nodeType!==3||(f=a+o),A!==i||r!==0&&A.nodeType!==3||(m=a+r),A.nodeType===3&&(a+=A.nodeValue.length),(Y=A.firstChild)!==null;)M=A,A=Y;for(;;){if(A===e)break t;if(M===n&&++E===o&&(f=a),M===i&&++F===r&&(m=a),(Y=A.nextSibling)!==null)break;A=M,M=A.parentNode}A=Y}n=f===-1||m===-1?null:{start:f,end:m}}else n=null}n=n||{start:0,end:0}}else n=null;for(fs={focusedElem:e,selectionRange:n},po=!1,Z=t;Z!==null;)if(t=Z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;try{var ee=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ee!==null){var re=ee.memoizedProps,Qe=ee.memoizedState,w=t.stateNode,v=w.getSnapshotBeforeUpdate(t.elementType===t.type?re:cn(t.type,re),Qe);w.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var k=t.stateNode.containerInfo;k.nodeType===1?k.textContent="":k.nodeType===9&&k.documentElement&&k.removeChild(k.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(z){He(t,t.return,z)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return ee=jc,jc=!1,ee}function ki(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Js(t,n,i)}o=o.next}while(o!==r)}}function wl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Zs(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Rc(e){var t=e.alternate;t!==null&&(e.alternate=null,Rc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Nn],delete t[ci],delete t[ms],delete t[vd],delete t[gd])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Mc(e){return e.tag===5||e.tag===3||e.tag===4}function Fc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Mc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function eu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Yi));else if(r!==4&&(e=e.child,e!==null))for(eu(e,t,n),e=e.sibling;e!==null;)eu(e,t,n),e=e.sibling}function tu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(tu(e,t,n),e=e.sibling;e!==null;)tu(e,t,n),e=e.sibling}var lt=null,fn=!1;function mr(e,t,n){for(n=n.child;n!==null;)Lc(e,t,n),n=n.sibling}function Lc(e,t,n){if($t&&typeof $t.onCommitFiberUnmount=="function")try{$t.onCommitFiberUnmount(On,n)}catch{}switch(n.tag){case 5:mt||zo(n,t);case 6:var r=lt,o=fn;lt=null,mr(e,t,n),lt=r,fn=o,lt!==null&&(fn?(e=lt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):lt.removeChild(n.stateNode));break;case 18:lt!==null&&(fn?(e=lt,n=n.stateNode,e.nodeType===8?ps(e.parentNode,n):e.nodeType===1&&ps(e,n),ir(e)):ps(lt,n.stateNode));break;case 4:r=lt,o=fn,lt=n.stateNode.containerInfo,fn=!0,mr(e,t,n),lt=r,fn=o;break;case 0:case 11:case 14:case 15:if(!mt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&((i&2)!==0||(i&4)!==0)&&Js(n,t,a),o=o.next}while(o!==r)}mr(e,t,n);break;case 1:if(!mt&&(zo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(f){He(n,t,f)}mr(e,t,n);break;case 21:mr(e,t,n);break;case 22:n.mode&1?(mt=(r=mt)||n.memoizedState!==null,mr(e,t,n),mt=r):mr(e,t,n);break;default:mr(e,t,n)}}function Ac(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Ld),t.forEach(function(r){var o=Wd.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function dn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,a=t,f=a;e:for(;f!==null;){switch(f.tag){case 5:lt=f.stateNode,fn=!1;break e;case 3:lt=f.stateNode.containerInfo,fn=!0;break e;case 4:lt=f.stateNode.containerInfo,fn=!0;break e}f=f.return}if(lt===null)throw Error(s(160));Lc(i,a,o),lt=null,fn=!1;var m=o.alternate;m!==null&&(m.return=null),o.return=null}catch(E){He(o,t,E)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Oc(t,e),t=t.sibling}function Oc(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(dn(t,e),jn(e),r&4){try{ki(3,e,e.return),wl(3,e)}catch(re){He(e,e.return,re)}try{ki(5,e,e.return)}catch(re){He(e,e.return,re)}}break;case 1:dn(t,e),jn(e),r&512&&n!==null&&zo(n,n.return);break;case 5:if(dn(t,e),jn(e),r&512&&n!==null&&zo(n,n.return),e.flags&32){var o=e.stateNode;try{_r(o,"")}catch(re){He(e,e.return,re)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,a=n!==null?n.memoizedProps:i,f=e.type,m=e.updateQueue;if(e.updateQueue=null,m!==null)try{f==="input"&&i.type==="radio"&&i.name!=null&&ut(o,i),io(f,a);var E=io(f,i);for(a=0;a<m.length;a+=2){var F=m[a],A=m[a+1];F==="style"?oo(o,A):F==="dangerouslySetInnerHTML"?ro(o,A):F==="children"?_r(o,A):ge(o,F,A,E)}switch(f){case"input":Er(o,i);break;case"textarea":Yn(o,i);break;case"select":var M=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var Y=i.value;Y!=null?zt(o,!!i.multiple,Y,!1):M!==!!i.multiple&&(i.defaultValue!=null?zt(o,!!i.multiple,i.defaultValue,!0):zt(o,!!i.multiple,i.multiple?[]:"",!1))}o[ci]=i}catch(re){He(e,e.return,re)}}break;case 6:if(dn(t,e),jn(e),r&4){if(e.stateNode===null)throw Error(s(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(re){He(e,e.return,re)}}break;case 3:if(dn(t,e),jn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ir(t.containerInfo)}catch(re){He(e,e.return,re)}break;case 4:dn(t,e),jn(e);break;case 13:dn(t,e),jn(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(ou=Fe())),r&4&&Ac(e);break;case 22:if(F=n!==null&&n.memoizedState!==null,e.mode&1?(mt=(E=mt)||F,dn(t,e),mt=E):dn(t,e),jn(e),r&8192){if(E=e.memoizedState!==null,(e.stateNode.isHidden=E)&&!F&&(e.mode&1)!==0)for(Z=e,F=e.child;F!==null;){for(A=Z=F;Z!==null;){switch(M=Z,Y=M.child,M.tag){case 0:case 11:case 14:case 15:ki(4,M,M.return);break;case 1:zo(M,M.return);var ee=M.stateNode;if(typeof ee.componentWillUnmount=="function"){r=M,n=M.return;try{t=r,ee.props=t.memoizedProps,ee.state=t.memoizedState,ee.componentWillUnmount()}catch(re){He(r,n,re)}}break;case 5:zo(M,M.return);break;case 22:if(M.memoizedState!==null){Ic(A);continue}}Y!==null?(Y.return=M,Z=Y):Ic(A)}F=F.sibling}e:for(F=null,A=e;;){if(A.tag===5){if(F===null){F=A;try{o=A.stateNode,E?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(f=A.stateNode,m=A.memoizedProps.style,a=m!=null&&m.hasOwnProperty("display")?m.display:null,f.style.display=vt("display",a))}catch(re){He(e,e.return,re)}}}else if(A.tag===6){if(F===null)try{A.stateNode.nodeValue=E?"":A.memoizedProps}catch(re){He(e,e.return,re)}}else if((A.tag!==22&&A.tag!==23||A.memoizedState===null||A===e)&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===e)break e;for(;A.sibling===null;){if(A.return===null||A.return===e)break e;F===A&&(F=null),A=A.return}F===A&&(F=null),A.sibling.return=A.return,A=A.sibling}}break;case 19:dn(t,e),jn(e),r&4&&Ac(e);break;case 21:break;default:dn(t,e),jn(e)}}function jn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Mc(n)){var r=n;break e}n=n.return}throw Error(s(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(_r(o,""),r.flags&=-33);var i=Fc(e);tu(e,i,o);break;case 3:case 4:var a=r.stateNode.containerInfo,f=Fc(e);eu(e,f,a);break;default:throw Error(s(161))}}catch(m){He(e,e.return,m)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Od(e,t,n){Z=e,zc(e)}function zc(e,t,n){for(var r=(e.mode&1)!==0;Z!==null;){var o=Z,i=o.child;if(o.tag===22&&r){var a=o.memoizedState!==null||yl;if(!a){var f=o.alternate,m=f!==null&&f.memoizedState!==null||mt;f=yl;var E=mt;if(yl=a,(mt=m)&&!E)for(Z=o;Z!==null;)a=Z,m=a.child,a.tag===22&&a.memoizedState!==null?Uc(o):m!==null?(m.return=a,Z=m):Uc(o);for(;i!==null;)Z=i,zc(i),i=i.sibling;Z=o,yl=f,mt=E}Dc(e)}else(o.subtreeFlags&8772)!==0&&i!==null?(i.return=o,Z=i):Dc(e)}}function Dc(e){for(;Z!==null;){var t=Z;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:mt||wl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!mt)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:cn(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Ia(t,i,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Ia(t,a,n)}break;case 5:var f=t.stateNode;if(n===null&&t.flags&4){n=f;var m=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":m.autoFocus&&n.focus();break;case"img":m.src&&(n.src=m.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var E=t.alternate;if(E!==null){var F=E.memoizedState;if(F!==null){var A=F.dehydrated;A!==null&&ir(A)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(s(163))}mt||t.flags&512&&Zs(t)}catch(M){He(t,t.return,M)}}if(t===e){Z=null;break}if(n=t.sibling,n!==null){n.return=t.return,Z=n;break}Z=t.return}}function Ic(e){for(;Z!==null;){var t=Z;if(t===e){Z=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Z=n;break}Z=t.return}}function Uc(e){for(;Z!==null;){var t=Z;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{wl(4,t)}catch(m){He(t,n,m)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(m){He(t,o,m)}}var i=t.return;try{Zs(t)}catch(m){He(t,i,m)}break;case 5:var a=t.return;try{Zs(t)}catch(m){He(t,a,m)}}}catch(m){He(t,t.return,m)}if(t===e){Z=null;break}var f=t.sibling;if(f!==null){f.return=t.return,Z=f;break}Z=t.return}}var zd=Math.ceil,Sl=I.ReactCurrentDispatcher,nu=I.ReactCurrentOwner,Xt=I.ReactCurrentBatchConfig,Ee=0,tt=null,Ge=null,st=0,Ht=0,Do=cr(0),Xe=0,xi=null,br=0,kl=0,ru=0,Ei=null,Ft=null,ou=0,Io=1/0,Hn=null,xl=!1,iu=null,vr=null,El=!1,gr=null,_l=0,_i=0,lu=null,Cl=-1,Nl=0;function Et(){return(Ee&6)!==0?Fe():Cl!==-1?Cl:Cl=Fe()}function yr(e){return(e.mode&1)===0?1:(Ee&2)!==0&&st!==0?st&-st:wd.transition!==null?(Nl===0&&(Nl=Rr()),Nl):(e=Ce,e!==0||(e=window.event,e=e===void 0?16:Dr(e.type)),e)}function hn(e,t,n,r){if(50<_i)throw _i=0,lu=null,Error(s(185));tn(e,n,r),((Ee&2)===0||e!==tt)&&(e===tt&&((Ee&2)===0&&(kl|=n),Xe===4&&wr(e,st)),Lt(e,r),n===1&&Ee===0&&(t.mode&1)===0&&(Io=Fe()+500,el&&dr()))}function Lt(e,t){var n=e.callbackNode;ql(e,t);var r=rr(e,e===tt?st:0);if(r===0)n!==null&&Zt(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Zt(n),t===1)e.tag===0?yd(Vc.bind(null,e)):Na(Vc.bind(null,e)),pd(function(){(Ee&6)===0&&dr()}),n=null;else{switch(Li(r)){case 1:n=It;break;case 4:n=Ut;break;case 16:n=yt;break;case 536870912:n=Ze;break;default:n=yt}n=bc(n,$c.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function $c(e,t){if(Cl=-1,Nl=0,(Ee&6)!==0)throw Error(s(327));var n=e.callbackNode;if(Uo()&&e.callbackNode!==n)return null;var r=rr(e,e===tt?st:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=Pl(e,r);else{t=r;var o=Ee;Ee|=2;var i=Wc();(tt!==e||st!==t)&&(Hn=null,Io=Fe()+500,Xr(e,t));do try{Ud();break}catch(f){Bc(e,f)}while(!0);_s(),Sl.current=i,Ee=o,Ge!==null?t=0:(tt=null,st=0,t=Xe)}if(t!==0){if(t===2&&(o=ct(e),o!==0&&(r=o,t=su(e,o))),t===1)throw n=xi,Xr(e,0),wr(e,r),Lt(e,Fe()),n;if(t===6)wr(e,r);else{if(o=e.current.alternate,(r&30)===0&&!Dd(o)&&(t=Pl(e,r),t===2&&(i=ct(e),i!==0&&(r=i,t=su(e,i))),t===1))throw n=xi,Xr(e,0),wr(e,r),Lt(e,Fe()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(s(345));case 2:Jr(e,Ft,Hn);break;case 3:if(wr(e,r),(r&130023424)===r&&(t=ou+500-Fe(),10<t)){if(rr(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Et(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=hs(Jr.bind(null,e,Ft,Hn),t);break}Jr(e,Ft,Hn);break;case 4:if(wr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var a=31-St(r);i=1<<a,a=t[a],a>o&&(o=a),r&=~i}if(r=o,r=Fe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*zd(r/1960))-r,10<r){e.timeoutHandle=hs(Jr.bind(null,e,Ft,Hn),r);break}Jr(e,Ft,Hn);break;case 5:Jr(e,Ft,Hn);break;default:throw Error(s(329))}}}return Lt(e,Fe()),e.callbackNode===n?$c.bind(null,e):null}function su(e,t){var n=Ei;return e.current.memoizedState.isDehydrated&&(Xr(e,t).flags|=256),e=Pl(e,t),e!==2&&(t=Ft,Ft=n,t!==null&&uu(t)),e}function uu(e){Ft===null?Ft=e:Ft.push.apply(Ft,e)}function Dd(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!un(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function wr(e,t){for(t&=~ru,t&=~kl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-St(t),r=1<<n;e[n]=-1,t&=~r}}function Vc(e){if((Ee&6)!==0)throw Error(s(327));Uo();var t=rr(e,0);if((t&1)===0)return Lt(e,Fe()),null;var n=Pl(e,t);if(e.tag!==0&&n===2){var r=ct(e);r!==0&&(t=r,n=su(e,r))}if(n===1)throw n=xi,Xr(e,0),wr(e,t),Lt(e,Fe()),n;if(n===6)throw Error(s(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Jr(e,Ft,Hn),Lt(e,Fe()),null}function au(e,t){var n=Ee;Ee|=1;try{return e(t)}finally{Ee=n,Ee===0&&(Io=Fe()+500,el&&dr())}}function Yr(e){gr!==null&&gr.tag===0&&(Ee&6)===0&&Uo();var t=Ee;Ee|=1;var n=Xt.transition,r=Ce;try{if(Xt.transition=null,Ce=1,e)return e()}finally{Ce=r,Xt.transition=n,Ee=t,(Ee&6)===0&&dr()}}function cu(){Ht=Do.current,ze(Do)}function Xr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,hd(n)),Ge!==null)for(n=Ge.return;n!==null;){var r=n;switch(ws(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ji();break;case 3:Ao(),ze(jt),ze(dt),Fs();break;case 5:Rs(r);break;case 4:Ao();break;case 13:ze(Be);break;case 19:ze(Be);break;case 10:Cs(r.type._context);break;case 22:case 23:cu()}n=n.return}if(tt=e,Ge=e=Sr(e.current,null),st=Ht=t,Xe=0,xi=null,ru=kl=br=0,Ft=Ei=null,Qr!==null){for(t=0;t<Qr.length;t++)if(n=Qr[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var a=i.next;i.next=o,r.next=a}n.pending=r}Qr=null}return e}function Bc(e,t){do{var n=Ge;try{if(_s(),cl.current=pl,fl){for(var r=We.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}fl=!1}if(Gr=0,et=Ye=We=null,vi=!1,gi=0,nu.current=null,n===null||n.return===null){Xe=1,xi=t,Ge=null;break}e:{var i=e,a=n.return,f=n,m=t;if(t=st,f.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){var E=m,F=f,A=F.tag;if((F.mode&1)===0&&(A===0||A===11||A===15)){var M=F.alternate;M?(F.updateQueue=M.updateQueue,F.memoizedState=M.memoizedState,F.lanes=M.lanes):(F.updateQueue=null,F.memoizedState=null)}var Y=hc(a);if(Y!==null){Y.flags&=-257,pc(Y,a,f,i,t),Y.mode&1&&dc(i,E,t),t=Y,m=E;var ee=t.updateQueue;if(ee===null){var re=new Set;re.add(m),t.updateQueue=re}else ee.add(m);break e}else{if((t&1)===0){dc(i,E,t),fu();break e}m=Error(s(426))}}else if(De&&f.mode&1){var Qe=hc(a);if(Qe!==null){(Qe.flags&65536)===0&&(Qe.flags|=256),pc(Qe,a,f,i,t),xs(Oo(m,f));break e}}i=m=Oo(m,f),Xe!==4&&(Xe=2),Ei===null?Ei=[i]:Ei.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var w=cc(i,m,t);Da(i,w);break e;case 1:f=m;var v=i.type,k=i.stateNode;if((i.flags&128)===0&&(typeof v.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(vr===null||!vr.has(k)))){i.flags|=65536,t&=-t,i.lanes|=t;var z=fc(i,f,t);Da(i,z);break e}}i=i.return}while(i!==null)}Kc(n)}catch(oe){t=oe,Ge===n&&n!==null&&(Ge=n=n.return);continue}break}while(!0)}function Wc(){var e=Sl.current;return Sl.current=pl,e===null?pl:e}function fu(){(Xe===0||Xe===3||Xe===2)&&(Xe=4),tt===null||(br&268435455)===0&&(kl&268435455)===0||wr(tt,st)}function Pl(e,t){var n=Ee;Ee|=2;var r=Wc();(tt!==e||st!==t)&&(Hn=null,Xr(e,t));do try{Id();break}catch(o){Bc(e,o)}while(!0);if(_s(),Ee=n,Sl.current=r,Ge!==null)throw Error(s(261));return tt=null,st=0,Xe}function Id(){for(;Ge!==null;)Hc(Ge)}function Ud(){for(;Ge!==null&&!Kt();)Hc(Ge)}function Hc(e){var t=Gc(e.alternate,e,Ht);e.memoizedProps=e.pendingProps,t===null?Kc(e):Ge=t,nu.current=null}function Kc(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=Md(n,t,Ht),n!==null){Ge=n;return}}else{if(n=Fd(n,t),n!==null){n.flags&=32767,Ge=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Xe=6,Ge=null;return}}if(t=t.sibling,t!==null){Ge=t;return}Ge=t=e}while(t!==null);Xe===0&&(Xe=5)}function Jr(e,t,n){var r=Ce,o=Xt.transition;try{Xt.transition=null,Ce=1,$d(e,t,n,r)}finally{Xt.transition=o,Ce=r}return null}function $d(e,t,n,r){do Uo();while(gr!==null);if((Ee&6)!==0)throw Error(s(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(s(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(nn(e,i),e===tt&&(Ge=tt=null,st=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||El||(El=!0,bc(yt,function(){return Uo(),null})),i=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||i){i=Xt.transition,Xt.transition=null;var a=Ce;Ce=1;var f=Ee;Ee|=4,nu.current=null,Ad(e,n),Oc(n,e),ld(fs),po=!!cs,fs=cs=null,e.current=n,Od(n),en(),Ee=f,Ce=a,Xt.transition=i}else e.current=n;if(El&&(El=!1,gr=e,_l=o),i=e.pendingLanes,i===0&&(vr=null),wt(n.stateNode),Lt(e,Fe()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(xl)throw xl=!1,e=iu,iu=null,e;return(_l&1)!==0&&e.tag!==0&&Uo(),i=e.pendingLanes,(i&1)!==0?e===lu?_i++:(_i=0,lu=e):_i=0,dr(),null}function Uo(){if(gr!==null){var e=Li(_l),t=Xt.transition,n=Ce;try{if(Xt.transition=null,Ce=16>e?16:e,gr===null)var r=!1;else{if(e=gr,gr=null,_l=0,(Ee&6)!==0)throw Error(s(331));var o=Ee;for(Ee|=4,Z=e.current;Z!==null;){var i=Z,a=i.child;if((Z.flags&16)!==0){var f=i.deletions;if(f!==null){for(var m=0;m<f.length;m++){var E=f[m];for(Z=E;Z!==null;){var F=Z;switch(F.tag){case 0:case 11:case 15:ki(8,F,i)}var A=F.child;if(A!==null)A.return=F,Z=A;else for(;Z!==null;){F=Z;var M=F.sibling,Y=F.return;if(Rc(F),F===E){Z=null;break}if(M!==null){M.return=Y,Z=M;break}Z=Y}}}var ee=i.alternate;if(ee!==null){var re=ee.child;if(re!==null){ee.child=null;do{var Qe=re.sibling;re.sibling=null,re=Qe}while(re!==null)}}Z=i}}if((i.subtreeFlags&2064)!==0&&a!==null)a.return=i,Z=a;else e:for(;Z!==null;){if(i=Z,(i.flags&2048)!==0)switch(i.tag){case 0:case 11:case 15:ki(9,i,i.return)}var w=i.sibling;if(w!==null){w.return=i.return,Z=w;break e}Z=i.return}}var v=e.current;for(Z=v;Z!==null;){a=Z;var k=a.child;if((a.subtreeFlags&2064)!==0&&k!==null)k.return=a,Z=k;else e:for(a=v;Z!==null;){if(f=Z,(f.flags&2048)!==0)try{switch(f.tag){case 0:case 11:case 15:wl(9,f)}}catch(oe){He(f,f.return,oe)}if(f===a){Z=null;break e}var z=f.sibling;if(z!==null){z.return=f.return,Z=z;break e}Z=f.return}}if(Ee=o,dr(),$t&&typeof $t.onPostCommitFiberRoot=="function")try{$t.onPostCommitFiberRoot(On,e)}catch{}r=!0}return r}finally{Ce=n,Xt.transition=t}}return!1}function Qc(e,t,n){t=Oo(n,t),t=cc(e,t,1),e=pr(e,t,1),t=Et(),e!==null&&(tn(e,1,t),Lt(e,t))}function He(e,t,n){if(e.tag===3)Qc(e,e,n);else for(;t!==null;){if(t.tag===3){Qc(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(vr===null||!vr.has(r))){e=Oo(n,e),e=fc(t,e,1),t=pr(t,e,1),e=Et(),t!==null&&(tn(t,1,e),Lt(t,e));break}}t=t.return}}function Vd(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Et(),e.pingedLanes|=e.suspendedLanes&n,tt===e&&(st&n)===n&&(Xe===4||Xe===3&&(st&130023424)===st&&500>Fe()-ou?Xr(e,0):ru|=n),Lt(e,t)}function qc(e,t){t===0&&((e.mode&1)===0?t=1:(t=zn,zn<<=1,(zn&130023424)===0&&(zn=4194304)));var n=Et();e=Vn(e,t),e!==null&&(tn(e,t,n),Lt(e,n))}function Bd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qc(e,n)}function Wd(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(s(314))}r!==null&&r.delete(t),qc(e,n)}var Gc;Gc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||jt.current)Mt=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return Mt=!1,Rd(e,t,n);Mt=(e.flags&131072)!==0}else Mt=!1,De&&(t.flags&1048576)!==0&&Pa(t,nl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;gl(e,t),e=t.pendingProps;var o=Po(t,dt.current);Lo(t,n),o=Os(null,t,r,e,o,n);var i=zs();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Rt(r)?(i=!0,Zi(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Ts(t),o.updater=ml,t.stateNode=o,o._reactInternals=t,Bs(t,r,e,n),t=Qs(null,t,r,!0,i,n)):(t.tag=0,De&&i&&ys(t),xt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(gl(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Kd(r),e=cn(r,e),o){case 0:t=Ks(null,t,r,e,n);break e;case 1:t=Sc(null,t,r,e,n);break e;case 11:t=mc(null,t,r,e,n);break e;case 14:t=vc(null,t,r,cn(r.type,e),n);break e}throw Error(s(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:cn(r,o),Ks(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:cn(r,o),Sc(e,t,r,o,n);case 3:e:{if(kc(t),e===null)throw Error(s(387));r=t.pendingProps,i=t.memoizedState,o=i.element,za(e,t),ul(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Oo(Error(s(423)),t),t=xc(e,t,r,n,o);break e}else if(r!==o){o=Oo(Error(s(424)),t),t=xc(e,t,r,n,o);break e}else for(Wt=ar(t.stateNode.containerInfo.firstChild),Bt=t,De=!0,an=null,n=Aa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ro(),r===o){t=Wn(e,t,n);break e}xt(e,t,r,n)}t=t.child}return t;case 5:return Ua(t),e===null&&ks(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,ds(r,o)?a=null:i!==null&&ds(r,i)&&(t.flags|=32),wc(e,t),xt(e,t,a,n),t.child;case 6:return e===null&&ks(t),null;case 13:return Ec(e,t,n);case 4:return js(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Mo(t,null,r,n):xt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:cn(r,o),mc(e,t,r,o,n);case 7:return xt(e,t,t.pendingProps,n),t.child;case 8:return xt(e,t,t.pendingProps.children,n),t.child;case 12:return xt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,Le(il,r._currentValue),r._currentValue=a,i!==null)if(un(i.value,a)){if(i.children===o.children&&!jt.current){t=Wn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var f=i.dependencies;if(f!==null){a=i.child;for(var m=f.firstContext;m!==null;){if(m.context===r){if(i.tag===1){m=Bn(-1,n&-n),m.tag=2;var E=i.updateQueue;if(E!==null){E=E.shared;var F=E.pending;F===null?m.next=m:(m.next=F.next,F.next=m),E.pending=m}}i.lanes|=n,m=i.alternate,m!==null&&(m.lanes|=n),Ns(i.return,n,t),f.lanes|=n;break}m=m.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(s(341));a.lanes|=n,f=a.alternate,f!==null&&(f.lanes|=n),Ns(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}xt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Lo(t,n),o=bt(o),r=r(o),t.flags|=1,xt(e,t,r,n),t.child;case 14:return r=t.type,o=cn(r,t.pendingProps),o=cn(r.type,o),vc(e,t,r,o,n);case 15:return gc(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:cn(r,o),gl(e,t),t.tag=1,Rt(r)?(e=!0,Zi(t)):e=!1,Lo(t,n),uc(t,r,o),Bs(t,r,o,n),Qs(null,t,r,!0,e,n);case 19:return Cc(e,t,n);case 22:return yc(e,t,n)}throw Error(s(156,t.tag))};function bc(e,t){return Xo(e,t)}function Hd(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jt(e,t,n,r){return new Hd(e,t,n,r)}function du(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Kd(e){if(typeof e=="function")return du(e)?1:0;if(e!=null){if(e=e.$$typeof,e===be)return 11;if(e===Ie)return 14}return 2}function Sr(e,t){var n=e.alternate;return n===null?(n=Jt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Tl(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")du(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case ne:return Zr(n.children,o,i,t);case me:a=8,o|=8;break;case Se:return e=Jt(12,n,t,o|2),e.elementType=Se,e.lanes=i,e;case Je:return e=Jt(13,n,t,o),e.elementType=Je,e.lanes=i,e;case qe:return e=Jt(19,n,t,o),e.elementType=qe,e.lanes=i,e;case _e:return jl(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case H:a=10;break e;case xe:a=9;break e;case be:a=11;break e;case Ie:a=14;break e;case Ue:a=16,r=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return t=Jt(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Zr(e,t,n,r){return e=Jt(7,e,r,t),e.lanes=n,e}function jl(e,t,n,r){return e=Jt(22,e,r,t),e.elementType=_e,e.lanes=n,e.stateNode={isHidden:!1},e}function hu(e,t,n){return e=Jt(6,e,null,t),e.lanes=n,e}function pu(e,t,n){return t=Jt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Qd(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=wn(0),this.expirationTimes=wn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wn(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function mu(e,t,n,r,o,i,a,f,m){return e=new Qd(e,t,n,f,m),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Jt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ts(i),e}function qd(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:U,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Yc(e){if(!e)return fr;e=e._reactInternals;e:{if(An(e)!==e||e.tag!==1)throw Error(s(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Rt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(s(171))}if(e.tag===1){var n=e.type;if(Rt(n))return _a(e,n,t)}return t}function Xc(e,t,n,r,o,i,a,f,m){return e=mu(n,r,!0,e,o,i,a,f,m),e.context=Yc(null),n=e.current,r=Et(),o=yr(n),i=Bn(r,o),i.callback=t??null,pr(n,i,o),e.current.lanes=o,tn(e,o,r),Lt(e,r),e}function Rl(e,t,n,r){var o=t.current,i=Et(),a=yr(o);return n=Yc(n),t.context===null?t.context=n:t.pendingContext=n,t=Bn(i,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=pr(o,t,a),e!==null&&(hn(e,o,a,i),sl(e,o,a)),a}function Ml(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Jc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function vu(e,t){Jc(e,t),(e=e.alternate)&&Jc(e,t)}function Gd(){return null}var Zc=typeof reportError=="function"?reportError:function(e){console.error(e)};function gu(e){this._internalRoot=e}Fl.prototype.render=gu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));Rl(e,t,null,null)},Fl.prototype.unmount=gu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Yr(function(){Rl(null,e,null,null)}),t[Dn]=null}};function Fl(e){this._internalRoot=e}Fl.prototype.unstable_scheduleHydration=function(e){if(e){var t=rn();e={blockedOn:null,target:e,priority:t};for(var n=0;n<on.length&&t!==0&&t<on[n].priority;n++);on.splice(n,0,e),n===0&&ln(e)}};function yu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ll(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function ef(){}function bd(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var E=Ml(a);i.call(E)}}var a=Xc(t,r,e,0,null,!1,!1,"",ef);return e._reactRootContainer=a,e[Dn]=a.current,ui(e.nodeType===8?e.parentNode:e),Yr(),a}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var f=r;r=function(){var E=Ml(m);f.call(E)}}var m=mu(e,0,!1,null,null,!1,!1,"",ef);return e._reactRootContainer=m,e[Dn]=m.current,ui(e.nodeType===8?e.parentNode:e),Yr(function(){Rl(t,m,n,r)}),m}function Al(e,t,n,r,o){var i=n._reactRootContainer;if(i){var a=i;if(typeof o=="function"){var f=o;o=function(){var m=Ml(a);f.call(m)}}Rl(t,a,e,o)}else a=bd(n,t,e,o,r);return Ml(a)}Ai=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=jr(t.pendingLanes);n!==0&&(Jo(t,n|1),Lt(t,Fe()),(Ee&6)===0&&(Io=Fe()+500,dr()))}break;case 13:Yr(function(){var r=Vn(e,1);if(r!==null){var o=Et();hn(r,e,1,o)}}),vu(e,1)}},Sn=function(e){if(e.tag===13){var t=Vn(e,134217728);if(t!==null){var n=Et();hn(t,e,134217728,n)}vu(e,134217728)}},ho=function(e){if(e.tag===13){var t=yr(e),n=Vn(e,t);if(n!==null){var r=Et();hn(n,e,t,r)}vu(e,t)}},rn=function(){return Ce},Oi=function(e,t){var n=Ce;try{return Ce=e,t()}finally{Ce=n}},Ho=function(e,t,n){switch(t){case"input":if(Er(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=Xi(r);if(!o)throw Error(s(90));xr(r),Er(r,o)}}}break;case"textarea":Yn(e,n);break;case"select":t=n.value,t!=null&&zt(e,!!n.multiple,t,!1)}},Fn=au,Nr=Yr;var Yd={usingClientEntryPoint:!1,Events:[fi,Co,Xi,Ko,Qo,au]},Ci={findFiberByHostInstance:Br,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Xd={bundleType:Ci.bundleType,version:Ci.version,rendererPackageName:Ci.rendererPackageName,rendererConfig:Ci.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:I.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=bo(e),e===null?null:e.stateNode},findFiberByHostInstance:Ci.findFiberByHostInstance||Gd,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ol=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ol.isDisabled&&Ol.supportsFiber)try{On=Ol.inject(Xd),$t=Ol}catch{}}return At.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yd,At.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!yu(t))throw Error(s(200));return qd(e,t,null,n)},At.createRoot=function(e,t){if(!yu(e))throw Error(s(299));var n=!1,r="",o=Zc;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=mu(e,1,!1,null,null,n,!1,r,o),e[Dn]=t.current,ui(e.nodeType===8?e.parentNode:e),new gu(t)},At.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=bo(t),e=e===null?null:e.stateNode,e},At.flushSync=function(e){return Yr(e)},At.hydrate=function(e,t,n){if(!Ll(t))throw Error(s(200));return Al(null,e,t,!0,n)},At.hydrateRoot=function(e,t,n){if(!yu(e))throw Error(s(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",a=Zc;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=Xc(t,null,e,1,n??null,o,!1,i,a),e[Dn]=t.current,ui(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Fl(t)},At.render=function(e,t,n){if(!Ll(t))throw Error(s(200));return Al(null,e,t,!1,n)},At.unmountComponentAtNode=function(e){if(!Ll(e))throw Error(s(40));return e._reactRootContainer?(Yr(function(){Al(null,null,e,!1,function(){e._reactRootContainer=null,e[Dn]=null})}),!0):!1},At.unstable_batchedUpdates=au,At.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Ll(n))throw Error(s(200));if(e==null||e._reactInternals===void 0)throw Error(s(38));return Al(e,t,n,!1,r)},At.version="18.3.1-next-f1338f8080-20240426",At}var af;function sh(){if(af)return ku.exports;af=1;function u(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(l){console.error(l)}}return u(),ku.exports=lh(),ku.exports}var cf;function uh(){if(cf)return zl;cf=1;var u=sh();return zl.createRoot=u.createRoot,zl.hydrateRoot=u.hydrateRoot,zl}var ah=uh(),C=Vu();function ff(u){return[...u.toLocaleLowerCase().matchAll(/[\p{L}\p{N}]+(?:['’\-][\p{L}\p{N}]+)*/gu)].map(l=>({value:l[0],start:l.index??0}))}function _u(u,l){if(!l.length||l.length>u.length)return!1;for(let s=0;s<=u.length-l.length;s++)if(l.every((c,d)=>u[s+d]===c))return!0;return!1}function ch(u,l){const s=u.trim(),c=ff(s),d=ff(l).map(({value:_})=>_),g=c.map(({value:_})=>_);if(g.join(" ")==="it seems like"&&_u(d,g))return"";if(c.length<5||d.length<5)return s;if(_u(d,g))return"";for(let _=c.length-1;_>=5;_--)if(_u(d,g.slice(0,_)))return s.slice(c[_].start).replace(/^[\s,.;:!?—-]+/u,"").trim();return s}class fh{constructor(l,s,c=()=>{},d=()=>{}){te(this,"recordings",[]);te(this,"transcripts",[]);te(this,"hearing",!1);te(this,"pumpingEpoch",null);te(this,"active",null);te(this,"epoch",0);te(this,"transcribe");te(this,"send");te(this,"report");te(this,"changed");this.transcribe=l,this.send=s,this.report=c,this.changed=d}get busy(){return this.pumpingEpoch!==null||this.recordings.length>0||this.transcripts.length>0}speechStarted(){this.hearing=!0,this.changed()}speechEnded(l){this.hearing=!1,this.recordings.push(l),this.changed(),this.pump()}speechDiscarded(){this.hearing=!1,this.changed(),this.pump()}reset(){var l;this.epoch++,(l=this.active)==null||l.abort(),this.active=null,this.recordings=[],this.transcripts=[],this.hearing=!1,this.pumpingEpoch=null,this.changed()}pump(){const l=this.epoch;this.pumpingEpoch!==l&&(this.pumpingEpoch=l,this.changed(),(async()=>{try{for(;this.recordings.length&&l===this.epoch;){const c=this.recordings.shift(),d=new AbortController;this.active=d;try{const g=(await this.transcribe(c,d.signal)).trim();l===this.epoch&&g&&this.transcripts.push(g)}catch(g){if(l===this.epoch&&!d.signal.aborted)throw g}finally{this.active===d&&(this.active=null),l===this.epoch&&this.changed()}}if(l!==this.epoch||this.hearing||this.recordings.length||!this.transcripts.length)return;const s=this.transcripts.join(" ").trim();this.transcripts=[],this.changed(),s&&await this.send(s)}catch(s){l===this.epoch&&this.report(s)}finally{this.pumpingEpoch===l&&(this.pumpingEpoch=null,this.changed(),l===this.epoch&&!this.hearing&&(this.recordings.length||this.transcripts.length)&&this.pump())}})())}}const dh=2e3;class hh{constructor(l=dh){te(this,"tail",Promise.resolve());te(this,"_active",!1);te(this,"_flushing",!1);te(this,"epoch",0);te(this,"timeoutMs");te(this,"invalid",new WeakSet);this.timeoutMs=l}get acceptsCallbacks(){return this._active||this._flushing}pause(l){if(this.invalid.has(l))return Promise.reject(new Error("VAD transition is invalidated."));const s=this.epoch;return this._active=!1,this.enqueue(async()=>{s===this.epoch&&await this.withTimeout(l,l.pause(),"pause")})}start(l){if(this.invalid.has(l))return Promise.reject(new Error("VAD transition is invalidated."));const s=this.epoch;return this.enqueue(async()=>{s===this.epoch&&(await this.withTimeout(l,l.start(),"start"),s===this.epoch&&(this._active=!0))})}flush(l){if(this.invalid.has(l))return Promise.reject(new Error("VAD transition is invalidated."));const s=this.epoch;return this.enqueue(async()=>{if(s===this.epoch){this._flushing=!0;try{await this.withTimeout(l,l.pause(),"pause"),await this.withTimeout(l,l.start(),"start"),s===this.epoch&&(this._active=!0)}finally{s===this.epoch&&(this._flushing=!1)}}})}beginSession(){this.epoch++,this.tail=Promise.resolve(),this._active=!1,this._flushing=!1}deactivate(){this.epoch++,this.tail=Promise.resolve(),this._active=!1,this._flushing=!1}isInvalid(l){return this.invalid.has(l)}enqueue(l){const s=this.tail.then(l,l);return this.tail=s.catch(()=>{}),s}withTimeout(l,s,c){return new Promise((d,g)=>{const x=globalThis.setTimeout(()=>{this.invalidate(l),g(new Error(`VAD ${c} timed out.`))},this.timeoutMs);s.then(()=>{globalThis.clearTimeout(x),d()},_=>{globalThis.clearTimeout(x),g(_)})})}invalidate(l){this.invalid.add(l),this.epoch++,this.tail=Promise.resolve(),this._active=!1,this._flushing=!1}}function ph(u,l,s,c,d,g){return u===l&&s===c&&!d&&g}const mh=10,vh=2;function gh(u){const l=u.trim().replace(/["'“”‘’«»)\]}]+$/u,"").trimEnd();return/[.?!]$/.test(l)?!/(\.\.|…)$/.test(l):!1}function yh(u){return u.split(/\s+/).filter(l=>/[\p{L}\p{N}]/u.test(l)).length}function wh(u){const{text:l,resultRevision:s,revision:c,quietFrames:d}=u;return l===void 0||s!==c||d<mh?!1:gh(l)&&yh(l)>=vh}const Vl=.45,Bu=.3,jf=160,Rf=320,Bo=700,Mf=300,Ff=2e3,Ru=100;function Wu(u){if(!Number.isFinite(u))return Bo;const l=Math.round(u/Ru)*Ru;return Math.min(Ff,Math.max(Mf,l))}function Sh(u=Bo){return{positiveSpeechThreshold:Vl,negativeSpeechThreshold:Bu,minSpeechMs:jf,preSpeechPadMs:Rf,redemptionMs:Wu(u)}}const kh=350,xh=20;class Eh{constructor(l,s,c=()=>{}){te(this,"preRoll",[]);te(this,"current",null);te(this,"segments",new Set);te(this,"ended",new WeakMap);te(this,"request");te(this,"preview");te(this,"endpoint");te(this,"speechThreshold",Vl);this.request=l,this.preview=s,this.endpoint=c}frame(l,s){const c=s.slice(),d=this.current;if(!d){this.preRoll.push(c),this.preRoll.length>14&&this.preRoll.shift();return}d.frames.push(c),l>=this.speechThreshold?(d.revision++,d.quiet=0):d.quiet++;const g=d.confirmed&&d.overActiveTurn&&d.requested===-1&&d.confirmedAt!==null&&d.frames.length-d.confirmedAt>=xh;d.confirmed&&!d.pending&&d.requested!==d.revision&&(g||d.quiet>=6||d.frames.length-d.lastRequest>=63)&&this.speculate(d),this.checkEndpoint(d)}begin(l=!1){const s={frames:this.preRoll,revision:1,quiet:0,confirmed:!1,requested:-1,lastRequest:0,controller:new AbortController,endpointed:!1,overActiveTurn:l,confirmedAt:null};this.preRoll=[],this.current=s,this.segments.add(s),this.preview("")}confirm(){this.current&&(this.current.confirmed=!0,this.current.confirmedAt=this.current.frames.length)}end(l){this.current&&this.ended.set(l,this.current),this.current=null,this.preRoll=[]}async finish(l,s){var g;const c=this.ended.get(l);if(this.ended.delete(l),!c)return this.request(l,s);const d=()=>c.controller.abort(s.reason);s.addEventListener("abort",d,{once:!0}),s.aborted&&d();try{const x=c.pending;return x&&!await _h(x,kh,s)&&c.controller.abort(new DOMException("Speculative transcription timed out.","AbortError")),s.throwIfAborted(),((g=c.result)==null?void 0:g.revision)===c.revision&&c.result.text.trim()?c.result.text:await this.request(l,s)}finally{s.removeEventListener("abort",d),this.segments.delete(c)}}discard(){this.current&&(this.current.controller.abort(),this.segments.delete(this.current)),this.current=null,this.preRoll=[],this.preview("")}reset(){for(const l of this.segments)l.controller.abort();this.segments.clear(),this.ended=new WeakMap,this.discard()}samples(l){const s=new Float32Array(l.frames.reduce((d,g)=>d+g.length,0));let c=0;for(const d of l.frames)s.set(d,c),c+=d.length;return s}checkEndpoint(l){var s,c;l.endpointed||this.current!==l||!l.confirmed||wh({text:(s=l.result)==null?void 0:s.text,resultRevision:(c=l.result)==null?void 0:c.revision,revision:l.revision,quietFrames:l.quiet})&&(l.endpointed=!0,this.endpoint())}speculate(l){const s=l.revision;l.requested=s,l.lastRequest=l.frames.length,l.pending=this.request(this.samples(l),l.controller.signal).then(c=>{l.controller.signal.aborted||(l.result={revision:s,text:c},this.current===l&&(this.preview(c),this.checkEndpoint(l)))}).catch(()=>{}).finally(()=>{l.pending=void 0})}}function _h(u,l,s){return new Promise((c,d)=>{if(s.aborted)return d(s.reason);const g=globalThis.setTimeout(L,l),x=()=>{j(),d(s.reason)},_=()=>{j(),c(!0)};function L(){j(),c(!1)}function j(){globalThis.clearTimeout(g),s.removeEventListener("abort",x)}s.addEventListener("abort",x,{once:!0}),u.then(_,_)})}const Mu=new Set(["um","uh","uhm","erm","hmm","mm","mhm","ah","oh"]),df=2,Ch=1200,Nh=700;function Fu(u){return[...u.toLocaleLowerCase().matchAll(/[\p{L}\p{N}]+(?:['’\-][\p{L}\p{N}]+)*/gu)].map(l=>l[0])}function Ph(u){return Fu(u).filter(l=>!Mu.has(l))}function Th(u,l,s,c){let d=0;for(let g=0;g<u.length;g++)if(u[g]!==l[s+g]&&(d++,d>c))return!1;return!0}function jh(u,l){let s=null;for(let c=0;c<u.length;c++)for(let d=u.length;d>c;d--){const g=d-c;if(s&&g<=s.end-s.start)break;if(g<2||g>l.length)continue;const x=Math.floor(g/4),_=u.slice(c,d);let L=!1;for(let j=0;j<=l.length-g;j++)if(Th(_,l,j,x)){L=!0;break}if(L){s={start:c,end:d};break}}return s}function Rh(u,l){const s=Fu(u);if(s.filter(g=>!Mu.has(g)).length<df)return{echo:!1,meaningful:!1};const d=Fu(l);if(d.length){const g=jh(s,d);if(g&&s.filter((_,L)=>(L<g.start||L>=g.end)&&!Mu.has(_)).length<df)return{echo:!0,meaningful:!1}}return{echo:!1,meaningful:!0}}function Lu(u,l){return Rh(u,l).meaningful}const Mh=["stop","wait","hold on","hang on","pause","shut up","enough"],Fh=Mh.map(u=>new RegExp(`\\b${u.replace(/ /g,"\\s+")}\\b`,"iu"));function Lf(u,l){for(const s of Fh){if(!s.test(u)||s.test(l))continue;const c=new RegExp(s.source,`${s.flags}g`),d=u.replace(c," ").replace(/\s+/gu," ").trim().replace(/^[\s,.;:!?—-]+/u,"");return{remainder:Ph(d).length?d:""}}return null}function hf(u,l){return Lf(u,l)!==null}function Af(u){return Math.max(.2,u.trim().length/15)}const Lh=1500,Ah=300,Oh=1e4;function pf(u,l,s){const c=u.filter(d=>s-(d.startedAt+d.seconds*1e3)<Oh);return c.push({text:l,startedAt:s,seconds:Af(l)}),c}function zh(u,l,s){const c=l-Lh,d=s+Ah;return u.filter(g=>g.startedAt+g.seconds*1e3>=c&&g.startedAt<=d).map(g=>g.text).join(" ")}const Dh=8,Ih=2.5;function Uh(u,l){return l===null?!1:u<l*Ih}class $h{constructor(l=()=>Date.now()){te(this,"mode","idle");te(this,"interruptOnConfirm",!1);te(this,"interrupted",!1);te(this,"startedAt",0);te(this,"wordPathBlockedFlag",!1);te(this,"now");this.now=l}get idle(){return this.mode==="idle"}get wordPathBlocked(){return this.wordPathBlockedFlag}blockWordPath(){(this.mode==="candidate"||this.mode==="accepted")&&(this.wordPathBlockedFlag=!0)}speechStart(l){return this.mode="candidate",this.interruptOnConfirm=l,this.interrupted=!1,this.wordPathBlockedFlag=!1,this.startedAt=this.now(),{duck:l,begin:!0,accepted:!1}}speechRealStart(){return this.mode==="candidate"?(this.mode="accepted",{keepDucked:this.interruptOnConfirm,begin:!1,accepted:!0}):{keepDucked:!1,begin:!1,accepted:this.mode==="accepted"}}shouldInterruptNow(l,s){return this.mode!=="accepted"||!this.interruptOnConfirm||this.interrupted?!1:hf(l,s)?(this.interrupted=!0,!0):this.wordPathBlockedFlag?!1:Lu(l,s)?(this.interrupted=!0,!0):!1}speechEnd(l,s,c){const d=this.mode==="accepted",g=this.wordPathBlockedFlag;return d?!this.interruptOnConfirm||this.interrupted?(this.reset(),{accepted:!0,interrupt:!1,send:!0,deferDecision:!1,wordPathBlocked:g}):c?hf(l,s)||!g&&Lu(l,s)?(this.reset(),{accepted:!0,interrupt:!0,send:!0,deferDecision:!1,wordPathBlocked:g}):(this.reset(),{accepted:!0,interrupt:!1,send:!1,deferDecision:!1,wordPathBlocked:g}):(this.reset(),{accepted:!0,interrupt:!1,send:!0,deferDecision:!0,wordPathBlocked:g}):(this.reset(),{accepted:!1,interrupt:!1,send:!1,deferDecision:!1,wordPathBlocked:g})}reset(){this.mode="idle",this.interruptOnConfirm=!1,this.interrupted=!1,this.wordPathBlockedFlag=!1,this.startedAt=0}}function Cu(u,l,s,c){return async d=>{d.throwIfAborted();const g=l.createAnalyser();g.fftSize=128,g.connect(s);const x=l.createGain();x.connect(g);const _=l.createBufferSource();_.buffer=u,_.connect(x),await new Promise((L,j)=>{const K=()=>{_.disconnect(),x.disconnect(),g.disconnect()},D=()=>{_.onended=null;const O=l.currentTime;x.gain.cancelScheduledValues(O),x.gain.setValueAtTime(x.gain.value,O),x.gain.linearRampToValueAtTime(0,O+to);try{_.stop(O+to)}catch{}setTimeout(K,to*1e3+20),j(d.reason)};_.onended=()=>{d.removeEventListener("abort",D),K(),L()},d.addEventListener("abort",D,{once:!0}),_.start(),c(g),d.aborted&&D()})}}const Vh=.1,Bh=.02,Wh=.5,Hh=.3,to=.005;function Kh(){return{nextTime:0,started:!1,underrunLead:Bh,restarted:!1}}function Qh(u,l,s){let c,d;return u.started?u.nextTime<l?(c=l+u.underrunLead,u.underrunLead=Math.min(Wh,u.underrunLead*2),d=!0):(c=u.nextTime,d=!1):(c=l+Vh,d=!0),u.started=!0,u.restarted=d,u.nextTime=c+s,c}function qh(u,l){return u.reduce((s,c)=>s+c.length,0)/l}function Gh(u,l){return u>=Hh}function bh(u,l,s,c){return u.started&&!c&&u.nextTime<l&&s<u.underrunLead}async function Yh(u,l,s,c,d,g){const x=u.getReader(),_=[];let L=null,j=!1,K=0,D=null;const O=()=>{const I=D;D=null,I==null||I()},$=()=>{x.cancel().catch(()=>{})};g.addEventListener("abort",$,{once:!0});const J=I=>{let Q=I;L!==null&&(Q=new Uint8Array(I.length+1),Q[0]=L,Q.set(I,1),L=null),Q.length%2&&(L=Q[Q.length-1],Q=Q.subarray(0,Q.length-1));const U=new DataView(Q.buffer,Q.byteOffset,Q.byteLength),ne=new Float32Array(Q.length/2);for(let me=0;me<ne.length;me++){const Se=U.getInt16(me*2,!0);ne[me]=Se<0?Se/32768:Se/32767}return ne};let le,N;const b=new Promise((I,Q)=>{le=I,N=Q}),G=(async()=>{try{for(;;){const{done:I,value:Q}=await x.read();if(I)break;if(!(Q!=null&&Q.length))continue;const U=J(Q);U.length&&(K+=U.length,_.push(U),Gh(K/l,!1)&&le(),O())}if(!K)throw new Error("The speech server sent no audio");return K/l}finally{j=!0,g.removeEventListener("abort",$),O()}})();G.catch(I=>N(I)),G.then(()=>le(),()=>{}),await b;const ge=(async I=>{I.throwIfAborted();const Q=s.createAnalyser();Q.fftSize=128,Q.connect(c);const U=s.createGain();U.connect(Q);const ne=new Set,me=Kh();let Se=!1;try{await new Promise((H,xe)=>{const be=()=>{j&&!_.length&&!ne.size&&H()},Je=()=>{if(I.aborted)return;const Ie=s.currentTime,Ue=qh(_,l);if(_.length&&!bh(me,Ie,Ue,j)){const _e=_.reduce((ie,ue)=>ie+ue.length,0),V=s.createBuffer(1,_e,l),se=V.getChannelData(0);let W=0;for(const ie of _.splice(0))se.set(ie,W),W+=ie.length;const y=s.createBufferSource();y.buffer=V,y.connect(U);const T=Qh(me,Ie,V.duration);me.restarted&&(U.gain.cancelScheduledValues(T),U.gain.setValueAtTime(0,T),U.gain.linearRampToValueAtTime(1,T+to)),y.start(T),ne.add(y),y.onended=()=>{ne.delete(y),y.disconnect(),be()},Se||(Se=!0,d(Q))}be(),(!j||_.length)&&(D=Je)},qe=()=>{D=null;const Ie=s.currentTime;U.gain.cancelScheduledValues(Ie),U.gain.setValueAtTime(U.gain.value,Ie),U.gain.linearRampToValueAtTime(0,Ie+to);for(const Ue of ne){Ue.onended=null;try{Ue.stop(Ie+to)}catch{}}ne.clear(),$(),xe(I.reason)};I.addEventListener("abort",qe,{once:!0}),Je()}),U.disconnect(),Q.disconnect()}catch(H){throw setTimeout(()=>{try{U.disconnect()}catch{}try{Q.disconnect()}catch{}},to*1e3+20),H}});return ge.completed=G,ge}const Xh=300;class Jh{constructor(l,s,c){te(this,"run",this.fresh());te(this,"synthesize");te(this,"changed");te(this,"reportError");this.synthesize=l,this.changed=s,this.reportError=c}get busy(){const l=this.run;return l.held||l.generating||l.playing!==null||l.text.length>0||l.audio.length>0}enqueue(l){this.run.text.push(...l),this.pump(this.run)}hold(){const l=this.run;if(l.held||!(l.playing!==null||l.generating||l.audio.length>0))return!1;const c=l.audio.map(d=>d.text);return l.audio=[],l.text=[...c,...l.text],l.playing=null,l.generating=!1,l.held=!0,l.controller.abort(),l.controller=new AbortController,this.changed(),!0}resume(l){const s=this.run;s.held&&(s.held=!1,l.trim()&&s.text.unshift(l),this.pump(s))}cancel(){const l=this.run;this.run=this.fresh(),l.text=[],l.audio=[],l.controller.abort(),this.changed()}fresh(){return{controller:new AbortController,text:[],audio:[],hasDispatchedSpeech:!1,generating:!1,playing:null,held:!1}}fail(l,s){l!==this.run||l.controller.signal.aborted||l.held||(this.cancel(),this.reportError(s))}pump(l){if(l!==this.run||l.controller.signal.aborted)return;if(l.held){this.changed();return}const s=l.controller.signal;if(!l.playing&&l.audio.length){const c=l.audio.shift();l.playing=c.text,(async()=>{try{await c.prepared(s)}catch(d){this.fail(l,d)}finally{l.playing=null,l===this.run&&this.pump(l)}})()}if(!l.generating&&l.audio.length<2&&l.text.length){let c=l.text.shift();if(l.hasDispatchedSpeech)for(;l.text.length&&c.length+l.text[0].length+1<=Xh;)c+=` ${l.text.shift()}`;l.hasDispatchedSpeech=!0,l.generating=!0,(async()=>{var d;try{const g=await this.synthesize(c,s);l===this.run&&!s.aborted&&l.audio.push({text:c,prepared:g}),(d=g.completed)==null||d.catch(x=>this.fail(l,x))}catch(g){this.fail(l,g)}finally{l.generating=!1,l===this.run&&this.pump(l)}})()}this.changed()}}const Zh=/[.!?]\s+/g;function ep(u){const l=[0];for(const s of u.matchAll(Zh)){const c=s.index+s[0].length;c<u.length&&l.push(c)}return l}const tp=.98;function np(u,l){const s=u.trim();if(!s||!Number.isFinite(l)||l>=tp)return"";const c=Math.max(0,Math.min(1,l)),d=Math.round(c*s.length),g=ep(s);let x=g[0];for(const _ of g)if(_<=d)x=_;else break;return s.slice(x).trim()}const rp=1500,op=400;async function ip(u,l,s,c=fetch){if(!l.trim())return"";const d=new AbortController,g=setTimeout(()=>d.abort(),rp);try{const x=await c("/api/voice/bridge",{method:"POST",headers:{"Content-Type":"application/json",...s},body:JSON.stringify({said:u.slice(-op),resume:l}),signal:d.signal});if(!x.ok)return"";const _=await x.json().catch(()=>({}));return typeof(_==null?void 0:_.bridge)=="string"?_.bridge:""}catch{return""}finally{clearTimeout(g)}}function lp(u,l){const s=u.trim();return s?`${s} ${l}`:l}const sp="modulepreload",up=function(u){return"/"+u},mf={},Of=function(l,s,c){let d=Promise.resolve();if(s&&s.length>0){let x=function(j){return Promise.all(j.map(K=>Promise.resolve(K).then(D=>({status:"fulfilled",value:D}),D=>({status:"rejected",reason:D}))))};document.getElementsByTagName("link");const _=document.querySelector("meta[property=csp-nonce]"),L=(_==null?void 0:_.nonce)||(_==null?void 0:_.getAttribute("nonce"));d=x(s.map(j=>{if(j=up(j),j in mf)return;mf[j]=!0;const K=j.endsWith(".css"),D=K?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${j}"]${D}`))return;const O=document.createElement("link");if(O.rel=K?"stylesheet":sp,K||(O.as="script"),O.crossOrigin="",O.href=j,L&&O.setAttribute("nonce",L),document.head.appendChild(O),K)return new Promise(($,J)=>{O.addEventListener("load",$),O.addEventListener("error",()=>J(new Error(`Unable to preload CSS for ${j}`)))})}))}function g(x){const _=new Event("vite:preloadError",{cancelable:!0});if(_.payload=x,window.dispatchEvent(_),!_.defaultPrevented)throw x}return d.then(x=>{for(const _ of x||[])_.status==="rejected"&&g(_.reason);return l().catch(g)})},Au="/voice-assets/",ap=["silero_vad_v5.onnx","vad.worklet.bundle.min.js","ort-wasm-simd-threaded.mjs","ort-wasm-simd-threaded.wasm"];let Nu=null;function zf(){return Nu??(Nu=Of(()=>import("./index-CeWj4ejR.js").then(u=>u.i),__vite__mapDeps([0,1])).catch(u=>{throw Nu=null,u})),Nu}let vf=!1;function cp(){if(!vf){vf=!0,zf().catch(()=>{});for(const u of ap)fetch(`${Au}${u}`,{priority:"low"}).then(l=>l.ok?l.arrayBuffer():void 0).catch(()=>{})}}const Df="voice-assistant.vad-redemption-ms";function If(u){return typeof window>"u"?void 0:window.localStorage}function Pu(u){var l;try{const s=(l=If(u))==null?void 0:l.getItem(Df);if(s==null)return Bo;const c=Number(s);return Number.isFinite(c)?Wu(c):Bo}catch{return Bo}}function fp(u,l){var c;const s=Wu(u);try{(c=If(l))==null||c.setItem(Df,String(s))}catch{}return s}const Ou=512,zu=16e3,dp=2e4,hp={frameSamples:Ou,sampleRate:zu,positiveSpeechThreshold:Vl,negativeSpeechThreshold:Bu,minSpeechMs:jf,redemptionMs:Bo,preSpeechPadMs:Rf,maxSpeechMs:dp,noiseFloorWindowFrames:100,noiseFloorPercentile:.3,noiseFloorMarginDb:6,noiseFloorRangeDb:24,minFloorRms:.0015,submitUserSpeechOnPause:!1};function pp(u){let l=0;for(let s=0;s<u.length;s++)l+=u[s]*u[s];return Math.sqrt(l/Math.max(1,u.length))}function gf(u){return 20*Math.log10(Math.max(u,1e-8))}function mp(u){return Math.min(1,Math.max(0,u))}function vp(u){const l=u.reduce((d,g)=>d+g.length,0),s=new Float32Array(l);let c=0;for(const d of u)s.set(d,c),c+=d.length;return s}class gp{constructor(l={}){te(this,"options");te(this,"msPerFrame");te(this,"minSpeechFrames",1);te(this,"redemptionFrames",1);te(this,"preSpeechPadFrames",0);te(this,"maxSpeechFrames",1);te(this,"state","silence");te(this,"ring",[]);te(this,"recorded",[]);te(this,"activeFrames",0);te(this,"silenceFrames",0);te(this,"noiseFloorSamples",[]);te(this,"active",!0);this.options={...hp,...l},this.msPerFrame=this.options.frameSamples/this.options.sampleRate*1e3,this.recalculateFrameCounts()}recalculateFrameCounts(){this.minSpeechFrames=Math.max(1,Math.ceil(this.options.minSpeechMs/this.msPerFrame)),this.redemptionFrames=Math.max(1,Math.ceil(this.options.redemptionMs/this.msPerFrame)),this.preSpeechPadFrames=Math.max(0,Math.ceil(this.options.preSpeechPadMs/this.msPerFrame)),this.maxSpeechFrames=Math.max(this.minSpeechFrames,Math.ceil(this.options.maxSpeechMs/this.msPerFrame))}setOptions(l){this.options={...this.options,...l},this.recalculateFrameCounts()}get noiseFloor(){return this.estimateNoiseFloor()}get speaking(){return this.state==="speech"}reset(){this.state="silence",this.ring=[],this.recorded=[],this.activeFrames=0,this.silenceFrames=0}resume(){this.active=!0}pause(){return this.active=!1,this.options.submitUserSpeechOnPause?this.endSegment():(this.reset(),[])}endSegment(){const l=[];return this.state==="speech"?l.push({type:"speech-end",samples:vp(this.recorded)}):this.state==="maybe"&&l.push({type:"misfire"}),this.reset(),l}process(l){if(!this.active)return{probability:0,events:[]};const s=pp(l);this.state==="silence"&&this.pushNoiseFloorSample(s);const c=this.estimateNoiseFloor(),d=mp((gf(s)-gf(c)-this.options.noiseFloorMarginDb)/this.options.noiseFloorRangeDb),g=[];if(this.state==="silence")return this.pushRing(l),d>=this.options.positiveSpeechThreshold&&(this.state="maybe",this.recorded=[...this.ring],this.activeFrames=1,this.silenceFrames=0,g.push({type:"speech-start"})),{probability:d,events:g};this.recorded.push(l),d>=this.options.negativeSpeechThreshold?(this.silenceFrames=0,this.activeFrames++,this.state==="maybe"&&this.activeFrames>=this.minSpeechFrames&&(this.state="speech",g.push({type:"speech-real-start"}))):this.silenceFrames++;const _=this.recorded.length>=this.maxSpeechFrames,L=this.silenceFrames>=this.redemptionFrames;return(_||L)&&g.push(...this.endSegment()),{probability:d,events:g}}pushRing(l){this.ring.push(l),this.ring.length>this.preSpeechPadFrames&&this.ring.shift()}pushNoiseFloorSample(l){this.noiseFloorSamples.push(l),this.noiseFloorSamples.length>this.options.noiseFloorWindowFrames&&this.noiseFloorSamples.shift()}estimateNoiseFloor(){if(this.noiseFloorSamples.length===0)return this.options.minFloorRms;const l=[...this.noiseFloorSamples].sort((c,d)=>c-d),s=Math.min(l.length-1,Math.floor(l.length*this.options.noiseFloorPercentile));return Math.max(this.options.minFloorRms,l[s])}}class yp{constructor(l,s,c){te(this,"inputBuffer",[]);this.nativeSampleRate=l,this.targetSampleRate=s,this.targetFrameSize=c}process(l){const s=[];for(const c of l)for(this.inputBuffer.push(c);this.hasEnoughDataForFrame();)s.push(this.generateOutputFrame());return s}hasEnoughDataForFrame(){return this.inputBuffer.length*this.targetSampleRate/this.nativeSampleRate>=this.targetFrameSize}generateOutputFrame(){const l=new Float32Array(this.targetFrameSize);let s=0,c=0;for(;s<this.targetFrameSize;){let d=0,g=0;const x=Math.min(this.inputBuffer.length,(s+1)*this.nativeSampleRate/this.targetSampleRate);for(;c<x;){const _=this.inputBuffer[c];_!==void 0&&(d+=_,g++),c++}l[s]=g>0?d/g:0,s++}return this.inputBuffer=this.inputBuffer.slice(c),l}}const wp=`
|
|
42
|
-
class EnergyVadWorkletProcessor extends AudioWorkletProcessor {
|
|
43
|
-
constructor(options) {
|
|
44
|
-
super();
|
|
45
|
-
this.targetSampleRate = options.processorOptions.targetSampleRate;
|
|
46
|
-
this.targetFrameSize = options.processorOptions.targetFrameSize;
|
|
47
|
-
this.inputBuffer = [];
|
|
48
|
-
}
|
|
49
|
-
process(inputs) {
|
|
50
|
-
const channel = inputs[0] && inputs[0][0];
|
|
51
|
-
if (!channel) return true;
|
|
52
|
-
for (let i = 0; i < channel.length; i++) {
|
|
53
|
-
this.inputBuffer.push(channel[i]);
|
|
54
|
-
while ((this.inputBuffer.length * this.targetSampleRate) / sampleRate >= this.targetFrameSize) {
|
|
55
|
-
const frame = new Float32Array(this.targetFrameSize);
|
|
56
|
-
let outputIndex = 0;
|
|
57
|
-
let inputIndex = 0;
|
|
58
|
-
while (outputIndex < this.targetFrameSize) {
|
|
59
|
-
let sum = 0;
|
|
60
|
-
let count = 0;
|
|
61
|
-
const limit = Math.min(this.inputBuffer.length, ((outputIndex + 1) * sampleRate) / this.targetSampleRate);
|
|
62
|
-
while (inputIndex < limit) {
|
|
63
|
-
const value = this.inputBuffer[inputIndex];
|
|
64
|
-
if (value !== undefined) { sum += value; count++; }
|
|
65
|
-
inputIndex++;
|
|
66
|
-
}
|
|
67
|
-
frame[outputIndex] = count > 0 ? sum / count : 0;
|
|
68
|
-
outputIndex++;
|
|
69
|
-
}
|
|
70
|
-
this.inputBuffer = this.inputBuffer.slice(inputIndex);
|
|
71
|
-
this.port.postMessage(frame);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return true;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
registerProcessor("energy-vad-worklet-processor", EnergyVadWorkletProcessor);
|
|
78
|
-
`;class Hu{constructor(l){te(this,"options");te(this,"processor");te(this,"initState","uninitialized");te(this,"stream",null);te(this,"sourceNode",null);te(this,"workletNode",null);te(this,"scriptNode",null);te(this,"workletModuleUrl",null);te(this,"listening",!1);te(this,"handleFrame",l=>{const s=this.processor.process(l);this.options.onFrameProcessed({isSpeech:s.probability,notSpeech:1-s.probability},l);for(const c of s.events)this.dispatch(c)});te(this,"start",async()=>{switch(this.initState){case"uninitialized":{this.initState="initializing",this.processor.resume();try{this.stream=await this.options.getStream(),await this.attachAudioGraph(),this.listening=!0,this.initState="initialized"}catch(l){throw this.initState="errored",l}return}case"initialized":{if(this.listening)return;this.processor.resume(),this.stream=this.options.resumeStream?await this.options.resumeStream(this.stream):this.stream,await this.attachAudioGraph(),this.listening=!0;return}default:return}});te(this,"pause",async()=>{if(!this.listening)return;this.listening=!1;const l=this.processor.pause();for(const s of l)this.dispatch(s);this.stream&&this.options.pauseStream&&await this.options.pauseStream(this.stream),this.detachAudioGraph()});te(this,"destroy",async()=>{this.initState!=="destroyed"&&(this.listening&&await this.pause(),this.initState="destroyed",this.workletModuleUrl&&(URL.revokeObjectURL(this.workletModuleUrl),this.workletModuleUrl=null))});te(this,"setOptions",l=>{this.processor.setOptions(l)});this.options=l,this.processor=new gp({positiveSpeechThreshold:l.positiveSpeechThreshold,negativeSpeechThreshold:l.negativeSpeechThreshold,minSpeechMs:l.minSpeechMs,preSpeechPadMs:l.preSpeechPadMs,redemptionMs:l.redemptionMs,maxSpeechMs:l.maxSpeechMs,submitUserSpeechOnPause:l.submitUserSpeechOnPause??!1})}static async new(l){return new Hu(l)}dispatch(l){switch(l.type){case"speech-start":this.options.onSpeechStart();return;case"speech-real-start":this.options.onSpeechRealStart();return;case"misfire":this.options.onVADMisfire();return;case"speech-end":this.options.onSpeechEnd(l.samples);return}}async attachAudioGraph(){const l=this.options.audioContext,s=this.stream;if(!s)throw new Error("Energy VAD has no active microphone stream.");if(this.sourceNode=new MediaStreamAudioSourceNode(l,{mediaStream:s}),this.canUseAudioWorklet(l))try{await this.attachAsWorklet(l),this.sourceNode.connect(this.workletNode);return}catch{this.workletNode=null}this.attachAsScriptProcessor(l),this.sourceNode.connect(this.scriptNode)}canUseAudioWorklet(l){return"audioWorklet"in l&&typeof AudioWorkletNode=="function"}async attachAsWorklet(l){if(!this.workletModuleUrl){const s=new Blob([wp],{type:"application/javascript"});this.workletModuleUrl=URL.createObjectURL(s)}await l.audioWorklet.addModule(this.workletModuleUrl),this.workletNode=new AudioWorkletNode(l,"energy-vad-worklet-processor",{numberOfInputs:1,numberOfOutputs:0,channelCount:1,processorOptions:{targetSampleRate:zu,targetFrameSize:Ou}}),this.workletNode.port.onmessage=s=>{this.handleFrame(s.data)}}attachAsScriptProcessor(l){const s=new yp(l.sampleRate,zu,Ou),d=l.createScriptProcessor(4096,1,1);let g=!1;d.onaudioprocess=x=>{if(!g){g=!0;try{const _=x.inputBuffer.getChannelData(0);x.outputBuffer.getChannelData(0).fill(0);for(const j of s.process(_))this.handleFrame(j)}finally{g=!1}}},d.connect(l.destination),this.scriptNode=d}detachAudioGraph(){var l;(l=this.sourceNode)==null||l.disconnect(),this.sourceNode=null,this.workletNode&&(this.workletNode.port.onmessage=null,this.workletNode.disconnect(),this.workletNode=null),this.scriptNode&&(this.scriptNode.onaudioprocess=null,this.scriptNode.disconnect(),this.scriptNode=null)}}const Ul=["One moment.","Checking now.","Still on it.","Just a second.","Working on it."],Sp=1500,kp=6e3,xp=4e3,Ep=500;function _p(){return{turnActive:!1,hasSpokenThisTurn:!1,lastCueAt:null,lastCueText:null}}function Cp(u){return{turnActive:!0,hasSpokenThisTurn:!1,lastCueAt:null,lastCueText:null}}function yf(u){return{...u,turnActive:!1}}function Np(u){return u.hasSpokenThisTurn?u:{...u,hasSpokenThisTurn:!0}}function Pp(u,l,s){return{...u,lastCueAt:s,lastCueText:l}}function Tp(u,l,s){return!(!u.turnActive||!u.hasSpokenThisTurn||l<Sp||u.lastCueAt!==null&&s-u.lastCueAt<kp)}function jp(u,l=Math.random){const s=u.lastCueText?Ul.filter(d=>d!==u.lastCueText):Ul,c=s.length?s:Ul;return c[Math.min(c.length-1,Math.floor(l()*c.length))]}function Uf(u){return u.replace(/```[\s\S]*?(?:```|$)/g," Code is shown on screen. ").replace(/!\[[^\]]*\]\([^)]*\)/g,"").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/<[^>]*>/g,"").replace(/[*_`#>|]/g,"").replace(/\s+/g," ").trim()}function Rp(u,l){let s=!1,c=!1,d=0,g=!1;for(let x=0;x<u.length;x++){if(u.startsWith("```",x)){s=!s,x+=2;continue}if(s)continue;if(u[x]==="`"){c=!c;continue}if(c)continue;if(u[x]==="["&&d++,u[x]==="]"&&(d=Math.max(0,d-1),u[x+1]==="("&&(g=!0)),g){u[x]===")"&&(g=!1);continue}if(d)continue;const L=(/[.!?。!?]/.test(u[x])||l&&/[,;:,;:]/.test(u[x]))&&(/[。!?,;:]/.test(u[x])||/\s/.test(u[x+1]||"")),j=u[x]==="."&&/(?:\b(?:Mr|Mrs|Ms|Dr|Prof|St|vs|etc)|\b[A-Za-z])\.$/i.test(u.slice(0,x+1)),K=l?48:160;if(L&&!j||u[x]===`
|
|
79
|
-
`||u[x]==="—"||x>=K&&/\s/.test(u[x]))return x+1}return 0}function Mp(u,l,s){var d;let c=0;for(;c<u.length;){const g=Rp(u.slice(c),s)||(l?u.length-c:0);if(!g)return 0;c+=g;const x=((d=Uf(u.slice(0,c).replace(/—/g," ")).match(/[\p{L}\p{N}]+(?:['’\-][\p{L}\p{N}]+)*/gu))==null?void 0:d.length)??0,_=/[.!?。!?]["'”’)\]]*\s*$/.test(u.slice(0,c));if(x>(s&&_?1:3)||l&&c===u.length)return c}return 0}function Tu(u,l=!1,s=!1){const c=[];let d=0,g=s;for(;d<u.length;){const x=Mp(u.slice(d),l,g);if(!x)break;const _=Uf(u.slice(d,d+x).replace(/—$/,"").replace(/—/g,", "));_&&(c.push(_),g=!1),d+=x}return{chunks:c,rest:l?"":u.slice(d)}}function Dl(u,l,s){return u||l||s}function Fp(u){const l=new ArrayBuffer(44+u.length*2),s=new DataView(l),c=(d,g)=>[...g].forEach((x,_)=>s.setUint8(d+_,x.charCodeAt(0)));return c(0,"RIFF"),s.setUint32(4,36+u.length*2,!0),c(8,"WAVEfmt "),s.setUint32(16,16,!0),s.setUint16(20,1,!0),s.setUint16(22,1,!0),s.setUint32(24,16e3,!0),s.setUint32(28,32e3,!0),s.setUint16(32,2,!0),s.setUint16(34,16,!0),c(36,"data"),s.setUint32(40,u.length*2,!0),u.forEach((d,g)=>s.setInt16(44+g*2,Math.max(-1,Math.min(1,d))*(d<0?32768:32767),!0)),new Blob([l],{type:"audio/wav"})}function Du(){const u=globalThis.crypto;if(u&&typeof u.randomUUID=="function")return u.randomUUID();const l=new Uint8Array(16);if(u)u.getRandomValues(l);else for(let s=0;s<l.length;s+=1)l[s]=Math.floor(Math.random()*256);return Array.from(l,s=>s.toString(16).padStart(2,"0")).join("")}const $f="meldivo.token",Lp="meldivo.token";let $o;function Ap(){try{window.localStorage.removeItem(Lp)}catch{}const l=new URLSearchParams(window.location.hash.replace(/^#/,"")).get("token");if(l){try{window.sessionStorage.setItem($f,l)}catch{}$o=l;try{window.history.replaceState(null,"",`${window.location.pathname}${window.location.search}`)}catch{}}}function Op(){if($o!==void 0)return $o;try{$o=window.sessionStorage.getItem($f)}catch{$o=null}return $o}function Ae(){const u=Op();return u?{"X-Meldivo-Token":u}:{}}class pn extends Error{constructor(){super("Unauthorized"),this.name="UnauthorizedError"}}function mn(u){if(u.status===401)throw new pn;return u}const zp="voice-assistant-microphone",Iu="voice-assistant-microphone-owner",Dp=15e3,Ip=5e3,Up=5e3;function Il(){try{const u=window.localStorage.getItem(Iu);if(!u)return null;const l=JSON.parse(u);return typeof l.id!="string"||typeof l.expiresAt!="number"?null:{id:l.id,expiresAt:l.expiresAt}}catch{return null}}function $p(){var x;const u=Du(),l=Date.now(),s=Il();if(s&&s.expiresAt>l)return null;const c=()=>window.localStorage.setItem(Iu,JSON.stringify({id:u,expiresAt:Date.now()+Dp}));try{if(c(),((x=Il())==null?void 0:x.id)!==u)return null}catch{return{release:()=>{}}}let d=!1;const g=window.setInterval(()=>{var _;d||((_=Il())==null?void 0:_.id)!==u||c()},Ip);return{release:()=>{var _;if(!d){d=!0,window.clearInterval(g);try{((_=Il())==null?void 0:_.id)===u&&window.localStorage.removeItem(Iu)}catch{}}}}}async function Vp(){let u,l,s;const c=new Promise((g,x)=>{l=g,s=x}),d=new Promise(g=>{u=g});return navigator.locks.request(zp,{mode:"exclusive",ifAvailable:!0},async g=>{if(!g){l(null);return}let x=!1;l({release:()=>{x||(x=!0,u())}}),await d}).catch(s),c}async function Bp(u){const l=await fetch("/api/voice/lease",{method:"POST",headers:Ae()});if(l.status===409)return null;if(!l.ok)throw new Error("Could not reserve the voice session.");const s=await l.json();if(typeof s.token!="string"||s.token.length<16)throw new Error("Voice session returned an invalid lease.");let c=!1;const d=()=>{c||(c=!0,window.clearInterval(g),fetch("/api/voice/lease",{method:"DELETE",headers:{"Content-Type":"application/json",...Ae()},body:JSON.stringify({token:s.token}),keepalive:!0}).catch(()=>{}))},g=window.setInterval(()=>{fetch("/api/voice/lease/heartbeat",{method:"POST",headers:{"Content-Type":"application/json",...Ae()},body:JSON.stringify({token:s.token})}).then(x=>{x.status===409&&(d(),u())}).catch(()=>{})},Up);return{release:d}}async function Wp(u=()=>{}){const l=typeof navigator<"u"&&navigator.locks?await Vp():typeof window>"u"?null:$p();if(!l)return null;try{const s=await Bp(u);return s?{release:()=>{s.release(),l.release()}}:(l.release(),null)}catch(s){throw l.release(),s}}const Ku="voice-assistant.selected-voice";function Vf(u){return typeof u=="string"&&/^[A-Za-z0-9._-]{1,100}$/.test(u)}function Qu(u){return typeof window>"u"?void 0:window.localStorage}function eo(u){var l;try{const s=(l=Qu(u))==null?void 0:l.getItem(Ku);return Vf(s)?s:void 0}catch{return}}function Hp(u,l){var s;if(!Vf(u))return!1;try{return(s=Qu(l))==null||s.setItem(Ku,u),!0}catch{return!1}}function wf(u){var l;try{(l=Qu(u))==null||l.removeItem(Ku)}catch{}}function Bf(){return h.jsx("main",{className:"auth-screen",children:h.jsxs("p",{children:["Open the link printed by ",h.jsx("code",{children:"meldivo open"}),"."]})})}const Kp=3,Sf=420,kf=140;function Qp(){const[u,l]=C.useState([]),s=C.useRef(0),c=C.useRef(new Set);C.useEffect(()=>()=>{for(const _ of c.current)window.clearTimeout(_);c.current.clear()},[]);const d=C.useCallback((_,L)=>{const j=window.setTimeout(()=>{c.current.delete(j),l(K=>K.filter(D=>!_.includes(D.id)))},L);c.current.add(j)},[]),g=C.useCallback(_=>{const j={id:++s.current,name:_.name,summary:_.summary??`Using ${_.name}`,detail:_.detail,folder:_.folder,leaving:!1,delay:0};l(K=>{const D=K.filter($=>!$.leaving),O=new Set(D.slice(0,Math.max(0,D.length+1-Kp)).map($=>$.id));return O.size&&d([...O],Sf),[...K.map($=>O.has($.id)?{...$,leaving:!0,delay:0}:$),j]})},[d]),x=C.useCallback(()=>{l(_=>{const L=_.filter(j=>!j.leaving);return L.length?(d(L.map(j=>j.id),Sf+kf*L.length),_.map(j=>j.leaving?j:{...j,leaving:!0,delay:kf*L.indexOf(j)})):_})},[d]);return{items:u,push:g,clear:x}}function qp({items:u}){return u.length?h.jsx("ol",{className:"tool-activity","aria-live":"polite","aria-label":"What the agent is doing",children:u.map(l=>h.jsxs("li",{className:`tool-activity__item${l.leaving?" tool-activity__item--leaving":""}`,style:{"--delay":`${l.delay}ms`},"aria-hidden":l.leaving||void 0,children:[h.jsxs("span",{className:"tool-activity__summary",children:[h.jsx("span",{className:"tool-activity__tool",children:l.name.replace(/^mcp__.*__/,"")}),l.summary]}),l.detail&&h.jsx("code",{className:"tool-activity__detail",title:l.detail,children:l.detail}),l.folder&&h.jsxs("span",{className:"tool-activity__folder",children:["in ",l.folder]})]},l.id))}):null}function Vo(u){const l=/^@([A-Za-z0-9._-]{1,40})\/(.+)$/.exec(u);return l?{prefix:`@${l[1]}/`,host:l[1],inner:l[2]}:{prefix:"",host:"",inner:u}}const Uu=["pi","opencode","claude"],Bl={pi:"Pi",opencode:"OpenCode",claude:"Claude Code"};let xf=!1;function Ef(u){const{host:l,inner:s}=Vo(u),c=l||void 0;if(s.startsWith("new:"))return{harness:s.slice(4),title:"New chat",cwd:"~",host:c};if(s==="quick")return{title:"Quick chat",cwd:"~",host:c};const d=s.indexOf(":");return d===-1?{title:s,cwd:"",host:c}:{harness:s.slice(0,d),title:s.slice(d+1),cwd:"",host:c}}function Gp(u){const l=/^(\/home\/[^/]+|\/Users\/[^/]+)(\/.*)?$/.exec(u);return l?`~${l[2]??""}`:u}function bp(u){return`meldivo.conversation.${u}`}function Yp(u){const l=bp(u);try{const s=window.sessionStorage.getItem(l);if(s)return s;const c=Du();return window.sessionStorage.setItem(l,c),c}catch{return Du()}}const Xp=12e3,Jp=560,Zp="This is a voice preview.",Wf="voice-assistant.onboarding-dismissed",em=3e3;function Pi(u){const l=/^([a-z]{2})[_-](.+)$/i.exec(u),s={af:"American female",am:"American male",bf:"British female",bm:"British male",ef:"Spanish female",em:"Spanish male",ff:"French female",fm:"French male",hf:"Hindi female",hm:"Hindi male",if:"Italian female",im:"Italian male",jf:"Japanese female",jm:"Japanese male",pf:"Portuguese female",pm:"Portuguese male",zf:"Chinese female",zm:"Chinese male"};if(l){const c=s[l[1].toLowerCase()];if(c)return`${Pi(l[2])} — ${c}`}return u.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[._-]+/g," ").replace(/\b\w/g,c=>c.toUpperCase())}function tm(){try{return window.localStorage.getItem(Wf)!=="true"}catch{return!0}}class nm extends Error{constructor(){super("Another voice tab is active. Close it or stop voice there first."),this.name="VoiceOwnershipError"}}function _f(u,l){return new Promise((s,c)=>{if(l.aborted)return c(l.reason);const d=window.setTimeout(()=>{l.removeEventListener("abort",g),s()},u),g=()=>{window.clearTimeout(d),c(l.reason)};l.addEventListener("abort",g,{once:!0})})}async function rm(u,l){if(!u.body)throw new Error("Chat response was empty.");const s=u.body.pipeThrough(new TextDecoderStream).getReader();let c="";for(;;){const{done:d,value:g}=await s.read();if(d)break;c+=g;const x=c.split(`
|
|
80
|
-
`);c=x.pop()??"";for(const _ of x){if(!_.startsWith("data:"))continue;const L=_.slice(5).trim();if(!L)continue;let j;try{j=JSON.parse(L)}catch{continue}if(l(j),j.type==="done")return}}}function om({sessionKey:u,folder:l}){var vo;const[s,c]=C.useState("idle"),[d,g]=C.useState(0),[x,_]=C.useState(""),L=C.useRef(s),j=C.useRef(!0),K=C.useRef(!1),D=C.useRef(!1),O=C.useRef(!1),$=C.useRef(!1),J=C.useRef(null),le=C.useRef(null),N=C.useRef(null),b=C.useRef(null),G=C.useRef(null),ge=C.useRef(!1),I=C.useRef(null),Q=C.useRef(null),U=C.useRef(null),ne=C.useRef(new hh),me=C.useRef(0),Se=C.useRef(0),H=C.useRef(null),xe=C.useRef(null),be=C.useRef(0),Je=C.useRef(Yp(l?`${u}|${l}`:u)),qe=C.useRef(u),Ie=C.useRef(null),Ue=C.useRef(Ef(u).harness),_e=C.useRef(0),V=C.useRef(0),se=C.useRef(null),W=C.useRef(""),y=C.useRef(""),T=C.useRef(null),ie=C.useRef(new $h),ue=C.useRef(""),pe=C.useRef(0),ye=C.useRef([]),ve=C.useRef(""),ke=C.useRef(null),je=C.useRef(0),rt=C.useRef(0),Kn=C.useRef(!1),xr=C.useRef(null),Ot=C.useRef(null),Qn=C.useRef(!1),qn=C.useRef(null),ut=C.useRef(_p()),Er=C.useRef(new Map),vn=C.useRef(null),Gn=C.useRef(null),gn=C.useRef(null),zt=C.useRef(null),Rn=C.useRef(0),bn=C.useRef({}),Yn=C.useRef(),[Dt,no]=C.useState(null),[at,Xn]=C.useState(!1),[ro,_r]=C.useState([]),[yn,Wl]=C.useState(""),[vt,oo]=C.useState(()=>eo()??""),[ji,Cr]=C.useState(()=>eo()??""),[io,Wo]=C.useState(()=>Pu()),[gt,Ho]=C.useState({ready:!0,downloading:!1}),[_t,Mn]=C.useState(()=>{const p=Ef(u);return l&&Vo(u).inner.startsWith("new:")?{...p,cwd:Gp(l)}:p}),[Ri,Ko]=C.useState(!1),[Qo,Fn]=C.useState(""),Nr=Qp(),[qo,Jn]=C.useState(!1),[Zn,lo]=C.useState(""),[Ln,Mi]=C.useState(!1),[er,Ct]=C.useState(""),[Pr,tr]=C.useState(""),[so,Go]=C.useState(null),[Hl,An]=C.useState(tm),nr=C.useRef(null),Tr=C.useRef(null),uo=C.useRef(0),bo=C.useRef(null),Yo=C.useRef(null),Xo=C.useRef(null),Zt=C.useRef(null),Kt=C.useRef(null),en=C.useRef(null),Fe=C.useRef(null),ao=C.useRef(!1),It=C.useRef(!1),Ut=()=>{H.current!==null&&window.clearTimeout(H.current),H.current=null},yt=()=>{xr.current!==null&&window.clearTimeout(xr.current),xr.current=null},co=()=>{var p;Gn.current!==null&&window.clearInterval(Gn.current),Gn.current=null,(p=vn.current)==null||p.abort(),vn.current=null},Ze=p=>{L.current=p,j.current&&c(p)},On=p=>{p&&se.current!==p||(cancelAnimationFrame(V.current),se.current=null,$.current=!1,j.current&&g(0))},$t=(p,S)=>{cancelAnimationFrame(V.current),se.current=S,$.current=!0,Ze("speaking");const P=new Float32Array(p.fftSize),R=()=>{se.current===S&&(p.getFloatTimeDomainData(P),g(Math.min(1,Math.sqrt(P.reduce((X,B)=>X+B*B,0)/P.length)*6)),V.current=requestAnimationFrame(R))};R()},wt=()=>{var p,S,P;K.current||L.current==="error"||($.current||(p=I.current)!=null&&p.busy&&L.current==="speaking"?Ze("speaking"):G.current||(S=I.current)!=null&&S.busy||(P=U.current)!=null&&P.busy?Ze(ge.current?"running":"thinking"):D.current&&Ze("listening"))},St=C.useRef(!1),Fi="Reading the conversation…",Kl=async()=>{const p=qe.current,{inner:S}=Vo(p);if(!(St.current||!S.includes(":")||S.startsWith("new:"))){St.current=!0,Fn(Fi);try{await fetch(`/api/sessions/${encodeURIComponent(p)}/warm`,{method:"POST",headers:Ae()})}catch{}finally{St.current=!1,j.current&&Fn(P=>P===Fi?"":P)}}},Qt=()=>{const p=b.current,S=N.current;!p||!S||(p.gain.cancelScheduledValues(S.currentTime),p.gain.setTargetAtTime(1,S.currentTime,.015))},fo=()=>{var P;if(!(((P=I.current)==null?void 0:P.hold())??!1))return;Qn.current=!0;const S=Ot.current;if(Ot.current=null,S){const R=(performance.now()-S.startedAt)/1e3,X=S.seconds>0?R/S.seconds:1,B=np(S.text,X),q=W.current.slice(0,W.current.length-B.length).trim();qn.current=B?{said:q,resume:B}:null}else qn.current=null},zn=()=>{if(!Qn.current)return;Qn.current=!1;const p=qn.current;qn.current=null;const S=I.current;if(!S||!p){S==null||S.resume("");return}ip(p.said,p.resume,Ae()).then(P=>{I.current===S&&S.resume(lp(P,p.resume))})},jr=()=>{var p,S;return!!G.current||!!((p=I.current)!=null&&p.busy)||$.current||!!((S=U.current)!=null&&S.busy)||L.current==="hearing"},rr=async p=>{var X,B;(X=gn.current)==null||X.abort(),(B=zt.current)==null||B.abort();const S=new AbortController;gn.current=S,Er.current.clear();const P=eo(),R=()=>N.current===p&&!S.signal.aborted;try{await _f(xp,S.signal);for(const q of Ul)for(;R();){for(;R()&&jr();)await _f(Ep,S.signal);if(!R())return;const fe=new AbortController;zt.current=fe;try{const Me=await fetch("/api/voice/speech",{method:"POST",headers:{"Content-Type":"application/json",Accept:"audio/wav",...Ae()},body:JSON.stringify({text:q,...P?{voice:P}:{}}),signal:fe.signal});if(!R()||!Me.ok)break;const Ne=await Me.arrayBuffer();if(!R())return;const ot=await p.decodeAudioData(Ne);R()&&Er.current.set(q,ot);break}catch{if(!fe.signal.aborted)break}finally{zt.current===fe&&(zt.current=null)}}}catch{}finally{gn.current===S&&(gn.current=null)}},Ql=async(p,S)=>{const P=N.current,R=Er.current.get(p);if(!P||!R)return;const X=Symbol("cue"),B=W.current;W.current=p,ye.current=pf(ye.current,p,performance.now());const q=Cu(R,P,b.current??P.destination,fe=>$t(fe,X));try{await q(S)}catch{}finally{On(X),W.current===p&&(W.current=B),wt()}},ql=()=>{co(),Gn.current=window.setInterval(()=>{var X;if(!ut.current.turnActive){co();return}if($.current||(X=I.current)!=null&&X.busy||vn.current)return;const p=Date.now(),S=p-Rn.current;if(!Tp(ut.current,S,p))return;const P=jp(ut.current);ut.current=Pp(ut.current,P,p);const R=new AbortController;vn.current=R,Ql(P,R.signal).finally(()=>{vn.current===R&&(vn.current=null),Rn.current=Date.now()})},300)},ct=p=>{if(!j.current)return;const S=++be.current;xe.current!==null&&window.clearTimeout(xe.current),_(p),Ze("error"),xe.current=window.setTimeout(()=>{be.current===S&&(xe.current=null,_(""),L.current==="error"&&Ze(D.current?K.current?"muted":"listening":"idle"))},4e3)},Rr=()=>{var p;(p=T.current)==null||p.release(),T.current=null},wn=()=>{var S,P;_e.current++;const p=ge.current||!!G.current;if(ge.current=!1,(S=G.current)==null||S.abort(),G.current=null,(P=I.current)==null||P.cancel(),On(),Qt(),Qn.current=!1,qn.current=null,Ot.current=null,ut.current=yf(ut.current),co(),p){const R=Ie.current??qe.current;fetch(`/api/sessions/${encodeURIComponent(R)}/cancel`,{method:"POST",headers:Ae()}).catch(()=>{})}Ie.current=null,!K.current&&D.current&&Ze("listening")},tn=()=>{var p;Dl(!!G.current,!!((p=I.current)!=null&&p.busy),$.current)&&wn()},nn=p=>{var X,B,q;if(!D.current&&!O.current)return;D.current=!1,O.current=!1,It.current=!1,Jn(!1),me.current++,Ut(),ne.current.deactivate(),K.current=!1,wn(),Qt(),ie.current.reset(),yt(),ue.current="",pe.current=0,ve.current="",(X=Q.current)==null||X.reset(),Q.current=null,(B=U.current)==null||B.reset(),U.current=null,I.current=null;const S=J.current;J.current=null,S==null||S.destroy().catch(()=>{});const P=le.current;le.current=null,P==null||P.getTracks().forEach(fe=>{fe.onended=null,fe.stop()});const R=N.current;N.current=null,(q=b.current)==null||q.disconnect(),b.current=null,R&&R.state!=="closed"&&R.close().catch(()=>{}),Rr(),ct(p)},Jo=()=>{var R,X,B;if(!D.current)return;D.current=!1,It.current=!1,Jn(!1),me.current++,Ut(),ne.current.deactivate(),K.current=!1,wn(),Qt(),ie.current.reset(),yt(),ue.current="",pe.current=0,ve.current="",(R=Q.current)==null||R.reset(),Q.current=null,(X=U.current)==null||X.reset(),U.current=null,I.current=null;const p=J.current;J.current=null,p==null||p.destroy().catch(()=>{});const S=le.current;le.current=null,S==null||S.getTracks().forEach(q=>{q.onended=null,q.stop()});const P=N.current;N.current=null,(B=b.current)==null||B.disconnect(),b.current=null,P&&P.state!=="closed"&&P.close().catch(()=>{}),Rr(),ct("Voice session moved to another tab. Tap the shape to reconnect.")},Ce=async(p,S)=>{const P=await fetch("/api/voice/transcribe",{method:"POST",headers:{"Content-Type":"audio/wav",...Ae()},body:Fp(p),signal:S}),R=await P.json();if(!P.ok)throw new Error(R.error??"Transcription failed.");return String(R.text??"").trim()},Li=()=>{const p=bn.current;if(p.reported||p.sent===void 0)return;p.reported=!0;const S=performance.now(),P=(R,X)=>R===void 0||X===void 0?void 0:Math.round(X-R);fetch("/api/voice/timing",{method:"POST",headers:{"Content-Type":"application/json",...Ae()},body:JSON.stringify({silence_wait_ms:J.current?Pu():void 0,speech_end_to_send_ms:P(p.speechEnd,p.sent),send_to_first_word_ms:P(p.sent,p.firstDelta),first_word_to_sound_ms:P(p.firstDelta,S),speech_end_to_sound_ms:P(p.speechEnd,S)})}).catch(()=>{})},Ai=async(p,S)=>{var Ne,ot;const P=N.current;if(!P)throw new Error("Audio output is not ready.");const R=Symbol("playback");let X=Af(p);const B=Ke=>{var Pe;(Pe=vn.current)==null||Pe.abort(),Li(),W.current=`${W.current} ${p.trim()}`.trim().slice(-2e3),ye.current=pf(ye.current,p,performance.now()),Ot.current={text:p.trim(),startedAt:performance.now(),seconds:X},$t(Ke,R)},q=await fetch("/api/voice/speech",{method:"POST",headers:{"Content-Type":"application/json",Accept:"audio/pcm, audio/wav;q=0.9",...Ae()},body:JSON.stringify({text:p,...Yn.current?{voice:Yn.current}:{}}),signal:S});if(q.headers.get("x-voice-fallback")==="configured"&&(Yn.current=void 0,wf()),!q.ok)throw new Error((await q.json().catch(()=>({}))).error??"Speech generation failed.");let fe;if(q.body&&((Ne=q.headers.get("content-type"))!=null&&Ne.startsWith("audio/pcm"))){const Ke=Number(q.headers.get("x-sample-rate"))||24e3;fe=await Yh(q.body,Ke,P,b.current??P.destination,B,S),(ot=fe.completed)==null||ot.then(Pe=>{var ft;X=Pe,((ft=Ot.current)==null?void 0:ft.text)===p.trim()&&(Ot.current.seconds=Pe)},()=>{})}else{const Ke=await q.arrayBuffer();S.throwIfAborted();const Pe=await P.decodeAudioData(Ke);S.throwIfAborted(),X=Pe.duration,fe=Cu(Pe,P,b.current??P.destination,B)}const Me=(async Ke=>{var Pe;try{await fe(Ke)}finally{On(R),((Pe=Ot.current)==null?void 0:Pe.text)===p.trim()&&(Ot.current=null),wt()}});return Me.completed=fe.completed,Me},Sn=()=>{no(null),Xn(!1)},ho=(p,S)=>{no({x:p,y:S}),Xn(!1)},rn=()=>{nr.current!==null&&window.clearTimeout(nr.current),nr.current=null,Tr.current=null},Oi=p=>{if(Dt||at){uo.current=Date.now()+1e3,rn();return}if(p.pointerType!=="touch")return;rn();const{clientX:S,clientY:P,pointerId:R}=p;Tr.current={pointerId:R,x:S,y:P},nr.current=window.setTimeout(()=>{nr.current=null,Tr.current=null,uo.current=Date.now()+1e3,ho(S,P)},Jp)},Zo=p=>{const S=Tr.current;!S||S.pointerId!==p.pointerId||Math.hypot(p.clientX-S.x,p.clientY-S.y)>10&&rn()},or=()=>{var S;(S=Kt.current)==null||S.abort(),Kt.current=null,Fe.current=null;const p=en.current;en.current=null,p&&p.state!=="closed"&&p.close().catch(()=>{}),Go(null)},kn=async()=>{if(!vt||so)return;or();const p=new AbortController;Kt.current=p;const S=new AudioContext;en.current=S,Ct(""),Go(vt);try{await S.resume();const P=await fetch("/api/voice/speech",{method:"POST",headers:{"Content-Type":"application/json",Accept:"audio/wav",...Ae()},body:JSON.stringify({text:Zp,voice:vt}),signal:p.signal});if(!P.ok)throw new Error((await P.json().catch(()=>({}))).error??"Voice preview failed.");const R=await P.arrayBuffer();p.signal.throwIfAborted();const X=await S.decodeAudioData(R);p.signal.throwIfAborted();const B=Cu(X,S,S.destination,()=>{});if(Kt.current!==p)return;Fe.current=B,await B(p.signal)}catch(P){!(P instanceof DOMException&&P.name==="AbortError")&&Kt.current===p&&Ct(P instanceof Error?P.message:"Voice preview failed.")}finally{Kt.current===p&&(Kt.current=null),Fe.current=null,en.current===S&&(en.current=null,S.state!=="closed"&&S.close().catch(()=>{})),Kt.current===null&&Go(null)}},xn=p=>{var P;(P=Zt.current)==null||P.abort();const S=new AbortController;Zt.current=S,Mi(!0),Ct(""),lo(""),fetch("/api/voice/voices",{headers:Ae(),signal:S.signal}).then(async R=>{const X=await R.json();if(!R.ok)throw new Error(typeof X.current=="string"?X.current:"Could not load voices.");const B=Array.isArray(X.voices)?X.voices.filter(Ne=>typeof Ne=="string"&&/^[A-Za-z0-9._-]{1,100}$/.test(Ne)):[],q=typeof X.current=="string"&&/^[A-Za-z0-9._-]{1,100}$/.test(X.current)?X.current:"";if(Zt.current!==S||S.signal.aborted)return;const fe=p??eo(),Me=fe&&(!B.length||B.includes(fe))?fe:"";_r(B),Wl(q),Cr(Me),oo(Me||q||B[0]||""),lo(X.available===!1&&typeof X.warning=="string"?X.warning:"")}).catch(R=>{!(R instanceof DOMException&&R.name==="AbortError")&&!S.signal.aborted&&Ct(R instanceof Error?R.message:"Could not load voices.")}).finally(()=>{Zt.current===S&&(Zt.current=null,Mi(!1))})},En=()=>{if(vt){if(!Hp(vt)){Ct("This voice could not be saved.");return}Cr(vt),Ct(""),tr(`${Pi(vt)} will be used from the next reply.`),N.current&&rr(N.current)}},Mr=p=>{var P;const S=fp(p);Wo(S),(P=J.current)==null||P.setOptions({redemptionMs:S})},Fr=()=>{wf(),Cr(""),oo(yn),Ct(""),tr(`${yn?Pi(yn):"The profile default"} will be used from the next reply.`),N.current&&rr(N.current)},on=async()=>{var S,P;if(!D.current||K.current||It.current)return;const p=J.current;if(p){It.current=!0,Ut(),ie.current.reset(),yt(),ue.current="",pe.current=0,ve.current="",y.current="",(S=Q.current)==null||S.reset(),(P=U.current)==null||P.reset(),Qt(),p.setOptions({submitUserSpeechOnPause:!1});try{await ne.current.pause(p),(J.current!==p||!D.current||K.current||!ao.current)&&(It.current=!1)}catch(R){if(It.current=!1,J.current!==p||!D.current||K.current)return;p.setOptions({submitUserSpeechOnPause:!0}),nn(ne.current.isInvalid(p)?"Microphone transition timed out. Tap the shape to reconnect.":R instanceof Error?R.message:"Could not pause the microphone for settings.")}}},Gl=async()=>{if(!It.current)return;const p=J.current;if(It.current=!1,!(!p||!D.current||K.current))try{await ne.current.start(p),J.current===p&&D.current&&!K.current&&(p.setOptions({submitUserSpeechOnPause:!0}),wt())}catch(S){if(J.current!==p||!D.current||K.current)return;p.setOptions({submitUserSpeechOnPause:!0}),nn(ne.current.isInvalid(p)?"Microphone transition timed out. Tap the shape to reconnect.":S instanceof Error?S.message:"Could not resume the microphone after settings.")}},zi=p=>{const S=Ue.current,{prefix:P}=Vo(qe.current);if(S){qe.current=`${P}${S}:${p}`;return}fetch("/api/sessions",{headers:Ae()}).then(mn).then(async R=>{if(!R.ok)return;const B=(await R.json()).sessions.find(q=>q.id===p&&Vo(q.key).prefix===P);B&&(qe.current=B.key,Ue.current=B.harness,j.current&&Mn({harness:B.harness,title:B.title,cwd:B.cwd,host:B.host}))}).catch(()=>{})},Lr=async p=>{var q,fe,Me;const S=++_e.current;let P=!1,R=!1;const X=new AbortController;G.current=X,(q=zt.current)==null||q.abort(),Yn.current=eo(),bn.current={speechEnd:bn.current.speechEnd,sent:performance.now()},Ze("thinking"),ut.current=Cp(ut.current),Rn.current=Date.now(),ql();const B=()=>{P=!0,R=!1,ut.current=Np(ut.current),Rn.current=Date.now()};try{if(!p||S!==_e.current){wt();return}W.current="",Yn.current=eo();const Ne=qe.current;Ie.current=Ne;const ot=await fetch(`/api/sessions/${encodeURIComponent(Ne)}/chat`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream",...Ae()},body:JSON.stringify({conversationId:Je.current,message:p,...l&&Vo(Ne).inner.startsWith("new:")?{cwd:l}:{}}),signal:X.signal});if(mn(ot),!ot.ok)throw new Error((await ot.json().catch(()=>({}))).error??"Chat request failed.");let Ke="";if(await rm(ot,Pe=>{var ft,_n,Ir,Pt;if(S===_e.current)switch(Pe.type){case"session":zi(Pe.id);return;case"status":ge.current=!0,wt(),Fn(Pe.message);return;case"tool":{if(ge.current=!0,wt(),Fn(""),Nr.push(Pe),Rn.current=Date.now(),Ke.trim()){const Tt=Tu(Ke,!0,!P||R);Ke=Tt.rest,Tt.chunks.length&&(B(),(ft=I.current)==null||ft.enqueue(Tt.chunks))}R=!0;return}case"delta":{(_n=bn.current).firstDelta??(_n.firstDelta=performance.now()),ge.current&&(ge.current=!1,wt()),Nr.clear(),Ke+=Pe.text;const Tt=Tu(Ke,!1,!P||R);Ke=Tt.rest,Tt.chunks.length&&(B(),(Ir=I.current)==null||Ir.enqueue(Tt.chunks));return}case"notice":Fn(Pe.message),B(),(Pt=I.current)==null||Pt.enqueue([Pe.message]);return;case"error":throw new Error(Pe.message);case"done":return}}),S===_e.current){const Pe=Tu(Ke,!0,!P||R);Pe.chunks.length&&(B(),(fe=I.current)==null||fe.enqueue(Pe.chunks))}}catch(Ne){if(Ne instanceof pn){j.current&&Ko(!0);return}!(Ne instanceof DOMException&&Ne.name==="AbortError")&&S===_e.current&&(ct(Ne instanceof Error?Ne.message:"Voice conversation failed."),P||(Me=I.current)==null||Me.enqueue(["Sorry, I could not answer that. Please try again."]))}finally{G.current===X&&(G.current=null,Ie.current=null),ge.current=!1,j.current&&(Fn(""),Nr.clear()),S===_e.current&&(ut.current=yf(ut.current),co()),wt()}},ei=async()=>{var Ir;if(D.current||O.current)return;O.current=!0;const p=++Se.current;let S=null,P=null,R=null,X=null,B=null,q=null,fe=null,Me=null;const Ne=++me.current,ot=()=>{if(!j.current||me.current!==Ne||Se.current!==p)throw new DOMException("Voice startup was cancelled.","AbortError")};ne.current.beginSession();const Ke=performance.now(),Pe={},ft=Pt=>{Pe[Pt]=Math.round(performance.now()-Ke)};let _n=!1;try{if(!window.isSecureContext||!((Ir=navigator.mediaDevices)!=null&&Ir.getUserMedia))throw new Error("Microphone access requires HTTPS or localhost.");_(""),Jn(!1),Ze("thinking"),S=new AudioContext;const Pt=S,Tt=Wp(Jo).then(de=>_n?(de==null||de.release(),null):(X=de,ft("startup_lease_ms"),de)),Ur=navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}}).then(de=>_n?(de.getTracks().forEach(Re=>Re.stop()),null):(P=de,ft("startup_microphone_ms"),de));B=S.createGain(),B.gain.value=1,B.connect(S.destination),q=new Jh(Ai,wt,de=>{On(),ct(de instanceof Error?de.message:"Speech playback failed.")}),fe=new Eh(Ce,de=>{ue.current=de,pe.current=performance.now(),ir(R,Ne)},()=>Or(R,Ne)),Me=new fh(async(de,Re)=>{const $e=await((fe==null?void 0:fe.finish(de.samples,Re))??Ce(de.samples,Re)),Ve=de.possibleEcho?ch($e,de.possibleEcho):$e,kt=de.pendingInterruptDecision;if(!kt)return Ve;const Vt=Lf(Ve,kt.recentWindow);return Vt?(tn(),Vt.remainder):!kt.wordPathBlocked&&Lu(Ve,kt.recentWindow)?(tn(),Ve):(zn(),"")},Lr,de=>ct(de instanceof Error?de.message:"Voice transcription failed."),wt);const Ii=async()=>{if(!P)throw new Error("The microphone is not ready.");return P},Ui={getStream:Ii,pauseStream:async()=>{},resumeStream:Ii,...Sh(Pu()),submitUserSpeechOnPause:!0,onSpeechStart:()=>{var Ve,kt,Vt,Vr;if(!ln(R,Ne))return;(Ve=U.current)==null||Ve.speechStarted();const de=Dl(!!G.current,!!((kt=I.current)!=null&&kt.busy),$.current),Re=ie.current.speechStart(de);y.current=$.current||(Vt=I.current)!=null&&Vt.busy?W.current:"";const $e=performance.now();ve.current=zh(ye.current,$e,$e),ue.current="",pe.current=0,je.current=0,rt.current=0,Kn.current=!1,Re.begin&&((Vr=Q.current)==null||Vr.begin(de)),Di(R,Ne),yt(),de&&(xr.current=window.setTimeout(()=>ir(R,Ne),Ch))},onSpeechRealStart:()=>{var Re,$e;if(!ln(R,Ne))return;ie.current.speechRealStart().accepted&&(Qt(),(Re=Q.current)==null||Re.confirm(),Di(R,Ne),($e=zt.current)==null||$e.abort(),_(""),Ze("hearing"))},onVADMisfire:()=>{var de,Re;ln(R,Ne)&&(Ut(),ie.current.reset(),yt(),ue.current="",pe.current=0,y.current="",ve.current="",(de=Q.current)==null||de.discard(),(Re=U.current)==null||Re.speechDiscarded(),zn(),K.current||wt())},onFrameProcessed:(de,Re)=>{var Ve;if(!ln(R,Ne))return;(Ve=Q.current)==null||Ve.frame(de.isSpeech,Re);const $e=Math.sqrt(Re.reduce((kt,Vt)=>kt+Vt*Vt,0)/Re.length);if(g(Math.min(1,$e*7)),$.current&&ie.current.idle)ke.current=ke.current===null?$e:ke.current*.9+$e*.1;else if(!ie.current.idle&&$.current&&!Kn.current&&(je.current++,rt.current+=$e,je.current>=Dh)){Kn.current=!0;const kt=rt.current/je.current;Uh(kt,ke.current)?ie.current.blockWordPath():ke.current!==null&&fo()}},onSpeechEnd:de=>{var Vt,Vr,Bi,Wi,wo,sr;if(!ln(R,Ne))return;bn.current={speechEnd:performance.now()},Ut(),yt();const Re=ue.current.trim()!==""&&performance.now()-pe.current<=Nh,$e=ve.current,Ve=ie.current.speechEnd(ue.current,$e,Re);if(ue.current="",pe.current=0,!Ve.accepted){y.current="",ve.current="",(Vt=Q.current)==null||Vt.discard(),(Vr=U.current)==null||Vr.speechDiscarded(),zn(),wt();return}if(Ve.interrupt?tn():Ve.deferDecision||zn(),!Ve.send){y.current="",ve.current="",(Bi=Q.current)==null||Bi.discard(),(Wi=U.current)==null||Wi.speechDiscarded(),wt();return}(wo=Q.current)==null||wo.end(de);const kt=y.current;y.current="",ve.current="",(sr=U.current)==null||sr.speechEnded({samples:de,possibleEcho:kt,...Ve.deferDecision?{pendingInterruptDecision:{recentWindow:$e,wordPathBlocked:Ve.wordPathBlocked}}:{}})}},Xl=xf?Promise.resolve(null):(async()=>{try{const{MicVAD:de}=await zf(),Re=await de.new({model:"v5",audioContext:Pt,startOnLoad:!1,baseAssetPath:Au,onnxWASMBasePath:Au,ortConfig:$e=>{$e.env.wasm.numThreads=1},...Ui});return _n?(Re.destroy().catch(()=>{}),null):(R=Re,ft("startup_detector_ms"),Re)}catch{return xf=!0,null}})(),[Jl,Cn,$i]=await Promise.all([Tt,Ur,Xl,Pt.resume()]);if(X=Jl,P=Cn,R=$i,!X)throw new nm;if(!Cn)throw new Error("Voice startup did not finish.");ot();let ni=!1;R||(ni=!0,R=await Hu.new({audioContext:S,...Ui}),ft("startup_detector_ms")),ot(),fe.speechThreshold=ni?Bu:Vl,Jn(ni),await ne.current.start(R),ft("startup_listening_ms"),ot();const go=R,it=S;if(!go||!it)throw new Error("Voice startup did not finish.");T.current=X,N.current=it,b.current=B,rr(it),I.current=q,Q.current=fe,U.current=Me,le.current=Cn,J.current=go,D.current=!0;const Vi=()=>{var de,Re,$e;if(!(le.current!==Cn||!D.current)){D.current=!1,It.current=!1,Jn(!1),me.current++,Ut(),ne.current.deactivate(),K.current=!1,wn(),Qt(),ie.current.reset(),yt(),ue.current="",pe.current=0,ve.current="",I.current=null,(de=Q.current)==null||de.reset(),Q.current=null,(Re=U.current)==null||Re.reset(),U.current=null,J.current===go&&(J.current=null),le.current===Cn&&(le.current=null),N.current===it&&(N.current=null),($e=b.current)==null||$e.disconnect(),b.current=null;for(const Ve of Cn.getTracks())Ve.onended=null,Ve.readyState==="live"&&Ve.stop();go.destroy().catch(()=>{}),it.state!=="closed"&&it.close().catch(()=>{}),Rr(),ct("Microphone disconnected. Tap the shape to reconnect.")}};for(const de of Cn.getAudioTracks())de.onended=Vi;let $r=!1;const yo=()=>{if(!(N.current!==it||!D.current)){if(it.state==="running"||it.state==="closed"){$r=!1;return}it.resume().catch(()=>{}).then(()=>{N.current!==it||!D.current||it.state==="running"||$r||($r=!0,ct("The device paused audio. Tap the shape to keep talking."))})}};it.onstatechange=yo;const Zl=window.setInterval(()=>{if(N.current!==it||it.state==="closed"){window.clearInterval(Zl),document.removeEventListener("visibilitychange",yo);return}yo()},2e3);if(document.addEventListener("visibilitychange",yo),!Cn.getAudioTracks().some(de=>de.readyState==="live")){Vi();return}Ze("listening"),fetch("/api/voice/timing",{method:"POST",headers:{"Content-Type":"application/json",...Ae()},body:JSON.stringify(Pe)}).catch(()=>{}),ao.current&&on()}catch(Pt){_n=!0;const Tt=me.current===Ne&&Se.current===p;Tt&&(me.current++,Ut(),ne.current.deactivate(),J.current===R&&(J.current=null),le.current===P&&(le.current=null),N.current===S&&(N.current=null),b.current===B&&(b.current=null),I.current===q&&(I.current=null),Q.current===fe&&(Q.current=null),U.current===Me&&(U.current=null)),q==null||q.cancel(),fe==null||fe.reset(),Me==null||Me.reset(),B==null||B.disconnect(),R&&await R.destroy().catch(()=>{}),P==null||P.getTracks().forEach(Ur=>Ur.stop()),S&&S.state!=="closed"&&await S.close().catch(()=>{}),T.current===X&&(T.current=null),X==null||X.release(),Tt&&!(Pt instanceof DOMException&&Pt.name==="AbortError")&&ct(Pt instanceof Error?Pt.message:"Could not start the microphone.")}finally{Se.current===p&&(O.current=!1)}},ln=(p,S)=>(D.current||O.current)&&!ao.current&&ph(me.current,S,J.current,p,K.current,ne.current.acceptsCallbacks),Nt=(p,S,P)=>p!==null&&J.current===p&&D.current&&K.current===S&&(P===void 0||me.current===P),Ar=(p,S,P)=>Nt(p,S,P)&&p!==null&&!ne.current.isInvalid(p),Di=(p,S)=>{Ut(),p&&(H.current=window.setTimeout(()=>{H.current=null,ln(p,S)&&ne.current.flush(p).then(()=>{Ar(p,!1,S)}).catch(P=>{Nt(p,!1,S)&&(ne.current.isInvalid(p)?nn("Microphone transition timed out. Tap the shape to reconnect."):ct(P instanceof Error?P.message:"Microphone recovery failed."))})},Xp))},Or=(p,S)=>{!p||!ln(p,S)||ne.current.flush(p).catch(P=>{Nt(p,!1,S)&&(ne.current.isInvalid(p)?nn("Microphone transition timed out. Tap the shape to reconnect."):ct(P instanceof Error?P.message:"Microphone recovery failed."))})},ir=(p,S)=>{ln(p,S)&&ie.current.shouldInterruptNow(ue.current,ve.current)&&(yt(),tn(),Qt())},lr=async()=>{var S,P,R,X,B;if(!D.current){O.current||ei();return}const p=N.current;if(p&&p.state!=="running"&&p.state!=="closed"&&(await p.resume().catch(()=>{}),p.state==="running")){Ze(K.current?"muted":"listening");return}if(!K.current&&Dl(!!G.current,!!((S=I.current)!=null&&S.busy),$.current)){tn(),Qt();return}if(K.current=!K.current,K.current){Ut(),wn(),Qt(),ie.current.reset(),yt(),ue.current="",pe.current=0,ve.current="",(P=Q.current)==null||P.reset(),(R=U.current)==null||R.reset(),(X=le.current)==null||X.getTracks().forEach(fe=>{fe.enabled=!1});const q=J.current;if(!Nt(q,!0))return;q==null||q.setOptions({submitUserSpeechOnPause:!1});try{if(q&&await ne.current.pause(q),!Ar(q,!0)){Nt(q,!0)&&q&&ne.current.isInvalid(q)&&nn("Microphone transition timed out. Tap the shape to reconnect.");return}Ze("muted")}catch(fe){if(!Nt(q,!0))return;q&&ne.current.isInvalid(q)?nn("Microphone transition timed out. Tap the shape to reconnect."):ct(fe instanceof Error?fe.message:"Could not pause the microphone.")}}else{(B=le.current)==null||B.getTracks().forEach(fe=>{fe.enabled=!0});const q=J.current;if(!Nt(q,!1))return;try{if(q){if(await ne.current.start(q),!Ar(q,!1)){Nt(q,!1)&&ne.current.isInvalid(q)&&nn("Microphone transition timed out. Tap the shape to reconnect.");return}q.setOptions({submitUserSpeechOnPause:!0})}if(!Ar(q,!1))return;Ze("listening")}catch(fe){if(!Nt(q,!1))return;q&&ne.current.isInvalid(q)?nn("Microphone transition timed out. Tap the shape to reconnect."):ct(fe instanceof Error?fe.message:"Could not resume the microphone.")}}},po=()=>{if(Sn(),_(""),D.current||O.current){nn(""),window.setTimeout(()=>{!D.current&&!O.current&&ei()},0);return}ei()};if(C.useEffect(()=>{cp(),Kl()},[u]),C.useEffect(()=>{const p=new AbortController;return fetch("/api/sessions",{headers:Ae(),signal:p.signal}).then(mn).then(async S=>{if(!S.ok)return;const R=(await S.json()).sessions.find(X=>X.key===u);R&&!p.signal.aborted&&(Ue.current=R.harness,Mn({harness:R.harness,title:R.title,cwd:R.cwd,host:R.host}))}).catch(S=>{S instanceof pn&&!p.signal.aborted&&Ko(!0)}),()=>p.abort()},[u]),C.useEffect(()=>{let p=!1;const S=()=>{fetch("/api/health",{headers:Ae()}).then(async R=>{const X=await R.json().catch(()=>({}));if(p)return;const B=X.speech??{};Ho({ready:B.ready!==!1,downloading:B.downloading===!0,progress:typeof B.progress=="number"?B.progress:void 0,error:typeof B.error=="string"?B.error:void 0})}).catch(()=>{})};S();const P=window.setInterval(S,em);return()=>{p=!0,window.clearInterval(P)}},[]),C.useEffect(()=>{var p;if(ao.current=at,at?on():Gl(),!at){so&&or(),(p=Zt.current)==null||p.abort(),Zt.current=null;return}Ct(""),tr(""),xn(eo()??void 0)},[at]),C.useEffect(()=>{if(!Dt&&!at)return;const p=P=>{var X,B;const R=P.target;R instanceof Node&&((X=bo.current)!=null&&X.contains(R)||(B=Yo.current)!=null&&B.contains(R))||Sn()},S=P=>{P.key==="Escape"&&(P.preventDefault(),Sn())};return document.addEventListener("pointerdown",p),document.addEventListener("keydown",S),()=>{document.removeEventListener("pointerdown",p),document.removeEventListener("keydown",S)}},[Dt,at]),C.useEffect(()=>{at&&window.setTimeout(()=>{var p;return(p=Xo.current)==null?void 0:p.focus()},0)},[at]),C.useEffect(()=>()=>{var p,S,P,R,X,B,q,fe;j.current=!1,be.current++,xe.current!==null&&window.clearTimeout(xe.current),xe.current=null,D.current=!1,rn(),(p=Zt.current)==null||p.abort(),(S=Kt.current)==null||S.abort(),Kt.current=null,Fe.current=null,en.current&&en.current.state!=="closed"&&en.current.close().catch(()=>{}),en.current=null,me.current++,Ut(),ne.current.deactivate(),wn(),Qt(),ie.current.reset(),yt(),ue.current="",pe.current=0,ve.current="",(P=Q.current)==null||P.reset(),(R=U.current)==null||R.reset(),U.current=null,(X=J.current)==null||X.destroy(),(B=le.current)==null||B.getTracks().forEach(Me=>{Me.onended=null,Me.stop()}),(q=N.current)==null||q.close(),(fe=b.current)==null||fe.disconnect(),b.current=null,Rr()},[]),Ri)return h.jsx(Bf,{});const bl=Dl(!!G.current,!!((vo=I.current)!=null&&vo.busy),$.current),Yl=D.current?s==="muted"?"Unmute microphone":bl?"Stop reply":"Mute microphone":"Start voice conversation",ti=Dt?Math.max(12,Math.min(Dt.x,window.innerWidth-170)):0,mo=Dt?Math.max(12,Math.min(Dt.y,window.innerHeight-68)):0,zr=ji||yn,Dr=gt.ready,sn=gt.ready?"Ready":gt.downloading?`Downloading voice models…${typeof gt.progress=="number"?` ${Math.round(gt.progress)}%`:""}`:"Offline";return h.jsxs("main",{className:"voice-page","data-state":s,style:{"--level":d},children:[h.jsxs("header",{className:"room-header",children:[h.jsx("a",{className:"room-header__back",href:"/","aria-label":"Back to hub",children:"←"}),h.jsx("img",{className:"room-header__logo",src:"/logo-192.png",alt:"",width:22,height:22}),h.jsxs("span",{className:"room-header__title",children:[_t.harness?Bl[_t.harness]:"Meldivo"," · ",_t.title]}),(_t.host||_t.cwd)&&h.jsx("span",{className:"room-header__cwd",children:[_t.host,_t.cwd].filter(Boolean).join(" · ")})]}),Qo&&h.jsx("p",{className:"room-status",role:"status",children:Qo}),h.jsx(qp,{items:Nr.items}),qo&&h.jsx("p",{className:"room-status voice-fallback-notice",role:"status",children:"Using basic voice detection"}),!gt.ready&&h.jsx("p",{className:"voice-health",role:"status",children:gt.error||sn}),h.jsxs("button",{className:"voice-shape",type:"button",onClick:()=>{if(Date.now()<uo.current){uo.current=0;return}if(Dt||at){Sn();return}lr()},onPointerDown:Oi,onPointerMove:Zo,onPointerUp:rn,onPointerCancel:rn,onPointerLeave:rn,onLostPointerCapture:rn,onContextMenu:p=>{p.preventDefault(),ho(p.clientX,p.clientY)},onKeyDown:p=>{if(p.key==="ContextMenu"||p.key==="F10"&&p.shiftKey){p.preventDefault();const S=p.currentTarget.getBoundingClientRect();ho(S.left+S.width/2,S.top+S.height/2)}},"aria-label":Yl,"aria-haspopup":"menu","aria-expanded":!!(Dt||at),children:[h.jsx("span",{className:"voice-shape__halo"}),h.jsx("span",{className:"voice-shape__ring voice-shape__ring--one"}),h.jsx("span",{className:"voice-shape__ring voice-shape__ring--two"}),h.jsx("span",{className:"voice-shape__core"})]}),Dt&&h.jsx("div",{ref:bo,className:"voice-context-menu",role:"menu","aria-label":"Voice options",style:{left:ti,top:mo},children:h.jsx("button",{type:"button",role:"menuitem",onClick:()=>{no(null),Xn(!0)},children:"Settings"})}),at&&h.jsxs("div",{ref:Yo,className:"voice-settings",role:"dialog","aria-modal":"false","aria-labelledby":"voice-settings-title",onKeyDown:p=>{p.key==="Escape"&&(p.preventDefault(),Sn())},children:[h.jsxs("div",{className:"voice-settings__header",children:[h.jsx("h2",{id:"voice-settings-title",children:"Voice"}),h.jsx("button",{className:"voice-settings__close",type:"button",onClick:Sn,"aria-label":"Close voice settings",children:"×"})]}),h.jsxs("p",{id:"tts-provider-status",className:`voice-settings__availability voice-settings__availability--${gt.ready?"ready":gt.downloading?"checking":"offline"}`,role:"status",children:[h.jsx("span",{"aria-hidden":"true"}),sn]}),gt.error&&h.jsx("p",{className:"voice-settings__availability-note",children:gt.error}),Zn&&h.jsx("p",{className:"voice-settings__availability-note",children:Zn}),Ln&&h.jsx("p",{className:"voice-settings__muted",children:"Loading voices…"}),!Ln&&ro.length>0&&h.jsxs(h.Fragment,{children:[h.jsx("label",{className:"voice-settings__label",htmlFor:"voice-choice",children:"Choose a voice"}),h.jsxs("div",{className:"voice-settings__choice",children:[h.jsx("select",{ref:Xo,id:"voice-choice",value:vt,onChange:p=>{or(),oo(p.target.value),Ct(""),tr("")},"aria-describedby":"voice-current",children:ro.map(p=>h.jsx("option",{value:p,children:Pi(p)},p))}),h.jsx("button",{className:"voice-settings__play",type:"button",onClick:()=>{kn()},disabled:!vt||!Dr||!!so,"aria-label":`Preview ${vt||"voice"}`,"aria-describedby":"tts-provider-status",title:Dr?void 0:"Wait for voice models to be ready.",children:so?"…":"▶"})]}),h.jsxs("p",{id:"voice-current",className:"voice-settings__current",children:["Current: ",zr?Pi(zr):"profile default"]}),h.jsxs("div",{className:"voice-settings__actions",children:[h.jsx("button",{type:"button",onClick:En,disabled:!vt||!Dr||vt===zr,"aria-describedby":"tts-provider-status",title:Dr?void 0:"Wait for voice models to be ready.",children:"Use this voice"}),h.jsx("button",{type:"button",onClick:Fr,disabled:!ji,children:"Restore default"})]})]}),!Ln&&!ro.length&&h.jsx(h.Fragment,{children:h.jsx("p",{className:"voice-settings__muted",children:"No selectable voices are configured."})}),er&&h.jsx("p",{className:"voice-settings__error",role:"alert",children:er}),Pr&&h.jsx("p",{className:"voice-settings__notice",role:"status",children:Pr}),h.jsxs("label",{className:"voice-settings__label",htmlFor:"vad-redemption",children:["End-of-speech wait: ",io," ms"]}),h.jsx("input",{id:"vad-redemption",type:"range",min:Mf,max:Ff,step:Ru,value:io,onChange:p=>Mr(Number(p.target.value)),"aria-describedby":"vad-redemption-hint"}),h.jsx("p",{id:"vad-redemption-hint",className:"voice-settings__muted",children:"How long to wait after you stop talking before the reply starts. Lower is snappier; higher avoids cutting off pauses."}),h.jsx("a",{className:"voice-settings__advanced-link",href:"/?settings=speech",children:"Speech engines and servers…"})]}),Hl&&h.jsx("div",{className:"voice-onboarding",role:"dialog","aria-modal":"true","aria-labelledby":"voice-onboarding-title",children:h.jsxs("div",{className:"voice-onboarding__card",children:[h.jsx("h2",{id:"voice-onboarding-title",children:"Welcome"}),h.jsx("p",{children:"Tap to talk, or to stop a reply · hold or right-click for settings."}),h.jsx("button",{type:"button",onClick:()=>{try{window.localStorage.setItem(Wf,"true")}catch{}An(!1)},children:"OK"})]})}),x&&h.jsxs("div",{className:"voice-error",role:"alert",title:x,children:[h.jsx("span",{children:x}),h.jsx("button",{className:"voice-error__reconnect",type:"button",onClick:po,children:"Reconnect"})]})]})}function $u(u){return{engine:u.engine,url:u.url??"",apiKey:"",hasKey:!!u.hasKey,clearKey:!1,model:u.model??"",voice:u.voice??"",models:[],voices:[],status:"idle",error:""}}function $l(u){return u.engine==="local"?{engine:"local",...u.voice?{voice:u.voice}:{}}:{engine:u.engine,url:u.url,...u.apiKey?{apiKey:u.apiKey}:{},...u.clearKey?{clearKey:!0}:{},...u.model?{model:u.model}:{},...u.voice?{voice:u.voice}:{}}}function Cf(u){const l=/^([abefhijpz])([fm])_(.+)$/.exec(u),c=(l?l[3]:u.replace(/\.(wav|mp3|flac)$/i,"")).replace(/[_-]+/g," ").trim().replace(/\b\w/g,g=>g.toUpperCase());return l?`${c} (${{a:"American",b:"British",e:"Spanish",f:"French",h:"Hindi",i:"Italian",j:"Japanese",p:"Portuguese",z:"Chinese"}[l[1]]??""} ${l[2]==="f"?"female":"male"})`.replace("( ","("):c}async function im(u,l,s){const c=mn(await fetch(u,{method:"POST",headers:{"Content-Type":"application/json",...Ae()},body:JSON.stringify(l),signal:s})),d=await c.json().catch(()=>({}));if(!c.ok)throw new Error(d.error??"The request failed.");return d}function Nf({kind:u,engines:l,draft:s,onChange:c}){const d=l.find(N=>N.id===s.engine),g=s.engine!=="local",[x,_]=C.useState(!1),L=C.useRef(null),j=C.useRef(null),K=C.useRef(null),D=u==="tts"?"Text to speech":"Speech to text",O=`speech-${u}`,$=u==="tts"?s.model:"";C.useEffect(()=>{var G;if((G=K.current)==null||G.abort(),g&&!s.url.trim()){c(ge=>({...ge,models:[],voices:[],status:"idle",error:""}));return}const N=new AbortController;K.current=N;const b=window.setTimeout(()=>{c(I=>({...I,status:"loading",error:""}));const ge={...$l({...s,voice:""})};im("/api/speech/discover",{kind:u,setting:ge},N.signal).then(I=>{N.signal.aborted||c(Q=>{var me;const U=I.models.some(Se=>Se.id===Q.model)?Q.model:I.model??((me=I.models[0])==null?void 0:me.id)??"",ne=I.voices.includes(Q.voice)?Q.voice:I.voice??I.voices[0]??"";return{...Q,models:I.models,voices:I.voices,model:U,voice:ne,status:"ready",error:""}})}).catch(I=>{if(I instanceof pn)throw I;N.signal.aborted||c(Q=>({...Q,models:[],voices:[],status:"error",error:I instanceof Error?I.message:"Could not reach the server."}))})},g?600:0);return()=>{window.clearTimeout(b),N.abort()}},[u,s.engine,s.url,s.apiKey,s.clearKey,$]);const J=()=>{var b;(b=L.current)==null||b.abort();const N=j.current;j.current=null,N&&N.state!=="closed"&&N.close().catch(()=>{})};C.useEffect(()=>J,[]);const le=async()=>{if(!s.voice)return;J();const N=new AbortController;L.current=N;const b=new AudioContext;j.current=b,_(!0),c(G=>({...G,error:""}));try{const G=mn(await fetch("/api/speech/preview",{method:"POST",headers:{"Content-Type":"application/json",...Ae()},body:JSON.stringify({setting:$l(s),voice:s.voice}),signal:N.signal}));if(!G.ok)throw new Error((await G.json().catch(()=>({}))).error??"Preview failed.");await b.resume();const ge=await b.decodeAudioData(await G.arrayBuffer());if(N.signal.aborted)return;const I=b.createBufferSource();I.buffer=ge,I.connect(b.destination),I.onended=()=>{j.current===b&&(J(),_(!1))},I.start()}catch(G){if(G instanceof pn)throw G;N.signal.aborted||(J(),_(!1),c(ge=>({...ge,error:G instanceof Error?G.message:"Preview failed."})))}};return h.jsxs("section",{className:"speech-section","aria-labelledby":`${O}-title`,children:[h.jsx("h3",{id:`${O}-title`,children:D}),h.jsxs("label",{className:"speech-field",children:[h.jsx("span",{children:"Engine"}),h.jsx("select",{value:s.engine,onChange:N=>{const b=N.target.value;c(G=>({...$u({engine:b}),url:b===G.engine?G.url:""}))},children:l.map(N=>h.jsxs("option",{value:N.id,children:[N.label,N.note?` · ${N.note}`:""]},N.id))})]}),g&&h.jsxs(h.Fragment,{children:[h.jsxs("label",{className:"speech-field",children:[h.jsx("span",{children:"Server address"}),h.jsx("input",{type:"url",inputMode:"url",autoComplete:"off",spellCheck:!1,placeholder:(d==null?void 0:d.defaultUrl)??"http://localhost:8000",value:s.url,onChange:N=>{const b=N.target.value;c(G=>({...G,url:b}))}})]}),h.jsxs("label",{className:"speech-field",children:[h.jsxs("span",{children:["API key ",h.jsx("em",{children:"(optional)"})]}),h.jsx("input",{type:"password",autoComplete:"off",placeholder:s.hasKey&&!s.clearKey?"Saved; type to replace":"Leave empty if the server has none",value:s.apiKey,onChange:N=>{const b=N.target.value;c(G=>({...G,apiKey:b,clearKey:!1}))}})]}),s.hasKey&&!s.apiKey&&!s.clearKey&&h.jsx("button",{type:"button",className:"speech-link",onClick:()=>c(N=>({...N,clearKey:!0})),children:"Remove saved key"})]}),s.status==="loading"&&h.jsx("p",{className:"speech-status",children:"Connecting…"}),s.status==="ready"&&g&&h.jsx("p",{className:"speech-status speech-status--ok",children:"Connected"}),s.status==="error"&&h.jsx("p",{className:"speech-status speech-status--error",role:"alert",children:s.error}),g&&s.models.length>0&&((d==null?void 0:d.hasModels)||s.models.length>1)&&h.jsxs("label",{className:"speech-field",children:[h.jsx("span",{children:"Model"}),h.jsx("select",{value:s.model,onChange:N=>{const b=N.target.value;c(G=>({...G,model:b}))},children:s.models.map(N=>h.jsxs("option",{value:N.id,children:[N.id,N.installed===!1?" (downloads on first use)":""]},N.id))})]}),u==="tts"&&s.voices.length>0&&h.jsxs("div",{className:"speech-field",children:[h.jsx("label",{htmlFor:`${O}-voice`,children:"Speaker"}),h.jsxs("div",{className:"speech-voice",children:[h.jsx("select",{id:`${O}-voice`,value:s.voice,onChange:N=>{const b=N.target.value;c(G=>({...G,voice:b}))},children:s.voices.map(N=>h.jsx("option",{value:N,children:Cf(N)},N))}),h.jsx("button",{type:"button",className:"speech-play",onClick:()=>{le()},disabled:!s.voice||x,"aria-label":`Play a preview of ${s.voice?Cf(s.voice):"this speaker"}`,children:x?"…":"▶"})]})]}),s.error&&s.status!=="error"&&h.jsx("p",{className:"speech-status speech-status--error",role:"alert",children:s.error})]})}function lm({onClose:u}){const[l,s]=C.useState(null),[c,d]=C.useState(null),[g,x]=C.useState(null),[_,L]=C.useState(""),[j,K]=C.useState(""),[D,O]=C.useState(!1);C.useEffect(()=>{fetch("/api/speech/settings",{headers:Ae()}).then(mn).then(async N=>{if(!N.ok)throw new Error("Could not load the speech settings.");const b=await N.json();s(b),d($u(b.tts.setting)),x($u(b.stt.setting))}).catch(N=>{if(N instanceof pn)throw N;L(N instanceof Error?N.message:"Could not load the speech settings.")})},[]);const $=N=>b=>{K(""),N(G=>G&&b(G))},J=()=>{!c||!g||(O(!0),L(""),K(""),fetch("/api/speech/settings",{method:"PUT",headers:{"Content-Type":"application/json",...Ae()},body:JSON.stringify({tts:$l(c),stt:$l(g)})}).then(mn).then(async N=>{const b=await N.json().catch(()=>({}));if(!N.ok)throw new Error(b.error??"Could not save the speech settings.");d(G=>G&&{...G,apiKey:"",clearKey:!1,hasKey:!!b.tts.setting.hasKey}),x(G=>G&&{...G,apiKey:"",clearKey:!1,hasKey:!!b.stt.setting.hasKey}),K("Saved. Every machine and browser on this hub uses it from the next turn.")}).catch(N=>{if(N instanceof pn)throw N;L(N instanceof Error?N.message:"Could not save the speech settings.")}).finally(()=>O(!1)))},le=N=>!N||N.engine!=="local"&&!N.url.trim();return h.jsxs("div",{className:"hub-remote speech-settings",role:"dialog","aria-labelledby":"speech-settings-title",children:[h.jsxs("div",{className:"hub-remote__header",children:[h.jsx("h2",{id:"speech-settings-title",children:"Speech"}),h.jsx("button",{className:"hub-remote__close",type:"button",onClick:u,"aria-label":"Close speech settings",children:"×"})]}),h.jsx("p",{className:"hub-muted speech-intro",children:"Use the built-in on-device models, or point either direction at a speech server you run, for a bigger, more realistic, or faster model."}),!l&&!_&&h.jsx("p",{className:"hub-muted",children:"Loading…"}),l&&c&&g&&h.jsxs(h.Fragment,{children:[h.jsx(Nf,{kind:"tts",engines:l.tts.engines,draft:c,onChange:$(d)}),h.jsx(Nf,{kind:"stt",engines:l.stt.engines,draft:g,onChange:$(x)}),h.jsx("div",{className:"speech-actions",children:h.jsx("button",{type:"button",className:"hub-primary",onClick:J,disabled:D||le(c)||le(g),children:D?"Saving…":"Save"})})]}),_&&h.jsx("p",{className:"hub-error",role:"alert",children:_}),j&&h.jsx("p",{className:"speech-status speech-status--ok",role:"status",children:j})]})}const sm=5e3,um=5e3;function Ti(u){const l=/^(\/home\/[^/]+|\/Users\/[^/]+)(\/.*)?$/.exec(u);return l?l[2]?`~${l[2]}`:"~":u}function Hf(u){const l=Math.max(0,Math.round((Date.now()-u)/1e3));if(l<5)return"just now";if(l<60)return`${l}s ago`;const s=Math.round(l/60);if(s<60)return`${s}m ago`;const c=Math.round(s/60);return c<24?`${c}h ago`:`${Math.round(c/24)}d ago`}function Kf(u,l){window.location.href=`/?session=${encodeURIComponent(u)}${l?`&folder=${encodeURIComponent(l)}`:""}`}function am(u){return u.busy?{className:"hub-dot hub-dot--busy",label:"busy"}:u.open?{className:"hub-dot hub-dot--open",label:"open in terminal"}:{className:"hub-dot hub-dot--idle",label:"idle"}}function cm({onClose:u}){var O;const[l,s]=C.useState(null),[c,d]=C.useState(""),[g,x]=C.useState(!1),[_,L]=C.useState(""),j=()=>{d(""),fetch("/api/remote",{headers:Ae()}).then(mn).then(async $=>{if(!$.ok)throw new Error("Could not load phone access options.");s(await $.json())}).catch($=>{if($ instanceof pn)throw $;d($ instanceof Error?$.message:"Could not load phone access options.")})};C.useEffect(j,[]),C.useEffect(()=>{var le;const $=(le=l==null?void 0:l.active)==null?void 0:le.url;if(!$){L("");return}let J=!1;return Of(()=>import("./browser-CujOq0-h.js").then(N=>N.b),__vite__mapDeps([2,1])).then(async N=>{const b=await N.toDataURL($,{margin:1,width:200});J||L(b)}).catch(()=>{J||L("")}),()=>{J=!0}},[(O=l==null?void 0:l.active)==null?void 0:O.url]);const K=$=>{x(!0),d(""),fetch("/api/remote",{method:"POST",headers:{"Content-Type":"application/json",...Ae()},body:JSON.stringify({id:$})}).then(mn).then(async J=>{if(!J.ok)throw new Error((await J.json().catch(()=>({}))).error??"Could not enable phone access.");j()}).catch(J=>{if(J instanceof pn)throw J;d(J instanceof Error?J.message:"Could not enable phone access.")}).finally(()=>x(!1))},D=()=>{x(!0),d(""),fetch("/api/remote",{method:"DELETE",headers:Ae()}).then(mn).then($=>{if(!$.ok)throw new Error("Could not turn off phone access.");j()}).catch($=>{if($ instanceof pn)throw $;d($ instanceof Error?$.message:"Could not turn off phone access.")}).finally(()=>x(!1))};return h.jsxs("div",{className:"hub-remote",role:"dialog","aria-labelledby":"hub-remote-title",children:[h.jsxs("div",{className:"hub-remote__header",children:[h.jsx("h2",{id:"hub-remote-title",children:"Phone access"}),h.jsx("button",{className:"hub-remote__close",type:"button",onClick:u,"aria-label":"Close phone access",children:"×"})]}),!l&&!c&&h.jsx("p",{className:"hub-muted",children:"Loading…"}),c&&h.jsx("p",{className:"hub-error",role:"alert",children:c}),(l==null?void 0:l.active)&&h.jsxs("div",{className:"hub-remote__active",children:[h.jsx("p",{className:"hub-remote__url",children:l.active.url}),_&&h.jsx("img",{className:"hub-remote__qr",src:_,alt:"QR code for phone access URL"}),h.jsx("button",{type:"button",onClick:D,disabled:g,children:"Turn off"})]}),l&&!l.active&&h.jsxs(h.Fragment,{children:[h.jsx("ul",{className:"hub-remote__options",children:l.options.map($=>h.jsx("li",{children:h.jsxs("button",{type:"button",disabled:!$.ready||g,onClick:()=>K($.id),children:[$.label,$.ready?"":" (not ready)"]})},$.id))}),!l.options.some($=>$.ready)&&l.guide&&(/^https?:\/\//.test(l.guide)?h.jsx("p",{className:"hub-muted",children:h.jsx("a",{href:l.guide,target:"_blank",rel:"noreferrer",children:"Set up phone access"})}):h.jsx("p",{className:"hub-muted",children:l.guide}))]})]})}const Pf="meldivo.machine",fm=5;function dm(u){return u.id?`@${u.id}/`:""}function hm({host:u,sessions:l,selected:s,onSelect:c}){const d=l.filter(L=>L.open).length,g=l.some(L=>L.busy),x=l.reduce((L,j)=>Math.max(L,j.updatedAt),0),_=u.online?g?"hub-dot--busy":"hub-dot--online":"hub-dot--idle";return h.jsxs("button",{type:"button",role:"tab","aria-selected":s,className:`hub-machine${s?" hub-machine--selected":""}${u.online?"":" hub-machine--offline"}`,onClick:c,children:[h.jsxs("span",{className:"hub-machine__name",children:[h.jsx("span",{className:`hub-dot ${_}`,"aria-hidden":"true"}),u.name]}),h.jsx("span",{className:"hub-machine__meta",children:u.online?h.jsxs(h.Fragment,{children:[l.length," session",l.length===1?"":"s",d>0&&h.jsxs(h.Fragment,{children:[" · ",d," open"]})]}):"offline"}),u.online&&x>0&&h.jsxs("span",{className:"hub-machine__meta",children:["active ",Hf(x)]})]})}const ju=1440*60*1e3;function pm(u,l){const s=Date.now()-u;return l==="today"?new Date(u).toDateString()===new Date().toDateString():l==="week"?s<=7*ju:l==="month"?s<=30*ju:l==="older"?s>30*ju:!0}function mm(u,l){const s=[...u];return l==="title"?s.sort((c,d)=>(c.title||"").localeCompare(d.title||"",void 0,{sensitivity:"base"})):s.sort((c,d)=>l==="oldest"?c.updatedAt-d.updatedAt:d.updatedAt-c.updatedAt),s}function vm({session:u}){const l=am(u);return h.jsx("li",{children:h.jsxs("button",{type:"button",className:"hub-session",onClick:()=>Kf(u.key),children:[h.jsx("span",{className:l.className,"aria-hidden":"true",title:l.label}),h.jsxs("span",{className:"hub-session__body",children:[h.jsx("span",{className:"hub-session__title",children:u.title||"(untitled)"}),h.jsxs("span",{className:"hub-session__meta",children:[h.jsx("span",{className:"hub-session__badge",children:Bl[u.harness]}),h.jsx("span",{className:"hub-session__time",children:Hf(u.updatedAt)})]}),u.open&&h.jsx("span",{className:"hub-session__hint",children:"open in a terminal · continues as a voice copy"})]})]})})}function Qf(u,l){if(l.length===0)return!0;const s=`${u.title} ${Ti(u.cwd)} ${Bl[u.harness]}`.toLowerCase();return l.every(c=>s.includes(c))}function qf(u){return u.trim().toLowerCase().split(/\s+/).filter(Boolean)}function gm({cwd:u,sessions:l,total:s}){const[c,d]=C.useState(""),g=qf(c),x=l.filter(j=>Qf(j,g)),_=Ti(u),L=_==="~"?"Home folder":_||"(no folder)";return h.jsxs("section",{className:"hub-folder","aria-label":L,children:[h.jsxs("h3",{className:"hub-folder__title",children:[h.jsx("span",{children:L}),h.jsx("span",{className:"hub-folder__count",children:l.length===s?s:`${l.length} of ${s}`})]}),l.length>fm&&h.jsx("input",{type:"search",className:"hub-folder__search",placeholder:`Search in ${L}`,value:c,onChange:j=>d(j.target.value),"aria-label":`Search sessions in ${L}`,autoComplete:"off"}),x.length===0?h.jsx("p",{className:"hub-muted hub-folder__none",children:"No sessions here match."}):h.jsx("ul",{className:"hub-sessions hub-folder__list",children:x.map(j=>h.jsx(vm,{session:j},j.key))})]})}function ym({host:u,folders:l,agent:s,folder:c,onClose:d}){var K,D;const g=[...u.harnesses].filter(O=>O.available).sort((O,$)=>Uu.indexOf(O.id)-Uu.indexOf($.id)),[x,_]=C.useState(((K=g.find(O=>O.id===s))==null?void 0:K.id)??((D=g[0])==null?void 0:D.id)),[L,j]=C.useState(c==="all"?"":c);return g.length===0?h.jsx("div",{className:"hub-newchat",children:h.jsxs("p",{className:"hub-muted",children:["No coding agents are installed on ",u.name,"."]})}):h.jsxs("div",{className:"hub-newchat",role:"group","aria-label":"New chat",children:[h.jsxs("div",{className:"hub-newchat__row",children:[h.jsx("span",{className:"hub-newchat__label",children:"Agent"}),h.jsx("div",{className:"hub-chips",children:g.map(O=>h.jsx("button",{type:"button",className:`hub-chip${x===O.id?" hub-chip--on":""}`,"aria-pressed":x===O.id,onClick:()=>_(O.id),children:O.label},O.id))})]}),h.jsxs("label",{className:"hub-newchat__row",children:[h.jsx("span",{className:"hub-newchat__label",children:"Folder"}),h.jsxs("select",{className:"hub-select hub-select--wide",value:L,onChange:O=>j(O.target.value),children:[h.jsx("option",{value:"",children:"Home folder"}),l.map(O=>h.jsx("option",{value:O,children:Ti(O)},O))]})]}),h.jsxs("div",{className:"hub-newchat__actions",children:[h.jsx("button",{type:"button",className:"hub-more",onClick:d,children:"Cancel"}),h.jsx("button",{type:"button",className:"hub-primary",disabled:!x,onClick:()=>x&&Kf(`${dm(u)}new:${x}`,L||void 0),children:"Start talking"})]})]})}function wm({host:u,sessions:l}){const[s,c]=C.useState(""),[d,g]=C.useState("all"),[x,_]=C.useState("all"),[L,j]=C.useState("any"),[K,D]=C.useState("newest"),[O,$]=C.useState(!1),[J,le]=C.useState(!1);if(C.useEffect(()=>{c(""),g("all"),_("all"),j("any"),D("newest"),$(!1),le(!1)},[u.id]),!u.online)return h.jsxs("p",{className:"hub-empty",children:[u.name," is offline. Its sessions appear here as soon as it reconnects."]});const N=new Map;for(const H of l)N.set(H.cwd,Math.max(N.get(H.cwd)??0,H.updatedAt));const b=[...N.entries()].sort((H,xe)=>xe[1]-H[1]).map(([H])=>H),G=b.filter(H=>H&&Ti(H)!=="~"),ge=Uu.filter(H=>l.some(xe=>xe.harness===H)),I=qf(s),Q=mm(l.filter(H=>d!=="all"&&H.harness!==d||x!=="all"&&H.cwd!==x||O&&!H.open||!pm(H.updatedAt,L)?!1:Qf(H,I)),K),U=l.filter(H=>H.open).length,ne=d!=="all"||x!=="all"||L!=="any"||O||I.length>0,me=[];for(const H of Q){const xe=me.find(be=>be.cwd===H.cwd);xe?xe.sessions.push(H):me.push({cwd:H.cwd,sessions:[H]})}const Se=new Map;for(const H of l)Se.set(H.cwd,(Se.get(H.cwd)??0)+1);return h.jsxs("div",{className:"hub-panel",role:"tabpanel",children:[h.jsxs("div",{className:"hub-search",children:[h.jsx("input",{type:"search",className:"hub-search__input",placeholder:`Search all ${l.length} sessions`,value:s,onChange:H=>c(H.target.value),"aria-label":`Search all sessions on ${u.name}`,autoComplete:"off"}),h.jsx("button",{type:"button",className:"hub-primary","aria-expanded":J,onClick:()=>le(!J),children:J?"Close":"New chat"})]}),J&&h.jsx(ym,{host:u,folders:G,agent:d,folder:x,onClose:()=>le(!1)}),l.length>0&&h.jsxs("div",{className:"hub-filters",children:[h.jsxs("div",{className:"hub-chips",role:"group","aria-label":"Filter by agent",children:[h.jsx("button",{type:"button",className:`hub-chip${d==="all"?" hub-chip--on":""}`,"aria-pressed":d==="all",onClick:()=>g("all"),children:"All agents"}),ge.map(H=>h.jsxs("button",{type:"button",className:`hub-chip${d===H?" hub-chip--on":""}`,"aria-pressed":d===H,onClick:()=>g(d===H?"all":H),children:[Bl[H]," ",h.jsx("span",{className:"hub-chip__count",children:l.filter(xe=>xe.harness===H).length})]},H)),h.jsxs("button",{type:"button",className:`hub-chip${O?" hub-chip--on":""}`,"aria-pressed":O,disabled:U===0&&!O,onClick:()=>$(!O),children:["Open now ",h.jsx("span",{className:"hub-chip__count",children:U})]})]}),h.jsxs("div",{className:"hub-selects",children:[h.jsxs("select",{className:"hub-select",value:x,onChange:H=>_(H.target.value),"aria-label":"Folder",children:[h.jsxs("option",{value:"all",children:["All folders (",b.length,")"]}),b.map(H=>h.jsx("option",{value:H,children:Ti(H)||"(no folder)"},H))]}),h.jsxs("select",{className:"hub-select",value:L,onChange:H=>j(H.target.value),"aria-label":"Date",children:[h.jsx("option",{value:"any",children:"Any time"}),h.jsx("option",{value:"today",children:"Today"}),h.jsx("option",{value:"week",children:"Past 7 days"}),h.jsx("option",{value:"month",children:"Past 30 days"}),h.jsx("option",{value:"older",children:"Older than 30 days"})]}),h.jsxs("select",{className:"hub-select",value:K,onChange:H=>D(H.target.value),"aria-label":"Sort",children:[h.jsx("option",{value:"newest",children:"Newest first"}),h.jsx("option",{value:"oldest",children:"Oldest first"}),h.jsx("option",{value:"title",children:"Title A–Z"})]})]})]}),l.length===0&&h.jsxs("p",{className:"hub-empty",children:["No sessions on ",u.name," yet. Tap New chat to start one."]}),l.length>0&&Q.length===0&&h.jsxs("p",{className:"hub-empty",children:["No sessions match. ",h.jsx("button",{type:"button",className:"hub-link",onClick:()=>{c(""),g("all"),_("all"),j("any"),$(!1)},children:"Clear filters"})]}),ne&&Q.length>0&&h.jsxs("p",{className:"hub-count",children:[Q.length," of ",l.length," sessions"]}),h.jsx("div",{className:"hub-folders",children:me.map(H=>h.jsx(gm,{cwd:H.cwd,sessions:H.sessions,total:Se.get(H.cwd)??H.sessions.length},`${u.id}|${H.cwd}`))})]})}function Sm(){const[u,l]=C.useState(null),[s,c]=C.useState(""),[d,g]=C.useState(!1),[x,_]=C.useState({ready:!0,downloading:!1}),[L,j]=C.useState(!1),[K,D]=C.useState(()=>new URLSearchParams(window.location.search).get("settings")==="speech"),[O,$]=C.useState(()=>{try{return window.localStorage.getItem(Pf)}catch{return null}}),J=C.useRef(!0);if(C.useEffect(()=>(J.current=!0,()=>{J.current=!1}),[]),C.useEffect(()=>{let U=!1;const ne=()=>{fetch("/api/sessions",{headers:Ae()}).then(mn).then(async Se=>{if(!Se.ok)throw new Error("Could not load sessions.");const H=await Se.json();U||(l(H),c(""))}).catch(Se=>{if(!U){if(Se instanceof pn){g(!0);return}c(Se instanceof Error?Se.message:"Could not load sessions.")}})};ne();const me=window.setInterval(ne,sm);return()=>{U=!0,window.clearInterval(me)}},[]),C.useEffect(()=>{let U=!1;const ne=()=>{fetch("/api/health",{headers:Ae()}).then(async Se=>{const H=await Se.json().catch(()=>({}));if(U)return;const xe=H.speech??{};_({ready:xe.ready!==!1,downloading:xe.downloading===!0,progress:typeof xe.progress=="number"?xe.progress:void 0,error:typeof xe.error=="string"?xe.error:void 0})}).catch(()=>{})};ne();const me=window.setInterval(ne,um);return()=>{U=!0,window.clearInterval(me)}},[]),d)return h.jsx(Bf,{});const le=(u==null?void 0:u.hosts)??(u?[{id:"",name:u.machine,online:!0,harnesses:u.harnesses}]:[]),N=(u==null?void 0:u.sessions)??[],b=U=>N.filter(ne=>(ne.host??"")===U.id),G=le.filter(U=>U.id!==""||le.length===1||U.harnesses.some(ne=>ne.available)||b(U).length>0),ge=G.find(U=>U.id===O)??G.find(U=>U.online)??G[0],I=U=>{$(U);try{window.localStorage.setItem(Pf,U)}catch{}},Q=x.ready?"Speech ready":x.downloading?`Downloading voice models…${typeof x.progress=="number"?` ${Math.round(x.progress)}%`:""}`:"Speech offline";return h.jsxs("main",{className:"hub-page",children:[h.jsxs("header",{className:"hub-header",children:[h.jsxs("h1",{className:"hub-title",children:[h.jsx("img",{className:"hub-logo",src:"/logo-192.png",alt:"",width:30,height:30}),G.length>1?"Meldivo":(u==null?void 0:u.machine)??"Meldivo"]}),h.jsx("p",{className:`hub-speech-status${x.ready?"":" hub-speech-status--warn"}`,role:"status",children:x.error||Q}),h.jsx("button",{type:"button",className:"hub-remote-button",onClick:()=>{j(!1),D(!0)},children:"Speech"}),h.jsx("button",{type:"button",className:"hub-remote-button hub-remote-button--next",onClick:()=>{D(!1),j(!0)},children:"Phone access"})]}),s&&h.jsx("p",{className:"hub-error",role:"alert",children:s}),!u&&!s&&h.jsx("p",{className:"hub-empty",children:"Loading…"}),G.length>1&&h.jsx("nav",{className:"hub-machines",role:"tablist","aria-label":"Machines",children:G.map(U=>h.jsx(hm,{host:U,sessions:b(U),selected:U===ge,onSelect:()=>I(U.id)},U.id||"local"))}),ge&&h.jsx(wm,{host:ge,sessions:b(ge)}),L&&h.jsx(cm,{onClose:()=>j(!1)}),K&&h.jsx(lm,{onClose:()=>D(!1)})]})}Ap();const Gf=new URLSearchParams(window.location.search),Tf=Gf.get("session");ah.createRoot(document.getElementById("root")).render(Tf?h.jsx(om,{sessionKey:Tf,folder:Gf.get("folder")??void 0}):h.jsx(Sm,{}));
|