meldivo 2.4.4 → 2.4.6
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.
|
@@ -0,0 +1,80 @@
|
|
|
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 th=Object.defineProperty;var nh=(u,s,l)=>s in u?th(u,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):u[s]=l;var ne=(u,s,l)=>nh(u,typeof s!="symbol"?s+"":s,l);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))f(c);new MutationObserver(c=>{for(const g of c)if(g.type==="childList")for(const x of g.addedNodes)x.tagName==="LINK"&&x.rel==="modulepreload"&&f(x)}).observe(document,{childList:!0,subtree:!0});function l(c){const g={};return c.integrity&&(g.integrity=c.integrity),c.referrerPolicy&&(g.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?g.credentials="include":c.crossOrigin==="anonymous"?g.credentials="omit":g.credentials="same-origin",g}function f(c){if(c.ep)return;c.ep=!0;const g=l(c);fetch(c.href,g)}})();var ku={exports:{}},Ri={},xu={exports:{}},Se={};/**
|
|
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 rf;function rh(){if(rf)return Se;rf=1;var u=Symbol.for("react.element"),s=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),x=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),j=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),z=Symbol.iterator;function O(y){return y===null||typeof y!="object"?null:(y=z&&y[z]||y["@@iterator"],typeof y=="function"?y:null)}var V={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Y=Object.assign,ee={};function N(y,R,se){this.props=y,this.context=R,this.refs=ee,this.updater=se||V}N.prototype.isReactComponent={},N.prototype.setState=function(y,R){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,R,"setState")},N.prototype.forceUpdate=function(y){this.updater.enqueueForceUpdate(this,y,"forceUpdate")};function Q(){}Q.prototype=N.prototype;function $(y,R,se){this.props=y,this.context=R,this.refs=ee,this.updater=se||V}var ye=$.prototype=new Q;ye.constructor=$,Y(ye,N.prototype),ye.isPureReactComponent=!0;var I=Array.isArray,q=Object.prototype.hasOwnProperty,U={current:null},re={key:!0,ref:!0,__self:!0,__source:!0};function me(y,R,se){var ue,pe={},we=null,ve=null;if(R!=null)for(ue in R.ref!==void 0&&(ve=R.ref),R.key!==void 0&&(we=""+R.key),R)q.call(R,ue)&&!re.hasOwnProperty(ue)&&(pe[ue]=R[ue]);var xe=arguments.length-2;if(xe===1)pe.children=se;else if(1<xe){for(var Te=Array(xe),it=0;it<xe;it++)Te[it]=arguments[it+2];pe.children=Te}if(y&&y.defaultProps)for(ue in xe=y.defaultProps,xe)pe[ue]===void 0&&(pe[ue]=xe[ue]);return{$$typeof:u,type:y,key:we,ref:ve,props:pe,_owner:U.current}}function ke(y,R){return{$$typeof:u,type:y.type,key:R,ref:y.ref,props:y.props,_owner:y._owner}}function K(y){return typeof y=="object"&&y!==null&&y.$$typeof===u}function _e(y){var R={"=":"=0",":":"=2"};return"$"+y.replace(/[=:]/g,function(se){return R[se]})}var Ge=/\/+/g;function et(y,R){return typeof y=="object"&&y!==null&&y.key!=null?_e(""+y.key):R.toString(36)}function qe(y,R,se,ue,pe){var we=typeof y;(we==="undefined"||we==="boolean")&&(y=null);var ve=!1;if(y===null)ve=!0;else switch(we){case"string":case"number":ve=!0;break;case"object":switch(y.$$typeof){case u:case s:ve=!0}}if(ve)return ve=y,pe=pe(ve),y=ue===""?"."+et(ve,0):ue,I(pe)?(se="",y!=null&&(se=y.replace(Ge,"$&/")+"/"),qe(pe,R,se,"",function(it){return it})):pe!=null&&(K(pe)&&(pe=ke(pe,se+(!pe.key||ve&&ve.key===pe.key?"":(""+pe.key).replace(Ge,"$&/")+"/")+y)),R.push(pe)),1;if(ve=0,ue=ue===""?".":ue+":",I(y))for(var xe=0;xe<y.length;xe++){we=y[xe];var Te=ue+et(we,xe);ve+=qe(we,R,se,Te,pe)}else if(Te=O(y),typeof Te=="function")for(y=Te.call(y),xe=0;!(we=y.next()).done;)we=we.value,Te=ue+et(we,xe++),ve+=qe(we,R,se,Te,pe);else if(we==="object")throw R=String(y),Error("Objects are not valid as a React child (found: "+(R==="[object Object]"?"object with keys {"+Object.keys(y).join(", ")+"}":R)+"). If you meant to render a collection of children, use an array instead.");return ve}function Ue(y,R,se){if(y==null)return y;var ue=[],pe=0;return qe(y,ue,"","",function(we){return R.call(se,we,pe++)}),ue}function Ve(y){if(y._status===-1){var R=y._result;R=R(),R.then(function(se){(y._status===0||y._status===-1)&&(y._status=1,y._result=se)},function(se){(y._status===0||y._status===-1)&&(y._status=2,y._result=se)}),y._status===-1&&(y._status=0,y._result=R)}if(y._status===1)return y._result.default;throw y._result}var Ne={current:null},W={transition:null},le={ReactCurrentDispatcher:Ne,ReactCurrentBatchConfig:W,ReactCurrentOwner:U};function H(){throw Error("act(...) is not supported in production builds of React.")}return Se.Children={map:Ue,forEach:function(y,R,se){Ue(y,function(){R.apply(this,arguments)},se)},count:function(y){var R=0;return Ue(y,function(){R++}),R},toArray:function(y){return Ue(y,function(R){return R})||[]},only:function(y){if(!K(y))throw Error("React.Children.only expected to receive a single React element child.");return y}},Se.Component=N,Se.Fragment=l,Se.Profiler=c,Se.PureComponent=$,Se.StrictMode=f,Se.Suspense=M,Se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=le,Se.act=H,Se.cloneElement=function(y,R,se){if(y==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+y+".");var ue=Y({},y.props),pe=y.key,we=y.ref,ve=y._owner;if(R!=null){if(R.ref!==void 0&&(we=R.ref,ve=U.current),R.key!==void 0&&(pe=""+R.key),y.type&&y.type.defaultProps)var xe=y.type.defaultProps;for(Te in R)q.call(R,Te)&&!re.hasOwnProperty(Te)&&(ue[Te]=R[Te]===void 0&&xe!==void 0?xe[Te]:R[Te])}var Te=arguments.length-2;if(Te===1)ue.children=se;else if(1<Te){xe=Array(Te);for(var it=0;it<Te;it++)xe[it]=arguments[it+2];ue.children=xe}return{$$typeof:u,type:y.type,key:pe,ref:we,props:ue,_owner:ve}},Se.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},Se.createElement=me,Se.createFactory=function(y){var R=me.bind(null,y);return R.type=y,R},Se.createRef=function(){return{current:null}},Se.forwardRef=function(y){return{$$typeof:C,render:y}},Se.isValidElement=K,Se.lazy=function(y){return{$$typeof:B,_payload:{_status:-1,_result:y},_init:Ve}},Se.memo=function(y,R){return{$$typeof:j,type:y,compare:R===void 0?null:R}},Se.startTransition=function(y){var R=W.transition;W.transition={};try{y()}finally{W.transition=R}},Se.unstable_act=H,Se.useCallback=function(y,R){return Ne.current.useCallback(y,R)},Se.useContext=function(y){return Ne.current.useContext(y)},Se.useDebugValue=function(){},Se.useDeferredValue=function(y){return Ne.current.useDeferredValue(y)},Se.useEffect=function(y,R){return Ne.current.useEffect(y,R)},Se.useId=function(){return Ne.current.useId()},Se.useImperativeHandle=function(y,R,se){return Ne.current.useImperativeHandle(y,R,se)},Se.useInsertionEffect=function(y,R){return Ne.current.useInsertionEffect(y,R)},Se.useLayoutEffect=function(y,R){return Ne.current.useLayoutEffect(y,R)},Se.useMemo=function(y,R){return Ne.current.useMemo(y,R)},Se.useReducer=function(y,R,se){return Ne.current.useReducer(y,R,se)},Se.useRef=function(y){return Ne.current.useRef(y)},Se.useState=function(y){return Ne.current.useState(y)},Se.useSyncExternalStore=function(y,R,se){return Ne.current.useSyncExternalStore(y,R,se)},Se.useTransition=function(){return Ne.current.useTransition()},Se.version="18.3.1",Se}var of;function Hu(){return of||(of=1,xu.exports=rh()),xu.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 sf;function oh(){if(sf)return Ri;sf=1;var u=Hu(),s=Symbol.for("react.element"),l=Symbol.for("react.fragment"),f=Object.prototype.hasOwnProperty,c=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,g={key:!0,ref:!0,__self:!0,__source:!0};function x(C,M,j){var B,z={},O=null,V=null;j!==void 0&&(O=""+j),M.key!==void 0&&(O=""+M.key),M.ref!==void 0&&(V=M.ref);for(B in M)f.call(M,B)&&!g.hasOwnProperty(B)&&(z[B]=M[B]);if(C&&C.defaultProps)for(B in M=C.defaultProps,M)z[B]===void 0&&(z[B]=M[B]);return{$$typeof:s,type:C,key:O,ref:V,props:z,_owner:c.current}}return Ri.Fragment=l,Ri.jsx=x,Ri.jsxs=x,Ri}var lf;function ih(){return lf||(lf=1,ku.exports=oh()),ku.exports}var h=ih(),Us={},Eu={exports:{}},Ft={},_u={exports:{}},Cu={};/**
|
|
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 uf;function sh(){return uf||(uf=1,(function(u){function s(W,le){var H=W.length;W.push(le);e:for(;0<H;){var y=H-1>>>1,R=W[y];if(0<c(R,le))W[y]=le,W[H]=R,H=y;else break e}}function l(W){return W.length===0?null:W[0]}function f(W){if(W.length===0)return null;var le=W[0],H=W.pop();if(H!==le){W[0]=H;e:for(var y=0,R=W.length,se=R>>>1;y<se;){var ue=2*(y+1)-1,pe=W[ue],we=ue+1,ve=W[we];if(0>c(pe,H))we<R&&0>c(ve,pe)?(W[y]=ve,W[we]=H,y=we):(W[y]=pe,W[ue]=H,y=ue);else if(we<R&&0>c(ve,H))W[y]=ve,W[we]=H,y=we;else break e}}return le}function c(W,le){var H=W.sortIndex-le.sortIndex;return H!==0?H:W.id-le.id}if(typeof performance=="object"&&typeof performance.now=="function"){var g=performance;u.unstable_now=function(){return g.now()}}else{var x=Date,C=x.now();u.unstable_now=function(){return x.now()-C}}var M=[],j=[],B=1,z=null,O=3,V=!1,Y=!1,ee=!1,N=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function ye(W){for(var le=l(j);le!==null;){if(le.callback===null)f(j);else if(le.startTime<=W)f(j),le.sortIndex=le.expirationTime,s(M,le);else break;le=l(j)}}function I(W){if(ee=!1,ye(W),!Y)if(l(M)!==null)Y=!0,Ve(q);else{var le=l(j);le!==null&&Ne(I,le.startTime-W)}}function q(W,le){Y=!1,ee&&(ee=!1,Q(me),me=-1),V=!0;var H=O;try{for(ye(le),z=l(M);z!==null&&(!(z.expirationTime>le)||W&&!_e());){var y=z.callback;if(typeof y=="function"){z.callback=null,O=z.priorityLevel;var R=y(z.expirationTime<=le);le=u.unstable_now(),typeof R=="function"?z.callback=R:z===l(M)&&f(M),ye(le)}else f(M);z=l(M)}if(z!==null)var se=!0;else{var ue=l(j);ue!==null&&Ne(I,ue.startTime-le),se=!1}return se}finally{z=null,O=H,V=!1}}var U=!1,re=null,me=-1,ke=5,K=-1;function _e(){return!(u.unstable_now()-K<ke)}function Ge(){if(re!==null){var W=u.unstable_now();K=W;var le=!0;try{le=re(!0,W)}finally{le?et():(U=!1,re=null)}}else U=!1}var et;if(typeof $=="function")et=function(){$(Ge)};else if(typeof MessageChannel<"u"){var qe=new MessageChannel,Ue=qe.port2;qe.port1.onmessage=Ge,et=function(){Ue.postMessage(null)}}else et=function(){N(Ge,0)};function Ve(W){re=W,U||(U=!0,et())}function Ne(W,le){me=N(function(){W(u.unstable_now())},le)}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(W){W.callback=null},u.unstable_continueExecution=function(){Y||V||(Y=!0,Ve(q))},u.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ke=0<W?Math.floor(1e3/W):5},u.unstable_getCurrentPriorityLevel=function(){return O},u.unstable_getFirstCallbackNode=function(){return l(M)},u.unstable_next=function(W){switch(O){case 1:case 2:case 3:var le=3;break;default:le=O}var H=O;O=le;try{return W()}finally{O=H}},u.unstable_pauseExecution=function(){},u.unstable_requestPaint=function(){},u.unstable_runWithPriority=function(W,le){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var H=O;O=W;try{return le()}finally{O=H}},u.unstable_scheduleCallback=function(W,le,H){var y=u.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?y+H:y):H=y,W){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=H+R,W={id:B++,callback:le,priorityLevel:W,startTime:H,expirationTime:R,sortIndex:-1},H>y?(W.sortIndex=H,s(j,W),l(M)===null&&W===l(j)&&(ee?(Q(me),me=-1):ee=!0,Ne(I,H-y))):(W.sortIndex=R,s(M,W),Y||V||(Y=!0,Ve(q))),W},u.unstable_shouldYield=_e,u.unstable_wrapCallback=function(W){var le=O;return function(){var H=O;O=le;try{return W.apply(this,arguments)}finally{O=H}}}})(Cu)),Cu}var af;function lh(){return af||(af=1,_u.exports=sh()),_u.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 cf;function uh(){if(cf)return Ft;cf=1;var u=Hu(),s=lh();function l(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 f=new Set,c={};function g(e,t){x(e,t),x(e+"Capture",t)}function x(e,t){for(c[e]=t,e=0;e<t.length;e++)f.add(t[e])}var C=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),M=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]*$/,B={},z={};function O(e){return M.call(z,e)?!0:M.call(B,e)?!1:j.test(e)?z[e]=!0:(B[e]=!0,!1)}function V(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 Y(e,t,n,r){if(t===null||typeof t>"u"||V(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 ee(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 ee(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 ee(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){N[e]=new ee(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){N[e]=new ee(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 ee(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){N[e]=new ee(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){N[e]=new ee(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){N[e]=new ee(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){N[e]=new ee(e,5,!1,e.toLowerCase(),null,!1,!1)});var Q=/[\-:]([a-z])/g;function $(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(Q,$);N[t]=new ee(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(Q,$);N[t]=new ee(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(Q,$);N[t]=new ee(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){N[e]=new ee(e,1,!1,e.toLowerCase(),null,!1,!1)}),N.xlinkHref=new ee("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){N[e]=new ee(e,1,!1,e.toLowerCase(),null,!0,!0)});function ye(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")&&(Y(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"),re=Symbol.for("react.fragment"),me=Symbol.for("react.strict_mode"),ke=Symbol.for("react.profiler"),K=Symbol.for("react.provider"),_e=Symbol.for("react.context"),Ge=Symbol.for("react.forward_ref"),et=Symbol.for("react.suspense"),qe=Symbol.for("react.suspense_list"),Ue=Symbol.for("react.memo"),Ve=Symbol.for("react.lazy"),Ne=Symbol.for("react.offscreen"),W=Symbol.iterator;function le(e){return e===null||typeof e!="object"?null:(e=W&&e[W]||e["@@iterator"],typeof e=="function"?e:null)}var H=Object.assign,y;function R(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 se=!1;function ue(e,t){if(!e||se)return"";se=!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,d=i.length-1;1<=a&&0<=d&&o[a]!==i[d];)d--;for(;1<=a&&0<=d;a--,d--)if(o[a]!==i[d]){if(a!==1||d!==1)do if(a--,d--,0>d||o[a]!==i[d]){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<=d);break}}}finally{se=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?R(e):""}function pe(e){switch(e.tag){case 5:return R(e.type);case 16:return R("Lazy");case 13:return R("Suspense");case 19:return R("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 we(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 re:return"Fragment";case U:return"Portal";case ke:return"Profiler";case me:return"StrictMode";case et:return"Suspense";case qe:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _e:return(e.displayName||"Context")+".Consumer";case K:return(e._context.displayName||"Context")+".Provider";case Ge:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ue:return t=e.displayName||null,t!==null?t:we(e.type)||"Memo";case Ve:t=e._payload,e=e._init;try{return we(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 we(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 xe(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Te(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function it(e){var t=Te(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 Gn(e){e._valueTracker||(e._valueTracker=it(e))}function Nr(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Te(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Lt(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 Ht(e,t){var n=t.checked;return H({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Yn(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=xe(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&&ye(e,"checked",t,!1)}function Pr(e,t){ut(e,t);var n=xe(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")?Jn(e,t.type,n):t.hasOwnProperty("defaultValue")&&Jn(e,t.type,xe(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 Jn(e,t,n){(t!=="number"||Lt(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var gn=Array.isArray;function At(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=""+xe(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 Fn(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(l(91));return H({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Xn(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(l(92));if(gn(n)){if(1<n.length)throw Error(l(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:xe(n)}}function Zn(e,t){var n=xe(t.value),r=xe(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 Ot(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function eo(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"?eo(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var er,to=(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(er=er||document.createElement("div"),er.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=er.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Tr(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},Qs=["Webkit","ms","Moz","O"];Object.keys(yn).forEach(function(e){Qs.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),yn[t]=yn[e]})});function gt(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 no(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=gt(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var Fi=H({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 Rr(e,t){if(t){if(Fi[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(l(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(l(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(l(61))}if(t.style!=null&&typeof t.style!="object")throw Error(l(62))}}function ro(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 Uo=null;function yt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vo=null,_t=null,Ln=null;function Li(e){if(e=pi(e)){if(typeof Vo!="function")throw Error(l(280));var t=e.stateNode;t&&(t=es(t),Vo(e.stateNode,e.type,t))}}function Bo(e){_t?Ln?Ln.push(e):Ln=[e]:_t=e}function $o(){if(_t){var e=_t,t=Ln;if(Ln=_t=null,Li(e),t)for(e=0;e<t.length;e++)Li(t[e])}}function An(e,t){return e(t)}function jr(){}var Wo=!1;function tr(e,t,n){if(Wo)return e(t,n);Wo=!0;try{return An(e,t,n)}finally{Wo=!1,(_t!==null||Ln!==null)&&(jr(),$o())}}function nr(e,t){var n=e.stateNode;if(n===null)return null;var r=es(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(l(231,t,typeof n));return n}var oo=!1;if(C)try{var On={};Object.defineProperty(On,"passive",{get:function(){oo=!0}}),window.addEventListener("test",On,On),window.removeEventListener("test",On,On)}catch{oo=!1}function Ai(e,t,n,r,o,i,a,d,m){var E=Array.prototype.slice.call(arguments,3);try{t.apply(n,E)}catch(L){this.onError(L)}}var rr=!1,Ct=null,Mr=!1,or=null,io={onError:function(e){rr=!0,Ct=e}};function Ho(e,t,n,r,o,i,a,d,m){rr=!1,Ct=null,Ai.apply(io,arguments)}function qs(e,t,n,r,o,i,a,d,m){if(Ho.apply(this,arguments),rr){if(rr){var E=Ct;rr=!1,Ct=null}else throw Error(l(198));Mr||(Mr=!0,or=E)}}function zn(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 ir(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 Fr(e){if(zn(e)!==e)throw Error(l(188))}function so(e){var t=e.alternate;if(!t){if(t=zn(e),t===null)throw Error(l(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 Fr(o),e;if(i===r)return Fr(o),t;i=i.sibling}throw Error(l(188))}if(n.return!==r.return)n=o,r=i;else{for(var a=!1,d=o.child;d;){if(d===n){a=!0,n=o,r=i;break}if(d===r){a=!0,r=o,n=i;break}d=d.sibling}if(!a){for(d=i.child;d;){if(d===n){a=!0,n=i,r=o;break}if(d===r){a=!0,r=i,n=o;break}d=d.sibling}if(!a)throw Error(l(189))}}if(n.alternate!==r)throw Error(l(190))}if(n.tag!==3)throw Error(l(188));return n.stateNode.current===n?e:t}function Ko(e){return e=so(e),e!==null?Qo(e):null}function Qo(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Qo(e);if(t!==null)return t;e=e.sibling}return null}var qo=s.unstable_scheduleCallback,rn=s.unstable_cancelCallback,Kt=s.unstable_shouldYield,on=s.unstable_requestPaint,Le=s.unstable_now,lo=s.unstable_getCurrentPriorityLevel,zt=s.unstable_ImmediatePriority,Dt=s.unstable_UserBlockingPriority,wt=s.unstable_NormalPriority,uo=s.unstable_LowPriority,tt=s.unstable_IdlePriority,Dn=null,It=null;function St(e){if(It&&typeof It.onCommitFiberRoot=="function")try{It.onCommitFiberRoot(Dn,e,void 0,(e.current.flags&128)===128)}catch{}}var kt=Math.clz32?Math.clz32:Qt,Oi=Math.log,bs=Math.LN2;function Qt(e){return e>>>=0,e===0?32:31-(Oi(e)/bs|0)|0}var qt=64,wn=4194304;function Lr(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 Sn(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 d=a&~o;d!==0?r=Lr(d):(i&=a,i!==0&&(r=Lr(i)))}else a=n&~o,a!==0?r=Lr(a):i!==0&&(r=Lr(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-kt(t),o=1<<n,r|=e[n],t&=~o;return r}function Gs(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 bo(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-kt(i),d=1<<a,m=o[a];m===-1?((d&n)===0||(d&r)!==0)&&(o[a]=Gs(d,t)):m<=t&&(e.expiredLanes|=d),i&=~d}}function Go(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function zi(){var e=qt;return qt<<=1,(qt&4194240)===0&&(qt=64),e}function ct(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function kn(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-kt(t),e[t]=n}function sr(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-kt(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function In(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-kt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var ge=0;function Di(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Yo,Jo,Ii,Un,ao,bt=!1,co=[],xn=null,Gt=null,En=null,Ar=new Map,Or=new Map,_n=[],Ys="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 Xo(e,t){switch(e){case"focusin":case"focusout":xn=null;break;case"dragenter":case"dragleave":Gt=null;break;case"mouseover":case"mouseout":En=null;break;case"pointerover":case"pointerout":Ar.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Or.delete(t.pointerId)}}function zr(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=pi(t),t!==null&&Jo(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Js(e,t,n,r,o){switch(t){case"focusin":return xn=zr(xn,e,t,n,r,o),!0;case"dragenter":return Gt=zr(Gt,e,t,n,r,o),!0;case"mouseover":return En=zr(En,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Ar.set(i,zr(Ar.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Or.set(i,zr(Or.get(i)||null,e,t,n,r,o)),!0}return!1}function Ui(e){var t=Vr(e.target);if(t!==null){var n=zn(t);if(n!==null){if(t=n.tag,t===13){if(t=ir(n),t!==null){e.blockedOn=t,ao(e.priority,function(){Ii(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 lr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=ei(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Uo=r,n.target.dispatchEvent(r),Uo=null}else return t=pi(n),t!==null&&Jo(t),e.blockedOn=n,!1;t.shift()}return!0}function sn(e,t,n){lr(e)&&n.delete(t)}function ln(){bt=!1,xn!==null&&lr(xn)&&(xn=null),Gt!==null&&lr(Gt)&&(Gt=null),En!==null&&lr(En)&&(En=null),Ar.forEach(sn),Or.forEach(sn)}function Cn(e,t){e.blockedOn===t&&(e.blockedOn=null,bt||(bt=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,ln)))}function ur(e){function t(o){return Cn(o,e)}if(0<co.length){Cn(co[0],e);for(var n=1;n<co.length;n++){var r=co[n];r.blockedOn===e&&(r.blockedOn=null)}}for(xn!==null&&Cn(xn,e),Gt!==null&&Cn(Gt,e),En!==null&&Cn(En,e),Ar.forEach(t),Or.forEach(t),n=0;n<_n.length;n++)r=_n[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<_n.length&&(n=_n[0],n.blockedOn===null);)Ui(n),n.blockedOn===null&&_n.shift()}var ar=I.ReactCurrentBatchConfig,Dr=!0;function Xs(e,t,n,r){var o=ge,i=ar.transition;ar.transition=null;try{ge=1,Zo(e,t,n,r)}finally{ge=o,ar.transition=i}}function Zs(e,t,n,r){var o=ge,i=ar.transition;ar.transition=null;try{ge=4,Zo(e,t,n,r)}finally{ge=o,ar.transition=i}}function Zo(e,t,n,r){if(Dr){var o=ei(e,t,n,r);if(o===null)fl(e,t,r,fo,n),Xo(e,r);else if(Js(o,e,t,n,r))r.stopPropagation();else if(Xo(e,r),t&4&&-1<Ys.indexOf(e)){for(;o!==null;){var i=pi(o);if(i!==null&&Yo(i),i=ei(e,t,n,r),i===null&&fl(e,t,r,fo,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else fl(e,t,r,null,n)}}var fo=null;function ei(e,t,n,r){if(fo=null,e=yt(r),e=Vr(e),e!==null)if(t=zn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=ir(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 fo=e,null}function Vi(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(lo()){case zt:return 1;case Dt:return 4;case wt:case uo:return 16;case tt:return 536870912;default:return 16}default:return 16}}var Yt=null,cr=null,Ir=null;function ti(){if(Ir)return Ir;var e,t=cr,n=t.length,r,o="value"in Yt?Yt.value:Yt.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 Ir=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 w(){return!0}function P(){return!1}function T(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 d in e)e.hasOwnProperty(d)&&(n=e[d],this[d]=n?n(i):i[d]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?w:P,this.isPropagationStopped=P,this}return H(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=w)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=w)},persist:function(){},isPersistent:w}),t}var G={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},J=T(G),b=H({},G,{view:0,detail:0}),fe=T(b),Oe,Ee,Ye,He=H({},b,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Je,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!==Ye&&(Ye&&e.type==="mousemove"?(Oe=e.screenX-Ye.screenX,Ee=e.screenY-Ye.screenY):Ee=Oe=0,Ye=e),Oe)},movementY:function(e){return"movementY"in e?e.movementY:Ee}}),Re=T(He),Ut=H({},He,{dataTransfer:0}),Vn=T(Ut),Ur=H({},b,{relatedTarget:0}),ft=T(Ur),Nt=H({},G,{animationName:0,elapsedTime:0,pseudoElement:0}),ni=T(Nt),Bi=H({},G,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),$i=T(Bi),el=H({},G,{data:0}),Wi=T(el),Nn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},tl={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"},ri={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ho(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ri[e])?!!t[e]:!1}function Je(){return ho}var Hi=H({},b,{key:function(e){if(e.key){var t=Nn[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"?tl[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Je,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}}),oi=T(Hi),po=H({},He,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ki=T(po),de=H({},b,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Je}),Me=T(de),Be=H({},G,{propertyName:0,elapsedTime:0,pseudoElement:0}),je=T(Be),dt=H({},He,{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}),Vt=T(dt),Pn=[9,13,27,32],mo=C&&"CompositionEvent"in window,fr=null;C&&"documentMode"in document&&(fr=document.documentMode);var Qi=C&&"TextEvent"in window&&!fr,ii=C&&(!mo||fr&&8<fr&&11>=fr),Yu=" ",Ju=!1;function Xu(e,t){switch(e){case"keyup":return Pn.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var vo=!1;function Xf(e,t){switch(e){case"compositionend":return Zu(t);case"keypress":return t.which!==32?null:(Ju=!0,Yu);case"textInput":return e=t.data,e===Yu&&Ju?null:e;default:return null}}function Zf(e,t){if(vo)return e==="compositionend"||!mo&&Xu(e,t)?(e=ti(),Ir=cr=Yt=null,vo=!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 ii&&t.locale!=="ko"?null:t.data;default:return null}}var ed={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 ea(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ed[e.type]:t==="textarea"}function ta(e,t,n,r){Bo(r),t=Ji(t,"onChange"),0<t.length&&(n=new J("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var si=null,li=null;function td(e){wa(e,0)}function qi(e){var t=ko(e);if(Nr(t))return e}function nd(e,t){if(e==="change")return t}var na=!1;if(C){var nl;if(C){var rl="oninput"in document;if(!rl){var ra=document.createElement("div");ra.setAttribute("oninput","return;"),rl=typeof ra.oninput=="function"}nl=rl}else nl=!1;na=nl&&(!document.documentMode||9<document.documentMode)}function oa(){si&&(si.detachEvent("onpropertychange",ia),li=si=null)}function ia(e){if(e.propertyName==="value"&&qi(li)){var t=[];ta(t,li,e,yt(e)),tr(td,t)}}function rd(e,t,n){e==="focusin"?(oa(),si=t,li=n,si.attachEvent("onpropertychange",ia)):e==="focusout"&&oa()}function od(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return qi(li)}function id(e,t){if(e==="click")return qi(t)}function sd(e,t){if(e==="input"||e==="change")return qi(t)}function ld(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var un=typeof Object.is=="function"?Object.is:ld;function ui(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(!M.call(t,o)||!un(e[o],t[o]))return!1}return!0}function sa(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function la(e,t){var n=sa(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=sa(n)}}function ua(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ua(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function aa(){for(var e=window,t=Lt();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Lt(e.document)}return t}function ol(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 ud(e){var t=aa(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ua(n.ownerDocument.documentElement,n)){if(r!==null&&ol(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=la(n,i);var a=la(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 ad=C&&"documentMode"in document&&11>=document.documentMode,go=null,il=null,ai=null,sl=!1;function ca(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;sl||go==null||go!==Lt(r)||(r=go,"selectionStart"in r&&ol(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}),ai&&ui(ai,r)||(ai=r,r=Ji(il,"onSelect"),0<r.length&&(t=new J("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=go)))}function bi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var yo={animationend:bi("Animation","AnimationEnd"),animationiteration:bi("Animation","AnimationIteration"),animationstart:bi("Animation","AnimationStart"),transitionend:bi("Transition","TransitionEnd")},ll={},fa={};C&&(fa=document.createElement("div").style,"AnimationEvent"in window||(delete yo.animationend.animation,delete yo.animationiteration.animation,delete yo.animationstart.animation),"TransitionEvent"in window||delete yo.transitionend.transition);function Gi(e){if(ll[e])return ll[e];if(!yo[e])return e;var t=yo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in fa)return ll[e]=t[n];return e}var da=Gi("animationend"),ha=Gi("animationiteration"),pa=Gi("animationstart"),ma=Gi("transitionend"),va=new Map,ga="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 dr(e,t){va.set(e,t),g(t,[e])}for(var ul=0;ul<ga.length;ul++){var al=ga[ul],cd=al.toLowerCase(),fd=al[0].toUpperCase()+al.slice(1);dr(cd,"on"+fd)}dr(da,"onAnimationEnd"),dr(ha,"onAnimationIteration"),dr(pa,"onAnimationStart"),dr("dblclick","onDoubleClick"),dr("focusin","onFocus"),dr("focusout","onBlur"),dr(ma,"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 ci="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(" "),dd=new Set("cancel close invalid load scroll toggle".split(" ").concat(ci));function ya(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,qs(r,t,void 0,e),e.currentTarget=null}function wa(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 d=r[a],m=d.instance,E=d.currentTarget;if(d=d.listener,m!==i&&o.isPropagationStopped())break e;ya(o,d,E),i=m}else for(a=0;a<r.length;a++){if(d=r[a],m=d.instance,E=d.currentTarget,d=d.listener,m!==i&&o.isPropagationStopped())break e;ya(o,d,E),i=m}}}if(Mr)throw e=or,Mr=!1,or=null,e}function ze(e,t){var n=t[gl];n===void 0&&(n=t[gl]=new Set);var r=e+"__bubble";n.has(r)||(Sa(t,e,2,!1),n.add(r))}function cl(e,t,n){var r=0;t&&(r|=4),Sa(n,e,r,t)}var Yi="_reactListening"+Math.random().toString(36).slice(2);function fi(e){if(!e[Yi]){e[Yi]=!0,f.forEach(function(n){n!=="selectionchange"&&(dd.has(n)||cl(n,!1,e),cl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Yi]||(t[Yi]=!0,cl("selectionchange",!1,t))}}function Sa(e,t,n,r){switch(Vi(t)){case 1:var o=Xs;break;case 4:o=Zs;break;default:o=Zo}n=o.bind(null,t,n,e),o=void 0,!oo||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 fl(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 d=r.stateNode.containerInfo;if(d===o||d.nodeType===8&&d.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(;d!==null;){if(a=Vr(d),a===null)return;if(m=a.tag,m===5||m===6){r=i=a;continue e}d=d.parentNode}}r=r.return}tr(function(){var E=i,L=yt(n),A=[];e:{var F=va.get(e);if(F!==void 0){var X=J,te=e;switch(e){case"keypress":if(p(n)===0)break e;case"keydown":case"keyup":X=oi;break;case"focusin":te="focus",X=ft;break;case"focusout":te="blur",X=ft;break;case"beforeblur":case"afterblur":X=ft;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":X=Re;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":X=Vn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":X=Me;break;case da:case ha:case pa:X=ni;break;case ma:X=je;break;case"scroll":X=fe;break;case"wheel":X=Vt;break;case"copy":case"cut":case"paste":X=$i;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":X=Ki}var oe=(t&4)!==0,Qe=!oe&&e==="scroll",S=oe?F!==null?F+"Capture":null:F;oe=[];for(var v=E,k;v!==null;){k=v;var D=k.stateNode;if(k.tag===5&&D!==null&&(k=D,S!==null&&(D=nr(v,S),D!=null&&oe.push(di(v,D,k)))),Qe)break;v=v.return}0<oe.length&&(F=new X(F,te,null,n,L),A.push({event:F,listeners:oe}))}}if((t&7)===0){e:{if(F=e==="mouseover"||e==="pointerover",X=e==="mouseout"||e==="pointerout",F&&n!==Uo&&(te=n.relatedTarget||n.fromElement)&&(Vr(te)||te[Bn]))break e;if((X||F)&&(F=L.window===L?L:(F=L.ownerDocument)?F.defaultView||F.parentWindow:window,X?(te=n.relatedTarget||n.toElement,X=E,te=te?Vr(te):null,te!==null&&(Qe=zn(te),te!==Qe||te.tag!==5&&te.tag!==6)&&(te=null)):(X=null,te=E),X!==te)){if(oe=Re,D="onMouseLeave",S="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(oe=Ki,D="onPointerLeave",S="onPointerEnter",v="pointer"),Qe=X==null?F:ko(X),k=te==null?F:ko(te),F=new oe(D,v+"leave",X,n,L),F.target=Qe,F.relatedTarget=k,D=null,Vr(L)===E&&(oe=new oe(S,v+"enter",te,n,L),oe.target=k,oe.relatedTarget=Qe,D=oe),Qe=D,X&&te)t:{for(oe=X,S=te,v=0,k=oe;k;k=wo(k))v++;for(k=0,D=S;D;D=wo(D))k++;for(;0<v-k;)oe=wo(oe),v--;for(;0<k-v;)S=wo(S),k--;for(;v--;){if(oe===S||S!==null&&oe===S.alternate)break t;oe=wo(oe),S=wo(S)}oe=null}else oe=null;X!==null&&ka(A,F,X,oe,!1),te!==null&&Qe!==null&&ka(A,Qe,te,oe,!0)}}e:{if(F=E?ko(E):window,X=F.nodeName&&F.nodeName.toLowerCase(),X==="select"||X==="input"&&F.type==="file")var ie=nd;else if(ea(F))if(na)ie=sd;else{ie=od;var ae=rd}else(X=F.nodeName)&&X.toLowerCase()==="input"&&(F.type==="checkbox"||F.type==="radio")&&(ie=id);if(ie&&(ie=ie(e,E))){ta(A,ie,n,L);break e}ae&&ae(e,F,E),e==="focusout"&&(ae=F._wrapperState)&&ae.controlled&&F.type==="number"&&Jn(F,"number",F.value)}switch(ae=E?ko(E):window,e){case"focusin":(ea(ae)||ae.contentEditable==="true")&&(go=ae,il=E,ai=null);break;case"focusout":ai=il=go=null;break;case"mousedown":sl=!0;break;case"contextmenu":case"mouseup":case"dragend":sl=!1,ca(A,n,L);break;case"selectionchange":if(ad)break;case"keydown":case"keyup":ca(A,n,L)}var ce;if(mo)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 vo?Xu(e,n)&&(he="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(he="onCompositionStart");he&&(ii&&n.locale!=="ko"&&(vo||he!=="onCompositionStart"?he==="onCompositionEnd"&&vo&&(ce=ti()):(Yt=L,cr="value"in Yt?Yt.value:Yt.textContent,vo=!0)),ae=Ji(E,he),0<ae.length&&(he=new Wi(he,e,null,n,L),A.push({event:he,listeners:ae}),ce?he.data=ce:(ce=Zu(n),ce!==null&&(he.data=ce)))),(ce=Qi?Xf(e,n):Zf(e,n))&&(E=Ji(E,"onBeforeInput"),0<E.length&&(L=new Wi("onBeforeInput","beforeinput",null,n,L),A.push({event:L,listeners:E}),L.data=ce))}wa(A,t)})}function di(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ji(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=nr(e,n),i!=null&&r.unshift(di(e,i,o)),i=nr(e,t),i!=null&&r.push(di(e,i,o))),e=e.return}return r}function wo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ka(e,t,n,r,o){for(var i=t._reactName,a=[];n!==null&&n!==r;){var d=n,m=d.alternate,E=d.stateNode;if(m!==null&&m===r)break;d.tag===5&&E!==null&&(d=E,o?(m=nr(n,i),m!=null&&a.unshift(di(n,m,d))):o||(m=nr(n,i),m!=null&&a.push(di(n,m,d)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var hd=/\r\n?/g,pd=/\u0000|\uFFFD/g;function xa(e){return(typeof e=="string"?e:""+e).replace(hd,`
|
|
39
|
+
`).replace(pd,"")}function Xi(e,t,n){if(t=xa(t),xa(e)!==t&&n)throw Error(l(425))}function Zi(){}var dl=null,hl=null;function pl(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 ml=typeof setTimeout=="function"?setTimeout:void 0,md=typeof clearTimeout=="function"?clearTimeout:void 0,Ea=typeof Promise=="function"?Promise:void 0,vd=typeof queueMicrotask=="function"?queueMicrotask:typeof Ea<"u"?function(e){return Ea.resolve(null).then(e).catch(gd)}:ml;function gd(e){setTimeout(function(){throw e})}function vl(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),ur(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);ur(t)}function hr(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 _a(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 So=Math.random().toString(36).slice(2),Tn="__reactFiber$"+So,hi="__reactProps$"+So,Bn="__reactContainer$"+So,gl="__reactEvents$"+So,yd="__reactListeners$"+So,wd="__reactHandles$"+So;function Vr(e){var t=e[Tn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Bn]||n[Tn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=_a(e);e!==null;){if(n=e[Tn])return n;e=_a(e)}return t}e=n,n=e.parentNode}return null}function pi(e){return e=e[Tn]||e[Bn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ko(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(l(33))}function es(e){return e[hi]||null}var yl=[],xo=-1;function pr(e){return{current:e}}function De(e){0>xo||(e.current=yl[xo],yl[xo]=null,xo--)}function Ae(e,t){xo++,yl[xo]=e.current,e.current=t}var mr={},ht=pr(mr),Pt=pr(!1),Br=mr;function Eo(e,t){var n=e.type.contextTypes;if(!n)return mr;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 Tt(e){return e=e.childContextTypes,e!=null}function ts(){De(Pt),De(ht)}function Ca(e,t,n){if(ht.current!==mr)throw Error(l(168));Ae(ht,t),Ae(Pt,n)}function Na(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(l(108,ve(e)||"Unknown",o));return H({},n,r)}function ns(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||mr,Br=ht.current,Ae(ht,e),Ae(Pt,Pt.current),!0}function Pa(e,t,n){var r=e.stateNode;if(!r)throw Error(l(169));n?(e=Na(e,t,Br),r.__reactInternalMemoizedMergedChildContext=e,De(Pt),De(ht),Ae(ht,e)):De(Pt),Ae(Pt,n)}var $n=null,rs=!1,wl=!1;function Ta(e){$n===null?$n=[e]:$n.push(e)}function Sd(e){rs=!0,Ta(e)}function vr(){if(!wl&&$n!==null){wl=!0;var e=0,t=ge;try{var n=$n;for(ge=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}$n=null,rs=!1}catch(o){throw $n!==null&&($n=$n.slice(e+1)),qo(zt,vr),o}finally{ge=t,wl=!1}}return null}var _o=[],Co=0,os=null,is=0,Jt=[],Xt=0,$r=null,Wn=1,Hn="";function Wr(e,t){_o[Co++]=is,_o[Co++]=os,os=e,is=t}function Ra(e,t,n){Jt[Xt++]=Wn,Jt[Xt++]=Hn,Jt[Xt++]=$r,$r=e;var r=Wn;e=Hn;var o=32-kt(r)-1;r&=~(1<<o),n+=1;var i=32-kt(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,Wn=1<<32-kt(t)+o|n<<o|r,Hn=i+e}else Wn=1<<i|n<<o|r,Hn=e}function Sl(e){e.return!==null&&(Wr(e,1),Ra(e,1,0))}function kl(e){for(;e===os;)os=_o[--Co],_o[Co]=null,is=_o[--Co],_o[Co]=null;for(;e===$r;)$r=Jt[--Xt],Jt[Xt]=null,Hn=Jt[--Xt],Jt[Xt]=null,Wn=Jt[--Xt],Jt[Xt]=null}var Bt=null,$t=null,Ie=!1,an=null;function ja(e,t){var n=nn(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 Ma(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,$t=hr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Bt=e,$t=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=$r!==null?{id:Wn,overflow:Hn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=nn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Bt=e,$t=null,!0):!1;default:return!1}}function xl(e){return(e.mode&1)!==0&&(e.flags&128)===0}function El(e){if(Ie){var t=$t;if(t){var n=t;if(!Ma(e,t)){if(xl(e))throw Error(l(418));t=hr(n.nextSibling);var r=Bt;t&&Ma(e,t)?ja(r,n):(e.flags=e.flags&-4097|2,Ie=!1,Bt=e)}}else{if(xl(e))throw Error(l(418));e.flags=e.flags&-4097|2,Ie=!1,Bt=e}}}function Fa(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Bt=e}function ss(e){if(e!==Bt)return!1;if(!Ie)return Fa(e),Ie=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!pl(e.type,e.memoizedProps)),t&&(t=$t)){if(xl(e))throw La(),Error(l(418));for(;t;)ja(e,t),t=hr(t.nextSibling)}if(Fa(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){$t=hr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}$t=null}}else $t=Bt?hr(e.stateNode.nextSibling):null;return!0}function La(){for(var e=$t;e;)e=hr(e.nextSibling)}function No(){$t=Bt=null,Ie=!1}function _l(e){an===null?an=[e]:an.push(e)}var kd=I.ReactCurrentBatchConfig;function mi(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(l(309));var r=n.stateNode}if(!r)throw Error(l(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 d=o.refs;a===null?delete d[i]:d[i]=a},t._stringRef=i,t)}if(typeof e!="string")throw Error(l(284));if(!n._owner)throw Error(l(290,e))}return e}function ls(e,t){throw e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Aa(e){var t=e._init;return t(e._payload)}function Oa(e){function t(S,v){if(e){var k=S.deletions;k===null?(S.deletions=[v],S.flags|=16):k.push(v)}}function n(S,v){if(!e)return null;for(;v!==null;)t(S,v),v=v.sibling;return null}function r(S,v){for(S=new Map;v!==null;)v.key!==null?S.set(v.key,v):S.set(v.index,v),v=v.sibling;return S}function o(S,v){return S=_r(S,v),S.index=0,S.sibling=null,S}function i(S,v,k){return S.index=k,e?(k=S.alternate,k!==null?(k=k.index,k<v?(S.flags|=2,v):k):(S.flags|=2,v)):(S.flags|=1048576,v)}function a(S){return e&&S.alternate===null&&(S.flags|=2),S}function d(S,v,k,D){return v===null||v.tag!==6?(v=mu(k,S.mode,D),v.return=S,v):(v=o(v,k),v.return=S,v)}function m(S,v,k,D){var ie=k.type;return ie===re?L(S,v,k.props.children,D,k.key):v!==null&&(v.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===Ve&&Aa(ie)===v.type)?(D=o(v,k.props),D.ref=mi(S,v,k),D.return=S,D):(D=Ms(k.type,k.key,k.props,null,S.mode,D),D.ref=mi(S,v,k),D.return=S,D)}function E(S,v,k,D){return v===null||v.tag!==4||v.stateNode.containerInfo!==k.containerInfo||v.stateNode.implementation!==k.implementation?(v=vu(k,S.mode,D),v.return=S,v):(v=o(v,k.children||[]),v.return=S,v)}function L(S,v,k,D,ie){return v===null||v.tag!==7?(v=Jr(k,S.mode,D,ie),v.return=S,v):(v=o(v,k),v.return=S,v)}function A(S,v,k){if(typeof v=="string"&&v!==""||typeof v=="number")return v=mu(""+v,S.mode,k),v.return=S,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case q:return k=Ms(v.type,v.key,v.props,null,S.mode,k),k.ref=mi(S,null,v),k.return=S,k;case U:return v=vu(v,S.mode,k),v.return=S,v;case Ve:var D=v._init;return A(S,D(v._payload),k)}if(gn(v)||le(v))return v=Jr(v,S.mode,k,null),v.return=S,v;ls(S,v)}return null}function F(S,v,k,D){var ie=v!==null?v.key:null;if(typeof k=="string"&&k!==""||typeof k=="number")return ie!==null?null:d(S,v,""+k,D);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case q:return k.key===ie?m(S,v,k,D):null;case U:return k.key===ie?E(S,v,k,D):null;case Ve:return ie=k._init,F(S,v,ie(k._payload),D)}if(gn(k)||le(k))return ie!==null?null:L(S,v,k,D,null);ls(S,k)}return null}function X(S,v,k,D,ie){if(typeof D=="string"&&D!==""||typeof D=="number")return S=S.get(k)||null,d(v,S,""+D,ie);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case q:return S=S.get(D.key===null?k:D.key)||null,m(v,S,D,ie);case U:return S=S.get(D.key===null?k:D.key)||null,E(v,S,D,ie);case Ve:var ae=D._init;return X(S,v,k,ae(D._payload),ie)}if(gn(D)||le(D))return S=S.get(k)||null,L(v,S,D,ie,null);ls(v,D)}return null}function te(S,v,k,D){for(var ie=null,ae=null,ce=v,he=v=0,ot=null;ce!==null&&he<k.length;he++){ce.index>he?(ot=ce,ce=null):ot=ce.sibling;var Pe=F(S,ce,k[he],D);if(Pe===null){ce===null&&(ce=ot);break}e&&ce&&Pe.alternate===null&&t(S,ce),v=i(Pe,v,he),ae===null?ie=Pe:ae.sibling=Pe,ae=Pe,ce=ot}if(he===k.length)return n(S,ce),Ie&&Wr(S,he),ie;if(ce===null){for(;he<k.length;he++)ce=A(S,k[he],D),ce!==null&&(v=i(ce,v,he),ae===null?ie=ce:ae.sibling=ce,ae=ce);return Ie&&Wr(S,he),ie}for(ce=r(S,ce);he<k.length;he++)ot=X(ce,S,he,k[he],D),ot!==null&&(e&&ot.alternate!==null&&ce.delete(ot.key===null?he:ot.key),v=i(ot,v,he),ae===null?ie=ot:ae.sibling=ot,ae=ot);return e&&ce.forEach(function(Cr){return t(S,Cr)}),Ie&&Wr(S,he),ie}function oe(S,v,k,D){var ie=le(k);if(typeof ie!="function")throw Error(l(150));if(k=ie.call(k),k==null)throw Error(l(151));for(var ae=ie=null,ce=v,he=v=0,ot=null,Pe=k.next();ce!==null&&!Pe.done;he++,Pe=k.next()){ce.index>he?(ot=ce,ce=null):ot=ce.sibling;var Cr=F(S,ce,Pe.value,D);if(Cr===null){ce===null&&(ce=ot);break}e&&ce&&Cr.alternate===null&&t(S,ce),v=i(Cr,v,he),ae===null?ie=Cr:ae.sibling=Cr,ae=Cr,ce=ot}if(Pe.done)return n(S,ce),Ie&&Wr(S,he),ie;if(ce===null){for(;!Pe.done;he++,Pe=k.next())Pe=A(S,Pe.value,D),Pe!==null&&(v=i(Pe,v,he),ae===null?ie=Pe:ae.sibling=Pe,ae=Pe);return Ie&&Wr(S,he),ie}for(ce=r(S,ce);!Pe.done;he++,Pe=k.next())Pe=X(ce,S,he,Pe.value,D),Pe!==null&&(e&&Pe.alternate!==null&&ce.delete(Pe.key===null?he:Pe.key),v=i(Pe,v,he),ae===null?ie=Pe:ae.sibling=Pe,ae=Pe);return e&&ce.forEach(function(eh){return t(S,eh)}),Ie&&Wr(S,he),ie}function Qe(S,v,k,D){if(typeof k=="object"&&k!==null&&k.type===re&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case q:e:{for(var ie=k.key,ae=v;ae!==null;){if(ae.key===ie){if(ie=k.type,ie===re){if(ae.tag===7){n(S,ae.sibling),v=o(ae,k.props.children),v.return=S,S=v;break e}}else if(ae.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===Ve&&Aa(ie)===ae.type){n(S,ae.sibling),v=o(ae,k.props),v.ref=mi(S,ae,k),v.return=S,S=v;break e}n(S,ae);break}else t(S,ae);ae=ae.sibling}k.type===re?(v=Jr(k.props.children,S.mode,D,k.key),v.return=S,S=v):(D=Ms(k.type,k.key,k.props,null,S.mode,D),D.ref=mi(S,v,k),D.return=S,S=D)}return a(S);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(S,v.sibling),v=o(v,k.children||[]),v.return=S,S=v;break e}else{n(S,v);break}else t(S,v);v=v.sibling}v=vu(k,S.mode,D),v.return=S,S=v}return a(S);case Ve:return ae=k._init,Qe(S,v,ae(k._payload),D)}if(gn(k))return te(S,v,k,D);if(le(k))return oe(S,v,k,D);ls(S,k)}return typeof k=="string"&&k!==""||typeof k=="number"?(k=""+k,v!==null&&v.tag===6?(n(S,v.sibling),v=o(v,k),v.return=S,S=v):(n(S,v),v=mu(k,S.mode,D),v.return=S,S=v),a(S)):n(S,v)}return Qe}var Po=Oa(!0),za=Oa(!1),us=pr(null),as=null,To=null,Cl=null;function Nl(){Cl=To=as=null}function Pl(e){var t=us.current;De(us),e._currentValue=t}function Tl(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 Ro(e,t){as=e,Cl=To=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Rt=!0),e.firstContext=null)}function Zt(e){var t=e._currentValue;if(Cl!==e)if(e={context:e,memoizedValue:t,next:null},To===null){if(as===null)throw Error(l(308));To=e,as.dependencies={lanes:0,firstContext:e}}else To=To.next=e;return t}var Hr=null;function Rl(e){Hr===null?Hr=[e]:Hr.push(e)}function Da(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Rl(t)):(n.next=o.next,o.next=n),t.interleaved=n,Kn(e,r)}function Kn(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 gr=!1;function jl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ia(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 Qn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function yr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Ce&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Kn(e,n)}return o=r.interleaved,o===null?(t.next=t,Rl(r)):(t.next=o.next,o.next=t),r.interleaved=t,Kn(e,n)}function cs(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,In(e,n)}}function Ua(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 fs(e,t,n,r){var o=e.updateQueue;gr=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,d=o.shared.pending;if(d!==null){o.shared.pending=null;var m=d,E=m.next;m.next=null,a===null?i=E:a.next=E,a=m;var L=e.alternate;L!==null&&(L=L.updateQueue,d=L.lastBaseUpdate,d!==a&&(d===null?L.firstBaseUpdate=E:d.next=E,L.lastBaseUpdate=m))}if(i!==null){var A=o.baseState;a=0,L=E=m=null,d=i;do{var F=d.lane,X=d.eventTime;if((r&F)===F){L!==null&&(L=L.next={eventTime:X,lane:0,tag:d.tag,payload:d.payload,callback:d.callback,next:null});e:{var te=e,oe=d;switch(F=t,X=n,oe.tag){case 1:if(te=oe.payload,typeof te=="function"){A=te.call(X,A,F);break e}A=te;break e;case 3:te.flags=te.flags&-65537|128;case 0:if(te=oe.payload,F=typeof te=="function"?te.call(X,A,F):te,F==null)break e;A=H({},A,F);break e;case 2:gr=!0}}d.callback!==null&&d.lane!==0&&(e.flags|=64,F=o.effects,F===null?o.effects=[d]:F.push(d))}else X={eventTime:X,lane:F,tag:d.tag,payload:d.payload,callback:d.callback,next:null},L===null?(E=L=X,m=A):L=L.next=X,a|=F;if(d=d.next,d===null){if(d=o.shared.pending,d===null)break;F=d,d=F.next,F.next=null,o.lastBaseUpdate=F,o.shared.pending=null}}while(!0);if(L===null&&(m=A),o.baseState=m,o.firstBaseUpdate=E,o.lastBaseUpdate=L,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);qr|=a,e.lanes=a,e.memoizedState=A}}function Va(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(l(191,o));o.call(r)}}}var vi={},Rn=pr(vi),gi=pr(vi),yi=pr(vi);function Kr(e){if(e===vi)throw Error(l(174));return e}function Ml(e,t){switch(Ae(yi,t),Ae(gi,e),Ae(Rn,vi),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)}De(Rn),Ae(Rn,t)}function jo(){De(Rn),De(gi),De(yi)}function Ba(e){Kr(yi.current);var t=Kr(Rn.current),n=at(t,e.type);t!==n&&(Ae(gi,e),Ae(Rn,n))}function Fl(e){gi.current===e&&(De(Rn),De(gi))}var $e=pr(0);function ds(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 Ll=[];function Al(){for(var e=0;e<Ll.length;e++)Ll[e]._workInProgressVersionPrimary=null;Ll.length=0}var hs=I.ReactCurrentDispatcher,Ol=I.ReactCurrentBatchConfig,Qr=0,We=null,Xe=null,nt=null,ps=!1,wi=!1,Si=0,xd=0;function pt(){throw Error(l(321))}function zl(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 Dl(e,t,n,r,o,i){if(Qr=i,We=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,hs.current=e===null||e.memoizedState===null?Nd:Pd,e=n(r,o),wi){i=0;do{if(wi=!1,Si=0,25<=i)throw Error(l(301));i+=1,nt=Xe=null,t.updateQueue=null,hs.current=Td,e=n(r,o)}while(wi)}if(hs.current=gs,t=Xe!==null&&Xe.next!==null,Qr=0,nt=Xe=We=null,ps=!1,t)throw Error(l(300));return e}function Il(){var e=Si!==0;return Si=0,e}function jn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nt===null?We.memoizedState=nt=e:nt=nt.next=e,nt}function en(){if(Xe===null){var e=We.alternate;e=e!==null?e.memoizedState:null}else e=Xe.next;var t=nt===null?We.memoizedState:nt.next;if(t!==null)nt=t,Xe=e;else{if(e===null)throw Error(l(310));Xe=e,e={memoizedState:Xe.memoizedState,baseState:Xe.baseState,baseQueue:Xe.baseQueue,queue:Xe.queue,next:null},nt===null?We.memoizedState=nt=e:nt=nt.next=e}return nt}function ki(e,t){return typeof t=="function"?t(e):t}function Ul(e){var t=en(),n=t.queue;if(n===null)throw Error(l(311));n.lastRenderedReducer=e;var r=Xe,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 d=a=null,m=null,E=i;do{var L=E.lane;if((Qr&L)===L)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:L,action:E.action,hasEagerState:E.hasEagerState,eagerState:E.eagerState,next:null};m===null?(d=m=A,a=r):m=m.next=A,We.lanes|=L,qr|=L}E=E.next}while(E!==null&&E!==i);m===null?a=r:m.next=d,un(r,t.memoizedState)||(Rt=!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,qr|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Vl(e){var t=en(),n=t.queue;if(n===null)throw Error(l(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)||(Rt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function $a(){}function Wa(e,t){var n=We,r=en(),o=t(),i=!un(r.memoizedState,o);if(i&&(r.memoizedState=o,Rt=!0),r=r.queue,Bl(Qa.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||nt!==null&&nt.memoizedState.tag&1){if(n.flags|=2048,xi(9,Ka.bind(null,n,r,o,t),void 0,null),rt===null)throw Error(l(349));(Qr&30)!==0||Ha(n,t,o)}return o}function Ha(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 Ka(e,t,n,r){t.value=n,t.getSnapshot=r,qa(t)&&ba(e)}function Qa(e,t,n){return n(function(){qa(t)&&ba(e)})}function qa(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!un(e,n)}catch{return!0}}function ba(e){var t=Kn(e,1);t!==null&&hn(t,e,1,-1)}function Ga(e){var t=jn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ki,lastRenderedState:e},t.queue=e,e=e.dispatch=Cd.bind(null,We,e),[t.memoizedState,e]}function xi(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 Ya(){return en().memoizedState}function ms(e,t,n,r){var o=jn();We.flags|=e,o.memoizedState=xi(1|t,n,void 0,r===void 0?null:r)}function vs(e,t,n,r){var o=en();r=r===void 0?null:r;var i=void 0;if(Xe!==null){var a=Xe.memoizedState;if(i=a.destroy,r!==null&&zl(r,a.deps)){o.memoizedState=xi(t,n,i,r);return}}We.flags|=e,o.memoizedState=xi(1|t,n,i,r)}function Ja(e,t){return ms(8390656,8,e,t)}function Bl(e,t){return vs(2048,8,e,t)}function Xa(e,t){return vs(4,2,e,t)}function Za(e,t){return vs(4,4,e,t)}function ec(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 tc(e,t,n){return n=n!=null?n.concat([e]):null,vs(4,4,ec.bind(null,t,e),n)}function $l(){}function nc(e,t){var n=en();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&zl(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function rc(e,t){var n=en();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&zl(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function oc(e,t,n){return(Qr&21)===0?(e.baseState&&(e.baseState=!1,Rt=!0),e.memoizedState=n):(un(n,t)||(n=zi(),We.lanes|=n,qr|=n,e.baseState=!0),t)}function Ed(e,t){var n=ge;ge=n!==0&&4>n?n:4,e(!0);var r=Ol.transition;Ol.transition={};try{e(!1),t()}finally{ge=n,Ol.transition=r}}function ic(){return en().memoizedState}function _d(e,t,n){var r=xr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},sc(e))lc(t,n);else if(n=Da(e,t,n,r),n!==null){var o=Et();hn(n,e,r,o),uc(n,t,r)}}function Cd(e,t,n){var r=xr(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(sc(e))lc(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,d=i(a,n);if(o.hasEagerState=!0,o.eagerState=d,un(d,a)){var m=t.interleaved;m===null?(o.next=o,Rl(t)):(o.next=m.next,m.next=o),t.interleaved=o;return}}catch{}finally{}n=Da(e,t,o,r),n!==null&&(o=Et(),hn(n,e,r,o),uc(n,t,r))}}function sc(e){var t=e.alternate;return e===We||t!==null&&t===We}function lc(e,t){wi=ps=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function uc(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,In(e,n)}}var gs={readContext:Zt,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useInsertionEffect:pt,useLayoutEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useMutableSource:pt,useSyncExternalStore:pt,useId:pt,unstable_isNewReconciler:!1},Nd={readContext:Zt,useCallback:function(e,t){return jn().memoizedState=[e,t===void 0?null:t],e},useContext:Zt,useEffect:Ja,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ms(4194308,4,ec.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ms(4194308,4,e,t)},useInsertionEffect:function(e,t){return ms(4,2,e,t)},useMemo:function(e,t){var n=jn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=jn();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=_d.bind(null,We,e),[r.memoizedState,e]},useRef:function(e){var t=jn();return e={current:e},t.memoizedState=e},useState:Ga,useDebugValue:$l,useDeferredValue:function(e){return jn().memoizedState=e},useTransition:function(){var e=Ga(!1),t=e[0];return e=Ed.bind(null,e[1]),jn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=We,o=jn();if(Ie){if(n===void 0)throw Error(l(407));n=n()}else{if(n=t(),rt===null)throw Error(l(349));(Qr&30)!==0||Ha(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Ja(Qa.bind(null,r,i,e),[e]),r.flags|=2048,xi(9,Ka.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=jn(),t=rt.identifierPrefix;if(Ie){var n=Hn,r=Wn;n=(r&~(1<<32-kt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Si++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=xd++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Pd={readContext:Zt,useCallback:nc,useContext:Zt,useEffect:Bl,useImperativeHandle:tc,useInsertionEffect:Xa,useLayoutEffect:Za,useMemo:rc,useReducer:Ul,useRef:Ya,useState:function(){return Ul(ki)},useDebugValue:$l,useDeferredValue:function(e){var t=en();return oc(t,Xe.memoizedState,e)},useTransition:function(){var e=Ul(ki)[0],t=en().memoizedState;return[e,t]},useMutableSource:$a,useSyncExternalStore:Wa,useId:ic,unstable_isNewReconciler:!1},Td={readContext:Zt,useCallback:nc,useContext:Zt,useEffect:Bl,useImperativeHandle:tc,useInsertionEffect:Xa,useLayoutEffect:Za,useMemo:rc,useReducer:Vl,useRef:Ya,useState:function(){return Vl(ki)},useDebugValue:$l,useDeferredValue:function(e){var t=en();return Xe===null?t.memoizedState=e:oc(t,Xe.memoizedState,e)},useTransition:function(){var e=Vl(ki)[0],t=en().memoizedState;return[e,t]},useMutableSource:$a,useSyncExternalStore:Wa,useId:ic,unstable_isNewReconciler:!1};function cn(e,t){if(e&&e.defaultProps){t=H({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Wl(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:H({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ys={isMounted:function(e){return(e=e._reactInternals)?zn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Et(),o=xr(e),i=Qn(r,o);i.payload=t,n!=null&&(i.callback=n),t=yr(e,i,o),t!==null&&(hn(t,e,o,r),cs(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Et(),o=xr(e),i=Qn(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=yr(e,i,o),t!==null&&(hn(t,e,o,r),cs(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Et(),r=xr(e),o=Qn(n,r);o.tag=2,t!=null&&(o.callback=t),t=yr(e,o,r),t!==null&&(hn(t,e,r,n),cs(t,e,r))}};function ac(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?!ui(n,r)||!ui(o,i):!0}function cc(e,t,n){var r=!1,o=mr,i=t.contextType;return typeof i=="object"&&i!==null?i=Zt(i):(o=Tt(t)?Br:ht.current,r=t.contextTypes,i=(r=r!=null)?Eo(e,o):mr),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ys,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function fc(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&&ys.enqueueReplaceState(t,t.state,null)}function Hl(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},jl(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Zt(i):(i=Tt(t)?Br:ht.current,o.context=Eo(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Wl(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&&ys.enqueueReplaceState(o,o.state,null),fs(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Mo(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 Kl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ql(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Rd=typeof WeakMap=="function"?WeakMap:Map;function dc(e,t,n){n=Qn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Cs||(Cs=!0,lu=r),Ql(e,t)},n}function hc(e,t,n){n=Qn(-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(){Ql(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Ql(e,t),typeof r!="function"&&(Sr===null?Sr=new Set([this]):Sr.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function pc(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Rd;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=Wd.bind(null,e,t,n),t.then(e,e))}function mc(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 vc(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=Qn(-1,1),t.tag=2,yr(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var jd=I.ReactCurrentOwner,Rt=!1;function xt(e,t,n,r){t.child=e===null?za(t,null,n,r):Po(t,e.child,n,r)}function gc(e,t,n,r,o){n=n.render;var i=t.ref;return Ro(t,o),r=Dl(e,t,n,r,i,o),n=Il(),e!==null&&!Rt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,qn(e,t,o)):(Ie&&n&&Sl(t),t.flags|=1,xt(e,t,r,o),t.child)}function yc(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!pu(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,wc(e,t,i,r,o)):(e=Ms(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:ui,n(a,r)&&e.ref===t.ref)return qn(e,t,o)}return t.flags|=1,e=_r(i,r),e.ref=t.ref,e.return=t,t.child=e}function wc(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(ui(i,r)&&e.ref===t.ref)if(Rt=!1,t.pendingProps=r=i,(e.lanes&o)!==0)(e.flags&131072)!==0&&(Rt=!0);else return t.lanes=e.lanes,qn(e,t,o)}return ql(e,t,n,r,o)}function Sc(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},Ae(Lo,Wt),Wt|=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,Ae(Lo,Wt),Wt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Ae(Lo,Wt),Wt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Ae(Lo,Wt),Wt|=r;return xt(e,t,o,n),t.child}function kc(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ql(e,t,n,r,o){var i=Tt(n)?Br:ht.current;return i=Eo(t,i),Ro(t,o),n=Dl(e,t,n,r,i,o),r=Il(),e!==null&&!Rt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,qn(e,t,o)):(Ie&&r&&Sl(t),t.flags|=1,xt(e,t,n,o),t.child)}function xc(e,t,n,r,o){if(Tt(n)){var i=!0;ns(t)}else i=!1;if(Ro(t,o),t.stateNode===null)Ss(e,t),cc(t,n,r),Hl(t,n,r,o),r=!0;else if(e===null){var a=t.stateNode,d=t.memoizedProps;a.props=d;var m=a.context,E=n.contextType;typeof E=="object"&&E!==null?E=Zt(E):(E=Tt(n)?Br:ht.current,E=Eo(t,E));var L=n.getDerivedStateFromProps,A=typeof L=="function"||typeof a.getSnapshotBeforeUpdate=="function";A||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(d!==r||m!==E)&&fc(t,a,r,E),gr=!1;var F=t.memoizedState;a.state=F,fs(t,r,a,o),m=t.memoizedState,d!==r||F!==m||Pt.current||gr?(typeof L=="function"&&(Wl(t,n,L,r),m=t.memoizedState),(d=gr||ac(t,n,d,r,F,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=d):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ia(e,t),d=t.memoizedProps,E=t.type===t.elementType?d:cn(t.type,d),a.props=E,A=t.pendingProps,F=a.context,m=n.contextType,typeof m=="object"&&m!==null?m=Zt(m):(m=Tt(n)?Br:ht.current,m=Eo(t,m));var X=n.getDerivedStateFromProps;(L=typeof X=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(d!==A||F!==m)&&fc(t,a,r,m),gr=!1,F=t.memoizedState,a.state=F,fs(t,r,a,o);var te=t.memoizedState;d!==A||F!==te||Pt.current||gr?(typeof X=="function"&&(Wl(t,n,X,r),te=t.memoizedState),(E=gr||ac(t,n,E,r,F,te,m)||!1)?(L||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,te,m),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,te,m)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||d===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&F===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=te),a.props=r,a.state=te,a.context=m,r=E):(typeof a.componentDidUpdate!="function"||d===e.memoizedProps&&F===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&F===e.memoizedState||(t.flags|=1024),r=!1)}return bl(e,t,n,r,i,o)}function bl(e,t,n,r,o,i){kc(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return o&&Pa(t,n,!1),qn(e,t,i);r=t.stateNode,jd.current=t;var d=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Po(t,e.child,null,i),t.child=Po(t,null,d,i)):xt(e,t,d,i),t.memoizedState=r.state,o&&Pa(t,n,!0),t.child}function Ec(e){var t=e.stateNode;t.pendingContext?Ca(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ca(e,t.context,!1),Ml(e,t.containerInfo)}function _c(e,t,n,r,o){return No(),_l(o),t.flags|=256,xt(e,t,n,r),t.child}var Gl={dehydrated:null,treeContext:null,retryLane:0};function Yl(e){return{baseLanes:e,cachePool:null,transitions:null}}function Cc(e,t,n){var r=t.pendingProps,o=$e.current,i=!1,a=(t.flags&128)!==0,d;if((d=a)||(d=e!==null&&e.memoizedState===null?!1:(o&2)!==0),d?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Ae($e,o&1),e===null)return El(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=Fs(a,r,0,null),e=Jr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Yl(n),t.memoizedState=Gl,e):Jl(t,a));if(o=e.memoizedState,o!==null&&(d=o.dehydrated,d!==null))return Md(e,t,a,r,d,o,n);if(i){i=r.fallback,a=t.mode,o=e.child,d=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=_r(o,m),r.subtreeFlags=o.subtreeFlags&14680064),d!==null?i=_r(d,i):(i=Jr(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?Yl(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~n,t.memoizedState=Gl,r}return i=e.child,e=i.sibling,r=_r(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 Jl(e,t){return t=Fs({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ws(e,t,n,r){return r!==null&&_l(r),Po(t,e.child,null,n),e=Jl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Md(e,t,n,r,o,i,a){if(n)return t.flags&256?(t.flags&=-257,r=Kl(Error(l(422))),ws(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Fs({mode:"visible",children:r.children},o,0,null),i=Jr(i,o,a,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,(t.mode&1)!==0&&Po(t,e.child,null,a),t.child.memoizedState=Yl(a),t.memoizedState=Gl,i);if((t.mode&1)===0)return ws(e,t,a,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var d=r.dgst;return r=d,i=Error(l(419)),r=Kl(i,r,void 0),ws(e,t,a,r)}if(d=(a&e.childLanes)!==0,Rt||d){if(r=rt,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,Kn(e,o),hn(r,e,o,-1))}return hu(),r=Kl(Error(l(421))),ws(e,t,a,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Hd.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,$t=hr(o.nextSibling),Bt=t,Ie=!0,an=null,e!==null&&(Jt[Xt++]=Wn,Jt[Xt++]=Hn,Jt[Xt++]=$r,Wn=e.id,Hn=e.overflow,$r=t),t=Jl(t,r.children),t.flags|=4096,t)}function Nc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Tl(e.return,t,n)}function Xl(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 Pc(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(xt(e,t,r.children,n),r=$e.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&&Nc(e,n,t);else if(e.tag===19)Nc(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(Ae($e,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&&ds(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Xl(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&&ds(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Xl(t,!0,n,null,i);break;case"together":Xl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ss(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function qn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),qr|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,n=_r(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=_r(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Fd(e,t,n){switch(t.tag){case 3:Ec(t),No();break;case 5:Ba(t);break;case 1:Tt(t.type)&&ns(t);break;case 4:Ml(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Ae(us,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ae($e,$e.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?Cc(e,t,n):(Ae($e,$e.current&1),e=qn(e,t,n),e!==null?e.sibling:null);Ae($e,$e.current&1);break;case 19:if(r=(n&t.childLanes)!==0,(e.flags&128)!==0){if(r)return Pc(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ae($e,$e.current),r)break;return null;case 22:case 23:return t.lanes=0,Sc(e,t,n)}return qn(e,t,n)}var Tc,Zl,Rc,jc;Tc=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}},Zl=function(){},Rc=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Kr(Rn.current);var i=null;switch(n){case"input":o=Ht(e,o),r=Ht(e,r),i=[];break;case"select":o=H({},o,{value:void 0}),r=H({},r,{value:void 0}),i=[];break;case"textarea":o=Fn(e,o),r=Fn(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Zi)}Rr(n,r);var a;n=null;for(E in o)if(!r.hasOwnProperty(E)&&o.hasOwnProperty(E)&&o[E]!=null)if(E==="style"){var d=o[E];for(a in d)d.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else E!=="dangerouslySetInnerHTML"&&E!=="children"&&E!=="suppressContentEditableWarning"&&E!=="suppressHydrationWarning"&&E!=="autoFocus"&&(c.hasOwnProperty(E)?i||(i=[]):(i=i||[]).push(E,null));for(E in r){var m=r[E];if(d=o!=null?o[E]:void 0,r.hasOwnProperty(E)&&m!==d&&(m!=null||d!=null))if(E==="style")if(d){for(a in d)!d.hasOwnProperty(a)||m&&m.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in m)m.hasOwnProperty(a)&&d[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,d=d?d.__html:void 0,m!=null&&d!==m&&(i=i||[]).push(E,m)):E==="children"?typeof m!="string"&&typeof m!="number"||(i=i||[]).push(E,""+m):E!=="suppressContentEditableWarning"&&E!=="suppressHydrationWarning"&&(c.hasOwnProperty(E)?(m!=null&&E==="onScroll"&&ze("scroll",e),i||d===m||(i=[])):(i=i||[]).push(E,m))}n&&(i=i||[]).push("style",n);var E=i;(t.updateQueue=E)&&(t.flags|=4)}},jc=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ei(e,t){if(!Ie)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 mt(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 Ld(e,t,n){var r=t.pendingProps;switch(kl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mt(t),null;case 1:return Tt(t.type)&&ts(),mt(t),null;case 3:return r=t.stateNode,jo(),De(Pt),De(ht),Al(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ss(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,an!==null&&(cu(an),an=null))),Zl(e,t),mt(t),null;case 5:Fl(t);var o=Kr(yi.current);if(n=t.type,e!==null&&t.stateNode!=null)Rc(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(l(166));return mt(t),null}if(e=Kr(Rn.current),ss(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Tn]=t,r[hi]=i,e=(t.mode&1)!==0,n){case"dialog":ze("cancel",r),ze("close",r);break;case"iframe":case"object":case"embed":ze("load",r);break;case"video":case"audio":for(o=0;o<ci.length;o++)ze(ci[o],r);break;case"source":ze("error",r);break;case"img":case"image":case"link":ze("error",r),ze("load",r);break;case"details":ze("toggle",r);break;case"input":Yn(r,i),ze("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},ze("invalid",r);break;case"textarea":Xn(r,i),ze("invalid",r)}Rr(n,i),o=null;for(var a in i)if(i.hasOwnProperty(a)){var d=i[a];a==="children"?typeof d=="string"?r.textContent!==d&&(i.suppressHydrationWarning!==!0&&Xi(r.textContent,d,e),o=["children",d]):typeof d=="number"&&r.textContent!==""+d&&(i.suppressHydrationWarning!==!0&&Xi(r.textContent,d,e),o=["children",""+d]):c.hasOwnProperty(a)&&d!=null&&a==="onScroll"&&ze("scroll",r)}switch(n){case"input":Gn(r),vn(r,i,!0);break;case"textarea":Gn(r),Ot(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Zi)}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=eo(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[Tn]=t,e[hi]=r,Tc(e,t,!1,!1),t.stateNode=e;e:{switch(a=ro(n,r),n){case"dialog":ze("cancel",e),ze("close",e),o=r;break;case"iframe":case"object":case"embed":ze("load",e),o=r;break;case"video":case"audio":for(o=0;o<ci.length;o++)ze(ci[o],e);o=r;break;case"source":ze("error",e),o=r;break;case"img":case"image":case"link":ze("error",e),ze("load",e),o=r;break;case"details":ze("toggle",e),o=r;break;case"input":Yn(e,r),o=Ht(e,r),ze("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=H({},r,{value:void 0}),ze("invalid",e);break;case"textarea":Xn(e,r),o=Fn(e,r),ze("invalid",e);break;default:o=r}Rr(n,o),d=o;for(i in d)if(d.hasOwnProperty(i)){var m=d[i];i==="style"?no(e,m):i==="dangerouslySetInnerHTML"?(m=m?m.__html:void 0,m!=null&&to(e,m)):i==="children"?typeof m=="string"?(n!=="textarea"||m!=="")&&Tr(e,m):typeof m=="number"&&Tr(e,""+m):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(c.hasOwnProperty(i)?m!=null&&i==="onScroll"&&ze("scroll",e):m!=null&&ye(e,i,m,a))}switch(n){case"input":Gn(e),vn(e,r,!1);break;case"textarea":Gn(e),Ot(e);break;case"option":r.value!=null&&e.setAttribute("value",""+xe(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?At(e,!!r.multiple,i,!1):r.defaultValue!=null&&At(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Zi)}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 mt(t),null;case 6:if(e&&t.stateNode!=null)jc(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(l(166));if(n=Kr(yi.current),Kr(Rn.current),ss(t)){if(r=t.stateNode,n=t.memoizedProps,r[Tn]=t,(i=r.nodeValue!==n)&&(e=Bt,e!==null))switch(e.tag){case 3:Xi(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Xi(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Tn]=t,t.stateNode=r}return mt(t),null;case 13:if(De($e),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ie&&$t!==null&&(t.mode&1)!==0&&(t.flags&128)===0)La(),No(),t.flags|=98560,i=!1;else if(i=ss(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(l(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(l(317));i[Tn]=t}else No(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;mt(t),i=!1}else an!==null&&(cu(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||($e.current&1)!==0?Ze===0&&(Ze=3):hu())),t.updateQueue!==null&&(t.flags|=4),mt(t),null);case 4:return jo(),Zl(e,t),e===null&&fi(t.stateNode.containerInfo),mt(t),null;case 10:return Pl(t.type._context),mt(t),null;case 17:return Tt(t.type)&&ts(),mt(t),null;case 19:if(De($e),i=t.memoizedState,i===null)return mt(t),null;if(r=(t.flags&128)!==0,a=i.rendering,a===null)if(r)Ei(i,!1);else{if(Ze!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(a=ds(e),a!==null){for(t.flags|=128,Ei(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 Ae($e,$e.current&1|2),t.child}e=e.sibling}i.tail!==null&&Le()>Ao&&(t.flags|=128,r=!0,Ei(i,!1),t.lanes=4194304)}else{if(!r)if(e=ds(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ei(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Ie)return mt(t),null}else 2*Le()-i.renderingStartTime>Ao&&n!==1073741824&&(t.flags|=128,r=!0,Ei(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=Le(),t.sibling=null,n=$e.current,Ae($e,r?n&1|2:n&1),t):(mt(t),null);case 22:case 23:return du(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Wt&1073741824)!==0&&(mt(t),t.subtreeFlags&6&&(t.flags|=8192)):mt(t),null;case 24:return null;case 25:return null}throw Error(l(156,t.tag))}function Ad(e,t){switch(kl(t),t.tag){case 1:return Tt(t.type)&&ts(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return jo(),De(Pt),De(ht),Al(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Fl(t),null;case 13:if(De($e),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));No()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return De($e),null;case 4:return jo(),null;case 10:return Pl(t.type._context),null;case 22:case 23:return du(),null;case 24:return null;default:return null}}var ks=!1,vt=!1,Od=typeof WeakSet=="function"?WeakSet:Set,Z=null;function Fo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ke(e,t,r)}else n.current=null}function eu(e,t,n){try{n()}catch(r){Ke(e,t,r)}}var Mc=!1;function zd(e,t){if(dl=Dr,e=aa(),ol(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,d=-1,m=-1,E=0,L=0,A=e,F=null;t:for(;;){for(var X;A!==n||o!==0&&A.nodeType!==3||(d=a+o),A!==i||r!==0&&A.nodeType!==3||(m=a+r),A.nodeType===3&&(a+=A.nodeValue.length),(X=A.firstChild)!==null;)F=A,A=X;for(;;){if(A===e)break t;if(F===n&&++E===o&&(d=a),F===i&&++L===r&&(m=a),(X=A.nextSibling)!==null)break;A=F,F=A.parentNode}A=X}n=d===-1||m===-1?null:{start:d,end:m}}else n=null}n=n||{start:0,end:0}}else n=null;for(hl={focusedElem:e,selectionRange:n},Dr=!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 te=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(te!==null){var oe=te.memoizedProps,Qe=te.memoizedState,S=t.stateNode,v=S.getSnapshotBeforeUpdate(t.elementType===t.type?oe:cn(t.type,oe),Qe);S.__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(l(163))}}catch(D){Ke(t,t.return,D)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return te=Mc,Mc=!1,te}function _i(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&&eu(t,n,i)}o=o.next}while(o!==r)}}function xs(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 tu(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 Fc(e){var t=e.alternate;t!==null&&(e.alternate=null,Fc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Tn],delete t[hi],delete t[gl],delete t[yd],delete t[wd])),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 Lc(e){return e.tag===5||e.tag===3||e.tag===4}function Ac(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Lc(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 nu(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=Zi));else if(r!==4&&(e=e.child,e!==null))for(nu(e,t,n),e=e.sibling;e!==null;)nu(e,t,n),e=e.sibling}function ru(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(ru(e,t,n),e=e.sibling;e!==null;)ru(e,t,n),e=e.sibling}var st=null,fn=!1;function wr(e,t,n){for(n=n.child;n!==null;)Oc(e,t,n),n=n.sibling}function Oc(e,t,n){if(It&&typeof It.onCommitFiberUnmount=="function")try{It.onCommitFiberUnmount(Dn,n)}catch{}switch(n.tag){case 5:vt||Fo(n,t);case 6:var r=st,o=fn;st=null,wr(e,t,n),st=r,fn=o,st!==null&&(fn?(e=st,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):st.removeChild(n.stateNode));break;case 18:st!==null&&(fn?(e=st,n=n.stateNode,e.nodeType===8?vl(e.parentNode,n):e.nodeType===1&&vl(e,n),ur(e)):vl(st,n.stateNode));break;case 4:r=st,o=fn,st=n.stateNode.containerInfo,fn=!0,wr(e,t,n),st=r,fn=o;break;case 0:case 11:case 14:case 15:if(!vt&&(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)&&eu(n,t,a),o=o.next}while(o!==r)}wr(e,t,n);break;case 1:if(!vt&&(Fo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(d){Ke(n,t,d)}wr(e,t,n);break;case 21:wr(e,t,n);break;case 22:n.mode&1?(vt=(r=vt)||n.memoizedState!==null,wr(e,t,n),vt=r):wr(e,t,n);break;default:wr(e,t,n)}}function zc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Od),t.forEach(function(r){var o=Kd.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,d=a;e:for(;d!==null;){switch(d.tag){case 5:st=d.stateNode,fn=!1;break e;case 3:st=d.stateNode.containerInfo,fn=!0;break e;case 4:st=d.stateNode.containerInfo,fn=!0;break e}d=d.return}if(st===null)throw Error(l(160));Oc(i,a,o),st=null,fn=!1;var m=o.alternate;m!==null&&(m.return=null),o.return=null}catch(E){Ke(o,t,E)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Dc(t,e),t=t.sibling}function Dc(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(dn(t,e),Mn(e),r&4){try{_i(3,e,e.return),xs(3,e)}catch(oe){Ke(e,e.return,oe)}try{_i(5,e,e.return)}catch(oe){Ke(e,e.return,oe)}}break;case 1:dn(t,e),Mn(e),r&512&&n!==null&&Fo(n,n.return);break;case 5:if(dn(t,e),Mn(e),r&512&&n!==null&&Fo(n,n.return),e.flags&32){var o=e.stateNode;try{Tr(o,"")}catch(oe){Ke(e,e.return,oe)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,a=n!==null?n.memoizedProps:i,d=e.type,m=e.updateQueue;if(e.updateQueue=null,m!==null)try{d==="input"&&i.type==="radio"&&i.name!=null&&ut(o,i),ro(d,a);var E=ro(d,i);for(a=0;a<m.length;a+=2){var L=m[a],A=m[a+1];L==="style"?no(o,A):L==="dangerouslySetInnerHTML"?to(o,A):L==="children"?Tr(o,A):ye(o,L,A,E)}switch(d){case"input":Pr(o,i);break;case"textarea":Zn(o,i);break;case"select":var F=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var X=i.value;X!=null?At(o,!!i.multiple,X,!1):F!==!!i.multiple&&(i.defaultValue!=null?At(o,!!i.multiple,i.defaultValue,!0):At(o,!!i.multiple,i.multiple?[]:"",!1))}o[hi]=i}catch(oe){Ke(e,e.return,oe)}}break;case 6:if(dn(t,e),Mn(e),r&4){if(e.stateNode===null)throw Error(l(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(oe){Ke(e,e.return,oe)}}break;case 3:if(dn(t,e),Mn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ur(t.containerInfo)}catch(oe){Ke(e,e.return,oe)}break;case 4:dn(t,e),Mn(e);break;case 13:dn(t,e),Mn(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(su=Le())),r&4&&zc(e);break;case 22:if(L=n!==null&&n.memoizedState!==null,e.mode&1?(vt=(E=vt)||L,dn(t,e),vt=E):dn(t,e),Mn(e),r&8192){if(E=e.memoizedState!==null,(e.stateNode.isHidden=E)&&!L&&(e.mode&1)!==0)for(Z=e,L=e.child;L!==null;){for(A=Z=L;Z!==null;){switch(F=Z,X=F.child,F.tag){case 0:case 11:case 14:case 15:_i(4,F,F.return);break;case 1:Fo(F,F.return);var te=F.stateNode;if(typeof te.componentWillUnmount=="function"){r=F,n=F.return;try{t=r,te.props=t.memoizedProps,te.state=t.memoizedState,te.componentWillUnmount()}catch(oe){Ke(r,n,oe)}}break;case 5:Fo(F,F.return);break;case 22:if(F.memoizedState!==null){Vc(A);continue}}X!==null?(X.return=F,Z=X):Vc(A)}L=L.sibling}e:for(L=null,A=e;;){if(A.tag===5){if(L===null){L=A;try{o=A.stateNode,E?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(d=A.stateNode,m=A.memoizedProps.style,a=m!=null&&m.hasOwnProperty("display")?m.display:null,d.style.display=gt("display",a))}catch(oe){Ke(e,e.return,oe)}}}else if(A.tag===6){if(L===null)try{A.stateNode.nodeValue=E?"":A.memoizedProps}catch(oe){Ke(e,e.return,oe)}}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;L===A&&(L=null),A=A.return}L===A&&(L=null),A.sibling.return=A.return,A=A.sibling}}break;case 19:dn(t,e),Mn(e),r&4&&zc(e);break;case 21:break;default:dn(t,e),Mn(e)}}function Mn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Lc(n)){var r=n;break e}n=n.return}throw Error(l(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Tr(o,""),r.flags&=-33);var i=Ac(e);ru(e,i,o);break;case 3:case 4:var a=r.stateNode.containerInfo,d=Ac(e);nu(e,d,a);break;default:throw Error(l(161))}}catch(m){Ke(e,e.return,m)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Dd(e,t,n){Z=e,Ic(e)}function Ic(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||ks;if(!a){var d=o.alternate,m=d!==null&&d.memoizedState!==null||vt;d=ks;var E=vt;if(ks=a,(vt=m)&&!E)for(Z=o;Z!==null;)a=Z,m=a.child,a.tag===22&&a.memoizedState!==null?Bc(o):m!==null?(m.return=a,Z=m):Bc(o);for(;i!==null;)Z=i,Ic(i),i=i.sibling;Z=o,ks=d,vt=E}Uc(e)}else(o.subtreeFlags&8772)!==0&&i!==null?(i.return=o,Z=i):Uc(e)}}function Uc(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:vt||xs(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!vt)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&&Va(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}Va(t,a,n)}break;case 5:var d=t.stateNode;if(n===null&&t.flags&4){n=d;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 L=E.memoizedState;if(L!==null){var A=L.dehydrated;A!==null&&ur(A)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(l(163))}vt||t.flags&512&&tu(t)}catch(F){Ke(t,t.return,F)}}if(t===e){Z=null;break}if(n=t.sibling,n!==null){n.return=t.return,Z=n;break}Z=t.return}}function Vc(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 Bc(e){for(;Z!==null;){var t=Z;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{xs(4,t)}catch(m){Ke(t,n,m)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(m){Ke(t,o,m)}}var i=t.return;try{tu(t)}catch(m){Ke(t,i,m)}break;case 5:var a=t.return;try{tu(t)}catch(m){Ke(t,a,m)}}}catch(m){Ke(t,t.return,m)}if(t===e){Z=null;break}var d=t.sibling;if(d!==null){d.return=t.return,Z=d;break}Z=t.return}}var Id=Math.ceil,Es=I.ReactCurrentDispatcher,ou=I.ReactCurrentOwner,tn=I.ReactCurrentBatchConfig,Ce=0,rt=null,be=null,lt=0,Wt=0,Lo=pr(0),Ze=0,Ci=null,qr=0,_s=0,iu=0,Ni=null,jt=null,su=0,Ao=1/0,bn=null,Cs=!1,lu=null,Sr=null,Ns=!1,kr=null,Ps=0,Pi=0,uu=null,Ts=-1,Rs=0;function Et(){return(Ce&6)!==0?Le():Ts!==-1?Ts:Ts=Le()}function xr(e){return(e.mode&1)===0?1:(Ce&2)!==0&<!==0?lt&-lt:kd.transition!==null?(Rs===0&&(Rs=zi()),Rs):(e=ge,e!==0||(e=window.event,e=e===void 0?16:Vi(e.type)),e)}function hn(e,t,n,r){if(50<Pi)throw Pi=0,uu=null,Error(l(185));kn(e,n,r),((Ce&2)===0||e!==rt)&&(e===rt&&((Ce&2)===0&&(_s|=n),Ze===4&&Er(e,lt)),Mt(e,r),n===1&&Ce===0&&(t.mode&1)===0&&(Ao=Le()+500,rs&&vr()))}function Mt(e,t){var n=e.callbackNode;bo(e,t);var r=Sn(e,e===rt?lt:0);if(r===0)n!==null&&rn(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&rn(n),t===1)e.tag===0?Sd(Wc.bind(null,e)):Ta(Wc.bind(null,e)),vd(function(){(Ce&6)===0&&vr()}),n=null;else{switch(Di(r)){case 1:n=zt;break;case 4:n=Dt;break;case 16:n=wt;break;case 536870912:n=tt;break;default:n=wt}n=Jc(n,$c.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function $c(e,t){if(Ts=-1,Rs=0,(Ce&6)!==0)throw Error(l(327));var n=e.callbackNode;if(Oo()&&e.callbackNode!==n)return null;var r=Sn(e,e===rt?lt:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=js(e,r);else{t=r;var o=Ce;Ce|=2;var i=Kc();(rt!==e||lt!==t)&&(bn=null,Ao=Le()+500,Gr(e,t));do try{Bd();break}catch(d){Hc(e,d)}while(!0);Nl(),Es.current=i,Ce=o,be!==null?t=0:(rt=null,lt=0,t=Ze)}if(t!==0){if(t===2&&(o=Go(e),o!==0&&(r=o,t=au(e,o))),t===1)throw n=Ci,Gr(e,0),Er(e,r),Mt(e,Le()),n;if(t===6)Er(e,r);else{if(o=e.current.alternate,(r&30)===0&&!Ud(o)&&(t=js(e,r),t===2&&(i=Go(e),i!==0&&(r=i,t=au(e,i))),t===1))throw n=Ci,Gr(e,0),Er(e,r),Mt(e,Le()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(l(345));case 2:Yr(e,jt,bn);break;case 3:if(Er(e,r),(r&130023424)===r&&(t=su+500-Le(),10<t)){if(Sn(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Et(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=ml(Yr.bind(null,e,jt,bn),t);break}Yr(e,jt,bn);break;case 4:if(Er(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var a=31-kt(r);i=1<<a,a=t[a],a>o&&(o=a),r&=~i}if(r=o,r=Le()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Id(r/1960))-r,10<r){e.timeoutHandle=ml(Yr.bind(null,e,jt,bn),r);break}Yr(e,jt,bn);break;case 5:Yr(e,jt,bn);break;default:throw Error(l(329))}}}return Mt(e,Le()),e.callbackNode===n?$c.bind(null,e):null}function au(e,t){var n=Ni;return e.current.memoizedState.isDehydrated&&(Gr(e,t).flags|=256),e=js(e,t),e!==2&&(t=jt,jt=n,t!==null&&cu(t)),e}function cu(e){jt===null?jt=e:jt.push.apply(jt,e)}function Ud(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 Er(e,t){for(t&=~iu,t&=~_s,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-kt(t),r=1<<n;e[n]=-1,t&=~r}}function Wc(e){if((Ce&6)!==0)throw Error(l(327));Oo();var t=Sn(e,0);if((t&1)===0)return Mt(e,Le()),null;var n=js(e,t);if(e.tag!==0&&n===2){var r=Go(e);r!==0&&(t=r,n=au(e,r))}if(n===1)throw n=Ci,Gr(e,0),Er(e,t),Mt(e,Le()),n;if(n===6)throw Error(l(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Yr(e,jt,bn),Mt(e,Le()),null}function fu(e,t){var n=Ce;Ce|=1;try{return e(t)}finally{Ce=n,Ce===0&&(Ao=Le()+500,rs&&vr())}}function br(e){kr!==null&&kr.tag===0&&(Ce&6)===0&&Oo();var t=Ce;Ce|=1;var n=tn.transition,r=ge;try{if(tn.transition=null,ge=1,e)return e()}finally{ge=r,tn.transition=n,Ce=t,(Ce&6)===0&&vr()}}function du(){Wt=Lo.current,De(Lo)}function Gr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,md(n)),be!==null)for(n=be.return;n!==null;){var r=n;switch(kl(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ts();break;case 3:jo(),De(Pt),De(ht),Al();break;case 5:Fl(r);break;case 4:jo();break;case 13:De($e);break;case 19:De($e);break;case 10:Pl(r.type._context);break;case 22:case 23:du()}n=n.return}if(rt=e,be=e=_r(e.current,null),lt=Wt=t,Ze=0,Ci=null,iu=_s=qr=0,jt=Ni=null,Hr!==null){for(t=0;t<Hr.length;t++)if(n=Hr[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}Hr=null}return e}function Hc(e,t){do{var n=be;try{if(Nl(),hs.current=gs,ps){for(var r=We.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}ps=!1}if(Qr=0,nt=Xe=We=null,wi=!1,Si=0,ou.current=null,n===null||n.return===null){Ze=1,Ci=t,be=null;break}e:{var i=e,a=n.return,d=n,m=t;if(t=lt,d.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){var E=m,L=d,A=L.tag;if((L.mode&1)===0&&(A===0||A===11||A===15)){var F=L.alternate;F?(L.updateQueue=F.updateQueue,L.memoizedState=F.memoizedState,L.lanes=F.lanes):(L.updateQueue=null,L.memoizedState=null)}var X=mc(a);if(X!==null){X.flags&=-257,vc(X,a,d,i,t),X.mode&1&&pc(i,E,t),t=X,m=E;var te=t.updateQueue;if(te===null){var oe=new Set;oe.add(m),t.updateQueue=oe}else te.add(m);break e}else{if((t&1)===0){pc(i,E,t),hu();break e}m=Error(l(426))}}else if(Ie&&d.mode&1){var Qe=mc(a);if(Qe!==null){(Qe.flags&65536)===0&&(Qe.flags|=256),vc(Qe,a,d,i,t),_l(Mo(m,d));break e}}i=m=Mo(m,d),Ze!==4&&(Ze=2),Ni===null?Ni=[i]:Ni.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var S=dc(i,m,t);Ua(i,S);break e;case 1:d=m;var v=i.type,k=i.stateNode;if((i.flags&128)===0&&(typeof v.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(Sr===null||!Sr.has(k)))){i.flags|=65536,t&=-t,i.lanes|=t;var D=hc(i,d,t);Ua(i,D);break e}}i=i.return}while(i!==null)}qc(n)}catch(ie){t=ie,be===n&&n!==null&&(be=n=n.return);continue}break}while(!0)}function Kc(){var e=Es.current;return Es.current=gs,e===null?gs:e}function hu(){(Ze===0||Ze===3||Ze===2)&&(Ze=4),rt===null||(qr&268435455)===0&&(_s&268435455)===0||Er(rt,lt)}function js(e,t){var n=Ce;Ce|=2;var r=Kc();(rt!==e||lt!==t)&&(bn=null,Gr(e,t));do try{Vd();break}catch(o){Hc(e,o)}while(!0);if(Nl(),Ce=n,Es.current=r,be!==null)throw Error(l(261));return rt=null,lt=0,Ze}function Vd(){for(;be!==null;)Qc(be)}function Bd(){for(;be!==null&&!Kt();)Qc(be)}function Qc(e){var t=Yc(e.alternate,e,Wt);e.memoizedProps=e.pendingProps,t===null?qc(e):be=t,ou.current=null}function qc(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=Ld(n,t,Wt),n!==null){be=n;return}}else{if(n=Ad(n,t),n!==null){n.flags&=32767,be=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ze=6,be=null;return}}if(t=t.sibling,t!==null){be=t;return}be=t=e}while(t!==null);Ze===0&&(Ze=5)}function Yr(e,t,n){var r=ge,o=tn.transition;try{tn.transition=null,ge=1,$d(e,t,n,r)}finally{tn.transition=o,ge=r}return null}function $d(e,t,n,r){do Oo();while(kr!==null);if((Ce&6)!==0)throw Error(l(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(l(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(sr(e,i),e===rt&&(be=rt=null,lt=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||Ns||(Ns=!0,Jc(wt,function(){return Oo(),null})),i=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||i){i=tn.transition,tn.transition=null;var a=ge;ge=1;var d=Ce;Ce|=4,ou.current=null,zd(e,n),Dc(n,e),ud(hl),Dr=!!dl,hl=dl=null,e.current=n,Dd(n),on(),Ce=d,ge=a,tn.transition=i}else e.current=n;if(Ns&&(Ns=!1,kr=e,Ps=o),i=e.pendingLanes,i===0&&(Sr=null),St(n.stateNode),Mt(e,Le()),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(Cs)throw Cs=!1,e=lu,lu=null,e;return(Ps&1)!==0&&e.tag!==0&&Oo(),i=e.pendingLanes,(i&1)!==0?e===uu?Pi++:(Pi=0,uu=e):Pi=0,vr(),null}function Oo(){if(kr!==null){var e=Di(Ps),t=tn.transition,n=ge;try{if(tn.transition=null,ge=16>e?16:e,kr===null)var r=!1;else{if(e=kr,kr=null,Ps=0,(Ce&6)!==0)throw Error(l(331));var o=Ce;for(Ce|=4,Z=e.current;Z!==null;){var i=Z,a=i.child;if((Z.flags&16)!==0){var d=i.deletions;if(d!==null){for(var m=0;m<d.length;m++){var E=d[m];for(Z=E;Z!==null;){var L=Z;switch(L.tag){case 0:case 11:case 15:_i(8,L,i)}var A=L.child;if(A!==null)A.return=L,Z=A;else for(;Z!==null;){L=Z;var F=L.sibling,X=L.return;if(Fc(L),L===E){Z=null;break}if(F!==null){F.return=X,Z=F;break}Z=X}}}var te=i.alternate;if(te!==null){var oe=te.child;if(oe!==null){te.child=null;do{var Qe=oe.sibling;oe.sibling=null,oe=Qe}while(oe!==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:_i(9,i,i.return)}var S=i.sibling;if(S!==null){S.return=i.return,Z=S;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(d=Z,(d.flags&2048)!==0)try{switch(d.tag){case 0:case 11:case 15:xs(9,d)}}catch(ie){Ke(d,d.return,ie)}if(d===a){Z=null;break e}var D=d.sibling;if(D!==null){D.return=d.return,Z=D;break e}Z=d.return}}if(Ce=o,vr(),It&&typeof It.onPostCommitFiberRoot=="function")try{It.onPostCommitFiberRoot(Dn,e)}catch{}r=!0}return r}finally{ge=n,tn.transition=t}}return!1}function bc(e,t,n){t=Mo(n,t),t=dc(e,t,1),e=yr(e,t,1),t=Et(),e!==null&&(kn(e,1,t),Mt(e,t))}function Ke(e,t,n){if(e.tag===3)bc(e,e,n);else for(;t!==null;){if(t.tag===3){bc(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Sr===null||!Sr.has(r))){e=Mo(n,e),e=hc(t,e,1),t=yr(t,e,1),e=Et(),t!==null&&(kn(t,1,e),Mt(t,e));break}}t=t.return}}function Wd(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Et(),e.pingedLanes|=e.suspendedLanes&n,rt===e&&(lt&n)===n&&(Ze===4||Ze===3&&(lt&130023424)===lt&&500>Le()-su?Gr(e,0):iu|=n),Mt(e,t)}function Gc(e,t){t===0&&((e.mode&1)===0?t=1:(t=wn,wn<<=1,(wn&130023424)===0&&(wn=4194304)));var n=Et();e=Kn(e,t),e!==null&&(kn(e,t,n),Mt(e,n))}function Hd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Gc(e,n)}function Kd(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(l(314))}r!==null&&r.delete(t),Gc(e,n)}var Yc;Yc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Pt.current)Rt=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return Rt=!1,Fd(e,t,n);Rt=(e.flags&131072)!==0}else Rt=!1,Ie&&(t.flags&1048576)!==0&&Ra(t,is,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ss(e,t),e=t.pendingProps;var o=Eo(t,ht.current);Ro(t,n),o=Dl(null,t,r,e,o,n);var i=Il();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,Tt(r)?(i=!0,ns(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,jl(t),o.updater=ys,t.stateNode=o,o._reactInternals=t,Hl(t,r,e,n),t=bl(null,t,r,!0,i,n)):(t.tag=0,Ie&&i&&Sl(t),xt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ss(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=qd(r),e=cn(r,e),o){case 0:t=ql(null,t,r,e,n);break e;case 1:t=xc(null,t,r,e,n);break e;case 11:t=gc(null,t,r,e,n);break e;case 14:t=yc(null,t,r,cn(r.type,e),n);break e}throw Error(l(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:cn(r,o),ql(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:cn(r,o),xc(e,t,r,o,n);case 3:e:{if(Ec(t),e===null)throw Error(l(387));r=t.pendingProps,i=t.memoizedState,o=i.element,Ia(e,t),fs(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=Mo(Error(l(423)),t),t=_c(e,t,r,n,o);break e}else if(r!==o){o=Mo(Error(l(424)),t),t=_c(e,t,r,n,o);break e}else for($t=hr(t.stateNode.containerInfo.firstChild),Bt=t,Ie=!0,an=null,n=za(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(No(),r===o){t=qn(e,t,n);break e}xt(e,t,r,n)}t=t.child}return t;case 5:return Ba(t),e===null&&El(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,pl(r,o)?a=null:i!==null&&pl(r,i)&&(t.flags|=32),kc(e,t),xt(e,t,a,n),t.child;case 6:return e===null&&El(t),null;case 13:return Cc(e,t,n);case 4:return Ml(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Po(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),gc(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,Ae(us,r._currentValue),r._currentValue=a,i!==null)if(un(i.value,a)){if(i.children===o.children&&!Pt.current){t=qn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var d=i.dependencies;if(d!==null){a=i.child;for(var m=d.firstContext;m!==null;){if(m.context===r){if(i.tag===1){m=Qn(-1,n&-n),m.tag=2;var E=i.updateQueue;if(E!==null){E=E.shared;var L=E.pending;L===null?m.next=m:(m.next=L.next,L.next=m),E.pending=m}}i.lanes|=n,m=i.alternate,m!==null&&(m.lanes|=n),Tl(i.return,n,t),d.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(l(341));a.lanes|=n,d=a.alternate,d!==null&&(d.lanes|=n),Tl(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,Ro(t,n),o=Zt(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),yc(e,t,r,o,n);case 15:return wc(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:cn(r,o),Ss(e,t),t.tag=1,Tt(r)?(e=!0,ns(t)):e=!1,Ro(t,n),cc(t,r,o),Hl(t,r,o,n),bl(null,t,r,!0,e,n);case 19:return Pc(e,t,n);case 22:return Sc(e,t,n)}throw Error(l(156,t.tag))};function Jc(e,t){return qo(e,t)}function Qd(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 nn(e,t,n,r){return new Qd(e,t,n,r)}function pu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function qd(e){if(typeof e=="function")return pu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ge)return 11;if(e===Ue)return 14}return 2}function _r(e,t){var n=e.alternate;return n===null?(n=nn(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 Ms(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")pu(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case re:return Jr(n.children,o,i,t);case me:a=8,o|=8;break;case ke:return e=nn(12,n,t,o|2),e.elementType=ke,e.lanes=i,e;case et:return e=nn(13,n,t,o),e.elementType=et,e.lanes=i,e;case qe:return e=nn(19,n,t,o),e.elementType=qe,e.lanes=i,e;case Ne:return Fs(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case K:a=10;break e;case _e:a=9;break e;case Ge:a=11;break e;case Ue:a=14;break e;case Ve:a=16,r=null;break e}throw Error(l(130,e==null?e:typeof e,""))}return t=nn(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Jr(e,t,n,r){return e=nn(7,e,r,t),e.lanes=n,e}function Fs(e,t,n,r){return e=nn(22,e,r,t),e.elementType=Ne,e.lanes=n,e.stateNode={isHidden:!1},e}function mu(e,t,n){return e=nn(6,e,null,t),e.lanes=n,e}function vu(e,t,n){return t=nn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function bd(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=ct(0),this.expirationTimes=ct(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ct(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function gu(e,t,n,r,o,i,a,d,m){return e=new bd(e,t,n,d,m),t===1?(t=1,i===!0&&(t|=8)):t=0,i=nn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},jl(i),e}function Gd(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 Xc(e){if(!e)return mr;e=e._reactInternals;e:{if(zn(e)!==e||e.tag!==1)throw Error(l(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Tt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(l(171))}if(e.tag===1){var n=e.type;if(Tt(n))return Na(e,n,t)}return t}function Zc(e,t,n,r,o,i,a,d,m){return e=gu(n,r,!0,e,o,i,a,d,m),e.context=Xc(null),n=e.current,r=Et(),o=xr(n),i=Qn(r,o),i.callback=t??null,yr(n,i,o),e.current.lanes=o,kn(e,o,r),Mt(e,r),e}function Ls(e,t,n,r){var o=t.current,i=Et(),a=xr(o);return n=Xc(n),t.context===null?t.context=n:t.pendingContext=n,t=Qn(i,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=yr(o,t,a),e!==null&&(hn(e,o,a,i),cs(e,o,a)),a}function As(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 ef(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function yu(e,t){ef(e,t),(e=e.alternate)&&ef(e,t)}function Yd(){return null}var tf=typeof reportError=="function"?reportError:function(e){console.error(e)};function wu(e){this._internalRoot=e}Os.prototype.render=wu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));Ls(e,t,null,null)},Os.prototype.unmount=wu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;br(function(){Ls(null,e,null,null)}),t[Bn]=null}};function Os(e){this._internalRoot=e}Os.prototype.unstable_scheduleHydration=function(e){if(e){var t=Un();e={blockedOn:null,target:e,priority:t};for(var n=0;n<_n.length&&t!==0&&t<_n[n].priority;n++);_n.splice(n,0,e),n===0&&Ui(e)}};function Su(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function zs(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function nf(){}function Jd(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var E=As(a);i.call(E)}}var a=Zc(t,r,e,0,null,!1,!1,"",nf);return e._reactRootContainer=a,e[Bn]=a.current,fi(e.nodeType===8?e.parentNode:e),br(),a}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var d=r;r=function(){var E=As(m);d.call(E)}}var m=gu(e,0,!1,null,null,!1,!1,"",nf);return e._reactRootContainer=m,e[Bn]=m.current,fi(e.nodeType===8?e.parentNode:e),br(function(){Ls(t,m,n,r)}),m}function Ds(e,t,n,r,o){var i=n._reactRootContainer;if(i){var a=i;if(typeof o=="function"){var d=o;o=function(){var m=As(a);d.call(m)}}Ls(t,a,e,o)}else a=Jd(n,t,e,o,r);return As(a)}Yo=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Lr(t.pendingLanes);n!==0&&(In(t,n|1),Mt(t,Le()),(Ce&6)===0&&(Ao=Le()+500,vr()))}break;case 13:br(function(){var r=Kn(e,1);if(r!==null){var o=Et();hn(r,e,1,o)}}),yu(e,1)}},Jo=function(e){if(e.tag===13){var t=Kn(e,134217728);if(t!==null){var n=Et();hn(t,e,134217728,n)}yu(e,134217728)}},Ii=function(e){if(e.tag===13){var t=xr(e),n=Kn(e,t);if(n!==null){var r=Et();hn(n,e,t,r)}yu(e,t)}},Un=function(){return ge},ao=function(e,t){var n=ge;try{return ge=e,t()}finally{ge=n}},Vo=function(e,t,n){switch(t){case"input":if(Pr(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=es(r);if(!o)throw Error(l(90));Nr(r),Pr(r,o)}}}break;case"textarea":Zn(e,n);break;case"select":t=n.value,t!=null&&At(e,!!n.multiple,t,!1)}},An=fu,jr=br;var Xd={usingClientEntryPoint:!1,Events:[pi,ko,es,Bo,$o,fu]},Ti={findFiberByHostInstance:Vr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Zd={bundleType:Ti.bundleType,version:Ti.version,rendererPackageName:Ti.rendererPackageName,rendererConfig:Ti.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=Ko(e),e===null?null:e.stateNode},findFiberByHostInstance:Ti.findFiberByHostInstance||Yd,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 Is=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Is.isDisabled&&Is.supportsFiber)try{Dn=Is.inject(Zd),It=Is}catch{}}return Ft.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Xd,Ft.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Su(t))throw Error(l(200));return Gd(e,t,null,n)},Ft.createRoot=function(e,t){if(!Su(e))throw Error(l(299));var n=!1,r="",o=tf;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=gu(e,1,!1,null,null,n,!1,r,o),e[Bn]=t.current,fi(e.nodeType===8?e.parentNode:e),new wu(t)},Ft.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(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=Ko(t),e=e===null?null:e.stateNode,e},Ft.flushSync=function(e){return br(e)},Ft.hydrate=function(e,t,n){if(!zs(t))throw Error(l(200));return Ds(null,e,t,!0,n)},Ft.hydrateRoot=function(e,t,n){if(!Su(e))throw Error(l(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",a=tf;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=Zc(t,null,e,1,n??null,o,!1,i,a),e[Bn]=t.current,fi(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 Os(t)},Ft.render=function(e,t,n){if(!zs(t))throw Error(l(200));return Ds(null,e,t,!1,n)},Ft.unmountComponentAtNode=function(e){if(!zs(e))throw Error(l(40));return e._reactRootContainer?(br(function(){Ds(null,null,e,!1,function(){e._reactRootContainer=null,e[Bn]=null})}),!0):!1},Ft.unstable_batchedUpdates=fu,Ft.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!zs(n))throw Error(l(200));if(e==null||e._reactInternals===void 0)throw Error(l(38));return Ds(e,t,n,!1,r)},Ft.version="18.3.1-next-f1338f8080-20240426",Ft}var ff;function ah(){if(ff)return Eu.exports;ff=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(s){console.error(s)}}return u(),Eu.exports=uh(),Eu.exports}var df;function ch(){if(df)return Us;df=1;var u=ah();return Us.createRoot=u.createRoot,Us.hydrateRoot=u.hydrateRoot,Us}var fh=ch(),_=Hu();function hf(u){return[...u.toLocaleLowerCase().matchAll(/[\p{L}\p{N}]+(?:['’\-][\p{L}\p{N}]+)*/gu)].map(s=>({value:s[0],start:s.index??0}))}function Nu(u,s){if(!s.length||s.length>u.length)return!1;for(let l=0;l<=u.length-s.length;l++)if(s.every((f,c)=>u[l+c]===f))return!0;return!1}function dh(u,s){const l=u.trim(),f=hf(l),c=hf(s).map(({value:C})=>C),g=f.map(({value:C})=>C);if(g.join(" ")==="it seems like"&&Nu(c,g))return"";if(f.length<5||c.length<5)return l;if(Nu(c,g))return"";for(let C=f.length-1;C>=5;C--)if(Nu(c,g.slice(0,C)))return l.slice(f[C].start).replace(/^[\s,.;:!?—-]+/u,"").trim();return l}class hh{constructor(s,l,f=()=>{},c=()=>{}){ne(this,"recordings",[]);ne(this,"transcripts",[]);ne(this,"hearing",!1);ne(this,"pumpingEpoch",null);ne(this,"active",null);ne(this,"epoch",0);ne(this,"transcribe");ne(this,"send");ne(this,"report");ne(this,"changed");this.transcribe=s,this.send=l,this.report=f,this.changed=c}get busy(){return this.pumpingEpoch!==null||this.recordings.length>0||this.transcripts.length>0}speechStarted(){this.hearing=!0,this.changed()}speechEnded(s){this.hearing=!1,this.recordings.push(s),this.changed(),this.pump()}speechDiscarded(){this.hearing=!1,this.changed(),this.pump()}reset(){var s;this.epoch++,(s=this.active)==null||s.abort(),this.active=null,this.recordings=[],this.transcripts=[],this.hearing=!1,this.pumpingEpoch=null,this.changed()}pump(){const s=this.epoch;this.pumpingEpoch!==s&&(this.pumpingEpoch=s,this.changed(),(async()=>{try{for(;this.recordings.length&&s===this.epoch;){const f=this.recordings.shift(),c=new AbortController;this.active=c;try{const g=(await this.transcribe(f,c.signal)).trim();s===this.epoch&&g&&this.transcripts.push(g)}catch(g){if(s===this.epoch&&!c.signal.aborted)throw g}finally{this.active===c&&(this.active=null),s===this.epoch&&this.changed()}}if(s!==this.epoch||this.hearing||this.recordings.length||!this.transcripts.length)return;const l=this.transcripts.join(" ").trim();this.transcripts=[],this.changed(),l&&await this.send(l)}catch(l){s===this.epoch&&this.report(l)}finally{this.pumpingEpoch===s&&(this.pumpingEpoch=null,this.changed(),s===this.epoch&&!this.hearing&&(this.recordings.length||this.transcripts.length)&&this.pump())}})())}}const ph=2e3;class mh{constructor(s=ph){ne(this,"tail",Promise.resolve());ne(this,"_active",!1);ne(this,"_flushing",!1);ne(this,"epoch",0);ne(this,"timeoutMs");ne(this,"invalid",new WeakSet);this.timeoutMs=s}get acceptsCallbacks(){return this._active||this._flushing}pause(s){if(this.invalid.has(s))return Promise.reject(new Error("VAD transition is invalidated."));const l=this.epoch;return this._active=!1,this.enqueue(async()=>{l===this.epoch&&await this.withTimeout(s,s.pause(),"pause")})}start(s){if(this.invalid.has(s))return Promise.reject(new Error("VAD transition is invalidated."));const l=this.epoch;return this.enqueue(async()=>{l===this.epoch&&(await this.withTimeout(s,s.start(),"start"),l===this.epoch&&(this._active=!0))})}flush(s){if(this.invalid.has(s))return Promise.reject(new Error("VAD transition is invalidated."));const l=this.epoch;return this.enqueue(async()=>{if(l===this.epoch){this._flushing=!0;try{await this.withTimeout(s,s.pause(),"pause"),await this.withTimeout(s,s.start(),"start"),l===this.epoch&&(this._active=!0)}finally{l===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(s){return this.invalid.has(s)}enqueue(s){const l=this.tail.then(s,s);return this.tail=l.catch(()=>{}),l}withTimeout(s,l,f){return new Promise((c,g)=>{const x=globalThis.setTimeout(()=>{this.invalidate(s),g(new Error(`VAD ${f} timed out.`))},this.timeoutMs);l.then(()=>{globalThis.clearTimeout(x),c()},C=>{globalThis.clearTimeout(x),g(C)})})}invalidate(s){this.invalid.add(s),this.epoch++,this.tail=Promise.resolve(),this._active=!1,this._flushing=!1}}function vh(u,s,l,f,c,g){return u===s&&l===f&&!c&&g}const gh=10,yh=2;function wh(u){const s=u.trim().replace(/["'“”‘’«»)\]}]+$/u,"").trimEnd();return/[.?!]$/.test(s)?!/(\.\.|…)$/.test(s):!1}function Sh(u){return u.split(/\s+/).filter(s=>/[\p{L}\p{N}]/u.test(s)).length}function kh(u){const{text:s,resultRevision:l,revision:f,quietFrames:c}=u;return s===void 0||l!==f||c<gh?!1:wh(s)&&Sh(s)>=yh}const Hs=.45,Ku=.3,Ff=160,Lf=320,Io=700,Af=300,Of=2e3,Lu=100;function Qu(u){if(!Number.isFinite(u))return Io;const s=Math.round(u/Lu)*Lu;return Math.min(Of,Math.max(Af,s))}function xh(u=Io){return{positiveSpeechThreshold:Hs,negativeSpeechThreshold:Ku,minSpeechMs:Ff,preSpeechPadMs:Lf,redemptionMs:Qu(u)}}const Eh=350,_h=20;class Ch{constructor(s,l,f=()=>{}){ne(this,"preRoll",[]);ne(this,"current",null);ne(this,"segments",new Set);ne(this,"ended",new WeakMap);ne(this,"request");ne(this,"preview");ne(this,"endpoint");ne(this,"speechThreshold",Hs);this.request=s,this.preview=l,this.endpoint=f}frame(s,l){const f=l.slice(),c=this.current;if(!c){this.preRoll.push(f),this.preRoll.length>14&&this.preRoll.shift();return}c.frames.push(f),s>=this.speechThreshold?(c.revision++,c.quiet=0):c.quiet++;const g=c.confirmed&&c.overActiveTurn&&c.requested===-1&&c.confirmedAt!==null&&c.frames.length-c.confirmedAt>=_h;c.confirmed&&!c.pending&&c.requested!==c.revision&&(g||c.quiet>=6||c.frames.length-c.lastRequest>=63)&&this.speculate(c),this.checkEndpoint(c)}begin(s=!1){const l={frames:this.preRoll,revision:1,quiet:0,confirmed:!1,requested:-1,lastRequest:0,controller:new AbortController,endpointed:!1,overActiveTurn:s,confirmedAt:null};this.preRoll=[],this.current=l,this.segments.add(l),this.preview("")}confirm(){this.current&&(this.current.confirmed=!0,this.current.confirmedAt=this.current.frames.length)}end(s){this.current&&this.ended.set(s,this.current),this.current=null,this.preRoll=[]}async finish(s,l){var g;const f=this.ended.get(s);if(this.ended.delete(s),!f)return this.request(s,l);const c=()=>f.controller.abort(l.reason);l.addEventListener("abort",c,{once:!0}),l.aborted&&c();try{const x=f.pending;return x&&!await Nh(x,Eh,l)&&f.controller.abort(new DOMException("Speculative transcription timed out.","AbortError")),l.throwIfAborted(),((g=f.result)==null?void 0:g.revision)===f.revision&&f.result.text.trim()?f.result.text:await this.request(s,l)}finally{l.removeEventListener("abort",c),this.segments.delete(f)}}discard(){this.current&&(this.current.controller.abort(),this.segments.delete(this.current)),this.current=null,this.preRoll=[],this.preview("")}reset(){for(const s of this.segments)s.controller.abort();this.segments.clear(),this.ended=new WeakMap,this.discard()}samples(s){const l=new Float32Array(s.frames.reduce((c,g)=>c+g.length,0));let f=0;for(const c of s.frames)l.set(c,f),f+=c.length;return l}checkEndpoint(s){var l,f;s.endpointed||this.current!==s||!s.confirmed||kh({text:(l=s.result)==null?void 0:l.text,resultRevision:(f=s.result)==null?void 0:f.revision,revision:s.revision,quietFrames:s.quiet})&&(s.endpointed=!0,this.endpoint())}speculate(s){const l=s.revision;s.requested=l,s.lastRequest=s.frames.length,s.pending=this.request(this.samples(s),s.controller.signal).then(f=>{s.controller.signal.aborted||(s.result={revision:l,text:f},this.current===s&&(this.preview(f),this.checkEndpoint(s)))}).catch(()=>{}).finally(()=>{s.pending=void 0})}}function Nh(u,s,l){return new Promise((f,c)=>{if(l.aborted)return c(l.reason);const g=globalThis.setTimeout(M,s),x=()=>{j(),c(l.reason)},C=()=>{j(),f(!0)};function M(){j(),f(!1)}function j(){globalThis.clearTimeout(g),l.removeEventListener("abort",x)}l.addEventListener("abort",x,{once:!0}),u.then(C,C)})}const Au=new Set(["um","uh","uhm","erm","hmm","mm","mhm","ah","oh"]),pf=2,Ph=1200,Th=700;function Ou(u){return[...u.toLocaleLowerCase().matchAll(/[\p{L}\p{N}]+(?:['’\-][\p{L}\p{N}]+)*/gu)].map(s=>s[0])}function Rh(u){return Ou(u).filter(s=>!Au.has(s))}function jh(u,s,l,f){let c=0;for(let g=0;g<u.length;g++)if(u[g]!==s[l+g]&&(c++,c>f))return!1;return!0}function Mh(u,s){let l=null;for(let f=0;f<u.length;f++)for(let c=u.length;c>f;c--){const g=c-f;if(l&&g<=l.end-l.start)break;if(g<2||g>s.length)continue;const x=Math.floor(g/4),C=u.slice(f,c);let M=!1;for(let j=0;j<=s.length-g;j++)if(jh(C,s,j,x)){M=!0;break}if(M){l={start:f,end:c};break}}return l}function Fh(u,s){const l=Ou(u);if(l.filter(g=>!Au.has(g)).length<pf)return{echo:!1,meaningful:!1};const c=Ou(s);if(c.length){const g=Mh(l,c);if(g&&l.filter((C,M)=>(M<g.start||M>=g.end)&&!Au.has(C)).length<pf)return{echo:!0,meaningful:!1}}return{echo:!1,meaningful:!0}}function zu(u,s){return Fh(u,s).meaningful}const Lh=["stop","wait","hold on","hang on","pause","shut up","enough"],Ah=Lh.map(u=>new RegExp(`\\b${u.replace(/ /g,"\\s+")}\\b`,"iu"));function zf(u,s){for(const l of Ah){if(!l.test(u)||l.test(s))continue;const f=new RegExp(l.source,`${l.flags}g`),c=u.replace(f," ").replace(/\s+/gu," ").trim().replace(/^[\s,.;:!?—-]+/u,"");return{remainder:Rh(c).length?c:""}}return null}function mf(u,s){return zf(u,s)!==null}function Df(u){return Math.max(.2,u.trim().length/15)}const Oh=1500,zh=300,Dh=1e4;function vf(u,s,l){const f=u.filter(c=>l-(c.startedAt+c.seconds*1e3)<Dh);return f.push({text:s,startedAt:l,seconds:Df(s)}),f}function Ih(u,s,l){const f=s-Oh,c=l+zh;return u.filter(g=>g.startedAt+g.seconds*1e3>=f&&g.startedAt<=c).map(g=>g.text).join(" ")}const Uh=8,Vh=2.5;function Bh(u,s){return s===null?!1:u<s*Vh}class $h{constructor(s=()=>Date.now()){ne(this,"mode","idle");ne(this,"interruptOnConfirm",!1);ne(this,"interrupted",!1);ne(this,"startedAt",0);ne(this,"wordPathBlockedFlag",!1);ne(this,"now");this.now=s}get idle(){return this.mode==="idle"}get wordPathBlocked(){return this.wordPathBlockedFlag}blockWordPath(){(this.mode==="candidate"||this.mode==="accepted")&&(this.wordPathBlockedFlag=!0)}speechStart(s){return this.mode="candidate",this.interruptOnConfirm=s,this.interrupted=!1,this.wordPathBlockedFlag=!1,this.startedAt=this.now(),{duck:s,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(s,l){return this.mode!=="accepted"||!this.interruptOnConfirm||this.interrupted?!1:mf(s,l)?(this.interrupted=!0,!0):this.wordPathBlockedFlag?!1:zu(s,l)?(this.interrupted=!0,!0):!1}speechEnd(s,l,f){const c=this.mode==="accepted",g=this.wordPathBlockedFlag;return c?!this.interruptOnConfirm||this.interrupted?(this.reset(),{accepted:!0,interrupt:!1,send:!0,deferDecision:!1,wordPathBlocked:g}):f?mf(s,l)||!g&&zu(s,l)?(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 Pu(u,s,l,f){return async c=>{c.throwIfAborted();const g=s.createAnalyser();g.fftSize=128,g.connect(l);const x=s.createGain();x.connect(g);const C=s.createBufferSource();C.buffer=u,C.connect(x),await new Promise((M,j)=>{const B=()=>{C.disconnect(),x.disconnect(),g.disconnect()},z=()=>{C.onended=null;const O=s.currentTime;x.gain.cancelScheduledValues(O),x.gain.setValueAtTime(x.gain.value,O),x.gain.linearRampToValueAtTime(0,O+Zr);try{C.stop(O+Zr)}catch{}setTimeout(B,Zr*1e3+20),j(c.reason)};C.onended=()=>{c.removeEventListener("abort",z),B(),M()},c.addEventListener("abort",z,{once:!0}),C.start(),f(g),c.aborted&&z()})}}const Wh=.1,Hh=.02,Kh=.5,Qh=.3,Zr=.005;function qh(){return{nextTime:0,started:!1,underrunLead:Hh,restarted:!1}}function bh(u,s,l){let f,c;return u.started?u.nextTime<s?(f=s+u.underrunLead,u.underrunLead=Math.min(Kh,u.underrunLead*2),c=!0):(f=u.nextTime,c=!1):(f=s+Wh,c=!0),u.started=!0,u.restarted=c,u.nextTime=f+l,f}function Gh(u,s){return u.reduce((l,f)=>l+f.length,0)/s}function Yh(u,s){return u>=Qh}function Jh(u,s,l,f){return u.started&&!f&&u.nextTime<s&&l<u.underrunLead}async function Xh(u,s,l,f,c,g){const x=u.getReader(),C=[];let M=null,j=!1,B=0,z=null;const O=()=>{const I=z;z=null,I==null||I()},V=()=>{x.cancel().catch(()=>{})};g.addEventListener("abort",V,{once:!0});const Y=I=>{let q=I;M!==null&&(q=new Uint8Array(I.length+1),q[0]=M,q.set(I,1),M=null),q.length%2&&(M=q[q.length-1],q=q.subarray(0,q.length-1));const U=new DataView(q.buffer,q.byteOffset,q.byteLength),re=new Float32Array(q.length/2);for(let me=0;me<re.length;me++){const ke=U.getInt16(me*2,!0);re[me]=ke<0?ke/32768:ke/32767}return re};let ee,N;const Q=new Promise((I,q)=>{ee=I,N=q}),$=(async()=>{try{for(;;){const{done:I,value:q}=await x.read();if(I)break;if(!(q!=null&&q.length))continue;const U=Y(q);U.length&&(B+=U.length,C.push(U),Yh(B/s,!1)&&ee(),O())}if(!B)throw new Error("The speech server sent no audio");return B/s}finally{j=!0,g.removeEventListener("abort",V),O()}})();$.catch(I=>N(I)),$.then(()=>ee(),()=>{}),await Q;const ye=(async I=>{I.throwIfAborted();const q=l.createAnalyser();q.fftSize=128,q.connect(f);const U=l.createGain();U.connect(q);const re=new Set,me=qh();let ke=!1;try{await new Promise((K,_e)=>{const Ge=()=>{j&&!C.length&&!re.size&&K()},et=()=>{if(I.aborted)return;const Ue=l.currentTime,Ve=Gh(C,s);if(C.length&&!Jh(me,Ue,Ve,j)){const Ne=C.reduce((se,ue)=>se+ue.length,0),W=l.createBuffer(1,Ne,s),le=W.getChannelData(0);let H=0;for(const se of C.splice(0))le.set(se,H),H+=se.length;const y=l.createBufferSource();y.buffer=W,y.connect(U);const R=bh(me,Ue,W.duration);me.restarted&&(U.gain.cancelScheduledValues(R),U.gain.setValueAtTime(0,R),U.gain.linearRampToValueAtTime(1,R+Zr)),y.start(R),re.add(y),y.onended=()=>{re.delete(y),y.disconnect(),Ge()},ke||(ke=!0,c(q))}Ge(),(!j||C.length)&&(z=et)},qe=()=>{z=null;const Ue=l.currentTime;U.gain.cancelScheduledValues(Ue),U.gain.setValueAtTime(U.gain.value,Ue),U.gain.linearRampToValueAtTime(0,Ue+Zr);for(const Ve of re){Ve.onended=null;try{Ve.stop(Ue+Zr)}catch{}}re.clear(),V(),_e(I.reason)};I.addEventListener("abort",qe,{once:!0}),et()}),U.disconnect(),q.disconnect()}catch(K){throw setTimeout(()=>{try{U.disconnect()}catch{}try{q.disconnect()}catch{}},Zr*1e3+20),K}});return ye.completed=$,ye}const Zh=300;class ep{constructor(s,l,f){ne(this,"run",this.fresh());ne(this,"synthesize");ne(this,"changed");ne(this,"reportError");this.synthesize=s,this.changed=l,this.reportError=f}get busy(){const s=this.run;return s.held||s.generating||s.playing!==null||s.text.length>0||s.audio.length>0}enqueue(s){this.run.text.push(...s),this.pump(this.run)}hold(){const s=this.run;if(s.held||!(s.playing!==null||s.generating||s.audio.length>0))return!1;const f=s.audio.map(c=>c.text);return s.audio=[],s.text=[...f,...s.text],s.playing=null,s.generating=!1,s.held=!0,s.controller.abort(),s.controller=new AbortController,this.changed(),!0}resume(s){const l=this.run;l.held&&(l.held=!1,s.trim()&&l.text.unshift(s),this.pump(l))}cancel(){const s=this.run;this.run=this.fresh(),s.text=[],s.audio=[],s.controller.abort(),this.changed()}fresh(){return{controller:new AbortController,text:[],audio:[],hasDispatchedSpeech:!1,generating:!1,playing:null,held:!1}}fail(s,l){s!==this.run||s.controller.signal.aborted||s.held||(this.cancel(),this.reportError(l))}pump(s){if(s!==this.run||s.controller.signal.aborted)return;if(s.held){this.changed();return}const l=s.controller.signal;if(!s.playing&&s.audio.length){const f=s.audio.shift();s.playing=f.text,(async()=>{try{await f.prepared(l)}catch(c){this.fail(s,c)}finally{s.playing=null,s===this.run&&this.pump(s)}})()}if(!s.generating&&s.audio.length<2&&s.text.length){let f=s.text.shift();if(s.hasDispatchedSpeech)for(;s.text.length&&f.length+s.text[0].length+1<=Zh;)f+=` ${s.text.shift()}`;s.hasDispatchedSpeech=!0,s.generating=!0,(async()=>{var c;try{const g=await this.synthesize(f,l);s===this.run&&!l.aborted&&s.audio.push({text:f,prepared:g}),(c=g.completed)==null||c.catch(x=>this.fail(s,x))}catch(g){this.fail(s,g)}finally{s.generating=!1,s===this.run&&this.pump(s)}})()}this.changed()}}const tp=/[.!?]\s+/g;function np(u){const s=[0];for(const l of u.matchAll(tp)){const f=l.index+l[0].length;f<u.length&&s.push(f)}return s}const rp=.98;function op(u,s){const l=u.trim();if(!l||!Number.isFinite(s)||s>=rp)return"";const f=Math.max(0,Math.min(1,s)),c=Math.round(f*l.length),g=np(l);let x=g[0];for(const C of g)if(C<=c)x=C;else break;return l.slice(x).trim()}const ip=1500,sp=400;async function lp(u,s,l,f=fetch){if(!s.trim())return"";const c=new AbortController,g=setTimeout(()=>c.abort(),ip);try{const x=await f("/api/voice/bridge",{method:"POST",headers:{"Content-Type":"application/json",...l},body:JSON.stringify({said:u.slice(-sp),resume:s}),signal:c.signal});if(!x.ok)return"";const C=await x.json().catch(()=>({}));return typeof(C==null?void 0:C.bridge)=="string"?C.bridge:""}catch{return""}finally{clearTimeout(g)}}function up(u,s){const l=u.trim();return l?`${l} ${s}`:s}const ap="modulepreload",cp=function(u){return"/"+u},gf={},If=function(s,l,f){let c=Promise.resolve();if(l&&l.length>0){let x=function(j){return Promise.all(j.map(B=>Promise.resolve(B).then(z=>({status:"fulfilled",value:z}),z=>({status:"rejected",reason:z}))))};document.getElementsByTagName("link");const C=document.querySelector("meta[property=csp-nonce]"),M=(C==null?void 0:C.nonce)||(C==null?void 0:C.getAttribute("nonce"));c=x(l.map(j=>{if(j=cp(j),j in gf)return;gf[j]=!0;const B=j.endsWith(".css"),z=B?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${j}"]${z}`))return;const O=document.createElement("link");if(O.rel=B?"stylesheet":ap,B||(O.as="script"),O.crossOrigin="",O.href=j,M&&O.setAttribute("nonce",M),document.head.appendChild(O),B)return new Promise((V,Y)=>{O.addEventListener("load",V),O.addEventListener("error",()=>Y(new Error(`Unable to preload CSS for ${j}`)))})}))}function g(x){const C=new Event("vite:preloadError",{cancelable:!0});if(C.payload=x,window.dispatchEvent(C),!C.defaultPrevented)throw x}return c.then(x=>{for(const C of x||[])C.status==="rejected"&&g(C.reason);return s().catch(g)})},Du="/voice-assets/",fp=["silero_vad_v5.onnx","vad.worklet.bundle.min.js","ort-wasm-simd-threaded.mjs","ort-wasm-simd-threaded.wasm"];let Tu=null;function Uf(){return Tu??(Tu=If(()=>import("./index-CeWj4ejR.js").then(u=>u.i),__vite__mapDeps([0,1])).catch(u=>{throw Tu=null,u})),Tu}let yf=!1;function dp(){if(!yf){yf=!0,Uf().catch(()=>{});for(const u of fp)fetch(`${Du}${u}`,{priority:"low"}).then(s=>s.ok?s.arrayBuffer():void 0).catch(()=>{})}}const Vf="voice-assistant.vad-redemption-ms";function Bf(u){return typeof window>"u"?void 0:window.localStorage}function Ru(u){var s;try{const l=(s=Bf(u))==null?void 0:s.getItem(Vf);if(l==null)return Io;const f=Number(l);return Number.isFinite(f)?Qu(f):Io}catch{return Io}}function hp(u,s){var f;const l=Qu(u);try{(f=Bf(s))==null||f.setItem(Vf,String(l))}catch{}return l}const Iu=512,Uu=16e3,pp=2e4,mp={frameSamples:Iu,sampleRate:Uu,positiveSpeechThreshold:Hs,negativeSpeechThreshold:Ku,minSpeechMs:Ff,redemptionMs:Io,preSpeechPadMs:Lf,maxSpeechMs:pp,noiseFloorWindowFrames:100,noiseFloorPercentile:.3,noiseFloorMarginDb:6,noiseFloorRangeDb:24,minFloorRms:.0015,submitUserSpeechOnPause:!1};function vp(u){let s=0;for(let l=0;l<u.length;l++)s+=u[l]*u[l];return Math.sqrt(s/Math.max(1,u.length))}function wf(u){return 20*Math.log10(Math.max(u,1e-8))}function gp(u){return Math.min(1,Math.max(0,u))}function yp(u){const s=u.reduce((c,g)=>c+g.length,0),l=new Float32Array(s);let f=0;for(const c of u)l.set(c,f),f+=c.length;return l}class wp{constructor(s={}){ne(this,"options");ne(this,"msPerFrame");ne(this,"minSpeechFrames",1);ne(this,"redemptionFrames",1);ne(this,"preSpeechPadFrames",0);ne(this,"maxSpeechFrames",1);ne(this,"state","silence");ne(this,"ring",[]);ne(this,"recorded",[]);ne(this,"activeFrames",0);ne(this,"silenceFrames",0);ne(this,"noiseFloorSamples",[]);ne(this,"active",!0);this.options={...mp,...s},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(s){this.options={...this.options,...s},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 s=[];return this.state==="speech"?s.push({type:"speech-end",samples:yp(this.recorded)}):this.state==="maybe"&&s.push({type:"misfire"}),this.reset(),s}process(s){if(!this.active)return{probability:0,events:[]};const l=vp(s);this.state==="silence"&&this.pushNoiseFloorSample(l);const f=this.estimateNoiseFloor(),c=gp((wf(l)-wf(f)-this.options.noiseFloorMarginDb)/this.options.noiseFloorRangeDb),g=[];if(this.state==="silence")return this.pushRing(s),c>=this.options.positiveSpeechThreshold&&(this.state="maybe",this.recorded=[...this.ring],this.activeFrames=1,this.silenceFrames=0,g.push({type:"speech-start"})),{probability:c,events:g};this.recorded.push(s),c>=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 C=this.recorded.length>=this.maxSpeechFrames,M=this.silenceFrames>=this.redemptionFrames;return(C||M)&&g.push(...this.endSegment()),{probability:c,events:g}}pushRing(s){this.ring.push(s),this.ring.length>this.preSpeechPadFrames&&this.ring.shift()}pushNoiseFloorSample(s){this.noiseFloorSamples.push(s),this.noiseFloorSamples.length>this.options.noiseFloorWindowFrames&&this.noiseFloorSamples.shift()}estimateNoiseFloor(){if(this.noiseFloorSamples.length===0)return this.options.minFloorRms;const s=[...this.noiseFloorSamples].sort((f,c)=>f-c),l=Math.min(s.length-1,Math.floor(s.length*this.options.noiseFloorPercentile));return Math.max(this.options.minFloorRms,s[l])}}class Sp{constructor(s,l,f){ne(this,"inputBuffer",[]);this.nativeSampleRate=s,this.targetSampleRate=l,this.targetFrameSize=f}process(s){const l=[];for(const f of s)for(this.inputBuffer.push(f);this.hasEnoughDataForFrame();)l.push(this.generateOutputFrame());return l}hasEnoughDataForFrame(){return this.inputBuffer.length*this.targetSampleRate/this.nativeSampleRate>=this.targetFrameSize}generateOutputFrame(){const s=new Float32Array(this.targetFrameSize);let l=0,f=0;for(;l<this.targetFrameSize;){let c=0,g=0;const x=Math.min(this.inputBuffer.length,(l+1)*this.nativeSampleRate/this.targetSampleRate);for(;f<x;){const C=this.inputBuffer[f];C!==void 0&&(c+=C,g++),f++}s[l]=g>0?c/g:0,l++}return this.inputBuffer=this.inputBuffer.slice(f),s}}const kp=`
|
|
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 qu{constructor(s){ne(this,"options");ne(this,"processor");ne(this,"initState","uninitialized");ne(this,"stream",null);ne(this,"sourceNode",null);ne(this,"workletNode",null);ne(this,"scriptNode",null);ne(this,"workletModuleUrl",null);ne(this,"listening",!1);ne(this,"handleFrame",s=>{const l=this.processor.process(s);this.options.onFrameProcessed({isSpeech:l.probability,notSpeech:1-l.probability},s);for(const f of l.events)this.dispatch(f)});ne(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(s){throw this.initState="errored",s}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}});ne(this,"pause",async()=>{if(!this.listening)return;this.listening=!1;const s=this.processor.pause();for(const l of s)this.dispatch(l);this.stream&&this.options.pauseStream&&await this.options.pauseStream(this.stream),this.detachAudioGraph()});ne(this,"destroy",async()=>{this.initState!=="destroyed"&&(this.listening&&await this.pause(),this.initState="destroyed",this.workletModuleUrl&&(URL.revokeObjectURL(this.workletModuleUrl),this.workletModuleUrl=null))});ne(this,"setOptions",s=>{this.processor.setOptions(s)});this.options=s,this.processor=new wp({positiveSpeechThreshold:s.positiveSpeechThreshold,negativeSpeechThreshold:s.negativeSpeechThreshold,minSpeechMs:s.minSpeechMs,preSpeechPadMs:s.preSpeechPadMs,redemptionMs:s.redemptionMs,maxSpeechMs:s.maxSpeechMs,submitUserSpeechOnPause:s.submitUserSpeechOnPause??!1})}static async new(s){return new qu(s)}dispatch(s){switch(s.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(s.samples);return}}async attachAudioGraph(){const s=this.options.audioContext,l=this.stream;if(!l)throw new Error("Energy VAD has no active microphone stream.");if(this.sourceNode=new MediaStreamAudioSourceNode(s,{mediaStream:l}),this.canUseAudioWorklet(s))try{await this.attachAsWorklet(s),this.sourceNode.connect(this.workletNode);return}catch{this.workletNode=null}this.attachAsScriptProcessor(s),this.sourceNode.connect(this.scriptNode)}canUseAudioWorklet(s){return"audioWorklet"in s&&typeof AudioWorkletNode=="function"}async attachAsWorklet(s){if(!this.workletModuleUrl){const l=new Blob([kp],{type:"application/javascript"});this.workletModuleUrl=URL.createObjectURL(l)}await s.audioWorklet.addModule(this.workletModuleUrl),this.workletNode=new AudioWorkletNode(s,"energy-vad-worklet-processor",{numberOfInputs:1,numberOfOutputs:0,channelCount:1,processorOptions:{targetSampleRate:Uu,targetFrameSize:Iu}}),this.workletNode.port.onmessage=l=>{this.handleFrame(l.data)}}attachAsScriptProcessor(s){const l=new Sp(s.sampleRate,Uu,Iu),c=s.createScriptProcessor(4096,1,1);let g=!1;c.onaudioprocess=x=>{if(!g){g=!0;try{const C=x.inputBuffer.getChannelData(0);x.outputBuffer.getChannelData(0).fill(0);for(const j of l.process(C))this.handleFrame(j)}finally{g=!1}}},c.connect(s.destination),this.scriptNode=c}detachAudioGraph(){var s;(s=this.sourceNode)==null||s.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 $s=["One moment.","Checking now.","Still on it.","Just a second.","Working on it."],xp=1500,Ep=6e3,_p=4e3,Cp=500;function Np(){return{turnActive:!1,hasSpokenThisTurn:!1,lastCueAt:null,lastCueText:null}}function Pp(u){return{turnActive:!0,hasSpokenThisTurn:!1,lastCueAt:null,lastCueText:null}}function Sf(u){return{...u,turnActive:!1}}function Tp(u){return u.hasSpokenThisTurn?u:{...u,hasSpokenThisTurn:!0}}function Rp(u,s,l){return{...u,lastCueAt:l,lastCueText:s}}function jp(u,s,l){return!(!u.turnActive||!u.hasSpokenThisTurn||s<xp||u.lastCueAt!==null&&l-u.lastCueAt<Ep)}function Mp(u,s=Math.random){const l=u.lastCueText?$s.filter(c=>c!==u.lastCueText):$s,f=l.length?l:$s;return f[Math.min(f.length-1,Math.floor(s()*f.length))]}function $f(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 Fp(u,s){let l=!1,f=!1,c=0,g=!1;for(let x=0;x<u.length;x++){if(u.startsWith("```",x)){l=!l,x+=2;continue}if(l)continue;if(u[x]==="`"){f=!f;continue}if(f)continue;if(u[x]==="["&&c++,u[x]==="]"&&(c=Math.max(0,c-1),u[x+1]==="("&&(g=!0)),g){u[x]===")"&&(g=!1);continue}if(c)continue;const M=(/[.!?。!?]/.test(u[x])||s&&/[,;:,;:]/.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)),B=s?48:160;if(M&&!j||u[x]===`
|
|
79
|
+
`||u[x]==="—"||x>=B&&/\s/.test(u[x]))return x+1}return 0}function Lp(u,s,l){var c;let f=0;for(;f<u.length;){const g=Fp(u.slice(f),l)||(s?u.length-f:0);if(!g)return 0;f+=g;const x=((c=$f(u.slice(0,f).replace(/—/g," ")).match(/[\p{L}\p{N}]+(?:['’\-][\p{L}\p{N}]+)*/gu))==null?void 0:c.length)??0,C=/[.!?。!?]["'”’)\]]*\s*$/.test(u.slice(0,f));if(x>(l&&C?1:3)||s&&f===u.length)return f}return 0}function ju(u,s=!1,l=!1){const f=[];let c=0,g=l;for(;c<u.length;){const x=Lp(u.slice(c),s,g);if(!x)break;const C=$f(u.slice(c,c+x).replace(/—$/,"").replace(/—/g,", "));C&&(f.push(C),g=!1),c+=x}return{chunks:f,rest:s?"":u.slice(c)}}function Vs(u,s,l){return u||s||l}function Ap(u){const s=new ArrayBuffer(44+u.length*2),l=new DataView(s),f=(c,g)=>[...g].forEach((x,C)=>l.setUint8(c+C,x.charCodeAt(0)));return f(0,"RIFF"),l.setUint32(4,36+u.length*2,!0),f(8,"WAVEfmt "),l.setUint32(16,16,!0),l.setUint16(20,1,!0),l.setUint16(22,1,!0),l.setUint32(24,16e3,!0),l.setUint32(28,32e3,!0),l.setUint16(32,2,!0),l.setUint16(34,16,!0),f(36,"data"),l.setUint32(40,u.length*2,!0),u.forEach((c,g)=>l.setInt16(44+g*2,Math.max(-1,Math.min(1,c))*(c<0?32768:32767),!0)),new Blob([s],{type:"audio/wav"})}function Vu(){const u=globalThis.crypto;if(u&&typeof u.randomUUID=="function")return u.randomUUID();const s=new Uint8Array(16);if(u)u.getRandomValues(s);else for(let l=0;l<s.length;l+=1)s[l]=Math.floor(Math.random()*256);return Array.from(s,l=>l.toString(16).padStart(2,"0")).join("")}const Wf="meldivo.token",Op="meldivo.token";let zo;function zp(){try{window.localStorage.removeItem(Op)}catch{}const s=new URLSearchParams(window.location.hash.replace(/^#/,"")).get("token");if(s){try{window.sessionStorage.setItem(Wf,s)}catch{}zo=s;try{window.history.replaceState(null,"",`${window.location.pathname}${window.location.search}`)}catch{}}}function Dp(){if(zo!==void 0)return zo;try{zo=window.sessionStorage.getItem(Wf)}catch{zo=null}return zo}function Fe(){const u=Dp();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 Ip="voice-assistant-microphone",Bu="voice-assistant-microphone-owner",Up=15e3,Vp=5e3,Bp=5e3;function Bs(){try{const u=window.localStorage.getItem(Bu);if(!u)return null;const s=JSON.parse(u);return typeof s.id!="string"||typeof s.expiresAt!="number"?null:{id:s.id,expiresAt:s.expiresAt}}catch{return null}}function $p(){var x;const u=Vu(),s=Date.now(),l=Bs();if(l&&l.expiresAt>s)return null;const f=()=>window.localStorage.setItem(Bu,JSON.stringify({id:u,expiresAt:Date.now()+Up}));try{if(f(),((x=Bs())==null?void 0:x.id)!==u)return null}catch{return{release:()=>{}}}let c=!1;const g=window.setInterval(()=>{var C;c||((C=Bs())==null?void 0:C.id)!==u||f()},Vp);return{release:()=>{var C;if(!c){c=!0,window.clearInterval(g);try{((C=Bs())==null?void 0:C.id)===u&&window.localStorage.removeItem(Bu)}catch{}}}}}async function Wp(){let u,s,l;const f=new Promise((g,x)=>{s=g,l=x}),c=new Promise(g=>{u=g});return navigator.locks.request(Ip,{mode:"exclusive",ifAvailable:!0},async g=>{if(!g){s(null);return}let x=!1;s({release:()=>{x||(x=!0,u())}}),await c}).catch(l),f}async function Hp(u){const s=await fetch("/api/voice/lease",{method:"POST",headers:Fe()});if(s.status===409)return null;if(!s.ok)throw new Error("Could not reserve the voice session.");const l=await s.json();if(typeof l.token!="string"||l.token.length<16)throw new Error("Voice session returned an invalid lease.");let f=!1;const c=()=>{f||(f=!0,window.clearInterval(g),fetch("/api/voice/lease",{method:"DELETE",headers:{"Content-Type":"application/json",...Fe()},body:JSON.stringify({token:l.token}),keepalive:!0}).catch(()=>{}))},g=window.setInterval(()=>{fetch("/api/voice/lease/heartbeat",{method:"POST",headers:{"Content-Type":"application/json",...Fe()},body:JSON.stringify({token:l.token})}).then(x=>{x.status===409&&(c(),u())}).catch(()=>{})},Bp);return{release:c}}async function Kp(u=()=>{}){const s=typeof navigator<"u"&&navigator.locks?await Wp():typeof window>"u"?null:$p();if(!s)return null;try{const l=await Hp(u);return l?{release:()=>{l.release(),s.release()}}:(s.release(),null)}catch(l){throw s.release(),l}}const bu="voice-assistant.selected-voice";function Hf(u){return typeof u=="string"&&/^[A-Za-z0-9._-]{1,100}$/.test(u)}function Gu(u){return typeof window>"u"?void 0:window.localStorage}function Xr(u){var s;try{const l=(s=Gu(u))==null?void 0:s.getItem(bu);return Hf(l)?l:void 0}catch{return}}function Qp(u,s){var l;if(!Hf(u))return!1;try{return(l=Gu(s))==null||l.setItem(bu,u),!0}catch{return!1}}function kf(u){var s;try{(s=Gu(u))==null||s.removeItem(bu)}catch{}}function Kf(){return h.jsx("main",{className:"auth-screen",children:h.jsxs("p",{children:["Open the link printed by ",h.jsx("code",{children:"meldivo open"}),"."]})})}const Mu=[{x:353,y:653,w:78,h:139},{x:464,y:577,w:86,h:288},{x:584,y:493,w:86,h:430},{x:704,y:577,w:86,h:288},{x:823,y:653,w:78,h:139}],xf={loading:160,running:200,thinking:320};function qp({state:u,level:s}){const l=_.useRef([]),f=_.useRef({state:u,level:s});return f.current={state:u,level:s},_.useEffect(()=>{var M;const c=(M=window.matchMedia)==null?void 0:M.call(window,"(prefers-reduced-motion: reduce)").matches,g=Mu.map(()=>({value:.35,target:.35,next:0}));let x=0;const C=j=>{const{state:B,level:z}=f.current,O=B==="speaking"||B==="hearing";Mu.forEach((V,Y)=>{let ee;if(c)ee=.8;else if(O){const $=g[Y];j>$.next&&($.target=.35+Math.random()*(.3+z*.8),$.next=j+60+Math.random()*110),$.value+=($.target-$.value)*($.target>$.value?.55:.18),ee=$.value}else xf[B]?ee=.55+.4*Math.max(0,Math.sin(j/xf[B]-Y*.9)):B==="muted"||B==="error"?ee=.35:ee=.8+.12*Math.sin(j/700+Y*.8);const N=Math.max(V.w,V.h*Math.min(1.15,Math.max(.3,ee))),Q=l.current[Y];Q&&(Q.setAttribute("height",N.toFixed(1)),Q.setAttribute("y",(V.y+(V.h-N)/2).toFixed(1)))}),x=requestAnimationFrame(C)};return x=requestAnimationFrame(C),()=>cancelAnimationFrame(x)},[]),h.jsx("svg",{className:"voice-shape__bars",viewBox:"340 440 574 540","aria-hidden":"true",children:Mu.map((c,g)=>h.jsx("rect",{ref:x=>{l.current[g]=x},x:c.x,y:c.y,width:c.w,height:c.h,rx:c.w/2},g))})}const bp=3,Ef=420,_f=140;function Gp(){const[u,s]=_.useState([]),l=_.useRef(0),f=_.useRef(new Set);_.useEffect(()=>()=>{for(const C of f.current)window.clearTimeout(C);f.current.clear()},[]);const c=_.useCallback((C,M)=>{const j=window.setTimeout(()=>{f.current.delete(j),s(B=>B.filter(z=>!C.includes(z.id)))},M);f.current.add(j)},[]),g=_.useCallback(C=>{const j={id:++l.current,name:C.name,summary:C.summary??`Using ${C.name}`,detail:C.detail,folder:C.folder,leaving:!1,delay:0};s(B=>{const z=B.filter(V=>!V.leaving),O=new Set(z.slice(0,Math.max(0,z.length+1-bp)).map(V=>V.id));return O.size&&c([...O],Ef),[...B.map(V=>O.has(V.id)?{...V,leaving:!0,delay:0}:V),j]})},[c]),x=_.useCallback(()=>{s(C=>{const M=C.filter(j=>!j.leaving);return M.length?(c(M.map(j=>j.id),Ef+_f*M.length),C.map(j=>j.leaving?j:{...j,leaving:!0,delay:_f*M.indexOf(j)})):C})},[c]);return{items:u,push:g,clear:x}}function Yp({items:u}){return u.length?h.jsx("ol",{className:"tool-activity","aria-live":"polite","aria-label":"What the agent is doing",children:u.map(s=>h.jsxs("li",{className:`tool-activity__item${s.leaving?" tool-activity__item--leaving":""}`,style:{"--delay":`${s.delay}ms`},"aria-hidden":s.leaving||void 0,children:[h.jsxs("span",{className:"tool-activity__summary",children:[h.jsx("span",{className:"tool-activity__tool",children:s.name.replace(/^mcp__.*__/,"")}),s.summary]}),s.detail&&h.jsx("code",{className:"tool-activity__detail",title:s.detail,children:s.detail}),s.folder&&h.jsxs("span",{className:"tool-activity__folder",children:["in ",s.folder]})]},s.id))}):null}function Do(u){const s=/^@([A-Za-z0-9._-]{1,40})\/(.+)$/.exec(u);return s?{prefix:`@${s[1]}/`,host:s[1],inner:s[2]}:{prefix:"",host:"",inner:u}}const $u=["pi","opencode","claude"],Ks={pi:"Pi",opencode:"OpenCode",claude:"Claude Code"};let Cf=!1;function Nf(u){const{host:s,inner:l}=Do(u),f=s||void 0;if(l.startsWith("new:"))return{harness:l.slice(4),title:"New chat",cwd:"~",host:f};if(l==="quick")return{title:"Quick chat",cwd:"~",host:f};const c=l.indexOf(":");return c===-1?{title:l,cwd:"",host:f}:{harness:l.slice(0,c),title:l.slice(c+1),cwd:"",host:f}}function Jp(u){const s=/^(\/home\/[^/]+|\/Users\/[^/]+)(\/.*)?$/.exec(u);return s?`~${s[2]??""}`:u}function Xp(u){return`meldivo.conversation.${u}`}function Zp(u){const s=Xp(u);try{const l=window.sessionStorage.getItem(s);if(l)return l;const f=Vu();return window.sessionStorage.setItem(s,f),f}catch{return Vu()}}const em=12e3,tm=560,nm="This is a voice preview.",Qf="voice-assistant.onboarding-dismissed",rm=3e3;function ji(u){const s=/^([a-z]{2})[_-](.+)$/i.exec(u),l={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(s){const f=l[s[1].toLowerCase()];if(f)return`${ji(s[2])} — ${f}`}return u.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[._-]+/g," ").replace(/\b\w/g,f=>f.toUpperCase())}function om(){try{return window.localStorage.getItem(Qf)!=="true"}catch{return!0}}class im extends Error{constructor(){super("Another voice tab is active. Close it or stop voice there first."),this.name="VoiceOwnershipError"}}function Pf(u,s){return new Promise((l,f)=>{if(s.aborted)return f(s.reason);const c=window.setTimeout(()=>{s.removeEventListener("abort",g),l()},u),g=()=>{window.clearTimeout(c),f(s.reason)};s.addEventListener("abort",g,{once:!0})})}async function sm(u,s){if(!u.body)throw new Error("Chat response was empty.");const l=u.body.pipeThrough(new TextDecoderStream).getReader();let f="";for(;;){const{done:c,value:g}=await l.read();if(c)break;f+=g;const x=f.split(`
|
|
80
|
+
`);f=x.pop()??"";for(const C of x){if(!C.startsWith("data:"))continue;const M=C.slice(5).trim();if(!M)continue;let j;try{j=JSON.parse(M)}catch{continue}if(s(j),j.type==="done")return}}}function lm({sessionKey:u,folder:s}){var ti;const[l,f]=_.useState("idle"),[c,g]=_.useState(0),[x,C]=_.useState(""),M=_.useRef(l),j=_.useRef(!0),B=_.useRef(!1),z=_.useRef(!1),O=_.useRef(!1),V=_.useRef(!1),Y=_.useRef(null),ee=_.useRef(null),N=_.useRef(null),Q=_.useRef(null),$=_.useRef(null),ye=_.useRef(!1),I=_.useRef(null),q=_.useRef(null),U=_.useRef(null),re=_.useRef(new mh),me=_.useRef(0),ke=_.useRef(0),K=_.useRef(null),_e=_.useRef(null),Ge=_.useRef(0),et=_.useRef(Zp(s?`${u}|${s}`:u)),qe=_.useRef(u),Ue=_.useRef(null),Ve=_.useRef(Nf(u).harness),Ne=_.useRef(0),W=_.useRef(0),le=_.useRef(null),H=_.useRef(""),y=_.useRef(""),R=_.useRef(null),se=_.useRef(new $h),ue=_.useRef(""),pe=_.useRef(0),we=_.useRef([]),ve=_.useRef(""),xe=_.useRef(null),Te=_.useRef(0),it=_.useRef(0),Gn=_.useRef(!1),Nr=_.useRef(null),Lt=_.useRef(null),Ht=_.useRef(!1),Yn=_.useRef(null),ut=_.useRef(Np()),Pr=_.useRef(new Map),vn=_.useRef(null),Jn=_.useRef(null),gn=_.useRef(null),At=_.useRef(null),Fn=_.useRef(0),Xn=_.useRef({}),Zn=_.useRef(),[Ot,eo]=_.useState(null),[at,er]=_.useState(!1),[to,Tr]=_.useState([]),[yn,Qs]=_.useState(""),[gt,no]=_.useState(()=>Xr()??""),[Fi,Rr]=_.useState(()=>Xr()??""),[ro,Uo]=_.useState(()=>Ru()),[yt,Vo]=_.useState({ready:!0,downloading:!1}),[_t,Ln]=_.useState(()=>{const p=Nf(u);return s&&Do(u).inner.startsWith("new:")?{...p,cwd:Jp(s)}:p}),[Li,Bo]=_.useState(!1),[$o,An]=_.useState(""),jr=Gp(),[Wo,tr]=_.useState(!1),[nr,oo]=_.useState(""),[On,Ai]=_.useState(!1),[rr,Ct]=_.useState(""),[Mr,or]=_.useState(""),[io,Ho]=_.useState(null),[qs,zn]=_.useState(om),ir=_.useRef(null),Fr=_.useRef(null),so=_.useRef(0),Ko=_.useRef(null),Qo=_.useRef(null),qo=_.useRef(null),rn=_.useRef(null),Kt=_.useRef(null),on=_.useRef(null),Le=_.useRef(null),lo=_.useRef(!1),zt=_.useRef(!1),Dt=()=>{K.current!==null&&window.clearTimeout(K.current),K.current=null},wt=()=>{Nr.current!==null&&window.clearTimeout(Nr.current),Nr.current=null},uo=()=>{var p;Jn.current!==null&&window.clearInterval(Jn.current),Jn.current=null,(p=vn.current)==null||p.abort(),vn.current=null},tt=p=>{M.current=p,j.current&&f(p)},Dn=p=>{p&&le.current!==p||(cancelAnimationFrame(W.current),le.current=null,V.current=!1,j.current&&g(0))},It=(p,w)=>{cancelAnimationFrame(W.current),le.current=w,V.current=!0,tt("speaking");const P=new Float32Array(p.fftSize),T=()=>{le.current===w&&(p.getFloatTimeDomainData(P),g(Math.min(1,Math.sqrt(P.reduce((G,J)=>G+J*J,0)/P.length)*6)),W.current=requestAnimationFrame(T))};T()},St=()=>{var p,w,P;B.current||M.current==="error"||(V.current||(p=I.current)!=null&&p.busy&&M.current==="speaking"?tt("speaking"):$.current||(w=I.current)!=null&&w.busy||(P=U.current)!=null&&P.busy?tt(ye.current?"running":"thinking"):z.current&&tt("listening"))},kt=_.useRef(!1),Oi="Reading the conversation…",bs=async()=>{const p=qe.current,{inner:w}=Do(p);if(!(kt.current||!w.includes(":")||w.startsWith("new:"))){kt.current=!0,An(Oi);try{await fetch(`/api/sessions/${encodeURIComponent(p)}/warm`,{method:"POST",headers:Fe()})}catch{}finally{kt.current=!1,j.current&&An(P=>P===Oi?"":P)}}},Qt=()=>{const p=Q.current,w=N.current;!p||!w||(p.gain.cancelScheduledValues(w.currentTime),p.gain.setTargetAtTime(1,w.currentTime,.015))},qt=(p,w={})=>{fetch("/api/voice/event",{method:"POST",headers:{"Content-Type":"application/json",...Fe()},body:JSON.stringify({kind:p,...w})}).catch(()=>{})},wn=_.useRef(null),Lr=()=>{var T;const p=((T=I.current)==null?void 0:T.hold())??!1;if(qt("barge_pause",{held:p}),!p)return;Ht.current=!0,wn.current!==null&&window.clearInterval(wn.current);let w=0;wn.current=window.setInterval(()=>{var J;if(!Ht.current){window.clearInterval(wn.current),wn.current=null;return}w=M.current==="hearing"||!!((J=U.current)!=null&&J.busy)?0:w||Date.now(),w&&Date.now()-w>=2500&&(qt("barge_resume_watchdog"),Sn())},250);const P=Lt.current;if(Lt.current=null,P){const G=(performance.now()-P.startedAt)/1e3,J=P.seconds>0?G/P.seconds:1,b=op(P.text,J),fe=H.current.slice(0,H.current.length-b.length).trim();Yn.current=b?{said:fe,resume:b}:null}else Yn.current=null},Sn=()=>{if(!Ht.current)return;Ht.current=!1;const p=Yn.current;Yn.current=null;const w=I.current;if(qt("barge_resume",{with_sentence:!!p}),!w||!p){w==null||w.resume("");return}lp(p.said,p.resume,Fe()).then(P=>{I.current===w&&w.resume(up(P,p.resume))})},Gs=()=>{var p,w;return!!$.current||!!((p=I.current)!=null&&p.busy)||V.current||!!((w=U.current)!=null&&w.busy)||M.current==="hearing"},bo=async p=>{var G,J;(G=gn.current)==null||G.abort(),(J=At.current)==null||J.abort();const w=new AbortController;gn.current=w,Pr.current.clear();const P=Xr(),T=()=>N.current===p&&!w.signal.aborted;try{await Pf(_p,w.signal);for(const b of $s)for(;T();){for(;T()&&Gs();)await Pf(Cp,w.signal);if(!T())return;const fe=new AbortController;At.current=fe;try{const Oe=await fetch("/api/voice/speech",{method:"POST",headers:{"Content-Type":"application/json",Accept:"audio/wav",...Fe()},body:JSON.stringify({text:b,...P?{voice:P}:{}}),signal:fe.signal});if(!T()||!Oe.ok)break;const Ee=await Oe.arrayBuffer();if(!T())return;const Ye=await p.decodeAudioData(Ee);T()&&Pr.current.set(b,Ye);break}catch{if(!fe.signal.aborted)break}finally{At.current===fe&&(At.current=null)}}}catch{}finally{gn.current===w&&(gn.current=null)}},Go=async(p,w)=>{const P=N.current,T=Pr.current.get(p);if(!P||!T)return;const G=Symbol("cue"),J=H.current;H.current=p,we.current=vf(we.current,p,performance.now());const b=Pu(T,P,Q.current??P.destination,fe=>It(fe,G));try{await b(w)}catch{}finally{Dn(G),H.current===p&&(H.current=J),St()}},zi=()=>{uo(),Jn.current=window.setInterval(()=>{var G;if(!ut.current.turnActive){uo();return}if(V.current||(G=I.current)!=null&&G.busy||vn.current)return;const p=Date.now(),w=p-Fn.current;if(!jp(ut.current,w,p))return;const P=Mp(ut.current);ut.current=Rp(ut.current,P,p);const T=new AbortController;vn.current=T,Go(P,T.signal).finally(()=>{vn.current===T&&(vn.current=null),Fn.current=Date.now()})},300)},ct=p=>{if(!j.current)return;const w=++Ge.current;_e.current!==null&&window.clearTimeout(_e.current),C(p),tt("error"),_e.current=window.setTimeout(()=>{Ge.current===w&&(_e.current=null,C(""),M.current==="error"&&tt(z.current?B.current?"muted":"listening":"idle"))},4e3)},kn=()=>{var p;(p=R.current)==null||p.release(),R.current=null},sr=()=>{var w,P;Ne.current++;const p=ye.current||!!$.current;if(ye.current=!1,(w=$.current)==null||w.abort(),$.current=null,(P=I.current)==null||P.cancel(),Dn(),Qt(),Ht.current=!1,Yn.current=null,Lt.current=null,ut.current=Sf(ut.current),uo(),p){const T=Ue.current??qe.current;fetch(`/api/sessions/${encodeURIComponent(T)}/cancel`,{method:"POST",headers:Fe()}).catch(()=>{})}Ue.current=null,!B.current&&z.current&&tt("listening")},In=()=>{var w;const p=Vs(!!$.current,!!((w=I.current)!=null&&w.busy),V.current);qt("barge_interrupt",{active:p,paused:Ht.current}),p&&sr()},ge=p=>{var G,J,b;if(!z.current&&!O.current)return;z.current=!1,O.current=!1,zt.current=!1,tr(!1),me.current++,Dt(),re.current.deactivate(),B.current=!1,sr(),Qt(),se.current.reset(),wt(),ue.current="",pe.current=0,ve.current="",(G=q.current)==null||G.reset(),q.current=null,(J=U.current)==null||J.reset(),U.current=null,I.current=null;const w=Y.current;Y.current=null,w==null||w.destroy().catch(()=>{});const P=ee.current;ee.current=null,P==null||P.getTracks().forEach(fe=>{fe.onended=null,fe.stop()});const T=N.current;N.current=null,(b=Q.current)==null||b.disconnect(),Q.current=null,T&&T.state!=="closed"&&T.close().catch(()=>{}),kn(),ct(p)},Di=()=>{var T,G,J;if(!z.current)return;z.current=!1,zt.current=!1,tr(!1),me.current++,Dt(),re.current.deactivate(),B.current=!1,sr(),Qt(),se.current.reset(),wt(),ue.current="",pe.current=0,ve.current="",(T=q.current)==null||T.reset(),q.current=null,(G=U.current)==null||G.reset(),U.current=null,I.current=null;const p=Y.current;Y.current=null,p==null||p.destroy().catch(()=>{});const w=ee.current;ee.current=null,w==null||w.getTracks().forEach(b=>{b.onended=null,b.stop()});const P=N.current;N.current=null,(J=Q.current)==null||J.disconnect(),Q.current=null,P&&P.state!=="closed"&&P.close().catch(()=>{}),kn(),ct("Voice session moved to another tab. Tap the shape to reconnect.")},Yo=async(p,w)=>{const P=await fetch("/api/voice/transcribe",{method:"POST",headers:{"Content-Type":"audio/wav",...Fe()},body:Ap(p),signal:w}),T=await P.json();if(!P.ok)throw new Error(T.error??"Transcription failed.");return String(T.text??"").trim()},Jo=()=>{const p=Xn.current;if(p.reported||p.sent===void 0)return;p.reported=!0;const w=performance.now(),P=(T,G)=>T===void 0||G===void 0?void 0:Math.round(G-T);fetch("/api/voice/timing",{method:"POST",headers:{"Content-Type":"application/json",...Fe()},body:JSON.stringify({silence_wait_ms:Y.current?Ru():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,w),speech_end_to_sound_ms:P(p.speechEnd,w)})}).catch(()=>{})},Ii=async(p,w)=>{var Ee,Ye;const P=N.current;if(!P)throw new Error("Audio output is not ready.");const T=Symbol("playback");let G=Df(p);const J=He=>{var Re;(Re=vn.current)==null||Re.abort(),Jo(),H.current=`${H.current} ${p.trim()}`.trim().slice(-2e3),we.current=vf(we.current,p,performance.now()),Lt.current={text:p.trim(),startedAt:performance.now(),seconds:G},It(He,T)},b=await fetch("/api/voice/speech",{method:"POST",headers:{"Content-Type":"application/json",Accept:"audio/pcm, audio/wav;q=0.9",...Fe()},body:JSON.stringify({text:p,...Zn.current?{voice:Zn.current}:{}}),signal:w});if(b.headers.get("x-voice-fallback")==="configured"&&(Zn.current=void 0,kf()),!b.ok)throw new Error((await b.json().catch(()=>({}))).error??"Speech generation failed.");let fe;if(b.body&&((Ee=b.headers.get("content-type"))!=null&&Ee.startsWith("audio/pcm"))){const He=Number(b.headers.get("x-sample-rate"))||24e3;fe=await Xh(b.body,He,P,Q.current??P.destination,J,w),(Ye=fe.completed)==null||Ye.then(Re=>{var Ut;G=Re,((Ut=Lt.current)==null?void 0:Ut.text)===p.trim()&&(Lt.current.seconds=Re)},()=>{})}else{const He=await b.arrayBuffer();w.throwIfAborted();const Re=await P.decodeAudioData(He);w.throwIfAborted(),G=Re.duration,fe=Pu(Re,P,Q.current??P.destination,J)}const Oe=(async He=>{var Re;try{await fe(He)}finally{Dn(T),((Re=Lt.current)==null?void 0:Re.text)===p.trim()&&(Lt.current=null),St()}});return Oe.completed=fe.completed,Oe},Un=()=>{eo(null),er(!1)},ao=(p,w)=>{eo({x:p,y:w}),er(!1)},bt=()=>{ir.current!==null&&window.clearTimeout(ir.current),ir.current=null,Fr.current=null},co=p=>{if(Ot||at){so.current=Date.now()+1e3,bt();return}if(p.pointerType!=="touch")return;bt();const{clientX:w,clientY:P,pointerId:T}=p;Fr.current={pointerId:T,x:w,y:P},ir.current=window.setTimeout(()=>{ir.current=null,Fr.current=null,so.current=Date.now()+1e3,ao(w,P)},tm)},xn=p=>{const w=Fr.current;!w||w.pointerId!==p.pointerId||Math.hypot(p.clientX-w.x,p.clientY-w.y)>10&&bt()},Gt=()=>{var w;(w=Kt.current)==null||w.abort(),Kt.current=null,Le.current=null;const p=on.current;on.current=null,p&&p.state!=="closed"&&p.close().catch(()=>{}),Ho(null)},En=async()=>{if(!gt||io)return;Gt();const p=new AbortController;Kt.current=p;const w=new AudioContext;on.current=w,Ct(""),Ho(gt);try{await w.resume();const P=await fetch("/api/voice/speech",{method:"POST",headers:{"Content-Type":"application/json",Accept:"audio/wav",...Fe()},body:JSON.stringify({text:nm,voice:gt}),signal:p.signal});if(!P.ok)throw new Error((await P.json().catch(()=>({}))).error??"Voice preview failed.");const T=await P.arrayBuffer();p.signal.throwIfAborted();const G=await w.decodeAudioData(T);p.signal.throwIfAborted();const J=Pu(G,w,w.destination,()=>{});if(Kt.current!==p)return;Le.current=J,await J(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),Le.current=null,on.current===w&&(on.current=null,w.state!=="closed"&&w.close().catch(()=>{})),Kt.current===null&&Ho(null)}},Ar=p=>{var P;(P=rn.current)==null||P.abort();const w=new AbortController;rn.current=w,Ai(!0),Ct(""),oo(""),fetch("/api/voice/voices",{headers:Fe(),signal:w.signal}).then(async T=>{const G=await T.json();if(!T.ok)throw new Error(typeof G.current=="string"?G.current:"Could not load voices.");const J=Array.isArray(G.voices)?G.voices.filter(Ee=>typeof Ee=="string"&&/^[A-Za-z0-9._-]{1,100}$/.test(Ee)):[],b=typeof G.current=="string"&&/^[A-Za-z0-9._-]{1,100}$/.test(G.current)?G.current:"";if(rn.current!==w||w.signal.aborted)return;const fe=p??Xr(),Oe=fe&&(!J.length||J.includes(fe))?fe:"";Tr(J),Qs(b),Rr(Oe),no(Oe||b||J[0]||""),oo(G.available===!1&&typeof G.warning=="string"?G.warning:"")}).catch(T=>{!(T instanceof DOMException&&T.name==="AbortError")&&!w.signal.aborted&&Ct(T instanceof Error?T.message:"Could not load voices.")}).finally(()=>{rn.current===w&&(rn.current=null,Ai(!1))})},Or=()=>{if(gt){if(!Qp(gt)){Ct("This voice could not be saved.");return}Rr(gt),Ct(""),or(`${ji(gt)} will be used from the next reply.`),N.current&&bo(N.current)}},_n=p=>{var P;const w=hp(p);Uo(w),(P=Y.current)==null||P.setOptions({redemptionMs:w})},Ys=()=>{kf(),Rr(""),no(yn),Ct(""),or(`${yn?ji(yn):"The profile default"} will be used from the next reply.`),N.current&&bo(N.current)},Xo=async()=>{var w,P;if(!z.current||B.current||zt.current)return;const p=Y.current;if(p){zt.current=!0,Dt(),se.current.reset(),wt(),ue.current="",pe.current=0,ve.current="",y.current="",(w=q.current)==null||w.reset(),(P=U.current)==null||P.reset(),Qt(),p.setOptions({submitUserSpeechOnPause:!1});try{await re.current.pause(p),(Y.current!==p||!z.current||B.current||!lo.current)&&(zt.current=!1)}catch(T){if(zt.current=!1,Y.current!==p||!z.current||B.current)return;p.setOptions({submitUserSpeechOnPause:!0}),ge(re.current.isInvalid(p)?"Microphone transition timed out. Tap the shape to reconnect.":T instanceof Error?T.message:"Could not pause the microphone for settings.")}}},zr=async()=>{if(!zt.current)return;const p=Y.current;if(zt.current=!1,!(!p||!z.current||B.current))try{await re.current.start(p),Y.current===p&&z.current&&!B.current&&(p.setOptions({submitUserSpeechOnPause:!0}),St())}catch(w){if(Y.current!==p||!z.current||B.current)return;p.setOptions({submitUserSpeechOnPause:!0}),ge(re.current.isInvalid(p)?"Microphone transition timed out. Tap the shape to reconnect.":w instanceof Error?w.message:"Could not resume the microphone after settings.")}},Js=p=>{const w=Ve.current,{prefix:P}=Do(qe.current);if(w){qe.current=`${P}${w}:${p}`;return}fetch("/api/sessions",{headers:Fe()}).then(mn).then(async T=>{if(!T.ok)return;const J=(await T.json()).sessions.find(b=>b.id===p&&Do(b.key).prefix===P);J&&(qe.current=J.key,Ve.current=J.harness,j.current&&Ln({harness:J.harness,title:J.title,cwd:J.cwd,host:J.host}))}).catch(()=>{})},Ui=async p=>{var b,fe,Oe;const w=++Ne.current;let P=!1,T=!1;const G=new AbortController;$.current=G,(b=At.current)==null||b.abort(),Zn.current=Xr(),Xn.current={speechEnd:Xn.current.speechEnd,sent:performance.now()},tt("thinking"),ut.current=Pp(ut.current),Fn.current=Date.now(),zi();const J=()=>{P=!0,T=!1,ut.current=Tp(ut.current),Fn.current=Date.now()};try{if(!p||w!==Ne.current){St();return}H.current="",Zn.current=Xr();const Ee=qe.current;Ue.current=Ee;const Ye=await fetch(`/api/sessions/${encodeURIComponent(Ee)}/chat`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream",...Fe()},body:JSON.stringify({conversationId:et.current,message:p,...s&&Do(Ee).inner.startsWith("new:")?{cwd:s}:{}}),signal:G.signal});if(mn(Ye),!Ye.ok)throw new Error((await Ye.json().catch(()=>({}))).error??"Chat request failed.");let He="";if(await sm(Ye,Re=>{var Ut,Vn,Ur,ft;if(w===Ne.current)switch(Re.type){case"session":Js(Re.id);return;case"status":ye.current=!0,St(),An(Re.message);return;case"tool":{if(ye.current=!0,St(),An(""),jr.push(Re),Fn.current=Date.now(),He.trim()){const Nt=ju(He,!0,!P||T);He=Nt.rest,Nt.chunks.length&&(J(),(Ut=I.current)==null||Ut.enqueue(Nt.chunks))}T=!0;return}case"delta":{(Vn=Xn.current).firstDelta??(Vn.firstDelta=performance.now()),ye.current&&(ye.current=!1,St()),jr.clear(),He+=Re.text;const Nt=ju(He,!1,!P||T);He=Nt.rest,Nt.chunks.length&&(J(),(Ur=I.current)==null||Ur.enqueue(Nt.chunks));return}case"notice":An(Re.message),J(),(ft=I.current)==null||ft.enqueue([Re.message]);return;case"error":throw new Error(Re.message);case"done":return}}),w===Ne.current){const Re=ju(He,!0,!P||T);Re.chunks.length&&(J(),(fe=I.current)==null||fe.enqueue(Re.chunks))}}catch(Ee){if(Ee instanceof pn){j.current&&Bo(!0);return}!(Ee instanceof DOMException&&Ee.name==="AbortError")&&w===Ne.current&&(ct(Ee instanceof Error?Ee.message:"Voice conversation failed."),P||(Oe=I.current)==null||Oe.enqueue(["Sorry, I could not answer that. Please try again."]))}finally{$.current===G&&($.current=null,Ue.current=null),ye.current=!1,j.current&&(An(""),jr.clear()),w===Ne.current&&(ut.current=Sf(ut.current),uo()),St()}},lr=async()=>{var Ur;if(z.current||O.current)return;O.current=!0;const p=++ke.current;let w=null,P=null,T=null,G=null,J=null,b=null,fe=null,Oe=null;const Ee=++me.current,Ye=()=>{if(!j.current||me.current!==Ee||ke.current!==p)throw new DOMException("Voice startup was cancelled.","AbortError")};re.current.beginSession();const He=performance.now(),Re={},Ut=ft=>{Re[ft]=Math.round(performance.now()-He)};let Vn=!1;try{if(!window.isSecureContext||!((Ur=navigator.mediaDevices)!=null&&Ur.getUserMedia))throw new Error("Microphone access requires HTTPS or localhost.");C(""),tr(!1),tt("thinking"),w=new AudioContext;const ft=w,Nt=Kp(Di).then(de=>Vn?(de==null||de.release(),null):(G=de,Ut("startup_lease_ms"),de)),ni=navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}}).then(de=>Vn?(de.getTracks().forEach(Me=>Me.stop()),null):(P=de,Ut("startup_microphone_ms"),de));J=w.createGain(),J.gain.value=1,J.connect(w.destination),b=new ep(Ii,St,de=>{Dn(),ct(de instanceof Error?de.message:"Speech playback failed.")}),fe=new Ch(Yo,de=>{ue.current=de,pe.current=performance.now(),Dr(T,Ee)},()=>ar(T,Ee)),Oe=new hh(async(de,Me)=>{const Be=await((fe==null?void 0:fe.finish(de.samples,Me))??Yo(de.samples,Me)),je=de.possibleEcho?dh(Be,de.possibleEcho):Be,dt=de.pendingInterruptDecision,Vt=je.trim()?je.trim().split(/\s+/).length:0;if(!dt)return Ht.current&&qt("barge_send_while_paused",{words:Vt}),je;qt("barge_final_decision",{words:Vt,blocked:dt.wordPathBlocked});const Pn=zf(je,dt.recentWindow);return Pn?(In(),Pn.remainder):!dt.wordPathBlocked&&zu(je,dt.recentWindow)?(In(),je):(Sn(),"")},Ui,de=>ct(de instanceof Error?de.message:"Voice transcription failed."),St);const Bi=async()=>{if(!P)throw new Error("The microphone is not ready.");return P},$i={getStream:Bi,pauseStream:async()=>{},resumeStream:Bi,...xh(Ru()),submitUserSpeechOnPause:!0,onSpeechStart:()=>{var je,dt,Vt,Pn;if(!sn(T,Ee))return;(je=U.current)==null||je.speechStarted();const de=Vs(!!$.current,!!((dt=I.current)!=null&&dt.busy),V.current),Me=se.current.speechStart(de);y.current=V.current||(Vt=I.current)!=null&&Vt.busy?H.current:"";const Be=performance.now();ve.current=Ih(we.current,Be,Be),ue.current="",pe.current=0,Te.current=0,it.current=0,Gn.current=!1,Me.begin&&((Pn=q.current)==null||Pn.begin(de)),ur(T,Ee),wt(),de&&(Nr.current=window.setTimeout(()=>Dr(T,Ee),Ph))},onSpeechRealStart:()=>{var Me,Be;if(!sn(T,Ee))return;se.current.speechRealStart().accepted&&(Qt(),(Me=q.current)==null||Me.confirm(),ur(T,Ee),(Be=At.current)==null||Be.abort(),C(""),tt("hearing"))},onVADMisfire:()=>{var de,Me;sn(T,Ee)&&(Dt(),se.current.reset(),wt(),ue.current="",pe.current=0,y.current="",ve.current="",(de=q.current)==null||de.discard(),(Me=U.current)==null||Me.speechDiscarded(),Sn(),B.current||St())},onFrameProcessed:(de,Me)=>{var je;if(!sn(T,Ee))return;(je=q.current)==null||je.frame(de.isSpeech,Me);const Be=Math.sqrt(Me.reduce((dt,Vt)=>dt+Vt*Vt,0)/Me.length);if(g(Math.min(1,Be*7)),V.current&&se.current.idle)xe.current=xe.current===null?Be:xe.current*.9+Be*.1;else if(!se.current.idle&&V.current&&!Gn.current&&(Te.current++,it.current+=Be,Te.current>=Uh)){Gn.current=!0;const dt=it.current/Te.current;Bh(dt,xe.current)?se.current.blockWordPath():xe.current!==null&&Lr()}},onSpeechEnd:de=>{var Vt,Pn,mo,fr,Qi,ii;if(!sn(T,Ee))return;Xn.current={speechEnd:performance.now()},Dt(),wt();const Me=ue.current.trim()!==""&&performance.now()-pe.current<=Th,Be=ve.current,je=se.current.speechEnd(ue.current,Be,Me);if(Ht.current&&qt("barge_speech_end",{accepted:je.accepted,interrupt:!!je.interrupt,send:!!je.send,deferred:!!je.deferDecision,fresh:Me}),ue.current="",pe.current=0,!je.accepted){y.current="",ve.current="",(Vt=q.current)==null||Vt.discard(),(Pn=U.current)==null||Pn.speechDiscarded(),Sn(),St();return}if(je.interrupt?In():je.deferDecision||Sn(),!je.send){y.current="",ve.current="",(mo=q.current)==null||mo.discard(),(fr=U.current)==null||fr.speechDiscarded(),St();return}(Qi=q.current)==null||Qi.end(de);const dt=y.current;y.current="",ve.current="",(ii=U.current)==null||ii.speechEnded({samples:de,possibleEcho:dt,...je.deferDecision?{pendingInterruptDecision:{recentWindow:Be,wordPathBlocked:je.wordPathBlocked}}:{}})}},el=Cf?Promise.resolve(null):(async()=>{try{const{MicVAD:de}=await Uf(),Me=await de.new({model:"v5",audioContext:ft,startOnLoad:!1,baseAssetPath:Du,onnxWASMBasePath:Du,ortConfig:Be=>{Be.env.wasm.numThreads=1},...$i});return Vn?(Me.destroy().catch(()=>{}),null):(T=Me,Ut("startup_detector_ms"),Me)}catch{return Cf=!0,null}})(),[Wi,Nn,tl]=await Promise.all([Nt,ni,el,ft.resume()]);if(G=Wi,P=Nn,T=tl,!G)throw new im;if(!Nn)throw new Error("Voice startup did not finish.");Ye();let ri=!1;T||(ri=!0,T=await qu.new({audioContext:w,...$i}),Ut("startup_detector_ms")),Ye(),fe.speechThreshold=ri?Ku:Hs,tr(ri),await re.current.start(T),Ut("startup_listening_ms"),Ye();const ho=T,Je=w;if(!ho||!Je)throw new Error("Voice startup did not finish.");R.current=G,N.current=Je,Q.current=J,bo(Je),I.current=b,q.current=fe,U.current=Oe,ee.current=Nn,Y.current=ho,z.current=!0;const Hi=()=>{var de,Me,Be;if(!(ee.current!==Nn||!z.current)){z.current=!1,zt.current=!1,tr(!1),me.current++,Dt(),re.current.deactivate(),B.current=!1,sr(),Qt(),se.current.reset(),wt(),ue.current="",pe.current=0,ve.current="",I.current=null,(de=q.current)==null||de.reset(),q.current=null,(Me=U.current)==null||Me.reset(),U.current=null,Y.current===ho&&(Y.current=null),ee.current===Nn&&(ee.current=null),N.current===Je&&(N.current=null),(Be=Q.current)==null||Be.disconnect(),Q.current=null;for(const je of Nn.getTracks())je.onended=null,je.readyState==="live"&&je.stop();ho.destroy().catch(()=>{}),Je.state!=="closed"&&Je.close().catch(()=>{}),kn(),ct("Microphone disconnected. Tap the shape to reconnect.")}};for(const de of Nn.getAudioTracks())de.onended=Hi;let oi=!1;const po=()=>{if(!(N.current!==Je||!z.current)){if(Je.state==="running"||Je.state==="closed"){oi=!1;return}Je.resume().catch(()=>{}).then(()=>{N.current!==Je||!z.current||Je.state==="running"||oi||(oi=!0,ct("The device paused audio. Tap the shape to keep talking."))})}};Je.onstatechange=po;const Ki=window.setInterval(()=>{if(N.current!==Je||Je.state==="closed"){window.clearInterval(Ki),document.removeEventListener("visibilitychange",po);return}po()},2e3);if(document.addEventListener("visibilitychange",po),!Nn.getAudioTracks().some(de=>de.readyState==="live")){Hi();return}tt("listening"),fetch("/api/voice/timing",{method:"POST",headers:{"Content-Type":"application/json",...Fe()},body:JSON.stringify(Re)}).catch(()=>{}),lo.current&&Xo()}catch(ft){Vn=!0;const Nt=me.current===Ee&&ke.current===p;Nt&&(me.current++,Dt(),re.current.deactivate(),Y.current===T&&(Y.current=null),ee.current===P&&(ee.current=null),N.current===w&&(N.current=null),Q.current===J&&(Q.current=null),I.current===b&&(I.current=null),q.current===fe&&(q.current=null),U.current===Oe&&(U.current=null)),b==null||b.cancel(),fe==null||fe.reset(),Oe==null||Oe.reset(),J==null||J.disconnect(),T&&await T.destroy().catch(()=>{}),P==null||P.getTracks().forEach(ni=>ni.stop()),w&&w.state!=="closed"&&await w.close().catch(()=>{}),R.current===G&&(R.current=null),G==null||G.release(),Nt&&!(ft instanceof DOMException&&ft.name==="AbortError")&&ct(ft instanceof Error?ft.message:"Could not start the microphone.")}finally{ke.current===p&&(O.current=!1)}},sn=(p,w)=>(z.current||O.current)&&!lo.current&&vh(me.current,w,Y.current,p,B.current,re.current.acceptsCallbacks),ln=(p,w,P)=>p!==null&&Y.current===p&&z.current&&B.current===w&&(P===void 0||me.current===P),Cn=(p,w,P)=>ln(p,w,P)&&p!==null&&!re.current.isInvalid(p),ur=(p,w)=>{Dt(),p&&(K.current=window.setTimeout(()=>{K.current=null,sn(p,w)&&re.current.flush(p).then(()=>{Cn(p,!1,w)}).catch(P=>{ln(p,!1,w)&&(re.current.isInvalid(p)?ge("Microphone transition timed out. Tap the shape to reconnect."):ct(P instanceof Error?P.message:"Microphone recovery failed."))})},em))},ar=(p,w)=>{!p||!sn(p,w)||re.current.flush(p).catch(P=>{ln(p,!1,w)&&(re.current.isInvalid(p)?ge("Microphone transition timed out. Tap the shape to reconnect."):ct(P instanceof Error?P.message:"Microphone recovery failed."))})},Dr=(p,w)=>{sn(p,w)&&se.current.shouldInterruptNow(ue.current,ve.current)&&(wt(),In(),Qt())},Xs=async()=>{var w,P,T,G,J;if(!z.current){O.current||lr();return}const p=N.current;if(p&&p.state!=="running"&&p.state!=="closed"&&(await p.resume().catch(()=>{}),p.state==="running")){tt(B.current?"muted":"listening");return}if(!B.current&&Vs(!!$.current,!!((w=I.current)!=null&&w.busy),V.current)){In(),Qt();return}if(B.current=!B.current,B.current){Dt(),sr(),Qt(),se.current.reset(),wt(),ue.current="",pe.current=0,ve.current="",(P=q.current)==null||P.reset(),(T=U.current)==null||T.reset(),(G=ee.current)==null||G.getTracks().forEach(fe=>{fe.enabled=!1});const b=Y.current;if(!ln(b,!0))return;b==null||b.setOptions({submitUserSpeechOnPause:!1});try{if(b&&await re.current.pause(b),!Cn(b,!0)){ln(b,!0)&&b&&re.current.isInvalid(b)&&ge("Microphone transition timed out. Tap the shape to reconnect.");return}tt("muted")}catch(fe){if(!ln(b,!0))return;b&&re.current.isInvalid(b)?ge("Microphone transition timed out. Tap the shape to reconnect."):ct(fe instanceof Error?fe.message:"Could not pause the microphone.")}}else{(J=ee.current)==null||J.getTracks().forEach(fe=>{fe.enabled=!0});const b=Y.current;if(!ln(b,!1))return;try{if(b){if(await re.current.start(b),!Cn(b,!1)){ln(b,!1)&&re.current.isInvalid(b)&&ge("Microphone transition timed out. Tap the shape to reconnect.");return}b.setOptions({submitUserSpeechOnPause:!0})}if(!Cn(b,!1))return;tt("listening")}catch(fe){if(!ln(b,!1))return;b&&re.current.isInvalid(b)?ge("Microphone transition timed out. Tap the shape to reconnect."):ct(fe instanceof Error?fe.message:"Could not resume the microphone.")}}},Zs=()=>{if(Un(),C(""),z.current||O.current){ge(""),window.setTimeout(()=>{!z.current&&!O.current&&lr()},0);return}lr()};if(_.useEffect(()=>{dp(),bs()},[u]),_.useEffect(()=>{const p=new AbortController;return fetch("/api/sessions",{headers:Fe(),signal:p.signal}).then(mn).then(async w=>{if(!w.ok)return;const T=(await w.json()).sessions.find(G=>G.key===u);T&&!p.signal.aborted&&(Ve.current=T.harness,Ln({harness:T.harness,title:T.title,cwd:T.cwd,host:T.host}))}).catch(w=>{w instanceof pn&&!p.signal.aborted&&Bo(!0)}),()=>p.abort()},[u]),_.useEffect(()=>{let p=!1;const w=()=>{fetch("/api/health",{headers:Fe()}).then(async T=>{const G=await T.json().catch(()=>({}));if(p)return;const J=G.speech??{};Vo({ready:J.ready!==!1,downloading:J.downloading===!0,progress:typeof J.progress=="number"?J.progress:void 0,error:typeof J.error=="string"?J.error:void 0})}).catch(()=>{})};w();const P=window.setInterval(w,rm);return()=>{p=!0,window.clearInterval(P)}},[]),_.useEffect(()=>{var p;if(lo.current=at,at?Xo():zr(),!at){io&&Gt(),(p=rn.current)==null||p.abort(),rn.current=null;return}Ct(""),or(""),Ar(Xr()??void 0)},[at]),_.useEffect(()=>{if(!Ot&&!at)return;const p=P=>{var G,J;const T=P.target;T instanceof Node&&((G=Ko.current)!=null&&G.contains(T)||(J=Qo.current)!=null&&J.contains(T))||Un()},w=P=>{P.key==="Escape"&&(P.preventDefault(),Un())};return document.addEventListener("pointerdown",p),document.addEventListener("keydown",w),()=>{document.removeEventListener("pointerdown",p),document.removeEventListener("keydown",w)}},[Ot,at]),_.useEffect(()=>{at&&window.setTimeout(()=>{var p;return(p=qo.current)==null?void 0:p.focus()},0)},[at]),_.useEffect(()=>()=>{var p,w,P,T,G,J,b,fe;j.current=!1,Ge.current++,_e.current!==null&&window.clearTimeout(_e.current),_e.current=null,z.current=!1,bt(),(p=rn.current)==null||p.abort(),(w=Kt.current)==null||w.abort(),Kt.current=null,Le.current=null,on.current&&on.current.state!=="closed"&&on.current.close().catch(()=>{}),on.current=null,me.current++,Dt(),re.current.deactivate(),sr(),Qt(),se.current.reset(),wt(),ue.current="",pe.current=0,ve.current="",(P=q.current)==null||P.reset(),(T=U.current)==null||T.reset(),U.current=null,(G=Y.current)==null||G.destroy(),(J=ee.current)==null||J.getTracks().forEach(Oe=>{Oe.onended=null,Oe.stop()}),(b=N.current)==null||b.close(),(fe=Q.current)==null||fe.disconnect(),Q.current=null,kn()},[]),Li)return h.jsx(Kf,{});const Zo=Vs(!!$.current,!!((ti=I.current)!=null&&ti.busy),V.current),fo=z.current?l==="muted"?"Unmute microphone":Zo?"Stop reply":"Mute microphone":"Start voice conversation",ei=Ot?Math.max(12,Math.min(Ot.x,window.innerWidth-170)):0,Vi=Ot?Math.max(12,Math.min(Ot.y,window.innerHeight-68)):0,Yt=Fi||yn,cr=yt.ready,Ir=yt.ready?"Ready":yt.downloading?`Downloading voice models…${typeof yt.progress=="number"?` ${Math.round(yt.progress)}%`:""}`:"Offline";return h.jsxs("main",{className:"voice-page","data-state":l,style:{"--level":c},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?Ks[_t.harness]:"Meldivo"," · ",_t.title]}),(_t.host||_t.cwd)&&h.jsx("span",{className:"room-header__cwd",children:[_t.host,_t.cwd].filter(Boolean).join(" · ")})]}),$o&&h.jsx("p",{className:"room-status",role:"status",children:$o}),h.jsx(Yp,{items:jr.items}),Wo&&h.jsx("p",{className:"room-status voice-fallback-notice",role:"status",children:"Using basic voice detection"}),!yt.ready&&h.jsx("p",{className:"voice-health",role:"status",children:yt.error||Ir}),h.jsxs("button",{className:"voice-shape",type:"button",onClick:()=>{if(Date.now()<so.current){so.current=0;return}if(Ot||at){Un();return}Xs()},onPointerDown:co,onPointerMove:xn,onPointerUp:bt,onPointerCancel:bt,onPointerLeave:bt,onLostPointerCapture:bt,onContextMenu:p=>{p.preventDefault(),ao(p.clientX,p.clientY)},onKeyDown:p=>{if(p.key==="ContextMenu"||p.key==="F10"&&p.shiftKey){p.preventDefault();const w=p.currentTarget.getBoundingClientRect();ao(w.left+w.width/2,w.top+w.height/2)}},"aria-label":fo,"aria-haspopup":"menu","aria-expanded":!!(Ot||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(qp,{state:l,level:c})]}),Ot&&h.jsx("div",{ref:Ko,className:"voice-context-menu",role:"menu","aria-label":"Voice options",style:{left:ei,top:Vi},children:h.jsx("button",{type:"button",role:"menuitem",onClick:()=>{eo(null),er(!0)},children:"Settings"})}),at&&h.jsxs("div",{ref:Qo,className:"voice-settings",role:"dialog","aria-modal":"false","aria-labelledby":"voice-settings-title",onKeyDown:p=>{p.key==="Escape"&&(p.preventDefault(),Un())},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:Un,"aria-label":"Close voice settings",children:"×"})]}),h.jsxs("p",{id:"tts-provider-status",className:`voice-settings__availability voice-settings__availability--${yt.ready?"ready":yt.downloading?"checking":"offline"}`,role:"status",children:[h.jsx("span",{"aria-hidden":"true"}),Ir]}),yt.error&&h.jsx("p",{className:"voice-settings__availability-note",children:yt.error}),nr&&h.jsx("p",{className:"voice-settings__availability-note",children:nr}),On&&h.jsx("p",{className:"voice-settings__muted",children:"Loading voices…"}),!On&&to.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:qo,id:"voice-choice",value:gt,onChange:p=>{Gt(),no(p.target.value),Ct(""),or("")},"aria-describedby":"voice-current",children:to.map(p=>h.jsx("option",{value:p,children:ji(p)},p))}),h.jsx("button",{className:"voice-settings__play",type:"button",onClick:()=>{En()},disabled:!gt||!cr||!!io,"aria-label":`Preview ${gt||"voice"}`,"aria-describedby":"tts-provider-status",title:cr?void 0:"Wait for voice models to be ready.",children:io?"…":"▶"})]}),h.jsxs("p",{id:"voice-current",className:"voice-settings__current",children:["Current: ",Yt?ji(Yt):"profile default"]}),h.jsxs("div",{className:"voice-settings__actions",children:[h.jsx("button",{type:"button",onClick:Or,disabled:!gt||!cr||gt===Yt,"aria-describedby":"tts-provider-status",title:cr?void 0:"Wait for voice models to be ready.",children:"Use this voice"}),h.jsx("button",{type:"button",onClick:Ys,disabled:!Fi,children:"Restore default"})]})]}),!On&&!to.length&&h.jsx(h.Fragment,{children:h.jsx("p",{className:"voice-settings__muted",children:"No selectable voices are configured."})}),rr&&h.jsx("p",{className:"voice-settings__error",role:"alert",children:rr}),Mr&&h.jsx("p",{className:"voice-settings__notice",role:"status",children:Mr}),h.jsxs("label",{className:"voice-settings__label",htmlFor:"vad-redemption",children:["End-of-speech wait: ",ro," ms"]}),h.jsx("input",{id:"vad-redemption",type:"range",min:Af,max:Of,step:Lu,value:ro,onChange:p=>_n(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…"})]}),qs&&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(Qf,"true")}catch{}zn(!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:Zs,children:"Reconnect"})]})]})}function Wu(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 Ws(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 Tf(u){const s=/^([abefhijpz])([fm])_(.+)$/.exec(u),f=(s?s[3]:u.replace(/\.(wav|mp3|flac)$/i,"")).replace(/[_-]+/g," ").trim().replace(/\b\w/g,g=>g.toUpperCase());return s?`${f} (${{a:"American",b:"British",e:"Spanish",f:"French",h:"Hindi",i:"Italian",j:"Japanese",p:"Portuguese",z:"Chinese"}[s[1]]??""} ${s[2]==="f"?"female":"male"})`.replace("( ","("):f}async function um(u,s,l){const f=mn(await fetch(u,{method:"POST",headers:{"Content-Type":"application/json",...Fe()},body:JSON.stringify(s),signal:l})),c=await f.json().catch(()=>({}));if(!f.ok)throw new Error(c.error??"The request failed.");return c}function Rf({kind:u,engines:s,draft:l,onChange:f}){const c=s.find(N=>N.id===l.engine),g=l.engine!=="local",[x,C]=_.useState(!1),M=_.useRef(null),j=_.useRef(null),B=_.useRef(null),z=u==="tts"?"Text to speech":"Speech to text",O=`speech-${u}`,V=u==="tts"?l.model:"";_.useEffect(()=>{var $;if(($=B.current)==null||$.abort(),g&&!l.url.trim()){f(ye=>({...ye,models:[],voices:[],status:"idle",error:""}));return}const N=new AbortController;B.current=N;const Q=window.setTimeout(()=>{f(I=>({...I,status:"loading",error:""}));const ye={...Ws({...l,voice:""})};um("/api/speech/discover",{kind:u,setting:ye},N.signal).then(I=>{N.signal.aborted||f(q=>{var me;const U=I.models.some(ke=>ke.id===q.model)?q.model:I.model??((me=I.models[0])==null?void 0:me.id)??"",re=I.voices.includes(q.voice)?q.voice:I.voice??I.voices[0]??"";return{...q,models:I.models,voices:I.voices,model:U,voice:re,status:"ready",error:""}})}).catch(I=>{if(I instanceof pn)throw I;N.signal.aborted||f(q=>({...q,models:[],voices:[],status:"error",error:I instanceof Error?I.message:"Could not reach the server."}))})},g?600:0);return()=>{window.clearTimeout(Q),N.abort()}},[u,l.engine,l.url,l.apiKey,l.clearKey,V]);const Y=()=>{var Q;(Q=M.current)==null||Q.abort();const N=j.current;j.current=null,N&&N.state!=="closed"&&N.close().catch(()=>{})};_.useEffect(()=>Y,[]);const ee=async()=>{if(!l.voice)return;Y();const N=new AbortController;M.current=N;const Q=new AudioContext;j.current=Q,C(!0),f($=>({...$,error:""}));try{const $=mn(await fetch("/api/speech/preview",{method:"POST",headers:{"Content-Type":"application/json",...Fe()},body:JSON.stringify({setting:Ws(l),voice:l.voice}),signal:N.signal}));if(!$.ok)throw new Error((await $.json().catch(()=>({}))).error??"Preview failed.");await Q.resume();const ye=await Q.decodeAudioData(await $.arrayBuffer());if(N.signal.aborted)return;const I=Q.createBufferSource();I.buffer=ye,I.connect(Q.destination),I.onended=()=>{j.current===Q&&(Y(),C(!1))},I.start()}catch($){if($ instanceof pn)throw $;N.signal.aborted||(Y(),C(!1),f(ye=>({...ye,error:$ instanceof Error?$.message:"Preview failed."})))}};return h.jsxs("section",{className:"speech-section","aria-labelledby":`${O}-title`,children:[h.jsx("h3",{id:`${O}-title`,children:z}),h.jsxs("label",{className:"speech-field",children:[h.jsx("span",{children:"Engine"}),h.jsx("select",{value:l.engine,onChange:N=>{const Q=N.target.value;f($=>({...Wu({engine:Q}),url:Q===$.engine?$.url:""}))},children:s.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:(c==null?void 0:c.defaultUrl)??"http://localhost:8000",value:l.url,onChange:N=>{const Q=N.target.value;f($=>({...$,url:Q}))}})]}),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:l.hasKey&&!l.clearKey?"Saved; type to replace":"Leave empty if the server has none",value:l.apiKey,onChange:N=>{const Q=N.target.value;f($=>({...$,apiKey:Q,clearKey:!1}))}})]}),l.hasKey&&!l.apiKey&&!l.clearKey&&h.jsx("button",{type:"button",className:"speech-link",onClick:()=>f(N=>({...N,clearKey:!0})),children:"Remove saved key"})]}),l.status==="loading"&&h.jsx("p",{className:"speech-status",children:"Connecting…"}),l.status==="ready"&&g&&h.jsx("p",{className:"speech-status speech-status--ok",children:"Connected"}),l.status==="error"&&h.jsx("p",{className:"speech-status speech-status--error",role:"alert",children:l.error}),g&&l.models.length>0&&((c==null?void 0:c.hasModels)||l.models.length>1)&&h.jsxs("label",{className:"speech-field",children:[h.jsx("span",{children:"Model"}),h.jsx("select",{value:l.model,onChange:N=>{const Q=N.target.value;f($=>({...$,model:Q}))},children:l.models.map(N=>h.jsxs("option",{value:N.id,children:[N.id,N.installed===!1?" (downloads on first use)":""]},N.id))})]}),u==="tts"&&l.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:l.voice,onChange:N=>{const Q=N.target.value;f($=>({...$,voice:Q}))},children:l.voices.map(N=>h.jsx("option",{value:N,children:Tf(N)},N))}),h.jsx("button",{type:"button",className:"speech-play",onClick:()=>{ee()},disabled:!l.voice||x,"aria-label":`Play a preview of ${l.voice?Tf(l.voice):"this speaker"}`,children:x?"…":"▶"})]})]}),l.error&&l.status!=="error"&&h.jsx("p",{className:"speech-status speech-status--error",role:"alert",children:l.error})]})}function am({onClose:u}){const[s,l]=_.useState(null),[f,c]=_.useState(null),[g,x]=_.useState(null),[C,M]=_.useState(""),[j,B]=_.useState(""),[z,O]=_.useState(!1);_.useEffect(()=>{fetch("/api/speech/settings",{headers:Fe()}).then(mn).then(async N=>{if(!N.ok)throw new Error("Could not load the speech settings.");const Q=await N.json();l(Q),c(Wu(Q.tts.setting)),x(Wu(Q.stt.setting))}).catch(N=>{if(N instanceof pn)throw N;M(N instanceof Error?N.message:"Could not load the speech settings.")})},[]);const V=N=>Q=>{B(""),N($=>$&&Q($))},Y=()=>{!f||!g||(O(!0),M(""),B(""),fetch("/api/speech/settings",{method:"PUT",headers:{"Content-Type":"application/json",...Fe()},body:JSON.stringify({tts:Ws(f),stt:Ws(g)})}).then(mn).then(async N=>{const Q=await N.json().catch(()=>({}));if(!N.ok)throw new Error(Q.error??"Could not save the speech settings.");c($=>$&&{...$,apiKey:"",clearKey:!1,hasKey:!!Q.tts.setting.hasKey}),x($=>$&&{...$,apiKey:"",clearKey:!1,hasKey:!!Q.stt.setting.hasKey}),B("Saved. Every machine and browser on this hub uses it from the next turn.")}).catch(N=>{if(N instanceof pn)throw N;M(N instanceof Error?N.message:"Could not save the speech settings.")}).finally(()=>O(!1)))},ee=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."}),!s&&!C&&h.jsx("p",{className:"hub-muted",children:"Loading…"}),s&&f&&g&&h.jsxs(h.Fragment,{children:[h.jsx(Rf,{kind:"tts",engines:s.tts.engines,draft:f,onChange:V(c)}),h.jsx(Rf,{kind:"stt",engines:s.stt.engines,draft:g,onChange:V(x)}),h.jsx("div",{className:"speech-actions",children:h.jsx("button",{type:"button",className:"hub-primary",onClick:Y,disabled:z||ee(f)||ee(g),children:z?"Saving…":"Save"})})]}),C&&h.jsx("p",{className:"hub-error",role:"alert",children:C}),j&&h.jsx("p",{className:"speech-status speech-status--ok",role:"status",children:j})]})}const cm=5e3,fm=5e3;function Mi(u){const s=/^(\/home\/[^/]+|\/Users\/[^/]+)(\/.*)?$/.exec(u);return s?s[2]?`~${s[2]}`:"~":u}function qf(u){const s=Math.max(0,Math.round((Date.now()-u)/1e3));if(s<5)return"just now";if(s<60)return`${s}s ago`;const l=Math.round(s/60);if(l<60)return`${l}m ago`;const f=Math.round(l/60);return f<24?`${f}h ago`:`${Math.round(f/24)}d ago`}function bf(u,s){window.location.href=`/?session=${encodeURIComponent(u)}${s?`&folder=${encodeURIComponent(s)}`:""}`}function dm(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 hm({onClose:u}){var O;const[s,l]=_.useState(null),[f,c]=_.useState(""),[g,x]=_.useState(!1),[C,M]=_.useState(""),j=()=>{c(""),fetch("/api/remote",{headers:Fe()}).then(mn).then(async V=>{if(!V.ok)throw new Error("Could not load phone access options.");l(await V.json())}).catch(V=>{if(V instanceof pn)throw V;c(V instanceof Error?V.message:"Could not load phone access options.")})};_.useEffect(j,[]),_.useEffect(()=>{var ee;const V=(ee=s==null?void 0:s.active)==null?void 0:ee.url;if(!V){M("");return}let Y=!1;return If(()=>import("./browser-CujOq0-h.js").then(N=>N.b),__vite__mapDeps([2,1])).then(async N=>{const Q=await N.toDataURL(V,{margin:1,width:200});Y||M(Q)}).catch(()=>{Y||M("")}),()=>{Y=!0}},[(O=s==null?void 0:s.active)==null?void 0:O.url]);const B=V=>{x(!0),c(""),fetch("/api/remote",{method:"POST",headers:{"Content-Type":"application/json",...Fe()},body:JSON.stringify({id:V})}).then(mn).then(async Y=>{if(!Y.ok)throw new Error((await Y.json().catch(()=>({}))).error??"Could not enable phone access.");j()}).catch(Y=>{if(Y instanceof pn)throw Y;c(Y instanceof Error?Y.message:"Could not enable phone access.")}).finally(()=>x(!1))},z=()=>{x(!0),c(""),fetch("/api/remote",{method:"DELETE",headers:Fe()}).then(mn).then(V=>{if(!V.ok)throw new Error("Could not turn off phone access.");j()}).catch(V=>{if(V instanceof pn)throw V;c(V instanceof Error?V.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:"×"})]}),!s&&!f&&h.jsx("p",{className:"hub-muted",children:"Loading…"}),f&&h.jsx("p",{className:"hub-error",role:"alert",children:f}),(s==null?void 0:s.active)&&h.jsxs("div",{className:"hub-remote__active",children:[h.jsx("p",{className:"hub-remote__url",children:s.active.url}),C&&h.jsx("img",{className:"hub-remote__qr",src:C,alt:"QR code for phone access URL"}),h.jsx("button",{type:"button",onClick:z,disabled:g,children:"Turn off"})]}),s&&!s.active&&h.jsxs(h.Fragment,{children:[h.jsx("ul",{className:"hub-remote__options",children:s.options.map(V=>h.jsx("li",{children:h.jsxs("button",{type:"button",disabled:!V.ready||g,onClick:()=>B(V.id),children:[V.label,V.ready?"":" (not ready)"]})},V.id))}),!s.options.some(V=>V.ready)&&s.guide&&(/^https?:\/\//.test(s.guide)?h.jsx("p",{className:"hub-muted",children:h.jsx("a",{href:s.guide,target:"_blank",rel:"noreferrer",children:"Set up phone access"})}):h.jsx("p",{className:"hub-muted",children:s.guide}))]})]})}const jf="meldivo.machine",pm=5;function mm(u){return u.id?`@${u.id}/`:""}function vm({host:u,sessions:s,selected:l,onSelect:f}){const c=s.filter(M=>M.open).length,g=s.some(M=>M.busy),x=s.reduce((M,j)=>Math.max(M,j.updatedAt),0),C=u.online?g?"hub-dot--busy":"hub-dot--online":"hub-dot--idle";return h.jsxs("button",{type:"button",role:"tab","aria-selected":l,className:`hub-machine${l?" hub-machine--selected":""}${u.online?"":" hub-machine--offline"}`,onClick:f,children:[h.jsxs("span",{className:"hub-machine__name",children:[h.jsx("span",{className:`hub-dot ${C}`,"aria-hidden":"true"}),u.name]}),h.jsx("span",{className:"hub-machine__meta",children:u.online?h.jsxs(h.Fragment,{children:[s.length," session",s.length===1?"":"s",c>0&&h.jsxs(h.Fragment,{children:[" · ",c," open"]})]}):"offline"}),u.online&&x>0&&h.jsxs("span",{className:"hub-machine__meta",children:["active ",qf(x)]})]})}const Fu=1440*60*1e3;function gm(u,s){const l=Date.now()-u;return s==="today"?new Date(u).toDateString()===new Date().toDateString():s==="week"?l<=7*Fu:s==="month"?l<=30*Fu:s==="older"?l>30*Fu:!0}function ym(u,s){const l=[...u];return s==="title"?l.sort((f,c)=>(f.title||"").localeCompare(c.title||"",void 0,{sensitivity:"base"})):l.sort((f,c)=>s==="oldest"?f.updatedAt-c.updatedAt:c.updatedAt-f.updatedAt),l}function wm({session:u}){const s=dm(u);return h.jsx("li",{children:h.jsxs("button",{type:"button",className:"hub-session",onClick:()=>bf(u.key),children:[h.jsx("span",{className:s.className,"aria-hidden":"true",title:s.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:Ks[u.harness]}),h.jsx("span",{className:"hub-session__time",children:qf(u.updatedAt)})]}),u.open&&h.jsx("span",{className:"hub-session__hint",children:"open in a terminal · continues as a voice copy"})]})]})})}function Gf(u,s){if(s.length===0)return!0;const l=`${u.title} ${Mi(u.cwd)} ${Ks[u.harness]}`.toLowerCase();return s.every(f=>l.includes(f))}function Yf(u){return u.trim().toLowerCase().split(/\s+/).filter(Boolean)}function Sm({cwd:u,sessions:s,total:l}){const[f,c]=_.useState(""),g=Yf(f),x=s.filter(j=>Gf(j,g)),C=Mi(u),M=C==="~"?"Home folder":C||"(no folder)";return h.jsxs("section",{className:"hub-folder","aria-label":M,children:[h.jsxs("h3",{className:"hub-folder__title",children:[h.jsx("span",{children:M}),h.jsx("span",{className:"hub-folder__count",children:s.length===l?l:`${s.length} of ${l}`})]}),s.length>pm&&h.jsx("input",{type:"search",className:"hub-folder__search",placeholder:`Search in ${M}`,value:f,onChange:j=>c(j.target.value),"aria-label":`Search sessions in ${M}`,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(wm,{session:j},j.key))})]})}function km({host:u,folders:s,agent:l,folder:f,onClose:c}){var B,z;const g=[...u.harnesses].filter(O=>O.available).sort((O,V)=>$u.indexOf(O.id)-$u.indexOf(V.id)),[x,C]=_.useState(((B=g.find(O=>O.id===l))==null?void 0:B.id)??((z=g[0])==null?void 0:z.id)),[M,j]=_.useState(f==="all"?"":f);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:()=>C(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:M,onChange:O=>j(O.target.value),children:[h.jsx("option",{value:"",children:"Home folder"}),s.map(O=>h.jsx("option",{value:O,children:Mi(O)},O))]})]}),h.jsxs("div",{className:"hub-newchat__actions",children:[h.jsx("button",{type:"button",className:"hub-more",onClick:c,children:"Cancel"}),h.jsx("button",{type:"button",className:"hub-primary",disabled:!x,onClick:()=>x&&bf(`${mm(u)}new:${x}`,M||void 0),children:"Start talking"})]})]})}function xm({host:u,sessions:s}){const[l,f]=_.useState(""),[c,g]=_.useState("all"),[x,C]=_.useState("all"),[M,j]=_.useState("any"),[B,z]=_.useState("newest"),[O,V]=_.useState(!1),[Y,ee]=_.useState(!1);if(_.useEffect(()=>{f(""),g("all"),C("all"),j("any"),z("newest"),V(!1),ee(!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 K of s)N.set(K.cwd,Math.max(N.get(K.cwd)??0,K.updatedAt));const Q=[...N.entries()].sort((K,_e)=>_e[1]-K[1]).map(([K])=>K),$=Q.filter(K=>K&&Mi(K)!=="~"),ye=$u.filter(K=>s.some(_e=>_e.harness===K)),I=Yf(l),q=ym(s.filter(K=>c!=="all"&&K.harness!==c||x!=="all"&&K.cwd!==x||O&&!K.open||!gm(K.updatedAt,M)?!1:Gf(K,I)),B),U=s.filter(K=>K.open).length,re=c!=="all"||x!=="all"||M!=="any"||O||I.length>0,me=[];for(const K of q){const _e=me.find(Ge=>Ge.cwd===K.cwd);_e?_e.sessions.push(K):me.push({cwd:K.cwd,sessions:[K]})}const ke=new Map;for(const K of s)ke.set(K.cwd,(ke.get(K.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 ${s.length} sessions`,value:l,onChange:K=>f(K.target.value),"aria-label":`Search all sessions on ${u.name}`,autoComplete:"off"}),h.jsx("button",{type:"button",className:"hub-primary","aria-expanded":Y,onClick:()=>ee(!Y),children:Y?"Close":"New chat"})]}),Y&&h.jsx(km,{host:u,folders:$,agent:c,folder:x,onClose:()=>ee(!1)}),s.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${c==="all"?" hub-chip--on":""}`,"aria-pressed":c==="all",onClick:()=>g("all"),children:"All agents"}),ye.map(K=>h.jsxs("button",{type:"button",className:`hub-chip${c===K?" hub-chip--on":""}`,"aria-pressed":c===K,onClick:()=>g(c===K?"all":K),children:[Ks[K]," ",h.jsx("span",{className:"hub-chip__count",children:s.filter(_e=>_e.harness===K).length})]},K)),h.jsxs("button",{type:"button",className:`hub-chip${O?" hub-chip--on":""}`,"aria-pressed":O,disabled:U===0&&!O,onClick:()=>V(!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:K=>C(K.target.value),"aria-label":"Folder",children:[h.jsxs("option",{value:"all",children:["All folders (",Q.length,")"]}),Q.map(K=>h.jsx("option",{value:K,children:Mi(K)||"(no folder)"},K))]}),h.jsxs("select",{className:"hub-select",value:M,onChange:K=>j(K.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:B,onChange:K=>z(K.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"})]})]})]}),s.length===0&&h.jsxs("p",{className:"hub-empty",children:["No sessions on ",u.name," yet. Tap New chat to start one."]}),s.length>0&&q.length===0&&h.jsxs("p",{className:"hub-empty",children:["No sessions match. ",h.jsx("button",{type:"button",className:"hub-link",onClick:()=>{f(""),g("all"),C("all"),j("any"),V(!1)},children:"Clear filters"})]}),re&&q.length>0&&h.jsxs("p",{className:"hub-count",children:[q.length," of ",s.length," sessions"]}),h.jsx("div",{className:"hub-folders",children:me.map(K=>h.jsx(Sm,{cwd:K.cwd,sessions:K.sessions,total:ke.get(K.cwd)??K.sessions.length},`${u.id}|${K.cwd}`))})]})}function Em(){const[u,s]=_.useState(null),[l,f]=_.useState(""),[c,g]=_.useState(!1),[x,C]=_.useState({ready:!0,downloading:!1}),[M,j]=_.useState(!1),[B,z]=_.useState(()=>new URLSearchParams(window.location.search).get("settings")==="speech"),[O,V]=_.useState(()=>{try{return window.localStorage.getItem(jf)}catch{return null}}),Y=_.useRef(!0);if(_.useEffect(()=>(Y.current=!0,()=>{Y.current=!1}),[]),_.useEffect(()=>{let U=!1;const re=()=>{fetch("/api/sessions",{headers:Fe()}).then(mn).then(async ke=>{if(!ke.ok)throw new Error("Could not load sessions.");const K=await ke.json();U||(s(K),f(""))}).catch(ke=>{if(!U){if(ke instanceof pn){g(!0);return}f(ke instanceof Error?ke.message:"Could not load sessions.")}})};re();const me=window.setInterval(re,cm);return()=>{U=!0,window.clearInterval(me)}},[]),_.useEffect(()=>{let U=!1;const re=()=>{fetch("/api/health",{headers:Fe()}).then(async ke=>{const K=await ke.json().catch(()=>({}));if(U)return;const _e=K.speech??{};C({ready:_e.ready!==!1,downloading:_e.downloading===!0,progress:typeof _e.progress=="number"?_e.progress:void 0,error:typeof _e.error=="string"?_e.error:void 0})}).catch(()=>{})};re();const me=window.setInterval(re,fm);return()=>{U=!0,window.clearInterval(me)}},[]),c)return h.jsx(Kf,{});const ee=(u==null?void 0:u.hosts)??(u?[{id:"",name:u.machine,online:!0,harnesses:u.harnesses}]:[]),N=(u==null?void 0:u.sessions)??[],Q=U=>N.filter(re=>(re.host??"")===U.id),$=ee.filter(U=>U.id!==""||ee.length===1||U.harnesses.some(re=>re.available)||Q(U).length>0),ye=$.find(U=>U.id===O)??$.find(U=>U.online)??$[0],I=U=>{V(U);try{window.localStorage.setItem(jf,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}),$.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),z(!0)},children:"Speech"}),h.jsx("button",{type:"button",className:"hub-remote-button hub-remote-button--next",onClick:()=>{z(!1),j(!0)},children:"Phone access"})]}),l&&h.jsx("p",{className:"hub-error",role:"alert",children:l}),!u&&!l&&h.jsx("p",{className:"hub-empty",children:"Loading…"}),$.length>1&&h.jsx("nav",{className:"hub-machines",role:"tablist","aria-label":"Machines",children:$.map(U=>h.jsx(vm,{host:U,sessions:Q(U),selected:U===ye,onSelect:()=>I(U.id)},U.id||"local"))}),ye&&h.jsx(xm,{host:ye,sessions:Q(ye)}),M&&h.jsx(hm,{onClose:()=>j(!1)}),B&&h.jsx(am,{onClose:()=>z(!1)})]})}zp();const Jf=new URLSearchParams(window.location.search),Mf=Jf.get("session");fh.createRoot(document.getElementById("root")).render(Mf?h.jsx(lm,{sessionKey:Mf,folder:Jf.get("folder")??void 0}):h.jsx(Em,{}));
|