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