@goodfish/jarvy 0.12.1 → 0.13.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.
@@ -0,0 +1,832 @@
1
+ var o8=Object.defineProperty;var qy=e=>{throw TypeError(e)};var s8=(e,a,i)=>a in e?o8(e,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[a]=i;var Wt=(e,a,i)=>s8(e,typeof a!="symbol"?a+"":a,i),Uy=(e,a,i)=>a.has(e)||qy("Cannot "+i);var Un=(e,a,i)=>(Uy(e,a,"read from private field"),i?i.call(e):a.get(e)),Fy=(e,a,i)=>a.has(e)?qy("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(e):a.set(e,i),Um=(e,a,i,r)=>(Uy(e,a,"write to private field"),r?r.call(e,i):a.set(e,i),i);function c8(e,a){for(var i=0;i<a.length;i++){const r=a[i];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const c=Object.getOwnPropertyDescriptor(r,s);c&&Object.defineProperty(e,s,c.get?c:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const c of s)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function i(s){const c={};return s.integrity&&(c.integrity=s.integrity),s.referrerPolicy&&(c.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?c.credentials="include":s.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(s){if(s.ep)return;s.ep=!0;const c=i(s);fetch(s.href,c)}})();function A0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fm={exports:{}},yc={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Vy;function u8(){if(Vy)return yc;Vy=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(r,s,c){var d=null;if(c!==void 0&&(d=""+c),s.key!==void 0&&(d=""+s.key),"key"in s){c={};for(var f in s)f!=="key"&&(c[f]=s[f])}else c=s;return s=c.ref,{$$typeof:e,type:r,key:d,ref:s!==void 0?s:null,props:c}}return yc.Fragment=a,yc.jsx=i,yc.jsxs=i,yc}var $y;function d8(){return $y||($y=1,Fm.exports=u8()),Fm.exports}var o=d8(),Vm={exports:{}},it={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Gy;function f8(){if(Gy)return it;Gy=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),b=Symbol.for("react.view_transition"),j=Symbol.iterator;function k(B){return B===null||typeof B!="object"?null:(B=j&&B[j]||B["@@iterator"],typeof B=="function"?B:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,E={};function M(B,W,ue){this.props=B,this.context=W,this.refs=E,this.updater=ue||S}M.prototype.isReactComponent={},M.prototype.setState=function(B,W){if(typeof B!="object"&&typeof B!="function"&&B!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,B,W,"setState")},M.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function C(){}C.prototype=M.prototype;function A(B,W,ue){this.props=B,this.context=W,this.refs=E,this.updater=ue||S}var _=A.prototype=new C;_.constructor=A,N(_,M.prototype),_.isPureReactComponent=!0;var R=Array.isArray;function I(){}var G={H:null,A:null,T:null,S:null},Y=Object.prototype.hasOwnProperty;function L(B,W,ue){var me=ue.ref;return{$$typeof:e,type:B,key:W,ref:me!==void 0?me:null,props:ue}}function P(B,W){return L(B.type,W,B.props)}function q(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function Z(B){var W={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(ue){return W[ue]})}var U=/\/+/g;function F(B,W){return typeof B=="object"&&B!==null&&B.key!=null?Z(""+B.key):W.toString(36)}function X(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(I,I):(B.status="pending",B.then(function(W){B.status==="pending"&&(B.status="fulfilled",B.value=W)},function(W){B.status==="pending"&&(B.status="rejected",B.reason=W)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function $(B,W,ue,me,ge){var Se=typeof B;(Se==="undefined"||Se==="boolean")&&(B=null);var Me=!1;if(B===null)Me=!0;else switch(Se){case"bigint":case"string":case"number":Me=!0;break;case"object":switch(B.$$typeof){case e:case a:Me=!0;break;case y:return Me=B._init,$(Me(B._payload),W,ue,me,ge)}}if(Me)return ge=ge(B),Me=me===""?"."+F(B,0):me,R(ge)?(ue="",Me!=null&&(ue=Me.replace(U,"$&/")+"/"),$(ge,W,ue,"",function(Ee){return Ee})):ge!=null&&(q(ge)&&(ge=P(ge,ue+(ge.key==null||B&&B.key===ge.key?"":(""+ge.key).replace(U,"$&/")+"/")+Me)),W.push(ge)),1;Me=0;var xe=me===""?".":me+":";if(R(B))for(var oe=0;oe<B.length;oe++)me=B[oe],Se=xe+F(me,oe),Me+=$(me,W,ue,Se,ge);else if(oe=k(B),typeof oe=="function")for(B=oe.call(B),oe=0;!(me=B.next()).done;)me=me.value,Se=xe+F(me,oe++),Me+=$(me,W,ue,Se,ge);else if(Se==="object"){if(typeof B.then=="function")return $(X(B),W,ue,me,ge);throw W=String(B),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return Me}function H(B,W,ue){if(B==null)return B;var me=[],ge=0;return $(B,me,"","",function(Se){return W.call(ue,Se,ge++)}),me}function ie(B){if(B._status===-1){var W=B._result,ue=W();ue.then(function(me){(B._status===0||B._status===-1)&&(B._status=1,B._result=me,ue.status===void 0&&(ue.status="fulfilled",ue.value=me))},function(me){(B._status===0||B._status===-1)&&(B._status=2,B._result=me,ue.status===void 0&&(ue.status="rejected",ue.reason=me))}),B._status===-1&&(B._status=0,B._result=ue)}if(B._status===1)return B._result.default;throw B._result}var O=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var W=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(W))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)};function le(B){var W=G.T,ue={};ue.types=W!==null?W.types:null,G.T=ue;try{var me=B(),ge=G.S;ge!==null&&ge(ue,me),typeof me=="object"&&me!==null&&typeof me.then=="function"&&me.then(I,O)}catch(Se){O(Se)}finally{W!==null&&ue.types!==null&&(W.types=ue.types),G.T=W}}function ne(B){var W=G.T;if(W!==null){var ue=W.types;ue===null?W.types=[B]:ue.indexOf(B)===-1&&ue.push(B)}else le(ne.bind(null,B))}var D={map:H,forEach:function(B,W,ue){H(B,function(){W.apply(this,arguments)},ue)},count:function(B){var W=0;return H(B,function(){W++}),W},toArray:function(B){return H(B,function(W){return W})||[]},only:function(B){if(!q(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return it.Activity=g,it.Children=D,it.Component=M,it.Fragment=i,it.Profiler=s,it.PureComponent=A,it.StrictMode=r,it.Suspense=h,it.ViewTransition=b,it.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=G,it.__COMPILER_RUNTIME={__proto__:null,c:function(B){return G.H.useMemoCache(B)}},it.addTransitionType=ne,it.cache=function(B){return function(){return B.apply(null,arguments)}},it.cacheSignal=function(){return null},it.cloneElement=function(B,W,ue){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var me=N({},B.props),ge=B.key;if(W!=null)for(Se in W.key!==void 0&&(ge=""+W.key),W)!Y.call(W,Se)||Se==="key"||Se==="__self"||Se==="__source"||Se==="ref"&&W.ref===void 0||(me[Se]=W[Se]);var Se=arguments.length-2;if(Se===1)me.children=ue;else if(1<Se){for(var Me=Array(Se),xe=0;xe<Se;xe++)Me[xe]=arguments[xe+2];me.children=Me}return L(B.type,ge,me)},it.createContext=function(B){return B={$$typeof:d,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:c,_context:B},B},it.createElement=function(B,W,ue){var me,ge={},Se=null;if(W!=null)for(me in W.key!==void 0&&(Se=""+W.key),W)Y.call(W,me)&&me!=="key"&&me!=="__self"&&me!=="__source"&&(ge[me]=W[me]);var Me=arguments.length-2;if(Me===1)ge.children=ue;else if(1<Me){for(var xe=Array(Me),oe=0;oe<Me;oe++)xe[oe]=arguments[oe+2];ge.children=xe}if(B&&B.defaultProps)for(me in Me=B.defaultProps,Me)ge[me]===void 0&&(ge[me]=Me[me]);return L(B,Se,ge)},it.createRef=function(){return{current:null}},it.forwardRef=function(B){return{$$typeof:f,render:B}},it.isValidElement=q,it.lazy=function(B){return{$$typeof:y,_payload:{_status:-1,_result:B},_init:ie}},it.memo=function(B,W){return{$$typeof:p,type:B,compare:W===void 0?null:W}},it.startTransition=le,it.unstable_useCacheRefresh=function(){return G.H.useCacheRefresh()},it.use=function(B){return G.H.use(B)},it.useActionState=function(B,W,ue){return G.H.useActionState(B,W,ue)},it.useCallback=function(B,W){return G.H.useCallback(B,W)},it.useContext=function(B){return G.H.useContext(B)},it.useDebugValue=function(){},it.useDeferredValue=function(B,W){return G.H.useDeferredValue(B,W)},it.useEffect=function(B,W){return G.H.useEffect(B,W)},it.useEffectEvent=function(B){return G.H.useEffectEvent(B)},it.useId=function(){return G.H.useId()},it.useImperativeHandle=function(B,W,ue){return G.H.useImperativeHandle(B,W,ue)},it.useInsertionEffect=function(B,W){return G.H.useInsertionEffect(B,W)},it.useLayoutEffect=function(B,W){return G.H.useLayoutEffect(B,W)},it.useMemo=function(B,W){return G.H.useMemo(B,W)},it.useOptimistic=function(B,W){return G.H.useOptimistic(B,W)},it.useReducer=function(B,W,ue){return G.H.useReducer(B,W,ue)},it.useRef=function(B){return G.H.useRef(B)},it.useState=function(B){return G.H.useState(B)},it.useSyncExternalStore=function(B,W,ue){return G.H.useSyncExternalStore(B,W,ue)},it.useTransition=function(){return G.H.useTransition()},it.version="19.3.0",it}var Yy;function M0(){return Yy||(Yy=1,Vm.exports=f8()),Vm.exports}var w=M0();const h8=A0(w),Bc=c8({__proto__:null,default:h8},[w]);var $m={exports:{}},xc={},Gm={exports:{}},Ym={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Ky;function m8(){return Ky||(Ky=1,(function(e){function a(X,$){var H=X.length;X.push($);e:for(;0<H;){var ie=H-1>>>1,O=X[ie];if(0<s(O,$))X[ie]=$,X[H]=O,H=ie;else break e}}function i(X){return X.length===0?null:X[0]}function r(X){if(X.length===0)return null;var $=X[0],H=X.pop();if(H!==$){X[0]=H;e:for(var ie=0,O=X.length,le=O>>>1;ie<le;){var ne=2*(ie+1)-1,D=X[ne],B=ne+1,W=X[B];if(0>s(D,H))B<O&&0>s(W,D)?(X[ie]=W,X[B]=H,ie=B):(X[ie]=D,X[ne]=H,ie=ne);else if(B<O&&0>s(W,H))X[ie]=W,X[B]=H,ie=B;else break e}}return $}function s(X,$){var H=X.sortIndex-$.sortIndex;return H!==0?H:X.id-$.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var h=[],p=[],y=1,g=null,b=3,j=!1,k=!1,S=!1,N=!1,E=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function A(X){for(var $=i(p);$!==null;){if($.callback===null)r(p);else if($.startTime<=X)r(p),$.sortIndex=$.expirationTime,a(h,$);else break;$=i(p)}}function _(X){if(S=!1,A(X),!k)if(i(h)!==null)k=!0,R||(R=!0,q());else{var $=i(p);$!==null&&F(_,$.startTime-X)}}var R=!1,I=-1,G=5,Y=-1;function L(){return N?!0:!(e.unstable_now()-Y<G)}function P(){if(N=!1,R){var X=e.unstable_now();Y=X;var $=!0;try{e:{k=!1,S&&(S=!1,M(I),I=-1),j=!0;var H=b;try{t:{for(A(X),g=i(h);g!==null&&!(g.expirationTime>X&&L());){var ie=g.callback;if(typeof ie=="function"){g.callback=null,b=g.priorityLevel;var O=ie(g.expirationTime<=X);if(X=e.unstable_now(),typeof O=="function"){g.callback=O,A(X),$=!0;break t}g===i(h)&&r(h),A(X)}else r(h);g=i(h)}if(g!==null)$=!0;else{var le=i(p);le!==null&&F(_,le.startTime-X),$=!1}}break e}finally{g=null,b=H,j=!1}$=void 0}}finally{$?q():R=!1}}}var q;if(typeof C=="function")q=function(){C(P)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,U=Z.port2;Z.port1.onmessage=P,q=function(){U.postMessage(null)}}else q=function(){E(P,0)};function F(X,$){I=E(function(){X(e.unstable_now())},$)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(X){X.callback=null},e.unstable_forceFrameRate=function(X){0>X||125<X?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<X?Math.floor(1e3/X):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(X){switch(b){case 1:case 2:case 3:var $=3;break;default:$=b}var H=b;b=$;try{return X()}finally{b=H}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(X,$){switch(X){case 1:case 2:case 3:case 4:case 5:break;default:X=3}var H=b;b=X;try{return $()}finally{b=H}},e.unstable_scheduleCallback=function(X,$,H){var ie=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?ie+H:ie):H=ie,X){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=H+O,X={id:y++,callback:$,priorityLevel:X,startTime:H,expirationTime:O,sortIndex:-1},H>ie?(X.sortIndex=H,a(p,X),i(h)===null&&X===i(p)&&(S?(M(I),I=-1):S=!0,F(_,H-ie))):(X.sortIndex=O,a(h,X),k||j||(k=!0,R||(R=!0,q()))),X},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(X){var $=b;return function(){var H=b;b=$;try{return X.apply(this,arguments)}finally{b=H}}}})(Ym)),Ym}var Xy;function p8(){return Xy||(Xy=1,Gm.exports=m8()),Gm.exports}var Km={exports:{}},Ln={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Qy;function g8(){if(Qy)return Ln;Qy=1;var e=M0();function a(y){var g="https://react.dev/errors/"+y;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)g+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+y+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var r={d:{f:i,r:function(){throw Error(a(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},s=Symbol.for("react.portal"),c=Symbol.for("react.recoverable"),d=Symbol.for("react.optimistic_key");function f(y,g,b){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:j==null?null:j===d?d:""+j,children:y,containerInfo:g,implementation:b}}var h=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(y,g){if(y==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return Ln.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Ln.browser=function(y){return{$$typeof:c,_reason:y}},Ln.createPortal=function(y,g){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(a(299));return f(y,g,null,b)},Ln.flushSync=function(y){var g=h.T,b=r.p;try{if(h.T=null,r.p=2,y)return y()}finally{h.T=g,r.p=b,r.d.f()}},Ln.preconnect=function(y,g){typeof y=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,r.d.C(y,g))},Ln.prefetchDNS=function(y){typeof y=="string"&&r.d.D(y)},Ln.preinit=function(y,g){if(typeof y=="string"&&g&&typeof g.as=="string"){var b=g.as,j=p(b,g.crossOrigin),k=typeof g.integrity=="string"?g.integrity:void 0,S=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;b==="style"?r.d.S(y,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:j,integrity:k,fetchPriority:S}):b==="script"&&r.d.X(y,{crossOrigin:j,integrity:k,fetchPriority:S,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},Ln.preinitModule=function(y,g){if(typeof y=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var b=p(g.as,g.crossOrigin);r.d.M(y,{crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0})}}else g==null&&r.d.M(y)},Ln.preload=function(y,g){if(typeof y=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var b=g.as,j=p(b,g.crossOrigin);r.d.L(y,b,{crossOrigin:j,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},Ln.preloadModule=function(y,g){if(typeof y=="string")if(g){var b=p(g.as,g.crossOrigin);r.d.m(y,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0})}else r.d.m(y)},Ln.requestFormReset=function(y){r.d.r(y)},Ln.unstable_batchedUpdates=function(y,g){return y(g)},Ln.useFormState=function(y,g,b){return h.H.useFormState(y,g,b)},Ln.useFormStatus=function(){return h.H.useHostTransitionStatus()},Ln.version="19.3.0",Ln}var Zy;function Sj(){if(Zy)return Km.exports;Zy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(a){console.error(a)}}return e(),Km.exports=g8(),Km.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Jy;function v8(){if(Jy)return xc;Jy=1;var e=p8(),a=M0(),i=Sj();function r(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)n+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){for(var n=t,l=n;l&&!l.alternate;)n=l,(n.flags&4098)!==0&&(t=n.return),l=n.return;for(;n.return;)n=n.return;return n.tag===3?t:null}function d(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function f(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function h(t){if(c(t)!==t)throw Error(r(188))}function p(t){var n=t.alternate;if(!n){if(n=c(t),n===null)throw Error(r(188));return n!==t?null:t}for(var l=t,u=n;;){var m=l.return;if(m===null)break;var v=m.alternate;if(v===null){if(u=m.return,u!==null){l=u;continue}break}if(m.child===v.child){for(v=m.child;v;){if(v===l)return h(m),t;if(v===u)return h(m),n;v=v.sibling}throw Error(r(188))}if(l.return!==u.return)l=m,u=v;else{for(var T=!1,z=m.child;z;){if(z===l){T=!0,l=m,u=v;break}if(z===u){T=!0,u=m,l=v;break}z=z.sibling}if(!T){for(z=v.child;z;){if(z===l){T=!0,l=v,u=m;break}if(z===u){T=!0,u=v,l=m;break}z=z.sibling}if(!T)throw Error(r(189))}}if(l.alternate!==u)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?t:n}function y(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=y(t),n!==null)return n;t=t.sibling}return null}function g(t,n,l,u,m,v){for(;t!==null;){if((t.tag===5||t.tag===27||t.tag===6)&&l(t,u,m,v)||(t.tag!==22||t.memoizedState===null)&&(n||t.tag!==5&&t.tag!==27)&&g(t.child,n,l,u,m,v))return!0;t=t.sibling}return!1}function b(t){for(t=t.return;t!==null;){if(t.tag===3||t.tag===5||t.tag===27)return t;t=t.return}return null}function j(t){var n=!1;for(t=t.return;t!==null&&(t.tag===4&&(n=!0),!(t.tag===3||t.tag===5||t.tag===27));)t=t.return;return n}function k(t){var n=[null,null],l=b(t);return l===null||S(n,t,l.child,{foundSelf:!1}),n}function S(t,n,l,u){for(;l!==null;){if(l===n)u.foundSelf=!0;else if(l.tag===5||l.tag===27||l.tag===6){if(u.foundSelf)return t[1]=l,!0;t[0]=l}else if((l.tag!==22||l.memoizedState===null)&&S(t,n,l.child,u))return!0;l=l.sibling}return!1}function N(t){switch(t.tag){case 5:case 27:case 6:return t.stateNode;case 3:return t.stateNode.containerInfo;default:throw Error(r(559))}}var E=null,M=null;function C(t,n,l){return t===l?!0:t===n?(E=t,!0):!1}function A(t,n,l){return t===l?(M=t,!1):t===n?(M!==null&&(E=t),!0):!1}function _(t){if(t===null)return null;do t=t===null?null:t.return;while(t&&t.tag!==5&&t.tag!==27&&t.tag!==3);return t||null}function R(t,n,l){for(var u=0,m=t;m;m=l(m))u++;m=0;for(var v=n;v;v=l(v))m++;for(;0<u-m;)t=l(t),u--;for(;0<m-u;)n=l(n),m--;for(;u--;){if(t===n||n!==null&&t===n.alternate)return t;t=l(t),n=l(n)}return null}var I=Object.assign,G=Symbol.for("react.element"),Y=Symbol.for("react.transitional.element"),L=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),Z=Symbol.for("react.profiler"),U=Symbol.for("react.consumer"),F=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),ie=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),le=Symbol.for("react.activity"),ne=Symbol.for("react.legacy_hidden"),D=Symbol.for("react.memo_cache_sentinel"),B=Symbol.for("react.view_transition"),W=Symbol.for("react.recoverable"),ue=Symbol.iterator;function me(t){return t===null||typeof t!="object"?null:(t=ue&&t[ue]||t["@@iterator"],typeof t=="function"?t:null)}var ge=Symbol.for("react.client.reference");function Se(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===ge?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case P:return"Fragment";case Z:return"Profiler";case q:return"StrictMode";case $:return"Suspense";case H:return"SuspenseList";case le:return"Activity";case B:return"ViewTransition"}if(typeof t=="object")switch(t.$$typeof){case L:return"Portal";case F:return t.displayName||"Context";case U:return(t._context.displayName||"Context")+".Consumer";case X:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case ie:return n=t.displayName||null,n!==null?n:Se(t.type)||"Memo";case O:n=t._payload,t=t._init;try{return Se(t(n))}catch{}}return null}var Me=Array.isArray,xe=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ee={pending:!1,data:null,method:null,action:null},Xe=[],Be=-1;function Je(t){return{current:t}}function Qe(t){0>Be||(t.current=Xe[Be],Xe[Be]=null,Be--)}function et(t,n){Be++,Xe[Be]=t.current,t.current=n}var Lt=Je(null),cn=Je(null),jn=Je(null),Xt=Je(null);function $n(t,n){switch(et(jn,n),et(cn,t),et(Lt,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Q2(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Q2(n),t=Z2(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Qe(Lt),et(Lt,t)}function Pn(){Qe(Lt),Qe(cn),Qe(jn)}function ga(t){var n=t.memoizedState;n!==null&&(es._currentValue=n.memoizedState,et(Xt,t)),n=Lt.current;var l=Z2(n,t.type);n!==l&&(et(cn,t),et(Lt,l))}function pe(t){cn.current===t&&(Qe(Lt),Qe(cn)),Xt.current===t&&(Qe(Xt),es._currentValue=Ee)}var Ce,Ge;function Ke(t){if(Ce===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);Ce=n&&n[1]||"",Ge=-1<l.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Ce+t+Ge}var ot=!1;function At(t,n){if(!t||ot)return"";ot=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(n){var ye=function(){throw Error()};if(Object.defineProperty(ye.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ye,[])}catch(Oe){var J=Oe}Reflect.construct(t,[],ye)}else{try{ye.call()}catch(Oe){J=Oe}ye=!1;try{var re=Object.getOwnPropertyDescriptor(t.prototype,"props");Object.defineProperty(t.prototype,"props",{configurable:!0,set:function(){throw Error()}}),ye=!0,new t}finally{ye&&(re!==void 0?Object.defineProperty(t.prototype,"props",re):delete t.prototype.props)}}}else{try{throw Error()}catch(Oe){J=Oe}(ye=t())&&typeof ye.catch=="function"&&ye.catch(function(){})}}catch(Oe){if(Oe&&J&&typeof Oe.stack=="string")return[Oe.stack,J.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=u.DetermineComponentFrameRoot(),T=v[0],z=v[1];if(T&&z){var K=T.split(`
44
+ `),te=z.split(`
45
+ `);for(m=u=0;u<K.length&&!K[u].includes("DetermineComponentFrameRoot");)u++;for(;m<te.length&&!te[m].includes("DetermineComponentFrameRoot");)m++;if(u===K.length||m===te.length)for(u=K.length-1,m=te.length-1;1<=u&&0<=m&&K[u]!==te[m];)m--;for(;1<=u&&0<=m;u--,m--)if(K[u]!==te[m]){if(u!==1||m!==1)do if(u--,m--,0>m||K[u]!==te[m]){var ce=`
46
+ `+K[u].replace(" at new "," at ");return t.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",t.displayName)),ce}while(1<=u&&0<=m);break}}}finally{ot=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?Ke(l):""}function Qt(t,n){switch(t.tag){case 26:case 27:case 5:return Ke(t.type);case 16:return Ke("Lazy");case 13:return t.child!==n&&n!==null?Ke("Suspense Fallback"):Ke("Suspense");case 19:return Ke("SuspenseList");case 0:case 15:return At(t.type,!1);case 11:return At(t.type.render,!1);case 1:return At(t.type,!0);case 31:return Ke("Activity");case 30:return Ke("ViewTransition");default:return""}}function de(t){try{var n="",l=null;do n+=Qt(t,l),l=t,t=t.return;while(t);return n}catch(u){return`
47
+ Error generating stack: `+u.message+`
48
+ `+u.stack}}var Te=Object.prototype.hasOwnProperty,Re=e.unstable_scheduleCallback,Ie=e.unstable_cancelCallback,He=e.unstable_shouldYield,at=e.unstable_requestPaint,Gt=e.unstable_now,za=e.unstable_getCurrentPriorityLevel,Gn=e.unstable_ImmediatePriority,kt=e.unstable_UserBlockingPriority,gn=e.unstable_NormalPriority,vo=e.unstable_LowPriority,Ki=e.unstable_IdlePriority,bl=e.log,va=e.unstable_setDisableYieldValue,yi=null,Ht=null;function tn(t){if(typeof bl=="function"&&va(t),Ht&&typeof Ht.setStrictMode=="function")try{Ht.setStrictMode(yi,t)}catch{}}var on=Math.clz32?Math.clz32:Wa,xi=Math.log,Ja=Math.LN2;function Wa(t){return t>>>=0,t===0?32:31-(xi(t)/Ja|0)|0}var ei=256,La=262144,aa=4194304;function ti(t){var n=t&42;if(n!==0)return n;switch(t&-t){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&-t;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function ya(t,n,l){var u=t.pendingLanes;if(u===0)return 0;var m=0,v=t.suspendedLanes,T=t.pingedLanes;t=t.warmLanes;var z=u&134217727;return z!==0?(u=z&~v,u!==0?m=ti(u):(T&=z,T!==0?m=ti(T):l||(l=z&~t,l!==0&&(m=ti(l))))):(z=u&~v,z!==0?m=ti(z):T!==0?m=ti(T):l||(l=u&~t,l!==0&&(m=ti(l)))),m===0?0:n!==0&&n!==m&&(n&v)===0&&(v=m&-m,l=n&-n,v>=l||v===32&&(l&4194048)!==0)?n:m}function ia(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function bi(t,n){(n&8)!==0&&(n|=n&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=n;0<l;){var u=31-on(l),m=1<<u;n|=t[u],l&=~m}return n}function jl(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32: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 n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function xa(){var t=aa;return aa<<=1,(aa&62914560)===0&&(aa=4194304),t}function Cr(t){for(var n=[],l=0;31>l;l++)n.push(t);return n}function ni(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Nr(t,n,l,u,m,v){var T=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var z=t.entanglements,K=t.expirationTimes,te=t.hiddenUpdates;for(l=T&~l;0<l;){var ce=31-on(l),ye=1<<ce;z[ce]=0,K[ce]=-1;var J=te[ce];if(J!==null)for(te[ce]=null,ce=0;ce<J.length;ce++){var re=J[ce];re!==null&&(re.lane&=-536870913)}l&=~ye}u!==0&&ba(t,u,0),v!==0&&m===0&&t.tag!==0&&(t.suspendedLanes|=v&~(T&~n))}function ba(t,n,l){t.pendingLanes|=n,t.suspendedLanes&=~n;var u=31-on(n);t.entangledLanes|=n,t.entanglements[u]=t.entanglements[u]|1073741824|l&261930}function Er(t,n){var l=t.entangledLanes|=n;for(t=t.entanglements;l;){var u=31-on(l),m=1<<u;m&n|t[u]&n&&(t[u]|=n),l&=~m}}function Ba(t,n){var l=n&-n;return l=(l&42)!==0?1:Ia(l),(l&(t.suspendedLanes|n))!==0?0:l}function Ia(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Yn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Ft(){var t=oe.p;return t!==0?t:(t=window.event,t===void 0?32:Dy(t.type))}function wn(t,n){var l=oe.p;try{return oe.p=t,n()}finally{oe.p=l}}var Zt=Math.random().toString(36).slice(2),Vt="__reactFiber$"+Zt,vn="__reactProps$"+Zt,nn="__reactContainer$"+Zt,wl="__reactEvents$"+Zt,Tr="__reactListeners$"+Zt,ji="__reactHandles$"+Zt,Pa="__reactResources$"+Zt,Xi="__reactMarker$"+Zt,Ar="__reactLoad$"+Zt;function Mr(t){delete t[Vt],delete t[vn],delete t[Tr],delete t[ji]}function ja(t){var n;if(n=t[Vt])return n;for(var l=t.parentNode;l;){if(n=l[nn]||l[Vt]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(t=my(t);t!==null;){if(l=t[Vt])return l;t=my(t)}return n}t=l,l=t.parentNode}return null}function wi(t){if(t=t[Vt]||t[nn]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function se(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(r(33))}function be(t){var n=t[Pa];return n||(n=t[Pa]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function je(t){t[Xi]=!0}function Ve(t){t[Ar]=void 0}var tt=new Set,V={};function fe(t,n){ke(t,n),ke(t+"Capture",n)}function ke(t,n){for(V[t]=n,t=0;t<n.length;t++)tt.add(n[t])}var qe=RegExp("^[: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]*$"),De={},$e={};function ze(t){return Te.call($e,t)?!0:Te.call(De,t)?!1:qe.test(t)?$e[t]=!0:(De[t]=!0,!1)}var Le=!1;function dt(){var t=Le;return Le=!1,t}function lt(t,n,l){if(ze(n))if(l===null)t.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var u=n.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,l)}}function an(t,n,l){if(l===null)t.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,l)}}function Ct(t,n,l,u){if(u===null)t.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(n,l,u)}}function Nt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function yo(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Es(t,n,l){var u=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var m=u.get,v=u.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return m.call(this)},set:function(T){l=""+T,v.call(this,T)}}),Object.defineProperty(t,n,{enumerable:u.enumerable}),{getValue:function(){return l},setValue:function(T){l=""+T},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function Qi(t){if(!t._valueTracker){var n=yo(t)?"checked":"value";t._valueTracker=Es(t,n,""+t[n])}}function xo(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var l=n.getValue(),u="";return t&&(u=yo(t)?t.checked?"true":"false":t.value),t=u,t!==l?(n.setValue(t),!0):!1}var Zc=/[\n"\\]/g;function $t(t){return t.replace(Zc,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Hn(t,n,l,u,m,v,T,z){t.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?t.type=T:t.removeAttribute("type"),n!=null?T==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Nt(n)):t.value!==""+Nt(n)&&(t.value=""+Nt(n)):T!=="submit"&&T!=="reset"||t.removeAttribute("value"),n!=null?T==="number"&&t.value==n?bo(t,Nt(t.value)):bo(t,Nt(n)):l!=null?bo(t,Nt(l)):u!=null&&t.removeAttribute("value"),m==null&&v!=null&&(t.defaultChecked=!!v),m!=null&&(t.checked=m&&typeof m!="function"&&typeof m!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?t.name=""+Nt(z):t.removeAttribute("name")}function _r(t,n,l,u,m,v,T,z){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(t.type=v),n!=null||l!=null){if(!(v!=="submit"&&v!=="reset"||n!=null)){Qi(t);return}l=l!=null?""+Nt(l):"",n=n!=null?""+Nt(n):l,z||n===t.value||(t.value=n),t.defaultValue=n}u=u??m,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=z?t.checked:!!u,t.defaultChecked=!!u,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(t.name=T),Qi(t)}function bo(t,n){t.defaultValue!==""+n&&(t.defaultValue=""+n)}function ra(t,n,l,u){if(t=t.options,n){n={};for(var m=0;m<l.length;m++)n["$"+l[m]]=!0;for(l=0;l<t.length;l++)m=n.hasOwnProperty("$"+t[l].value),t[l].selected!==m&&(t[l].selected=m),m&&u&&(t[l].defaultSelected=!0)}else{for(l=""+Nt(l),n=null,m=0;m<t.length;m++){if(t[m].value===l){t[m].selected=!0,u&&(t[m].defaultSelected=!0);return}n!==null||t[m].disabled||(n=t[m])}n!==null&&(n.selected=!0)}}function jo(t,n,l){if(n!=null&&(n=""+Nt(n),n!==t.value&&(t.value=n),l==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=l!=null?""+Nt(l):""}function wa(t,n,l,u){if(n==null){if(u!=null){if(l!=null)throw Error(r(92));if(Me(u)){if(1<u.length)throw Error(r(93));u=u[0]}l=u}l==null&&(l=""),n=l}l=Nt(n),t.defaultValue=l,u=t.textContent,u===l&&u!==""&&u!==null&&(t.value=u),Qi(t)}function Kn(t,n){if(n){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=n;return}}t.textContent=n}var Rr=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ts(t,n,l){var u=n.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?u?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":u?t.setProperty(n,l):typeof l!="number"||l===0||Rr.has(n)?n==="float"?t.cssFloat=l:t[n]=(""+l).trim():t[n]=l+"px"}function ka(t,n,l){if(n!=null&&typeof n!="object")throw Error(r(62));if(t=t.style,l!=null){for(var u in l)!l.hasOwnProperty(u)||n!=null&&n.hasOwnProperty(u)||(u.indexOf("--")===0?t.setProperty(u,""):u==="float"?t.cssFloat="":t[u]="",Le=!0);for(var m in n)u=n[m],n.hasOwnProperty(m)&&l[m]!==u&&(Ts(t,m,u),Le=!0)}else for(var v in n)n.hasOwnProperty(v)&&Ts(t,v,n[v])}function kl(t){if(t.indexOf("-")===-1)return!1;switch(t){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 As=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Ms=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function An(t){return Ms.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Xn(){}var Sl=null;function Cl(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var bt=null,kn=null;function Ha(t){var n=wi(t);if(n&&(t=n.stateNode)){var l=t[vn]||null;e:switch(t=n.stateNode,n.type){case"input":if(Hn(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),n=l.name,l.type==="radio"&&n!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+$t(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var u=l[n];if(u!==t&&u.form===t.form){var m=u[vn]||null;if(!m)throw Error(r(90));Hn(u,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(n=0;n<l.length;n++)u=l[n],u.form===t.form&&xo(u)}break e;case"textarea":jo(t,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&ra(t,!!l.multiple,n,!1)}}}var Sa=!1;function Nl(t,n,l){if(Sa)return t(n,l);Sa=!0;try{var u=t(n);return u}finally{if(Sa=!1,(bt!==null||kn!==null)&&(Zu(),bt&&(n=bt,t=kn,kn=bt=null,Ha(n),t)))for(n=0;n<t.length;n++)Ha(t[n])}}function Zi(t,n){var l=t.stateNode;if(l===null)return null;var u=l[vn]||null;if(u===null)return null;l=u[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(t=t.type,u=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!u;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(r(231,n,typeof l));return l}var Mn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),El=!1;if(Mn)try{var _s={};Object.defineProperty(_s,"passive",{get:function(){El=!0}}),window.addEventListener("test",_s,_s),window.removeEventListener("test",_s,_s)}catch{El=!1}var Or=null,Nf=null,Jc=null;function Gg(){if(Jc)return Jc;var t,n=Nf,l=n.length,u,m="value"in Or?Or.value:Or.textContent,v=m.length;for(t=0;t<l&&n[t]===m[t];t++);var T=l-t;for(u=1;u<=T&&n[l-u]===m[v-u];u++);return Jc=m.slice(t,1<u?1-u:void 0)}function Wc(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function eu(){return!0}function Yg(){return!1}function Qn(t){function n(l,u,m,v,T){this._reactName=l,this._targetInst=m,this.type=u,this.nativeEvent=v,this.target=T,this.currentTarget=null;for(var z in t)t.hasOwnProperty(z)&&(l=t[z],this[z]=l?l(v):v[z]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?eu:Yg,this.isPropagationStopped=Yg,this}return I(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=eu)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=eu)},persist:function(){},isPersistent:eu}),n}var Dr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},tu=Qn(Dr),Rs=I({},Dr,{view:0,detail:0}),RS=Qn(Rs),Ef,Tf,Os,nu=I({},Rs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mf,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Os&&(Os&&t.type==="mousemove"?(Ef=t.screenX-Os.screenX,Tf=t.screenY-Os.screenY):Tf=Ef=0,Os=t),Ef)},movementY:function(t){return"movementY"in t?t.movementY:Tf}}),Kg=Qn(nu),OS=I({},nu,{dataTransfer:0}),DS=Qn(OS),zS=I({},Rs,{relatedTarget:0}),Af=Qn(zS),LS=I({},Dr,{animationName:0,elapsedTime:0,pseudoElement:0}),BS=Qn(LS),IS=I({},Dr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),PS=Qn(IS),HS=I({},Dr,{data:0}),Xg=Qn(HS),qS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},US={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"},FS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function VS(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=FS[t])?!!n[t]:!1}function Mf(){return VS}var $S=I({},Rs,{key:function(t){if(t.key){var n=qS[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=Wc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?US[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mf,charCode:function(t){return t.type==="keypress"?Wc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Wc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),GS=Qn($S),YS=I({},nu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Qg=Qn(YS),KS=I({},Dr,{submitter:0}),XS=Qn(KS),QS=I({},Rs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mf}),ZS=Qn(QS),JS=I({},Dr,{propertyName:0,elapsedTime:0,pseudoElement:0}),WS=Qn(JS),e6=I({},nu,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),t6=Qn(e6),n6=I({},Dr,{newState:0,oldState:0,source:0}),a6=Qn(n6),i6=[9,13,27,32],_f=Mn&&"CompositionEvent"in window,Ds=null;Mn&&"documentMode"in document&&(Ds=document.documentMode);var r6=Mn&&"TextEvent"in window&&!Ds,Zg=Mn&&(!_f||Ds&&8<Ds&&11>=Ds),Jg=" ",Wg=!1;function e1(t,n){switch(t){case"keyup":return i6.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function t1(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var wo=!1;function l6(t,n){switch(t){case"compositionend":return t1(n);case"keypress":return n.which!==32?null:(Wg=!0,Jg);case"textInput":return t=n.data,t===Jg&&Wg?null:t;default:return null}}function o6(t,n){if(wo)return t==="compositionend"||!_f&&e1(t,n)?(t=Gg(),Jc=Nf=Or=null,wo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Zg&&n.locale!=="ko"?null:n.data;default:return null}}var s6={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 n1(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!s6[t.type]:n==="textarea"}function a1(t,n,l,u){bt?kn?kn.push(u):kn=[u]:bt=u,n=ad(n,"onChange"),0<n.length&&(l=new tu("onChange","change",null,l,u),t.push({event:l,listeners:n}))}var zs=null,Ls=null;function c6(t){V2(t,0)}function au(t){var n=se(t);if(xo(n))return t}function i1(t,n){if(t==="change")return n}var r1=!1;if(Mn){var Rf;if(Mn){var Of="oninput"in document;if(!Of){var l1=document.createElement("div");l1.setAttribute("oninput","return;"),Of=typeof l1.oninput=="function"}Rf=Of}else Rf=!1;r1=Rf&&(!document.documentMode||9<document.documentMode)}function o1(){zs&&(zs.detachEvent("onpropertychange",s1),Ls=zs=null)}function s1(t){if(t.propertyName==="value"&&au(Ls)){var n=[];a1(n,Ls,t,Cl(t)),Nl(c6,n)}}function u6(t,n,l){t==="focusin"?(o1(),zs=n,Ls=l,zs.attachEvent("onpropertychange",s1)):t==="focusout"&&o1()}function d6(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return au(Ls)}function f6(t,n){if(t==="click")return au(n)}function h6(t,n){if(t==="input"||t==="change")return au(n)}function m6(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var Ca=typeof Object.is=="function"?Object.is:m6;function Bs(t,n){if(Ca(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var l=Object.keys(t),u=Object.keys(n);if(l.length!==u.length)return!1;for(u=0;u<l.length;u++){var m=l[u];if(!Te.call(n,m)||!Ca(t[m],n[m]))return!1}return!0}function Df(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function c1(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function u1(t,n){var l=c1(t);t=0;for(var u;l;){if(l.nodeType===3){if(u=t+l.textContent.length,t<=n&&u>=n)return{node:l,offset:n-t};t=u}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=c1(l)}}function d1(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?d1(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function f1(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=Df(t.document);n instanceof t.HTMLIFrameElement;){try{var l=typeof n.contentWindow.location.href=="string"}catch{l=!1}if(l)t=n.contentWindow;else break;n=Df(t.document)}return n}function zf(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var p6=Mn&&"documentMode"in document&&11>=document.documentMode,ko=null,Lf=null,Is=null,Bf=!1;function h1(t,n,l){var u=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Bf||ko==null||ko!==Df(u)||(u=ko,"selectionStart"in u&&zf(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Is&&Bs(Is,u)||(Is=u,u=ad(Lf,"onSelect"),0<u.length&&(n=new tu("onSelect","select",null,n,l),t.push({event:n,listeners:u}),n.target=ko)))}function Tl(t,n){var l={};return l[t.toLowerCase()]=n.toLowerCase(),l["Webkit"+t]="webkit"+n,l["Moz"+t]="moz"+n,l}var So={animationend:Tl("Animation","AnimationEnd"),animationiteration:Tl("Animation","AnimationIteration"),animationstart:Tl("Animation","AnimationStart"),transitionrun:Tl("Transition","TransitionRun"),transitionstart:Tl("Transition","TransitionStart"),transitioncancel:Tl("Transition","TransitionCancel"),transitionend:Tl("Transition","TransitionEnd")},If={},m1={};Mn&&(m1=document.createElement("div").style,"AnimationEvent"in window||(delete So.animationend.animation,delete So.animationiteration.animation,delete So.animationstart.animation),"TransitionEvent"in window||delete So.transitionend.transition);function Al(t){if(If[t])return If[t];if(!So[t])return t;var n=So[t],l;for(l in n)if(n.hasOwnProperty(l)&&l in m1)return If[t]=n[l];return t}var p1=Al("animationend"),g1=Al("animationiteration"),v1=Al("animationstart"),g6=Al("transitionrun"),v6=Al("transitionstart"),y6=Al("transitioncancel"),y1=Al("transitionend"),x1=new Map,Pf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");Pf.push("scrollEnd");function ai(t,n){x1.set(t,n),fe(n,[t])}var x6=0;function Ji(t,n){if(t.name!=null&&t.name!=="auto")return t.name;if(n.autoName!==null)return n.autoName;t=oi.identifierPrefix;var l=x6++;return t="_"+t+"t_"+l.toString(32)+"_",n.autoName=t}function b1(t){if(t==null||typeof t=="string")return t;var n=null,l=Vo;if(l!==null)for(var u=0;u<l.length;u++){var m=t[l[u]];if(m!=null){if(m==="none")return"none";n=n==null?m:n+(" "+m)}}return n??t.default}function Wi(t,n){return t=b1(t),n=b1(n),n==null?t==="auto"?null:t:n==="auto"?null:n}var iu=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},qa=[],Co=0,Hf=0;function ru(){for(var t=Co,n=Hf=Co=0;n<t;){var l=qa[n];qa[n++]=null;var u=qa[n];qa[n++]=null;var m=qa[n];qa[n++]=null;var v=qa[n];if(qa[n++]=null,u!==null&&m!==null){var T=u.pending;T===null?m.next=m:(m.next=T.next,T.next=m),u.pending=m}v!==0&&j1(l,m,v)}}function lu(t,n,l,u){qa[Co++]=t,qa[Co++]=n,qa[Co++]=l,qa[Co++]=u,Hf|=u,t.lanes|=u,t=t.alternate,t!==null&&(t.lanes|=u)}function qf(t,n,l,u){return lu(t,n,l,u),ou(t)}function Ml(t,n){return lu(t,null,null,n),ou(t)}function j1(t,n,l){t.lanes|=l;var u=t.alternate;u!==null&&(u.lanes|=l);for(var m=!1,v=t.return;v!==null;)v.childLanes|=l,u=v.alternate,u!==null&&(u.childLanes|=l),v.tag===22&&(t=v.stateNode,t===null||t._visibility&1||(m=!0)),t=v,v=v.return;return t.tag===3?(v=t.stateNode,m&&n!==null&&(m=31-on(l),t=v.hiddenUpdates,u=t[m],u===null?t[m]=[n]:u.push(n),n.lane=l|536870912),v):null}function ou(t){if(50<lc)throw lc=0,Qu=null,Error(r(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var No={};function b6(t,n,l,u){this.tag=t,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function la(t,n,l,u){return new b6(t,n,l,u)}function Uf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function er(t,n){var l=t.alternate;return l===null?(l=la(t.tag,n,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=n,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&1206910976,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,n=t.dependencies,l.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function w1(t,n){t.flags&=1206910978;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,n=l.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function su(t,n,l,u,m,v){var T=0;if(u=t,typeof u=="function")Uf(u)&&(T=1);else if(typeof u=="string")T=KC(t,l,Lt.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(u){case le:return t=la(31,l,n,m),t.elementType=le,t.lanes=v,t;case P:return _l(l.children,m,v,n);case q:T=8,m|=24;break;case Z:return t=la(12,l,n,m|2),t.elementType=Z,t.lanes=v,t;case $:return t=la(13,l,n,m),t.elementType=$,t.lanes=v,t;case H:return t=la(19,l,n,m),t.elementType=H,t.lanes=v,t;case ne:case B:return t=m|32,t=la(30,l,n,t),t.elementType=B,t.lanes=v,t.stateNode={autoName:null,paired:null,clones:null,ref:null},t;default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case F:T=10;break e;case U:T=9;break e;case X:T=11;break e;case ie:T=14;break e;case O:T=16,u=null;break e}T=29,l=Error(r(130,t===null?"null":typeof t,"")),u=null}return n=la(T,l,n,m),n.elementType=t,n.type=u,n.lanes=v,n}function _l(t,n,l,u){return t=la(7,t,u,n),t.lanes=l,t}function Ff(t,n,l){return t=la(6,t,null,n),t.lanes=l,t}function k1(t){var n=la(18,null,null,0);return n.stateNode=t,n}function Vf(t,n,l){return n=la(4,t.children!==null?t.children:[],t.key,n),n.lanes=l,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var S1=new WeakMap;function Ua(t,n){if(typeof t=="object"&&t!==null){var l=S1.get(t);return l!==void 0?l:(n={value:t,source:n,stack:de(n)},S1.set(t,n),n)}return{value:t,source:n,stack:de(n)}}var Eo=[],To=0,cu=null,Ps=0,Fa=[],Va=0,zr=null,ki=1,Si="";function tr(t,n){Eo[To++]=Ps,Eo[To++]=cu,cu=t,Ps=n}function C1(t,n,l){Fa[Va++]=ki,Fa[Va++]=Si,Fa[Va++]=zr,zr=t;var u=ki;t=Si;var m=32-on(u)-1;u&=~(1<<m),l+=1;var v=32-on(n)+m;if(30<v){var T=m-m%5;v=(u&(1<<T)-1).toString(32),u>>=T,m-=T,ki=1<<32-on(n)+m|l<<m|u,Si=v+t}else ki=1<<v|l<<m|u,Si=t}function uu(t){t.return!==null&&(tr(t,1),C1(t,1,0))}function $f(t){for(;t===cu;)cu=Eo[--To],Eo[To]=null,Ps=Eo[--To],Eo[To]=null;for(;t===zr;)zr=Fa[--Va],Fa[Va]=null,Si=Fa[--Va],Fa[Va]=null,ki=Fa[--Va],Fa[Va]=null}function N1(t,n){Fa[Va++]=ki,Fa[Va++]=Si,Fa[Va++]=zr,ki=n.id,Si=n.overflow,zr=t}var Sn=null,qt=null,ut=!1,Lr=null,$a=!1,Gf=Error(r(519));function Br(t){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Hs(Ua(n,t)),Gf}function E1(t){var n=t.stateNode,l=t.type,u=t.memoizedProps;switch(n[Vt]=t,n[vn]=u,l){case"dialog":ht("cancel",n),ht("close",n);break;case"iframe":case"object":case"embed":ht("load",n);break;case"video":case"audio":for(l=0;l<sc.length;l++)ht(sc[l],n);break;case"source":ht("error",n);break;case"img":case"image":case"link":ht("error",n),ht("load",n);break;case"details":ht("toggle",n);break;case"input":ht("invalid",n),_r(n,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":ht("invalid",n);break;case"textarea":ht("invalid",n),wa(n,u.value,u.defaultValue,u.children)}l=u.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||n.textContent===""+l||u.suppressHydrationWarning===!0||K2(n.textContent,l)?(u.popover!=null&&(ht("beforetoggle",n),ht("toggle",n)),u.onScroll!=null&&ht("scroll",n),u.onScrollEnd!=null&&ht("scrollend",n),u.onClick!=null&&(n.onclick=Xn),n=!0):n=!1,n||Br(t,!0)}function du(t){for(Sn=t.return;Sn;)switch(Sn.tag){case 5:case 31:case 13:$a=!1;return;case 27:case 3:$a=!0;return;default:Sn=Sn.return}}function Ao(t){if(t!==Sn)return!1;if(!ut)return du(t),ut=!0,!1;var n=t.tag,l;if((l=n!==3&&n!==27)&&((l=n===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||wm(t.type,t.memoizedProps)),l=!l),l&&qt&&Br(t),du(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));qt=hy(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));qt=hy(t)}else n===27?(n=qt,Wr(t.type)?(t=_m,_m=null,qt=t):qt=n):qt=Sn?Ya(t.stateNode.nextSibling):null;return!0}function Rl(){qt=Sn=null,ut=!1}function Yf(){var t=Lr;return t!==null&&(ca===null?ca=t:ca.push.apply(ca,t),Lr=null),t}function Hs(t){Lr===null?Lr=[t]:Lr.push(t)}var Kf=Je(null),Ol=null,nr=null;function Ir(t,n,l){et(Kf,n._currentValue),n._currentValue=l}function ar(t){t._currentValue=Kf.current,Qe(Kf)}function fu(t,n,l){for(;t!==null;){var u=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,u!==null&&(u.childLanes|=n)):u!==null&&(u.childLanes&n)!==n&&(u.childLanes|=n),t===l)break;t=t.return}}function Xf(t,n,l,u){var m=t.child;for(m!==null&&(m.return=t);m!==null;){var v=m.dependencies;if(v!==null){var T=m.child;v=v.firstContext;e:for(;v!==null;){var z=v;v=m;for(var K=0;K<n.length;K++)if(z.context===n[K]){v.lanes|=l,z=v.alternate,z!==null&&(z.lanes|=l),fu(v.return,l,t),u||(T=null);break e}v=z.next}}else if(m.tag===18){if(T=m.return,T===null)throw Error(r(341));T.lanes|=l,v=T.alternate,v!==null&&(v.lanes|=l),fu(T,l,t),T=null}else m.tag===13&&m.memoizedState!==null&&m.memoizedState.dehydrated===null?(m.lanes|=l,T=m.alternate,T!==null&&(T.lanes|=l),fu(m.return,l,t),T=m.child,T=T!==null?T.sibling:null):T=m.child;if(T!==null)T.return=m;else for(T=m;T!==null;){if(T===t){T=null;break}if(m=T.sibling,m!==null){m.return=T.return,T=m;break}T=T.return}m=T}}function Dl(t,n,l,u){t=null;for(var m=n,v=!1;m!==null;){if(!v){if((m.flags&524288)!==0)v=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var T=m.alternate;if(T===null)throw Error(r(387));if(T=T.memoizedProps,T!==null){var z=m.type;Ca(m.pendingProps.value,T.value)||(t!==null?t.push(z):t=[z])}}else if(m===Xt.current){if(T=m.alternate,T===null)throw Error(r(387));T.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(t!==null?t.push(es):t=[es])}m=m.return}return t!==null&&Xf(n,t,l,u),n.flags|=262144,t!==null}function hu(t){for(t=t.firstContext;t!==null;){if(!Ca(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function zl(t){Ol=t,nr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function _n(t){return T1(Ol,t)}function mu(t,n){return Ol===null&&zl(t),T1(t,n)}function T1(t,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},nr===null){if(t===null)throw Error(r(308));nr=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else nr=nr.next=n;return l}var j6=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(l,u){t.push(u)}};this.abort=function(){n.aborted=!0,t.forEach(function(l){return l()})}},w6=e.unstable_scheduleCallback,k6=e.unstable_NormalPriority,un={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qf(){return{controller:new j6,data:new Map,refCount:0}}function qs(t){t.refCount--,t.refCount===0&&w6(k6,function(){t.controller.abort()})}function A1(t,n){if((t.pendingLanes&4194048)!==0){var l=t.transitionTypes;for(l===null&&(l=t.transitionTypes=[]),t=0;t<n.length;t++){var u=n[t];l.indexOf(u)===-1&&l.push(u)}}}var Us=null;function S6(t){var n=t.transitionTypes;return t.transitionTypes=null,n}var Fs=null,Zf=0,Ll=0,Mo=null;function C6(t,n){if(Fs===null){var l=Fs=[];Zf=0,Ll=hm(),Mo={status:"pending",value:void 0,then:function(u){l.push(u)}}}return Zf++,n.then(M1,M1),n}function M1(){if(--Zf===0&&(Us=null,Fs!==null)){Mo!==null&&(Mo.status="fulfilled");var t=Fs;Fs=null,Ll=0,Mo=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function N6(t,n){var l=[],u={status:"pending",value:null,reason:null,then:function(m){l.push(m)}};return t.then(function(){u.status="fulfilled",u.value=n;for(var m=0;m<l.length;m++)(0,l[m])(n)},function(m){for(u.status="rejected",u.reason=m,m=0;m<l.length;m++)(0,l[m])(void 0)}),u}var _1=xe.S;xe.S=function(t,n){if(k2=Gt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&C6(t,n),Us!==null)for(var l=Ko;l!==null;)A1(l,Us),l=l.next;if(l=t.types,l!==null){for(var u=Ko;u!==null;)A1(u,l),u=u.next;if(Ll!==0){u=Us,u===null&&(u=Us=[]);for(var m=0;m<l.length;m++){var v=l[m];u.indexOf(v)===-1&&u.push(v)}}}_1!==null&&_1(t,n)};var Bl=Je(null);function Jf(){var t=Bl.current;return t!==null?t:Bt.pooledCache}function pu(t,n){n===null?et(Bl,Bl.current):et(Bl,n.pool)}function R1(){var t=Jf();return t===null?null:{parent:un._currentValue,pool:t}}var _o=Error(r(460)),Wf=Error(r(474)),gu=Error(r(542)),vu={then:function(){}};function O1(t){return t=t.status,t==="fulfilled"||t==="rejected"}function D1(t,n,l){switch(l=t[l],l===void 0?t.push(n):l!==n&&(n.then(Xn,Xn),n=l),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,L1(t),t===void 0&&!("reason"in n)?Error(r(600)):t;default:if(typeof n.status=="string")n.then(Xn,Xn);else{if(t=Bt,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=n,t.status="pending",t.then(function(u){if(n.status==="pending"){var m=n;m.status="fulfilled",m.value=u}},function(u){if(n.status==="pending"){var m=n;m.status="rejected",m.reason=u}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,L1(t),t}throw Pl=n,_o}}function Il(t){try{var n=t._init;return n(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Pl=l,_o):l}}var Pl=null;function z1(){if(Pl===null)throw Error(r(459));var t=Pl;return Pl=null,t}function L1(t){if(t===_o||t===gu)throw Error(r(483))}var Ro=null,Vs=0;function yu(t){var n=Vs;return Vs+=1,Ro===null&&(Ro=[]),D1(Ro,t,n)}function Pr(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function xu(t,n){throw n.$$typeof===G?Error(r(525)):(t=Object.prototype.toString.call(n),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function B1(t){function n(ee,Q){if(t){var ae=ee.deletions;ae===null?(ee.deletions=[Q],ee.flags|=16):ae.push(Q)}}function l(ee,Q){if(!t)return null;for(;Q!==null;)n(ee,Q),Q=Q.sibling;return null}function u(ee){for(var Q=new Map;ee!==null;)ee.key===null?Q.set(ee.index,ee):Q.set(ee.key,ee),ee=ee.sibling;return Q}function m(ee,Q){return ee=er(ee,Q),ee.index=0,ee.sibling=null,ee}function v(ee,Q,ae){return ee.index=ae,t?(ae=ee.alternate,ae!==null?(ae=ae.index,ae<Q?(ee.flags|=2,Q):ae):(ee.flags|=134217730,Q)):(ee.flags|=1048576,Q)}function T(ee){return t&&ee.alternate===null&&(ee.flags|=134217730),ee}function z(ee,Q,ae,ve){return Q===null||Q.tag!==6?(Q=Ff(ae,ee.mode,ve),Q.return=ee,Q):(Q=m(Q,ae),Q.return=ee,Q)}function K(ee,Q,ae,ve){var Pe=ae.type;return Pe===P?(ee=ce(ee,Q,ae.props.children,ve,ae.key),Pr(ee,ae),ee):Q!==null&&(Q.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===O&&Il(Pe)===Q.type)?(Q=m(Q,ae.props),Pr(Q,ae),Q.return=ee,Q):(Q=su(ae.type,ae.key,ae.props,null,ee.mode,ve),Pr(Q,ae),Q.return=ee,Q)}function te(ee,Q,ae,ve){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==ae.containerInfo||Q.stateNode.implementation!==ae.implementation?(Q=Vf(ae,ee.mode,ve),Q.return=ee,Q):(Q=m(Q,ae.children||[]),Q.return=ee,Q)}function ce(ee,Q,ae,ve,Pe){return Q===null||Q.tag!==7?(Q=_l(ae,ee.mode,ve,Pe),Q.return=ee,Q):(Q=m(Q,ae),Q.return=ee,Q)}function ye(ee,Q,ae){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Q=Ff(""+Q,ee.mode,ae),Q.return=ee,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case Y:return ae=su(Q.type,Q.key,Q.props,null,ee.mode,ae),Pr(ae,Q),ae.return=ee,ae;case L:return Q=Vf(Q,ee.mode,ae),Q.return=ee,Q;case O:return Q=Il(Q),ye(ee,Q,ae)}if(Me(Q)||me(Q))return Q=_l(Q,ee.mode,ae,null),Q.return=ee,Q;if(typeof Q.then=="function")return ye(ee,yu(Q),ae);if(Q.$$typeof===F)return ye(ee,mu(ee,Q),ae);xu(ee,Q)}return null}function J(ee,Q,ae,ve){var Pe=Q!==null?Q.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return Pe!==null?null:z(ee,Q,""+ae,ve);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case Y:return ae.key===Pe?K(ee,Q,ae,ve):null;case L:return ae.key===Pe?te(ee,Q,ae,ve):null;case O:return ae=Il(ae),J(ee,Q,ae,ve)}if(Me(ae)||me(ae))return Pe!==null?null:ce(ee,Q,ae,ve,null);if(typeof ae.then=="function")return J(ee,Q,yu(ae),ve);if(ae.$$typeof===F)return J(ee,Q,mu(ee,ae),ve);xu(ee,ae)}return null}function re(ee,Q,ae,ve,Pe){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return ee=ee.get(ae)||null,z(Q,ee,""+ve,Pe);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case Y:return ee=ee.get(ve.key===null?ae:ve.key)||null,K(Q,ee,ve,Pe);case L:return ee=ee.get(ve.key===null?ae:ve.key)||null,te(Q,ee,ve,Pe);case O:return ve=Il(ve),re(ee,Q,ae,ve,Pe)}if(Me(ve)||me(ve))return ee=ee.get(ae)||null,ce(Q,ee,ve,Pe,null);if(typeof ve.then=="function")return re(ee,Q,ae,yu(ve),Pe);if(ve.$$typeof===F)return re(ee,Q,ae,mu(Q,ve),Pe);xu(Q,ve)}return null}function Oe(ee,Q,ae,ve){for(var Pe=null,yt=null,Ye=Q,We=Q=0,hn=null;Ye!==null&&We<ae.length;We++){Ye.index>We?(hn=Ye,Ye=null):hn=Ye.sibling;var jt=J(ee,Ye,ae[We],ve);if(jt===null){Ye===null&&(Ye=hn);break}t&&Ye&&jt.alternate===null&&n(ee,Ye),Q=v(jt,Q,We),yt===null?Pe=jt:yt.sibling=jt,yt=jt,Ye=hn}if(We===ae.length)return l(ee,Ye),ut&&tr(ee,We),Pe;if(Ye===null){for(;We<ae.length;We++)Ye=ye(ee,ae[We],ve),Ye!==null&&(Q=v(Ye,Q,We),yt===null?Pe=Ye:yt.sibling=Ye,yt=Ye);return ut&&tr(ee,We),Pe}for(Ye=u(Ye);We<ae.length;We++)hn=re(Ye,ee,We,ae[We],ve),hn!==null&&(t&&(jt=hn.alternate,jt!==null&&Ye.delete(jt.key===null?We:jt.key)),Q=v(hn,Q,We),yt===null?Pe=hn:yt.sibling=hn,yt=hn);return t&&Ye.forEach(function(il){return n(ee,il)}),ut&&tr(ee,We),Pe}function Fe(ee,Q,ae,ve){if(ae==null)throw Error(r(151));for(var Pe=null,yt=null,Ye=Q,We=Q=0,hn=null,jt=ae.next();Ye!==null&&!jt.done;We++,jt=ae.next()){Ye.index>We?(hn=Ye,Ye=null):hn=Ye.sibling;var il=J(ee,Ye,jt.value,ve);if(il===null){Ye===null&&(Ye=hn);break}t&&Ye&&il.alternate===null&&n(ee,Ye),Q=v(il,Q,We),yt===null?Pe=il:yt.sibling=il,yt=il,Ye=hn}if(jt.done)return l(ee,Ye),ut&&tr(ee,We),Pe;if(Ye===null){for(;!jt.done;We++,jt=ae.next())jt=ye(ee,jt.value,ve),jt!==null&&(Q=v(jt,Q,We),yt===null?Pe=jt:yt.sibling=jt,yt=jt);return ut&&tr(ee,We),Pe}for(Ye=u(Ye);!jt.done;We++,jt=ae.next())jt=re(Ye,ee,We,jt.value,ve),jt!==null&&(t&&(hn=jt.alternate,hn!==null&&Ye.delete(hn.key===null?We:hn.key)),Q=v(jt,Q,We),yt===null?Pe=jt:yt.sibling=jt,yt=jt);return t&&Ye.forEach(function(l8){return n(ee,l8)}),ut&&tr(ee,We),Pe}function ct(ee,Q,ae,ve){if(typeof ae=="object"&&ae!==null&&ae.type===P&&ae.key===null&&ae.props.ref===void 0&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case Y:e:{for(var Pe=ae.key;Q!==null;){if(Q.key===Pe){if(Pe=ae.type,Pe===P){if(Q.tag===7){l(ee,Q.sibling),ve=m(Q,ae.props.children),Pr(ve,ae),ve.return=ee,ee=ve;break e}}else if(Q.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===O&&Il(Pe)===Q.type){l(ee,Q.sibling),ve=m(Q,ae.props),Pr(ve,ae),ve.return=ee,ee=ve;break e}l(ee,Q);break}else n(ee,Q);Q=Q.sibling}ae.type===P?(ve=_l(ae.props.children,ee.mode,ve,ae.key),Pr(ve,ae),ve.return=ee,ee=ve):(ve=su(ae.type,ae.key,ae.props,null,ee.mode,ve),Pr(ve,ae),ve.return=ee,ee=ve)}return T(ee);case L:e:{for(Pe=ae.key;Q!==null;){if(Q.key===Pe)if(Q.tag===4&&Q.stateNode.containerInfo===ae.containerInfo&&Q.stateNode.implementation===ae.implementation){l(ee,Q.sibling),ve=m(Q,ae.children||[]),ve.return=ee,ee=ve;break e}else{l(ee,Q);break}else n(ee,Q);Q=Q.sibling}ve=Vf(ae,ee.mode,ve),ve.return=ee,ee=ve}return T(ee);case O:return ae=Il(ae),ct(ee,Q,ae,ve)}if(Me(ae))return Oe(ee,Q,ae,ve);if(me(ae)){if(Pe=me(ae),typeof Pe!="function")throw Error(r(150));return ae=Pe.call(ae),Fe(ee,Q,ae,ve)}if(typeof ae.then=="function")return ct(ee,Q,yu(ae),ve);if(ae.$$typeof===F)return ct(ee,Q,mu(ee,ae),ve);xu(ee,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,Q!==null&&Q.tag===6?(l(ee,Q.sibling),ve=m(Q,ae),ve.return=ee,ee=ve):(l(ee,Q),ve=Ff(ae,ee.mode,ve),ve.return=ee,ee=ve),T(ee)):l(ee,Q)}return function(ee,Q,ae,ve){try{Vs=0;var Pe=ct(ee,Q,ae,ve);return Ro=null,Pe}catch(Ye){if(Ye===_o||Ye===gu)throw Ye;var yt=la(29,Ye,null,ee.mode);return yt.lanes=ve,yt.return=ee,yt}finally{}}}var Hl=B1(!0),I1=B1(!1),Hr=!1;function eh(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function th(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function qr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Ur(t,n,l){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,(Et&2)!==0){var m=u.pending;return m===null?n.next=n:(n.next=m.next,m.next=n),u.pending=n,n=ou(t),j1(t,null,l),n}return lu(t,u,n,l),ou(t)}function $s(t,n,l){if(n=n.updateQueue,n!==null&&(n=n.shared,(l&4194048)!==0)){var u=n.lanes;u&=t.pendingLanes,l|=u,n.lanes=l,Er(t,l)}}function nh(t,n){var l=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,l===u)){var m=null,v=null;if(l=l.firstBaseUpdate,l!==null){do{var T={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};v===null?m=v=T:v=v.next=T,l=l.next}while(l!==null);v===null?m=v=n:v=v.next=n}else m=v=n;l={baseState:u.baseState,firstBaseUpdate:m,lastBaseUpdate:v,shared:u.shared,callbacks:u.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=n:t.next=n,l.lastBaseUpdate=n}var ah=!1;function Gs(){if(ah){var t=Mo;if(t!==null)throw t}}function Ys(t,n,l,u){ah=!1;var m=t.updateQueue;Hr=!1;var v=m.firstBaseUpdate,T=m.lastBaseUpdate,z=m.shared.pending;if(z!==null){m.shared.pending=null;var K=z,te=K.next;K.next=null,T===null?v=te:T.next=te,T=K;var ce=t.alternate;ce!==null&&(ce=ce.updateQueue,z=ce.lastBaseUpdate,z!==T&&(z===null?ce.firstBaseUpdate=te:z.next=te,ce.lastBaseUpdate=K))}if(v!==null){var ye=m.baseState;T=0,ce=te=K=null,z=v;do{var J=z.lane&-536870913,re=J!==z.lane;if(re?(vt&J)===J:(u&J)===J){J!==0&&J===Ll&&(ah=!0),ce!==null&&(ce=ce.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var Oe=t,Fe=z;J=n;var ct=l;switch(Fe.tag){case 1:if(Oe=Fe.payload,typeof Oe=="function"){ye=Oe.call(ct,ye,J);break e}ye=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Fe.payload,J=typeof Oe=="function"?Oe.call(ct,ye,J):Oe,J==null)break e;ye=I({},ye,J);break e;case 2:Hr=!0}}J=z.callback,J!==null&&(t.flags|=64,re&&(t.flags|=8192),re=m.callbacks,re===null?m.callbacks=[J]:re.push(J))}else re={lane:J,tag:z.tag,payload:z.payload,callback:z.callback,next:null},ce===null?(te=ce=re,K=ye):ce=ce.next=re,T|=J;if(z=z.next,z===null){if(z=m.shared.pending,z===null)break;re=z,z=re.next,re.next=null,m.lastBaseUpdate=re,m.shared.pending=null}}while(!0);ce===null&&(K=ye),m.baseState=K,m.firstBaseUpdate=te,m.lastBaseUpdate=ce,v===null&&(m.shared.lanes=0),Xr|=T,t.lanes=T,t.memoizedState=ye}}function P1(t,n){if(typeof t!="function")throw Error(r(191,t));t.call(n)}function H1(t,n){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)P1(l[t],n)}var Fr=Je(null),bu=Je(0);function q1(t,n){t=sr,et(bu,t),et(Fr,n),sr=t|n.baseLanes}function ih(){et(bu,sr),et(Fr,Fr.current)}function rh(){sr=bu.current,Qe(Fr),Qe(bu)}var Rn=Je(null),qn=null;function Vr(t){var n=t.alternate;et(On,On.current&1),et(Rn,t),qn===null&&(n===null||Fr.current!==null||n.memoizedState!==null)&&(qn=t)}function lh(t){et(On,On.current),et(Rn,t),qn===null&&(qn=t)}function U1(t){t.tag===22?(et(On,On.current),et(Rn,t),qn===null&&(qn=t)):$r()}function $r(){et(On,On.current),et(Rn,Rn.current)}function Na(t){Qe(Rn),qn===t&&(qn=null),Qe(On)}var On=Je(0);function Ks(t,n){et(Rn,Rn.current),et(On,n)}function oh(t){Qe(On),Qe(Rn),qn===t&&(qn=null)}function ju(t){for(var n=t;n!==null;){if(n.tag===13){var l=n.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Am(l)||Mm(l)))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!=="independent"){if((n.flags&128)!==0)return n}else if(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 null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var ir=0,st=null,Dt=null,dn=null,wu=!1,Oo=!1,ql=!1,ku=0,Xs=0,Do=null,E6=0;function rn(){throw Error(r(321))}function sh(t,n){if(n===null)return!1;for(var l=0;l<n.length&&l<t.length;l++)if(!Ca(t[l],n[l]))return!1;return!0}function ch(t,n,l,u,m,v){return ir=v,st=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,xe.H=t===null||t.memoizedState===null?Cv:Nv,ql=!1,v=l(u,m),ql=!1,Oo&&(v=V1(n,l,u,m)),F1(t),v}function F1(t){xe.H=Mu;var n=Dt!==null&&Dt.next!==null;if(ir=0,dn=Dt=st=null,wu=!1,Xs=0,Do=null,n)throw Error(r(300));t===null||fn||(t=t.dependencies,t!==null&&hu(t)&&(fn=!0))}function V1(t,n,l,u){st=t;var m=0;do{if(Oo&&(Do=null),Xs=0,Oo=!1,25<=m)throw Error(r(301));if(m+=1,dn=Dt=null,t.updateQueue!=null){var v=t.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}xe.H=z6,v=n(l,u)}while(Oo);return v}function T6(){var t=xe.H,n=t.useState()[0];return n=typeof n.then=="function"?Qs(n):n,t=t.useState()[0],(Dt!==null?Dt.memoizedState:null)!==t&&(st.flags|=1024),n}function uh(){var t=ku!==0;return ku=0,t}function dh(t,n,l){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~l}function fh(t){if(wu){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}wu=!1}ir=0,dn=Dt=st=null,Oo=!1,Xs=ku=0,Do=null}function Zn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dn===null?st.memoizedState=dn=t:dn=dn.next=t,dn}function sn(){if(Dt===null){var t=st.alternate;t=t!==null?t.memoizedState:null}else t=Dt.next;var n=dn===null?st.memoizedState:dn.next;if(n!==null)dn=n,Dt=t;else{if(t===null)throw st.alternate===null?Error(r(467)):Error(r(310));Dt=t,t={memoizedState:Dt.memoizedState,baseState:Dt.baseState,baseQueue:Dt.baseQueue,queue:Dt.queue,next:null},dn===null?st.memoizedState=dn=t:dn=dn.next=t}return dn}function Su(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Qs(t){var n=Xs;return Xs+=1,Do===null&&(Do=[]),t=D1(Do,t,n),n=st,(dn===null?n.memoizedState:dn.next)===null&&(n=n.alternate,xe.H=n===null||n.memoizedState===null?Cv:Nv),t}function Cu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Qs(t);if(t.$$typeof===W)return;if(t.$$typeof===F)return _n(t)}throw Error(r(438,String(t)))}function hh(t){var n=null,l=st.updateQueue;if(l!==null&&(n=l.memoCache),n==null){var u=st.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(n={data:u.data.map(function(m){return m.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),l===null&&(l=Su(),st.updateQueue=l),l.memoCache=n,l=n.data[n.index],l===void 0)for(l=n.data[n.index]=Array(t),u=0;u<t;u++)l[u]=D;return n.index++,l}function rr(t,n){return typeof n=="function"?n(t):n}function Nu(t){var n=sn();return mh(n,Dt,t)}function mh(t,n,l){var u=t.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=l;var m=t.baseQueue,v=u.pending;if(v!==null){if(m!==null){var T=m.next;m.next=v.next,v.next=T}n.baseQueue=m=v,u.pending=null}if(v=t.baseState,m===null)t.memoizedState=v;else{n=m.next;var z=T=null,K=null,te=n,ce=!1;do{var ye=te.lane&-536870913;if(ye!==te.lane?(vt&ye)===ye:(ir&ye)===ye){var J=te.revertLane;if(J===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),ye===Ll&&(ce=!0);else if((ir&J)===J){te=te.next,J===Ll&&(ce=!0);continue}else ye={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},K===null?(z=K=ye,T=v):K=K.next=ye,st.lanes|=J,Xr|=J;ye=te.action,ql&&l(v,ye),v=te.hasEagerState?te.eagerState:l(v,ye)}else J={lane:ye,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},K===null?(z=K=J,T=v):K=K.next=J,st.lanes|=ye,Xr|=ye;te=te.next}while(te!==null&&te!==n);if(K===null?T=v:K.next=z,!Ca(v,t.memoizedState)&&(fn=!0,ce&&(l=Mo,l!==null)))throw l;t.memoizedState=v,t.baseState=T,t.baseQueue=K,u.lastRenderedState=v}return m===null&&(u.lanes=0),[t.memoizedState,u.dispatch]}function ph(t){var n=sn(),l=n.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=t;var u=l.dispatch,m=l.pending,v=n.memoizedState;if(m!==null){l.pending=null;var T=m=m.next;do v=t(v,T.action),T=T.next;while(T!==m);Ca(v,n.memoizedState)||(fn=!0),n.memoizedState=v,n.baseQueue===null&&(n.baseState=v),l.lastRenderedState=v}return[v,u]}function $1(t,n,l){var u=st,m=sn(),v=ut;if(v){if(l===void 0)throw Error(r(407));l=l()}else l=n();var T=!Ca((Dt||m).memoizedState,l);if(T&&(m.memoizedState=l,fn=!0),m=m.queue,yh(K1.bind(null,u,m,t),[t]),t=m.getSnapshot!==n||T||dn!==null&&(dn.memoizedState.tag&1)!==0,zo(t?9:8,{destroy:void 0},Y1.bind(null,u,m,l,n),null),t){if(u.flags|=2048,Bt===null)throw Error(r(349));v||(ir&127)!==0||G1(u,n,l)}return l}function G1(t,n,l){t.flags|=16384,t={getSnapshot:n,value:l},n=st.updateQueue,n===null?(n=Su(),st.updateQueue=n,n.stores=[t]):(l=n.stores,l===null?n.stores=[t]:l.push(t))}function Y1(t,n,l,u){n.value=l,n.getSnapshot=u,X1(n)&&Q1(t)}function K1(t,n,l){return l(function(){X1(n)&&Q1(t)})}function X1(t){var n=t.getSnapshot;t=t.value;try{var l=n();return!Ca(t,l)}catch{return!0}}function Q1(t){var n=Ml(t,2);n!==null&&ua(n,t,2)}function gh(t){var n=Zn();if(typeof t=="function"){var l=t;if(t=l(),ql){tn(!0);try{l()}finally{tn(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rr,lastRenderedState:t},n}function Z1(t,n,l,u){return t.baseState=l,mh(t,Dt,typeof u=="function"?u:rr)}function A6(t,n,l,u,m){if(Au(t))throw Error(r(485));if(t=n.action,t!==null){var v={payload:m,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){v.listeners.push(T)}};xe.T!==null?l(!0):v.isTransition=!1,u(v),l=n.pending,l===null?(v.next=n.pending=v,J1(n,v)):(v.next=l.next,n.pending=l.next=v)}}function J1(t,n){var l=n.action,u=n.payload,m=t.state;if(n.isTransition){var v=xe.T,T={};T.types=v!==null?v.types:null,xe.T=T;try{var z=l(m,u),K=xe.S;K!==null&&K(T,z),W1(t,n,z)}catch(te){vh(t,n,te)}finally{v!==null&&T.types!==null&&(v.types=T.types),xe.T=v}}else try{v=l(m,u),W1(t,n,v)}catch(te){vh(t,n,te)}}function W1(t,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(u){ev(t,n,u)},function(u){return vh(t,n,u)}):ev(t,n,l)}function ev(t,n,l){n.status="fulfilled",n.value=l,tv(n),t.state=l,n=t.pending,n!==null&&(l=n.next,l===n?t.pending=null:(l=l.next,n.next=l,J1(t,l)))}function vh(t,n,l){var u=t.pending;if(t.pending=null,u!==null){u=u.next;do n.status="rejected",n.reason=l,tv(n),n=n.next;while(n!==u)}t.action=null}function tv(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function nv(t,n){return n}function av(t,n){if(ut){var l=Bt.formState;if(l!==null){e:{var u=st;if(ut){if(qt){t:{for(var m=qt,v=$a;m.nodeType!==8;){if(!v){m=null;break t}if(m=Ya(m.nextSibling),m===null){m=null;break t}}v=m.data,m=v==="F!"||v==="F"?m:null}if(m){qt=Ya(m.nextSibling),u=m.data==="F!";break e}}Br(u)}u=!1}u&&(n=l[0])}}return l=Zn(),l.memoizedState=l.baseState=n,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:nv,lastRenderedState:n},l.queue=u,l=wv.bind(null,st,u),u.dispatch=l,u=gh(!1),v=kh.bind(null,st,!1,u.queue),u=Zn(),m={state:n,dispatch:null,action:t,pending:null},u.queue=m,l=A6.bind(null,st,m,v,l),m.dispatch=l,u.memoizedState=t,[n,l,!1]}function iv(t){var n=sn();return rv(n,Dt,t)}function rv(t,n,l){if(n=mh(t,n,nv)[0],t=Nu(rr)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var u=Qs(n)}catch(T){throw T===_o?gu:T}else u=n;n=sn();var m=n.queue,v=m.dispatch;return l!==n.memoizedState&&(st.flags|=2048,zo(9,{destroy:void 0},M6.bind(null,m,l),null)),[u,v,t]}function M6(t,n){t.action=n}function lv(t){var n=sn(),l=Dt;if(l!==null)return rv(n,l,t);sn(),n=n.memoizedState,l=sn();var u=l.queue.dispatch;return l.memoizedState=t,[n,u,!1]}function zo(t,n,l,u){return t={tag:t,create:l,deps:u,inst:n,next:null},n=st.updateQueue,n===null&&(n=Su(),st.updateQueue=n),l=n.lastEffect,l===null?n.lastEffect=t.next=t:(u=l.next,l.next=t,t.next=u,n.lastEffect=t),t}function ov(){return sn().memoizedState}function Eu(t,n,l,u){var m=Zn();st.flags|=t,m.memoizedState=zo(1|n,{destroy:void 0},l,u===void 0?null:u)}function Tu(t,n,l,u){var m=sn();u=u===void 0?null:u;var v=m.memoizedState.inst;Dt!==null&&u!==null&&sh(u,Dt.memoizedState.deps)?m.memoizedState=zo(n,v,l,u):(st.flags|=t,m.memoizedState=zo(1|n,v,l,u))}function sv(t,n){Eu(8390656,8,t,n)}function yh(t,n){Tu(2048,8,t,n)}function _6(t){st.flags|=4;var n=st.updateQueue;if(n===null)n=Su(),st.updateQueue=n,n.events=[t];else{var l=n.events;l===null?n.events=[t]:l.push(t)}}function cv(t){var n=sn().memoizedState;return _6({ref:n,nextImpl:t}),function(){if((Et&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function uv(t,n){return Tu(4,2,t,n)}function dv(t,n){return Tu(4,4,t,n)}function fv(t,n){if(typeof n=="function"){t=t();var l=n(t);return function(){typeof l=="function"?l():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function hv(t,n,l){l=l!=null?l.concat([t]):null,Tu(4,4,fv.bind(null,n,t),l)}function xh(){}function mv(t,n){var l=sn();n=n===void 0?null:n;var u=l.memoizedState;return n!==null&&sh(n,u[1])?u[0]:(l.memoizedState=[t,n],t)}function pv(t,n){var l=sn();n=n===void 0?null:n;var u=l.memoizedState;if(n!==null&&sh(n,u[1]))return u[0];if(u=t(),ql){tn(!0);try{t()}finally{tn(!1)}}return l.memoizedState=[u,n],u}function bh(t,n,l){return l===void 0||(ir&1073741824)!==0&&(vt&261930)===0?t.memoizedState=n:(t.memoizedState=l,t=C2(),st.lanes|=t,Xr|=t,l)}function gv(t,n,l,u){return Ca(l,n)?l:Fr.current!==null?(t=bh(t,l,u),Ca(t,n)||(fn=!0),t):(ir&106)===0||(ir&1073741824)!==0&&(vt&261930)===0?(fn=!0,t.memoizedState=l):(t=C2(),st.lanes|=t,Xr|=t,n)}function vv(t,n,l,u,m){var v=oe.p;oe.p=v!==0&&8>v?v:8;var T=xe.T,z={};z.types=T!==null?T.types:null,xe.T=z,kh(t,!1,n,l);try{var K=m(),te=xe.S;if(te!==null&&te(z,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var ce=N6(K,u);Zs(t,n,ce,Ma(t))}else Zs(t,n,u,Ma(t))}catch(ye){Zs(t,n,{then:function(){},status:"rejected",reason:ye},Ma())}finally{oe.p=v,T!==null&&z.types!==null&&(T.types=z.types),xe.T=T}}function R6(){}function jh(t,n,l,u){if(t.tag!==5)throw Error(r(476));var m=yv(t).queue;vv(t,m,n,Ee,l===null?R6:function(){return xv(t),l(u)})}function yv(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:Ee,baseState:Ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:rr,lastRenderedState:Ee},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:rr,lastRenderedState:l},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function xv(t){var n=yv(t);n.next===null&&(n=t.alternate.memoizedState),Zs(t,n.next.queue,{},Ma())}function wh(){return _n(es)}function bv(){return sn().memoizedState}function jv(){return sn().memoizedState}function O6(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var l=Ma();t=qr(l);var u=Ur(n,t,l);u!==null&&(ua(u,n,l),$s(u,n,l)),n={cache:Qf()},t.payload=n;return}n=n.return}}function D6(t,n,l){var u=Ma();l={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Au(t)?kv(n,l):(l=qf(t,n,l,u),l!==null&&(ua(l,t,u),Sv(l,n,u)))}function wv(t,n,l){var u=Ma();Zs(t,n,l,u)}function Zs(t,n,l,u){var m={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Au(t))kv(n,m);else{var v=t.alternate;if(t.lanes===0&&(v===null||v.lanes===0)&&(v=n.lastRenderedReducer,v!==null))try{var T=n.lastRenderedState,z=v(T,l);if(m.hasEagerState=!0,m.eagerState=z,Ca(z,T))return lu(t,n,m,0),Bt===null&&ru(),!1}catch{}finally{}if(l=qf(t,n,m,u),l!==null)return ua(l,t,u),Sv(l,n,u),!0}return!1}function kh(t,n,l,u){if(u={lane:2,revertLane:hm(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Au(t)){if(n)throw Error(r(479))}else n=qf(t,l,u,2),n!==null&&ua(n,t,2)}function Au(t){var n=t.alternate;return t===st||n!==null&&n===st}function kv(t,n){Oo=wu=!0;var l=t.pending;l===null?n.next=n:(n.next=l.next,l.next=n),t.pending=n}function Sv(t,n,l){if((l&4194048)!==0){var u=n.lanes;u&=t.pendingLanes,l|=u,n.lanes=l,Er(t,l)}}var Mu={readContext:_n,use:Cu,useCallback:rn,useContext:rn,useEffect:rn,useImperativeHandle:rn,useLayoutEffect:rn,useInsertionEffect:rn,useMemo:rn,useReducer:rn,useRef:rn,useState:rn,useDebugValue:rn,useDeferredValue:rn,useTransition:rn,useSyncExternalStore:rn,useId:rn,useHostTransitionStatus:rn,useFormState:rn,useActionState:rn,useOptimistic:rn,useMemoCache:rn,useCacheRefresh:rn,useEffectEvent:rn},Cv={readContext:_n,use:Cu,useCallback:function(t,n){return Zn().memoizedState=[t,n===void 0?null:n],t},useContext:_n,useEffect:sv,useImperativeHandle:function(t,n,l){l=l!=null?l.concat([t]):null,Eu(4194308,4,fv.bind(null,n,t),l)},useLayoutEffect:function(t,n){return Eu(4194308,4,t,n)},useInsertionEffect:function(t,n){Eu(4,2,t,n)},useMemo:function(t,n){var l=Zn();n=n===void 0?null:n;var u=t();if(ql){tn(!0);try{t()}finally{tn(!1)}}return l.memoizedState=[u,n],u},useReducer:function(t,n,l){var u=Zn();if(l!==void 0){var m=l(n);if(ql){tn(!0);try{l(n)}finally{tn(!1)}}}else m=n;return u.memoizedState=u.baseState=m,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:m},u.queue=t,t=t.dispatch=D6.bind(null,st,t),[u.memoizedState,t]},useRef:function(t){var n=Zn();return t={current:t},n.memoizedState=t},useState:function(t){t=gh(t);var n=t.queue,l=wv.bind(null,st,n);return n.dispatch=l,[t.memoizedState,l]},useDebugValue:xh,useDeferredValue:function(t,n){var l=Zn();return bh(l,t,n)},useTransition:function(){var t=gh(!1);return t=vv.bind(null,st,t.queue,!0,!1),Zn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,l){var u=st,m=Zn();if(ut){if(l===void 0)throw Error(r(407));l=l()}else{if(l=n(),Bt===null)throw Error(r(349));(vt&127)!==0||G1(u,n,l)}m.memoizedState=l;var v={value:l,getSnapshot:n};return m.queue=v,sv(K1.bind(null,u,v,t),[t]),u.flags|=2048,zo(9,{destroy:void 0},Y1.bind(null,u,v,l,n),null),l},useId:function(){var t=Zn(),n=Bt.identifierPrefix;if(ut){var l=Si,u=ki;l=(u&~(1<<32-on(u)-1)).toString(32)+l,n="_"+n+"R_"+l,l=ku++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=E6++,n="_"+n+"r_"+l.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:wh,useFormState:av,useActionState:av,useOptimistic:function(t){var n=Zn();n.memoizedState=n.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=l,n=kh.bind(null,st,!0,l),l.dispatch=n,[t,n]},useMemoCache:hh,useCacheRefresh:function(){return Zn().memoizedState=O6.bind(null,st)},useEffectEvent:function(t){var n=Zn(),l={impl:t};return n.memoizedState=l,function(){if((Et&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},Nv={readContext:_n,use:Cu,useCallback:mv,useContext:_n,useEffect:yh,useImperativeHandle:hv,useInsertionEffect:uv,useLayoutEffect:dv,useMemo:pv,useReducer:Nu,useRef:ov,useState:function(){return Nu(rr)},useDebugValue:xh,useDeferredValue:function(t,n){var l=sn();return gv(l,Dt.memoizedState,t,n)},useTransition:function(){var t=Nu(rr)[0],n=sn().memoizedState;return[typeof t=="boolean"?t:Qs(t),n]},useSyncExternalStore:$1,useId:bv,useHostTransitionStatus:wh,useFormState:iv,useActionState:iv,useOptimistic:function(t,n){var l=sn();return Z1(l,Dt,t,n)},useMemoCache:hh,useCacheRefresh:jv,useEffectEvent:cv},z6={readContext:_n,use:Cu,useCallback:mv,useContext:_n,useEffect:yh,useImperativeHandle:hv,useInsertionEffect:uv,useLayoutEffect:dv,useMemo:pv,useReducer:ph,useRef:ov,useState:function(){return ph(rr)},useDebugValue:xh,useDeferredValue:function(t,n){var l=sn();return Dt===null?bh(l,t,n):gv(l,Dt.memoizedState,t,n)},useTransition:function(){var t=ph(rr)[0],n=sn().memoizedState;return[typeof t=="boolean"?t:Qs(t),n]},useSyncExternalStore:$1,useId:bv,useHostTransitionStatus:wh,useFormState:lv,useActionState:lv,useOptimistic:function(t,n){var l=sn();return Dt!==null?Z1(l,Dt,t,n):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:hh,useCacheRefresh:jv,useEffectEvent:cv};function Sh(t,n,l,u){n=t.memoizedState,l=l(u,n),l=l==null?n:I({},n,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var Ch={enqueueSetState:function(t,n,l){t=t._reactInternals;var u=Ma(),m=qr(u);m.payload=n,l!=null&&(m.callback=l),n=Ur(t,m,u),n!==null&&(ua(n,t,u),$s(n,t,u))},enqueueReplaceState:function(t,n,l){t=t._reactInternals;var u=Ma(),m=qr(u);m.tag=1,m.payload=n,l!=null&&(m.callback=l),n=Ur(t,m,u),n!==null&&(ua(n,t,u),$s(n,t,u))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var l=Ma(),u=qr(l);u.tag=2,n!=null&&(u.callback=n),n=Ur(t,u,l),n!==null&&(ua(n,t,l),$s(n,t,l))}};function Ev(t,n,l,u,m,v,T){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(u,v,T):n.prototype&&n.prototype.isPureReactComponent?!Bs(l,u)||!Bs(m,v):!0}function Tv(t,n,l,u){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(l,u),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(l,u),n.state!==t&&Ch.enqueueReplaceState(n,n.state,null)}function Ul(t,n){var l=n;if("ref"in n){l={};for(var u in n)u!=="ref"&&(l[u]=n[u])}if(t=t.defaultProps){l===n&&(l=I({},l));for(var m in t)l[m]===void 0&&(l[m]=t[m])}return l}function Av(t){iu(t)}function Mv(t){console.error(t)}function _v(t){iu(t)}function _u(t,n){try{var l=t.onUncaughtError;l(n.value,{componentStack:n.stack})}catch(u){setTimeout(function(){throw u})}}function Rv(t,n,l){try{var u=t.onCaughtError;u(l.value,{componentStack:l.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function Nh(t,n,l){return l=qr(l),l.tag=3,l.payload={element:null},l.callback=function(){_u(t,n)},l}function Ov(t){return t=qr(t),t.tag=3,t}function Dv(t,n,l,u){var m=l.type.getDerivedStateFromError;if(typeof m=="function"){var v=u.value;t.payload=function(){return m(v)},t.callback=function(){Rv(n,l,u)}}var T=l.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(t.callback=function(){Rv(n,l,u),typeof m!="function"&&(Qr===null?Qr=new Set([this]):Qr.add(this));var z=u.stack;this.componentDidCatch(u.value,{componentStack:z!==null?z:""})})}function L6(t,n,l,u,m){if(l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(n=l.alternate,n!==null&&Dl(n,l,m,!0),l=Rn.current,l!==null){switch(l.tag){case 31:case 13:case 19:return qn===null?Ju():l.alternate===null&&ln===0&&(ln=3),l.flags&=-257,l.flags|=65536,l.lanes=m,u===vu?l.flags|=16384:(n=l.updateQueue,n===null?l.updateQueue=new Set([u]):n.add(u),um(t,u,m)),!1;case 22:return l.flags|=65536,u===vu?l.flags|=16384:(n=l.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([u])},l.updateQueue=n):(l=n.retryQueue,l===null?n.retryQueue=new Set([u]):l.add(u)),um(t,u,m)),!1}throw Error(r(435,l.tag))}return um(t,u,m),Ju(),!1}if(ut)return n=Rn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=m,u!==Gf&&(t=Error(r(422),{cause:u}),Hs(Ua(t,l)))):(u!==Gf&&(n=Error(r(423),{cause:u}),Hs(Ua(n,l))),t=t.current.alternate,t.flags|=65536,m&=-m,t.lanes|=m,u=Ua(u,l),m=Nh(t.stateNode,u,m),nh(t,m),ln!==4&&(ln=2)),!1;var v=Error(r(520),{cause:u});if(v=Ua(v,l),rc===null?rc=[v]:rc.push(v),ln!==4&&(ln=2),n===null)return!0;u=Ua(u,l),l=n;do{switch(l.tag){case 3:return l.flags|=65536,t=m&-m,l.lanes|=t,t=Nh(l.stateNode,u,t),nh(l,t),!1;case 1:if(n=l.type,v=l.stateNode,(l.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Qr===null||!Qr.has(v))))return l.flags|=65536,m&=-m,l.lanes|=m,m=Ov(m),Dv(m,t,l,u),nh(l,m),!1;break;case 22:if(l.memoizedState!==null)return l.flags|=65536,!1}l=l.return}while(l!==null);return!1}var Eh=Error(r(461)),fn=!1;function yn(t,n,l,u){n.child=t===null?I1(n,null,l,u):Hl(n,t.child,l,u)}function zv(t,n,l,u,m){l=l.render;var v=n.ref;if("ref"in u){var T={};for(var z in u)z!=="ref"&&(T[z]=u[z])}else T=u;return zl(n),u=ch(t,n,l,T,v,m),z=uh(),t!==null&&!fn?(dh(t,n,m),lr(t,n,m)):(ut&&z&&uu(n),n.flags|=1,yn(t,n,u,m),n.child)}function Lv(t,n,l,u,m){if(t===null){var v=l.type;return typeof v=="function"&&!Uf(v)&&v.defaultProps===void 0&&l.compare===null?(n.tag=15,n.type=v,Bv(t,n,v,u,m)):(t=su(l.type,null,u,n,n.mode,m),t.ref=n.ref,t.return=n,n.child=t)}if(v=t.child,!zh(t,m)){var T=v.memoizedProps;if(l=l.compare,l=l!==null?l:Bs,l(T,u)&&t.ref===n.ref)return lr(t,n,m)}return n.flags|=1,t=er(v,u),t.ref=n.ref,t.return=n,n.child=t}function Bv(t,n,l,u,m){if(t!==null){var v=t.memoizedProps;if(Bs(v,u)&&t.ref===n.ref)if(fn=!1,n.pendingProps=u=v,zh(t,m))(t.flags&131072)!==0&&(fn=!0);else return n.lanes=t.lanes,lr(t,n,m)}return Th(t,n,l,u,m)}function Iv(t,n,l,u){var m=u.children,v=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((n.flags&128)!==0){if(v=v!==null?v.baseLanes|l:l,t!==null){for(u=n.child=t.child,m=0;u!==null;)m=m|u.lanes|u.childLanes,u=u.sibling;u=m&~v}else u=0,n.child=null;return Pv(t,n,v,l,u)}if((l&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&pu(n,v!==null?v.cachePool:null),v!==null?q1(n,v):ih(),U1(n);else return u=n.lanes=536870912,Pv(t,n,v!==null?v.baseLanes|l:l,l,u)}else v!==null?(pu(n,v.cachePool),q1(n,v),$r(),n.memoizedState=null):(t!==null&&pu(n,null),ih(),$r());return yn(t,n,m,l),n.child}function Js(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Pv(t,n,l,u,m){var v=Jf();return v=v===null?null:{parent:un._currentValue,pool:v},n.memoizedState={baseLanes:l,cachePool:v},t!==null&&pu(n,null),ih(),U1(n),t!==null&&Dl(t,n,u,!0),n.childLanes=m,null}function Ru(t,n){return n=Ou({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function Hv(t,n,l){return Hl(n,t.child,null,l),t=Ru(n,n.pendingProps),t.flags|=2,Na(n),n.memoizedState=null,t}function B6(t,n,l){var u=n.pendingProps,m=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(ut){if(u.mode==="hidden")return t=Ru(n,u),n.lanes=536870912,t.memoizedState={baseLanes:0,cachePool:null},Js(null,t);if(lh(n),(t=qt)?(t=fy(t,$a),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:zr!==null?{id:ki,overflow:Si}:null,retryLane:536870912,hydrationErrors:null},l=k1(t),l.return=n,n.child=l,Sn=n,qt=null)):t=null,t===null)throw Br(n);return n.lanes=536870912,null}return Ru(n,u)}var v=t.memoizedState;if(v!==null){var T=v.dehydrated;if(lh(n),m)if(n.flags&256)n.flags&=-257,n=Hv(t,n,l);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(r(558));else if(fn||Dl(t,n,l,!1),m=(l&t.childLanes)!==0,fn||m){if(Fr.current===null){if(u=Bt,u!==null&&(T=Ba(u,l),T!==0&&T!==v.retryLane))throw v.retryLane=T,Ml(t,T),ua(u,t,T),Eh;Ju()}n=Hv(t,n,l)}else t=v.treeContext,qt=Ya(T.nextSibling),Sn=n,ut=!0,Lr=null,$a=!1,t!==null&&N1(n,t),n=Ru(n,u),n.flags|=134221824;return n}return t=er(t.child,{mode:u.mode,children:u.children}),t.ref=n.ref,n.child=t,t.return=n,t}function Lo(t,n){var l=n.ref;if(l===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(t===null||t.ref!==l)&&(n.flags|=4194816)}}function Th(t,n,l,u,m){return zl(n),l=ch(t,n,l,u,void 0,m),u=uh(),t!==null&&!fn?(dh(t,n,m),lr(t,n,m)):(ut&&u&&uu(n),n.flags|=1,yn(t,n,l,m),n.child)}function qv(t,n,l,u,m,v){return zl(n),n.updateQueue=null,l=V1(n,u,l,m),F1(t),u=uh(),t!==null&&!fn?(dh(t,n,v),lr(t,n,v)):(ut&&u&&uu(n),n.flags|=1,yn(t,n,l,v),n.child)}function Uv(t,n,l,u,m){if(zl(n),n.stateNode===null){var v=No,T=l.contextType;typeof T=="object"&&T!==null&&(v=_n(T)),v=new l(u,v),n.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Ch,n.stateNode=v,v._reactInternals=n,v=n.stateNode,v.props=u,v.state=n.memoizedState,v.refs={},eh(n),T=l.contextType,v.context=typeof T=="object"&&T!==null?_n(T):No,v.state=n.memoizedState,T=l.getDerivedStateFromProps,typeof T=="function"&&(Sh(n,l,T,u),v.state=n.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(T=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),T!==v.state&&Ch.enqueueReplaceState(v,v.state,null),Ys(n,u,v,m),Gs(),v.state=n.memoizedState),typeof v.componentDidMount=="function"&&(n.flags|=4194308),u=!0}else if(t===null){v=n.stateNode;var z=n.memoizedProps,K=Ul(l,z);v.props=K;var te=v.context,ce=l.contextType;T=No,typeof ce=="object"&&ce!==null&&(T=_n(ce));var ye=l.getDerivedStateFromProps;ce=typeof ye=="function"||typeof v.getSnapshotBeforeUpdate=="function",z=n.pendingProps!==z,ce||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(z||te!==T)&&Tv(n,v,u,T),Hr=!1;var J=n.memoizedState;v.state=J,Ys(n,u,v,m),Gs(),te=n.memoizedState,z||J!==te||Hr?(typeof ye=="function"&&(Sh(n,l,ye,u),te=n.memoizedState),(K=Hr||Ev(n,l,K,u,J,te,T))?(ce||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(n.flags|=4194308)):(typeof v.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=u,n.memoizedState=te),v.props=u,v.state=te,v.context=T,u=K):(typeof v.componentDidMount=="function"&&(n.flags|=4194308),u=!1)}else{v=n.stateNode,th(t,n),T=n.memoizedProps,ce=Ul(l,T),v.props=ce,ye=n.pendingProps,J=v.context,te=l.contextType,K=No,typeof te=="object"&&te!==null&&(K=_n(te)),z=l.getDerivedStateFromProps,(te=typeof z=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(T!==ye||J!==K)&&Tv(n,v,u,K),Hr=!1,J=n.memoizedState,v.state=J,Ys(n,u,v,m),Gs();var re=n.memoizedState;T!==ye||J!==re||Hr||t!==null&&t.dependencies!==null&&hu(t.dependencies)?(typeof z=="function"&&(Sh(n,l,z,u),re=n.memoizedState),(ce=Hr||Ev(n,l,ce,u,J,re,K)||t!==null&&t.dependencies!==null&&hu(t.dependencies))?(te||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(u,re,K),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(u,re,K)),typeof v.componentDidUpdate=="function"&&(n.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof v.componentDidUpdate!="function"||T===t.memoizedProps&&J===t.memoizedState||(n.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||T===t.memoizedProps&&J===t.memoizedState||(n.flags|=1024),n.memoizedProps=u,n.memoizedState=re),v.props=u,v.state=re,v.context=K,u=ce):(typeof v.componentDidUpdate!="function"||T===t.memoizedProps&&J===t.memoizedState||(n.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||T===t.memoizedProps&&J===t.memoizedState||(n.flags|=1024),u=!1)}return v=u,Lo(t,n),u=(n.flags&128)!==0,v||u?(v=n.stateNode,l=u&&typeof l.getDerivedStateFromError!="function"?null:v.render(),n.flags|=1,t!==null&&u?(n.child=Hl(n,t.child,null,m),n.child=Hl(n,null,l,m)):yn(t,n,l,m),n.memoizedState=v.state,t=n.child):t=lr(t,n,m),t}function Fv(t,n,l,u){return Rl(),n.flags|=256,yn(t,n,l,u),n.child}var Ah={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Mh(t){return{baseLanes:t,cachePool:R1()}}function _h(t,n,l){return t=t!==null?t.childLanes&~l:0,n&&(t|=Aa),t}function Vv(t,n,l){var u=n.pendingProps,m=!1,v=(n.flags&128)!==0,T;if((T=v)||(T=t!==null&&t.memoizedState===null?!1:(On.current&2)!==0),T&&(m=!0,n.flags&=-129),T=(n.flags&32)!==0,n.flags&=-33,t===null){if(ut){if(m?Vr(n):$r(),(t=qt)?(t=fy(t,$a),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:zr!==null?{id:ki,overflow:Si}:null,retryLane:536870912,hydrationErrors:null},l=k1(t),l.return=n,n.child=l,Sn=n,qt=null)):t=null,t===null)throw Br(n);return Mm(t)?n.lanes=32:n.lanes=536870912,null}return v=u.children,u=u.fallback,m?($r(),m=n.mode,v=Ou({mode:"hidden",children:v},m),u=_l(u,m,l,null),v.return=n,u.return=n,v.sibling=u,n.child=v,u=n.child,u.memoizedState=Mh(l),u.childLanes=_h(t,T,l),n.memoizedState=Ah,Js(null,u)):(Vr(n),Rh(n,v))}var z=t.memoizedState;if(z!==null){var K=z.dehydrated;if(K!==null)return I6(t,n,v,T,u,K,z,l)}return m?($r(),m=u.fallback,v=n.mode,z=t.child,K=z.sibling,u=er(z,{mode:"hidden",children:u.children}),u.subtreeFlags=z.subtreeFlags&1206910976,K!==null?m=er(K,m):(m=_l(m,v,l,null),m.flags|=2),m.return=n,u.return=n,u.sibling=m,n.child=u,Js(null,u),u=n.child,m=t.child.memoizedState,m===null?m=Mh(l):(v=m.cachePool,v!==null?(z=un._currentValue,v=v.parent!==z?{parent:z,pool:z}:v):v=R1(),m={baseLanes:m.baseLanes|l,cachePool:v}),u.memoizedState=m,u.childLanes=_h(t,T,l),n.memoizedState=Ah,Js(t.child,u)):(Vr(n),l=t.child,t=l.sibling,l=er(l,{mode:"visible",children:u.children}),l.return=n,l.sibling=null,t!==null&&(T=n.deletions,T===null?(n.deletions=[t],n.flags|=16):T.push(t)),n.child=l,n.memoizedState=null,l)}function Rh(t,n){return n=Ou({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function Ou(t,n){return t=la(22,t,null,n),t.lanes=0,t}function Du(t,n,l){return Hl(n,t.child,null,l),t=Rh(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function I6(t,n,l,u,m,v,T,z){if(l)return n.flags&256?(Vr(n),n.flags&=-257,Du(t,n,z)):n.memoizedState!==null?($r(),n.child=t.child,n.flags|=128,null):($r(),v=m.fallback,T=n.mode,m=Ou({mode:"visible",children:m.children},T),v=_l(v,T,z,null),v.flags|=2,m.return=n,v.return=n,m.sibling=v,n.child=m,Hl(n,t.child,null,z),m=n.child,m.memoizedState=Mh(z),m.childLanes=_h(t,u,z),n.memoizedState=Ah,Js(null,m));if(Vr(n),Mm(v)){if(u=v.nextSibling&&v.nextSibling.dataset,u)var K=u.dgst;return u=K,u!==""&&(m=Error(r(419)),m.stack="",m.digest=u,Hs({value:m,source:null,stack:null})),Du(t,n,z)}if(fn||Dl(t,n,z,!1),u=(z&t.childLanes)!==0,fn||u){if(Fr.current!==null)return Du(t,n,z);if(u=Bt,u!==null&&(m=Ba(u,z),m!==0&&m!==T.retryLane))throw T.retryLane=m,Ml(t,m),ua(u,t,m),Eh;return Am(v)||Ju(),Du(t,n,z)}return Am(v)?(n.flags|=192,n.child=t.child,null):(t=T.treeContext,qt=Ya(v.nextSibling),Sn=n,ut=!0,Lr=null,$a=!1,t!==null&&N1(n,t),n=Rh(n,m.children),n.flags|=134221824,n)}function $v(t,n,l){t.lanes|=n;var u=t.alternate;u!==null&&(u.lanes|=n),fu(t.return,n,l)}function Gv(t){for(var n=null;t!==null;){var l=t.alternate;l!==null&&ju(l)===null&&(n=t),t=t.sibling}return n}function zu(t,n,l,u,m,v){var T=t.memoizedState;T===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:u,tail:l,tailMode:m,treeForkCount:v}:(T.isBackwards=n,T.rendering=null,T.renderingStartTime=0,T.last=u,T.tail=l,T.tailMode=m,T.treeForkCount=v)}function Oh(t){var n=t.child;for(t.child=null;n!==null;){var l=n.sibling;n.sibling=t.child,t.child=n,n=l}}function Dh(t,n,l){var u=n.pendingProps,m=u.revealOrder,v=u.tail;u=u.children;var T=On.current;if(n.flags&128)return Ks(n,T),null;var z=(T&2)!==0;if(z?(T=T&1|2,n.flags|=128):T&=1,Ks(n,T),m==="backwards"&&t!==null?(Oh(t),yn(t,n,u,l),Oh(t)):yn(t,n,u,l),u=ut?Ps:0,!z&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&$v(t,l,n);else if(t.tag===19)$v(t,l,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(m){case"backwards":l=Gv(n.child),l===null?(m=n.child,n.child=null):(m=l.sibling,l.sibling=null,Oh(n)),zu(n,!0,m,null,v,u);break;case"unstable_legacy-backwards":for(l=null,m=n.child,n.child=null;m!==null;){if(t=m.alternate,t!==null&&ju(t)===null){n.child=m;break}t=m.sibling,m.sibling=l,l=m,m=t}zu(n,!0,l,null,v,u);break;case"together":zu(n,!1,null,null,void 0,u);break;case"independent":n.memoizedState=null;break;default:l=Gv(n.child),l===null?(m=n.child,n.child=null):(m=l.sibling,l.sibling=null),zu(n,!1,m,l,v,u)}return n.child}function Yv(t,n,l){var u=n.pendingProps;return Ir(n,n.type,u.value),yn(t,n,u.children,l),n.child}function lr(t,n,l){if(t!==null&&(n.dependencies=t.dependencies),Xr|=n.lanes,(l&n.childLanes)===0)if(t!==null){if(Dl(t,n,l,!1),(l&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(r(153));if(n.child!==null){for(t=n.child,l=er(t,t.pendingProps),n.child=l,l.return=n;t.sibling!==null;)t=t.sibling,l=l.sibling=er(t,t.pendingProps),l.return=n;l.sibling=null}return n.child}function zh(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&hu(t)))}function P6(t,n,l){switch(n.tag){case 3:$n(n,n.stateNode.containerInfo),Ir(n,un,t.memoizedState.cache),Rl();break;case 27:case 5:ga(n);break;case 4:$n(n,n.stateNode.containerInfo);break;case 10:Ir(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,lh(n),null;break;case 13:var u=n.memoizedState;if(u!==null){if(u.dehydrated!==null)return Vr(n),n.flags|=128,null;u=Dl(t,n,l,!1);var m=n.child.childLanes;return u||(l&m)!==0?Vv(t,n,l):(Vr(n),t=lr(t,n,l),t!==null?t.sibling:null)}Vr(n);break;case 19:if(n.flags&128)return Dh(t,n,l);if(m=(t.flags&128)!==0,u=(l&n.childLanes)!==0,u||(Dl(t,n,l,!1),u=(l&n.childLanes)!==0),m){if(u)return Dh(t,n,l);n.flags|=128}if(m=n.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),Ks(n,On.current),u)break;return null;case 22:return n.lanes=0,Iv(t,n,l,n.pendingProps);case 24:Ir(n,un,t.memoizedState.cache)}return lr(t,n,l)}function Kv(t,n,l){if(t!==null)if(t.memoizedProps!==n.pendingProps)fn=!0;else{if(!zh(t,l)&&(n.flags&128)===0)return fn=!1,P6(t,n,l);fn=(t.flags&131072)!==0}else fn=!1,ut&&(n.flags&1048576)!==0&&C1(n,Ps,n.index);switch(n.lanes=0,n.tag){case 16:e:{var u=n.pendingProps;if(t=Il(n.elementType),n.type=t,typeof t=="function")Uf(t)?(u=Ul(t,u),n.tag=1,n=Uv(null,n,t,u,l)):(n.tag=0,n=Th(null,n,t,u,l));else{if(t!=null){var m=t.$$typeof;if(m===X){n.tag=11,n=zv(null,n,t,u,l);break e}else if(m===ie){n.tag=14,n=Lv(null,n,t,u,l);break e}else if(m===F){n.tag=10,n.type=t,n=Yv(null,n,l);break e}}throw n=Se(t)||t,Error(r(306,n,""))}}return n;case 0:return Th(t,n,n.type,n.pendingProps,l);case 1:return u=n.type,m=Ul(u,n.pendingProps),Uv(t,n,u,m,l);case 3:e:{if($n(n,n.stateNode.containerInfo),t===null)throw Error(r(387));u=n.pendingProps;var v=n.memoizedState;m=v.element,th(t,n),Ys(n,u,null,l);var T=n.memoizedState;if(u=T.cache,Ir(n,un,u),u!==v.cache&&Xf(n,[un],l,!0),Gs(),u=T.element,v.isDehydrated)if(v={element:u,isDehydrated:!1,cache:T.cache},n.updateQueue.baseState=v,n.memoizedState=v,n.flags&256){n=Fv(t,n,u,l);break e}else if(u!==m){m=Ua(Error(r(424)),n),Hs(m),n=Fv(t,n,u,l);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(qt=Ya(t.firstChild),Sn=n,ut=!0,Lr=null,$a=!0,l=I1(n,null,u,l),n.child=l;l;)l.flags=l.flags&-3|134221824,l=l.sibling}else{if(Rl(),u===m){n=lr(t,n,l);break e}yn(t,n,u,l)}n=n.child}return n;case 26:return Lo(t,n),t===null?(l=xy(n.type,null,n.pendingProps,null))?n.memoizedState=l:ut||(n.stateNode=J2(n.type,n.pendingProps,jn.current,n)):n.memoizedState=xy(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return ga(n),t===null&&ut&&(u=n.stateNode=py(n.type,n.pendingProps,jn.current),Sn=n,$a=!0,m=qt,Wr(n.type)?(_m=m,qt=Ya(u.firstChild)):qt=m),yn(t,n,n.pendingProps.children,l),Lo(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&ut&&((m=u=qt)&&(u=OC(u,n.type,n.pendingProps,$a),u!==null?(n.stateNode=u,Sn=n,qt=Ya(u.firstChild),$a=!1,m=!0):m=!1),m||Br(n)),ga(n),m=n.type,v=n.pendingProps,T=t!==null?t.memoizedProps:null,u=v.children,wm(m,v)?u=null:T!==null&&wm(m,T)&&(n.flags|=32),n.memoizedState!==null&&(m=ch(t,n,T6,null,null,l),es._currentValue=m),Lo(t,n),yn(t,n,u,l),n.child;case 6:return t===null&&ut&&((t=l=qt)&&(l=DC(l,n.pendingProps,$a),l!==null?(n.stateNode=l,Sn=n,qt=null,t=!0):t=!1),t||Br(n)),null;case 13:return Vv(t,n,l);case 4:return $n(n,n.stateNode.containerInfo),u=n.pendingProps,t===null?n.child=Hl(n,null,u,l):yn(t,n,u,l),n.child;case 11:return zv(t,n,n.type,n.pendingProps,l);case 7:return u=n.pendingProps,Lo(t,n),yn(t,n,u,l),n.child;case 8:return yn(t,n,n.pendingProps.children,l),n.child;case 12:return yn(t,n,n.pendingProps.children,l),n.child;case 10:return Yv(t,n,l);case 9:return m=n.type._context,u=n.pendingProps.children,zl(n),m=_n(m),u=u(m),n.flags|=1,yn(t,n,u,l),n.child;case 14:return Lv(t,n,n.type,n.pendingProps,l);case 15:return Bv(t,n,n.type,n.pendingProps,l);case 19:return Dh(t,n,l);case 31:return B6(t,n,l);case 22:return Iv(t,n,l,n.pendingProps);case 24:return zl(n),u=_n(un),t===null?(m=Jf(),m===null&&(m=Bt,v=Qf(),m.pooledCache=v,v.refCount++,v!==null&&(m.pooledCacheLanes|=l),m=v),n.memoizedState={parent:u,cache:m},eh(n),Ir(n,un,m)):((t.lanes&l)!==0&&(th(t,n),Ys(n,null,null,l),Gs()),m=t.memoizedState,v=n.memoizedState,m.parent!==u?(m={parent:u,cache:u},n.memoizedState=m,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=m),Ir(n,un,u)):(u=v.cache,Ir(n,un,u),u!==m.cache&&Xf(n,[un],l,!0))),yn(t,n,n.pendingProps.children,l),n.child;case 30:return n.stateNode===null&&(n.stateNode={autoName:null,paired:null,clones:null,ref:null}),u=n.pendingProps,u.name!=null&&u.name!=="auto"?n.flags|=t===null?18882560:18874368:ut&&uu(n),t!==null&&t.memoizedProps.name!==u.name?n.flags|=4194816:Lo(t,n),yn(t,n,u.children,l),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function or(t){t.flags|=4}function Lh(t,n,l,u,m){var v;if((v=(t.mode&32)!==0)&&(v=l===null?ky(n,u):ky(n,u)&&(u.src!==l.src||u.srcSet!==l.srcSet)),v){if(t.flags|=16777216,(m&335544128)===m)if(t.stateNode.complete)t.flags|=8192;else if(A2())t.flags|=8192;else throw Pl=vu,Wf}else t.flags&=-16777217}function Xv(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Sy(n))if(A2())t.flags|=8192;else throw Pl=vu,Wf}function Lu(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?xa():536870912,t.lanes|=n,qo|=n)}function Ws(t,n){if(!ut)switch(t.tailMode){case"visible":break;case"collapsed":for(var l=t.tail,u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:u.sibling=null;break;default:for(n=t.tail,l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t.tail=null:l.sibling=null}}function Ut(t){var n=t.alternate!==null&&t.alternate.child===t.child,l=0,u=0;if(n)for(var m=t.child;m!==null;)l|=m.lanes|m.childLanes,u|=m.subtreeFlags&1206910976,u|=m.flags&1206910976,m.return=t,m=m.sibling;else for(m=t.child;m!==null;)l|=m.lanes|m.childLanes,u|=m.subtreeFlags,u|=m.flags,m.return=t,m=m.sibling;return t.subtreeFlags|=u,t.childLanes=l,n}function H6(t,n,l){var u=n.pendingProps;switch($f(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ut(n),null;case 1:return Ut(n),null;case 3:return l=n.stateNode,u=null,t!==null&&(u=t.memoizedState.cache),n.memoizedState.cache!==u&&(n.flags|=2048),ar(un),Pn(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(Ao(n)?or(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Yf())),Ut(n),null;case 26:var m=n.type,v=n.memoizedState;return t===null?(or(n),v!==null?(Ut(n),Xv(n,v)):(Ut(n),Lh(n,m,null,u,l))):v?v!==t.memoizedState?(or(n),Ut(n),Xv(n,v)):(Ut(n),n.flags&=-16777217):(t=t.memoizedProps,t!==u&&or(n),Ut(n),Lh(n,m,t,u,l)),null;case 27:if(pe(n),l=jn.current,m=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==u&&or(n);else{if(!u){if(n.stateNode===null)throw Error(r(166));return Ut(n),n.subtreeFlags&=-33554433,null}t=Lt.current,Ao(n)?E1(n):(t=py(m,u,l),n.stateNode=t,or(n))}return Ut(n),n.subtreeFlags&=-33554433,null;case 5:if(pe(n),m=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==u&&or(n);else{if(!u){if(n.stateNode===null)throw Error(r(166));return Ut(n),n.subtreeFlags&=-33554433,null}if(v=Lt.current,Ao(n))E1(n);else{var T=uc(jn.current);switch(v){case 1:v=T.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:v=T.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":v=T.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":v=T.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":v=T.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof u.is=="string"?T.createElement("select",{is:u.is}):T.createElement("select"),u.multiple?v.multiple=!0:u.size&&(v.size=u.size);break;default:v=typeof u.is=="string"?T.createElement(m,{is:u.is}):T.createElement(m)}}v[Vt]=n,v[vn]=u;e:for(T=n.child;T!==null;){if(T.tag===5||T.tag===6)v.appendChild(T.stateNode);else if(T.tag!==4&&T.tag!==27&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===n)break e;for(;T.sibling===null;){if(T.return===null||T.return===n)break e;T=T.return}T.sibling.return=T.return,T=T.sibling}n.stateNode=v;e:switch(zn(v,m,u),m){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&or(n)}}return Ut(n),n.subtreeFlags&=-33554433,Lh(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,l),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==u&&or(n);else{if(typeof u!="string"&&n.stateNode===null)throw Error(r(166));if(t=jn.current,Ao(n)){if(t=n.stateNode,l=n.memoizedProps,u=null,m=Sn,m!==null)switch(m.tag){case 27:case 5:u=m.memoizedProps}t[Vt]=n,t=!!(t.nodeValue===l||u!==null&&u.suppressHydrationWarning===!0||K2(t.nodeValue,l)),t||Br(n,!0)}else t=uc(t).createTextNode(u),t[Vt]=n,n.stateNode=t}return Ut(n),null;case 31:if(l=n.memoizedState,t===null||t.memoizedState!==null){if(u=Ao(n),l!==null){if(t===null){if(!u)throw Error(r(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[Vt]=n}else Rl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ut(n),t=!1}else l=Yf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return n.flags&256?(Na(n),n):(Na(n),null);if((n.flags&128)!==0)throw Error(r(558))}return Ut(n),null;case 13:if(u=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(m=Ao(n),u!==null&&u.dehydrated!==null){if(t===null){if(!m)throw Error(r(318));if(m=n.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(r(317));m[Vt]=n}else Rl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ut(n),m=!1}else m=Yf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=m),m=!0;if(!m)return n.flags&256?(Na(n),n):(Na(n),null)}return Na(n),(n.flags&128)!==0?(n.lanes=l,n):(l=u!==null,t=t!==null&&t.memoizedState!==null,l&&(u=n.child,m=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(m=u.alternate.memoizedState.cachePool.pool),v=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(v=u.memoizedState.cachePool.pool),v!==m&&(u.flags|=2048)),l!==t&&l&&(n.child.flags|=8192),Lu(n,n.updateQueue),Ut(n),null);case 4:return Pn(),t===null&&vm(n.stateNode.containerInfo),n.flags|=67108864,Ut(n),null;case 10:return ar(n.type),Ut(n),null;case 19:if(oh(n),u=n.memoizedState,u===null)return Ut(n),null;if(m=(n.flags&128)!==0,v=u.rendering,v===null)if(m)Ws(u,!1);else{if(ln!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(v=ju(t),v!==null){for(n.flags|=128,Ws(u,!1),t=v.updateQueue,n.updateQueue=t,Lu(n,t),n.subtreeFlags=0,t=l,l=n.child;l!==null;)w1(l,t),l=l.sibling;return Ks(n,On.current&1|2),ut&&tr(n,u.treeForkCount),n.child}t=t.sibling}u.tail!==null&&Gt()>Ku&&(n.flags|=128,m=!0,Ws(u,!1),n.lanes=4194304)}else{if(!m)if(t=ju(v),t!==null){if(n.flags|=128,m=!0,t=t.updateQueue,n.updateQueue=t,Lu(n,t),Ws(u,!0),u.tail===null&&u.tailMode!=="collapsed"&&u.tailMode!=="visible"&&!v.alternate&&!ut)return Ut(n),null}else 2*Gt()-u.renderingStartTime>Ku&&l!==536870912&&(n.flags|=128,m=!0,Ws(u,!1),n.lanes=4194304);u.isBackwards?(v.sibling=n.child,n.child=v):(t=u.last,t!==null?t.sibling=v:n.child=v,u.last=v)}if(u.tail!==null){t=u.tail;e:{for(l=t;l!==null;){if(l.alternate!==null){l=!1;break e}l=l.sibling}l=!0}return u.rendering=t,u.tail=t.sibling,u.renderingStartTime=Gt(),t.sibling=null,v=On.current,v=m?v&1|2:v&1,u.tailMode==="visible"||u.tailMode==="collapsed"||!l||ut?Ks(n,v):(l=v,et(Rn,n),et(On,l),qn===null&&(qn=n)),ut&&tr(n,u.treeForkCount),t}return Ut(n),null;case 22:case 23:return Na(n),rh(),u=n.memoizedState!==null,t!==null?t.memoizedState!==null!==u&&(n.flags|=8192):u&&(n.flags|=8192),u?(l&536870912)!==0&&(n.flags&128)===0&&(Ut(n),n.subtreeFlags&6&&(n.flags|=8192)):Ut(n),l=n.updateQueue,l!==null&&Lu(n,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),u=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(u=n.memoizedState.cachePool.pool),u!==l&&(n.flags|=2048),t!==null&&Qe(Bl),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),ar(un),Ut(n),null;case 25:return null;case 30:return n.flags|=33554432,Ut(n),null}throw Error(r(156,n.tag))}function q6(t,n){switch($f(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return ar(un),Pn(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return pe(n),null;case 31:if(n.memoizedState!==null){if(Na(n),n.alternate===null)throw Error(r(340));Rl()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Na(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(r(340));Rl()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return oh(n),t=n.flags,t&65536?(n.flags=t&-65537|128,t=n.memoizedState,t!==null&&(t.rendering=null,t.tail=null),n.flags|=4,n):null;case 4:return Pn(),null;case 10:return ar(n.type),null;case 22:case 23:return Na(n),rh(),t!==null&&Qe(Bl),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return ar(un),null;case 25:return null;default:return null}}function Qv(t,n){switch($f(n),n.tag){case 3:ar(un),Pn();break;case 26:case 27:case 5:pe(n);break;case 4:Pn();break;case 31:n.memoizedState!==null&&Na(n);break;case 13:Na(n);break;case 19:oh(n);break;case 10:ar(n.type);break;case 22:case 23:Na(n),rh(),t!==null&&Qe(Bl);break;case 24:ar(un)}}function ec(t,n){try{var l=n.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var m=u.next;l=m;do{if((l.tag&t)===t){u=void 0;var v=l.create,T=l.inst;u=v(),T.destroy=u}l=l.next}while(l!==m)}}catch(z){_t(n,n.return,z)}}function Gr(t,n,l){try{var u=n.updateQueue,m=u!==null?u.lastEffect:null;if(m!==null){var v=m.next;u=v;do{if((u.tag&t)===t){var T=u.inst,z=T.destroy;if(z!==void 0){T.destroy=void 0,m=n;var K=l,te=z;try{te()}catch(ce){_t(m,K,ce)}}}u=u.next}while(u!==v)}}catch(ce){_t(n,n.return,ce)}}function Zv(t){var n=t.updateQueue;if(n!==null){var l=t.stateNode;try{H1(n,l)}catch(u){_t(t,t.return,u)}}}function Jv(t,n,l){l.props=Ul(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(u){_t(t,n,u)}}function Ci(t,n){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var u=t.stateNode;break;case 30:var m=t.stateNode,v=Ji(t.memoizedProps,m);(m.ref===null||m.ref.name!==v)&&(m.ref=ry(v)),u=m.ref;break;case 7:if(t.stateNode===null){var T=new _a(t);g(t.child,!1,_C,T,void 0,void 0),t.stateNode=T}u=t.stateNode;break;default:u=t.stateNode}typeof l=="function"?t.refCleanup=l(u):l.current=u}}catch(z){_t(t,n,z)}}function Dn(t,n){var l=t.ref,u=t.refCleanup;if(l!==null)if(typeof u=="function")try{u()}catch(m){_t(t,n,m)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(m){_t(t,n,m)}else l.current=null}function Bu(t,n){if((t.tag===5||t.tag===27||t.tag===6)&&t.alternate===null&&n!==null)for(var l=0;l<n.length;l++)dy(t.stateNode,n[l])}function Wv(t){for(var n=t.return;n!==null&&(Ih(n)&&dy(t.stateNode,n.stateNode),!Bh(n));)n=n.return}function tc(t){for(var n=t.return;n!==null&&(Ih(n)&&RC(t.stateNode,n.stateNode),!Bh(n));)n=n.return}function Bh(t){return t.tag===5||t.tag===3||t.tag===27}function Ih(t){return t&&t.tag===7&&t.stateNode!==null}function Ph(t){var n=t.type,l=t.memoizedProps,u=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":l.autoFocus&&u.focus();break e;case"img":l.src?u.src=l.src:l.srcSet&&(u.srcset=l.srcSet)}}catch(m){_t(t,t.return,m)}}function Hh(t,n,l){try{var u=t.stateNode;hC(u,t.type,l,n),u[vn]=n}catch(m){_t(t,t.return,m)}}function e2(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Wr(t.type)||t.tag===4}function qh(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||e2(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Wr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Uh(t,n,l,u){var m=t.tag;if(m===5||m===6)m=t.stateNode,n?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(m,n):(n=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,n.appendChild(m),l=l._reactRootContainer,l!=null||n.onclick!==null||(n.onclick=Xn)),Bu(t,u),Le=!0;else if(m!==4&&(m===27&&(Bu(t,u),u=null,Wr(t.type)&&(l=t.stateNode,n=null)),t=t.child,t!==null))for(Uh(t,n,l,u),t=t.sibling;t!==null;)Uh(t,n,l,u),t=t.sibling}function Iu(t,n,l,u){var m=t.tag;if(m===5||m===6)m=t.stateNode,n?l.insertBefore(m,n):l.appendChild(m),Bu(t,u),Le=!0;else if(m!==4&&(m===27&&(Bu(t,u),u=null,Wr(t.type)&&(l=t.stateNode)),t=t.child,t!==null))for(Iu(t,n,l,u),t=t.sibling;t!==null;)Iu(t,n,l,u),t=t.sibling}function t2(t){var n=t.stateNode,l=t.memoizedProps;try{for(var u=t.type,m=n.attributes;m.length;)n.removeAttributeNode(m[0]);zn(n,u,l),n[Vt]=t,n[vn]=l}catch(v){_t(t,t.return,v)}}var Pu=!1,Ea=null;function n2(t){(t.tag===30||(t.subtreeFlags&33554432)!==0)&&(Pu=!0)}var Ni=null;function a2(){var t=Ni;return Ni=null,t}var oa=0;function Bo(t,n,l,u,m){return oa=0,i2(t.child,n,l,u,m)}function i2(t,n,l,u,m){for(var v=!1;t!==null;){if(t.tag===5){var T=t.stateNode;if(u!==null){var z=Cm(T);u.push(z),z.view&&(v=!0)}else v||Cm(T).view&&(v=!0);Pu=!0,ay(T,oa===0?n:n+"_"+oa,l),oa++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&m||i2(t.child,n,l,u,m)&&(v=!0));t=t.sibling}return v}function Ei(t,n){for(;t!==null;)t.tag===5?iy(t.stateNode,t.memoizedProps):(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&n||Ei(t.child,n)),t=t.sibling}function Hu(t){if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if((t.tag!==22||t.memoizedState===null)&&(Hu(t),t.tag===30&&(t.flags&18874368)!==0&&t.stateNode.paired)){var n=t.memoizedProps;if(n.name==null||n.name==="auto")throw Error(r(544));var l=n.name;n=Wi(n.default,n.share),n!=="none"&&(Bo(t,l,n,null,!1)||Ei(t.child,!1))}t=t.sibling}}function Fh(t,n){if(t.tag===30){var l=t.stateNode,u=t.memoizedProps,m=Ji(u,l),v=Wi(u.default,l.paired?u.share:u.enter);v!=="none"?Bo(t,m,v,null,!1)?(Hu(t),l.paired||n||$o(t,u.onEnter)):Ei(t.child,!1):Hu(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)Fh(t,n),t=t.sibling;else Hu(t)}function Vh(t){if(Ea!==null&&Ea.size!==0){var n=Ea;if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if(t.tag!==22||t.memoizedState===null){if(t.tag===30&&(t.flags&18874368)!==0){var l=t.memoizedProps,u=l.name;if(u!=null&&u!=="auto"){var m=n.get(u);if(m!==void 0){var v=Wi(l.default,l.share);if(v!=="none"&&(Bo(t,u,v,null,!1)?(v=t.stateNode,m.paired=v,v.paired=m,$o(t,l.onShare)):Ei(t.child,!1)),n.delete(u),n.size===0)break}}}Vh(t)}t=t.sibling}}}function $h(t){if(t.tag===30){var n=t.memoizedProps,l=Ji(n,t.stateNode),u=Ea!==null?Ea.get(l):void 0,m=Wi(n.default,u!==void 0?n.share:n.exit);m!=="none"&&(Bo(t,l,m,null,!1)?u!==void 0?(m=t.stateNode,u.paired=m,m.paired=u,Ea.delete(l),$o(t,n.onShare)):$o(t,n.onExit):Ei(t.child,!1)),Ea!==null&&Vh(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)$h(t),t=t.sibling;else Ea!==null&&Vh(t)}function r2(t){for(t=t.child;t!==null;){if(t.tag===30){var n=t.memoizedProps,l=Ji(n,t.stateNode);n=Wi(n.default,n.update),t.flags&=-5,n!=="none"&&Bo(t,l,n,t.memoizedState=[],!1)}else(t.subtreeFlags&33554432)!==0&&r2(t);t=t.sibling}}function Gh(t){if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if(t.tag!==22||t.memoizedState===null){if(t.tag===30&&(t.flags&18874368)!==0){var n=t.stateNode;n.paired!==null&&(n.paired=null,Ei(t.child,!1))}Gh(t)}t=t.sibling}}function qu(t){if(t.tag===30)t.stateNode.paired=null,Ei(t.child,!1),Gh(t);else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)qu(t),t=t.sibling;else Gh(t)}function l2(t){for(t=t.child;t!==null;)t.tag===30?Ei(t.child,!1):(t.subtreeFlags&33554432)!==0&&l2(t),t=t.sibling}function Yh(t,n,l,u,m,v,T){for(var z=!1;n!==null;){if(n.tag===5){var K=n.stateNode;if(v!==null&&oa<v.length){var te=v[oa],ce=Cm(K);(te.view||ce.view)&&(z=!0);var ye;if(ye=(t.flags&4)===0)if(ce.clip)ye=!0;else{ye=te.rect;var J=ce.rect;ye=ye.y!==J.y||ye.x!==J.x||ye.height!==J.height||ye.width!==J.width}ye&&(t.flags|=4),ce.abs?ce=!te.abs:(te=te.rect,ce=ce.rect,ce=te.height!==ce.height||te.width!==ce.width),ce&&(t.flags|=32)}else t.flags|=32;(t.flags&4)!==0&&ay(K,oa===0?l:l+"_"+oa,m),z&&(t.flags&4)!==0||(Ni===null&&(Ni=[]),Ni.push(K,oa===0?u:u+"_"+oa,n.memoizedProps)),oa++}else(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&T?t.flags|=n.flags&32:Yh(t,n.child,l,u,m,v,T)&&(z=!0));n=n.sibling}return z}function o2(t,n){for(t=t.child;t!==null;){if(t.tag===30){var l=t.memoizedProps,u=t.stateNode,m=Ji(l,u),v=Wi(l.default,l.update),T;T=t.memoizedState,t.memoizedState=null,u=t;var z=t.child;oa=0,m=Yh(u,z,m,m,v,T,!1),(t.flags&4)!==0&&m&&$o(t,l.onUpdate)}else(t.subtreeFlags&33554432)!==0&&o2(t);t=t.sibling}}var Cn=!1,Tt=!1,Ti=!1,Kh=!1,s2=typeof WeakSet=="function"?WeakSet:Set,Nn=null,Ai=!1,nc=!1,Uu=!1,Xh=!1;function U6(t,n,l){if(t=t.containerInfo,bm=ts,t=f1(t),zf(t)){if("selectionStart"in t)var u={start:t.selectionStart,end:t.selectionEnd};else e:{u=(u=t.ownerDocument)&&u.defaultView||window;var m=u.getSelection&&u.getSelection();if(m&&m.rangeCount!==0){u=m.anchorNode;var v=m.anchorOffset,T=m.focusNode;m=m.focusOffset;try{u.nodeType,T.nodeType}catch{u=null;break e}var z=0,K=-1,te=-1,ce=0,ye=0,J=t,re=null;t:for(;;){for(var Oe;J!==u||v!==0&&J.nodeType!==3||(K=z+v),J!==T||m!==0&&J.nodeType!==3||(te=z+m),J.nodeType===3&&(z+=J.nodeValue.length),(Oe=J.firstChild)!==null;)re=J,J=Oe;for(;;){if(J===t)break t;if(re===u&&++ce===v&&(K=z),re===T&&++ye===m&&(te=z),(Oe=J.nextSibling)!==null)break;J=re,re=J.parentNode}J=Oe}u=K===-1||te===-1?null:{start:K,end:te}}else u=null}u=u||{start:0,end:0}}else u=null;for(jm={focusedElem:t,selectionRange:u},ts=!1,l=(l&335544064)===l,Nn=n,n=l?9270:1024;Nn!==null;){if(t=Nn,l&&(u=t.deletions,u!==null))for(v=0;v<u.length;v++)l&&$h(u[v]);if(t.alternate===null&&(t.flags&2)!==0)l&&n2(t),Fu(l);else{if(t.tag===22){if(u=t.alternate,t.memoizedState!==null){u!==null&&u.memoizedState===null&&l&&$h(u),Fu(l);continue}else if(u!==null&&u.memoizedState!==null){l&&n2(t),Fu(l);continue}}u=t.child,(t.subtreeFlags&n)!==0&&u!==null?(u.return=t,Nn=u):(l&&r2(t),Fu(l))}}Ea=null}function Fu(t){for(;Nn!==null;){var n=Nn,l=t,u=n.alternate,m=n.flags;switch(n.tag){case 0:case 11:case 15:break;case 1:if((m&1024)!==0&&u!==null){l=void 0,m=u.memoizedProps,u=u.memoizedState;var v=n.stateNode;try{var T=Ul(n.type,m);l=v.getSnapshotBeforeUpdate(T,u),v.__reactInternalSnapshotBeforeUpdate=l}catch(z){_t(n,n.return,z)}}break;case 3:if((m&1024)!==0){if(u=n.stateNode.containerInfo,l=u.nodeType,l===9)Tm(u);else if(l===1)switch(u.nodeName){case"HEAD":case"HTML":case"BODY":Tm(u);break;default:u.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:l&&u!==null&&(l=Ji(u.memoizedProps,u.stateNode),m=n.memoizedProps,m=Wi(m.default,m.update),m!=="none"&&Bo(u,l,m,u.memoizedState=[],!0));break;default:if((m&1024)!==0)throw Error(r(163))}if(u=n.sibling,u!==null){u.return=n.return,Nn=u;break}Nn=n.return}}function c2(t,n,l){var u=l.flags;switch(l.tag){case 0:case 11:case 15:Mi(t,l),u&4&&ec(5,l);break;case 1:if(Mi(t,l),u&4)if(t=l.stateNode,n===null)try{t.componentDidMount()}catch(T){_t(l,l.return,T)}else{var m=Ul(l.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(m,n,t.__reactInternalSnapshotBeforeUpdate)}catch(T){_t(l,l.return,T)}}u&64&&Zv(l),u&512&&Ci(l,l.return);break;case 3:if(Mi(t,l),u&64&&(t=l.updateQueue,t!==null)){if(n=null,l.child!==null)switch(l.child.tag){case 27:case 5:n=l.child.stateNode;break;case 1:n=l.child.stateNode}try{H1(t,n)}catch(T){_t(l,l.return,T)}}break;case 27:n===null&&u&4&&t2(l);case 26:case 5:Mi(t,l),n===null&&u&4&&Ph(l),u&512&&Ci(l,l.return);break;case 12:Mi(t,l);break;case 31:Mi(t,l),u&4&&h2(t,l);break;case 13:Mi(t,l),u&4&&m2(t,l),u&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=eC.bind(null,l),zC(t,l))));break;case 22:if(u=l.memoizedState!==null||Cn,!u){var v=n!==null&&n.memoizedState!==null||Tt;n=Cn,m=Tt,Cn=u,(Tt=v)&&!m?(u=2,(l.subtreeFlags&8772)!==0&&(u|=1),li(t,l,u)):Mi(t,l),Cn=n,Tt=m}break;case 30:Mi(t,l),u&512&&Ci(l,l.return);break;case 7:u&512&&Ci(l,l.return);default:Mi(t,l)}}function Qh(t,n){for(t=t.child;t!==null;)u2(t,n),t=t.sibling}function u2(t,n){switch(t.tag){case 5:case 26:try{var l=t.stateNode;if(n){var u=l.style;typeof u.setProperty=="function"?u.setProperty("display","none","important"):u.display="none"}else{var m=t.stateNode,v=t.memoizedProps.style,T=v!=null&&v.hasOwnProperty("display")?v.display:null;m.style.display=T==null||typeof T=="boolean"?"":(""+T).trim()}}catch(K){_t(t,t.return,K)}Zh(t,n);break;case 6:try{t.stateNode.nodeValue=n?"":t.memoizedProps,Le=!0}catch(K){_t(t,t.return,K)}break;case 18:try{var z=t.stateNode;n?ny(z,!0):ny(t.stateNode,!1)}catch(K){_t(t,t.return,K)}break;case 22:case 23:t.memoizedState===null&&Qh(t,n);break;default:Qh(t,n)}}function Zh(t,n){if(t.subtreeFlags&67108864)for(t=t.child;t!==null;){e:{var l=t,u=n;switch(l.tag){case 4:u2(l,u);break e;case 22:l.memoizedState===null&&Zh(l,u);break e;default:Zh(l,u)}}t=t.sibling}}function d2(t){var n=t.alternate;n!==null&&(t.alternate=null,d2(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&Mr(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Yt=null,sa=!1;function ii(t,n,l){for(l=l.child;l!==null;)f2(t,n,l),l=l.sibling}function f2(t,n,l){if(Ht&&typeof Ht.onCommitFiberUnmount=="function")try{Ht.onCommitFiberUnmount(yi,l)}catch{}switch(l.tag){case 26:Tt||Dn(l,n),ii(t,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&!Tt&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Tt||Dn(l,n),tc(l);var u=Yt,m=sa;Wr(l.type)&&(Yt=l.stateNode,sa=!1),ii(t,n,l),gy(l.stateNode,l.type,l.memoizedProps),Yt=u,sa=m;break;case 5:Tt||Dn(l,n),tc(l);case 6:if(l.tag===6&&tc(l),u=Yt,m=sa,Yt=null,ii(t,n,l),Yt=u,sa=m,Yt!==null)if(sa)try{(Yt.nodeType===9?Yt.body:Yt.nodeName==="HTML"?Yt.ownerDocument.body:Yt).removeChild(l.stateNode),Le=!0}catch(v){_t(l,n,v)}else try{Yt.removeChild(l.stateNode),Le=!0}catch(v){_t(l,n,v)}break;case 18:Yt!==null&&(sa?(t=Yt,ty(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),ns(t)):ty(Yt,l.stateNode));break;case 4:u=Yt,m=sa,Yt=l.stateNode.containerInfo,sa=!0,ii(t,n,l),Yt=u,sa=m;break;case 0:case 11:case 14:case 15:Gr(2,l,n),Tt||Gr(4,l,n),ii(t,n,l);break;case 1:Tt||(Dn(l,n),u=l.stateNode,typeof u.componentWillUnmount=="function"&&Jv(l,n,u)),ii(t,n,l);break;case 21:ii(t,n,l);break;case 22:Tt=(u=Tt)||l.memoizedState!==null,ii(t,n,l),Tt=u;break;case 30:Dn(l,n),ii(t,n,l);break;case 7:Tt||Dn(l,n),ii(t,n,l);break;default:ii(t,n,l)}}function h2(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ns(t)}catch(l){_t(n,n.return,l)}}}function m2(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ns(t)}catch(l){_t(n,n.return,l)}}function F6(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new s2),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new s2),n;default:throw Error(r(435,t.tag))}}function Vu(t,n){var l=F6(t);n.forEach(function(u){if(!l.has(u)){l.add(u);var m=tC.bind(null,t,u);u.then(m,m)}})}function Jn(t,n,l){var u=n.deletions;if(u!==null)for(var m=0;m<u.length;m++){var v=u[m],T=t,z=n,K=z;e:for(;K!==null;){switch(K.tag){case 27:if(Wr(K.type)){Yt=K.stateNode,sa=!1;break e}break;case 5:Yt=K.stateNode,sa=!1;break e;case 3:case 4:Yt=K.stateNode.containerInfo,sa=!0;break e}K=K.return}if(Yt===null)throw Error(r(160));f2(T,z,v),Yt=null,sa=!1,T=v.alternate,T!==null&&(T.return=null),v.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)p2(n,t,l),n=n.sibling}var ri=null;function p2(t,n,l){var u=t.alternate,m=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(m&4&&(u=t.updateQueue,u=u!==null?u.events:null,u!==null))for(var v=0;v<u.length;v++){var T=u[v];T.ref.impl=T.nextImpl}Jn(n,t,l),Wn(t),m&4&&(Gr(3,t,t.return),ec(3,t),Gr(5,t,t.return));break;case 1:Jn(n,t,l),Wn(t),m&512&&(Tt||u===null||Dn(u,u.return)),m&64&&Cn&&(t=t.updateQueue,t!==null&&(n=t.callbacks,n!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?n:l.concat(n))));break;case 26:if(v=ri,Jn(n,t,l),Wn(t),m&512&&(Tt||u===null||Dn(u,u.return)),m&4)if(m=u!==null?u.memoizedState:null,l=t.memoizedState,u===null)if(l===null)if(t.stateNode===null)if(Cn)t.stateNode=J2(t.type,t.memoizedProps,n.containerInfo,t);else{e:{n=t.type,l=t.memoizedProps,m=v.ownerDocument||v;t:switch(n){case"title":u=m.getElementsByTagName("title")[0],(!u||u[Xi]||u[Vt]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=m.createElement(n),m.head.insertBefore(u,m.querySelector("head > title"))),zn(u,n,l),u[Vt]=t,je(u),n=u;break e;case"link":if(v=wy("link","href",m).get(n+(l.href||""))){for(T=0;T<v.length;T++)if(u=v[T],u.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&u.getAttribute("rel")===(l.rel==null?null:l.rel)&&u.getAttribute("title")===(l.title==null?null:l.title)&&u.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){v.splice(T,1);break t}}u=m.createElement(n),zn(u,n,l),m.head.appendChild(u);break;case"meta":if(v=wy("meta","content",m).get(n+(l.content||""))){for(T=0;T<v.length;T++)if(u=v[T],u.getAttribute("content")===(l.content==null?null:""+l.content)&&u.getAttribute("name")===(l.name==null?null:l.name)&&u.getAttribute("property")===(l.property==null?null:l.property)&&u.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&u.getAttribute("charset")===(l.charSet==null?null:l.charSet)){v.splice(T,1);break t}}u=m.createElement(n),zn(u,n,l),m.head.appendChild(u);break;default:throw Error(r(468,n))}u[Vt]=t,je(u),n=u}t.stateNode=n}else Cn||zm(v,t.type,t.stateNode);else t.stateNode=jy(v,l,t.memoizedProps);else m!==l?(m===null?(n=u.stateNode,n===null||Tt||n.parentNode.removeChild(n)):m.count--,l===null?Cn||zm(v,t.type,t.stateNode):jy(v,l,t.memoizedProps)):l===null&&t.stateNode!==null&&Hh(t,t.memoizedProps,u.memoizedProps);break;case 27:Jn(n,t,l),Wn(t),m&512&&(Tt||u===null||Dn(u,u.return)),u!==null&&m&4&&Hh(t,t.memoizedProps,u.memoizedProps);break;case 5:if(v=Ti,Ti=!1,Jn(n,t,l),Ti=v,Wn(t),m&512&&(Tt||u===null||Dn(u,u.return)),t.flags&32){n=t.stateNode;try{Kn(n,""),Le=!0}catch(ce){_t(t,t.return,ce)}}m&4&&t.stateNode!=null&&(n=t.memoizedProps,Hh(t,n,u!==null?u.memoizedProps:n)),m&1024&&(Kh=!0);break;case 6:if(Jn(n,t,l),Wn(t),m&4){if(t.stateNode===null)throw Error(r(162));n=t.memoizedProps,l=t.stateNode;try{l.nodeValue=n,Le=!0}catch(ce){_t(t,t.return,ce)}}break;case 3:if(Le=!1,rd=null,v=ri,ri=dc(n.containerInfo),Jn(n,t,l),ri=v,Wn(t),m&4&&u!==null&&u.memoizedState.isDehydrated)try{ns(n.containerInfo)}catch(ce){_t(t,t.return,ce)}Kh&&(Kh=!1,g2(t)),Le=!1;break;case 4:m=Ti,Ti=Cn,u=dt(),v=ri,ri=dc(t.stateNode.containerInfo),Jn(n,t,l),Wn(t),ri=v,Le&&nc&&(Uu=!0),Le=u,Ti=m;break;case 12:Jn(n,t,l),Wn(t);break;case 31:Jn(n,t,l),Wn(t),m&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,Vu(t,n)));break;case 13:Jn(n,t,l),Wn(t),t.child.flags&8192&&t.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Yu=Gt()),m&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,Vu(t,n)));break;case 22:v=t.memoizedState!==null,T=u!==null&&u.memoizedState!==null;var z=Cn,K=Tt,te=Ti;Cn=z||v,Ti=te||v,Tt=K||T,Jn(n,t,l),Tt=K,Ti=te,Cn=z,Wn(t),m&8192&&(n=t.stateNode,n._visibility=v?n._visibility&-2:n._visibility|1,!v||u===null||T||Cn||Tt||(n=T||Tt,l=Cn,u=Tt,Cn=v||Cn,Tt=n,Yr(t,2),Cn=l,Tt=u),!v&&Ti||Qh(t,v)),m&4&&(n=t.updateQueue,n!==null&&(l=n.retryQueue,l!==null&&(n.retryQueue=null,Vu(t,l))));break;case 19:Jn(n,t,l),Wn(t),m&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,Vu(t,n)));break;case 30:m&512&&(Tt||u===null||Dn(u,u.return)),m=dt(),v=nc,T=(l&335544064)===l,z=t.memoizedProps,nc=T&&Wi(z.default,z.update)!=="none",Jn(n,t,l),Wn(t),T&&u!==null&&Le&&(t.flags|=4),nc=v,Le=m;break;case 21:break;case 7:m&512&&(Tt||u===null||Dn(u,u.return)),u&&u.stateNode!==null&&(u.stateNode._fragmentFiber=t);default:Jn(n,t,l),Wn(t)}}function Wn(t){var n=t.flags;if(n&2){try{for(var l,u=t.return;u!==null;){if(e2(u)){l=u;break}u=u.return}u=null;for(var m=t.return;m!==null;){if(Ih(m)){var v=m.stateNode;u===null?u=[v]:u.push(v)}if(Bh(m))break;m=m.return}var T=u;if(l==null)throw Error(r(160));switch(l.tag){case 27:var z=l.stateNode,K=qh(t);Iu(t,K,z,T);break;case 5:var te=l.stateNode;l.flags&32&&(Kn(te,""),l.flags&=-33);var ce=qh(t);Iu(t,ce,te,T);break;case 3:case 4:var ye=l.stateNode.containerInfo,J=qh(t);Uh(t,J,ye,T);break;default:throw Error(r(161))}}catch(re){_t(t,t.return,re)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function g2(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;g2(n),n.tag===5&&n.flags&1024&&(n=n.stateNode,ts=!0,n.reset(),ts=!1),t=t.sibling}}function Io(t,n){if(n.subtreeFlags&9270)for(n=n.child;n!==null;)v2(n,t),n=n.sibling;else o2(n)}function v2(t,n){var l=t.alternate;if(l===null)Fh(t,!1);else switch(t.tag){case 3:if(Xh=Ai=!1,a2(),Io(n,t),!Ai&&!Uu){if(t=Ni,t!==null)for(var u=0;u<t.length;u+=3){l=t[u];var m=t[u+1];iy(l,t[u+2]),l=l.ownerDocument.documentElement,l!==null&&l.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+m+")"})}t=n.containerInfo,t=t.nodeType===9?t.documentElement:t.ownerDocument.documentElement,t!==null&&t.style.viewTransitionName===""&&(t.style.viewTransitionName="none",t.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),t.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),Xh=!0}Ni=null;break;case 5:Io(n,t);break;case 4:u=Ai,Ai=!1,Io(n,t),Ai&&(Uu=!0),Ai=u;break;case 22:t.memoizedState===null&&(l.memoizedState!==null?Fh(t,!1):Io(n,t));break;case 30:u=Ai,m=a2(),Ai=!1,Io(n,t),Ai&&(t.flags|=4);var v=t.memoizedProps,T=t.stateNode;n=Ji(v,T),T=Ji(l.memoizedProps,T);var z=Wi(v.default,v.update);z==="none"?n=!1:(v=l.memoizedState,l.memoizedState=null,l=t.child,oa=0,n=Yh(t,l,n,T,z,v,!0),oa!==(v===null?0:v.length)&&(t.flags|=32)),(t.flags&4)!==0&&n?($o(t,t.memoizedProps.onUpdate),Ni=m):m!==null&&(m.push.apply(m,Ni),Ni=m),Ai=(t.flags&32)!==0?!0:u;break;default:Io(n,t)}}function Mi(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)c2(t,n.alternate,n),n=n.sibling}function Yr(t,n){for(t=t.child;t!==null;){var l=t,u=n;switch(l.tag){case 0:case 11:case 14:case 15:Gr(4,l,l.return),Yr(l,u);break;case 1:Dn(l,l.return);var m=l.stateNode;typeof m.componentWillUnmount=="function"&&Jv(l,l.return,m),Yr(l,u);break;case 27:(u&2)!==0&&gy(l.stateNode,l.type,l.memoizedProps);case 5:Dn(l,l.return),l.tag!==5&&l.tag!==27||tc(l),Yr(l,u);break;case 6:tc(l);break;case 26:Dn(l,l.return),m=l.stateNode,l.memoizedState!==null||m===null||Tt||m.parentNode.removeChild(m),Yr(l,u);break;case 22:l.memoizedState===null&&Yr(l,u);break;case 30:Dn(l,l.return),Yr(l,u);break;case 7:Dn(l,l.return);default:Yr(l,u)}t=t.sibling}}function li(t,n,l){for(l=(n.subtreeFlags&8772)!==0?l:l&-2,n=n.child;n!==null;){var u=n.alternate,m=t,v=n,T=v.flags,z=(l&1)!==0;switch(v.tag){case 0:case 11:case 15:li(m,v,l),ec(4,v);break;case 1:if(li(m,v,l),u=v,m=u.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(ce){_t(u,u.return,ce)}if(u=v,m=u.updateQueue,m!==null){var K=u.stateNode;try{var te=m.shared.hiddenCallbacks;if(te!==null)for(m.shared.hiddenCallbacks=null,m=0;m<te.length;m++)P1(te[m],K)}catch(ce){_t(u,u.return,ce)}}z&&T&64&&Zv(v),Ci(v,v.return);break;case 27:(l&2)!==0&&t2(v);case 5:v.tag!==5&&v.tag!==27||Wv(v),li(m,v,l),z&&u===null&&T&4&&Ph(v),Ci(v,v.return);break;case 6:Wv(v);break;case 26:K=v.stateNode,v.memoizedState!==null||K===null||Cn||zm(dc(K.ownerDocument),v.type,K),li(m,v,l),z&&u===null&&T&4&&Ph(v),Ci(v,v.return);break;case 12:li(m,v,l);break;case 31:li(m,v,l),z&&T&4&&h2(m,v);break;case 13:li(m,v,l),z&&T&4&&m2(m,v);break;case 22:v.memoizedState===null&&li(m,v,l),Ci(v,v.return);break;case 30:li(m,v,l),Ci(v,v.return);break;case 7:Ci(v,v.return);default:li(m,v,l)}n=n.sibling}}function Jh(t,n){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&qs(l))}function Wh(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&qs(t))}function Ga(t,n,l,u){var m=(l&335544064)===l;if(n.subtreeFlags&(m?10262:10256))for(n=n.child;n!==null;)y2(t,n,l,u),n=n.sibling;else m&&l2(n)}function y2(t,n,l,u){var m=(l&335544064)===l;m&&n.alternate===null&&n.return!==null&&n.return.alternate!==null&&qu(n);var v=n.flags;switch(n.tag){case 0:case 11:case 15:Ga(t,n,l,u),v&2048&&ec(9,n);break;case 1:Ga(t,n,l,u);break;case 3:Ga(t,n,l,u),m&&Xh&&(t=t.containerInfo,t=t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,t.style.viewTransitionName==="root"&&(t.style.viewTransitionName=""),t=t.ownerDocument.documentElement,t!==null&&t.style.viewTransitionName==="none"&&(t.style.viewTransitionName="")),v&2048&&(v=null,n.alternate!==null&&(v=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==v&&(n.refCount++,v!=null&&qs(v)));break;case 12:if(v&2048){Ga(t,n,l,u),v=n.stateNode;try{var T=n.memoizedProps,z=T.id,K=T.onPostCommit;typeof K=="function"&&K(z,n.alternate===null?"mount":"update",v.passiveEffectDuration,-0)}catch(te){_t(n,n.return,te)}}else Ga(t,n,l,u);break;case 31:Ga(t,n,l,u);break;case 13:Ga(t,n,l,u);break;case 23:break;case 22:T=n.stateNode,z=n.alternate,n.memoizedState!==null?(m&&z!==null&&z.memoizedState===null&&qu(z),T._visibility&2?Ga(t,n,l,u):ac(t,n)):(m&&z!==null&&z.memoizedState!==null&&qu(n),T._visibility&2?Ga(t,n,l,u):(T._visibility|=2,Po(t,n,l,u,(n.subtreeFlags&10256)!==0||!1))),v&2048&&Jh(z,n);break;case 24:Ga(t,n,l,u),v&2048&&Wh(n.alternate,n);break;case 30:m&&(v=n.alternate,v!==null&&(Ei(v.child,!0),Ei(n.child,!0))),Ga(t,n,l,u);break;default:Ga(t,n,l,u)}}function Po(t,n,l,u,m){for(m=m&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var v=t,T=n,z=l,K=u,te=T.flags;switch(T.tag){case 0:case 11:case 15:Po(v,T,z,K,m),ec(8,T);break;case 23:break;case 22:var ce=T.stateNode;T.memoizedState!==null?ce._visibility&2?Po(v,T,z,K,m):ac(v,T):(ce._visibility|=2,Po(v,T,z,K,m)),m&&te&2048&&Jh(T.alternate,T);break;case 24:Po(v,T,z,K,m),m&&te&2048&&Wh(T.alternate,T);break;default:Po(v,T,z,K,m)}n=n.sibling}}function ac(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var l=t,u=n,m=u.flags;switch(u.tag){case 22:ac(l,u),m&2048&&Jh(u.alternate,u);break;case 24:ac(l,u),m&2048&&Wh(u.alternate,u);break;default:ac(l,u)}n=n.sibling}}var Fl=8192;function Vl(t,n,l){if(t.subtreeFlags&Fl)for(t=t.child;t!==null;)x2(t,n,l),t=t.sibling}function x2(t,n,l){switch(t.tag){case 26:Vl(t,n,l),t.flags&Fl&&(t.memoizedState!==null?XC(l,ri,t.memoizedState,t.memoizedProps):(t=t.stateNode,(n&335544128)===n&&Ny(l,t)));break;case 5:Vl(t,n,l),t.flags&Fl&&(t=t.stateNode,(n&335544128)===n&&Ny(l,t));break;case 3:case 4:var u=ri;ri=dc(t.stateNode.containerInfo),Vl(t,n,l),ri=u;break;case 22:t.memoizedState===null&&(u=t.alternate,u!==null&&u.memoizedState!==null?(u=Fl,Fl=16777216,Vl(t,n,l),Fl=u):Vl(t,n,l));break;case 30:if((t.flags&Fl)!==0&&(u=t.memoizedProps.name,u!=null&&u!=="auto")){var m=t.stateNode;m.paired=null,Ea===null&&(Ea=new Map),Ea.set(u,m)}Vl(t,n,l);break;default:Vl(t,n,l)}}function b2(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function ic(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var u=n[l];Nn=u,w2(u,t)}b2(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)j2(t),t=t.sibling}function j2(t){switch(t.tag){case 0:case 11:case 15:ic(t),t.flags&2048&&Gr(9,t,t.return);break;case 3:ic(t);break;case 12:ic(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,$u(t)):ic(t);break;default:ic(t)}}function $u(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var u=n[l];Nn=u,w2(u,t)}b2(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:Gr(8,n,n.return),$u(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,$u(n));break;default:$u(n)}t=t.sibling}}function w2(t,n){for(;Nn!==null;){var l=Nn;switch(l.tag){case 0:case 11:case 15:Gr(8,l,n);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var u=l.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:qs(l.memoizedState.cache)}if(u=l.child,u!==null)u.return=l,Nn=u;else e:for(l=t;Nn!==null;){u=Nn;var m=u.sibling,v=u.return;if(d2(u),u===l){Nn=null;break e}if(m!==null){m.return=v,Nn=m;break e}Nn=v}}}var V6={getCacheForType:function(t){var n=_n(un),l=n.data.get(t);return l===void 0&&(l=t(),n.data.set(t,l)),l},cacheSignal:function(){return _n(un).controller.signal}},$6=typeof WeakMap=="function"?WeakMap:Map,Et=0,Bt=null,ft=null,vt=0,Mt=0,Ta=null,Kr=!1,Ho=!1,em=!1,sr=0,ln=0,Xr=0,$l=0,Gu=0,Aa=0,qo=0,rc=null,ca=null,tm=!1,Yu=0,k2=0,Ku=1/0,Xu=null,Qr=null,Jt=0,oi=null,Gl=null,_i=0,nm=0,am=null,S2=null,Uo=null,Fo=null,Vo=null,lc=0,Qu=null;function Ma(){return(Et&2)!==0&&vt!==0?vt&-vt:xe.T!==null?hm():Ft()}function C2(){if(Aa===0)if((vt&536870912)===0||ut){var t=La;La<<=1,(La&3932160)===0&&(La=262144),Aa=t}else Aa=536870912;return t=Rn.current,t!==null&&(t.flags|=32),Aa}function $o(t,n){if(n!=null){var l=t.stateNode,u=l.ref;u===null&&(u=l.ref=ry(Ji(t.memoizedProps,l))),Fo===null&&(Fo=[]),Fo.push(n.bind(null,u))}}function ua(t,n,l){(t===Bt&&(Mt===2||Mt===9)||t.cancelPendingCommit!==null)&&(Go(t,0),Zr(t,vt,Aa,!1)),ni(t,l),((Et&2)===0||t!==Bt)&&(t===Bt&&((Et&2)===0&&($l|=l),ln===4&&Zr(t,vt,Aa,!1)),Ri(t))}function N2(t,n,l){if((Et&6)!==0)throw Error(r(327));var u=!l&&(n&127)===0&&(n&t.expiredLanes)===0||ia(t,n),m=u?K6(t,n):rm(t,n,!0),v=u;do{if(m===0){Ho&&!u&&Zr(t,n,0,!1);break}else{if(l=t.current.alternate,v&&!G6(l)){m=rm(t,n,!1),v=!1;continue}if(m===2){if(v=n,t.errorRecoveryDisabledLanes&v)var T=0;else T=t.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){n=T;e:{var z=t;m=rc;var K=z.current.memoizedState.isDehydrated;if(K&&(Go(z,T).flags|=256),T=rm(z,T,!1),T!==2&&T!==6){if(em&&!K){z.errorRecoveryDisabledLanes|=v,$l|=v,m=4;break e}v=ca,ca=m,v!==null&&(ca===null?ca=v:ca.push.apply(ca,v))}m=T}if(v=!1,m!==2)continue}}if(m===1){Go(t,0),Zr(t,n,0,!0);break}e:{switch(u=t,v=m,v){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n&&(n&62914560)!==n)break;case 6:Zr(u,n,Aa,!Kr);break e;case 2:ca=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(m=Yu+300-Gt(),10<m)){if(Zr(u,n,Aa,!Kr),ya(u,0,!0)!==0)break e;_i=n,u.timeoutHandle=Sm(E2.bind(null,u,l,ca,Xu,tm,n,Aa,$l,qo,Kr,v,"Throttled",-0,0),m);break e}E2(u,l,ca,Xu,tm,n,Aa,$l,qo,Kr,v,null,-0,0)}}break}while(!0);Ri(t)}function E2(t,n,l,u,m,v,T,z,K,te,ce,ye,J,re){t.timeoutHandle=-1;var Oe=n.subtreeFlags,Fe=(v&335544064)===v;if(ye=null,(Fe||Oe&8192||(Oe&16785408)===16785408)&&(ye={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xn},Ea=null,x2(n,v,ye),Fe&&(Oe=ye,Fe=t.containerInfo,Fe=(Fe.nodeType===9?Fe:Fe.ownerDocument).__reactViewTransition,Fe!=null&&(Oe.count++,Oe.waitingForViewTransition=!0,Oe=mc.bind(Oe),Fe.finished.then(Oe,Oe))),Oe=(v&62914560)===v?Yu-Gt():(v&4194048)===v?k2-Gt():0,Oe=QC(ye,Oe),Oe!==null)){_i=v,t.cancelPendingCommit=Oe(z2.bind(null,t,n,v,l,u,m,T,z,K,te,ce,ye,null,J,re)),Zr(t,v,T,!te);return}z2(t,n,v,l,u,m,T,z,K,te,ce,ye)}function G6(t){for(var n=t;;){var l=n.tag;if((l===0||l===11||l===15)&&n.flags&16384&&(l=n.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var u=0;u<l.length;u++){var m=l[u],v=m.getSnapshot;m=m.value;try{if(!Ca(v(),m))return!1}catch{return!1}}if(l=n.child,n.subtreeFlags&16384&&l!==null)l.return=n,n=l;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Zr(t,n,l,u){n=bi(t,n),n&=~Gu,n&=~$l,t.suspendedLanes|=n,t.pingedLanes&=~n,u&&(t.warmLanes|=n),u=t.expirationTimes;for(var m=n;0<m;){var v=31-on(m),T=1<<v;u[v]=-1,m&=~T}l!==0&&ba(t,l,n)}function Zu(){return(Et&6)===0?(oc(0),!1):!0}function im(){if(ft!==null){if(Mt===0)var t=ft.return;else t=ft,nr=Ol=null,fh(t),Ro=null,Vs=0,t=ft;for(;t!==null;)Qv(t.alternate,t),t=t.return;ft=null}}function Go(t,n){var l=t.timeoutHandle;return l!==-1&&(t.timeoutHandle=-1,gC(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),_i=0,im(),Bt=t,ft=l=er(t.current,null),vt=n,Mt=0,Ta=null,Kr=!1,Ho=ia(t,n),em=!1,qo=Aa=Gu=$l=Xr=ln=0,ca=rc=null,tm=!1,sr=bi(t,n),ru(),l}function T2(t,n){st=null,xe.H=Mu,n===_o||n===gu?(n=z1(),Mt=3):n===Wf?(n=z1(),Mt=4):Mt=n===Eh?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Ta=n,ft===null&&(ln=1,_u(t,Ua(n,t.current)))}function A2(){var t=Rn.current;return t===null?!0:(vt&4194048)===vt?qn===null:(vt&62914560)===vt||(vt&536870912)!==0?t===qn:!1}function M2(){var t=xe.H;return xe.H=Mu,t===null?Mu:t}function _2(){var t=xe.A;return xe.A=V6,t}function Ju(){ln=4,Kr||(vt&4194048)!==vt&&Rn.current!==null||(Ho=!0),(Xr&134217727)===0&&($l&134217727)===0||Bt===null||Zr(Bt,vt,Aa,!1)}function rm(t,n,l){var u=Et;Et|=2;var m=M2(),v=_2();(Bt!==t||vt!==n)&&(Xu=null,Go(t,n)),n=!1;var T=ln;e:do try{if(Mt!==0&&ft!==null){var z=ft,K=Ta;switch(Mt){case 8:im(),T=6;break e;case 3:case 2:case 9:case 6:Rn.current===null&&(n=!0);var te=Mt;if(Mt=0,Ta=null,Yo(t,z,K,te),l&&Ho){T=0;break e}break;default:te=Mt,Mt=0,Ta=null,Yo(t,z,K,te)}}Y6(),T=ln;break}catch(ce){T2(t,ce)}while(!0);return n&&t.shellSuspendCounter++,nr=Ol=null,Et=u,xe.H=m,xe.A=v,ft===null&&(Bt=null,vt=0,ru()),T}function Y6(){for(;ft!==null;)R2(ft)}function K6(t,n){var l=Et;Et|=2;var u=M2(),m=_2();Bt!==t||vt!==n?(Xu=null,Ku=Gt()+500,Go(t,n)):Ho=ia(t,n);e:do try{if(Mt!==0&&ft!==null){n=ft;var v=Ta;t:switch(Mt){case 1:Mt=0,Ta=null,Yo(t,n,v,1);break;case 2:case 9:if(O1(v)){Mt=0,Ta=null,O2(n);break}n=function(){Mt!==2&&Mt!==9||Bt!==t||(Mt=7),Ri(t)},v.then(n,n);break e;case 3:Mt=7;break e;case 4:Mt=5;break e;case 7:O1(v)?(Mt=0,Ta=null,O2(n)):(Mt=0,Ta=null,Yo(t,n,v,7));break;case 5:var T=null;switch(ft.tag){case 26:T=ft.memoizedState;case 5:case 27:var z=ft;if(T?Sy(T):z.stateNode.complete){Mt=0,Ta=null;var K=z.sibling;if(K!==null)ft=K;else{var te=z.return;te!==null?(ft=te,Wu(te)):ft=null}break t}}Mt=0,Ta=null,Yo(t,n,v,5);break;case 6:Mt=0,Ta=null,Yo(t,n,v,6);break;case 8:im(),ln=6;break e;default:throw Error(r(462))}}X6();break}catch(ce){T2(t,ce)}while(!0);return nr=Ol=null,xe.H=u,xe.A=m,Et=l,ft!==null?0:(Bt=null,vt=0,ru(),ln)}function X6(){for(;ft!==null&&!He();)R2(ft)}function R2(t){var n=Kv(t.alternate,t,sr);t.memoizedProps=t.pendingProps,n===null?Wu(t):ft=n}function O2(t){var n=t,l=n.alternate;switch(n.tag){case 15:case 0:n=qv(l,n,n.pendingProps,n.type,void 0,vt);break;case 11:n=qv(l,n,n.pendingProps,n.type.render,n.ref,vt);break;case 5:fh(n);var u=n;u===Sn&&(ut?(du(u),u.tag===5&&u.stateNode!=null&&(qt=u.stateNode)):(du(u),ut=!0));default:Qv(l,n),n=ft=w1(n,sr),n=Kv(l,n,sr)}t.memoizedProps=t.pendingProps,n===null?Wu(t):ft=n}function Yo(t,n,l,u){nr=Ol=null,fh(n),Ro=null,Vs=0;var m=n.return;try{if(L6(t,m,n,l,vt)){ln=1,_u(t,Ua(l,t.current)),ft=null;return}}catch(v){if(m!==null)throw ft=m,v;ln=1,_u(t,Ua(l,t.current)),ft=null;return}n.flags&32768?(ut||u===1?t=!0:Ho||(vt&536870912)!==0?t=!1:(Kr=t=!0,(u===2||u===9||u===3||u===6)&&(u=Rn.current,u!==null&&u.tag===13&&(u.flags|=16384))),D2(n,t)):Wu(n)}function Wu(t){var n=t;do{if((n.flags&32768)!==0){D2(n,Kr);return}t=n.return;var l=H6(n.alternate,n,sr);if(l!==null){ft=l;return}if(n=n.sibling,n!==null){ft=n;return}ft=n=t}while(n!==null);ln===0&&(ln=5)}function D2(t,n){do{var l=q6(t.alternate,t);if(l!==null){l.flags&=32767,ft=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(t=t.sibling,t!==null)){ft=t;return}ft=t=l}while(t!==null);ln=6,ft=null}function z2(t,n,l,u,m,v,T,z,K,te,ce,ye){t.cancelPendingCommit=null;do ed();while(Jt!==0);if((Et&6)!==0)throw Error(r(327));if(n!==null){if(n===t.current)throw Error(r(177));t===Bt&&(ft=Bt=null,vt=0),Gl=n,oi=t,_i=l,am=m,S2=u,Q6(t,n,l,T,z,K,ye)}}function Q6(t,n,l,u,m,v,T){var z=n.lanes|n.childLanes;if(nm=z,z|=Hf,Nr(t,l,z,u,m,v),Fo=null,(l&335544064)===l?(Vo=S6(t),u=10262):(Vo=null,u=10256),(n.subtreeFlags&u)!==0||(n.flags&u)!==0?(t.callbackNode=null,t.callbackPriority=0,nC(gn,function(){return cm(),null})):(t.callbackNode=null,t.callbackPriority=0),Pu=!1,u=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||u){u=xe.T,xe.T=null,m=oe.p,oe.p=2,v=Et,Et|=4;try{U6(t,n,l)}finally{Et=v,oe.p=m,xe.T=u}}Jt=1,Pu?Uo=wC(T,t.containerInfo,Vo,lm,om,J6,sm,cm,Z6):(lm(),om(),sm())}function Z6(t){if(Jt!==0){var n=oi.onRecoverableError;n(t,{componentStack:null})}}function J6(){Jt===3&&(Jt=0,v2(Gl,oi),Jt=4)}function lm(){if(Jt===1){Jt=0;var t=oi,n=Gl,l=_i,u=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||u){u=xe.T,xe.T=null;var m=oe.p;oe.p=2;var v=Et;Et|=4;try{nc=Uu=!1,p2(n,t,l),l=jm;var T=f1(t.containerInfo),z=l.focusedElem,K=l.selectionRange;if(T!==z&&z&&z.ownerDocument&&d1(z.ownerDocument.documentElement,z)){if(K!==null&&zf(z)){var te=K.start,ce=K.end;if(ce===void 0&&(ce=te),"selectionStart"in z)z.selectionStart=te,z.selectionEnd=Math.min(ce,z.value.length);else{var ye=z.ownerDocument||document,J=ye&&ye.defaultView||window;if(J.getSelection){var re=J.getSelection(),Oe=z.textContent.length,Fe=Math.min(K.start,Oe),ct=K.end===void 0?Fe:Math.min(K.end,Oe);!re.extend&&Fe>ct&&(T=ct,ct=Fe,Fe=T);var ee=u1(z,Fe),Q=u1(z,ct);if(ee&&Q&&(re.rangeCount!==1||re.anchorNode!==ee.node||re.anchorOffset!==ee.offset||re.focusNode!==Q.node||re.focusOffset!==Q.offset)){var ae=ye.createRange();ae.setStart(ee.node,ee.offset),re.removeAllRanges(),Fe>ct?(re.addRange(ae),re.extend(Q.node,Q.offset)):(ae.setEnd(Q.node,Q.offset),re.addRange(ae))}}}}for(ye=[],re=z;re=re.parentNode;)re.nodeType===1&&ye.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<ye.length;z++){var ve=ye[z];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}ts=!!bm,jm=bm=null}finally{Et=v,oe.p=m,xe.T=u}}t.current=n,Jt=2}}function om(){if(Jt===2){Jt=0;var t=oi,n=Gl,l=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||l){l=xe.T,xe.T=null;var u=oe.p;oe.p=2;var m=Et;Et|=4;try{c2(t,n.alternate,n)}finally{Et=m,oe.p=u,xe.T=l}}Jt=3}}function sm(){if(Jt===4||Jt===3){Jt=0;var t=Uo;Uo=null,at();var n=oi,l=Gl,u=_i,m=S2,v=(u&335544064)===u?10262:10256;if((l.subtreeFlags&v)!==0||(l.flags&v)!==0?Jt=5:(Jt=0,Gl=oi=null,L2(n,n.pendingLanes)),v=n.pendingLanes,v===0&&(Qr=null),Yn(u),l=l.stateNode,Ht&&typeof Ht.onCommitFiberRoot=="function")try{Ht.onCommitFiberRoot(yi,l,void 0,(l.current.flags&128)===128)}catch{}if(m!==null){l=xe.T,v=oe.p,oe.p=2,xe.T=null;try{for(var T=n.onRecoverableError,z=0;z<m.length;z++){var K=m[z];T(K.value,{componentStack:K.stack})}}finally{xe.T=l,oe.p=v}}if(m=Fo,T=Vo,Vo=null,m!==null&&(Fo=null,T===null&&(T=[]),t!==null))for(K=0;K<m.length;K++)l=(0,m[K])(T),l!==void 0&&t.finished.finally(l);(_i&3)!==0&&ed(),Ri(n),v=n.pendingLanes,(u&261930)!==0&&(v&42)!==0?n===Qu?lc++:(lc=0,Qu=n):(lc=0,Qu=null),oc(0)}}function L2(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,qs(n)))}function ed(){return Uo!==null&&(Uo.skipTransition(),Uo=null),lm(),om(),sm(),cm()}function cm(){if(Jt!==5)return!1;var t=oi,n=nm;nm=0;var l=Yn(_i),u=xe.T,m=oe.p;try{oe.p=32>l?32:l,xe.T=null,l=am,am=null;var v=oi,T=_i;if(Jt=0,Gl=oi=null,_i=0,(Et&6)!==0)throw Error(r(331));var z=Et;if(Et|=4,j2(v.current),y2(v,v.current,T,l),Et=z,oc(0,!1),Ht&&typeof Ht.onPostCommitFiberRoot=="function")try{Ht.onPostCommitFiberRoot(yi,v)}catch{}return!0}finally{oe.p=m,xe.T=u,L2(t,n)}}function B2(t,n,l){n=Ua(l,n),n=Nh(t.stateNode,n,2),t=Ur(t,n,2),t!==null&&(ni(t,2),Ri(t))}function _t(t,n,l){if(t.tag===3)B2(t,t,l);else for(;n!==null;){if(n.tag===3){B2(n,t,l);break}else if(n.tag===1){var u=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Qr===null||!Qr.has(u))){t=Ua(l,t),l=Ov(2),u=Ur(n,l,2),u!==null&&(Dv(l,u,n,t),ni(u,2),Ri(u));break}}n=n.return}}function um(t,n,l){var u=t.pingCache;if(u===null){u=t.pingCache=new $6;var m=new Set;u.set(n,m)}else m=u.get(n),m===void 0&&(m=new Set,u.set(n,m));m.has(l)||(em=!0,m.add(l),t=W6.bind(null,t,n,l),n.then(t,t))}function W6(t,n,l){var u=t.pingCache;u!==null&&u.delete(n),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,Bt===t&&(vt&l)===l&&((ln===4||ln===3&&(vt&62914560)===vt&&300>Gt()-Yu)&&(Et&2)===0?Go(t,0):Gu|=l,qo===vt&&(qo=0)),Ri(t)}function I2(t,n){n===0&&(n=xa()),t=Ml(t,n),t!==null&&(ni(t,n),Ri(t))}function eC(t){var n=t.memoizedState,l=0;n!==null&&(l=n.retryLane),I2(t,l)}function tC(t,n){var l=0;switch(t.tag){case 31:case 13:var u=t.stateNode,m=t.memoizedState;m!==null&&(l=m.retryLane);break;case 19:u=t.stateNode;break;case 22:u=t.stateNode._retryCache;break;default:throw Error(r(314))}u!==null&&u.delete(n),I2(t,l)}function nC(t,n){return Re(t,n)}var Ko=null,Xo=null,dm=!1,td=!1,fm=!1,Jr=0;function Ri(t){t!==Xo&&t.next===null&&(Xo===null?Ko=Xo=t:Xo=Xo.next=t),td=!0,dm||(dm=!0,iC())}function oc(t,n){if(!fm&&td){fm=!0;do for(var l=!1,u=Ko;u!==null;){if(t!==0){var m=u.pendingLanes;if(m===0)var v=0;else{var T=u.suspendedLanes,z=u.pingedLanes;v=(1<<31-on(42|t)+1)-1,v&=m&~(T&~z),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(l=!0,U2(u,v))}else v=vt,v=ya(u,u===Bt?v:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(v&3)===0||ia(u,v)||(l=!0,U2(u,v));u=u.next}while(l);fm=!1}}function aC(){P2()}function P2(){td=dm=!1;var t=0;Jr!==0&&pC()&&(t=Jr);for(var n=Gt(),l=null,u=Ko;u!==null;){var m=u.next,v=H2(u,n);v===0?(u.next=null,l===null?Ko=m:l.next=m,m===null&&(Xo=l)):(l=u,(t!==0||(v&3)!==0)&&(td=!0)),u=m}Jt!==0&&Jt!==5||oc(t),Jr!==0&&(Jr=0)}function H2(t,n){for(var l=t.suspendedLanes,u=t.pingedLanes,m=t.expirationTimes,v=t.pendingLanes&-62914561;0<v;){var T=31-on(v),z=1<<T,K=m[T];K===-1?((z&l)===0||(z&u)!==0)&&(m[T]=jl(z,n)):K<=n&&(t.expiredLanes|=z),v&=~z}if(n=Bt,l=vt,l=ya(t,t===n?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u=t.callbackNode,l===0||t===n&&(Mt===2||Mt===9)||t.cancelPendingCommit!==null)return u!==null&&u!==null&&Ie(u),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||ia(t,l)){if(n=l&-l,n===t.callbackPriority)return n;switch(u!==null&&Ie(u),Yn(l)){case 2:case 8:l=kt;break;case 32:l=gn;break;case 268435456:l=Ki;break;default:l=gn}return u=q2.bind(null,t),l=Re(l,u),t.callbackPriority=n,t.callbackNode=l,n}return u!==null&&u!==null&&Ie(u),t.callbackPriority=2,t.callbackNode=null,2}function q2(t,n){if(Jt!==0&&Jt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(ed()&&t.callbackNode!==l)return null;var u=vt;return u=ya(t,t===Bt?u:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u===0?null:(N2(t,u,n),H2(t,Gt()),t.callbackNode!=null&&t.callbackNode===l?q2.bind(null,t):null)}function U2(t,n){if(ed())return null;N2(t,n,!0)}function iC(){vC(function(){(Et&6)!==0?Re(Gn,aC):P2()})}function hm(){if(Jr===0){var t=Ll;t===0&&(t=ei,ei<<=1,(ei&261888)===0&&(ei=256)),Jr=t}return Jr}function F2(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:An(t)}function rC(t,n,l,u,m){if(n==="submit"&&l&&l.stateNode===m){var v=F2((m[vn]||null).action),T=u.submitter;T&&(n=(n=T[vn]||null)?F2(n.formAction):T.getAttribute("formAction"),n!==null&&(v=n,T=null));var z=new tu("action","action",null,u,m);t.push({event:z,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Jr!==0){var K=new FormData(m,T);jh(l,{pending:!0,data:K,method:m.method,action:v},null,K)}}else typeof v=="function"&&(z.preventDefault(),K=new FormData(m,T),jh(l,{pending:!0,data:K,method:m.method,action:v},v,K))},currentTarget:m}]})}}for(var mm=0;mm<Pf.length;mm++){var pm=Pf[mm],lC=pm.toLowerCase(),oC=pm[0].toUpperCase()+pm.slice(1);ai(lC,"on"+oC)}ai(p1,"onAnimationEnd"),ai(g1,"onAnimationIteration"),ai(v1,"onAnimationStart"),ai("dblclick","onDoubleClick"),ai("focusin","onFocus"),ai("focusout","onBlur"),ai(g6,"onTransitionRun"),ai(v6,"onTransitionStart"),ai(y6,"onTransitionCancel"),ai(y1,"onTransitionEnd"),ke("onMouseEnter",["mouseout","mouseover"]),ke("onMouseLeave",["mouseout","mouseover"]),ke("onPointerEnter",["pointerout","pointerover"]),ke("onPointerLeave",["pointerout","pointerover"]),fe("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fe("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fe("onBeforeInput",["compositionend","keypress","textInput","paste"]),fe("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fe("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fe("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var sc="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(" "),sC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(sc));function V2(t,n){n=(n&4)!==0;for(var l=0;l<t.length;l++){var u=t[l],m=u.event;u=u.listeners;e:{var v=void 0;if(n)for(var T=u.length-1;0<=T;T--){var z=u[T],K=z.instance,te=z.currentTarget;if(z=z.listener,K!==v&&m.isPropagationStopped())break e;v=z,m.currentTarget=te;try{v(m)}catch(ce){iu(ce)}m.currentTarget=null,v=K}else for(T=0;T<u.length;T++){if(z=u[T],K=z.instance,te=z.currentTarget,z=z.listener,K!==v&&m.isPropagationStopped())break e;v=z,m.currentTarget=te;try{v(m)}catch(ce){iu(ce)}m.currentTarget=null,v=K}}}}function ht(t,n){var l=n[wl];l===void 0&&(l=n[wl]=new Set);var u=t+"__bubble";l.has(u)||($2(n,t,2,!1),l.add(u))}function gm(t,n,l){var u=0;n&&(u|=4),$2(l,t,u,n)}var nd="_reactListening"+Math.random().toString(36).slice(2);function vm(t){if(!t[nd]){t[nd]=!0,tt.forEach(function(l){l!=="selectionchange"&&(sC.has(l)||gm(l,!1,t),gm(l,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[nd]||(n[nd]=!0,gm("selectionchange",!1,n))}}function $2(t,n,l,u){switch(Dy(n)){case 2:var m=e8;break;case 8:m=t8;break;default:m=Bm}l=m.bind(null,n,l,t),m=void 0,!El||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(m=!0),u?m!==void 0?t.addEventListener(n,l,{capture:!0,passive:m}):t.addEventListener(n,l,!0):m!==void 0?t.addEventListener(n,l,{passive:m}):t.addEventListener(n,l,!1)}function ym(t,n,l,u,m){var v=u;if((n&1)===0&&(n&2)===0&&u!==null)e:for(;;){if(u===null)return;var T=u.tag;if(T===3||T===4){var z=u.stateNode.containerInfo;if(z===m)break;if(T===4)for(T=u.return;T!==null;){var K=T.tag;if((K===3||K===4)&&T.stateNode.containerInfo===m)return;T=T.return}for(;z!==null;){if(T=ja(z),T===null)return;if(K=T.tag,K===5||K===6||K===26||K===27){u=v=T;continue e}z=z.parentNode}}u=u.return}Nl(function(){var te=v,ce=Cl(l),ye=[];e:{var J=x1.get(t);if(J!==void 0){var re=tu,Oe=t;switch(t){case"keypress":if(Wc(l)===0)break e;case"keydown":case"keyup":re=GS;break;case"focusin":Oe="focus",re=Af;break;case"focusout":Oe="blur",re=Af;break;case"beforeblur":case"afterblur":re=Af;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":re=Kg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=DS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=ZS;break;case p1:case g1:case v1:re=BS;break;case y1:re=WS;break;case"scroll":case"scrollend":re=RS;break;case"wheel":re=t6;break;case"copy":case"cut":case"paste":re=PS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=Qg;break;case"submit":re=XS;break;case"toggle":case"beforetoggle":re=a6}var Fe=(n&4)!==0,ct=!Fe&&(t==="scroll"||t==="scrollend"),ee=Fe?J!==null?J+"Capture":null:J;Fe=[];for(var Q=te,ae;Q!==null;){var ve=Q;if(ae=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||ae===null||ee===null||(ve=Zi(Q,ee),ve!=null&&Fe.push(cc(Q,ve,ae))),ct)break;Q=Q.return}0<Fe.length&&(J=new re(J,Oe,null,l,ce),ye.push({event:J,listeners:Fe}))}}if((n&7)===0){e:{if(re=t==="mouseover"||t==="pointerover",J=t==="mouseout"||t==="pointerout",re&&l!==Sl&&(Oe=l.relatedTarget||l.fromElement)&&(ja(Oe)||Oe[nn]))break e;(J||re)&&(Oe=ce.window===ce?ce:(re=ce.ownerDocument)?re.defaultView||re.parentWindow:window,J?(re=l.relatedTarget||l.toElement,J=te,re=re?ja(re):null,re!==null&&(ct=c(re),Fe=re.tag,re!==ct||Fe!==5&&Fe!==27&&Fe!==6)&&(re=null)):(J=null,re=te),J!==re&&(Fe=Kg,ve="onMouseLeave",ee="onMouseEnter",Q="mouse",(t==="pointerout"||t==="pointerover")&&(Fe=Qg,ve="onPointerLeave",ee="onPointerEnter",Q="pointer"),ct=J==null?Oe:se(J),ae=re==null?Oe:se(re),Oe=new Fe(ve,Q+"leave",J,l,ce),Oe.target=ct,Oe.relatedTarget=ae,ve=null,ja(ce)===te&&(Fe=new Fe(ee,Q+"enter",re,l,ce),Fe.target=ae,Fe.relatedTarget=ct,ve=Fe),ct=ve,Fe=J&&re?R(J,re,cC):null,J!==null&&G2(ye,Oe,J,Fe,!1),re!==null&&ct!==null&&G2(ye,ct,re,Fe,!0)))}e:{if(J=te?se(te):window,re=J.nodeName&&J.nodeName.toLowerCase(),re==="select"||re==="input"&&J.type==="file")var Pe=i1;else if(n1(J))if(r1)Pe=h6;else{Pe=d6;var yt=u6}else re=J.nodeName,!re||re.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?te&&kl(te.elementType)&&(Pe=i1):Pe=f6;if(Pe&&(Pe=Pe(t,te))){a1(ye,Pe,l,ce);break e}yt&&yt(t,J,te)}switch(yt=te?se(te):window,t){case"focusin":(n1(yt)||yt.contentEditable==="true")&&(ko=yt,Lf=te,Is=null);break;case"focusout":Is=Lf=ko=null;break;case"mousedown":Bf=!0;break;case"contextmenu":case"mouseup":case"dragend":Bf=!1,h1(ye,l,ce);break;case"selectionchange":if(p6)break;case"keydown":case"keyup":h1(ye,l,ce)}var Ye;if(_f)e:{switch(t){case"compositionstart":var We="onCompositionStart";break e;case"compositionend":We="onCompositionEnd";break e;case"compositionupdate":We="onCompositionUpdate";break e}We=void 0}else wo?e1(t,l)&&(We="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(We="onCompositionStart");We&&(Zg&&l.locale!=="ko"&&(wo||We!=="onCompositionStart"?We==="onCompositionEnd"&&wo&&(Ye=Gg()):(Or=ce,Nf="value"in Or?Or.value:Or.textContent,wo=!0)),yt=ad(te,We),0<yt.length&&(We=new Xg(We,t,null,l,ce),ye.push({event:We,listeners:yt}),Ye?We.data=Ye:(Ye=t1(l),Ye!==null&&(We.data=Ye)))),(Ye=r6?l6(t,l):o6(t,l))&&(We=ad(te,"onBeforeInput"),0<We.length&&(yt=new Xg("onBeforeInput","beforeinput",null,l,ce),ye.push({event:yt,listeners:We}),yt.data=Ye)),rC(ye,t,te,l,ce)}V2(ye,n)})}function cc(t,n,l){return{instance:t,listener:n,currentTarget:l}}function ad(t,n){for(var l=n+"Capture",u=[];t!==null;){var m=t,v=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||v===null||(m=Zi(t,l),m!=null&&u.unshift(cc(t,m,v)),m=Zi(t,n),m!=null&&u.push(cc(t,m,v))),t.tag===3)return u;t=t.return}return[]}function cC(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function G2(t,n,l,u,m){for(var v=n._reactName,T=[];l!==null&&l!==u;){var z=l,K=z.alternate,te=z.stateNode;if(z=z.tag,K!==null&&K===u)break;z!==5&&z!==26&&z!==27||te===null||(K=te,m?(te=Zi(l,v),te!=null&&T.unshift(cc(l,te,K))):m||(te=Zi(l,v),te!=null&&T.push(cc(l,te,K)))),l=l.return}T.length!==0&&t.push({event:n,listeners:T})}var uC=/\r\n?/g,dC=/\u0000|\uFFFD/g;function Y2(t){return(typeof t=="string"?t:""+t).replace(uC,`
49
+ `).replace(dC,"")}function K2(t,n){return n=Y2(n),Y2(t)===n}function Rt(t,n,l,u,m,v){switch(l){case"children":if(typeof u=="string")n==="body"||n==="textarea"&&u===""||Kn(t,u);else if(typeof u=="number"||typeof u=="bigint")n!=="body"&&Kn(t,""+u);else return;break;case"className":an(t,"class",u);break;case"tabIndex":an(t,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":an(t,l,u);break;case"style":ka(t,u,v);return;case"data":if(n!=="object"){an(t,"data",u);break}case"src":case"href":if(u===""&&(n!=="a"||l!=="href")){t.removeAttribute(l);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(l);break}u=An(u),t.setAttribute(l,u);break;case"action":case"formAction":if(typeof u=="function"){t.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(l==="formAction"?(n!=="input"&&Rt(t,n,"name",m.name,m,null),Rt(t,n,"formEncType",m.formEncType,m,null),Rt(t,n,"formMethod",m.formMethod,m,null),Rt(t,n,"formTarget",m.formTarget,m,null)):(Rt(t,n,"encType",m.encType,m,null),Rt(t,n,"method",m.method,m,null),Rt(t,n,"target",m.target,m,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(l);break}u=An(u),t.setAttribute(l,u);break;case"onClick":u!=null&&(t.onclick=Xn);return;case"onScroll":u!=null&&ht("scroll",t);return;case"onScrollEnd":u!=null&&ht("scrollend",t);return;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(l=u.__html,l!=null){if(m.children!=null)throw Error(r(60));(v!=null?v.__html:void 0)!==l&&(t.innerHTML=l)}}break;case"multiple":t.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":t.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){t.removeAttribute("xlink:href");break}l=An(u),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(l,u):t.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":u===!0?t.setAttribute(l,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(l,u):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?t.setAttribute(l,u):t.removeAttribute(l);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?t.removeAttribute(l):t.setAttribute(l,u);break;case"popover":ht("beforetoggle",t),ht("toggle",t),lt(t,"popover",u);break;case"xlinkActuate":Ct(t,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Ct(t,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Ct(t,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Ct(t,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Ct(t,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Ct(t,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Ct(t,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Ct(t,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Ct(t,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":lt(t,"is",u);break;case"innerText":case"textContent":return;default:if(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")l=As.get(l)||l,lt(t,l,u);else return}Le=!0}function xm(t,n,l,u,m,v){switch(l){case"style":ka(t,u,v);return;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(l=u.__html,l!=null){if(m.children!=null)throw Error(r(60));(v!=null?v.__html:void 0)!==l&&(t.innerHTML=l)}}break;case"children":if(typeof u=="string")Kn(t,u);else if(typeof u=="number"||typeof u=="bigint")Kn(t,""+u);else return;break;case"onScroll":u!=null&&ht("scroll",t);return;case"onScrollEnd":u!=null&&ht("scrollend",t);return;case"onClick":u!=null&&(t.onclick=Xn);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!V.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(m=l.endsWith("Capture"),v=l.slice(2,m?l.length-7:void 0),n=t[vn]||null,n=n!=null?n[l]:null,typeof n=="function"&&t.removeEventListener(v,n,m),typeof u=="function")){typeof n!="function"&&n!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(v,u,m);break e}Le=!0,l in t?t[l]=u:u===!0?t.setAttribute(l,""):lt(t,l,u)}return}Le=!0}function zn(t,n,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ht("error",t),ht("load",t);var u=!1,m=!1,v;for(v in l)if(l.hasOwnProperty(v)){var T=l[v];if(T!=null)switch(v){case"src":u=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:Rt(t,n,v,T,l,null)}}m&&Rt(t,n,"srcSet",l.srcSet,l,null),u&&Rt(t,n,"src",l.src,l,null);return;case"input":ht("invalid",t);var z=v=T=m=null,K=null,te=null;for(u in l)if(l.hasOwnProperty(u)){var ce=l[u];if(ce!=null)switch(u){case"name":m=ce;break;case"type":T=ce;break;case"checked":K=ce;break;case"defaultChecked":te=ce;break;case"value":v=ce;break;case"defaultValue":z=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(r(137,n));break;default:Rt(t,n,u,ce,l,null)}}_r(t,v,z,K,te,T,m,!1);return;case"select":ht("invalid",t),u=T=v=null;for(m in l)if(l.hasOwnProperty(m)&&(z=l[m],z!=null))switch(m){case"value":v=z;break;case"defaultValue":T=z;break;case"multiple":u=z;default:Rt(t,n,m,z,l,null)}n=v,l=T,t.multiple=!!u,n!=null?ra(t,!!u,n,!1):l!=null&&ra(t,!!u,l,!0);return;case"textarea":ht("invalid",t),v=m=u=null;for(T in l)if(l.hasOwnProperty(T)&&(z=l[T],z!=null))switch(T){case"value":u=z;break;case"defaultValue":m=z;break;case"children":v=z;break;case"dangerouslySetInnerHTML":if(z!=null)throw Error(r(91));break;default:Rt(t,n,T,z,l,null)}wa(t,u,m,v);return;case"option":for(K in l)if(l.hasOwnProperty(K)&&(u=l[K],u!=null))switch(K){case"selected":t.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:Rt(t,n,K,u,l,null)}return;case"dialog":ht("beforetoggle",t),ht("toggle",t),ht("cancel",t),ht("close",t);break;case"iframe":case"object":ht("load",t);break;case"video":case"audio":for(u=0;u<sc.length;u++)ht(sc[u],t);break;case"image":ht("error",t),ht("load",t);break;case"details":ht("toggle",t);break;case"embed":case"source":case"link":ht("error",t),ht("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(te in l)if(l.hasOwnProperty(te)&&(u=l[te],u!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:Rt(t,n,te,u,l,null)}return;default:if(kl(n)){for(ce in l)l.hasOwnProperty(ce)&&(u=l[ce],u!==void 0&&xm(t,n,ce,u,l,void 0));return}}for(z in l)l.hasOwnProperty(z)&&(u=l[z],u!=null&&Rt(t,n,z,u,l,null))}var fC={};function hC(t,n,l,u){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,v=null,T=null,z=null,K=null,te=null,ce=null;for(re in l){var ye=l[re];if(l.hasOwnProperty(re)&&ye!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":K=ye;default:u.hasOwnProperty(re)||Rt(t,n,re,null,u,ye)}}for(var J in u){var re=u[J];if(ye=l[J],u.hasOwnProperty(J)&&(re!=null||ye!=null))switch(J){case"type":re!==ye&&(Le=!0),v=re;break;case"name":re!==ye&&(Le=!0),m=re;break;case"checked":re!==ye&&(Le=!0),te=re;break;case"defaultChecked":re!==ye&&(Le=!0),ce=re;break;case"value":re!==ye&&(Le=!0),T=re;break;case"defaultValue":re!==ye&&(Le=!0),z=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,n));break;default:re!==ye&&Rt(t,n,J,re,u,ye)}}Hn(t,T,z,K,te,ce,v,m);return;case"select":re=T=z=J=null;for(v in l)if(K=l[v],l.hasOwnProperty(v)&&K!=null)switch(v){case"value":break;case"multiple":re=K;default:u.hasOwnProperty(v)||Rt(t,n,v,null,u,K)}for(m in u)if(v=u[m],K=l[m],u.hasOwnProperty(m)&&(v!=null||K!=null))switch(m){case"value":v!==K&&(Le=!0),J=v;break;case"defaultValue":v!==K&&(Le=!0),z=v;break;case"multiple":v!==K&&(Le=!0),T=v;default:v!==K&&Rt(t,n,m,v,u,K)}n=z,l=T,u=re,J!=null?ra(t,!!l,J,!1):!!u!=!!l&&(n!=null?ra(t,!!l,n,!0):ra(t,!!l,l?[]:"",!1));return;case"textarea":re=J=null;for(z in l)if(m=l[z],l.hasOwnProperty(z)&&m!=null&&!u.hasOwnProperty(z))switch(z){case"value":break;case"children":break;default:Rt(t,n,z,null,u,m)}for(T in u)if(m=u[T],v=l[T],u.hasOwnProperty(T)&&(m!=null||v!=null))switch(T){case"value":m!==v&&(Le=!0),J=m;break;case"defaultValue":m!==v&&(Le=!0),re=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(r(91));break;default:m!==v&&Rt(t,n,T,m,u,v)}jo(t,J,re);return;case"option":for(var Oe in l)if(J=l[Oe],l.hasOwnProperty(Oe)&&J!=null&&!u.hasOwnProperty(Oe))switch(Oe){case"selected":t.selected=!1;break;default:Rt(t,n,Oe,null,u,J)}for(K in u)if(J=u[K],re=l[K],u.hasOwnProperty(K)&&J!==re&&(J!=null||re!=null))switch(K){case"selected":J!==re&&(Le=!0),t.selected=J&&typeof J!="function"&&typeof J!="symbol";break;default:Rt(t,n,K,J,u,re)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Fe in l)J=l[Fe],l.hasOwnProperty(Fe)&&J!=null&&!u.hasOwnProperty(Fe)&&Rt(t,n,Fe,null,u,J);for(te in u)if(J=u[te],re=l[te],u.hasOwnProperty(te)&&J!==re&&(J!=null||re!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(r(137,n));break;default:Rt(t,n,te,J,u,re)}return;default:if(kl(n)){for(var ct in l)J=l[ct],l.hasOwnProperty(ct)&&J!==void 0&&!u.hasOwnProperty(ct)&&xm(t,n,ct,void 0,u,J);for(ce in u)J=u[ce],re=l[ce],!u.hasOwnProperty(ce)||J===re||J===void 0&&re===void 0||xm(t,n,ce,J,u,re);return}}for(var ee in l)J=l[ee],l.hasOwnProperty(ee)&&J!=null&&!u.hasOwnProperty(ee)&&Rt(t,n,ee,null,u,J);for(ye in u)J=u[ye],re=l[ye],!u.hasOwnProperty(ye)||J===re||J==null&&re==null||Rt(t,n,ye,J,u,re)}function X2(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function mC(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,l=performance.getEntriesByType("resource"),u=0;u<l.length;u++){var m=l[u],v=m.transferSize,T=m.initiatorType,z=m.duration;if(v&&z&&X2(T)){for(T=0,z=m.responseEnd,u+=1;u<l.length;u++){var K=l[u],te=K.startTime;if(te>z)break;var ce=K.transferSize,ye=K.initiatorType;ce&&X2(ye)&&(K=K.responseEnd,T+=ce*(K<z?1:(z-te)/(K-te)))}if(--u,n+=8*(v+T)/(m.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var bm=null,jm=null;function uc(t){return t.nodeType===9?t:t.ownerDocument}function Q2(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Z2(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function J2(t,n,l,u){return l=uc(l).createElement(t),l[Vt]=u,l[vn]=n,zn(l,t,n),je(l),l}function wm(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var km=null;function pC(){var t=window.event;return t&&t.type==="popstate"?t===km?!1:(km=t,!0):(km=null,!1)}var Sm=typeof setTimeout=="function"?setTimeout:void 0,gC=typeof clearTimeout=="function"?clearTimeout:void 0,W2=typeof Promise=="function"?Promise:void 0,ey=typeof requestAnimationFrame=="function"?requestAnimationFrame:Sm,vC=typeof queueMicrotask=="function"?queueMicrotask:typeof W2<"u"?function(t){return W2.resolve(null).then(t).catch(yC)}:Sm;function yC(t){setTimeout(function(){throw t})}function Wr(t){return t==="head"}function ty(t,n){var l=n,u=0;do{var m=l.nextSibling;if(t.removeChild(l),m&&m.nodeType===8)if(l=m.data,l==="/$"||l==="/&"){if(u===0){t.removeChild(m),ns(n);return}u--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")u++;else if(l==="html")Rm(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,Rm(l);for(var v=l.firstChild;v;){var T=v.nextSibling,z=v.nodeName;v[Xi]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&v.rel.toLowerCase()==="stylesheet"||l.removeChild(v),v=T}}else l==="body"&&Rm(t.ownerDocument.body);l=m}while(l);ns(n)}function ny(t,n){var l=t;t=0;do{var u=l.nextSibling;if(l.nodeType===1?n?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(n?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),u&&u.nodeType===8)if(l=u.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=u}while(l)}function ay(t,n,l){if(n=CSS.escape(n)!==n?"r-"+btoa(n).replace(/=/g,""):n,t.style.viewTransitionName=n,l!=null&&(t.style.viewTransitionClass=l),l=getComputedStyle(t),l.display==="inline"){if(n=t.getClientRects(),n.length===1)var u=1;else for(var m=u=0;m<n.length;m++){var v=n[m];0<v.width&&0<v.height&&u++}u===1&&(t=t.style,t.display=n.length===1?"inline-block":"block",t.marginTop="-"+l.paddingTop,t.marginBottom="-"+l.paddingBottom)}}function iy(t,n){t=t.style,n=n.style;var l=n!=null?n.hasOwnProperty("viewTransitionName")?n.viewTransitionName:n.hasOwnProperty("view-transition-name")?n["view-transition-name"]:null:null;t.viewTransitionName=l==null||typeof l=="boolean"?"":(""+l).trim(),l=n!=null?n.hasOwnProperty("viewTransitionClass")?n.viewTransitionClass:n.hasOwnProperty("view-transition-class")?n["view-transition-class"]:null:null,t.viewTransitionClass=l==null||typeof l=="boolean"?"":(""+l).trim(),t.display==="inline-block"&&(n==null?t.display=t.margin="":(l=n.display,t.display=l==null||typeof l=="boolean"?"":l,l=n.margin,l!=null?t.margin=l:(l=n.hasOwnProperty("marginTop")?n.marginTop:n["margin-top"],t.marginTop=l==null||typeof l=="boolean"?"":l,n=n.hasOwnProperty("marginBottom")?n.marginBottom:n["margin-bottom"],t.marginBottom=n==null||typeof n=="boolean"?"":n)))}function xC(t,n,l){return l=l.ownerDocument.defaultView,{rect:t,abs:n.position==="absolute"||n.position==="fixed",clip:n.clipPath!=="none"||n.overflow!=="visible"||n.filter!=="none"||n.mask!=="none"||n.mask!=="none"||n.borderRadius!=="0px",view:0<=t.bottom&&0<=t.right&&t.top<=l.innerHeight&&t.left<=l.innerWidth}}function Cm(t){var n=t.getBoundingClientRect(),l=getComputedStyle(t);return xC(n,l,t)}function bC(t){return t.documentElement.clientHeight}function jC(t){this.addEventListener("load",t),this.addEventListener("error",t)}function wC(t,n,l,u,m,v,T,z,K){var te=n.nodeType===9?n:n.ownerDocument;try{var ce=te.startViewTransition({update:function(){var J=te.defaultView,re=J.navigation&&J.navigation.transition,Oe=te.fonts.status;u();var Fe=[];if(Oe==="loaded"&&(bC(te),te.fonts.status==="loading"&&Fe.push(te.fonts.ready)),Oe=Fe.length,t!==null)for(var ct=t.suspenseyImages,ee=0,Q=0;Q<ct.length;Q++){var ae=ct[Q];if(!ae.complete){var ve=ae.getBoundingClientRect();if(0<ve.bottom&&0<ve.right&&ve.top<J.innerHeight&&ve.left<J.innerWidth){if(ee+=Cy(ae),ee>ld){Fe.length=Oe;break}ae=new Promise(jC.bind(ae)),Fe.push(ae)}}}if(0<Fe.length)return J=Promise.race([Promise.all(Fe),new Promise(function(Pe){return setTimeout(Pe,500)})]).then(m,m),(re?Promise.allSettled([re.finished,J]):J).then(v,v);if(m(),re)return re.finished.then(v,v);v()},types:l});te.__reactViewTransition=ce;var ye=[];return ce.ready.then(function(){for(var J=te.documentElement.getAnimations({subtree:!0}),re=0;re<J.length;re++){var Oe=J[re],Fe=Oe.effect,ct=Fe.pseudoElement;if(ct!=null&&ct.startsWith("::view-transition")){ye.push(Oe),Oe=Fe.getKeyframes();for(var ee=ct=void 0,Q=!0,ae=0;ae<Oe.length;ae++){var ve=Oe[ae],Pe=ve.width;if(ct===void 0)ct=Pe;else if(ct!==Pe){Q=!1;break}if(Pe=ve.height,ee===void 0)ee=Pe;else if(ee!==Pe){Q=!1;break}delete ve.width,delete ve.height,ve.transform==="none"&&delete ve.transform}Q&&ct!==void 0&&ee!==void 0&&(Fe.setKeyframes(Oe),Q=getComputedStyle(Fe.target,Fe.pseudoElement),Q.width!==ct||Q.height!==ee)&&(Q=Oe[0],Q.width=ct,Q.height=ee,Q=Oe[Oe.length-1],Q.width=ct,Q.height=ee,Fe.setKeyframes(Oe))}}T()},function(J){te.__reactViewTransition===ce&&(te.__reactViewTransition=null);try{if(typeof J=="object"&&J!==null)switch(J.name){case"InvalidStateError":(J.message==="View transition was skipped because document visibility state is hidden."||J.message==="Skipping view transition because document visibility state has become hidden."||J.message==="Skipping view transition because viewport size changed."||J.message==="Transition was aborted because of invalid state")&&(J=null)}J!==null&&K(J)}finally{u(),m(),T()}}),ce.finished.finally(function(){for(var J=0;J<ye.length;J++)ye[J].cancel();te.__reactViewTransition===ce&&(te.__reactViewTransition=null),z()}),ce}catch{return u(),m(),T(),null}}function Yl(t,n){this._scope=document.documentElement,this._selector="::view-transition-"+t+"("+n+")"}Yl.prototype.animate=function(t,n){return n=typeof n=="number"?{duration:n}:I({},n),n.pseudoElement=this._selector,this._scope.animate(t,n)},Yl.prototype.getAnimations=function(){for(var t=this._scope,n=this._selector,l=t.getAnimations({subtree:!0}),u=[],m=0;m<l.length;m++){var v=l[m].effect;v!==null&&v.target===t&&v.pseudoElement===n&&u.push(l[m])}return u},Yl.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function ry(t){return{name:t,group:new Yl("group",t),imagePair:new Yl("image-pair",t),old:new Yl("old",t),new:new Yl("new",t)}}function _a(t){this._fragmentFiber=t,this._observers=this._eventListeners=null}_a.prototype.addEventListener=function(t,n,l){var u=null,m=null;if(!(l!=null&&typeof l!="boolean"&&(u=l.signal||null,u!==null&&u.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var v=this._eventListeners;if(oy(v,t,n,l)===-1){var T=this,z=n;l!=null&&typeof l!="boolean"&&l.once===!0&&(z=function(K){T.removeEventListener(t,n,l),typeof n=="function"?n.call(this,K):n.handleEvent(K)}),u!==null&&(m=T.removeEventListener.bind(T,t,n,l),u.addEventListener("abort",m,{once:!0}),m=u.removeEventListener.bind(u,"abort",m)),u=Qo(l),v.push({type:t,listener:n,optionsOrUseCapture:l,attachedListener:z,cleanup:m}),g(this._fragmentFiber.child,!1,kC,t,z,u)}this._eventListeners=v}};function kC(t,n,l,u){return N(t).addEventListener(n,l,u),!1}_a.prototype.removeEventListener=function(t,n,l){var u=this._eventListeners;if(u!==null&&(n=oy(u,t,n,l),n!==-1)){var m=u[n];l=m.attachedListener;var v=m.cleanup;m=Qo(m.optionsOrUseCapture),g(this._fragmentFiber.child,!1,SC,t,l,m),u.splice(n,1),v!==null&&v()}};function SC(t,n,l,u){return N(t).removeEventListener(n,l,u),!1}function Qo(t){return t!=null&&typeof t!="boolean"&&(t.once===!0||t.signal instanceof AbortSignal)?{capture:t.capture,passive:t.passive}:t}function ly(t){return t==null?"c=0":typeof t=="boolean"?"c="+(t?"1":"0"):"c="+(t.capture?"1":"0")}function oy(t,n,l,u){if(t.length===0)return-1;u=ly(u);for(var m=0;m<t.length;m++){var v=t[m];if(v.type===n&&v.listener===l&&ly(v.optionsOrUseCapture)===u)return m}return-1}_a.prototype.dispatchEvent=function(t){var n=b(this._fragmentFiber);if(n===null)return!0;n=N(n);var l=this._eventListeners;if(l!==null&&0<l.length||!t.bubbles){var u=n.nodeType===9?n.createComment(""):document.createTextNode("");if(l)for(var m=0;m<l.length;m++){var v=l[m];u.addEventListener(v.type,v.attachedListener,Qo(v.optionsOrUseCapture))}if(n.appendChild(u),t=u.dispatchEvent(t),l)for(m=0;m<l.length;m++)v=l[m],u.removeEventListener(v.type,v.attachedListener,Qo(v.optionsOrUseCapture));return n.removeChild(u),t}return n.dispatchEvent(t)},_a.prototype.focus=function(t){g(this._fragmentFiber.child,!0,sy,t,void 0,void 0)};function sy(t,n){return t.tag===6?!1:(t=N(t),LC(t,n))}_a.prototype.focusLast=function(t){var n=[];g(this._fragmentFiber.child,!0,Nm,n,void 0,void 0);for(var l=n.length-1;0<=l&&!sy(n[l],t);l--);};function Nm(t,n){return n.push(t),!1}_a.prototype.blur=function(){var t=b(this._fragmentFiber);t!==null&&(t=N(t),t=uc(t).activeElement,t!==null&&g(this._fragmentFiber.child,!1,CC,t,void 0,void 0))};function CC(t,n){return t.tag===6?!1:(t=N(t),t===n||t.contains(n)?(n.blur(),!0):!1)}_a.prototype.observeUsing=function(t){this._observers===null&&(this._observers=new Set),this._observers.add(t),g(this._fragmentFiber.child,!1,NC,t,void 0,void 0)};function NC(t,n){return t.tag===6||(t=N(t),n.observe(t)),!1}_a.prototype.unobserveUsing=function(t){var n=this._observers;if(n!==null&&n.has(t)){n.delete(t),g(this._fragmentFiber.child,!1,EC,t,void 0,void 0);for(var l=n=0;l<si.length;l++){var u=si[l];u.fragmentInstance===this&&u.observer===t?t.unobserve(u.instance):si[n++]=u}si.length=n}};function EC(t,n){return t.tag===6||(t=N(t),n.unobserve(t)),!1}var si=[],Em=!1;function TC(t,n,l){si.push({fragmentInstance:t,observer:n,instance:l}),Em||(Em=!0,BC(function(){Em=!1;var u=si;si=[];for(var m=0;m<u.length;m++){var v=u[m];v.observer.unobserve(v.instance)}}))}_a.prototype.getClientRects=function(){var t=[];return g(this._fragmentFiber.child,!1,AC,t,void 0,void 0),t};function AC(t,n){if(t.tag===6){t=t.stateNode;var l=t.ownerDocument.createRange();l.selectNodeContents(t),n.push.apply(n,l.getClientRects())}else t=N(t),n.push.apply(n,t.getClientRects());return!1}_a.prototype.getRootNode=function(t){var n=b(this._fragmentFiber);return n===null?this:N(n).getRootNode(t)},_a.prototype.compareDocumentPosition=function(t){var n=b(this._fragmentFiber);if(n===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var l=[];g(this._fragmentFiber.child,!1,Nm,l,void 0,void 0);var u=N(n);if(l.length===0){if(l=u,j(this._fragmentFiber)){e:{for(n=this._fragmentFiber.return;n!==null;){if(n.tag===4){n=n.stateNode.containerInfo;break e}if(n.tag===3||n.tag===5||n.tag===27)break;n=n.return}n=null}n!=null&&(l=n)}n=this._fragmentFiber;var m=u=l.compareDocumentPosition(t);return l===t?m=Node.DOCUMENT_POSITION_CONTAINS:u&Node.DOCUMENT_POSITION_CONTAINED_BY&&(l=k(n)[1],l===null?m=Node.DOCUMENT_POSITION_PRECEDING:(t=N(l).compareDocumentPosition(t),m=t===0||t&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),m|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}n=N(l[0]),m=N(l[l.length-1]);var v=j(this._fragmentFiber)?n.parentElement:u;if(v==null)return Node.DOCUMENT_POSITION_DISCONNECTED;u=v.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_CONTAINED_BY,v=v.compareDocumentPosition(m)&Node.DOCUMENT_POSITION_CONTAINED_BY;var T=n.compareDocumentPosition(t),z=m.compareDocumentPosition(t),K=T&Node.DOCUMENT_POSITION_CONTAINED_BY||z&Node.DOCUMENT_POSITION_CONTAINED_BY;return z=u&&v&&T&Node.DOCUMENT_POSITION_FOLLOWING&&z&Node.DOCUMENT_POSITION_PRECEDING,n=u&&n===t||v&&m===t||K||z?Node.DOCUMENT_POSITION_CONTAINED_BY:!u&&n===t||!v&&m===t?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:T,n&Node.DOCUMENT_POSITION_DISCONNECTED||n&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||MC(n,this._fragmentFiber,l[0],l[l.length-1],t)?n:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function MC(t,n,l,u,m){var v=ja(m);if(t&Node.DOCUMENT_POSITION_CONTAINED_BY){if(l=!!v)e:{for(;v!==null;){if(v.tag===7&&(v===n||v.alternate===n)){l=!0;break e}v=v.return}l=!1}return l}if(t&Node.DOCUMENT_POSITION_CONTAINS){if(v===null)return v=m.ownerDocument,m===v||m===v.documentElement||m===v.body;e:{for(v=n,n=b(n);v!==null;){if(!(v.tag!==5&&v.tag!==3&&v.tag!==27||v!==n&&v.alternate!==n)){v=!0;break e}v=v.return}v=!1}return v}return t&Node.DOCUMENT_POSITION_PRECEDING?((n=!!v)&&!(n=v===l)&&(n=R(l,v,_),n===null?n=!1:(g(n,!0,C,v,l),v=E,E=null,n=v!==null)),n):t&Node.DOCUMENT_POSITION_FOLLOWING?((n=!!v)&&!(n=v===u)&&(n=R(u,v,_),n===null?n=!1:(g(n,!0,A,v,u),v=E,M=E=null,n=v!==null)),n):!1}function cy(t,n){var l=t.ownerDocument.createRange();l.selectNodeContents(t),t=l.getBoundingClientRect(),window.scrollTo(window.scrollX+t.left,n?window.scrollY+t.top:window.scrollY+t.bottom-window.innerHeight)}_a.prototype.scrollIntoView=function(t){if(typeof t=="object")throw Error(r(566));var n=[];g(this._fragmentFiber.child,!1,Nm,n,void 0,void 0);var l=t!==!1;if(n.length===0){var u=k(this._fragmentFiber);if(u=l?u[1]||u[0]||b(this._fragmentFiber):u[0]||u[1],u===null)return;if(u.tag===6){t=N(u),cy(t,l);return}if(u=N(u),u.nodeType!==9){if(u.nodeType===11){l="host"in u?u.host:null,l!==null&&l.scrollIntoView(t);return}u.scrollIntoView(t)}}for(u=l?n.length-1:0;u!==(l?-1:n.length);){var m=n[u];m.tag===6?(m=N(m),cy(m,l)):N(m).scrollIntoView(t),u+=l?-1:1}};function _C(t,n){return t=N(t),uy(t,n),!1}function uy(t,n){t.reactFragments==null&&(t.reactFragments=new Set),t.reactFragments.add(n)}function dy(t,n){var l=n._eventListeners;if(l!==null)for(var u=0;u<l.length;u++){var m=l[u];t.addEventListener(m.type,m.attachedListener,Qo(m.optionsOrUseCapture))}t.nodeType!==3&&(l=n._observers,l!==null&&l.forEach(function(v){for(var T=0,z=0;z<si.length;z++){var K=si[z];(K.fragmentInstance!==n||K.observer!==v||K.instance!==t)&&(si[T++]=K)}si.length=T,v.observe(t)}),uy(t,n))}function RC(t,n){var l=n._eventListeners;if(l!==null)for(var u=0;u<l.length;u++){var m=l[u];t.removeEventListener(m.type,m.attachedListener,Qo(m.optionsOrUseCapture))}t.nodeType!==3&&(l=n._observers,l!==null&&l.forEach(function(v){typeof v.rootMargin=="string"?TC(n,v,t):v.unobserve(t)}),t.reactFragments!=null&&t.reactFragments.delete(n))}function Tm(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var l=n;switch(n=n.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Tm(l),Mr(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function OC(t,n,l,u){for(;t.nodeType===1;){var m=l;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!u&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(u){if(!t[Xi])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(v=t.getAttribute("rel"),v==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(v!==m.rel||t.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||t.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||t.getAttribute("title")!==(m.title==null?null:m.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(v=t.getAttribute("src"),(v!==(m.src==null?null:m.src)||t.getAttribute("type")!==(m.type==null?null:m.type)||t.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&v&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var v=m.name==null?null:""+m.name;if(m.type==="hidden"&&t.getAttribute("name")===v)return t}else return t;if(t=Ya(t.nextSibling),t===null)break}return null}function DC(t,n,l){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=Ya(t.nextSibling),t===null))return null;return t}function fy(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=Ya(t.nextSibling),t===null))return null;return t}function Am(t){return t.data==="$?"||t.data==="$~"}function Mm(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function zC(t,n){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||l.readyState!=="loading")n();else{var u=function(){n(),l.removeEventListener("DOMContentLoaded",u)};l.addEventListener("DOMContentLoaded",u),t._reactRetry=u}}function Ya(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var _m=null;function hy(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(n===0)return Ya(t.nextSibling);n--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||n++}t=t.nextSibling}return null}function my(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(n===0)return t;n--}else l!=="/$"&&l!=="/&"||n++}t=t.previousSibling}return null}function LC(t,n){function l(){u=!0}if(t.ownerDocument.activeElement===t)return!0;var u=!1;try{t.ownerDocument.addEventListener("focus",l,!0),(t.focus||HTMLElement.prototype.focus).call(t,n)}finally{t.ownerDocument.removeEventListener("focus",l,!0)}return u}function BC(t){ey(function(){ey(function(n){return t(n)})})}function py(t,n,l){switch(n=uc(l),t){case"html":if(t=n.documentElement,!t)throw Error(r(452));return t;case"head":if(t=n.head,!t)throw Error(r(453));return t;case"body":if(t=n.body,!t)throw Error(r(454));return t;default:throw Error(r(451))}}function gy(t,n,l){for(var u in l){var m=l[u];l.hasOwnProperty(u)&&m!=null&&Rt(t,n,u,null,fC,m)}l.dangerouslySetInnerHTML!=null&&(t.textContent=""),t.onclick===Xn&&(t.onclick=null),Mr(t)}function Rm(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Mr(t)}var Ka=new Map,vy=new Set;function dc(t){if(typeof t.getRootNode=="function"){var n=t.getRootNode();if(n.nodeType===9||n.nodeType===11)return n}return t.nodeType===9?t:t.ownerDocument}var cr=oe.d;oe.d={f:IC,r:PC,D:HC,C:qC,L:UC,m:FC,X:$C,S:VC,M:GC};function IC(){var t=cr.f(),n=Zu();return t||n}function PC(t){var n=wi(t);n!==null&&n.tag===5&&n.type==="form"?xv(n):cr.r(t)}var Zo=typeof document>"u"?null:document;function yy(t,n,l){var u=Zo;if(u&&typeof n=="string"&&n){var m=$t(n);m='link[rel="'+t+'"][href="'+m+'"]',typeof l=="string"&&(m+='[crossorigin="'+l+'"]'),vy.has(m)||(vy.add(m),t={rel:t,crossOrigin:l,href:n},u.querySelector(m)===null&&(n=u.createElement("link"),zn(n,"link",t),je(n),u.head.appendChild(n)))}}function HC(t){cr.D(t),yy("dns-prefetch",t,null)}function qC(t,n){cr.C(t,n),yy("preconnect",t,n)}function UC(t,n,l){cr.L(t,n,l);var u=Zo;if(u&&t&&n){var m='link[rel="preload"][as="'+$t(n)+'"]';n==="image"&&l&&l.imageSrcSet?(m+='[imagesrcset="'+$t(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(m+='[imagesizes="'+$t(l.imageSizes)+'"]')):m+='[href="'+$t(t)+'"]';var v=m;switch(n){case"style":v=Jo(t);break;case"script":v=Wo(t)}if(!(Ka.has(v)||(t=I({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:t,as:n},l),Ka.set(v,t),u.querySelector(m)!==null||n==="style"&&u.querySelector(fc(v))||n==="script"&&u.querySelector(hc(v))))){var T=u.createElement("link");zn(T,"link",t),n==="style"&&(T[Ar]=!0,T.onload=T.onerror=function(){Ve(T)}),je(T),u.head.appendChild(T)}}}function FC(t,n){cr.m(t,n);var l=Zo;if(l&&t){var u=n&&typeof n.as=="string"?n.as:"script",m='link[rel="modulepreload"][as="'+$t(u)+'"][href="'+$t(t)+'"]',v=m;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=Wo(t)}if(!Ka.has(v)&&(t=I({rel:"modulepreload",href:t},n),Ka.set(v,t),l.querySelector(m)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(hc(v)))return}u=l.createElement("link"),zn(u,"link",t),je(u),l.head.appendChild(u)}}}function VC(t,n,l){cr.S(t,n,l);var u=Zo;if(u&&t){var m=be(u).hoistableStyles,v=Jo(t);n=n||"default";var T=m.get(v);if(!T){var z={loading:0,preload:null};if(T=u.querySelector(fc(v)))z.loading=5;else{t=I({rel:"stylesheet",href:t,"data-precedence":n},l),(l=Ka.get(v))&&Om(t,l);var K=T=u.createElement("link");je(K),zn(K,"link",t),K._p=new Promise(function(te,ce){K.onload=te,K.onerror=ce}),K.addEventListener("load",function(){z.loading|=1}),K.addEventListener("error",function(){z.loading|=2}),z.loading|=4,id(T,n,u)}T={type:"stylesheet",instance:T,count:1,state:z},m.set(v,T)}}}function $C(t,n){cr.X(t,n);var l=Zo;if(l&&t){var u=be(l).hoistableScripts,m=Wo(t),v=u.get(m);v||(v=l.querySelector(hc(m)),v||(t=I({src:t,async:!0},n),(n=Ka.get(m))&&Dm(t,n),v=l.createElement("script"),je(v),zn(v,"link",t),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(m,v))}}function GC(t,n){cr.M(t,n);var l=Zo;if(l&&t){var u=be(l).hoistableScripts,m=Wo(t),v=u.get(m);v||(v=l.querySelector(hc(m)),v||(t=I({src:t,async:!0,type:"module"},n),(n=Ka.get(m))&&Dm(t,n),v=l.createElement("script"),je(v),zn(v,"link",t),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(m,v))}}function xy(t,n,l,u){var m=(m=jn.current)?dc(m):null;if(!m)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(l=Jo(l.href),n=be(m).hoistableStyles,u=n.get(l),u||(u={type:"style",instance:null,count:0,state:null},n.set(l,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=Jo(l.href);var v=be(m).hoistableStyles,T=v.get(t);if(T||(m=m.ownerDocument||m,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(t,T),(v=m.querySelector(fc(t)))?v._p||(T.instance=v,T.state.loading=5):(v=Ka.get(t),v||(v={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Ka.set(t,v)),YC(m,t,v,T.state))),n&&u===null)throw Error(r(528,""));return T}if(n&&u!==null)throw Error(r(529,""));return null;case"script":return n=l.async,l=l.src,typeof l=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(l=Wo(l),n=be(m).hoistableScripts,u=n.get(l),u||(u={type:"script",instance:null,count:0,state:null},n.set(l,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function Jo(t){return'href="'+$t(t)+'"'}function fc(t){return'link[rel="stylesheet"]['+t+"]"}function by(t){return I({},t,{"data-precedence":t.precedence,precedence:null})}function YC(t,n,l,u){if(n=t.querySelector('link[rel="preload"][as="style"]['+n+"]")){if(n[Ar]!==!0){u.loading=1;return}}else n=t.createElement("link"),n[Ar]=!0,n.onload=n.onerror=Ve.bind(null,n),zn(n,"link",l),je(n),t.head.appendChild(n);u.preload=n,n.addEventListener("load",function(){return u.loading|=1}),n.addEventListener("error",function(){return u.loading|=2})}function Wo(t){return'[src="'+$t(t)+'"]'}function hc(t){return"script[async]"+t}function jy(t,n,l){if(n.count++,n.instance===null)switch(n.type){case"style":var u=t.querySelector('style[data-href~="'+$t(l.href)+'"]');if(u)return n.instance=u,je(u),u;var m=I({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),je(u),zn(u,"style",m),id(u,l.precedence,t),n.instance=u;case"stylesheet":m=Jo(l.href);var v=t.querySelector(fc(m));if(v)return n.state.loading|=4,n.instance=v,je(v),v;u=by(l),(m=Ka.get(m))&&Om(u,m),v=(t.ownerDocument||t).createElement("link"),je(v);var T=v;return T._p=new Promise(function(z,K){T.onload=z,T.onerror=K}),zn(v,"link",u),n.state.loading|=4,id(v,l.precedence,t),n.instance=v;case"script":return v=Wo(l.src),(m=t.querySelector(hc(v)))?(n.instance=m,je(m),m):(u=l,(m=Ka.get(v))&&(u=I({},l),Dm(u,m)),t=t.ownerDocument||t,m=t.createElement("script"),je(m),zn(m,"link",u),t.head.appendChild(m),n.instance=m);case"void":return null;default:throw Error(r(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(u=n.instance,n.state.loading|=4,id(u,l.precedence,t));return n.instance}function id(t,n,l){for(var u=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=u.length?u[u.length-1]:null,v=m,T=0;T<u.length;T++){var z=u[T];if(z.dataset.precedence===n)v=z;else if(v!==m)break}v?v.parentNode.insertBefore(t,v.nextSibling):(n=l.nodeType===9?l.head:l,n.insertBefore(t,n.firstChild))}function Om(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function Dm(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var rd=null;function wy(t,n,l){if(rd===null){var u=new Map,m=rd=new Map;m.set(l,u)}else m=rd,u=m.get(l),u||(u=new Map,m.set(l,u));if(u.has(t))return u;for(u.set(t,null),l=l.getElementsByTagName(t),m=0;m<l.length;m++){var v=l[m];if(!(v[Xi]||v[Vt]||t==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var T=v.getAttribute(n)||"";T=t+T;var z=u.get(T);z?z.push(v):u.set(T,[v])}}return u}function zm(t,n,l){t=t.ownerDocument||t,t.head.insertBefore(l,n==="title"?t.querySelector("head > title"):null)}function KC(t,n,l){if(l===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return t=n.disabled,typeof n.precedence=="string"&&t==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function ky(t,n){return t==="img"&&n.src!=null&&n.src!==""&&n.onLoad==null&&n.loading!=="lazy"}function Sy(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Cy(t){return(t.width||100)*(t.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Ny(t,n){typeof n.decode=="function"&&(t.imgCount++,n.complete||(t.imgBytes+=Cy(n),t.suspenseyImages.push(n)),t=ZC.bind(t),n.decode().then(t,t))}function XC(t,n,l,u){if(l.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var m=Jo(u.href),v=n.querySelector(fc(m));if(v){n=v._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=mc.bind(t),n.then(t,t)),l.state.loading|=4,l.instance=v,je(v);return}v=n.ownerDocument||n,u=by(u),(m=Ka.get(m))&&Om(u,m),v=v.createElement("link"),je(v);var T=v;T._p=new Promise(function(z,K){T.onload=z,T.onerror=K}),zn(v,"link",u),l.instance=v}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,n),(n=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=mc.bind(t),n.addEventListener("load",l),n.addEventListener("error",l))}}var ld=0;function QC(t,n){return t.stylesheets&&t.count===0&&sd(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var u=setTimeout(function(){if(t.stylesheets&&sd(t,t.stylesheets),t.unsuspend){var v=t.unsuspend;t.unsuspend=null,v()}},6e4+n);0<t.imgBytes&&ld===0&&(ld=62500*mC());var m=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&sd(t,t.stylesheets),t.unsuspend)){var v=t.unsuspend;t.unsuspend=null,v()}},(t.imgBytes>ld?50:800)+n);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(u),clearTimeout(m)}}:null}function Ey(t){if(t.count===0&&(t.imgCount===0||!t.waitingForImages)){if(t.stylesheets)sd(t,t.stylesheets);else if(t.unsuspend){var n=t.unsuspend;t.unsuspend=null,n()}}}function mc(){this.count--,Ey(this)}function ZC(){this.imgCount--,Ey(this)}var od=null;function sd(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,od=new Map,n.forEach(JC,t),od=null,mc.call(t))}function JC(t,n){if(!(n.state.loading&4)){var l=od.get(t);if(l)var u=l.get(null);else{l=new Map,od.set(t,l);for(var m=t.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<m.length;v++){var T=m[v];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(l.set(T.dataset.precedence,T),u=T)}u&&l.set(null,u)}m=n.instance,T=m.getAttribute("data-precedence"),v=l.get(T)||u,v===u&&l.set(null,m),l.set(T,m),this.count++,u=mc.bind(this),m.addEventListener("load",u),m.addEventListener("error",u),v?v.parentNode.insertBefore(m,v.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(m,t.firstChild)),n.state.loading|=4}}var es={$$typeof:F,Provider:null,Consumer:null,_currentValue:Ee,_currentValue2:Ee,_threadCount:0};function WC(t,n,l,u,m,v,T,z,K){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Cr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Cr(0),this.hiddenUpdates=Cr(null),this.identifierPrefix=u,this.onUncaughtError=m,this.onCaughtError=v,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.transitionTypes=null,this.incompleteTransitions=new Map}function Ty(t,n,l,u,m,v,T,z,K,te,ce,ye){return t=new WC(t,n,l,T,K,te,ce,ye,z),n=1,v===!0&&(n|=24),v=la(3,null,null,n),t.current=v,v.stateNode=t,n=Qf(),n.refCount++,t.pooledCache=n,n.refCount++,v.memoizedState={element:u,isDehydrated:l,cache:n},eh(v),t}function Ay(t){return t?(t=No,t):No}function My(t,n,l,u,m,v){m=Ay(m),u.context===null?u.context=m:u.pendingContext=m,u=qr(n),u.payload={element:l},v=v===void 0?null:v,v!==null&&(u.callback=v),l=Ur(t,u,n),l!==null&&(ua(l,t,n),$s(l,t,n))}function _y(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<n?l:n}}function Lm(t,n){_y(t,n),(t=t.alternate)&&_y(t,n)}function Ry(t){if(t.tag===13||t.tag===31){var n=Ml(t,67108864);n!==null&&ua(n,t,67108864),Lm(t,67108864)}}function Oy(t){if(t.tag===13||t.tag===31){var n=Ma();n=Ia(n);var l=Ml(t,n);l!==null&&ua(l,t,n),Lm(t,n)}}var ts=!0;function e8(t,n,l,u){var m=xe.T;xe.T=null;var v=oe.p;try{oe.p=2,Bm(t,n,l,u)}finally{oe.p=v,xe.T=m}}function t8(t,n,l,u){var m=xe.T;xe.T=null;var v=oe.p;try{oe.p=8,Bm(t,n,l,u)}finally{oe.p=v,xe.T=m}}function Bm(t,n,l,u){if(ts){var m=Im(u);if(m===null)ym(t,n,u,cd,l),zy(t,u);else if(a8(m,t,n,l,u))u.stopPropagation();else if(zy(t,u),n&4&&-1<n8.indexOf(t)){for(;m!==null;){var v=wi(m);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var T=ti(v.pendingLanes);if(T!==0){var z=v;for(z.pendingLanes|=2,z.entangledLanes|=2;T;){var K=1<<31-on(T);z.entanglements[1]|=K,T&=~K}Ri(v),(Et&6)===0&&(Ku=Gt()+500,oc(0))}}break;case 31:case 13:z=Ml(v,2),z!==null&&ua(z,v,2),Zu(),Lm(v,2)}if(v=Im(u),v===null&&ym(t,n,u,cd,l),v===m)break;m=v}m!==null&&u.stopPropagation()}else ym(t,n,u,null,l)}}function Im(t){return t=Cl(t),Pm(t)}var cd=null;function Pm(t){if(cd=null,t=ja(t),t!==null){var n=c(t);if(n===null)t=null;else{var l=n.tag;if(l===13){if(t=d(n),t!==null)return t;t=null}else if(l===31){if(t=f(n),t!==null)return t;t=null}else if(l===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return cd=t,null}function Dy(t){switch(t){case"beforetoggle":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"seeked":case"submit":case"toggle":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"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(za()){case Gn:return 2;case kt:return 8;case gn:case vo:return 32;case Ki:return 268435456;default:return 32}default:return 32}}var Hm=!1,el=null,tl=null,nl=null,pc=new Map,gc=new Map,al=[],n8="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".split(" ");function zy(t,n){switch(t){case"focusin":case"focusout":el=null;break;case"dragenter":case"dragleave":tl=null;break;case"mouseover":case"mouseout":nl=null;break;case"pointerover":case"pointerout":pc.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":gc.delete(n.pointerId)}}function vc(t,n,l,u,m,v){return t===null||t.nativeEvent!==v?(t={blockedOn:n,domEventName:l,eventSystemFlags:u,nativeEvent:v,targetContainers:[m]},n!==null&&(n=wi(n),n!==null&&Ry(n)),t):(t.eventSystemFlags|=u,n=t.targetContainers,m!==null&&n.indexOf(m)===-1&&n.push(m),t)}function a8(t,n,l,u,m){switch(n){case"focusin":return el=vc(el,t,n,l,u,m),!0;case"dragenter":return tl=vc(tl,t,n,l,u,m),!0;case"mouseover":return nl=vc(nl,t,n,l,u,m),!0;case"pointerover":var v=m.pointerId;return pc.set(v,vc(pc.get(v)||null,t,n,l,u,m)),!0;case"gotpointercapture":return v=m.pointerId,gc.set(v,vc(gc.get(v)||null,t,n,l,u,m)),!0}return!1}function Ly(t){var n=ja(t.target);if(n!==null){var l=c(n);if(l!==null){if(n=l.tag,n===13){if(n=d(l),n!==null){t.blockedOn=n,wn(t.priority,function(){Oy(l)});return}}else if(n===31){if(n=f(l),n!==null){t.blockedOn=n,wn(t.priority,function(){Oy(l)});return}}else if(n===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function ud(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var l=Im(t.nativeEvent);if(l===null){l=t.nativeEvent;var u=new l.constructor(l.type,l);Sl=u,l.target.dispatchEvent(u),Sl=null}else return n=wi(l),n!==null&&Ry(n),t.blockedOn=l,!1;n.shift()}return!0}function By(t,n,l){ud(t)&&l.delete(n)}function i8(){Hm=!1,el!==null&&ud(el)&&(el=null),tl!==null&&ud(tl)&&(tl=null),nl!==null&&ud(nl)&&(nl=null),pc.forEach(By),gc.forEach(By)}function dd(t,n){t.blockedOn===n&&(t.blockedOn=null,Hm||(Hm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,i8)))}var fd=null;function Iy(t){fd!==t&&(fd=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){fd===t&&(fd=null);for(var n=0;n<t.length;n+=3){var l=t[n],u=t[n+1],m=t[n+2];if(typeof u!="function"){if(Pm(u||l)===null)continue;break}var v=wi(l);v!==null&&(t.splice(n,3),n-=3,jh(v,{pending:!0,data:m,method:l.method,action:u},u,m))}}))}function ns(t){function n(K){return dd(K,t)}el!==null&&dd(el,t),tl!==null&&dd(tl,t),nl!==null&&dd(nl,t),pc.forEach(n),gc.forEach(n);for(var l=0;l<al.length;l++){var u=al[l];u.blockedOn===t&&(u.blockedOn=null)}for(;0<al.length&&(l=al[0],l.blockedOn===null);)Ly(l),l.blockedOn===null&&al.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(u=0;u<l.length;u+=3){var m=l[u],v=l[u+1],T=m[vn]||null;if(typeof v=="function")T||Iy(l);else if(T){var z=null;if(v&&v.hasAttribute("formAction")){if(m=v,T=v[vn]||null)z=T.formAction;else if(Pm(m)!==null)continue}else z=T.action;typeof z=="function"?l[u+1]=z:(l.splice(u,3),u-=3),Iy(l)}}}function Py(){function t(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(T){return m=T})},focusReset:"manual",scroll:"manual"})}function n(){m!==null&&(m(),m=null),u||setTimeout(l,20)}function l(){if(!u&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,m=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(l,100),function(){u=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),m!==null&&(m(),m=null)}}}function qm(t){this._internalRoot=t}hd.prototype.render=qm.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(r(409));var l=n.current,u=Ma();My(l,u,t,n,null,null)},hd.prototype.unmount=qm.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;My(t.current,2,null,t,null,null),Zu(),n[nn]=null}};function hd(t){this._internalRoot=t}hd.prototype.unstable_scheduleHydration=function(t){if(t){var n=Ft();t={blockedOn:null,target:t,priority:n};for(var l=0;l<al.length&&n!==0&&n<al[l].priority;l++);al.splice(l,0,t),l===0&&Ly(t)}};var Hy=a.version;if(Hy!=="19.3.0")throw Error(r(527,Hy,"19.3.0"));oe.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(r(188)):(t=Object.keys(t).join(","),Error(r(268,t)));return t=p(n),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var r8={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:xe,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var md=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!md.isDisabled&&md.supportsFiber)try{yi=md.inject(r8),Ht=md}catch{}}return xc.createRoot=function(t,n){if(!s(t))throw Error(r(299));var l=!1,u="",m=Av,v=Mv,T=_v;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(m=n.onUncaughtError),n.onCaughtError!==void 0&&(v=n.onCaughtError),n.onRecoverableError!==void 0&&(T=n.onRecoverableError)),n=Ty(t,1,!1,null,null,l,u,null,m,v,T,Py),t[nn]=n.current,vm(t),new qm(n)},xc.hydrateRoot=function(t,n,l){if(!s(t))throw Error(r(299));var u=!1,m="",v=Av,T=Mv,z=_v,K=null;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(m=l.identifierPrefix),l.onUncaughtError!==void 0&&(v=l.onUncaughtError),l.onCaughtError!==void 0&&(T=l.onCaughtError),l.onRecoverableError!==void 0&&(z=l.onRecoverableError),l.formState!==void 0&&(K=l.formState)),n=Ty(t,1,!0,n,l??null,u,m,K,v,T,z,Py),n.context=Ay(null),l=n.current,u=Ma(),u=Ia(u),m=qr(u),m.callback=null,Ur(l,m,u),l=u,n.current.lanes=l,ni(n,l),Ri(n),t[nn]=n.current,vm(t),new hd(n)},xc.version="19.3.0",xc}var Wy;function y8(){if(Wy)return $m.exports;Wy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(a){console.error(a)}}return e(),$m.exports=v8(),$m.exports}var x8=y8();const b8={"locale.name":"English","locale.short":"EN","common.close":"Close","common.continue":"Continue","common.failed":"Something went wrong. Please try again.","common.listSeparator":", ","login.subtitle":"Sign in to continue","login.form":"Sign in","login.username":"Username","login.password":"Password","login.showPassword":"Show password","login.hidePassword":"Hide password","login.submit":"Sign in","login.submitting":"Signing in…","login.wrong":"Wrong username or password.","login.tooMany":"Too many attempts. Please try again later.","login.offline":"Can't connect to Jarvy. Check your network and try again.","login.themeLight":"Switch to the light theme","login.themeDark":"Switch to the dark theme","general.language":"Language","general.theme":"Theme","general.light":"Light","general.dark":"Dark","about.tagline":"A group chat where you and your AI Bots work side by side, running entirely on your own machine.","about.version":"Version {version}","about.source":"Source","about.package":"npm package","about.license":"License","about.notices":"Third-party notices","status.signedIn":"Signed in","status.signedOut":"Signed out","status.configured":"Ready","status.notConfigured":"Not set up","account.menu":"Account menu","account.menuFor":"Account menu for {name}","account.toggleTheme":"Switch theme","account.signOut":"Sign out","entry.menu":"Chat actions","entry.pin":"Pin","entry.unpin":"Unpin","entry.mute":"Mute","entry.unmute":"Unmute","entry.botInfo":"Bot info","entry.channelInfo":"Channel info","entry.deleteBot":"Delete Bot","entry.deleteChannel":"Delete channel","hint.reaction":"{actor} reacted {emoji} to your message","hint.reactionInThread":"{actor} reacted {emoji} to your message in “{title}”","hint.threadSummary":"{actor} updated the summary of “{title}”","hint.summary":"{actor} updated the thread summary","hint.notice":"{actor} updated the notice","app.connecting":"Connecting to Jarvy…","app.channelDeleted":"Channel deleted","app.botDeleted":"{name} deleted","app.notInChannel":{one:"{names} isn't in this channel, so wasn't notified",other:"{names} aren't in this channel, so weren't notified"},"app.memberAdded":"{name} joined #{channel}","app.sourceGone":"The original message no longer exists","ui.closeNamed":"Close {name}","ui.copied":"Copied","ui.copyFailed":"Couldn't copy","ui.copyCode":"Copy code","ui.image":"[Image: {alt}]","ui.imageHidden":"external image hidden","app.deleteChannelTitle":"Delete channel #{name}","app.deleteChannelBody":"Its messages, threads and attachments will be deleted. This can't be undone.","app.resizePane":"Drag to resize the side panel","common.cancel":"Cancel","common.save":"Save","common.create":"Create","common.delete":"Delete","common.retry":"Retry","common.back":"Back","common.add":"Add","common.saveFailed":"Couldn't save","common.openNav":"Open the chat list","common.you":"You","common.member":"Member","common.noMatch":"No matching members","common.searchMembers":"Search members","common.attachment":"[Attachment]","actions.reply":"Reply to this message","actions.react":"Add a reaction","actions.pickEmoji":"Pick an emoji","actions.recent":"Recent","actions.searchEmoji":"Search emoji","actions.noEmoji":"No emoji found","actions.emoji.Smileys & Emotion":"Smileys and emotion","actions.emoji.People & Body":"People and body","actions.emoji.Animals & Nature":"Animals and nature","actions.emoji.Food & Drink":"Food and drink","actions.emoji.Travel & Places":"Travel and places","actions.emoji.Activities":"Activities","actions.emoji.Objects":"Objects","actions.emoji.Symbols":"Symbols","actions.emoji.Flags":"Flags","actions.fold":"Fold to one line","actions.unfold":"Unfold","fold.folded":"Folded","fold.more":"Show all","fold.less":"Show less","dialogs.candidates":"Members you can add","dialogs.allInside":"Everyone is already in this channel","dialogs.addCount":"Add ({count})","dialogs.addFailed":"Couldn't add members","dialogs.optional":"Optional","dialogs.deleteSection":"Delete the group “{name}”? Its channels move under Channels.","dialogs.deleteFailed":"Couldn't delete. Please try again.","dialogs.editSection":"Edit channel group","dialogs.sectionName":"Group name","dialogs.newSection":"New group","api.offline":"Can't connect to Jarvy. Check your network and try again.","api.historyFailed":"Couldn't load the messages. Please try again.","error.autoconfigModel":"Enter the model ID.","error.autoconfigSource":"The selected setup source isn't valid. Choose another one.","error.botMissing":"Can't find this Bot. It may have been deleted.","error.agentUndeletable":"The agent Bot can't be deleted. You can rename or stop it.","error.chatAccessChanged":"Your access to this chat has changed. Refresh and try again.","error.computerFailed":"The sandbox couldn't start.","error.computerMissing":"This Bot has no sandbox.","error.dockerUnavailable":"Docker isn't available on the computer running Jarvy.","error.fileTooLarge":"Attachments can't be larger than {limit}.","error.connectionMissing":"Can't find this model connection. It may have been deleted.","error.credentialChanged":"The credential changed. Please try again.","error.credentialScope":"The credential belongs to another connection.","error.credentialsMissing":"Set up this connection's credential first.","error.dataLocked":"Jarvy is already running, or another program is using its data directory.","error.discoveryFormat":"This address didn't return a model list for the selected protocol. Check the API URL and protocol.","error.discoveryHttp":"Couldn't fetch the models: HTTP {status}.","error.discoveryKey":"Enter the API key.","error.discoveryProtocol":"The selected protocol can't list models. Add models manually.","error.discoveryUrl":"The API URL isn't valid.","error.discoveryUrlMissing":"Enter the API URL.","error.historyMissing":"Can't find this History record.","error.invalidCredential":"The credential format isn't valid.","error.invalidRun":"The Bot's state just changed. Refresh and try again.","error.loginInput":"Enter the authorization code or the redirect URL.","error.loginOption":"Pick a sign-in method.","error.loginStep":"The sign-in step has changed. Please start again.","error.loginFailed":"Sign-in failed. Refresh and try again.","error.messageMissing":"Can't find this message. It may have been deleted.","error.modelIncomplete":"Fill in the model's context window and max output.","error.modelMissing":"Can't find this model. It may have been removed.","error.modelRequestFailed":"Model request failed: {detail}","error.modelRequired":"Pick a model for the Bot first.","error.modelSwitchUncertain":"The model switch didn't finish. Pick the model again.","error.nameTaken":"Another member already has this name.","error.providerNameTaken":"A provider with this name already exists.","error.resetCustom":"A custom provider has no default models to reset to.","error.connectionInUse":"In use by {bots}. Switch to another model before deleting this provider.","error.questionClosed":"This question is already settled.","error.questionExpired":"This question was ignored. The Bot is no longer waiting for an answer.","error.runtimeFailed":"The Bot's run failed. Check its model settings and try again.","error.sessionCorrupt":"The Bot couldn't start (the session file can't be read).","error.sessionMismatch":"The Bot couldn't start (the session file doesn't match).","error.sessionMissing":"The Bot couldn't start (the session file is missing).","error.sessionPath":"The Bot couldn't start (the session file path isn't valid).","error.stopping":"Jarvy is shutting down. Try again later.","error.thinkingFormat":"This thinking format isn't supported.","error.toolsMissing":"Couldn't load the Bot's tools. Restart the Bot and try again.","error.unsafeReplay":"The Bot may have already taken actions before it was interrupted, so it won't retry automatically to avoid doing them twice.","error.discoveryUnreachable":"Couldn't reach {host}. Check the API URL.","color.gray":"Gray","color.blue":"Blue","color.green":"Green","color.amber":"Amber","color.rose":"Pink","color.violet":"Purple","avatar.working":"Working","avatar.openInfo":"Open {name}'s Bot info"},j8={"settings.title":"Settings","settings.sections":"Settings sections","settings.general":"General","settings.models":"Models","settings.usage":"Usage","settings.network":"Network","settings.secrets":"Secrets","settings.about":"About","group.custom":"Custom API","group.subscription":"Subscription","group.apiKey":"API key","models.add":"Add a provider","models.empty":"No model connection yet","models.count":{one:"{count} model",other:"{count} models"},"models.none":"No models yet","picker.back":"Back to the model page","picker.search":"Search providers","picker.searchPlaceholder":"Search providers…","picker.keyHint":{one:"API key · {count} model",other:"API key · {count} models"},"picker.loading":"Loading providers…","picker.retry":"Try again","picker.noMatch":"No provider matches","editor.back":"Back to the provider list","editor.delete":"Delete this provider","editor.connection":"Connection","editor.providerName":"Provider name","editor.name":"Connection name","editor.protocol":"API protocol","editor.url":"API URL","editor.defaultUrl":"The provider's own address","editor.key":"API key","editor.keyPlaceholder":"Enter the API key","editor.keySaved":"Saved. Leave empty to keep it.","editor.settings":"Connection settings","editor.models":"Model list","editor.selected":"{selected} of {total} selected","editor.fetch":"Get the model list","editor.fetching":"Getting…","editor.fetched":{one:"Got {count} model",other:"Got {count} models"},"editor.noneReturned":"This endpoint returned no models","editor.fetchFailed":"Couldn't get the model list","editor.loadingCatalog":"Loading the model catalog…","editor.autoSelected":"Autoconfigure selected","editor.addManually":"Add manually","editor.filter":"Filter models","editor.filterPlaceholder":"Filter models…","editor.selectVisible":"Select everything shown","editor.empty":"No models yet","editor.emptyCustom":"Get the model list, or add a model by hand.","editor.emptyBuiltin":"You can add a model by hand.","editor.autoSummary":"{parts}; saved with the form","editor.autoMatched":{one:"{count} configured",other:"{count} configured"},"editor.autoChoose":{one:"{count} needs a source",other:"{count} need a source"},"editor.autoNone":{one:"{count} not in the catalog",other:"{count} not in the catalog"},"editor.autoFailed":{one:"{count} failed",other:"{count} failed"},"editor.confirmDelete":'Delete "{name}" and its models?',"editor.deleteFailed":"Could not delete","editor.saveFailed":"Could not save","editor.saved":"Saved","editor.reset":"Reset models","editor.resetTitle":"Reset the models to the defaults?","editor.resetModels":{one:"{count} model will be restored to its defaults.",other:"{count} models will be restored to their defaults."},"editor.resetRemoves":{one:"{count} model not in the defaults will be removed: {names}.",other:"{count} models not in the defaults will be removed: {names}."},"editor.resetBots":{one:"{bots} uses a model that will be removed and will need to pick another.",other:"{bots} use models that will be removed and will need to pick others."},"editor.resetKeeps":"The API URL and protocol will be restored to the defaults. Sign-in details and the API key are kept. Unsaved changes will be discarded.","editor.resetConfirm":"Reset","editor.resetDone":"Models reset to the defaults","editor.resetFailed":"Couldn't reset","editor.saving":"Saving…","editor.save":"Save","card.defaultProtocol":"The provider's own protocol","card.modelId":"Model ID","card.modelName":"Model name","card.optional":"Optional","card.newModel":"New model","card.enterId":"Enter the model ID","card.use":"Use {name}","card.remove":"Remove {name}","card.image":"Image","card.reasoning":"Thinking","card.capabilities":"Capabilities","card.reasoningThinking":"Thinking / reasoning","card.imageInput":"Image input","card.specs":"Model specs","card.hidePrices":"Hide prices","card.editPrices":"Edit prices","card.context":"Context window · tokens","card.maxOutput":"Maximum output · tokens","card.costTitle":"Price per million tokens","card.costInput":"Input","card.costOutput":"Output","card.costCacheRead":"Cache read","card.costCacheWrite":"Cache write","card.notProvided":"Not given","card.advanced":"Advanced","card.apiOverride":"API protocol","card.headers":"Headers","card.headerSaved":"Saved. Leave empty to keep it.","card.addHeader":"Add a header","card.removeHeader":"Remove this header","card.compat":"Compat flags","card.jsonObject":"Enter a JSON object","auto.run":"Autoconfigure","auto.pending":"Configuring…","auto.failed":"Autoconfigure failed","auto.tagChoose":"Pick a source","auto.tagNone":"Not in the catalog","auto.official":"Official","auto.matched":"Filled in from {source}{note}{suffix}","auto.reseller":" (a reseller's catalog, not the vendor's)","auto.applied":"; it takes effect once saved.","auto.apiMismatch":"The catalog has this model on the {api} protocol, not the one chosen here, so the thinking format and compat flags were left alone.","auto.changeSource":"Change the source","auto.multiple":"Several official sources share this model name; pick one:","auto.similar":"The catalog has no {modelId}; similar models:","auto.notFound":"The catalog has no such model. Fill it in by hand.","thinking.title":"Thinking","thinking.format":"Thinking format","thinking.protocolDefault":"The protocol's default","thinking.onlyCompletions":"Only used by the OpenAI Chat Completions protocol","thinking.levels":"Thinking levels","thinking.level.off":"Off","thinking.level.minimal":"Minimal","thinking.level.low":"Low","thinking.level.medium":"Medium","thinking.level.high":"High","thinking.level.xhigh":"Extra high","thinking.level.max":"Maximum","thinking.levelName":"{level} level","thinking.levelValue":"Value sent for the {level} level","thinking.supportedDefault":"Supported (default)","thinking.unsupported":"Not supported","thinking.supportedCustom":"Supported, send this value","thinking.supported":"Levels in use: {levels}","auth.title":"Account authorization","auth.running":"Authorizing","auth.openPage":"Open the authorization page","auth.code":"Code: {code}","auth.browser":"Sign in with the browser (OAuth)","auth.deviceCode":"Sign in with a device code","auth.redirectFull":"The full redirect URL","auth.redirectOrCode":"Code or redirect URL","auth.manualNote":"If the browser does not come back on its own, paste the redirect URL here.","auth.waiting":"Waiting for authorization…","auth.cancel":"Cancel authorization","auth.configureCredential":"Set up the credential","auth.signInAgain":"Sign in again","auth.signIn":"Sign in","auth.removeCredential":"Remove the credential","auth.signOut":"Sign out","auth.statusFailed":"Couldn't get the sign-in status","auth.refresh":"Refresh the state","picker.loadFailed":"Couldn't load the providers"},w8={"sidebar.label":"Chats","sidebar.create":"Create","sidebar.createMenu":"Create menu","sidebar.newChannel":"New channel","sidebar.newSection":"New channel group","sidebar.newBot":"New Bot","sidebar.alerts":"{count} unread for you","sidebar.unread":"{count} unread","sidebar.said":"{name}: {text}","sidebar.atMe":"[Mentioned you]","sidebar.more":"More actions for {name}","sidebar.asking":"(waiting for your answer)","sidebar.working":"(working)","sidebar.pinned":"Pinned","sidebar.muted":"Muted","sidebar.hasUnread":"Unread","sidebar.editSection":"Edit group: {name}","sidebar.search":"Search chats and messages","sidebar.results":"Search results","sidebar.chats":"Chats","sidebar.nav":"Channels and DMs","sidebar.followed":"Followed threads","sidebar.channels":"Channels","sidebar.dms":"DMs","sidebar.noDms":"No DMs yet","search.title":"Search","search.paneLabel":"Search in this chat","search.inThread":"This thread","search.inDm":"This DM","search.close":"Close search","search.placeholder":"Search messages","search.channelPlaceholder":"Search this channel and its threads","search.prompt":"Type what you're looking for","search.searching":"Searching…","search.noMessages":"No messages found","search.count":{one:"{count} message, newest first",other:"{count} messages, newest first"},"search.countLatest":"Showing the latest {count}","search.showAll":"Show all {count}","search.threads":"Threads","search.channels":"Channels (topics and notices)","search.messages":"Messages","search.channel":"Channel","member.unknown":"Unknown member","member.deleted":"{name} (deleted)","members.view":"View {name}","members.remove":"Remove {name}","members.count":{one:"{count} member",other:"{count} members"},"members.people":"People","members.removeTitle":"Remove {name} from #{channel}","members.removeBody":"They won't get this channel's messages anymore.","members.removeConfirm":"Remove","chat.area":"Conversation","chat.botDms":"{name}'s DMs with other Bots","chat.botStatus":"Bot status","chat.transcript":"Messages","chat.loading":"Loading…","chat.empty":"No messages yet","chat.start":"Start a conversation with {name}","chat.loadingOlder":"Loading earlier messages…","chat.toLatest":"Jump to the latest","chat.unseen":{one:"{count} new message",other:"{count} new messages"},"chat.toChannel":"Message #{name}","chat.toBot":"Message {name}…","chat.pickModel":"Choose a model for this Bot to start messaging","chat.pick":"Pick a chat","channel.infoFor":"Channel info: {name}","channel.membersCount":{one:"{count} member",other:"{count} members"},"channel.members":"Members","channel.search":"Search channel messages (Ctrl+F)","channel.threads":"Threads","notice.title":"Notice","notice.edit":"Edit the notice","notice.content":"Notice text","notice.none":"No notice yet","notice.version":"v{version}","chat.newBelow":"New messages","chat.today":"Today","chat.yesterday":"Yesterday","channel.echo":"Replied in “{title}”","channel.replies":{one:"{count} reply",other:"{count} replies"},"channel.threadDone":"Done","channel.lastReply":"Last reply {time}","channel.replyInThread":"Reply in thread","info.edit":"Edit {name}","info.memberList":"Member list","info.back":"Back to channel info","info.addMembers":"Add members","info.name":"Name","info.newChannel":"New channel","info.topic":"Topic","info.noTopic":"No topic yet","info.section":"Group","info.menu":"Channel","info.noSection":"None","mention.menu":"Mention a member","mention.inThread":"In this thread","mention.inChannel":"Others in the channel","mention.outside":"Not in this channel","mention.outsideList":"Members not in this channel","mention.searchOutside":"Search members not in this channel","mention.invites":"Choosing someone adds them to this channel","quote.inline":"“{text}”","quote.by":"{name}:","quote.remove":"Remove quote: {text}","quote.tooMany":"A message can quote up to {count} passages","quote.selection":"Selected text","quote.copy":"Copy","quote.quote":"Quote in reply","ref.label":"Message from {name}: {text}","ref.dm":"DM · {title}","ref.open":"Go to message","composer.busy":"Still uploading. Add more once it's done.","composer.tooMany":"A message can have up to {count} attachments.","composer.size":"Attachments can't be empty or larger than {limit}.","composer.pasted":"pasted-image","composer.removeFile":"Remove attachment: {name}","composer.uploading":"Uploading: {name}","composer.cancelUpload":"Cancel upload: {name}","composer.replying":"Replying to","composer.cancelReply":"Cancel reply","composer.drop":"Drop to attach","composer.attach":"Attach files","composer.input":"Message","composer.send":"Send","files.preview":"Preview {name}","files.download":"Download {name}","files.gone":"This attachment doesn't exist or was deleted","files.readFailed":"Couldn't open the file ({status})","files.readError":"Couldn't open the file","files.kindImage":"Image","files.kindSvg":"SVG","files.kindHtml":"HTML","files.kindMarkdown":"Markdown","files.kindText":"Text","files.kindFile":"File","files.downloadFile":"Download","files.showPreview":"Preview","files.showSource":"Source","files.showText":"Plain text","files.openTab":"Open in a new tab (isolated)","files.narrow":"Shrink the preview","files.widen":"Widen the preview","files.closePreview":"Close the preview","files.running":"Scripts are running in isolation: they can reach the network but can't read Jarvy's data.","files.scripts":{one:"This HTML has {count} script{hosts}. It isn't running. Once run, it can reach the network but can't read Jarvy's data.",other:"This HTML has {count} scripts{hosts}. They aren't running. Once run, they can reach the network but can't read Jarvy's data."},"files.scriptHosts":" (loading {hosts})","files.andMore":" and more","files.stop":"Stop scripts","files.run":"Run scripts","files.downloadToView":"Download this file to view it","files.tooLarge":"This file is over 1 MB, too large to preview here.","files.unsupported":"This file can't be previewed here.","files.reading":"Reading the file…","files.runningTitle":"{name} (running)","files.previous":"Previous attachment","files.choose":"Pick a file to preview","files.next":"Next attachment","question.failed":"Couldn't send the answer","question.dismissed":"Dismissed","question.chose":"Chose: {answer}","question.dismissLabel":"Close the question without answering","question.dismiss":"Skip","question.multiple":"Pick one or more","question.note":"Add a note (optional)","question.own":"Or write your own…","question.ownLabel":"Your own answer","question.confirmCount":"OK ({count})","question.confirm":"OK","question.send":"Send","directs.back":"Back to the list","directs.between":"{name} and {other}","directs.readOnly":"Read only","files.kindVideo":"Video","files.kindAudio":"Audio","files.cantPlay":"This browser can't play it","files.cantPlayHint":"Download it and open it in a player."},k8={"threadSort.title":"Sort","threadSort.current":"Sort: {order}","threadSort.updated":"Last updated","threadSort.created":"Created","threadSort.status":"Status","threads.list":"Thread list","threads.closeList":"Close the thread list","threads.byStatus":"Filter by status","threads.openCount":"Open {count}","threads.doneCount":"Done {count}","threads.all":"All","threads.loading":"Loading…","threads.loadFailed":"Couldn't load the threads","threads.none":"No threads yet","threads.following":"Following","threads.filter":"Filter","threads.unreadCount":"Unread {count}","threads.unread":"Unread","threads.noneUnread":"No unread threads","threads.noneOpen":"No open threads","threads.noneDone":"No finished threads","threads.notFollowing":"Not following","threads.pick":"Pick a thread","threads.open":"Open","thread.rename":"Rename","thread.title":"Thread title","thread.toggleStatus":"Switch status","thread.summary":"Summary","thread.editSummary":"Edit the summary","thread.conclude":"Mark done and post the summary to #{channel}","thread.addSummary":"Add a summary","thread.sourceElsewhere":"The original message isn't in this thread","thread.label":"Thread","thread.backToList":"Back to the thread list","thread.inChannel":"View in channel","thread.search":"Search thread messages (Ctrl+F)","thread.followingHint":"New replies count as unread","thread.notFollowingHint":"New replies don't count as unread","thread.follow":"Follow","thread.expand":"Expand","thread.collapse":"Back to the side panel","thread.close":"Close the thread panel","thread.conclusion":"Conclusion:","thread.concluded":"Marked done; the summary was posted to #{channel}","thread.noReplies":"No replies yet","thread.toLatest":"Jump to the latest reply","thread.reply":"Reply in thread"},S8={"usage.title":"Usage","usage.range":"Time range","usage.today":"Today","usage.days":"{count} days","usage.all":"All","usage.refresh":"Refresh","usage.refreshLabel":"Refresh usage","usage.retry":"Retry","usage.loading":"Loading usage…","usage.loadFailed":"Could not load usage","usage.empty":"No model calls in this period","usage.model":"Model","usage.calls":"Calls","usage.input":"Input","usage.output":"Output","usage.cacheRead":"Cache read","usage.cacheWrite":"Cache write","usage.cost":"Cost","usage.total":"Total","usage.byModel":"By model","usage.byBot":"By Bot","usage.unpriced":"No price set","usage.notePartial":"The total cost leaves out models with no price set.","usage.noteCosts":"Costs leave out models with no price set.","activity.error":"Error","activity.running":"Running","activity.reasoning":"Thinking","activity.texting":"Replying","activity.toolCalling":"Using tools","activity.asking":"Waiting for your answer","activity.noModel":"No model","activity.idle":"Idle","activity.stopped":"Not running","bot.saved":"Saved","bot.changeFailed":"Couldn't change it","bot.color":"Avatar color","bot.contextHint":"Context in use, as the model reported it with the Bot's last reply","bot.contextStale":"The latest model request failed. This is the context usage from the last successful request.","bot.context":"Context","bot.unknown":"Unknown","bot.tokens":"{used} / {window} tokens","bot.description":"Description","bot.descriptionPlaceholder":"What can this Bot do for you?","bot.personaPlaceholder":"The Bot's personality, duties and habits","bot.personaHint":"Applies from the next time it starts working.","bot.unsaved":"Unsaved changes","bot.saving":"Saving…","agent.title":"Agent Bot","agent.intro":"{name} is your agent Bot: it helps you run Jarvy itself. Ask it in a DM or a channel to:","agent.create":"Create Bots and change their name, description and persona","agent.model":"Give Bots a model and a thinking level","agent.run":"Start or stop Bots, and see their usage","agent.delete":"Delete Bots, channels and channel groups, or remove members from a channel, always after you confirm on a card","bot.aborting":"Interrupting…","bot.abort":"Interrupt the current task","bot.starting":"Starting…","bot.stopping":"Stopping…","bot.start":"Start","bot.stop":"Stop","bot.workspace":"Workspace","bot.copyWorkspace":"Copy the workspace path","bot.tab.overview":"Overview","bot.tab.profile":"Profile","bot.tab.environment":"Environment","bot.tab.tasks":"Tasks","bot.tab.activity":"Activity","bot.subscriptions":"Subscriptions","bot.noSubscriptions":"No subscriptions","bot.threadIn":"Thread · #{channel}","botModel.auto":"Default level","botModel.off":"Off","botModel.minimal":"Minimal","botModel.low":"Low","botModel.medium":"Medium","botModel.high":"High","botModel.xhigh":"Extra high","botModel.max":"Maximum","botModel.loadFailed":"Couldn't load the model list","botModel.switchFailed":"Couldn't switch the model","botModel.pick":"Pick the Bot's model","botModel.broken":"This model isn't available anymore. Choose another one.","botModel.choose":"Pick a model","botModel.filter":"Filter the Bot's models","botModel.filterPlaceholder":"Filter models…","botModel.list":"Bot models","botModel.noMatch":"No matching models","botModel.none":"No models yet. Add one in Settings.","botModel.manage":"Manage models","botModel.thinking":"Thinking","botModel.pickThinking":"Pick the thinking level","botModel.loading":"Loading models…","botModel.switching":"Switching…","botModel.pickFor":"Pick a model for {name}","deleteBot.title":"Delete {name}","deleteBot.after":"Once deleted:","deleteBot.chats":{one:"Its {count} DM, channel memberships and subscriptions are deleted.",other:"Its {count} DMs, channel memberships and subscriptions are deleted."},"deleteBot.messages":"Its messages in channels and threads stay, shown as from “{name}”; the name can be used again.","deleteBot.history":"Its session history and unfinished tasks are cleared.","deleteBot.files":"Also delete the workspace folder","deleteBot.filesHint":"The workspace may hold files it made. It's kept unless you tick this.","deleteBot.deleting":"Deleting…","deleteBot.working":"Working…","history.reasoning":"Thinking","history.text":"Text","history.empty":"(empty)","history.image":"Image in History","history.toolCall":"Tool call","history.toolResult":"Tool result","history.error":"Error","history.related":"View related record #{id}","history.result":"Result","history.call":"Call","history.details":"Structured result","history.view":"Record view","history.content":"Content","history.json":"Raw JSON","history.contentLabel":"Record content","history.tools":"Tool definitions","history.toolsRemoved":"Removed tools","history.stopReason":"Stop reason","activity.detailFailed":"Couldn't load the record","activity.detailLoading":"Loading the record…","activity.openChat":"Open the chat","activity.sentBy":"Sent by call #{id}","activity.roleSystem":"System","activity.roleUser":"Input","activity.roleAssistant":"Assistant","activity.timeline":"Bot activity timeline","activity.chatMessage":"Chat message {id}","activity.viewMessage":"View message {sequence} · {chat}","activity.attachmentOnly":"Attachments only","activity.attachments":{one:"{count} attachment",other:"{count} attachments"},"activity.viewSentBy":"View call #{id}, which sent it","activity.historyRecord":"History record #{id}","activity.viewHistory":"View History #{id} · {role}","activity.emptyMessage":"(empty message)","activity.loadFailed":"Couldn't load the activity","activity.backToTimeline":"Back to the timeline","activity.newestFirst":"Newest first","activity.refresh":"Refresh the activity","activity.reading":"Loading…","activity.columnChat":"Chat","activity.columnTime":"Time","activity.loading":"Loading the activity…","activity.empty":"No activity yet","activity.newer":"Newer","activity.page":"Page {page}","activity.older":"Older","activity.historyDetail":"History record details","activity.chatDetail":"Chat message details","activity.toolCall":"Called {name}","activity.toolResult":"{name} · result","activity.toolFailed":"{name} · failed","activity.images":{one:"{count} image",other:"{count} images"},"bot.newName":"New Bot","bot.newNameN":"New Bot {n}"},C8={"npc.toolbar":"NPC prototype","npc.replay":"Replay the turn","npc.mood":"Base mood","npc.mood.normal":"Normal","npc.mood.happy":"Happy","npc.mood.sad":"Sad","npc.mood.angry":"Angry","npc.mood.dizzy":"Dizzy","npc.poses":"Animations","npc.pose.sleep":"Sleeping","npc.pose.idle":"Idle","npc.pose.think":"Thinking","npc.pose.mutter":"Talking to itself","npc.pose.say":"Talking to you","npc.pose.ask":"Waiting for you","npc.pose.read":"Reading a file","npc.pose.work":"Editing, running","npc.pose.compact":"Compacting","npc.pose.busy":"Retrying","npc.pose.failed":"Failed","npc.pose.done":"Done","npc.pose.groom":"Grooming","npc.expand":"Show every step","npc.collapse":"Collapse","npc.panel":"This turn","npc.state.running":"Running","npc.state.ok":"Done","npc.state.failed":"Failed","npc.duration":"{value}s","npc.done":"Done · {duration}","npc.mutter":"({text})","npc.to":"→ {chat}","npc.step.think":"Thinking","npc.step.mutter":"Talked to itself","npc.step.read.running":"Reading {target}","npc.step.read.ok":"Read {target}","npc.step.write.running":"Editing {target}","npc.step.write.ok":"Edited {target}","npc.step.run.running":"Running {target}","npc.step.run.ok":"Ran {target}","npc.step.run.failed":"{target} failed","npc.step.compact.running":"Tidying up the context","npc.step.compact.ok":"Tidied up the context","npc.step.ask.running":"Waiting for your answer","npc.step.ask.ok":"You chose “{answer}”","npc.step.say.running":"Replying to you","npc.step.say.ok":"Replied to you","npc.step.post.running":"Posting to {chat}","npc.step.post.ok":"Posted to {chat}","npc.demo.think1":"fish says the thread pane jumps when it opens. The scroll may run at the wrong moment. Let me first see how ThreadPane scrolls.","npc.demo.think2":"It scrolls before the replies have their height. Scrolling after layout should fix it. The reply count belongs in the dependencies too.","npc.demo.mutter1":"Edited. Let me run the build first.","npc.demo.mutter2":"Hmm… the types don't pass; the ref can be null.","npc.demo.channel":"dev","npc.demo.post":"The thread pane no longer jumps when it opens, and the build passes. Waiting for fish to confirm.","npc.demo.question":"Fixed. Should I also update the screenshots in the docs?","npc.demo.yes":"Yes, update them","npc.demo.no":"Not now","npc.demo.replyYes":"Done: the thread pane now opens at the newest reply without jumping, and the screenshots in the docs are new. The build passes.","npc.demo.replyNo":"Done: the thread pane now opens at the newest reply without jumping. The build passes; I left the screenshots as they are.","npc.live.omitted":"… {count} characters left out …","npc.live.tokens":"Context: {before} → {after} tokens","npc.live.compact.running":"Tidying up the context","npc.live.compact.ok":"Tidied up the context","npc.live.compact.failed":"Couldn't tidy up the context","npc.live.retry.running":"Retrying ({attempt}/{max})","npc.live.retry.ok":"Retried","npc.live.retry.failed":"Retrying failed","npc.live.read.running":"Reading {target}","npc.live.read.ok":"Read {target}","npc.live.read.failed":"Couldn't read {target}","npc.live.edit.running":"Editing {target}","npc.live.edit.ok":"Edited {target}","npc.live.edit.failed":"Couldn't edit {target}","npc.live.write.running":"Writing {target}","npc.live.write.ok":"Wrote {target}","npc.live.write.failed":"Couldn't write {target}","npc.live.run.running":"Running {target}","npc.live.run.ok":"Ran {target}","npc.live.run.failed":"{target} failed","npc.live.script.running":"Running a script","npc.live.script.ok":"Ran a script","npc.live.script.failed":"The script failed","npc.live.tool.running":"Using {tool}","npc.live.tool.ok":"Used {tool}","npc.live.tool.failed":"{tool} failed","npc.live.sendFailed":"The message didn't go out","npc.live.switch.running":"Switching work environment","npc.live.switch.ok":"Switched work environment","npc.live.switch.failed":"Couldn't switch work environment","npc.live.askFailed":"The question didn't go out","npc.live.askClosed":"The question was closed","npc.live.answerBelow":"Answer on the card below","npc.live.answerIn":"Answer in {chat}","npc.live.browse.running":"Looking through {chat}","npc.live.browse.ok":"Looked through {chat}","npc.live.browseAll.running":"Looking through the chats","npc.live.browseAll.ok":"Looked through the chats","npc.done.interrupted":"Interrupted · {duration}","npc.done.failed":"The turn failed · {duration}"},N8={"environment.title":"Work environment","environment.own":"Docker sandbox","environment.container":"Container","environment.image":"Image","environment.mount":"Workspace mount","environment.external":"External environments","environment.accessFailed":"Couldn't change access","environment.state.preparing":"Preparing","environment.state.running":"Running","environment.state.stopped":"Stopped","environment.state.failed":"Failed to start","environment.state.unavailable":"Unavailable","environment.unavailable":"{why}, so a sandbox can't be started for this Bot (without one, it can't read or write files, run commands and so on).","environment.unavailable.missing":"Docker isn't installed here","environment.unavailable.stopped":"The Docker service isn't running here","environment.unavailable.denied":"No permission to use Docker here","environment.unavailable.failed":"Docker can't be used here","environment.start":"Start","environment.starting":"Starting…","environment.stop":"Stop","environment.stopping":"Stopping…","environment.stopTitle":"Stop {name}'s sandbox?","environment.stopBody":"Programs running in the sandbox will be closed. Installed software and workspace files are kept.","environment.stopConfirm":"Stop","environment.reset":"Reset…","environment.resetTitle":"Reset {name}'s sandbox?","environment.resetBody":"Software installed in the sandbox will be removed. Workspace files are kept.","environment.resetConfirm":"Reset","environment.resetBodyVm":"Software installed in the sandbox, and Docker's images, containers and volumes there, will be removed. Workspace files are kept.","environment.restartNote":"The new size takes effect when the sandbox next starts.","environment.restart":"Restart now","environment.restartTitle":"Restart {name}'s sandbox?","environment.restartBody":"Programs running in the sandbox will be closed. Installed software and workspace files are kept.","environment.restartConfirm":"Restart","environment.type":"Type","environment.type.container":"Container","environment.type.vm":"Virtual machine","environment.type.checking":"Checking whether this computer can run virtual machines…","environment.type.unavailable":"This computer can't run virtual machine sandboxes: {why}.","environment.type.why.no_kata":"Kata isn't installed","environment.type.why.no_kvm":"it has no KVM","environment.type.why.busy":"hardware virtualization is taken by other virtual machine software (such as VirtualBox)","environment.type.why.failed":"a trial virtual machine didn't start","environment.type.recheck":"Check again","environment.type.vmTitle":"Make {name}'s sandbox a virtual machine?","environment.type.vmBody":"The sandbox is made afresh, with Docker and Docker Compose inside: workspace files are kept, software installed in it is removed. The first switch builds its image, which can take a few minutes.","environment.type.containerTitle":"Make {name}'s sandbox a container?","environment.type.containerBody":"The sandbox is made afresh: workspace files are kept; software installed in it, and Docker's images, containers and volumes there, are removed.","environment.type.confirm":"Switch","environment.type.switching":"Switching…","environment.limits":"Resource limits","environment.limits.edit":"Change resource limits","environment.limits.none":"No limits","environment.limits.unlimited":"Unlimited","environment.limits.memory":"Memory {value}","environment.limits.cpu":"CPU {value}","environment.limits.cores":"{count} cores","environment.limits.oneCore":"1 core","environment.limits.memoryField":"Memory (GB)","environment.limits.cpuField":"CPU (cores)","environment.limits.machine":"This machine: {cpus} cores · {memory} GB","environment.limits.below":"Below the {usage} in use now. After saving, some programs in the sandbox may be ended.","environment.limits.failed":"Couldn't change the resource limits","environment.limits.vm":"Size","environment.limits.vmEdit":"Change the virtual machine's size","environment.limits.vmDefault":"Empty fields mean the default: 4 GB and 2 cores.","environment.limits.vmLater":"It is running: the new size takes effect when it next starts.","environment.usage":"Usage","environment.usage.value":"Memory {memory} · CPU {cpu}","error.typeInvalid":"A sandbox is a container or a virtual machine.","error.vmSizeInvalid":"A virtual machine can have 1–{memory} GB of memory and 1–{cpus} CPUs.","error.vmUnavailable":"This computer can't run virtual machine sandboxes right now.","error.limitsInvalid":"Memory can be 0.25–{memory} GB and CPU 0.1–{cpus} cores, or unlimited."},E8={"connection.lan":"LAN access","connection.localOnly":"This computer only","connection.localOnlyHint":"Jarvy accepts connections from this computer only. To use it from other devices on your network, restart it with {flag}.","connection.addresses":"Addresses","connection.copy":"Copy address","connection.root":"Security certificate","connection.download":"Download certificate","connection.fingerprint":"SHA-256 fingerprint","connection.fingerprintSha1":"SHA-1 fingerprint","connection.howTo":"Installation instructions","connection.howMac":"Mac: Open the certificate to add it to Keychain Access, double-click it, then under Trust set When using this certificate to Always Trust.","connection.howWindows":"Windows: Open the certificate, click Install Certificate, choose Place all certificates in the following store, then pick Trusted Root Certification Authorities. The Thumbprint on the certificate's Details tab is the SHA-1 fingerprint above.","connection.howIos":"iPhone and iPad: Download it in Safari, install it in Settings › General › VPN & Device Management, then turn on full trust in Settings › General › About › Certificate Trust Settings.","connection.howAndroid":"Android: Download it, then search Settings for CA certificate and install it. Where it lives varies by phone, usually under Security or Encryption & credentials.","connection.howRestart":"After installing, quit the browser completely and open it again so it picks up the certificate.","connection.allowHttp":"Allow HTTP access","connection.allowHttpHint":"Passwords and conversations travel in plain text; turn this on only on a network you trust.","connection.insecure":"This connection isn't encrypted. Others on the same network could see passwords and conversations.","connection.useHttps":"Switch to HTTPS"},T8={"secrets.add":"Add secret","secrets.empty":"No secrets yet","secrets.name":"Name","secrets.description":"Description","secrets.descriptionPlaceholder":"Optional, such as what it's for","secrets.value":"Value","secrets.newValue":"New value","secrets.newValuePlaceholder":"Leave empty to keep the current value","secrets.showValue":"Show value","secrets.hideValue":"Hide value","secrets.shortValue":"This value is shorter than 8 characters and may not be hidden when it appears in what Bots see.","secrets.noDescription":"No description","secrets.grantCount":{one:"Granted to {count} Bot",other:"Granted to {count} Bots"},"secrets.notGranted":"Not granted","secrets.unreadable":"Can't decrypt","secrets.unreadableHint":"This value was encrypted with a different master key and can't be read. Enter it again.","secrets.fingerprint":"Fingerprint","secrets.updated":"Updated {time}","secrets.usedCount":{one:"Used {count} time",other:"Used {count} times"},"secrets.neverUsed":"Never used","secrets.grants":"Bots that can use it","secrets.noBots":"No Bots yet.","secrets.addBots":"Add Bots","secrets.noGrants":"No Bot can use it yet.","secrets.searchBots":"Search Bots","secrets.noMatch":"No matching Bots","secrets.allGranted":"Every Bot can already use it.","secrets.revoke":"Remove {name}","secrets.onceTag":"This time only","secrets.edit":"Edit secret","secrets.uses":"Recent uses","secrets.noUses":"No uses yet.","secrets.deletedBot":"Deleted Bot","secrets.useCommand":"Command","secrets.useSsh":"SSH signature","secrets.delete":"Delete secret","secrets.deleteTitle":"Delete {name}?","secrets.deleteBody":"Bots that were granted it can no longer use it. Its use history is kept.","secrets.deleteConfirm":"Delete","secrets.masterKey":"Master key","secrets.keyFile":"Location","secrets.keyHint":"Copy this file too when you back up or move Jarvy; without it, secrets and API keys must be entered again.","secretCard.title":"Request to use the secret {name}","secretCard.valuePlaceholder":"Paste or type the value","secretCard.insecure":"This connection isn't encrypted, so others on the same network could see the value. Switch to HTTPS before entering it.","secretCard.exists":"This secret is already saved in Settings › Secrets.","secretCard.replace":"Replace value","secretCard.keepValue":"Use the saved value","secretCard.unreadable":"The saved value can't be decrypted. Enter it again.","secretCard.value":"Value","secretCard.valueHint":"It's saved encrypted in Settings › Secrets and never shown in the chat.","secretCard.scope":"How long the Bot can use it","secretCard.always":"Always allow","secretCard.alwaysHint":"Until you remove it in Settings › Secrets","secretCard.once":"This time only","secretCard.onceHint":"Ends when the Bot finishes its current task","secretCard.allow":"Allow","secretCard.saveAllow":"Save and allow","secretCard.decline":"Decline","secretCard.allowedAlways":"Allowed {name}. You can remove it in Settings › Secrets","secretCard.allowedOnce":"Allowed {name} this time only","secretCard.declined":"Declined {name}","secretCard.ignored":"Ignored the request for {name}","error.secretNameInvalid":"Use capital letters, digits and underscores, starting with a letter.","error.secretNameTaken":"Another secret already has this name.","error.secretValueMissing":"Enter a value.","error.secretValueTooLong":"The value is too long. The limit is 16 KB.","error.secretDescriptionInvalid":"The description must be a single line of up to 200 characters.","error.secretMissing":"Can't find this secret. It may have been deleted.","error.credentialUnreadable":"The saved API key can't be decrypted. Enter it again in Settings › Models."},A8={"settings.machines":"Environments","machines.add":"Add machine","machines.empty":"No machines yet","machines.host":"Host","machines.hostPlaceholder":"192.168.1.20 or dev.example.com","machines.port":"Port","machines.user":"User","machines.name":"Name","machines.directory":"Start directory","machines.description":"Description","machines.descriptionPlaceholder":"Purpose, installed software, things to note","machines.directoryPlaceholder":"Home","machines.next":"Next","machines.scanning":"Connecting…","machines.fingerprint":"Host fingerprint","machines.fingerprintHint":"Check it against ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub on that machine before going on.","machines.password":"Password","machines.passwordHint":"Used to install the key Jarvy generates. If the machine doesn't support key login, the password is stored encrypted and used to log in.","machines.byPassword":"Password","machines.byKey":"Public key","machines.publicKey":"Public key","machines.keyHint":"Add it to ~/.ssh/authorized_keys for {user}, then verify.","machines.copy":"Copy","machines.copied":"Copied","machines.verify":"Verify and add","machines.verifying":"Verifying…","machines.login":"Login","machines.loginKey":"Key","machines.loginPassword":"Password","machines.passwordLogin":"This machine doesn't support key login, so the saved password is used. Enable PubkeyAuthentication to switch to key login.","machines.newPassword":"New password","machines.updatePassword":"Update password","machines.passwordUpdated":"Password updated.","machines.useKey":"Switch to key login","machines.usingKey":"Switched to key login. The saved password was deleted.","machines.stillPassword":"This machine still doesn't accept Jarvy's key.","machines.connect":"Connect and add","machines.connecting":"Adding…","machines.back":"Back","machines.check":"Check fingerprint","machines.checking":"Checking…","machines.unchanged":"The fingerprint hasn't changed.","machines.changed":"The machine now shows a different fingerprint. If it was reinstalled or replaced, check the new one and accept it; otherwise something may be posing as it.","machines.trust":"Accept new fingerprint","machines.delete":"Delete machine","machines.deleteTitle":"Delete {name}?","machines.deleteBody":"Jarvy's key is removed from the machine first. Bots working there go back to their default environment.","machines.deleteConfirm":"Delete","machines.forceTitle":"Can't reach {name}","machines.forceBody":"Jarvy's key stays in ~/.ssh/authorized_keys there, on the line ending in {comment}; you can remove it later. Delete anyway?","machines.forceConfirm":"Delete anyway","machineCard.title":"Request to add {name}","machineCard.existing":"This machine is already in Settings › Environments.","machineCard.add":"Connect and add","machineCard.allow":"Allow","machineCard.decline":"Decline","machineCard.added":"Added {name}","machineCard.granted":"Allowed {name}","machineCard.declined":"Declined to add {name}","machineCard.ignored":"Ignored the request for {name}","environment.awayMachine":"Using {name}","error.machineMissing":"This machine wasn't found. It may have been deleted.","error.machineNameTaken":"Another machine already has this name.","error.sshPasswordMissing":"Enter the password.","error.sshKeyUnreadable":"This machine's key can't be decrypted with the current master key. Delete the machine and add it again.","error.sshBadHost":"The host must be a host name or an IP address.","error.sshBadUser":"Enter a user name on that machine.","error.sshBadPort":"The port must be 1–65535.","error.sshBadDirectory":"The start directory must be an absolute path or start with ~/.","error.sshAuthFailed":"Incorrect user name or password.","error.sshPasswordRefused":"This machine doesn't support password login. Use a public key instead.","error.sshKeyRefused":"This machine didn't accept Jarvy's public key. Make sure it's in ~/.ssh/authorized_keys and that sshd has PubkeyAuthentication enabled.","error.sshKeyExpired":"This public key is no longer valid. Get a new one and add it to the machine.","error.sshUnreachable":"Can't reach this machine. Check the host, port and network.","error.sshHostKeyChanged":"The machine shows a different fingerprint from the accepted one, so Jarvy didn't connect.","error.sshUnsupported":"Only Linux and macOS are supported for now.","error.sshFailed":"SSH failed: {detail}"},M8={"tasks.title":"Scheduled tasks","tasks.empty":"No scheduled tasks","tasks.add":"New task","tasks.edit":"Edit","tasks.delete":"Delete","tasks.deleteTitle":"Delete “{name}”?","tasks.deleteBody":"It won't run again. To stop it for a while, turn it off instead.","tasks.toggle":"Turn {name} on or off","tasks.next":"Next {time}","tasks.paused":"Off","tasks.done":"Done","tasks.newTitle":"New task","tasks.editTitle":"Edit task","tasks.name":"Name","tasks.namePlaceholder":"Morning news","tasks.instruction":"What to do","tasks.instructionPlaceholder":"Read the front pages of the news sites I follow and send me the three stories worth reading, with a line on each.","tasks.when":"When","tasks.kind.once":"Once","tasks.kind.every":"Repeat","tasks.kind.daily":"Daily","tasks.kind.weekly":"Weekly","tasks.at":"Date and time","tasks.everyCount":"Every","tasks.unit.minutes":"minutes","tasks.unit.hours":"hours","tasks.time":"Time","tasks.weekday":"Day","tasks.minimum":"5 minutes at the least.","tasks.saveFailed":"Couldn't save the task","tasks.changeFailed":"Couldn't change the task","tasks.loadFailed":"Couldn't load the tasks","tasks.schedule.once":"Once, {time}","tasks.schedule.minutes":{one:"Every minute",other:"Every {count} minutes"},"tasks.schedule.hours":{one:"Every hour",other:"Every {count} hours"},"tasks.schedule.daily":"Daily at {time}","tasks.schedule.weekly":"Every {day} at {time}","error.taskTimePast":"That time has already passed. Pick a time in the future.","error.taskScheduleInvalid":"Check the schedule: every 5 minutes at the least, and a valid time of day.","error.taskInvalid":"Give the task a name and say what to do."},_8={"ports.title":"Port forwarding","ports.empty":"No forwarded ports","ports.open":"Open {name}","ports.port":"Port {port}","ports.sandboxPort":"Sandbox port","ports.link":"Link","ports.linkOther":"Other address","ports.copy":"Copy link","ports.state":"State","ports.state.live":"Running","ports.state.local":"Local only","ports.state.idle":"Not listening","ports.state.stopped":"Sandbox stopped","ports.state.unknown":"Unknown state","ports.hint.local":"The service listens only on 127.0.0.1 in the sandbox and can't be reached through the link. Ask the Bot to listen on 0.0.0.0.","ports.hint.idle":"No service in the sandbox listens on this port.","ports.hint.stopped":"The link works once the sandbox starts.","ports.stop":"Stop forwarding","ports.stopTitle":"Stop forwarding “{name}”?","ports.stopBody":"Its link stops working. The service keeps running in the sandbox.","ports.back":"Back","ports.loadFailed":"Couldn't load the forwarded ports.","ports.changeFailed":"Couldn't stop forwarding the port.","ports.range":"Forwarding ports","ports.rangeHint":"When a Bot publishes a port, Jarvy forwards it from a port in this range. Ports already forwarded keep theirs.","ports.rangeFrom":"From","ports.rangeTo":"To","ports.rangeSaved":"Saved","error.portInvalid":"That port can't be forwarded.","error.portMissing":"That port isn't forwarded.","error.portRangeInvalid":"Use ports from 1024 to 65535, the first no larger than the last, at most 1000 of them.","error.portRangeOwn":"The range can't include Jarvy's own port.","error.portsExhausted":"No free port left in {from}–{to}. Widen the range in Settings › Network."},R8={...b8,...j8,...w8,...k8,...S8,...C8,...N8,...E8,...T8,...A8,...M8,..._8},O8={"locale.name":"中文","locale.short":"中","common.close":"关闭","common.continue":"继续","common.failed":"操作失败,请重试。","common.listSeparator":",","login.subtitle":"登录以继续","login.form":"登录","login.username":"用户名","login.password":"密码","login.showPassword":"显示密码","login.hidePassword":"隐藏密码","login.submit":"登录","login.submitting":"正在登录…","login.wrong":"用户名或密码不正确。","login.tooMany":"尝试次数过多,请稍后再试。","login.offline":"无法连接到 Jarvy,请检查网络后重试。","login.themeLight":"切换为浅色主题","login.themeDark":"切换为深色主题","general.language":"语言","general.theme":"主题","general.light":"浅色","general.dark":"深色","about.tagline":"你和 AI Bot 一起工作的群聊,完整运行在你自己的电脑上。","about.version":"版本 {version}","about.source":"源代码","about.package":"npm 包","about.license":"许可证","about.notices":"第三方声明","status.signedIn":"已登录","status.signedOut":"未登录","status.configured":"已配置","status.notConfigured":"未配置","account.menu":"账户菜单","account.menuFor":"{name} 的账户菜单","account.toggleTheme":"切换主题","account.signOut":"退出登录","entry.menu":"会话操作","entry.pin":"置顶","entry.unpin":"取消置顶","entry.mute":"免打扰","entry.unmute":"取消免打扰","entry.botInfo":"Bot 信息","entry.channelInfo":"频道信息","entry.deleteBot":"删除 Bot","entry.deleteChannel":"删除频道","hint.reaction":"{actor} 用 {emoji} 回应了你的消息","hint.reactionInThread":"{actor} 用 {emoji} 回应了你在「{title}」中的消息","hint.threadSummary":"{actor} 更新了线程「{title}」的摘要","hint.summary":"{actor} 更新了线程摘要","hint.notice":"{actor} 更新了公告","app.connecting":"正在连接 Jarvy…","app.channelDeleted":"频道已删除","app.botDeleted":"{name} 已删除","app.notInChannel":{one:"{names} 不在本频道,没有收到通知",other:"{names} 不在本频道,没有收到通知"},"app.memberAdded":"{name} 已加入 #{channel}","app.sourceGone":"原消息已不存在","ui.closeNamed":"关闭{name}","ui.copied":"已复制","ui.copyFailed":"复制失败","ui.copyCode":"复制代码","ui.image":"[图片:{alt}]","ui.imageHidden":"外部图片已隐藏","app.deleteChannelTitle":"删除频道 #{name}","app.deleteChannelBody":"频道里的消息、线程和附件都会被删除,且无法恢复。","app.resizePane":"拖动调整侧栏宽度","common.cancel":"取消","common.save":"保存","common.create":"创建","common.delete":"删除","common.retry":"重试","common.back":"返回","common.add":"添加","common.saveFailed":"保存失败","common.openNav":"打开会话列表","common.you":"你","common.member":"成员","common.noMatch":"没有匹配的成员","common.searchMembers":"搜索成员","common.attachment":"[附件]","actions.reply":"回复这条消息","actions.react":"添加表情回应","actions.pickEmoji":"选择表情","actions.recent":"最近使用","actions.searchEmoji":"搜索表情","actions.noEmoji":"没有找到表情","actions.emoji.Smileys & Emotion":"表情和情绪","actions.emoji.People & Body":"人物和手势","actions.emoji.Animals & Nature":"动物和自然","actions.emoji.Food & Drink":"食物和饮料","actions.emoji.Travel & Places":"旅行和地点","actions.emoji.Activities":"活动","actions.emoji.Objects":"物品","actions.emoji.Symbols":"符号","actions.emoji.Flags":"旗帜","actions.fold":"折叠成一行","actions.unfold":"取消折叠","fold.folded":"已折叠","fold.more":"展开全文","fold.less":"收起","dialogs.candidates":"可添加的成员","dialogs.allInside":"所有成员都已在频道中","dialogs.addCount":"添加({count})","dialogs.addFailed":"添加成员失败","dialogs.optional":"可选","dialogs.deleteSection":"删除分组「{name}」?其中的频道会移到「频道」下。","dialogs.deleteFailed":"删除失败,请重试","dialogs.editSection":"编辑频道分组","dialogs.sectionName":"分组名称","dialogs.newSection":"新分组","api.offline":"无法连接到 Jarvy,请检查网络后重试。","api.historyFailed":"无法加载聊天记录,请重试。","error.autoconfigModel":"请填写模型 ID。","error.autoconfigSource":"所选的配置来源无效,请重新选择。","error.botMissing":"找不到这个 Bot,它可能已被删除。","error.agentUndeletable":"主 Bot 不能删除,但可以改名或停止。","error.chatAccessChanged":"你在这个聊天中的权限已变化,请刷新后重试。","error.computerFailed":"沙箱启动失败。","error.computerMissing":"这个 Bot 没有沙箱。","error.dockerUnavailable":"运行 Jarvy 的电脑上没有可用的 Docker。","error.fileTooLarge":"附件不能超过 {limit}。","error.connectionMissing":"找不到这个模型连接,它可能已被删除。","error.credentialChanged":"凭证已更改,请重试。","error.credentialScope":"凭证连接不匹配。","error.credentialsMissing":"请先配置此模型连接的凭证。","error.dataLocked":"Jarvy 已经在运行,或数据目录被其他程序占用。","error.discoveryFormat":"这个地址返回的不是所选协议的模型列表,请检查 API URL 和协议。","error.discoveryHttp":"获取模型失败:HTTP {status}。","error.discoveryKey":"请填写 API Key。","error.discoveryProtocol":"所选协议不支持获取模型列表,请手动添加模型。","error.discoveryUrl":"API URL 无效。","error.discoveryUrlMissing":"请填写 API URL。","error.historyMissing":"找不到这条 History 记录。","error.invalidCredential":"凭证格式无效。","error.invalidRun":"Bot 的状态刚刚变化,请刷新后重试。","error.loginInput":"请填写授权码或回调地址。","error.loginOption":"请选择登录方式。","error.loginStep":"登录步骤已变化,请重新开始。","error.loginFailed":"登录操作失败,请刷新后重试。","error.messageMissing":"找不到这条消息,它可能已被删除。","error.modelIncomplete":"请补全模型的上下文窗口和最大输出。","error.modelMissing":"找不到这个模型,它可能已被移除。","error.modelRequestFailed":"模型请求失败:{detail}","error.modelRequired":"请先为 Bot 选择模型。","error.modelSwitchUncertain":"模型切换未完成,请重新选择模型。","error.nameTaken":"名称已被其他成员使用。","error.providerNameTaken":"已有同名的 Provider。","error.resetCustom":"自定义 Provider 没有系统默认的模型,无法重置。","error.connectionInUse":"{bots} 正在使用这个 Provider 的模型,请先换成其他模型再删除。","error.questionClosed":"问题已结束。","error.questionExpired":"这个问题已忽略,Bot 不再等待回答。","error.runtimeFailed":"Bot 运行失败,请检查它的模型设置后重试。","error.sessionCorrupt":"Bot 启动失败(会话文件无法读取)。","error.sessionMismatch":"Bot 启动失败(会话文件不匹配)。","error.sessionMissing":"Bot 启动失败(会话文件缺失)。","error.sessionPath":"Bot 启动失败(会话文件路径无效)。","error.stopping":"Jarvy 正在关闭,请稍后再试。","error.thinkingFormat":"不支持此思考格式。","error.toolsMissing":"Bot 的工具加载失败,请重启 Bot 后重试。","error.unsafeReplay":"上次中断时 Bot 可能已经执行了操作,为避免重复,不会自动重试。","error.discoveryUnreachable":"无法连接 {host},请检查 API URL。","color.gray":"灰","color.blue":"蓝","color.green":"绿","color.amber":"琥珀","color.rose":"粉","color.violet":"紫","avatar.working":"工作中","avatar.openInfo":"查看 {name} 的 Bot 信息"},D8={"settings.title":"设置","settings.sections":"设置分类","settings.general":"通用","settings.models":"模型","settings.usage":"用量","settings.network":"网络","settings.secrets":"密钥","settings.about":"关于","group.custom":"自定义 API","group.subscription":"订阅服务","group.apiKey":"API Key","models.add":"添加 Provider","models.empty":"还没有模型连接","models.count":{one:"{count} 个模型",other:"{count} 个模型"},"models.none":"尚未添加模型","picker.back":"返回模型页面","picker.search":"搜索 Provider","picker.searchPlaceholder":"搜索 Provider…","picker.keyHint":{one:"API Key · {count} 个模型",other:"API Key · {count} 个模型"},"picker.loading":"正在加载 Provider…","picker.retry":"重试","picker.noMatch":"没有匹配的 Provider","editor.back":"返回 Provider 列表","editor.delete":"删除 Provider","editor.connection":"连接","editor.providerName":"Provider 名称","editor.name":"连接名称","editor.protocol":"API 协议","editor.url":"API URL","editor.defaultUrl":"使用 Provider 默认地址","editor.key":"API Key","editor.keyPlaceholder":"输入 API Key","editor.keySaved":"已保存,留空则不修改","editor.settings":"连接设置","editor.models":"模型列表","editor.selected":"已选 {selected} / {total}","editor.fetch":"获取模型列表","editor.fetching":"正在获取…","editor.fetched":{one:"获取到 {count} 个模型",other:"获取到 {count} 个模型"},"editor.noneReturned":"此端点没有返回模型","editor.fetchFailed":"获取模型列表失败","editor.loadingCatalog":"正在加载模型目录…","editor.autoSelected":"自动配置已选","editor.addManually":"手动添加","editor.filter":"筛选模型","editor.filterPlaceholder":"筛选模型…","editor.selectVisible":"全选当前结果","editor.empty":"还没有模型","editor.emptyCustom":"获取模型列表,或手动添加模型。","editor.emptyBuiltin":"可以手动添加模型。","editor.autoSummary":"{parts};保存后生效","editor.autoMatched":{one:"已配置 {count} 个",other:"已配置 {count} 个"},"editor.autoChoose":{one:"{count} 个需选择来源",other:"{count} 个需选择来源"},"editor.autoNone":{one:"{count} 个在目录中未找到",other:"{count} 个在目录中未找到"},"editor.autoFailed":{one:"{count} 个失败",other:"{count} 个失败"},"editor.confirmDelete":"删除「{name}」及其模型?","editor.deleteFailed":"删除失败","editor.saveFailed":"保存未完成","editor.saved":"已保存","editor.reset":"重置模型","editor.resetTitle":"将模型重置为系统默认?","editor.resetModels":{one:"{count} 个模型将恢复为系统默认设置。",other:"{count} 个模型将恢复为系统默认设置。"},"editor.resetRemoves":{one:"{count} 个不在系统默认中的模型将被移除:{names}。",other:"{count} 个不在系统默认中的模型将被移除:{names}。"},"editor.resetBots":{one:"{bots} 正在使用将被移除的模型,重置后需要重新选择模型。",other:"{bots} 正在使用将被移除的模型,重置后需要重新选择模型。"},"editor.resetKeeps":"API URL 和协议将恢复默认,登录信息和 API Key 会保留。未保存的修改将被丢弃。","editor.resetConfirm":"重置","editor.resetDone":"已重置为系统默认","editor.resetFailed":"重置失败","editor.saving":"正在保存…","editor.save":"保存","card.defaultProtocol":"使用 Provider 默认协议","card.modelId":"模型 ID","card.modelName":"模型名称","card.optional":"可选","card.newModel":"新模型","card.enterId":"填写模型 ID","card.use":"使用 {name}","card.remove":"移除 {name}","card.image":"图片","card.reasoning":"推理","card.capabilities":"能力","card.reasoningThinking":"推理 / 思考","card.imageInput":"图片输入","card.specs":"模型规格","card.hidePrices":"收起价格","card.editPrices":"编辑价格","card.context":"上下文窗口 · tokens","card.maxOutput":"最大输出 · tokens","card.costTitle":"每百万 tokens 价格","card.costInput":"输入","card.costOutput":"输出","card.costCacheRead":"缓存读取","card.costCacheWrite":"缓存写入","card.notProvided":"未提供","card.advanced":"高级设置","card.apiOverride":"指定 API 协议","card.headers":"请求头","card.headerSaved":"已保存,留空则不修改","card.addHeader":"添加请求头","card.removeHeader":"移除请求头","card.compat":"兼容参数 · compat","card.jsonObject":"请输入 JSON 对象","auto.run":"自动配置","auto.pending":"正在配置…","auto.failed":"自动配置失败","auto.tagChoose":"需选择配置来源","auto.tagNone":"目录中未找到","auto.official":"原厂","auto.matched":"已按 {source}{note} 填入配置{suffix}","auto.reseller":"(来自转售目录,非原厂)","auto.applied":";保存后生效。","auto.apiMismatch":"目录中此模型使用 {api} 协议,与当前协议不同,思考格式和兼容参数未填入。","auto.changeSource":"更换来源","auto.multiple":"同名模型有多个原厂来源,请选择:","auto.similar":"目录中没有 {modelId},以下是相似模型:","auto.notFound":"目录中没有找到此模型,请手动填写。","thinking.title":"思考","thinking.format":"思考格式","thinking.protocolDefault":"协议默认","thinking.onlyCompletions":"仅 OpenAI Chat Completions 协议使用","thinking.levels":"思考档位","thinking.level.off":"关闭","thinking.level.minimal":"极低","thinking.level.low":"低","thinking.level.medium":"中","thinking.level.high":"高","thinking.level.xhigh":"超高","thinking.level.max":"最高","thinking.levelName":"{level}档位","thinking.levelValue":"{level}档位发送值","thinking.supportedDefault":"支持(默认值)","thinking.unsupported":"不支持","thinking.supportedCustom":"支持,发送指定值","thinking.supported":"可选档位:{levels}","auth.title":"账户授权","auth.running":"正在授权","auth.openPage":"打开授权页面","auth.code":"验证码:{code}","auth.browser":"浏览器登录(OAuth)","auth.deviceCode":"设备码登录","auth.redirectFull":"完整回调地址","auth.redirectOrCode":"授权码或回调地址","auth.manualNote":"完成授权后若未自动返回,请粘贴回调地址。","auth.waiting":"等待授权完成…","auth.cancel":"取消授权","auth.configureCredential":"配置凭证","auth.signInAgain":"重新登录","auth.signIn":"登录账户","auth.removeCredential":"移除凭证","auth.signOut":"退出登录","auth.statusFailed":"无法获取登录状态","auth.refresh":"刷新状态","picker.loadFailed":"无法加载 Provider 列表"},z8={"sidebar.label":"会话列表","sidebar.create":"打开新建菜单","sidebar.createMenu":"新建菜单","sidebar.newChannel":"新建频道","sidebar.newSection":"新建频道分组","sidebar.newBot":"新建 Bot","sidebar.alerts":"{count} 条发给你的未读","sidebar.unread":"{count} 条未读","sidebar.said":"{name}:{text}","sidebar.atMe":"[有人@我]","sidebar.more":"{name} 的更多操作","sidebar.asking":"(等你回答)","sidebar.working":"(工作中)","sidebar.pinned":"已置顶","sidebar.muted":"免打扰","sidebar.hasUnread":"有未读","sidebar.editSection":"编辑分组:{name}","sidebar.search":"搜索会话和消息","sidebar.results":"搜索结果","sidebar.chats":"会话","sidebar.nav":"频道与私信","sidebar.followed":"我关注的线程","sidebar.channels":"频道","sidebar.dms":"私信","sidebar.noDms":"暂无私信","search.title":"搜索","search.paneLabel":"聊天内搜索","search.inThread":"本线程","search.inDm":"本私信","search.close":"关闭搜索","search.placeholder":"搜索消息","search.channelPlaceholder":"搜索本频道及其线程中的消息","search.prompt":"输入关键词","search.searching":"正在搜索…","search.noMessages":"没有找到消息","search.count":{one:"{count} 条,最新在前",other:"{count} 条,最新在前"},"search.countLatest":"显示最近 {count} 条","search.showAll":"查看全部 {count} 条","search.threads":"线程","search.channels":"频道(主题与公告)","search.messages":"消息","search.channel":"频道","member.unknown":"未知成员","member.deleted":"{name}(已删除)","members.view":"查看 {name}","members.remove":"移出 {name}","members.count":{one:"{count} 位成员",other:"{count} 位成员"},"members.people":"用户","members.removeTitle":"把 {name} 移出 #{channel}","members.removeBody":"移出后,对方将无法再收到此频道的消息。","members.removeConfirm":"移出","chat.area":"对话区域","chat.botDms":"{name} 与其他 Bot 的私信","chat.botStatus":"Bot 状态","chat.transcript":"聊天记录","chat.loading":"正在加载…","chat.empty":"暂无消息","chat.start":"与 {name} 开始对话","chat.loadingOlder":"正在加载更早的消息…","chat.toLatest":"回到最新消息","chat.unseen":{one:"{count} 条新消息",other:"{count} 条新消息"},"chat.toChannel":"发消息到 #{name}","chat.toBot":"发消息给 {name}…","chat.pickModel":"为这个 Bot 选择模型后才能发消息","chat.pick":"选择一个会话","channel.infoFor":"频道信息:{name}","channel.membersCount":{one:"成员 {count}",other:"成员 {count}"},"channel.members":"成员","channel.search":"搜索频道消息(Ctrl+F)","channel.threads":"线程","notice.title":"公告","notice.edit":"编辑公告","notice.content":"公告内容","notice.none":"暂无公告","notice.version":"第 {version} 版","chat.newBelow":"以下为新消息","chat.today":"今天","chat.yesterday":"昨天","channel.echo":"回复了线程「{title}」","channel.replies":{one:"{count} 条回复",other:"{count} 条回复"},"channel.threadDone":"已完成","channel.lastReply":"最后回复 {time}","channel.replyInThread":"在线程中回复","info.edit":"编辑{name}","info.memberList":"成员列表","info.back":"返回频道信息","info.addMembers":"添加成员","info.name":"名称","info.newChannel":"新频道","info.topic":"主题","info.noTopic":"暂无主题","info.section":"分组","info.menu":"频道","info.noSection":"无","mention.menu":"提及成员","mention.inThread":"线程中","mention.inChannel":"频道其他成员","mention.outside":"不在本频道中","mention.outsideList":"不在本频道中的成员","mention.searchOutside":"搜索不在本频道中的成员","mention.invites":"选择后会把对方加入本频道","quote.inline":"「{text}」","quote.by":"{name}:","quote.remove":"移除引用:{text}","quote.tooMany":"一条消息最多引用 {count} 段","quote.selection":"选中的文字","quote.copy":"复制","quote.quote":"在回复中引用","ref.label":"{name} 的消息:{text}","ref.dm":"私聊 · {title}","ref.open":"查看消息","composer.busy":"附件上传中,请稍后再添加。","composer.tooMany":"每条消息最多添加 {count} 个附件。","composer.size":"附件不能为空,也不能超过 {limit}。","composer.pasted":"粘贴图片","composer.removeFile":"移除附件:{name}","composer.uploading":"正在上传:{name}","composer.cancelUpload":"取消上传:{name}","composer.replying":"回复","composer.cancelReply":"取消回复","composer.drop":"松开以添加附件","composer.attach":"添加附件","composer.input":"输入消息","composer.send":"发送消息","files.preview":"预览 {name}","files.download":"下载 {name}","files.gone":"附件不存在或已被删除","files.readFailed":"无法打开文件({status})","files.readError":"无法打开文件","files.kindImage":"图片","files.kindSvg":"SVG","files.kindHtml":"HTML","files.kindMarkdown":"Markdown","files.kindText":"文本","files.kindFile":"文件","files.downloadFile":"下载文件","files.showPreview":"预览","files.showSource":"源码","files.showText":"原文","files.openTab":"在新标签页中打开(隔离运行)","files.narrow":"收起预览","files.widen":"扩大预览","files.closePreview":"关闭附件预览","files.running":"脚本正在隔离环境中运行:可以联网,但无法读取 Jarvy 的数据。","files.scripts":{one:"这个 HTML 含有 {count} 段脚本{hosts},当前未运行。运行后脚本可以联网,但无法读取 Jarvy 的数据。",other:"这个 HTML 含有 {count} 段脚本{hosts},当前未运行。运行后脚本可以联网,但无法读取 Jarvy 的数据。"},"files.scriptHosts":"(引用 {hosts})","files.andMore":" 等","files.stop":"停止脚本","files.run":"运行脚本","files.downloadToView":"此文件请下载后查看","files.tooLarge":"文件超过 1 MB,无法在页面内预览。","files.unsupported":"此文件不支持在页面内预览。","files.reading":"正在读取文件…","files.runningTitle":"{name}(运行中)","files.previous":"上一个附件","files.choose":"选择预览文件","files.next":"下一个附件","question.failed":"提交失败","question.dismissed":"已忽略","question.chose":"已选:{answer}","question.dismissLabel":"关闭问题,不回答","question.dismiss":"跳过","question.multiple":"可多选","question.note":"补充说明(可选)","question.own":"或者自己填写…","question.ownLabel":"自己填写回答","question.confirmCount":"确定({count})","question.confirm":"确定","question.send":"发送","directs.back":"返回列表","directs.between":"{name} 与 {other}","directs.readOnly":"只读","files.kindVideo":"视频","files.kindAudio":"音频","files.cantPlay":"当前浏览器无法播放","files.cantPlayHint":"下载后用播放器打开。"},L8={"threadSort.title":"排序","threadSort.current":"排序:{order}","threadSort.updated":"最近更新","threadSort.created":"创建时间","threadSort.status":"状态","threads.list":"线程列表","threads.closeList":"关闭线程列表","threads.byStatus":"按状态筛选","threads.openCount":"进行中 {count}","threads.doneCount":"已完成 {count}","threads.all":"全部","threads.loading":"正在加载…","threads.loadFailed":"无法加载线程","threads.none":"暂无线程","threads.following":"已关注","threads.filter":"筛选","threads.unreadCount":"未读 {count}","threads.unread":"未读","threads.noneUnread":"暂无未读线程","threads.noneOpen":"暂无进行中的线程","threads.noneDone":"暂无已完成的线程","threads.notFollowing":"未关注","threads.pick":"选择一个线程","threads.open":"进行中","thread.rename":"修改标题","thread.title":"线程标题","thread.toggleStatus":"切换状态","thread.summary":"摘要","thread.editSummary":"编辑摘要","thread.conclude":"完成并把摘要发到 #{channel}","thread.addSummary":"添加摘要","thread.sourceElsewhere":"原消息不在这个线程里","thread.label":"线程","thread.backToList":"返回线程列表","thread.inChannel":"在频道中查看","thread.search":"搜索线程消息(Ctrl+F)","thread.followingHint":"新回复会计入未读","thread.notFollowingHint":"新回复不会计入未读","thread.follow":"关注","thread.expand":"展开","thread.collapse":"收起到侧栏","thread.close":"关闭线程","thread.conclusion":"结论:","thread.concluded":"已完成,摘要已发到 #{channel}","thread.noReplies":"暂无回复","thread.toLatest":"回到最新回复","thread.reply":"回复线程"},B8={"usage.title":"用量","usage.range":"时间范围","usage.today":"今天","usage.days":"{count} 天","usage.all":"全部","usage.refresh":"刷新","usage.refreshLabel":"刷新用量","usage.retry":"重试","usage.loading":"正在加载用量…","usage.loadFailed":"用量加载失败","usage.empty":"这段时间没有模型调用","usage.model":"模型","usage.calls":"调用","usage.input":"输入","usage.output":"输出","usage.cacheRead":"缓存读取","usage.cacheWrite":"缓存写入","usage.cost":"费用","usage.total":"合计","usage.byModel":"按模型","usage.byBot":"按 Bot","usage.unpriced":"未设置价格","usage.notePartial":"合计费用不含未设置价格的模型。","usage.noteCosts":"费用不含未设置价格的模型。","activity.error":"运行出错","activity.running":"运行中","activity.reasoning":"思考中","activity.texting":"回复中","activity.toolCalling":"使用工具","activity.asking":"等你回答","activity.noModel":"未设置模型","activity.idle":"空闲","activity.stopped":"未运行","bot.saved":"已保存","bot.changeFailed":"修改失败","bot.color":"形象颜色","bot.contextHint":"截至 Bot 上次回复时,模型报告的上下文占用","bot.contextStale":"最近一次模型请求异常,当前显示的是上一次请求成功时的上下文占用。","bot.context":"上下文","bot.unknown":"未知","bot.tokens":"{used} / {window} tokens","bot.description":"描述","bot.descriptionPlaceholder":"这个 Bot 能帮你做什么?","bot.personaPlaceholder":"Bot 的性格、职责与行为偏好","bot.personaHint":"下次开始工作时生效。","bot.unsaved":"有未保存的修改","bot.saving":"正在保存…","agent.title":"主 Bot","agent.intro":"{name} 是你的主 Bot,替你打理 Jarvy 本身。在私信或频道里跟它说一声,它就能:","agent.create":"新建 Bot,修改它们的名字、描述和 Persona","agent.model":"给 Bot 选模型和思考强度","agent.run":"启动、停止 Bot,查看用量","agent.delete":"删除 Bot、频道、频道分组,或把成员移出频道,每次都先弹卡片请你确认","bot.aborting":"正在中断…","bot.abort":"中断当前任务","bot.starting":"正在启动…","bot.stopping":"正在停止…","bot.start":"启动","bot.stop":"停止","bot.workspace":"工作区","bot.copyWorkspace":"复制工作区路径","bot.tab.overview":"概览","bot.tab.profile":"设定","bot.tab.environment":"环境","bot.tab.tasks":"任务","bot.tab.activity":"活动","bot.subscriptions":"订阅","bot.noSubscriptions":"暂无订阅","bot.threadIn":"线程 · #{channel}","botModel.auto":"使用默认强度","botModel.off":"关闭思考","botModel.minimal":"最少思考","botModel.low":"少量思考","botModel.medium":"适中思考","botModel.high":"更多思考","botModel.xhigh":"高强度思考","botModel.max":"最高强度思考","botModel.loadFailed":"无法加载模型列表","botModel.switchFailed":"切换模型失败","botModel.pick":"选择 Bot 模型","botModel.broken":"这个模型已不可用,请重新选择","botModel.choose":"选择模型","botModel.filter":"筛选 Bot 模型","botModel.filterPlaceholder":"筛选模型…","botModel.list":"Bot 模型","botModel.noMatch":"没有匹配的模型","botModel.none":"暂无模型,请先在设置中添加","botModel.manage":"管理模型","botModel.thinking":"思考强度","botModel.pickThinking":"选择思考强度","botModel.loading":"正在加载模型…","botModel.switching":"正在切换…","botModel.pickFor":"为 {name} 选择模型","deleteBot.title":"删除 {name}","deleteBot.after":"删除后:","deleteBot.chats":{one:"它的 {count} 个私信、频道成员身份和订阅都会被删掉。",other:"它的 {count} 个私信、频道成员身份和订阅都会被删掉。"},"deleteBot.messages":"它在频道和线程里发过的消息会保留,发送者显示为「{name}」,名字可以重新使用。","deleteBot.history":"它的会话历史和未完成的任务都会被清除。","deleteBot.files":"同时删除工作区文件夹","deleteBot.filesHint":"工作区里可能有它生成的文件,不勾选则保留。","deleteBot.deleting":"正在删除…","deleteBot.working":"正在处理…","history.reasoning":"思考","history.text":"正文","history.empty":"(空)","history.image":"History 中的图片","history.toolCall":"工具调用","history.toolResult":"工具结果","history.error":"出错","history.related":"查看关联记录 #{id}","history.result":"结果","history.call":"调用","history.details":"结构化结果","history.view":"记录显示方式","history.content":"内容","history.json":"原始 JSON","history.contentLabel":"记录内容","history.tools":"工具定义","history.toolsRemoved":"移除的工具","history.stopReason":"结束原因","activity.detailFailed":"无法加载记录","activity.detailLoading":"正在加载记录…","activity.openChat":"打开聊天","activity.sentBy":"发送调用 #{id}","activity.roleSystem":"系统","activity.roleUser":"输入","activity.roleAssistant":"助手","activity.timeline":"Bot 活动时间线","activity.chatMessage":"聊天发言 {id}","activity.viewMessage":"查看聊天消息 {sequence} · {chat}","activity.attachmentOnly":"附件消息","activity.attachments":{one:"{count} 个附件",other:"{count} 个附件"},"activity.viewSentBy":"查看发送调用 #{id}","activity.historyRecord":"History 记录 #{id}","activity.viewHistory":"查看 History #{id} · {role}","activity.emptyMessage":"(空消息)","activity.loadFailed":"活动记录加载失败","activity.backToTimeline":"返回时间线","activity.newestFirst":"最新记录在前","activity.refresh":"刷新活动历史","activity.reading":"正在加载…","activity.columnChat":"聊天","activity.columnTime":"时间","activity.loading":"正在加载活动记录…","activity.empty":"还没有活动记录","activity.newer":"较新","activity.page":"第 {page} 页","activity.older":"较早","activity.historyDetail":"History 记录详情","activity.chatDetail":"聊天记录详情","activity.toolCall":"调用 {name}","activity.toolResult":"{name} · 执行结果","activity.toolFailed":"{name} · 执行出错","activity.images":{one:"{count} 张图片",other:"{count} 张图片"},"bot.newName":"新 Bot","bot.newNameN":"新 Bot {n}"},I8={"npc.toolbar":"NPC 原型","npc.replay":"重播","npc.mood":"基础心情","npc.mood.normal":"普通","npc.mood.happy":"开心","npc.mood.sad":"难过","npc.mood.angry":"生气","npc.mood.dizzy":"晕","npc.poses":"动作","npc.pose.sleep":"睡觉","npc.pose.idle":"空闲","npc.pose.think":"思考","npc.pose.mutter":"自言自语","npc.pose.say":"对你说话","npc.pose.ask":"等你回答","npc.pose.read":"读文件","npc.pose.work":"改文件、跑命令","npc.pose.compact":"压缩上下文","npc.pose.busy":"重试","npc.pose.failed":"报错","npc.pose.done":"做完了","npc.pose.groom":"舔爪子","npc.expand":"展开过程","npc.collapse":"收起","npc.panel":"这一轮","npc.state.running":"进行中","npc.state.ok":"成功","npc.state.failed":"失败","npc.duration":"{value} 秒","npc.done":"做完了 · {duration}","npc.mutter":"({text})","npc.to":"→ {chat}","npc.step.think":"思考","npc.step.mutter":"自言自语","npc.step.read.running":"在读 {target}","npc.step.read.ok":"读了 {target}","npc.step.write.running":"在改 {target}","npc.step.write.ok":"改好了 {target}","npc.step.run.running":"在跑 {target}","npc.step.run.ok":"跑完了 {target}","npc.step.run.failed":"{target} 失败了","npc.step.compact.running":"在整理上下文","npc.step.compact.ok":"整理好了上下文","npc.step.ask.running":"在等你回答","npc.step.ask.ok":"你选了「{answer}」","npc.step.say.running":"在回复你","npc.step.say.ok":"回复了你","npc.step.post.running":"在发到 {chat}","npc.step.post.ok":"发到了 {chat}","npc.demo.think1":"fish 说线程面板打开时会跳一下。可能是滚动的时机不对。先看看 ThreadPane 是怎么滚动的。","npc.demo.think2":"它在回复还没量好高度时就滚了。改成布局之后再滚应该就好。回复数也要算进依赖里。","npc.demo.mutter1":"改好了,先跑一遍构建看看。","npc.demo.mutter2":"嗯……类型没过,ref 可能是空的。","npc.demo.channel":"研发","npc.demo.post":"线程面板打开时跳一下的问题修好了,构建通过,等 fish 确认。","npc.demo.question":"修好了。要不要顺便更新文档里的截图?","npc.demo.yes":"要,一起更新","npc.demo.no":"先不用","npc.demo.replyYes":"好了:线程面板现在打开就停在最新回复,不会再跳;文档里的截图也换成了新的。构建通过。","npc.demo.replyNo":"好了:线程面板现在打开就停在最新回复,不会再跳。构建通过,截图先没动。","npc.live.omitted":"……省略 {count} 字……","npc.live.tokens":"上下文:{before} → {after} tokens","npc.live.compact.running":"在整理上下文","npc.live.compact.ok":"整理好了上下文","npc.live.compact.failed":"整理上下文失败了","npc.live.retry.running":"在重试(第 {attempt}/{max} 次)","npc.live.retry.ok":"重试成功","npc.live.retry.failed":"重试失败了","npc.live.read.running":"在读 {target}","npc.live.read.ok":"读了 {target}","npc.live.read.failed":"没读到 {target}","npc.live.edit.running":"在改 {target}","npc.live.edit.ok":"改好了 {target}","npc.live.edit.failed":"没改成 {target}","npc.live.write.running":"在写 {target}","npc.live.write.ok":"写好了 {target}","npc.live.write.failed":"没写成 {target}","npc.live.run.running":"在跑 {target}","npc.live.run.ok":"跑完了 {target}","npc.live.run.failed":"{target} 失败了","npc.live.script.running":"在跑一段脚本","npc.live.script.ok":"跑完了一段脚本","npc.live.script.failed":"脚本出错了","npc.live.tool.running":"在用 {tool}","npc.live.tool.ok":"用了 {tool}","npc.live.tool.failed":"{tool} 出错了","npc.live.sendFailed":"消息没发出去","npc.live.switch.running":"在切换工作环境","npc.live.switch.ok":"切换了工作环境","npc.live.switch.failed":"没能切换工作环境","npc.live.askFailed":"问题没发出去","npc.live.askClosed":"问题关掉了","npc.live.answerBelow":"在下面的卡片里回答","npc.live.answerIn":"去 {chat} 里回答","npc.live.browse.running":"在翻看 {chat}","npc.live.browse.ok":"翻看了 {chat}","npc.live.browseAll.running":"在翻看聊天","npc.live.browseAll.ok":"翻看了聊天","npc.done.interrupted":"被打断了 · {duration}","npc.done.failed":"这一轮失败了 · {duration}"},P8={"environment.title":"工作环境","environment.own":"Docker 沙箱","environment.container":"容器","environment.image":"镜像","environment.mount":"工作区挂载点","environment.external":"外部环境","environment.accessFailed":"无法更改访问权限","environment.state.preparing":"准备中","environment.state.running":"运行中","environment.state.stopped":"已停止","environment.state.failed":"启动失败","environment.state.unavailable":"不可用","environment.unavailable":"{why},无法为 Bot 启动沙箱(无沙箱时,Bot 无法进行文件读写和命令执行等操作)。","environment.unavailable.missing":"当前环境没有安装 Docker","environment.unavailable.stopped":"当前环境的 Docker 服务未启动","environment.unavailable.denied":"当前环境无 Docker 权限","environment.unavailable.failed":"当前环境的 Docker 无法使用","environment.start":"启动","environment.starting":"正在启动…","environment.stop":"停止","environment.stopping":"正在停止…","environment.stopTitle":"停止 {name} 的沙箱?","environment.stopBody":"沙箱中运行的程序将被关闭,已安装的软件和工作区文件会保留。","environment.stopConfirm":"停止","environment.reset":"重置…","environment.resetTitle":"重置 {name} 的沙箱?","environment.resetBody":"沙箱中安装的软件将被清除,工作区文件会保留。","environment.resetConfirm":"重置","environment.resetBodyVm":"沙箱中安装的软件,以及其中 Docker 的镜像、容器和数据卷将被清除,工作区文件会保留。","environment.restartNote":"新的大小在沙箱下次启动后生效。","environment.restart":"现在重启","environment.restartTitle":"重启 {name} 的沙箱?","environment.restartBody":"沙箱中运行的程序将被关闭,已安装的软件和工作区文件会保留。","environment.restartConfirm":"重启","environment.type":"类型","environment.type.container":"容器","environment.type.vm":"虚拟机","environment.type.checking":"正在检查这台电脑能否运行虚拟机…","environment.type.unavailable":"这台电脑不能运行虚拟机沙箱:{why}。","environment.type.why.no_kata":"没有安装 Kata","environment.type.why.no_kvm":"没有 KVM","environment.type.why.busy":"硬件虚拟化正被其他虚拟机软件(如 VirtualBox)占用","environment.type.why.failed":"试运行虚拟机没有成功","environment.type.recheck":"重新检查","environment.type.vmTitle":"把 {name} 的沙箱换成虚拟机?","environment.type.vmBody":"沙箱会重新创建,里面可以直接用 Docker 和 Docker Compose。工作区文件会保留,沙箱中安装的软件会清除。第一次切换要先构建镜像,可能需要几分钟。","environment.type.containerTitle":"把 {name} 的沙箱换成容器?","environment.type.containerBody":"沙箱会重新创建。工作区文件会保留,沙箱中安装的软件,以及其中 Docker 的镜像、容器和数据卷会清除。","environment.type.confirm":"切换","environment.type.switching":"正在切换…","environment.limits":"资源上限","environment.limits.edit":"修改资源上限","environment.limits.none":"不限制","environment.limits.unlimited":"不限制","environment.limits.memory":"内存 {value}","environment.limits.cpu":"CPU {value}","environment.limits.cores":"{count} 核","environment.limits.oneCore":"1 核","environment.limits.memoryField":"内存(GB)","environment.limits.cpuField":"CPU(核)","environment.limits.machine":"本机 {cpus} 核 · {memory} GB","environment.limits.below":"低于当前占用的 {usage}。保存后,沙箱中的部分程序可能被结束。","environment.limits.failed":"无法修改资源上限","environment.limits.vm":"虚拟机大小","environment.limits.vmEdit":"修改虚拟机大小","environment.limits.vmDefault":"留空则用默认大小:4 GB、2 核。","environment.limits.vmLater":"沙箱正在运行,新的大小在下次启动后生效。","environment.usage":"当前占用","environment.usage.value":"内存 {memory} · CPU {cpu}","error.typeInvalid":"沙箱类型只能是容器或虚拟机。","error.vmSizeInvalid":"虚拟机的内存可设为 1–{memory} GB,CPU 可设为 1–{cpus} 核。","error.vmUnavailable":"这台电脑现在不能运行虚拟机沙箱。","error.limitsInvalid":"内存可设为 0.25–{memory} GB,CPU 可设为 0.1–{cpus} 核,或不限制。"},H8={"connection.lan":"局域网访问","connection.localOnly":"仅限本机","connection.localOnlyHint":"Jarvy 目前只接受这台电脑上的访问。如需在局域网内的其他设备上使用,请用 {flag} 重新启动 Jarvy。","connection.addresses":"访问地址","connection.copy":"复制地址","connection.root":"安全证书","connection.download":"下载证书","connection.fingerprint":"SHA-256 指纹","connection.fingerprintSha1":"SHA-1 指纹","connection.howTo":"安装说明","connection.howMac":"Mac:打开证书将它添加到「钥匙串访问」,双击该证书,在「信任」中将「使用此证书时」设为「始终信任」。","connection.howWindows":"Windows:打开证书,点「安装证书」,选择「将所有的证书都放入下列存储」,再选「受信任的根证书颁发机构」。证书「详细信息」中的「指纹」就是上面的 SHA-1 指纹。","connection.howIos":"iPhone 和 iPad:在 Safari 中下载证书,前往「设置 › 通用 › VPN与设备管理」安装,再在「设置 › 通用 › 关于本机 › 证书信任设置」中针对它启用完全信任。","connection.howAndroid":"Android:下载证书后,在「设置」中搜索「CA 证书」并安装。不同手机的位置不同,通常在「安全」或「加密与凭据」里。","connection.howRestart":"装好后,完全退出浏览器再重新打开,新证书才会生效。","connection.allowHttp":"允许 HTTP 访问","connection.allowHttpHint":"密码和对话会明文传输,只在可信的网络中开启。","connection.insecure":"当前连接未加密,密码和对话内容可能被同一网络中的他人看到。","connection.useHttps":"切换到 HTTPS"},q8={"secrets.add":"添加密钥","secrets.empty":"还没有密钥","secrets.name":"名称","secrets.description":"说明","secrets.descriptionPlaceholder":"可选,例如用途","secrets.value":"值","secrets.newValue":"新值","secrets.newValuePlaceholder":"留空则不修改","secrets.showValue":"显示值","secrets.hideValue":"隐藏值","secrets.shortValue":"这个值少于 8 个字符,出现在 Bot 能看到的内容里时可能不会被隐藏。","secrets.noDescription":"无说明","secrets.grantCount":{one:"已授权 {count} 个 Bot",other:"已授权 {count} 个 Bot"},"secrets.notGranted":"未授权","secrets.unreadable":"无法解密","secrets.unreadableHint":"这个值是用另一个主密钥加密的,无法读取,请重新输入。","secrets.fingerprint":"指纹","secrets.updated":"更新于 {time}","secrets.usedCount":{one:"已使用 {count} 次",other:"已使用 {count} 次"},"secrets.neverUsed":"从未使用","secrets.grants":"可以使用的 Bot","secrets.noBots":"还没有 Bot。","secrets.addBots":"添加 Bot","secrets.noGrants":"还没有 Bot 可以使用它。","secrets.searchBots":"搜索 Bot","secrets.noMatch":"没有匹配的 Bot","secrets.allGranted":"所有 Bot 都已经可以使用它。","secrets.revoke":"移除 {name}","secrets.onceTag":"仅限本次","secrets.edit":"修改密钥","secrets.uses":"使用记录","secrets.noUses":"暂无使用记录。","secrets.deletedBot":"已删除的 Bot","secrets.useCommand":"命令","secrets.useSsh":"SSH 签名","secrets.delete":"删除密钥","secrets.deleteTitle":"删除 {name}?","secrets.deleteBody":"已授权的 Bot 将无法再使用它,使用记录会保留。","secrets.deleteConfirm":"删除","secrets.masterKey":"主密钥","secrets.keyFile":"保存位置","secrets.keyHint":"备份或迁移 Jarvy 时请一起复制这个文件,丢失后密钥和 API key 需要重新输入。","secretCard.title":"请求使用密钥 {name}","secretCard.valuePlaceholder":"粘贴或输入值","secretCard.insecure":"当前连接未加密,填写的值可能被同一网络中的他人看到。建议先切换到 HTTPS 再填写。","secretCard.exists":"这个密钥已保存在「设置 › 密钥」中。","secretCard.replace":"更换值","secretCard.keepValue":"使用已保存的值","secretCard.unreadable":"已保存的值无法解密,请重新输入。","secretCard.value":"值","secretCard.valueHint":"会加密保存到「设置 › 密钥」,不会出现在聊天里。","secretCard.scope":"Bot 可以使用多久","secretCard.always":"始终允许","secretCard.alwaysHint":"直到你在「设置 › 密钥」里移除","secretCard.once":"仅限本次","secretCard.onceHint":"Bot 当前的任务结束后失效","secretCard.allow":"允许","secretCard.saveAllow":"保存并允许","secretCard.decline":"拒绝","secretCard.allowedAlways":"已允许使用 {name},可以在「设置 › 密钥」中移除","secretCard.allowedOnce":"已允许本次使用 {name}","secretCard.declined":"已拒绝提供 {name}","secretCard.ignored":"已忽略 {name} 的请求","error.secretNameInvalid":"名称只能包含大写字母、数字和下划线,且以字母开头。","error.secretNameTaken":"已有同名的密钥。","error.secretValueMissing":"请输入值。","error.secretValueTooLong":"值太长,最多 16 KB。","error.secretDescriptionInvalid":"说明只能有一行,最多 200 个字符。","error.secretMissing":"找不到这个密钥,它可能已被删除。","error.credentialUnreadable":"已保存的 API key 无法解密,请在「设置 › 模型」中重新输入。"},U8={"settings.machines":"工作环境","machines.add":"添加机器","machines.empty":"还没有机器","machines.host":"地址","machines.hostPlaceholder":"192.168.1.20 或 dev.example.com","machines.port":"端口","machines.user":"用户名","machines.name":"名称","machines.directory":"起始目录","machines.description":"描述","machines.descriptionPlaceholder":"用途、已安装的软件、注意事项","machines.directoryPlaceholder":"用户主目录","machines.next":"下一步","machines.scanning":"正在连接…","machines.fingerprint":"主机指纹","machines.fingerprintHint":"继续之前,请在这台机器上运行 ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub 核对。","machines.password":"登录密码","machines.passwordHint":"用于安装 Jarvy 生成的密钥;机器不支持密钥登录时,密码将加密保存并用于登录。","machines.byPassword":"密码","machines.byKey":"公钥","machines.publicKey":"公钥","machines.keyHint":"添加到 {user} 的 ~/.ssh/authorized_keys 后验证。","machines.copy":"复制","machines.copied":"已复制","machines.verify":"验证并添加","machines.verifying":"正在验证…","machines.login":"登录方式","machines.loginKey":"密钥","machines.loginPassword":"密码","machines.passwordLogin":"该机器不支持密钥登录,当前使用已保存的密码。启用 PubkeyAuthentication 后可切换为密钥登录。","machines.newPassword":"新密码","machines.updatePassword":"更新密码","machines.passwordUpdated":"密码已更新。","machines.useKey":"切换为密钥登录","machines.usingKey":"已切换为密钥登录,保存的密码已删除。","machines.stillPassword":"该机器仍不接受 Jarvy 的密钥。","machines.connect":"连接并添加","machines.connecting":"正在添加…","machines.back":"上一步","machines.check":"检查指纹","machines.checking":"正在检查…","machines.unchanged":"指纹没有变化。","machines.changed":"这台机器现在出示的指纹和之前接受的不同。如果它重装过系统或换了机器,核对后可以接受新指纹;否则可能有人在冒充它。","machines.trust":"接受新指纹","machines.delete":"删除机器","machines.deleteTitle":"删除 {name}?","machines.deleteBody":"会先从这台机器上移除 Jarvy 的密钥。正在使用它的 Bot 会回到默认环境。","machines.deleteConfirm":"删除","machines.forceTitle":"无法连接 {name}","machines.forceBody":"Jarvy 的密钥会留在这台机器的 ~/.ssh/authorized_keys 里(以 {comment} 结尾的那一行),之后可以手动移除。仍要删除吗?","machines.forceConfirm":"仍然删除","machineCard.title":"请求添加机器 {name}","machineCard.existing":"这台机器已在「设置 › 工作环境」中。","machineCard.add":"连接并添加","machineCard.allow":"允许","machineCard.decline":"拒绝","machineCard.added":"已添加 {name}","machineCard.granted":"已允许使用 {name}","machineCard.declined":"已拒绝添加 {name}","machineCard.ignored":"已忽略 {name} 的请求","environment.awayMachine":"正在使用 {name}","error.machineMissing":"找不到这台机器,它可能已被删除。","error.machineNameTaken":"已有同名的机器。","error.sshPasswordMissing":"请输入密码。","error.sshKeyUnreadable":"这台机器的密钥无法用当前主密钥解密,请删除后重新添加。","error.sshBadHost":"地址需要是主机名或 IP 地址。","error.sshBadUser":"请填写这台机器上的用户名。","error.sshBadPort":"端口需要在 1–65535 之间。","error.sshBadDirectory":"起始目录需要是绝对路径,或以 ~/ 开头。","error.sshAuthFailed":"用户名或密码错误。","error.sshPasswordRefused":"该机器不支持密码登录,请改用公钥。","error.sshKeyRefused":"该机器未接受 Jarvy 的公钥。请确认已添加到 ~/.ssh/authorized_keys,且 sshd 已启用 PubkeyAuthentication。","error.sshKeyExpired":"公钥已失效,请重新获取并添加到机器。","error.sshUnreachable":"连接不上这台机器,请检查地址、端口和网络。","error.sshHostKeyChanged":"这台机器出示的指纹和之前接受的不同,已停止连接。","error.sshUnsupported":"目前只支持 Linux 和 macOS。","error.sshFailed":"SSH 连接失败:{detail}"},F8={"tasks.title":"定时任务","tasks.empty":"暂无定时任务","tasks.add":"新建任务","tasks.edit":"编辑","tasks.delete":"删除","tasks.deleteTitle":"删除「{name}」?","tasks.deleteBody":"删除后不会再运行。只想停一阵子的话,把它关掉就行。","tasks.toggle":"开启或关闭{name}","tasks.next":"下次 {time}","tasks.paused":"已关闭","tasks.done":"已完成","tasks.newTitle":"新建任务","tasks.editTitle":"编辑任务","tasks.name":"名称","tasks.namePlaceholder":"早间新闻","tasks.instruction":"要做什么","tasks.instructionPlaceholder":"看一遍我关注的新闻网站首页,挑三条值得看的发给我,每条附一句话。","tasks.when":"时间","tasks.kind.once":"一次","tasks.kind.every":"间隔","tasks.kind.daily":"每天","tasks.kind.weekly":"每周","tasks.at":"日期和时间","tasks.everyCount":"每隔","tasks.unit.minutes":"分钟","tasks.unit.hours":"小时","tasks.time":"时间","tasks.weekday":"星期","tasks.minimum":"最短 5 分钟。","tasks.saveFailed":"任务保存失败","tasks.changeFailed":"任务修改失败","tasks.loadFailed":"任务加载失败","tasks.schedule.once":"一次,{time}","tasks.schedule.minutes":{one:"每分钟",other:"每 {count} 分钟"},"tasks.schedule.hours":{one:"每小时",other:"每 {count} 小时"},"tasks.schedule.daily":"每天 {time}","tasks.schedule.weekly":"每{day} {time}","error.taskTimePast":"这个时间已经过了,请选一个以后的时间。","error.taskScheduleInvalid":"检查一下周期:最短每 5 分钟,时间要是有效的。","error.taskInvalid":"给任务起个名字,写上要做什么。"},V8={"ports.title":"端口转发","ports.empty":"暂无转发的端口","ports.open":"打开{name}","ports.port":"端口 {port}","ports.sandboxPort":"沙箱端口","ports.link":"链接","ports.linkOther":"其它地址","ports.copy":"复制链接","ports.state":"状态","ports.state.live":"运行中","ports.state.local":"仅本地监听","ports.state.idle":"未监听","ports.state.stopped":"沙箱已停止","ports.state.unknown":"状态未知","ports.hint.local":"服务仅监听沙箱内的 127.0.0.1,无法通过链接访问。请让 Bot 改为监听 0.0.0.0。","ports.hint.idle":"沙箱内暂无服务监听此端口。","ports.hint.stopped":"沙箱启动后即可通过链接访问。","ports.stop":"停止转发","ports.stopTitle":"停止转发「{name}」?","ports.stopBody":"链接将失效,沙箱内的服务不受影响。","ports.back":"返回","ports.loadFailed":"无法加载转发的端口。","ports.changeFailed":"无法停止转发此端口。","ports.range":"转发端口范围","ports.rangeHint":"Bot 发布端口时,Jarvy 从此范围中分配端口进行转发。已转发的端口不受影响。","ports.rangeFrom":"起始","ports.rangeTo":"结束","ports.rangeSaved":"已保存","error.portInvalid":"此端口无法转发。","error.portMissing":"此端口未在转发。","error.portRangeInvalid":"端口范围须在 1024–65535 之间,起始不大于结束,最多 1000 个。","error.portRangeOwn":"范围不能包含 Jarvy 自己的端口。","error.portsExhausted":"{from}–{to} 中已无空闲端口,请在「设置 › 网络」中扩大范围。"},$8={...O8,...D8,...z8,...L8,...B8,...I8,...P8,...H8,...q8,...U8,...F8,...V8},Cj=["en","zh"],Nj={en:R8,zh:$8},Ic={en:"en",zh:"zh-CN"},Ej="jarvy-locale";function G8(){var i;const e=localStorage.getItem(Ej);if(e==="en"||e==="zh")return e;const a=((i=navigator.languages)!=null&&i.length?navigator.languages:[navigator.language]).map(r=>r.toLowerCase()).find(r=>/^(en|zh)\b/.test(r));return a!=null&&a.startsWith("zh")?"zh":"en"}let Hi=G8();document.documentElement.lang=Ic[Hi];const Ip=new Set,ol=()=>Hi;function Tj(e){if(e!==Hi){Hi=e,localStorage.setItem(Ej,e),document.documentElement.lang=Ic[e];for(const a of Ip)a()}}function Aj(){return w.useSyncExternalStore(e=>(Ip.add(e),()=>{Ip.delete(e)}),ol)}const Pp=(e,a)=>Nj[e][a==="name"?"locale.name":"locale.short"];function Mj(e,a){const i=Nj[Hi][e];return typeof i=="string"?i:new Intl.PluralRules(Ic[Hi]).select(Number(a))==="one"?i.one:i.other}function x(e,a){const i=Mj(e,a==null?void 0:a.count);return a?i.replace(/\{(\w+)\}/g,(r,s)=>s in a?String(a[s]):r):i}const na=(e,a)=>new Date(e).toLocaleString(Ic[Hi],a),sl=e=>na(e,{hour:Hi==="zh"?"2-digit":"numeric",minute:"2-digit"}),lf=e=>{const a=new Date(e).getFullYear()===new Date().getFullYear();return na(e,{year:a?void 0:"numeric",month:Hi==="zh"?"numeric":"short",day:"numeric"})},mi=(e,a)=>new Intl.NumberFormat(Ic[Hi],a).format(e);function _0(e,a){return Mj(e,a.count).split(/\{(\w+)\}/).map((i,r)=>o.jsx(w.Fragment,{children:r%2?a[i]??`{${i}}`:i},r))}class qi extends Error{constructor(a,i,r,s){super(i),this.status=a,this.code=r,this.params=s}}async function we(e,a={}){let i;try{i=await fetch(`/api${e}`,{...a,credentials:"same-origin",headers:{...a.body&&!(a.body instanceof Blob)?{"Content-Type":"application/json"}:{},...a.headers}})}catch{throw new Error(x("api.offline"))}const r=await i.json().catch(()=>({}));if(!i.ok)throw _j(i.status,r);return r}const _j=(e,a)=>{const i=typeof a=="object"&&a!==null?a:{};return new qi(e,i.error===void 0?`HTTP ${e}`:String(i.error),typeof i.code=="string"?i.code:void 0,i.params)};function Y8(e,a,i,r){return new Promise((s,c)=>{const d=new XMLHttpRequest;if(r!=null&&r.aborted){c(new DOMException("Upload cancelled","AbortError"));return}r==null||r.addEventListener("abort",()=>d.abort(),{once:!0}),d.onabort=()=>c(new DOMException("Upload cancelled","AbortError")),d.open("POST",`/api/chats/${e}/attachments`),d.setRequestHeader("Content-Type",a.type||"application/octet-stream"),d.setRequestHeader("X-File-Name",encodeURIComponent(a.name)),d.upload.onprogress=f=>{f.lengthComputable&&(i==null||i(f.loaded/f.total))},d.onerror=()=>c(new Error(x("api.offline"))),d.onload=()=>{let f={};try{f=JSON.parse(d.responseText)}catch{}d.status>=200&&d.status<300?s(f):c(_j(d.status,f))},d.send(a)})}async function K8(e,a=0){const i=[];let r=a;for(;;){const s=await we(`/chats/${e}/messages?after=${r}&limit=1000`);if(i.push(...s.messages),!s.hasMore)return{messages:i};if(s.nextSequence<=r)throw new Error(x("api.historyFailed"));r=s.nextSequence}}const nt=e=>JSON.stringify(e),he={me:()=>we("/me"),search:(e,a)=>we(`/search?q=${encodeURIComponent(e)}${a?`&in=${a}`:""}&limit=60`),login:(e,a)=>we("/login",{method:"POST",body:nt({username:e,password:a})}),logout:()=>we("/logout",{method:"POST"}),bots:()=>we("/bots"),createBot:e=>we("/bots",{method:"POST",body:nt({name:e})}),saveBot:(e,a)=>we(`/bots/${e}`,{method:"PUT",body:nt(a)}),modelOptions:()=>we("/model-options"),selectBotModel:(e,a,i,r,s)=>we(`/bots/${e}/model`,{method:"PUT",body:nt({connectionId:a,modelId:i,thinkingLevel:r,language:s})}),answerQuestion:(e,a,i)=>we(`/chats/${e}/questions/${a}`,{method:"POST",body:nt(i)}),setBotColor:(e,a)=>we(`/bots/${e}/color`,{method:"PUT",body:nt({color:a})}),chats:()=>we("/chats"),createChat:e=>we("/chats",{method:"POST",body:nt({botId:e})}),deleteChat:e=>we(`/chats/${e}`,{method:"DELETE"}),members:()=>we("/members"),sections:()=>we("/sections"),createSection:e=>we("/sections",{method:"POST",body:nt(e)}),updateSection:(e,a)=>we(`/sections/${e}`,{method:"PATCH",body:nt(a)}),deleteSection:e=>we(`/sections/${e}`,{method:"DELETE"}),createChannel:e=>we("/channels",{method:"POST",body:nt(e)}),updateChannel:(e,a)=>we(`/chats/${e}`,{method:"PATCH",body:nt(a)}),addMember:(e,a)=>we(`/chats/${e}/members`,{method:"POST",body:nt({memberId:a})}),removeMember:(e,a)=>we(`/chats/${e}/members/${a}`,{method:"DELETE"}),setNote:(e,a)=>we(`/chats/${e}/note`,{method:"PUT",body:nt({text:a})}),markRead:(e,a)=>we(`/chats/${e}/read`,{method:"POST",body:nt({sequence:a})}),messages:K8,latestMessages:(e,a)=>we(`/chats/${e}/messages?tail=${a}`),olderMessages:(e,a,i)=>we(`/chats/${e}/messages?before=${a}&limit=${i}`),send:(e,a,i,r,s=!1,c,d=[])=>we(`/chats/${e}/messages`,{method:"POST",body:nt({content:a,attachmentIds:i,clientMessageId:r,...s?{alsoToChannel:s}:{},...c?{replyTo:c}:{},...d.length?{quotes:d}:{}})}),fold:(e,a)=>we(`/messages/${e}/fold`,{method:"PUT",body:nt({folded:a})}),react:(e,a,i)=>we(`/messages/${e}/reaction`,{method:"PUT",body:nt({emoji:a,on:i})}),pin:(e,a)=>we(`/chats/${e}/pin`,{method:"PUT",body:nt({pinned:a})}),mute:(e,a)=>we(`/chats/${e}/mute`,{method:"PUT",body:nt({muted:a})}),deleteBot:(e,a)=>we(`/bots/${e}${a?"?files=delete":""}`,{method:"DELETE"}),chat:e=>we(`/chats/${e}`),message:e=>we(`/messages/${e}`),openThread:e=>we(`/messages/${e}/thread`,{method:"POST"}),channelThreads:e=>we(`/chats/${e}/threads`),followedThreads:({filter:e,sort:a,cursor:i})=>we(`/threads?${new URLSearchParams({filter:e,sort:a,...i?{cursor:i}:{}})}`),followedThread:e=>we(`/threads/${e}`),updateThread:(e,a)=>we(`/chats/${e}`,{method:"PATCH",body:nt(a)}),follow:(e,a)=>we(`/chats/${e}/follow`,{method:"PUT",body:nt({following:a})}),botDirects:e=>we(`/members/${e}/dms`),tasks:e=>we(`/bots/${e}/tasks`),createTask:(e,a)=>we(`/bots/${e}/tasks`,{method:"POST",body:nt(a)}),updateTask:(e,a,i)=>we(`/bots/${e}/tasks/${a}`,{method:"PUT",body:nt(i)}),setTaskOn:(e,a,i)=>we(`/bots/${e}/tasks/${a}/${i?"resume":"pause"}`,{method:"POST"}),deleteTask:(e,a)=>we(`/bots/${e}/tasks/${a}`,{method:"DELETE"}),botSubscriptions:e=>we(`/members/${e}/subscriptions`),controlBot:(e,a)=>we(`/bots/${e}/${a}`,{method:"POST"}),grantBotMachine:(e,a,i)=>we(`/bots/${e}/environment`,{method:"PUT",body:nt({machineId:a,granted:i})}),machines:()=>we("/environments"),scanMachine:e=>we("/environments/scan",{method:"POST",body:nt(e)}),addMachine:e=>we("/environments",{method:"POST",body:nt(e)}),prepareMachineKey:()=>we("/environments/keys",{method:"POST"}),setMachinePassword:(e,a)=>we(`/environments/${e}/password`,{method:"PUT",body:nt({password:a})}),updateMachine:(e,a)=>we(`/environments/${e}`,{method:"PUT",body:nt(a)}),checkMachine:e=>we(`/environments/${e}/check`,{method:"POST"}),trustMachine:(e,a)=>we(`/environments/${e}/trust`,{method:"POST",body:nt({fingerprints:a})}),deleteMachine:(e,a=!1)=>we(`/environments/${e}${a?"?force=1":""}`,{method:"DELETE"}),grantMachine:(e,a,i)=>we(`/environments/${e}/grants/${a}`,{method:"PUT",body:nt({granted:i})}),fulfilMachine:(e,a,i)=>we(`/environments/requests/${e}/${a}`,{method:"POST",body:nt(i)}),computer:(e,a)=>we(`/bots/${e}/computer/${a}`,{method:"POST"}),setComputerType:(e,a)=>we(`/bots/${e}/computer/type`,{method:"PUT",body:nt({type:a})}),vmSupport:()=>we("/environments/vm"),checkVmSupport:()=>we("/environments/vm/check",{method:"POST"}),setComputerLimits:(e,a)=>we(`/bots/${e}/computer/limits`,{method:"PUT",body:nt(a)}),computerResources:e=>we(`/bots/${e}/computer/resources`),connection:()=>we("/connection"),setConnection:e=>we("/connection",{method:"PUT",body:nt({allowHttp:e})}),setPortRange:e=>we("/connection",{method:"PUT",body:nt({ports:e})}),ports:e=>we(`/bots/${e}/ports`),unpublishPort:(e,a)=>we(`/bots/${e}/ports/${a}`,{method:"DELETE"}),secrets:()=>we("/secrets"),createSecret:e=>we("/secrets",{method:"POST",body:nt(e)}),updateSecret:(e,a)=>we(`/secrets/${e}`,{method:"PUT",body:nt(a)}),deleteSecret:e=>we(`/secrets/${e}`,{method:"DELETE"}),grantSecret:(e,a,i)=>we(`/secrets/${e}/grants/${a}`,{method:"PUT",body:nt({granted:i})}),secretUses:e=>we(`/secrets/${e}/uses`),fulfilSecret:(e,a,i)=>we(`/secrets/requests/${e}/${a}`,{method:"POST",body:nt(i)}),botStatus:e=>we(`/bots/${e}/status`),uploadAttachment:Y8,removeAttachment:e=>we(`/attachments/${e}`,{method:"DELETE"}),authStatus:e=>we(`/model-connections/${e}/auth`),authStart:e=>we(`/model-connections/${e}/auth`,{method:"POST"}),authCancel:e=>we(`/model-connections/${e}/auth`,{method:"DELETE"}),authInput:(e,a,i)=>we(`/model-connections/${e}/auth/input`,{method:"POST",body:nt({promptId:a,value:i})}),authLogout:e=>we(`/model-connections/${e}/auth/logout`,{method:"POST"}),modelCatalog:e=>we(`/model-connections/${e}/catalog`),modelResetPlan:e=>we(`/model-connections/${e}/reset`),resetModelConnection:e=>we(`/model-connections/${e}/reset`,{method:"POST"}),providerModels:e=>we(`/model-providers/${encodeURIComponent(e)}/models`),modelProviders:()=>we("/model-providers"),autoconfigModel:e=>we("/model-autoconfig",{method:"POST",body:nt(e)}),discoverModels:e=>we("/model-discovery",{method:"POST",body:nt(e)}),modelConnections:()=>we("/model-connections"),createModelConnection:e=>we("/model-connections",{method:"POST",body:nt(e)}),updateModelConnection:(e,a)=>we(`/model-connections/${e}`,{method:"PUT",body:nt(a)}),deleteModelConnection:e=>we(`/model-connections/${e}`,{method:"DELETE"}),saveModelCredential:(e,a,i=!1)=>we(`/model-connections/${e}/credential`,{method:"PUT",body:nt({apiKey:a,remove:i})}),saveConnectionModel:(e,a,i)=>we(`/model-connections/${e}/models`,{method:i?"PUT":"POST",body:nt({model:a,originalId:i})}),deleteConnectionModel:(e,a)=>we(`/model-connections/${e}/models`,{method:"DELETE",body:nt({modelId:a})})},ex=4*1024**3,X8=["normal","happy","sad","angry","dizzy"];/**
50
+ * @license lucide-react v1.47.0 - ISC
51
+ *
52
+ * This source code is licensed under the ISC license.
53
+ * See the LICENSE file in the root directory of this source tree.
54
+ */const Q8=e=>e==null?void 0:e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
55
+ * @license lucide-react v1.47.0 - ISC
56
+ *
57
+ * This source code is licensed under the ISC license.
58
+ * See the LICENSE file in the root directory of this source tree.
59
+ */function Z8(e,a,i=[]){if(a==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:Q8(e),size:24,node:a,...i.length>0?{aliases:i}:{}}}/**
60
+ * @license lucide-react v1.47.0 - ISC
61
+ *
62
+ * This source code is licensed under the ISC license.
63
+ * See the LICENSE file in the root directory of this source tree.
64
+ */const J8=e=>{let a="",i=!1;for(const r of e){if(r==="-"||r==="_"||r<=" "){i=a.length>0;continue}a.length===0?a+=r.toLowerCase():a+=i?r.toUpperCase():r,i=!1}return a};/**
65
+ * @license lucide-react v1.47.0 - ISC
66
+ *
67
+ * This source code is licensed under the ISC license.
68
+ * See the LICENSE file in the root directory of this source tree.
69
+ */const W8=e=>{const a=J8(e);return a.charAt(0).toUpperCase()+a.slice(1)};/**
70
+ * @license lucide-react v1.47.0 - ISC
71
+ *
72
+ * This source code is licensed under the ISC license.
73
+ * See the LICENSE file in the root directory of this source tree.
74
+ */const Hp=(...e)=>e.filter((a,i,r)=>!!a&&a.trim()!==""&&r.indexOf(a)===i).join(" ").trim();/**
75
+ * @license lucide-react v1.47.0 - ISC
76
+ *
77
+ * This source code is licensed under the ISC license.
78
+ * See the LICENSE file in the root directory of this source tree.
79
+ */const Kl={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
80
+ * @license lucide-react v1.47.0 - ISC
81
+ *
82
+ * This source code is licensed under the ISC license.
83
+ * See the LICENSE file in the root directory of this source tree.
84
+ */function Xm(e){return e!=null}function e7(e,a={}){var b,j;const i=a.attributeNames??{},r=k=>i[k]??k,s=e.size??e.width??Kl.width,c=e.size??e.height??Kl.height,d=((b=e.aliases)==null?void 0:b.filter(k=>typeof k=="string"&&k.trim()!=="").map(k=>`lucide-${k}`))??[],f=[...e.name?[`lucide-${e.name}`]:[],...d],h=((j=a.className)==null?void 0:j.split(" ").filter(Boolean))??[],p=a.includeDefaultClasses===!1?Hp(...h):Hp("lucide",...f,...h),y=a.absoluteStrokeWidth?Number(a.strokeWidth??Kl["stroke-width"])*Number(e.size??e.width??Kl.width)/Number(a.size??a.width??Kl.width):a.strokeWidth??Kl["stroke-width"];return["svg",{...Object.entries(Kl).reduce((k,[S,N])=>(k[r(S)]=N,k),{}),..."color"in a&&a.color&&{[r("stroke")]:a.color},..."size"in a&&Xm(a.size)&&{[r("width")]:a.size,[r("height")]:a.size},..."width"in a&&Xm(a.width)&&{[r("width")]:a.width},..."height"in a&&Xm(a.height)&&{[r("height")]:a.height},[r("stroke-width")]:y,...p&&{[r("class")]:p},[r("viewBox")]:`0 0 ${s} ${c}`,...a.hasA11yProp===!1?{[r("aria-hidden")]:"true"}:{},..."attributes"in a&&a.attributes},e.node.map(k=>{const[S,N,E]=k,M=a.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",...N}:N;return E?[S,M,E]:[S,M]})]}/**
85
+ * @license lucide-react v1.47.0 - ISC
86
+ *
87
+ * This source code is licensed under the ISC license.
88
+ * See the LICENSE file in the root directory of this source tree.
89
+ */function t7(e,a={}){return e7(e,{...a,attributeNames:{...a.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
90
+ * @license lucide-react v1.47.0 - ISC
91
+ *
92
+ * This source code is licensed under the ISC license.
93
+ * See the LICENSE file in the root directory of this source tree.
94
+ */const n7=e=>{for(const a in e)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1},a7=w.createContext({}),i7=()=>w.useContext(a7),r7=w.forwardRef(({color:e,size:a,width:i,height:r,strokeWidth:s,absoluteStrokeWidth:c,nonScalingStroke:d,className:f="",children:h,iconNode:p=[],icon:y={node:p,aliases:[],size:24},...g},b)=>{const{size:j=24,strokeWidth:k=2,absoluteStrokeWidth:S=!1,nonScalingStroke:N=!1,color:E="currentColor",className:M=""}=i7()??{},C=!!h||n7(g),[A,_,R=[]]=t7(y,{color:e??E,width:i??a??j,height:r??a??j,strokeWidth:s??k,absoluteStrokeWidth:c??S,nonScalingStroke:d??N,className:Hp(M,f),hasA11yProp:C,attributes:g});return w.createElement(A,{ref:b,..._},[...R.map(([I,G])=>w.createElement(I,G)),...Array.isArray(h)?h:[h]])});/**
95
+ * @license lucide-react v1.47.0 - ISC
96
+ *
97
+ * This source code is licensed under the ISC license.
98
+ * See the LICENSE file in the root directory of this source tree.
99
+ */function _e(e,a=[],i=[]){const r=typeof e=="string"?Z8(e,a,i):e,s=w.forwardRef(({className:c,...d},f)=>w.createElement(r7,{ref:f,icon:r,className:c,...d}));return r.name&&(s.displayName=W8(r.name)),s}/**
100
+ * @license lucide-react v1.47.0 - ISC
101
+ *
102
+ * This source code is licensed under the ISC license.
103
+ * See the LICENSE file in the root directory of this source tree.
104
+ */const Rj={name:"app-window",size:24,node:[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]]};Rj.node;const l7=_e(Rj);/**
105
+ * @license lucide-react v1.47.0 - ISC
106
+ *
107
+ * This source code is licensed under the ISC license.
108
+ * See the LICENSE file in the root directory of this source tree.
109
+ */const Oj={name:"archive",size:24,node:[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]};Oj.node;const o7=_e(Oj);/**
110
+ * @license lucide-react v1.47.0 - ISC
111
+ *
112
+ * This source code is licensed under the ISC license.
113
+ * See the LICENSE file in the root directory of this source tree.
114
+ */const Dj={name:"arrow-down-up",size:24,node:[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"m21 8-4-4-4 4",key:"1c9v7m"}],["path",{d:"M17 4v16",key:"7dpous"}]]};Dj.node;const s7=_e(Dj);/**
115
+ * @license lucide-react v1.47.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */const zj={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};zj.node;const R0=_e(zj);/**
120
+ * @license lucide-react v1.47.0 - ISC
121
+ *
122
+ * This source code is licensed under the ISC license.
123
+ * See the LICENSE file in the root directory of this source tree.
124
+ */const Lj={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};Lj.node;const qp=_e(Lj);/**
125
+ * @license lucide-react v1.47.0 - ISC
126
+ *
127
+ * This source code is licensed under the ISC license.
128
+ * See the LICENSE file in the root directory of this source tree.
129
+ */const Bj={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};Bj.node;const c7=_e(Bj);/**
130
+ * @license lucide-react v1.47.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */const Ij={name:"bell-off",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]};Ij.node;const u7=_e(Ij);/**
135
+ * @license lucide-react v1.47.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */const Pj={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};Pj.node;const d7=_e(Pj);/**
140
+ * @license lucide-react v1.47.0 - ISC
141
+ *
142
+ * This source code is licensed under the ISC license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */const Hj={name:"brain",size:24,node:[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]};Hj.node;const f7=_e(Hj);/**
145
+ * @license lucide-react v1.47.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */const qj={name:"cat",size:24,node:[["path",{d:"M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z",key:"x6xyqk"}],["path",{d:"M8 14v.5",key:"1nzgdb"}],["path",{d:"M16 14v.5",key:"1lajdz"}],["path",{d:"M11.25 16.25h1.5L12 17l-.75-.75Z",key:"12kq1m"}]]};qj.node;const h7=_e(qj);/**
150
+ * @license lucide-react v1.47.0 - ISC
151
+ *
152
+ * This source code is licensed under the ISC license.
153
+ * See the LICENSE file in the root directory of this source tree.
154
+ */const Uj={name:"chart-column",size:24,node:[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],aliases:["bar-chart-3"]};Uj.node;const m7=_e(Uj);/**
155
+ * @license lucide-react v1.47.0 - ISC
156
+ *
157
+ * This source code is licensed under the ISC license.
158
+ * See the LICENSE file in the root directory of this source tree.
159
+ */const Fj={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};Fj.node;const ma=_e(Fj);/**
160
+ * @license lucide-react v1.47.0 - ISC
161
+ *
162
+ * This source code is licensed under the ISC license.
163
+ * See the LICENSE file in the root directory of this source tree.
164
+ */const Vj={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};Vj.node;const cl=_e(Vj);/**
165
+ * @license lucide-react v1.47.0 - ISC
166
+ *
167
+ * This source code is licensed under the ISC license.
168
+ * See the LICENSE file in the root directory of this source tree.
169
+ */const $j={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};$j.node;const Gj=_e($j);/**
170
+ * @license lucide-react v1.47.0 - ISC
171
+ *
172
+ * This source code is licensed under the ISC license.
173
+ * See the LICENSE file in the root directory of this source tree.
174
+ */const Yj={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};Yj.node;const ml=_e(Yj);/**
175
+ * @license lucide-react v1.47.0 - ISC
176
+ *
177
+ * This source code is licensed under the ISC license.
178
+ * See the LICENSE file in the root directory of this source tree.
179
+ */const Kj={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};Kj.node;const p7=_e(Kj);/**
180
+ * @license lucide-react v1.47.0 - ISC
181
+ *
182
+ * This source code is licensed under the ISC license.
183
+ * See the LICENSE file in the root directory of this source tree.
184
+ */const Xj={name:"code-xml",size:24,node:[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],aliases:["code-2"]};Xj.node;const g7=_e(Xj);/**
185
+ * @license lucide-react v1.47.0 - ISC
186
+ *
187
+ * This source code is licensed under the ISC license.
188
+ * See the LICENSE file in the root directory of this source tree.
189
+ */const Qj={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};Qj.node;const Pc=_e(Qj);/**
190
+ * @license lucide-react v1.47.0 - ISC
191
+ *
192
+ * This source code is licensed under the ISC license.
193
+ * See the LICENSE file in the root directory of this source tree.
194
+ */const Zj={name:"database",size:24,node:[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]};Zj.node;const v7=_e(Zj);/**
195
+ * @license lucide-react v1.47.0 - ISC
196
+ *
197
+ * This source code is licensed under the ISC license.
198
+ * See the LICENSE file in the root directory of this source tree.
199
+ */const Jj={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};Jj.node;const O0=_e(Jj);/**
200
+ * @license lucide-react v1.47.0 - ISC
201
+ *
202
+ * This source code is licensed under the ISC license.
203
+ * See the LICENSE file in the root directory of this source tree.
204
+ */const Wj={name:"ellipsis",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aliases:["more-horizontal"]};Wj.node;const tx=_e(Wj);/**
205
+ * @license lucide-react v1.47.0 - ISC
206
+ *
207
+ * This source code is licensed under the ISC license.
208
+ * See the LICENSE file in the root directory of this source tree.
209
+ */const ew={name:"expand",size:24,node:[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16v5h-5",key:"1ck2sf"}],["path",{d:"M21 8V3h-5",key:"1qoq8a"}],["path",{d:"M3 16v5h5",key:"1t08am"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 8V3h5",key:"1ln10m"}],["path",{d:"M9 9 3 3",key:"v551iv"}]]};ew.node;const y7=_e(ew);/**
210
+ * @license lucide-react v1.47.0 - ISC
211
+ *
212
+ * This source code is licensed under the ISC license.
213
+ * See the LICENSE file in the root directory of this source tree.
214
+ */const tw={name:"external-link",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]};tw.node;const Up=_e(tw);/**
215
+ * @license lucide-react v1.47.0 - ISC
216
+ *
217
+ * This source code is licensed under the ISC license.
218
+ * See the LICENSE file in the root directory of this source tree.
219
+ */const nw={name:"eye-off",size:24,node:[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};nw.node;const D0=_e(nw);/**
220
+ * @license lucide-react v1.47.0 - ISC
221
+ *
222
+ * This source code is licensed under the ISC license.
223
+ * See the LICENSE file in the root directory of this source tree.
224
+ */const aw={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};aw.node;const z0=_e(aw);/**
225
+ * @license lucide-react v1.47.0 - ISC
226
+ *
227
+ * This source code is licensed under the ISC license.
228
+ * See the LICENSE file in the root directory of this source tree.
229
+ */const iw={name:"face-slightly-smiling-plus",size:24,node:[["path",{d:"M13.267 2.08a10 10 0 108.653 8.653",key:"1wbpyh"}],["path",{d:"M15 10V9",key:"4dkmfx"}],["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M16.472 15a6 6 0 01-8.943 0",key:"7qomzy"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M9 10V9",key:"1lazqi"}]],aliases:["smile-plus"]};iw.node;const x7=_e(iw);/**
230
+ * @license lucide-react v1.47.0 - ISC
231
+ *
232
+ * This source code is licensed under the ISC license.
233
+ * See the LICENSE file in the root directory of this source tree.
234
+ */const rw={name:"face-slightly-smiling",size:24,node:[["path",{d:"M15 10V9",key:"4dkmfx"}],["path",{d:"M16.472 15a6 6 0 01-8.943 0",key:"7qomzy"}],["path",{d:"M9 10V9",key:"1lazqi"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],aliases:["smile"]};rw.node;const b7=_e(rw);/**
235
+ * @license lucide-react v1.47.0 - ISC
236
+ *
237
+ * This source code is licensed under the ISC license.
238
+ * See the LICENSE file in the root directory of this source tree.
239
+ */const lw={name:"file-headphone",size:24,node:[["path",{d:"M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343",key:"1vfytu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0",key:"1etmh7"}]],aliases:["file-audio","file-audio-2"]};lw.node;const j7=_e(lw);/**
240
+ * @license lucide-react v1.47.0 - ISC
241
+ *
242
+ * This source code is licensed under the ISC license.
243
+ * See the LICENSE file in the root directory of this source tree.
244
+ */const ow={name:"file-play",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z",key:"1tzo1f"}]],aliases:["file-video"]};ow.node;const w7=_e(ow);/**
245
+ * @license lucide-react v1.47.0 - ISC
246
+ *
247
+ * This source code is licensed under the ISC license.
248
+ * See the LICENSE file in the root directory of this source tree.
249
+ */const sw={name:"file-text",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};sw.node;const k7=_e(sw);/**
250
+ * @license lucide-react v1.47.0 - ISC
251
+ *
252
+ * This source code is licensed under the ISC license.
253
+ * See the LICENSE file in the root directory of this source tree.
254
+ */const cw={name:"file",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]};cw.node;const S7=_e(cw);/**
255
+ * @license lucide-react v1.47.0 - ISC
256
+ *
257
+ * This source code is licensed under the ISC license.
258
+ * See the LICENSE file in the root directory of this source tree.
259
+ */const uw={name:"flag",size:24,node:[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]};uw.node;const C7=_e(uw);/**
260
+ * @license lucide-react v1.47.0 - ISC
261
+ *
262
+ * This source code is licensed under the ISC license.
263
+ * See the LICENSE file in the root directory of this source tree.
264
+ */const dw={name:"fold-vertical",size:24,node:[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3-3-3 3",key:"e37ymu"}],["path",{d:"m15 5-3 3-3-3",key:"19d6lf"}]]};dw.node;const N7=_e(dw);/**
265
+ * @license lucide-react v1.47.0 - ISC
266
+ *
267
+ * This source code is licensed under the ISC license.
268
+ * See the LICENSE file in the root directory of this source tree.
269
+ */const fw={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};fw.node;const E7=_e(fw);/**
270
+ * @license lucide-react v1.47.0 - ISC
271
+ *
272
+ * This source code is licensed under the ISC license.
273
+ * See the LICENSE file in the root directory of this source tree.
274
+ */const hw={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};hw.node;const T7=_e(hw);/**
275
+ * @license lucide-react v1.47.0 - ISC
276
+ *
277
+ * This source code is licensed under the ISC license.
278
+ * See the LICENSE file in the root directory of this source tree.
279
+ */const mw={name:"hand",size:24,node:[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]};mw.node;const A7=_e(mw);/**
280
+ * @license lucide-react v1.47.0 - ISC
281
+ *
282
+ * This source code is licensed under the ISC license.
283
+ * See the LICENSE file in the root directory of this source tree.
284
+ */const pw={name:"hash",size:24,node:[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]};pw.node;const M7=_e(pw);/**
285
+ * @license lucide-react v1.47.0 - ISC
286
+ *
287
+ * This source code is licensed under the ISC license.
288
+ * See the LICENSE file in the root directory of this source tree.
289
+ */const gw={name:"heart",size:24,node:[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]};gw.node;const _7=_e(gw);/**
290
+ * @license lucide-react v1.47.0 - ISC
291
+ *
292
+ * This source code is licensed under the ISC license.
293
+ * See the LICENSE file in the root directory of this source tree.
294
+ */const vw={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};vw.node;const R7=_e(vw);/**
295
+ * @license lucide-react v1.47.0 - ISC
296
+ *
297
+ * This source code is licensed under the ISC license.
298
+ * See the LICENSE file in the root directory of this source tree.
299
+ */const yw={name:"info",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]};yw.node;const L0=_e(yw);/**
300
+ * @license lucide-react v1.47.0 - ISC
301
+ *
302
+ * This source code is licensed under the ISC license.
303
+ * See the LICENSE file in the root directory of this source tree.
304
+ */const xw={name:"key-round",size:24,node:[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]};xw.node;const bw=_e(xw);/**
305
+ * @license lucide-react v1.47.0 - ISC
306
+ *
307
+ * This source code is licensed under the ISC license.
308
+ * See the LICENSE file in the root directory of this source tree.
309
+ */const jw={name:"lightbulb",size:24,node:[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]};jw.node;const O7=_e(jw);/**
310
+ * @license lucide-react v1.47.0 - ISC
311
+ *
312
+ * This source code is licensed under the ISC license.
313
+ * See the LICENSE file in the root directory of this source tree.
314
+ */const ww={name:"list",size:24,node:[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]};ww.node;const D7=_e(ww);/**
315
+ * @license lucide-react v1.47.0 - ISC
316
+ *
317
+ * This source code is licensed under the ISC license.
318
+ * See the LICENSE file in the root directory of this source tree.
319
+ */const kw={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};kw.node;const Sw=_e(kw);/**
320
+ * @license lucide-react v1.47.0 - ISC
321
+ *
322
+ * This source code is licensed under the ISC license.
323
+ * See the LICENSE file in the root directory of this source tree.
324
+ */const Cw={name:"log-out",size:24,node:[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]};Cw.node;const z7=_e(Cw);/**
325
+ * @license lucide-react v1.47.0 - ISC
326
+ *
327
+ * This source code is licensed under the ISC license.
328
+ * See the LICENSE file in the root directory of this source tree.
329
+ */const Nw={name:"megaphone",size:24,node:[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]]};Nw.node;const L7=_e(Nw);/**
330
+ * @license lucide-react v1.47.0 - ISC
331
+ *
332
+ * This source code is licensed under the ISC license.
333
+ * See the LICENSE file in the root directory of this source tree.
334
+ */const Ew={name:"message-circle-question-mark",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["message-circle-question"]};Ew.node;const Tw=_e(Ew);/**
335
+ * @license lucide-react v1.47.0 - ISC
336
+ *
337
+ * This source code is licensed under the ISC license.
338
+ * See the LICENSE file in the root directory of this source tree.
339
+ */const Aw={name:"message-circle",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]};Aw.node;const B7=_e(Aw);/**
340
+ * @license lucide-react v1.47.0 - ISC
341
+ *
342
+ * This source code is licensed under the ISC license.
343
+ * See the LICENSE file in the root directory of this source tree.
344
+ */const Mw={name:"message-square-text",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]]};Mw.node;const I7=_e(Mw);/**
345
+ * @license lucide-react v1.47.0 - ISC
346
+ *
347
+ * This source code is licensed under the ISC license.
348
+ * See the LICENSE file in the root directory of this source tree.
349
+ */const _w={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};_w.node;const P7=_e(_w);/**
350
+ * @license lucide-react v1.47.0 - ISC
351
+ *
352
+ * This source code is licensed under the ISC license.
353
+ * See the LICENSE file in the root directory of this source tree.
354
+ */const Rw={name:"messages-square",size:24,node:[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]]};Rw.node;const Ow=_e(Rw);/**
355
+ * @license lucide-react v1.47.0 - ISC
356
+ *
357
+ * This source code is licensed under the ISC license.
358
+ * See the LICENSE file in the root directory of this source tree.
359
+ */const Dw={name:"minimize-2",size:24,node:[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]};Dw.node;const H7=_e(Dw);/**
360
+ * @license lucide-react v1.47.0 - ISC
361
+ *
362
+ * This source code is licensed under the ISC license.
363
+ * See the LICENSE file in the root directory of this source tree.
364
+ */const zw={name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]};zw.node;const Lw=_e(zw);/**
365
+ * @license lucide-react v1.47.0 - ISC
366
+ *
367
+ * This source code is licensed under the ISC license.
368
+ * See the LICENSE file in the root directory of this source tree.
369
+ */const Bw={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};Bw.node;const q7=_e(Bw);/**
370
+ * @license lucide-react v1.47.0 - ISC
371
+ *
372
+ * This source code is licensed under the ISC license.
373
+ * See the LICENSE file in the root directory of this source tree.
374
+ */const Iw={name:"panel-left",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],aliases:["sidebar"]};Iw.node;const U7=_e(Iw);/**
375
+ * @license lucide-react v1.47.0 - ISC
376
+ *
377
+ * This source code is licensed under the ISC license.
378
+ * See the LICENSE file in the root directory of this source tree.
379
+ */const Pw={name:"paperclip",size:24,node:[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]};Pw.node;const B0=_e(Pw);/**
380
+ * @license lucide-react v1.47.0 - ISC
381
+ *
382
+ * This source code is licensed under the ISC license.
383
+ * See the LICENSE file in the root directory of this source tree.
384
+ */const Hw={name:"pencil-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]};Hw.node;const F7=_e(Hw);/**
385
+ * @license lucide-react v1.47.0 - ISC
386
+ *
387
+ * This source code is licensed under the ISC license.
388
+ * See the LICENSE file in the root directory of this source tree.
389
+ */const qw={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};qw.node;const V7=_e(qw);/**
390
+ * @license lucide-react v1.47.0 - ISC
391
+ *
392
+ * This source code is licensed under the ISC license.
393
+ * See the LICENSE file in the root directory of this source tree.
394
+ */const Uw={name:"pin",size:24,node:[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]};Uw.node;const Fp=_e(Uw);/**
395
+ * @license lucide-react v1.47.0 - ISC
396
+ *
397
+ * This source code is licensed under the ISC license.
398
+ * See the LICENSE file in the root directory of this source tree.
399
+ */const Fw={name:"plane",size:24,node:[["path",{d:"M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z",key:"1v9wt8"}]]};Fw.node;const $7=_e(Fw);/**
400
+ * @license lucide-react v1.47.0 - ISC
401
+ *
402
+ * This source code is licensed under the ISC license.
403
+ * See the LICENSE file in the root directory of this source tree.
404
+ */const Vw={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};Vw.node;const xr=_e(Vw);/**
405
+ * @license lucide-react v1.47.0 - ISC
406
+ *
407
+ * This source code is licensed under the ISC license.
408
+ * See the LICENSE file in the root directory of this source tree.
409
+ */const $w={name:"quote",size:24,node:[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]};$w.node;const G7=_e($w);/**
410
+ * @license lucide-react v1.47.0 - ISC
411
+ *
412
+ * This source code is licensed under the ISC license.
413
+ * See the LICENSE file in the root directory of this source tree.
414
+ */const Gw={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};Gw.node;const I0=_e(Gw);/**
415
+ * @license lucide-react v1.47.0 - ISC
416
+ *
417
+ * This source code is licensed under the ISC license.
418
+ * See the LICENSE file in the root directory of this source tree.
419
+ */const Yw={name:"reply",size:24,node:[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]};Yw.node;const Y7=_e(Yw);/**
420
+ * @license lucide-react v1.47.0 - ISC
421
+ *
422
+ * This source code is licensed under the ISC license.
423
+ * See the LICENSE file in the root directory of this source tree.
424
+ */const Kw={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};Kw.node;const Xw=_e(Kw);/**
425
+ * @license lucide-react v1.47.0 - ISC
426
+ *
427
+ * This source code is licensed under the ISC license.
428
+ * See the LICENSE file in the root directory of this source tree.
429
+ */const Qw={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};Qw.node;const ys=_e(Qw);/**
430
+ * @license lucide-react v1.47.0 - ISC
431
+ *
432
+ * This source code is licensed under the ISC license.
433
+ * See the LICENSE file in the root directory of this source tree.
434
+ */const Zw={name:"server",size:24,node:[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]};Zw.node;const Jw=_e(Zw);/**
435
+ * @license lucide-react v1.47.0 - ISC
436
+ *
437
+ * This source code is licensed under the ISC license.
438
+ * See the LICENSE file in the root directory of this source tree.
439
+ */const Ww={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};Ww.node;const K7=_e(Ww);/**
440
+ * @license lucide-react v1.47.0 - ISC
441
+ *
442
+ * This source code is licensed under the ISC license.
443
+ * See the LICENSE file in the root directory of this source tree.
444
+ */const e4={name:"shapes",size:24,node:[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]};e4.node;const X7=_e(e4);/**
445
+ * @license lucide-react v1.47.0 - ISC
446
+ *
447
+ * This source code is licensed under the ISC license.
448
+ * See the LICENSE file in the root directory of this source tree.
449
+ */const t4={name:"shield-alert",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]};t4.node;const Q7=_e(t4);/**
450
+ * @license lucide-react v1.47.0 - ISC
451
+ *
452
+ * This source code is licensed under the ISC license.
453
+ * See the LICENSE file in the root directory of this source tree.
454
+ */const n4={name:"shrink",size:24,node:[["path",{d:"m15 15 6 6m-6-6v4.8m0-4.8h4.8",key:"17vawe"}],["path",{d:"M9 19.8V15m0 0H4.2M9 15l-6 6",key:"chjx8e"}],["path",{d:"M15 4.2V9m0 0h4.8M15 9l6-6",key:"lav6yq"}],["path",{d:"M9 4.2V9m0 0H4.2M9 9 3 3",key:"1pxi2q"}]]};n4.node;const Z7=_e(n4);/**
455
+ * @license lucide-react v1.47.0 - ISC
456
+ *
457
+ * This source code is licensed under the ISC license.
458
+ * See the LICENSE file in the root directory of this source tree.
459
+ */const a4={name:"sliders-horizontal",size:24,node:[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]};a4.node;const J7=_e(a4);/**
460
+ * @license lucide-react v1.47.0 - ISC
461
+ *
462
+ * This source code is licensed under the ISC license.
463
+ * See the LICENSE file in the root directory of this source tree.
464
+ */const i4={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};i4.node;const r4=_e(i4);/**
465
+ * @license lucide-react v1.47.0 - ISC
466
+ *
467
+ * This source code is licensed under the ISC license.
468
+ * See the LICENSE file in the root directory of this source tree.
469
+ */const l4={name:"speech",size:24,node:[["path",{d:"M8.8 20v-4.1l1.9.2a2.3 2.3 0 0 0 2.164-2.1V8.3A5.37 5.37 0 0 0 2 8.25c0 2.8.656 3.054 1 4.55a5.77 5.77 0 0 1 .029 2.758L2 20",key:"11atix"}],["path",{d:"M19.8 17.8a7.5 7.5 0 0 0 .003-10.603",key:"yol142"}],["path",{d:"M17 15a3.5 3.5 0 0 0-.025-4.975",key:"ssbmkc"}]]};l4.node;const W7=_e(l4);/**
470
+ * @license lucide-react v1.47.0 - ISC
471
+ *
472
+ * This source code is licensed under the ISC license.
473
+ * See the LICENSE file in the root directory of this source tree.
474
+ */const o4={name:"square-terminal",size:24,node:[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],aliases:["terminal-square"]};o4.node;const e9=_e(o4);/**
475
+ * @license lucide-react v1.47.0 - ISC
476
+ *
477
+ * This source code is licensed under the ISC license.
478
+ * See the LICENSE file in the root directory of this source tree.
479
+ */const s4={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};s4.node;const t9=_e(s4);/**
480
+ * @license lucide-react v1.47.0 - ISC
481
+ *
482
+ * This source code is licensed under the ISC license.
483
+ * See the LICENSE file in the root directory of this source tree.
484
+ */const c4={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};c4.node;const Fd=_e(c4);/**
485
+ * @license lucide-react v1.47.0 - ISC
486
+ *
487
+ * This source code is licensed under the ISC license.
488
+ * See the LICENSE file in the root directory of this source tree.
489
+ */const u4={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};u4.node;const P0=_e(u4);/**
490
+ * @license lucide-react v1.47.0 - ISC
491
+ *
492
+ * This source code is licensed under the ISC license.
493
+ * See the LICENSE file in the root directory of this source tree.
494
+ */const d4={name:"trophy",size:24,node:[["path",{d:"M10 14.66V17a1 1 0 0 1-1 1 2 2 0 0 0-2 2v2",key:"pwuv1l"}],["path",{d:"M14 14.66V17a1 1 0 0 0 1 1 2 2 0 0 1 2 2v2",key:"1y54w1"}],["path",{d:"M17.916 10H19.5A2.5 2.5 0 0 0 22 7.5V5a1 1 0 0 0-1-1h-3",key:"e30mpu"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6.084 10H4.5A2.5 2.5 0 0 1 2 7.5V5a1 1 0 0 1 1-1h3",key:"i0yafy"}]]};d4.node;const n9=_e(d4);/**
495
+ * @license lucide-react v1.47.0 - ISC
496
+ *
497
+ * This source code is licensed under the ISC license.
498
+ * See the LICENSE file in the root directory of this source tree.
499
+ */const f4={name:"unfold-vertical",size:24,node:[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]]};f4.node;const a9=_e(f4);/**
500
+ * @license lucide-react v1.47.0 - ISC
501
+ *
502
+ * This source code is licensed under the ISC license.
503
+ * See the LICENSE file in the root directory of this source tree.
504
+ */const h4={name:"user-plus",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]};h4.node;const i9=_e(h4);/**
505
+ * @license lucide-react v1.47.0 - ISC
506
+ *
507
+ * This source code is licensed under the ISC license.
508
+ * See the LICENSE file in the root directory of this source tree.
509
+ */const m4={name:"users",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};m4.node;const r9=_e(m4);/**
510
+ * @license lucide-react v1.47.0 - ISC
511
+ *
512
+ * This source code is licensed under the ISC license.
513
+ * See the LICENSE file in the root directory of this source tree.
514
+ */const p4={name:"utensils",size:24,node:[["path",{d:"M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2",key:"cjf0a3"}],["path",{d:"M7 2v20",key:"1473qp"}],["path",{d:"M21 15V2a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7",key:"j28e5"}]],aliases:["fork-knife"]};p4.node;const l9=_e(p4);/**
515
+ * @license lucide-react v1.47.0 - ISC
516
+ *
517
+ * This source code is licensed under the ISC license.
518
+ * See the LICENSE file in the root directory of this source tree.
519
+ */const g4={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};g4.node;const o9=_e(g4);/**
520
+ * @license lucide-react v1.47.0 - ISC
521
+ *
522
+ * This source code is licensed under the ISC license.
523
+ * See the LICENSE file in the root directory of this source tree.
524
+ */const v4={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};v4.node;const xs=_e(v4),y4={list:(e,a)=>we(`/bots/${e}/activity${a===void 0?"":`?before=${encodeURIComponent(a)}`}`),message:(e,a)=>we(`/bots/${e}/activity/messages/${a}`)};function x4(e){var a,i,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(a=0;a<s;a++)e[a]&&(i=x4(e[a]))&&(r&&(r+=" "),r+=i)}else for(i in e)e[i]&&(r&&(r+=" "),r+=i);return r}function s9(){for(var e,a,i=0,r="",s=arguments.length;i<s;i++)(e=arguments[i])&&(a=x4(e))&&(r&&(r+=" "),r+=a);return r}const nx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ax=s9,H0=(e,a)=>i=>{var r;if((a==null?void 0:a.variants)==null)return ax(e,i==null?void 0:i.class,i==null?void 0:i.className);const{variants:s,defaultVariants:c}=a,d=Object.keys(s).map(p=>{const y=i==null?void 0:i[p],g=c==null?void 0:c[p];if(y===null)return null;const b=nx(y)||nx(g);return s[p][b]}),f=i&&Object.entries(i).reduce((p,y)=>{let[g,b]=y;return b===void 0||(p[g]=b),p},{}),h=a==null||(r=a.compoundVariants)===null||r===void 0?void 0:r.reduce((p,y)=>{let{class:g,className:b,...j}=y;return Object.entries(j).every(k=>{let[S,N]=k;return Array.isArray(N)?N.includes({...c,...f}[S]):{...c,...f}[S]===N})?[...p,g,b]:p},[]);return ax(e,d,h,i==null?void 0:i.class,i==null?void 0:i.className)},b4=48,$i=(e,a=0)=>{const i=new Int32Array(e.length);for(let r=0;r<e.length;r++)i[r]=e.charCodeAt(r)-b4-a;return i},of=e=>{const a=new Int32Array(e.length+1);for(let i=0;i<e.length;i++)a[i+1]=a[i]+e[i];return a},ul=e=>{const a=new Int32Array(e.length);let i=0;for(let r=0;r<e.length;r++){const s=e.charCodeAt(r)-b4;i+=s>>>1^-(s&1),a[r]=i}return a},c9=384,u9=[],Wl=of($i("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010")),d9=of($i(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3")),f9="@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom",h9=(()=>{const e=Wl.length-1,a=new Int32Array(e);for(let s=e-1;s>=0;s--){let c=1,d=s+1;for(let f=Wl[s];f<Wl[s+1];f++)c+=a[d],d+=a[d];a[s]=c}const i=new Int32Array(Wl[e]);let r=0;for(let s=0;s<e;s++){let c=s+1;for(let d=Wl[s];d<Wl[s+1];d++)i[r++]=c,c+=a[c]}return i})(),m9=$i("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000",1),p9=of($i("123333359346463635126536711576")),g9=$i("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032"),v9=$i("012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199"),y9=ul("020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200"),x9=(()=>{const e=new Int32Array(319).fill(-1),a=ul("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222"),i=ul("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");for(let r=0;r<a.length;r++)e[a[r]]=i[r];return e})(),b9="container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform".split("|").map(e=>{const a=e.split(" "),i=a.shift();for(let r=0;r<a.length;r++)a[r]=i+a[r];return a}),ix=ul("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422"),j9=ul("ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622"),w9=ul("02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~‚22…ˆ‡:22|22222222222G000q†OVI00000}š2›>40000ŒB00000I¨©000¬00000000000000021M®­00°“000000000000000000000–222›HGHa1º222¿2À2222ÉÌ000­°2±"),j4=new Int32Array(995),w4=new Int32Array(995),k4=new Int32Array(995);let Vp="";const $p=new Int32Array(1038);{const e=new Map;let a=0,i=0;for(let r=0;r<ix.length;r++)for(const s of b9[w9[r]]){let c=e.get(s);c===void 0&&(c=a++,e.set(s,c),$p[c*2]=Vp.length,$p[c*2+1]=s.length,Vp+=s),j4[i]=ix[r],w4[i]=j9[r],k4[i]=c,i++}}const k9=ul("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p"),S9=of($i("1::24444432:442:44:44>222222:44:4421322511111311111114")),C9=ul("2Š4A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅҜ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=„ƧNž2Đå242L222290000f22500ɛ000ǘ222"),N9=$i("ij"),E9=$i("—"),T9=$i("1"),A9="* ** after backdrop before details-content file first-letter first-line marker placeholder selection";var M9={GROUP_COUNT:c9,customValidatorNames:u9,edgeStart:Wl,labelStart:d9,labelText:f9,edgeTarget:h9,nodeGroup:m9,nodeVlist:x9,vlistPat:p9,vlistOps:g9,vlistRef:v9,vlistGroup:y9,litAnchor:j4,litGroup:w4,litPool:k4,poolOffsets:$p,poolText:Vp,adjGid:k9,adjStart:S9,adjTgt:C9,patGid:N9,patTgt:E9,postfixLookupGroups:T9,orderSensitiveModifiers:A9};const _9="line"in new Error,Oi=-1,Xl=-1,Qm=(e,a,i)=>{let r=2166136261;for(let s=a;s<i;s++)r=Math.imul(r^e.charCodeAt(s),16777619);return r},zd=(e,a,i)=>{const r=i-a;let s=Math.imul(r,2654435761)^e.charCodeAt(a);if(r>3){const c=r>>2,d=r>>1;s=Math.imul(s^e.charCodeAt(a+1)<<8^e.charCodeAt(a+2)<<16^e.charCodeAt(a+c),2246822507),s=Math.imul(s^e.charCodeAt(a+d)<<8^e.charCodeAt(a+d+c)<<16^e.charCodeAt(i-3),3266489909),s^=e.charCodeAt(i-2)<<8^e.charCodeAt(i-1)<<16;for(let f=a+3,h=i-4;f<a+8&&f<h;f++,h--)s=Math.imul(s^e.charCodeAt(f)^e.charCodeAt(h)<<8,16777619)}return s^s>>>15|0},R9=(e,a,i={})=>{const{GROUP_COUNT:r,edgeStart:s,labelStart:c,labelText:d,edgeTarget:f,nodeGroup:h,nodeVlist:p,vlistPat:y,vlistOps:g,vlistRef:b,vlistGroup:j,litAnchor:k,litGroup:S,litPool:N,poolOffsets:E,poolText:M,adjGid:C,adjStart:A,adjTgt:_,patGid:R,patTgt:I,postfixLookupGroups:G,customValidatorNames:Y,orderSensitiveModifiers:L}=e,P=new Int32Array(r).fill(-1);for(let se=0;se<C.length;se++)P[C[se]]=se;let q=0;for(let se=0;se+1<A.length;se++){const be=A[se+1]-A[se];be>q&&(q=be)}let Z=32;for(;Z<2*(1+q+R.length);)Z<<=1;const U=new Int32Array(b.length+1);for(let se=0;se<b.length;se++)U[se+1]=U[se]+y[b[se]+1]-y[b[se]];const F=new Uint8Array(r);for(let se=0;se<G.length;se++)F[G[se]]=1;const X=s.length-1,$=new Uint8Array(X);let H=0,ie=!0;for(let se=0;se<k.length;se++){$[k[se]]=1;const be=E[N[se]*2+1];be>H&&(H=be);const je=M.charCodeAt(E[N[se]*2]);(je===91||je===40)&&(ie=!1)}let O=1;for(;O<k.length*2;)O<<=1;const le=new Int32Array(O).fill(-1);for(let se=0;se<k.length;se++){const be=E[N[se]*2];let je=(Qm(M,be,be+E[N[se]*2+1])^Math.imul(k[se],2654435761)|0)&O-1;for(;le[je]!==-1;)je=je+1&O-1;le[je]=se}const ne=(se,be,je,Ve)=>{let tt=(Qm(be,je,Ve)^Math.imul(se,2654435761)|0)&O-1;const V=Ve-je;for(;;){const fe=le[tt];if(fe===-1)return-1;if(k[fe]===se&&E[N[fe]*2+1]===V){const ke=E[N[fe]*2];let qe=!0;for(let De=0;De<V;De++)if(M.charCodeAt(ke+De)!==be.charCodeAt(je+De)){qe=!1;break}if(qe)return S[fe]}tt=tt+1&O-1}},D=i.cacheSize??8192,B=i.prefix??e.prefix??"",W=B===""?"":B+":",ue=W.length,me=(Y??[]).map(se=>{throw new Error("cn: missing validator "+se)}),ge=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Se=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Me=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;let oe=0,Ee=-1,Xe=-1,Be=-1,Je=-1;const Qe=se=>se>=97&&se<=122||se>=65&&se<=90||se>=48&&se<=57||se===95,et=se=>/\s/.test(String.fromCharCode(se)),Lt=(se,be,je)=>{if(oe=0,Ee=-1,je-be<3)return;const Ve=se.charCodeAt(be),tt=se.charCodeAt(je-1);if(Ve===91&&tt===93)oe=1;else if(Ve===40&&tt===41)oe=2;else return;Be=be+1,Je=je-1;let V=be+1;if(Qe(se.charCodeAt(V))){for(V++;V<je-1;){const fe=se.charCodeAt(V);if(!Qe(fe)&&fe!==45)break;V++}V<je-2&&se.charCodeAt(V)===58&&(Ee=be+1,Xe=V,Be=V+1)}},cn=(se,be,je,Ve)=>{if(je-be!==Ve.length)return!1;for(let tt=0;tt<Ve.length;tt++)if(se.charCodeAt(be+tt)!==Ve.charCodeAt(tt))return!1;return!0},jn=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Xt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$n=se=>!!se&&!Number.isNaN(Number(se)),Pn=(se,be,je)=>{if(je-be<11||!cn(se,be,be+10,"@container"))return!1;if(se.charCodeAt(be+10)===47)return je-be>=12;const Ve=se.charCodeAt(be+11);return Ve===115&&je-be>=17&&cn(se,be+10,be+16,"-size/")||Ve===110&&je-be>=19&&cn(se,be+10,be+18,"-normal/")},ga=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],pe="length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight".split("|").map(se=>se.split(" ")),Ce=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],Ge=(se,be,je,Ve)=>{if(se>=10){if(se>=25)return me[se-25](be.slice(je,Ve));const tt=se-10;if(oe!==ga[tt])return!1;if(Ee>=0){for(const V of pe[tt])if(cn(be,Ee,Xe,V))return!0;return!1}switch(Ce[tt]){case 0:return!1;case 1:return!0;case 2:{const V=be.slice(Be,Je);return ge.test(V)&&!Se.test(V)}case 3:return $n(be.slice(Be,Je));case 4:return xe.test(be.slice(Be,Je));default:return Me.test(be.slice(Be,Je))}}switch(se){case 0:return!0;case 1:return oe===0;case 2:return oe===1;case 3:return oe===2;case 4:return jn.test(be.slice(je,Ve));case 5:return $n(be.slice(je,Ve));case 6:{const tt=be.slice(je,Ve);return!!tt&&Number.isInteger(Number(tt))}case 7:return Ve>je&&be.charCodeAt(Ve-1)===37&&$n(be.slice(je,Ve-1));case 8:return Xt.test(be.slice(je,Ve));default:return Pn(be,je,Ve)}},Ke=new Set(typeof L=="string"?L.split(" "):L),ot=(se,be,je,Ve,tt,V)=>{const fe=Qm(be,je,Ve)^(tt?2654435769:0)|0;let ke=se.get(fe);if(ke!==void 0)e:for(let $e=0;$e<ke.length;$e++){const ze=ke[$e];if(!(ze.imp!==tt||ze.k.length!==Ve-je)){for(let Le=0;Le<ze.k.length;Le++)if(ze.k.charCodeAt(Le)!==be.charCodeAt(je+Le))continue e;return ze.id}}else se.set(fe,ke=[]);const qe=be.slice(je,Ve),De=V(qe);return ke.push({k:qe,imp:tt,id:De}),De};let At=new Map,Qt=new Map,de=2;const Te=4096,Re=(se,be)=>{const je=[];let Ve=0,tt=0,V=0;for(let De=0;De<se.length;De++){const $e=se.charCodeAt(De);Ve===0&&tt===0&&$e===58?(je.push(se.slice(V,De)),V=De+1):$e===91?Ve++:$e===93?Ve--:$e===40?tt++:$e===41&&tt--}je.push(se.slice(V));let fe=je[0];if(je.length>1){const De=[];let $e=[];for(const ze of je)ze.charCodeAt(0)===91||Ke.has(ze)?($e.length&&(De.push(...$e.sort()),$e=[]),De.push(ze)):$e.push(ze);$e.length&&De.push(...$e.sort()),fe=De.join(":")}const ke=be?fe+" !":fe;let qe=Qt.get(ke);return qe===void 0&&Qt.set(ke,qe=de++),qe};let Ie=new Map,He=r;const at=r+4096,Gt=()=>He++,za=2097152,Gn=8192,kt=new Int32Array(Gn),gn=new Array(Gn).fill(null),vo=new Int32Array(Gn),Ki=new Int32Array(Gn),bl=new Uint8Array(Gn);let va=0;const yi=(se,be,je,Ve,tt,V,fe,ke)=>{let qe=se;if(gn[se]!==null)if(gn[se|1]===null)qe=se|1;else if((va++&3)===0)qe=se|va>>2&1;else return;gn[qe]=be.slice(je,Ve),kt[qe]=tt,vo[qe]=V,Ki[qe]=fe,bl[qe]=ke},Ht=()=>gn.fill(null);let tn=256,on=[new Int32Array(tn),new Int32Array(tn),new Int32Array(tn),new Int32Array(tn)],[xi,Ja,Wa,ei]=on,La=new Uint8Array(tn),aa=new Uint8Array(tn);const ti=()=>{tn*=2,on=on.map(be=>{const je=new Int32Array(tn);return je.set(be),je}),[xi,Ja,Wa,ei]=on;const se=new Uint8Array(tn);se.set(La),La=se,aa=new Uint8Array(tn)};let ya=64,ia=new Int32Array(ya),bi=new Int32Array(ya);const jl=new Int32Array(r);let xa=2048,Cr=21,ni=new Float64Array(xa),Nr=new Int32Array(xa),ba=0;const Er=(se,be)=>{if(se===0&&be<r)return jl[be]===ba?1:(jl[be]=ba,0);const je=se*2097152+be+1;let Ve=Math.imul(je,2654435761)>>>Cr;for(;Nr[Ve]===ba;){if(ni[Ve]===je)return 1;Ve=Ve+1&xa-1}return ni[Ve]=je,Nr[Ve]=ba,0},Ba=(se,be,je,Ve,tt)=>{if(je-be>=2&&se.charCodeAt(be)===91&&se.charCodeAt(je-1)===93){let V=-1;for(let fe=be+1;fe<je-1;fe++)if(se.charCodeAt(fe)===58){V=fe;break}return V===-1||V===be+1?Oi:ot(Ie,se,be+1,V,0,Gt)}if(Ve>=0&&h[Ve]>=0)return h[Ve];for(let V=tt-1;V>=0;V--){const fe=bi[V];if(fe>je)continue;const ke=ia[V],qe=je-fe;if($[ke]===1&&qe>0&&qe<=H){const lt=se.charCodeAt(fe);if(ie===!1||lt!==91&&lt!==40){const an=ne(ke,se,fe,je);if(an>=0)return an}}const De=p[ke];if(De<0)continue;const $e=b[De],ze=y[$e],Le=y[$e+1];if(ze===Le)continue;Lt(se,fe,je);const dt=U[De]-ze;for(let lt=ze;lt<Le;lt++)if(Ge(g[lt],se,fe,je))return j[dt+lt]}return Oi},Ia=se=>{const be=se.length;let je=0,Ve=0,tt=!1;(de>Te||At.size>Te)&&(At=new Map,Qt=new Map,de=2,Ht()),He>at&&(Ie=new Map,He=r,Ht());let V=0;for(;V<be;){let De=se.charCodeAt(V);if(De===32||De>=9&&De<=13||De>=160&&et(De)){De!==32&&(tt=!0),V++;continue}const $e=V;let ze=0;for(;V<be;){if(De=se.charCodeAt(V),De<=32){if(De===32)break;if(De>=9&&De<=13){tt=!0;break}}else if(De>=160&&et(De)){tt=!0;break}ze=Math.imul(ze^De,16777619),V++}const Le=V,dt=Le-$e;je===tn&&ti();const lt=je++;xi[lt]=$e,Ja[lt]=Le,Ve+=dt,ze^=Math.imul(dt,2654435761);const an=ze^ze>>>15|0,Ct=an&8190;{let bt=-1;if(kt[Ct]===an&&gn[Ct]!==null&&gn[Ct].length===dt?bt=Ct:kt[Ct|1]===an&&gn[Ct|1]!==null&&gn[Ct|1].length===dt&&(bt=Ct|1),bt>=0){const kn=gn[bt];let Ha=!0;for(let Sa=0;Sa<dt;Sa++)if(kn.charCodeAt(Sa)!==se.charCodeAt($e+Sa)){Ha=!1;break}if(Ha){Wa[lt]=vo[bt],ei[lt]=Ki[bt],La[lt]=bl[bt];continue}}}let Nt=$e;if(ue!==0){if(Le-$e<=ue||!se.startsWith(W,$e)){Wa[lt]=Oi,yi(Ct,se,$e,Le,an,Oi,0,0);continue}Nt=$e+ue}let yo=0,Es=0,Qi=-1,xo=-1;for(let bt=Nt;bt<Le;bt++){const kn=se.charCodeAt(bt);if(yo===0&&Es===0){if(kn===58){Qi=bt;continue}if(kn===47){xo=bt;continue}}kn===91?yo++:kn===93?yo--:kn===40?Es++:kn===41&&Es--}const Zc=Qi>=Nt?Qi+1:Nt;let $t=Zc,Hn=Le,_r=!1,bo=0;Hn>$t&&se.charCodeAt(Hn-1)===33?(_r=!0,Hn--):Hn>$t&&se.charCodeAt($t)===33&&(_r=!0,$t++,bo=1);let ra=-1;xo>Zc&&(ra=xo+bo,ra>=Hn&&(ra=-1));let jo=$t;Hn-$t>1&&se.charCodeAt($t)===45&&(jo=$t+1);let wa=0,Kn=0,Rr=0,Ts=-1,ka=0;(p[0]>=0||$[0]===1)&&(ia[0]=0,bi[0]=jo,ka=1);let kl=Xl,As=0;for(let bt=jo;bt<Hn;bt++)if(bt===ra&&(kl=Kn<Rr?Xl:wa,As=ka),wa!==Xl){const kn=se.charCodeAt(bt);let Ha=-1;if(Kn<Rr)d.charCodeAt(Kn)===kn?(Kn++,Kn===Rr&&(Ha=wa=Ts)):wa=Xl;else{const Sa=s[wa],Nl=s[wa+1];let Zi=Xl;for(let Mn=Sa;Mn<Nl;Mn++){const El=c[Mn];if(d.charCodeAt(El)===kn){c[Mn+1]-El===1?Ha=Zi=f[Mn]:(Kn=El+1,Rr=c[Mn+1],Ts=f[Mn],Zi=wa);break}}wa=Zi}if(Ha>=0&&(p[Ha]>=0||$[Ha]===1)&&bt+1<Hn&&se.charCodeAt(bt+1)===45){if(ka===ya){ya*=2;const Sa=new Int32Array(ya);Sa.set(ia),ia=Sa;const Nl=new Int32Array(ya);Nl.set(bi),bi=Nl}ia[ka]=Ha,bi[ka]=bt+2,ka++}}ra===Hn&&(kl=Kn<Rr?Xl:wa,As=ka);const Ms=Kn<Rr?Xl:wa;let An,Xn=!1;if(ra>=0)if(Xn=!0,An=Ba(se,$t,ra,kl,As),An!==Oi&&An<r&&F[An]){const bt=Ba(se,$t,Hn,Ms,ka);bt!==Oi&&bt!==An&&(An=bt,Xn=!1)}else An===Oi&&(An=Ba(se,$t,Hn,Ms,ka),Xn=!1);else An=Ba(se,$t,Hn,Ms,ka);let Sl=0,Cl=0;An===Oi?Wa[lt]=Oi:(Cl=Xn?1:0,Sl=Nt>=Qi?_r?1:0:ot(At,se,Nt,Qi,_r?1:0,bt=>Re(bt,_r)),Wa[lt]=An,La[lt]=Cl,ei[lt]=Sl),yi(Ct,se,$e,Le,an,An,Sl,Cl)}if(je===0)return"";if(je===1)return xi[0]===0&&Ja[0]===be?se:se.slice(xi[0],Ja[0]);if(je*Z>xa){for(;je*Z>xa;)xa<<=1,Cr--;ni=new Float64Array(xa),Nr=new Int32Array(xa)}if(de>=za||He>=za)throw new Error("cn: too many distinct classes in one merge");ba=ba+1|0,ba===0&&(jl.fill(0),Nr.fill(0),ba=1);let fe=!1;for(let De=je-1;De>=0;De--){const $e=Wa[De];if($e===Oi){aa[De]=1;continue}const ze=ei[De];if(Er(ze,$e)===1){aa[De]=0,fe=!0;continue}if(aa[De]=1,$e<r){const Le=P[$e];if(Le>=0)for(let dt=A[Le];dt<A[Le+1];dt++)Er(ze,_[dt]);if(La[De]&1)for(let dt=0;dt<R.length;dt++)R[dt]===$e&&Er(ze,I[dt])}}if(!fe&&!tt&&be===Ve+je-1)return se;let ke="",qe=0;for(;qe<je;){if(!aa[qe]){qe++;continue}const De=xi[qe];let $e=Ja[qe],ze=qe+1;for(;ze<je&&aa[ze]&&xi[ze]===$e+1&&se.charCodeAt($e)===32;)$e=Ja[ze],ze++;ke.length>0&&(ke+=" "),ke+=se.slice(De,$e),qe=ze}return ke},Yn=16384,Ft=new Int32Array(Yn*2);let wn=0,Zt=1,Vt=Object.create(null),vn=Object.create(null),nn=new Map,wl=new Map,Tr=0,ji=0;const Pa=()=>{wn^=Yn,Zt=Zt+1|0,ji=0},Xi=se=>{let be=Vt[se];if(be!==void 0)return be;const je=zd(se,0,se.length),Ve=(je&16383)+wn,tt=Ft[Ve]===(je^Zt)||Ft[Ve^Yn]===(je^Zt-1);return tt&&(be=vn[se],be!==void 0)?(Vt[se]=be,be):(be=Ia(se),tt?(Vt[se]=be,++Tr>D&&(Tr=0,vn=Vt,Vt=Object.create(null),Pa())):(Ft[Ve]=je^Zt,++ji>Yn&&Pa()),be)},Ar=se=>{let be=nn.get(se);if(be!==void 0)return be;const je=zd(se,0,se.length),Ve=(je&16383)+wn,tt=Ft[Ve]===(je^Zt)||Ft[Ve^Yn]===(je^Zt-1);return tt&&(be=wl.get(se),be!==void 0)?(nn.set(se,be),be):(be=Ia(se),tt?(nn.set(se,be),++Tr>D&&(Tr=0,wl=nn,nn=new Map,Pa())):(Ft[Ve]=je^Zt,++ji>Yn&&Pa()),be)},Mr=se=>{const be=zd(se,0,se.length),je=(be&16383)+wn;return Ft[je]===(be^Zt)||Ft[je^Yn]===(be^Zt-1)?!0:(Ft[je]=be^Zt,++ji>Yn&&Pa(),!1)},ja=D===0?Ia:_9?se=>{const be=nn.get(se);return be!==void 0?be:Ar(se)}:Xi;return{merge:function(){return arguments.length===1&&typeof arguments[0]=="string"?ja(arguments[0]):ja(D9.apply(null,arguments))},mergeString:ja,seenBefore:D===0?()=>!1:Mr,mergeUncached:Ia}},Vd=(e,a)=>{if(!e)return"";if(typeof e=="string")return e;let i="";if(typeof e.length=="number"&&(!a||Array.isArray(e))){const r=e;for(let s=0;s<r.length;s++){const c=r[s];if(!c)continue;const d=typeof c=="string"?c:Vd(c,a);d&&(i&&(i+=" "),i+=d)}return i}if(a){if(typeof e=="number")return""+e;if(typeof e=="object")for(const r in e)e[r]&&(i&&(i+=" "),i+=r)}return i},O9=(e,a)=>{let i="";for(let r=0;r<e.length;r++){const s=e[r];if(!s)continue;const c=typeof s=="string"?s:Vd(s,a);c&&(i&&(i+=" "),i+=c)}return i},D9=function(){return O9(arguments,!1)},z9=256,rx=16,L9=1024,Zm=4096,B9=(e,a)=>{const i=a===void 0?()=>!0:a.seenBefore,r=a===void 0?e:a.mergeUncached;let s=new Map,c=new Map,d=0,f=null,h=null,p=[],y=[],g=0;const b=(E,M,C)=>{h===null&&(h=new Array(Zm).fill(""),p=new Array(Zm).fill(""),y=new Array(Zm).fill(""));const A=zd(E,0,E.length)&4094;if(h[A]===E&&p[A]===M)return y[A];if(h[A|1]===E&&p[A|1]===M)return y[A|1];const _=e(C?M+" "+E:E),R=h[A]===""?A:A|(h[A|1]===""?1:g++&1);return h[R]=E,p[R]=M,y[R]=_,_},j=(E,M,C,A)=>{let _=0;if(M){if(M!==E.a0)return!1;_=1}if(C){if(C!==(_===0?E.a0:E.a1))return!1;_++}if(A){if(A!==(_===0?E.a0:_===1?E.a1:E.a2))return!1;_++}return _===E.t},k=(E,M)=>{const C=E.a;let A=0;for(let _=0;_<M.length;_++){const R=M[_];if(R){if(R!==C[A])return!1;A++}}return A===E.t},S=(E,M)=>{const C=E.length,A=f===null?null:f.n;if(!M){if(A!==null&&k(A,E))return f=A,A.r;if(f!==null&&f!==A&&k(f,E))return f.r}let _="",R=-1,I=0,G=!1;for(let P=0;P<C;P++){let q=E[P];if(q){if(typeof q!="string"){if(q=E[P]=Vd(q,!0),!q)continue;G=!0}R<0&&(_=q,R=P),I++}}if(I===0)return"";if(I===1)return e(_);if(G){if(A!==null&&k(A,E))return f=A,A.r;if(f!==null&&f!==A&&k(f,E))return f.r}let Y=s.get(_);Y===void 0&&(Y=c.get(_),Y!==void 0&&s.set(_,Y));let L=null;if(Y!==void 0){if(Y.skip>0){Y.skip--,f=null;let q=_;for(let Z=R+1;Z<C;Z++){const U=E[Z];U&&(q+=" "+U)}return b(q,"",!1)}const P=Y.e;e:for(let q=0;q<P.length;q++){const Z=P[q];if(Z.t!==I)continue;const U=Z.a;let F=1;for(let X=R+1;X<C;X++){const $=E[X];if($&&$!==U[F++])continue e}L=Z;break}L!==null&&(Y.miss=0)}if(L===null){let P=_;const q=[_];for(let U=R+1;U<C;U++){const F=E[U];F&&(P+=" "+F,q.push(F))}if(!i(P))return r(P);L={r:e(P),t:q.length,a0:q[0],a1:q[1],a2:q[2]??"",a:q,n:null},Y===void 0?s.set(_,Y={e:[],miss:0,skip:0,at:0}):++Y.miss>rx&&(Y.miss=rx,Y.skip=L9,Y.e.length=0,Y.at=0);const Z=Y.e;Z.length<z9?Z.push(L):(Z[Y.at]=L,Y.at=Y.at+1&255),++d>1e3&&(d=0,c=s,s=new Map)}return f!==null&&f!==L&&(f.n=L),f=L,L.r},N=E=>Array.isArray(E)?S(E.slice(),!1):e(Vd(E,!0));return function(E,M,C){const A=arguments.length;if((A|1)===3){const I=f;if(I!==null){const G=I.n;if(G!==null&&j(G,E,M,C))return f=G,G.r;if(I!==G&&j(I,E,M,C))return I.r}if(A===2&&typeof M=="string"&&M!==""){const G=s.get(E);if(G!==void 0&&G.skip>0)return G.skip--,f=null,b(M,E,!0)}return S([E,M,C],!0)}if(A===1)return typeof E=="string"?e(E):N(E);const _=f;if(_!==null){const I=_.n;if(I!==null){const G=I.a;let Y=0,L=!0;for(let P=0;P<A;P++){const q=arguments[P];if(q){if(q!==G[Y]){L=!1;break}Y++}}if(L&&Y===I.t)return f=I,I.r}if(_!==I){const G=_.a;let Y=0,L=!0;for(let P=0;P<A;P++){const q=arguments[P];if(q){if(q!==G[Y]){L=!1;break}Y++}}if(L&&Y===_.t)return _.r}}const R=[];for(let I=0;I<A;I++)R.push(arguments[I]);return S(R,!0)}},lx=R9(M9),bn=B9(lx.mergeString,lx);var ho=Sj(),I9=Object.defineProperty,q0=(e,a)=>I9(e,"name",{value:a,configurable:!0});function Gp(e,a){if(typeof e=="function")return e(a);e!=null&&(e.current=a)}q0(Gp,"setRef");function S4(...e){return a=>{let i=!1;const r=e.map(s=>{const c=Gp(s,a);return!i&&typeof c=="function"&&(i=!0),c});if(i)return()=>{for(let s=0;s<r.length;s++){const c=r[s];typeof c=="function"?c():Gp(e[s],null)}}}}q0(S4,"composeRefs");function Ot(...e){return w.useCallback(S4(...e),e)}q0(Ot,"useComposedRefs");var P9=Object.defineProperty,gi=(e,a)=>P9(e,"name",{value:a,configurable:!0});function Ui(e){const a=w.forwardRef((i,r)=>{let{children:s,...c}=i,d=null,f=!1;const h=[];Yp(s)&&typeof pd=="function"&&(s=pd(s._payload)),w.Children.forEach(s,b=>{var j;if(T4(b)){f=!0;const k=b;let S="child"in k.props?k.props.child:k.props.children;Yp(S)&&typeof pd=="function"&&(S=pd(S._payload)),d=U9(k,S),h.push((j=d==null?void 0:d.props)==null?void 0:j.children)}else h.push(b)}),d?d=w.cloneElement(d,void 0,h):!f&&w.Children.count(s)===1&&w.isValidElement(s)&&(d=s);const p=d?E4(d):void 0,y=Ot(r,p);if(!d){if(s||s===0)throw new Error(f?$9(e):V9(e));return s}const g=N4(c,d.props??{});return d.type!==w.Fragment&&(g.ref=r?y:p),w.cloneElement(d,g)});return a.displayName=`${e}.Slot`,a}gi(Ui,"createSlot");var H9=Ui("Slot"),C4=Symbol.for("radix.slottable");function q9(e){const a=gi(i=>"child"in i?i.children(i.child):i.children,"Slottable");return a.displayName=`${e}.Slottable`,a.__radixId=C4,a}gi(q9,"createSlottable");var U9=gi((e,a)=>{if("child"in e.props){const i=e.props.child;return w.isValidElement(i)?w.cloneElement(i,void 0,e.props.children(i.props.children)):null}return w.isValidElement(a)?a:null},"getSlottableElementFromSlottable");function N4(e,a){const i={...a};for(const r in a){const s=e[r],c=a[r];/^on[A-Z]/.test(r)?s&&c?i[r]=(...f)=>{const h=c(...f);return s(...f),h}:s&&(i[r]=s):r==="style"?i[r]={...s,...c}:r==="className"&&(i[r]=[s,c].filter(Boolean).join(" "))}return{...e,...i}}gi(N4,"mergeProps");function E4(e){var r,s;let a=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,i=a&&"isReactWarning"in a&&a.isReactWarning;return i?e.ref:(a=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,i=a&&"isReactWarning"in a&&a.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}gi(E4,"getElementRef");function T4(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===C4}gi(T4,"isSlottable");var F9=Symbol.for("react.lazy");function Yp(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===F9&&"_payload"in e&&A4(e._payload)}gi(Yp,"isLazyComponent");function A4(e){return typeof e=="object"&&e!==null&&"then"in e}gi(A4,"isPromiseLike");var V9=gi(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),$9=gi(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),pd=Bc[" use ".trim().toString()],G9=Object.defineProperty,Y9=(e,a)=>G9(e,"name",{value:a,configurable:!0}),K9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Kt=K9.reduce((e,a)=>{const i=Ui(`Primitive.${a}`),r=w.forwardRef((s,c)=>{const{asChild:d,...f}=s,h=d?i:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(h,{...f,ref:c})});return r.displayName=`Primitive.${a}`,{...e,[a]:r}},{});function M4(e,a){e&&ho.flushSync(()=>e.dispatchEvent(a))}Y9(M4,"dispatchDiscreteCustomEvent");var X9=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Q9=Object.defineProperty,Qa=(e,a)=>Q9(e,"name",{value:a,configurable:!0});function Z9(e,a){const i=w.createContext(a);i.displayName=e+"Context";const r=Qa(c=>{const{children:d,...f}=c,h=w.useMemo(()=>f,Object.values(f));return o.jsx(i.Provider,{value:h,children:d})},"Provider");r.displayName=e+"Provider";function s(c,d={}){const{optional:f=!1}=d,h=w.useContext(i);if(h)return h;if(a!==void 0)return a;if(!f)throw new Error(`\`${c}\` must be used within \`${e}\``)}return Qa(s,"useContext"),[r,s]}Qa(Z9,"createContext");function pl(e,a=[]){let i=[];function r(c,d){const f=w.createContext(d);f.displayName=c+"Context";const h=i.length;i=[...i,d];const p=Qa(g=>{var E;const{scope:b,children:j,...k}=g,S=((E=b==null?void 0:b[e])==null?void 0:E[h])||f,N=w.useMemo(()=>k,Object.values(k));return o.jsx(S.Provider,{value:N,children:j})},"Provider");p.displayName=c+"Provider";function y(g,b,j={}){var E;const{optional:k=!1}=j,S=((E=b==null?void 0:b[e])==null?void 0:E[h])||f,N=w.useContext(S);if(N)return N;if(d!==void 0)return d;if(!k)throw new Error(`\`${g}\` must be used within \`${c}\``)}return Qa(y,"useContext"),[p,y]}Qa(r,"createContext");const s=Qa(()=>{const c=i.map(d=>w.createContext(d));return Qa(function(f){const h=(f==null?void 0:f[e])||c;return w.useMemo(()=>({[`__scope${e}`]:{...f,[e]:h}}),[f,h])},"useScope")},"createScope");return s.scopeName=e,[r,_4(s,...a)]}Qa(pl,"createContextScope");function _4(...e){const a=e[0];if(e.length===1)return a;const i=Qa(()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return Qa(function(c){const d=r.reduce((f,{useScope:h,scopeName:p})=>{const g=h(c)[`__scope${p}`];return{...f,...g}},{});return w.useMemo(()=>({[`__scope${a.scopeName}`]:d}),[d])},"useComposedScopes")},"createScope");return i.scopeName=a.scopeName,i}Qa(_4,"composeContextScopes");var J9=Object.defineProperty,Tn=(e,a)=>J9(e,"name",{value:a,configurable:!0});function R4(e){const a=e+"CollectionProvider",[i,r]=pl(a),[s,c]=i(a,{collectionRef:{current:null},itemMap:new Map}),d=Tn(S=>{const{scope:N,children:E}=S,M=w.useRef(null),C=w.useRef(new Map).current;return o.jsx(s,{scope:N,itemMap:C,collectionRef:M,children:E})},"CollectionProvider");d.displayName=a;const f=e+"CollectionSlot",h=Ui(f),p=w.forwardRef((S,N)=>{const{scope:E,children:M}=S,C=c(f,E),A=Ot(N,C.collectionRef);return o.jsx(h,{ref:A,children:M})});p.displayName=f;const y=e+"CollectionItemSlot",g="data-radix-collection-item",b=Ui(y),j=w.forwardRef((S,N)=>{const{scope:E,children:M,...C}=S,A=w.useRef(null),_=Ot(N,A),R=c(y,E);return w.useEffect(()=>(R.itemMap.set(A,{ref:A,...C}),()=>void R.itemMap.delete(A))),o.jsx(b,{[g]:"",ref:_,children:M})});j.displayName=y;function k(S){const N=c(e+"CollectionConsumer",S);return w.useCallback(()=>{const M=N.collectionRef.current;if(!M)return[];const C=Array.from(M.querySelectorAll(`[${g}]`));return Array.from(N.itemMap.values()).sort((R,I)=>C.indexOf(R.ref.current)-C.indexOf(I.ref.current))},[N.collectionRef,N.itemMap])}return Tn(k,"useCollection"),[{Provider:d,Slot:p,ItemSlot:j},k,r]}Tn(R4,"createCollection");var ox=new WeakMap,mn,Oa,Jm=(Oa=class extends Map{constructor(i){super(i);Fy(this,mn);Um(this,mn,[...super.keys()]),ox.set(this,!0)}set(i,r){return ox.get(this)&&(this.has(i)?Un(this,mn)[Un(this,mn).indexOf(i)]=i:Un(this,mn).push(i)),super.set(i,r),this}insert(i,r,s){const c=this.has(r),d=Un(this,mn).length,f=U0(i);let h=f>=0?f:d+f;const p=h<0||h>=d?-1:h;if(p===this.size||c&&p===this.size-1||p===-1)return this.set(r,s),this;const y=this.size+(c?0:1);f<0&&h++;const g=[...Un(this,mn)];let b,j=!1;for(let k=h;k<y;k++)if(h===k){let S=g[k];g[k]===r&&(S=g[k+1]),c&&this.delete(r),b=this.get(S),this.set(r,s)}else{!j&&g[k-1]===r&&(j=!0);const S=g[j?k:k-1],N=b;b=this.get(S),this.delete(S),this.set(S,N)}return this}with(i,r,s){const c=new Oa(this);return c.insert(i,r,s),c}before(i){const r=Un(this,mn).indexOf(i)-1;if(!(r<0))return this.entryAt(r)}setBefore(i,r,s){const c=Un(this,mn).indexOf(i);return c===-1?this:this.insert(c,r,s)}after(i){let r=Un(this,mn).indexOf(i);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(i,r,s){const c=Un(this,mn).indexOf(i);return c===-1?this:this.insert(c+1,r,s)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Um(this,mn,[]),super.clear()}delete(i){const r=super.delete(i);return r&&Un(this,mn).splice(Un(this,mn).indexOf(i),1),r}deleteAt(i){const r=this.keyAt(i);return r!==void 0?this.delete(r):!1}at(i){const r=Ld(Un(this,mn),i);if(r!==void 0)return this.get(r)}entryAt(i){const r=Ld(Un(this,mn),i);if(r!==void 0)return[r,this.get(r)]}indexOf(i){return Un(this,mn).indexOf(i)}keyAt(i){return Ld(Un(this,mn),i)}from(i,r){const s=this.indexOf(i);if(s===-1)return;let c=s+r;return c<0&&(c=0),c>=this.size&&(c=this.size-1),this.at(c)}keyFrom(i,r){const s=this.indexOf(i);if(s===-1)return;let c=s+r;return c<0&&(c=0),c>=this.size&&(c=this.size-1),this.keyAt(c)}find(i,r){let s=0;for(const c of this){if(Reflect.apply(i,r,[c,s,this]))return c;s++}}findIndex(i,r){let s=0;for(const c of this){if(Reflect.apply(i,r,[c,s,this]))return s;s++}return-1}filter(i,r){const s=[];let c=0;for(const d of this)Reflect.apply(i,r,[d,c,this])&&s.push(d),c++;return new Oa(s)}map(i,r){const s=[];let c=0;for(const d of this)s.push([d[0],Reflect.apply(i,r,[d,c,this])]),c++;return new Oa(s)}reduce(...i){const[r,s]=i;let c=0,d=s??this.at(0);for(const f of this)c===0&&i.length===1?d=f:d=Reflect.apply(r,this,[d,f,c,this]),c++;return d}reduceRight(...i){const[r,s]=i;let c=s??this.at(-1);for(let d=this.size-1;d>=0;d--){const f=this.at(d);d===this.size-1&&i.length===1?c=f:c=Reflect.apply(r,this,[c,f,d,this])}return c}toSorted(i){const r=[...this.entries()].sort(i);return new Oa(r)}toReversed(){const i=new Oa;for(let r=this.size-1;r>=0;r--){const s=this.keyAt(r),c=this.get(s);i.set(s,c)}return i}toSpliced(...i){const r=[...this.entries()];return r.splice(...i),new Oa(r)}slice(i,r){const s=new Oa;let c=this.size-1;if(i===void 0)return s;i<0&&(i=i+this.size),r!==void 0&&r>0&&(c=r-1);for(let d=i;d<=c;d++){const f=this.keyAt(d),h=this.get(f);s.set(f,h)}return s}every(i,r){let s=0;for(const c of this){if(!Reflect.apply(i,r,[c,s,this]))return!1;s++}return!0}some(i,r){let s=0;for(const c of this){if(Reflect.apply(i,r,[c,s,this]))return!0;s++}return!1}},mn=new WeakMap,Tn(Oa,"OrderedDict"),Oa);function Ld(e,a){if("at"in Array.prototype)return Array.prototype.at.call(e,a);const i=O4(e,a);return i===-1?void 0:e[i]}Tn(Ld,"at");function O4(e,a){const i=e.length,r=U0(a),s=r>=0?r:i+r;return s<0||s>=i?-1:s}Tn(O4,"toSafeIndex");function U0(e){return e!==e||e===0?0:Math.trunc(e)}Tn(U0,"toSafeInteger");function W9(e){const a=e+"CollectionProvider",[i,r]=pl(a),[s,c]=i(a,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Jm,setItemMap:Tn(()=>{},"setItemMap")}),d=Tn(({state:C,...A})=>C?o.jsx(h,{...A,state:C}):o.jsx(f,{...A}),"CollectionProvider");d.displayName=a;const f=Tn(C=>{const A=N();return o.jsx(h,{...C,state:A})},"CollectionInit");f.displayName=a+"Init";const h=Tn(C=>{const{scope:A,children:_,state:R}=C,I=w.useRef(null),[G,Y]=w.useState(null),L=Ot(I,Y),[P,q]=R;return w.useEffect(()=>{if(!G)return;const Z=L4(()=>{});return Z.observe(G,{childList:!0,subtree:!0}),()=>{Z.disconnect()}},[G]),o.jsx(s,{scope:A,itemMap:P,setItemMap:q,collectionRef:L,collectionRefObject:I,collectionElement:G,children:_})},"CollectionProviderImpl");h.displayName=a+"Impl";const p=e+"CollectionSlot",y=Ui(p),g=w.forwardRef((C,A)=>{const{scope:_,children:R}=C,I=c(p,_),G=Ot(A,I.collectionRef);return o.jsx(y,{ref:G,children:R})});g.displayName=p;const b=e+"CollectionItemSlot",j="data-radix-collection-item",k=Ui(b),S=w.forwardRef((C,A)=>{const{scope:_,children:R,...I}=C,G=w.useRef(null),[Y,L]=w.useState(null),P=Ot(A,G,L),q=c(b,_),{setItemMap:Z}=q,U=w.useRef(I);D4(U.current,I)||(U.current=I);const F=U.current;return w.useEffect(()=>{const X=F;return Z($=>Y?$.has(Y)?$.set(Y,{...X,element:Y}).toSorted(Kp):($.set(Y,{...X,element:Y}),$.toSorted(Kp)):$),()=>{Z($=>!Y||!$.has(Y)?$:($.delete(Y),new Jm($)))}},[Y,F,Z]),o.jsx(k,{[j]:"",ref:P,children:R})});S.displayName=b;function N(){return w.useState(new Jm)}Tn(N,"useInitCollection");function E(C){const{itemMap:A}=c(e+"CollectionConsumer",C);return A}return Tn(E,"useCollection"),[{Provider:d,Slot:g,ItemSlot:S},{createCollectionScope:r,useCollection:E,useInitCollection:N}]}Tn(W9,"createCollection");function D4(e,a){if(e===a)return!0;if(typeof e!="object"||typeof a!="object"||e==null||a==null)return!1;const i=Object.keys(e),r=Object.keys(a);if(i.length!==r.length)return!1;for(const s of i)if(!Object.prototype.hasOwnProperty.call(a,s)||e[s]!==a[s])return!1;return!0}Tn(D4,"shallowEqual");function z4(e,a){return!!(a.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Tn(z4,"isElementPreceding");function Kp(e,a){return!e[1].element||!a[1].element?0:z4(e[1].element,a[1].element)?-1:1}Tn(Kp,"sortByDocumentPosition");function L4(e){return new MutationObserver(i=>{for(const r of i)if(r.type==="childList"){e();return}})}Tn(L4,"getChildListObserver");var eN=Object.defineProperty,bs=(e,a)=>eN(e,"name",{value:a,configurable:!0}),B4=!!(typeof window<"u"&&window.document&&window.document.createElement);function St(e,a,{checkForDefaultPrevented:i=!0}={}){return bs(function(s){if(e==null||e(s),i===!1||!s||!s.defaultPrevented)return a==null?void 0:a(s)},"handleEvent")}bs(St,"composeEventHandlers");function tN(e){var a;if(!B4)throw new Error("Cannot access window outside of the DOM");return((a=e==null?void 0:e.ownerDocument)==null?void 0:a.defaultView)??window}bs(tN,"getOwnerWindow");function Xp(e){if(!B4)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}bs(Xp,"getOwnerDocument");function I4(e,a=!1){const{activeElement:i}=Xp(e);if(!(i!=null&&i.nodeName))return null;if(P4(i)&&i.contentDocument)return I4(i.contentDocument.body,a);if(a){const r=i.getAttribute("aria-activedescendant");if(r){const s=Xp(i).getElementById(r);if(s)return s}}return i}bs(I4,"getActiveElement");function P4(e){return e.tagName==="IFRAME"}bs(P4,"isFrame");var In=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},nN=Object.defineProperty,aN=(e,a)=>nN(e,"name",{value:a,configurable:!0}),sx=Bc[" useEffectEvent ".trim().toString()],cx=Bc[" useInsertionEffect ".trim().toString()];function H4(e){if(typeof sx=="function")return sx(e);const a=w.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof cx=="function"?cx(()=>{a.current=e}):In(()=>{a.current=e}),w.useMemo(()=>((...i)=>{var r;return(r=a.current)==null?void 0:r.call(a,...i)}),[])}aN(H4,"useEffectEvent");var iN=Object.defineProperty,Hc=(e,a)=>iN(e,"name",{value:a,configurable:!0}),rN=Bc[" useInsertionEffect ".trim().toString()]||In;function Ac({prop:e,defaultProp:a,onChange:i=Hc(()=>{},"onChange"),caller:r}){const[s,c,d]=q4({defaultProp:a,onChange:i}),f=e!==void 0,h=f?e:s,p=w.useCallback(y=>{var g;if(f){const b=U4(y)?y(e):y;b!==e&&((g=d.current)==null||g.call(d,b))}else c(y)},[f,e,c,d]);return[h,p]}Hc(Ac,"useControllableState");function q4({defaultProp:e,onChange:a}){const[i,r]=w.useState(e),s=w.useRef(i),c=w.useRef(a);return rN(()=>{c.current=a},[a]),w.useEffect(()=>{var d;s.current!==i&&((d=c.current)==null||d.call(c,i),s.current=i)},[i,s]),[i,r,c]}Hc(q4,"useUncontrolledState");function U4(e){return typeof e=="function"}Hc(U4,"isFunction");var ux=Symbol("RADIX:SYNC_STATE");function lN(e,a,i,r){const{prop:s,defaultProp:c,onChange:d,caller:f}=a,h=s!==void 0,p=H4(d),y=[{...i,state:c}];r&&y.push(r);const[g,b]=w.useReducer((N,E)=>{if(E.type===ux)return{...N,state:E.state};const M=e(N,E);return h&&!Object.is(M.state,N.state)&&p(M.state),M},...y),j=g.state,k=w.useRef(j);w.useEffect(()=>{k.current!==j&&(k.current=j,h||p(j))},[j,k,h]);const S=w.useMemo(()=>s!==void 0?{...g,state:s}:g,[g,s]);return w.useEffect(()=>{h&&!Object.is(s,g.state)&&b({type:ux,state:s})},[s,g.state,h]),[S,b]}Hc(lN,"useControllableStateReducer");var oN=Object.defineProperty,hr=(e,a)=>oN(e,"name",{value:a,configurable:!0});function F4(e,a){return w.useReducer((i,r)=>a[i][r]??i,e)}hr(F4,"useStateMachine");var Gi=hr(e=>{const{present:a,children:i}=e,r=V4(a),s=typeof i=="function"?i({present:r.isPresent}):w.Children.only(i),c=$4(r.ref,G4(s));return typeof i=="function"||r.isPresent?w.cloneElement(s,{ref:c}):null},"Presence");function V4(e){const[a,i]=w.useState(),r=w.useRef(null),s=w.useRef(e),c=w.useRef("none"),d=w.useRef(void 0),f=e?"mounted":"unmounted",[h,p]=F4(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{h==="mounted"?(c.current=d.current??cs(r.current),d.current=void 0):c.current="none"},[h]),In(()=>{const y=r.current,g=s.current;if(g!==e){const j=c.current,k=cs(y);e?(d.current=k,p("MOUNT")):k==="none"||(y==null?void 0:y.display)==="none"?p("UNMOUNT"):p(g&&j!==k?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,p]),In(()=>{if(a){let y;const g=a.ownerDocument.defaultView??window,b=hr(k=>{const N=cs(r.current).includes(CSS.escape(k.animationName));if(k.target===a&&N&&(p("ANIMATION_END"),!s.current)){const E=a.style.animationFillMode;a.style.animationFillMode="forwards",y=g.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=E)})}},"handleAnimationEnd"),j=hr(k=>{k.target===a&&(c.current=cs(r.current))},"handleAnimationStart");return a.addEventListener("animationstart",j),a.addEventListener("animationcancel",b),a.addEventListener("animationend",b),()=>{g.clearTimeout(y),a.removeEventListener("animationstart",j),a.removeEventListener("animationcancel",b),a.removeEventListener("animationend",b)}}else p("ANIMATION_END")},[a,p]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:w.useCallback(y=>{if(y){const g=getComputedStyle(y);r.current=g,d.current=cs(g)}else r.current=null;i(y)},[])}}hr(V4,"usePresence");function Qp(e,a){if(typeof e=="function")return e(a);e!=null&&(e.current=a)}hr(Qp,"setRef");function $4(...e){const a=w.useRef(e);return a.current=e,w.useCallback(i=>{const r=a.current;let s=!1;const c=r.map(d=>{const f=Qp(d,i);return!s&&typeof f=="function"&&(s=!0),f});if(s)return()=>{for(let d=0;d<c.length;d++){const f=c[d];typeof f=="function"?f():Qp(r[d],null)}}},[])}hr($4,"useStableComposedRefs");function cs(e){return(e==null?void 0:e.animationName)||"none"}hr(cs,"getAnimationName");function G4(e){var r,s;let a=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,i=a&&"isReactWarning"in a&&a.isReactWarning;return i?e.ref:(a=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,i=a&&"isReactWarning"in a&&a.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}hr(G4,"getElementRef");var sN=Object.defineProperty,cN=(e,a)=>sN(e,"name",{value:a,configurable:!0}),uN=Bc[" useId ".trim().toString()]||(()=>{}),dN=0;function ao(e){const[a,i]=w.useState(uN());return In(()=>{e||i(r=>r??String(dN++))},[e]),e||(a?`radix-${a}`:"")}cN(ao,"useId");var fN=Object.defineProperty,hN=(e,a)=>fN(e,"name",{value:a,configurable:!0}),mN=w.createContext(void 0);function F0(e){const a=w.useContext(mN);return e||a||"ltr"}hN(F0,"useDirection");var pN=Object.defineProperty,gN=(e,a)=>pN(e,"name",{value:a,configurable:!0});function Bn(e){const a=w.useRef(e);return w.useEffect(()=>{a.current=e}),w.useMemo(()=>((...i)=>{var r;return(r=a.current)==null?void 0:r.call(a,...i)}),[])}gN(Bn,"useCallbackRef");var vN=Object.defineProperty,En=(e,a)=>vN(e,"name",{value:a,configurable:!0}),Zp="dismissableLayer.update",yN="dismissableLayer.pointerDownOutside",xN="dismissableLayer.focusOutside",dx,Y4=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),V0=w.forwardRef(En(function(a,i){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,...y}=a,g=w.useContext(Y4),[b,j]=w.useState(null),k=(b==null?void 0:b.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=w.useState({}),N=Ot(i,j),E=Array.from(g.layers),[M]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),C=M?E.indexOf(M):-1,A=b?E.indexOf(b):-1,_=g.layersWithOutsidePointerEventsDisabled.size>0,R=A>=C,I=w.useRef(!1),G=X4(q=>{d==null||d(q),h==null||h(q),q.defaultPrevented||p==null||p()},{ownerDocument:k,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:g.dismissableSurfaces,shouldHandlePointerDownOutside:w.useCallback(q=>{if(!(q instanceof Node))return!1;const Z=[...g.branches].some(U=>U.contains(q));return R&&!Z},[g.branches,R])}),Y=Q4(q=>{if(s&&I.current)return;const Z=q.target;[...g.branches].some(F=>F.contains(Z))||(f==null||f(q),h==null||h(q),q.defaultPrevented||p==null||p())},k),L=b?A===E.length-1:!1,P=Bn(q=>{q.key==="Escape"&&(c==null||c(q),!q.defaultPrevented&&p&&(q.preventDefault(),p()))});return w.useEffect(()=>{if(L)return k.addEventListener("keydown",P,{capture:!0}),()=>k.removeEventListener("keydown",P,{capture:!0})},[k,L,P]),w.useEffect(()=>{if(b)return r&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(dx=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(b)),g.layers.add(b),Jp(),()=>{r&&(g.layersWithOutsidePointerEventsDisabled.delete(b),g.layersWithOutsidePointerEventsDisabled.size===0&&(k.body.style.pointerEvents=dx))}},[b,k,r,g]),w.useEffect(()=>()=>{b&&(g.layers.delete(b),g.layersWithOutsidePointerEventsDisabled.delete(b),Jp())},[b,g]),w.useEffect(()=>{const q=En(()=>S({}),"handleUpdate");return document.addEventListener(Zp,q),()=>document.removeEventListener(Zp,q)},[]),o.jsx(Kt.div,{...y,ref:N,style:{pointerEvents:_?R?"auto":"none":void 0,...a.style},onFocusCapture:St(a.onFocusCapture,Y.onFocusCapture),onBlurCapture:St(a.onBlurCapture,Y.onBlurCapture),onPointerDownCapture:St(a.onPointerDownCapture,G.onPointerDownCapture)})},"DismissableLayer"));function K4(){const e=w.useContext(Y4),[a,i]=w.useState(null);return w.useEffect(()=>{if(a)return e.dismissableSurfaces.add(a),()=>{e.dismissableSurfaces.delete(a)}},[a,e.dismissableSurfaces]),i}En(K4,"useDismissableLayerSurface");var bN=En(()=>!0,"IS_TRUE");function X4(e,a){const{ownerDocument:i=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:c,shouldHandlePointerDownOutside:d=bN}=a,f=Bn(e),h=w.useRef(!1),p=w.useRef(!1),y=w.useRef(new Map),g=w.useRef(()=>{});return w.useEffect(()=>{function b(){p.current=!1,s.current=!1,y.current.clear()}En(b,"resetOutsideInteraction");function j(){return Array.from(y.current.values()).some(Boolean)}En(j,"isOutsideInteractionIntercepted");function k(C){if(!p.current)return;const A=C.target;A instanceof Node&&[...c].some(R=>R.contains(A))||y.current.set(C.type,!0),C.type==="click"&&window.setTimeout(()=>{p.current&&g.current()},0)}En(k,"handleInteractionCapture");function S(C){p.current&&y.current.set(C.type,!1)}En(S,"handleInteractionBubble");const N=En(C=>{if(C.target&&!h.current){let A=function(){i.removeEventListener("click",g.current);const R=j();b(),R||$0(yN,f,_,{discrete:!0})};if(En(A,"handleAndDispatchPointerDownOutsideEvent"),!d(C.target)){i.removeEventListener("click",g.current),b(),h.current=!1;return}const _={originalEvent:C};p.current=!0,s.current=r&&C.button===0,y.current.clear(),!r||C.button!==0?A():(i.removeEventListener("click",g.current),g.current=A,i.addEventListener("click",g.current,{once:!0}))}else i.removeEventListener("click",g.current),b();h.current=!1},"handlePointerDown"),E=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const C of E)i.addEventListener(C,k,!0),i.addEventListener(C,S);const M=window.setTimeout(()=>{i.addEventListener("pointerdown",N)},0);return()=>{window.clearTimeout(M),i.removeEventListener("pointerdown",N),i.removeEventListener("click",g.current);for(const C of E)i.removeEventListener(C,k,!0),i.removeEventListener(C,S)}},[i,f,r,s,c,d]),{onPointerDownCapture:En(()=>h.current=!0,"onPointerDownCapture")}}En(X4,"usePointerDownOutside");function Q4(e,a=globalThis==null?void 0:globalThis.document){const i=Bn(e),r=w.useRef(!1);return w.useEffect(()=>{const s=En(c=>{c.target&&!r.current&&$0(xN,i,{originalEvent:c},{discrete:!1})},"handleFocus");return a.addEventListener("focusin",s),()=>a.removeEventListener("focusin",s)},[a,i]),{onFocusCapture:En(()=>r.current=!0,"onFocusCapture"),onBlurCapture:En(()=>r.current=!1,"onBlurCapture")}}En(Q4,"useFocusOutside");function Jp(){const e=new CustomEvent(Zp);document.dispatchEvent(e)}En(Jp,"dispatchUpdate");function $0(e,a,i,{discrete:r}){const s=i.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:i});a&&s.addEventListener(e,a,{once:!0}),r?M4(s,c):s.dispatchEvent(c)}En($0,"handleAndDispatchCustomEvent");var jN=Object.defineProperty,ta=(e,a)=>jN(e,"name",{value:a,configurable:!0}),Wm="focusScope.autoFocusOnMount",ep="focusScope.autoFocusOnUnmount",fx={bubbles:!1,cancelable:!0},G0=w.forwardRef(ta(function(a,i){const{loop:r=!1,trapped:s=!1,onMountAutoFocus:c,onUnmountAutoFocus:d,...f}=a,[h,p]=w.useState(null),y=Bn(c),g=Bn(d),b=w.useRef(null),j=Ot(i,p),k=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(s){let N=function(A){if(k.paused||!h)return;const _=A.target;h.contains(_)?b.current=_:ur(b.current,{select:!0})},E=function(A){if(k.paused||!h)return;const _=A.relatedTarget;_!==null&&(h.contains(_)||ur(b.current,{select:!0}))},M=function(A){if(document.activeElement===document.body)for(const R of A)R.removedNodes.length>0&&ur(h)};ta(N,"handleFocusIn"),ta(E,"handleFocusOut"),ta(M,"handleMutations"),document.addEventListener("focusin",N),document.addEventListener("focusout",E);const C=new MutationObserver(M);return h&&C.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",N),document.removeEventListener("focusout",E),C.disconnect()}}},[s,h,k.paused]),w.useEffect(()=>{if(h){hx.add(k);const N=document.activeElement;if(!h.contains(N)){const M=new CustomEvent(Wm,fx);h.addEventListener(Wm,y),h.dispatchEvent(M),M.defaultPrevented||(Z4(n3(Y0(h)),{select:!0}),document.activeElement===N&&ur(h))}return()=>{h.removeEventListener(Wm,y),setTimeout(()=>{const M=new CustomEvent(ep,fx);h.addEventListener(ep,g),h.dispatchEvent(M),M.defaultPrevented||ur(N??document.body,{select:!0}),h.removeEventListener(ep,g),hx.remove(k)},0)}}},[h,y,g,k]);const S=w.useCallback(N=>{if(!r&&!s||k.paused)return;const E=N.key==="Tab"&&!N.altKey&&!N.ctrlKey&&!N.metaKey,M=document.activeElement;if(E&&M){const C=N.currentTarget,[A,_]=J4(C);A&&_?!N.shiftKey&&M===_?(N.preventDefault(),r&&ur(A,{select:!0})):N.shiftKey&&M===A&&(N.preventDefault(),r&&ur(_,{select:!0})):M===C&&N.preventDefault()}},[r,s,k.paused]);return o.jsx(Kt.div,{tabIndex:-1,...f,ref:j,onKeyDown:S})},"FocusScope"));function Z4(e,{select:a=!1}={}){const i=document.activeElement;for(const r of e)if(ur(r,{select:a}),document.activeElement!==i)return}ta(Z4,"focusFirst");function J4(e){const a=Y0(e),i=Wp(a,e),r=Wp(a.reverse(),e);return[i,r]}ta(J4,"getTabbableEdges");function Y0(e){const a=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:ta(r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;i.nextNode();)a.push(i.currentNode);return a}ta(Y0,"getTabbableCandidates");function Wp(e,a){const i=typeof a.checkVisibility=="function"&&a.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(i?!r.checkVisibility({checkVisibilityCSS:!0}):W4(r,{upTo:a})))return r}ta(Wp,"findVisible");function W4(e,{upTo:a}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(a!==void 0&&e===a)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}ta(W4,"isHidden");function e3(e){return e instanceof HTMLInputElement&&"select"in e}ta(e3,"isSelectableInput");function ur(e,{select:a=!1}={}){if(e&&e.focus){const i=document.activeElement;e.focus({preventScroll:!0}),e!==i&&e3(e)&&a&&e.select()}}ta(ur,"focus");var hx=t3();function t3(){let e=[];return{add(a){const i=e[0];a!==i&&(i==null||i.pause()),e=e0(e,a),e.unshift(a)},remove(a){var i;e=e0(e,a),(i=e[0])==null||i.resume()}}}ta(t3,"createFocusScopesStack");function e0(e,a){const i=[...e],r=i.indexOf(a);return r!==-1&&i.splice(r,1),i}ta(e0,"arrayRemove");function n3(e){return e.filter(a=>a.tagName!=="A")}ta(n3,"removeLinks");var wN=Object.defineProperty,kN=(e,a)=>wN(e,"name",{value:a,configurable:!0}),K0=w.forwardRef(kN(function(a,i){var h;const{container:r,...s}=a,[c,d]=w.useState(!1);In(()=>d(!0),[]);const f=r||c&&((h=globalThis==null?void 0:globalThis.document)==null?void 0:h.body);return f?ho.createPortal(o.jsx(Kt.div,{...s,ref:i}),f):null},"Portal")),SN=Object.defineProperty,X0=(e,a)=>SN(e,"name",{value:a,configurable:!0}),gd=0,Di=null;function CN(e){return qc(),e.children}X0(CN,"FocusGuards");function qc(){w.useEffect(()=>{Di||(Di={start:t0(),end:t0()});const{start:e,end:a}=Di;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==a&&document.body.insertAdjacentElement("beforeend",a),gd++,()=>{gd===1&&(Di==null||Di.start.remove(),Di==null||Di.end.remove(),Di=null),gd=Math.max(0,gd-1)}},[])}X0(qc,"useFocusGuards");function t0(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}X0(t0,"createFocusGuard");var Bi=function(){return Bi=Object.assign||function(a){for(var i,r=1,s=arguments.length;r<s;r++){i=arguments[r];for(var c in i)Object.prototype.hasOwnProperty.call(i,c)&&(a[c]=i[c])}return a},Bi.apply(this,arguments)};function a3(e,a){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&a.indexOf(r)<0&&(i[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)a.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(i[r[s]]=e[r[s]]);return i}function NN(e,a,i){if(i||arguments.length===2)for(var r=0,s=a.length,c;r<s;r++)(c||!(r in a))&&(c||(c=Array.prototype.slice.call(a,0,r)),c[r]=a[r]);return e.concat(c||Array.prototype.slice.call(a))}var Bd="right-scroll-bar-position",Id="width-before-scroll-bar",EN="with-scroll-bars-hidden",TN="--removed-body-scroll-bar-size";function tp(e,a){return typeof e=="function"?e(a):e&&(e.current=a),e}function AN(e,a){var i=w.useState(function(){return{value:e,callback:a,facade:{get current(){return i.value},set current(r){var s=i.value;s!==r&&(i.value=r,i.callback(r,s))}}}})[0];return i.callback=a,i.facade}var MN=typeof window<"u"?w.useLayoutEffect:w.useEffect,mx=new WeakMap;function _N(e,a){var i=AN(null,function(r){return e.forEach(function(s){return tp(s,r)})});return MN(function(){var r=mx.get(i);if(r){var s=new Set(r),c=new Set(e),d=i.current;s.forEach(function(f){c.has(f)||tp(f,null)}),c.forEach(function(f){s.has(f)||tp(f,d)})}mx.set(i,e)},[e]),i}function RN(e){return e}function ON(e,a){a===void 0&&(a=RN);var i=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:e},useMedium:function(c){var d=a(c,r);return i.push(d),function(){i=i.filter(function(f){return f!==d})}},assignSyncMedium:function(c){for(r=!0;i.length;){var d=i;i=[],d.forEach(c)}i={push:function(f){return c(f)},filter:function(){return i}}},assignMedium:function(c){r=!0;var d=[];if(i.length){var f=i;i=[],f.forEach(c),d=i}var h=function(){var y=d;d=[],y.forEach(c)},p=function(){return Promise.resolve().then(h)};p(),i={push:function(y){d.push(y),p()},filter:function(y){return d=d.filter(y),i}}}};return s}function DN(e){e===void 0&&(e={});var a=ON(null);return a.options=Bi({async:!0,ssr:!1},e),a}var i3=function(e){var a=e.sideCar,i=a3(e,["sideCar"]);if(!a)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=a.read();if(!r)throw new Error("Sidecar medium not found");return w.createElement(r,Bi({},i))};i3.isSideCarExport=!0;function zN(e,a){return e.useMedium(a),i3}var r3=DN(),np=function(){},sf=w.forwardRef(function(e,a){var i=w.useRef(null),r=w.useState({onScrollCapture:np,onWheelCapture:np,onTouchMoveCapture:np}),s=r[0],c=r[1],d=e.forwardProps,f=e.children,h=e.className,p=e.removeScrollBar,y=e.enabled,g=e.shards,b=e.sideCar,j=e.noRelative,k=e.noIsolation,S=e.inert,N=e.allowPinchZoom,E=e.as,M=E===void 0?"div":E,C=e.gapMode,A=a3(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=b,R=_N([i,a]),I=Bi(Bi({},A),s);return w.createElement(w.Fragment,null,y&&w.createElement(_,{sideCar:r3,removeScrollBar:p,shards:g,noRelative:j,noIsolation:k,inert:S,setCallbacks:c,allowPinchZoom:!!N,lockRef:i,gapMode:C}),d?w.cloneElement(w.Children.only(f),Bi(Bi({},I),{ref:R})):w.createElement(M,Bi({},I,{className:h,ref:R}),f))});sf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};sf.classNames={fullWidth:Id,zeroRight:Bd};var LN=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function BN(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var a=LN();return a&&e.setAttribute("nonce",a),e}function IN(e,a){e.styleSheet?e.styleSheet.cssText=a:e.appendChild(document.createTextNode(a))}function PN(e){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(e)}var HN=function(){var e=0,a=null;return{add:function(i){e==0&&(a=BN())&&(IN(a,i),PN(a)),e++},remove:function(){e--,!e&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},qN=function(){var e=HN();return function(a,i){w.useEffect(function(){return e.add(a),function(){e.remove()}},[a&&i])}},l3=function(){var e=qN(),a=function(i){var r=i.styles,s=i.dynamic;return e(r,s),null};return a},UN={left:0,top:0,right:0,gap:0},ap=function(e){return parseInt(e||"",10)||0},FN=function(e){var a=window.getComputedStyle(document.body),i=a[e==="padding"?"paddingLeft":"marginLeft"],r=a[e==="padding"?"paddingTop":"marginTop"],s=a[e==="padding"?"paddingRight":"marginRight"];return[ap(i),ap(r),ap(s)]},VN=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return UN;var a=FN(e),i=document.documentElement.clientWidth,r=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,r-i+a[2]-a[0])}},$N=l3(),fs="data-scroll-locked",GN=function(e,a,i,r){var s=e.left,c=e.top,d=e.right,f=e.gap;return i===void 0&&(i="margin"),`
525
+ .`.concat(EN,` {
526
+ overflow: hidden `).concat(r,`;
527
+ padding-right: `).concat(f,"px ").concat(r,`;
528
+ }
529
+ body[`).concat(fs,`] {
530
+ overflow: hidden `).concat(r,`;
531
+ overscroll-behavior: contain;
532
+ `).concat([a&&"position: relative ".concat(r,";"),i==="margin"&&`
533
+ padding-left: `.concat(s,`px;
534
+ padding-top: `).concat(c,`px;
535
+ padding-right: `).concat(d,`px;
536
+ margin-left:0;
537
+ margin-top:0;
538
+ margin-right: `).concat(f,"px ").concat(r,`;
539
+ `),i==="padding"&&"padding-right: ".concat(f,"px ").concat(r,";")].filter(Boolean).join(""),`
540
+ }
541
+
542
+ .`).concat(Bd,` {
543
+ right: `).concat(f,"px ").concat(r,`;
544
+ }
545
+
546
+ .`).concat(Id,` {
547
+ margin-right: `).concat(f,"px ").concat(r,`;
548
+ }
549
+
550
+ .`).concat(Bd," .").concat(Bd,` {
551
+ right: 0 `).concat(r,`;
552
+ }
553
+
554
+ .`).concat(Id," .").concat(Id,` {
555
+ margin-right: 0 `).concat(r,`;
556
+ }
557
+
558
+ body[`).concat(fs,`] {
559
+ `).concat(TN,": ").concat(f,`px;
560
+ }
561
+ `)},px=function(){var e=parseInt(document.body.getAttribute(fs)||"0",10);return isFinite(e)?e:0},YN=function(){w.useEffect(function(){return document.body.setAttribute(fs,(px()+1).toString()),function(){var e=px()-1;e<=0?document.body.removeAttribute(fs):document.body.setAttribute(fs,e.toString())}},[])},KN=function(e){var a=e.noRelative,i=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;YN();var c=w.useMemo(function(){return VN(s)},[s]);return w.createElement($N,{styles:GN(c,!a,s,i?"":"!important")})},n0=!1;if(typeof window<"u")try{var vd=Object.defineProperty({},"passive",{get:function(){return n0=!0,!0}});window.addEventListener("test",vd,vd),window.removeEventListener("test",vd,vd)}catch{n0=!1}var as=n0?{passive:!1}:!1,XN=function(e){return e.tagName==="TEXTAREA"},o3=function(e,a){if(!(e instanceof Element))return!1;var i=window.getComputedStyle(e);return i[a]!=="hidden"&&!(i.overflowY===i.overflowX&&!XN(e)&&i[a]==="visible")},QN=function(e){return o3(e,"overflowY")},ZN=function(e){return o3(e,"overflowX")},gx=function(e,a){var i=a.ownerDocument,r=a;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=s3(e,r);if(s){var c=c3(e,r),d=c[1],f=c[2];if(d>f)return!0}r=r.parentNode}while(r&&r!==i.body);return!1},JN=function(e){var a=e.scrollTop,i=e.scrollHeight,r=e.clientHeight;return[a,i,r]},WN=function(e){var a=e.scrollLeft,i=e.scrollWidth,r=e.clientWidth;return[a,i,r]},s3=function(e,a){return e==="v"?QN(a):ZN(a)},c3=function(e,a){return e==="v"?JN(a):WN(a)},eE=function(e,a){return e==="h"&&a==="rtl"?-1:1},tE=function(e,a,i,r,s){var c=eE(e,window.getComputedStyle(a).direction),d=c*r,f=i.target,h=a.contains(f),p=!1,y=d>0,g=0,b=0;do{if(!f)break;var j=c3(e,f),k=j[0],S=j[1],N=j[2],E=S-N-c*k;(k||E)&&s3(e,f)&&(g+=E,b+=k);var M=f.parentNode;f=M&&M.nodeType===Node.DOCUMENT_FRAGMENT_NODE?M.host:M}while(!h&&f!==document.body||h&&(a.contains(f)||a===f));return(y&&Math.abs(g)<1||!y&&Math.abs(b)<1)&&(p=!0),p},yd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},vx=function(e){return[e.deltaX,e.deltaY]},yx=function(e){return e&&"current"in e?e.current:e},nE=function(e,a){return e[0]===a[0]&&e[1]===a[1]},aE=function(e){return`
562
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
563
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
564
+ `)},iE=0,is=[];function rE(e){var a=w.useRef([]),i=w.useRef([0,0]),r=w.useRef(),s=w.useState(iE++)[0],c=w.useState(l3)[0],d=w.useRef(e);w.useEffect(function(){d.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var S=NN([e.lockRef.current],(e.shards||[]).map(yx),!0).filter(Boolean);return S.forEach(function(N){return N.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),S.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var f=w.useCallback(function(S,N){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!d.current.allowPinchZoom;var E=yd(S),M=i.current,C="deltaX"in S?S.deltaX:M[0]-E[0],A="deltaY"in S?S.deltaY:M[1]-E[1],_,R=S.target,I=Math.abs(C)>Math.abs(A)?"h":"v";if("touches"in S&&I==="h"&&R.type==="range")return!1;var G=window.getSelection(),Y=G&&G.anchorNode,L=Y?Y===R||Y.contains(R):!1;if(L)return!1;var P=gx(I,R);if(!P)return!0;if(P?_=I:(_=I==="v"?"h":"v",P=gx(I,R)),!P)return!1;if(!r.current&&"changedTouches"in S&&(C||A)&&(r.current=_),!_)return!0;var q=r.current||_;return tE(q,N,S,q==="h"?C:A)},[]),h=w.useCallback(function(S){var N=S;if(!(!is.length||is[is.length-1]!==c)){var E="deltaY"in N?vx(N):yd(N),M=a.current.filter(function(_){return _.name===N.type&&(_.target===N.target||N.target===_.shadowParent)&&nE(_.delta,E)})[0];if(M&&M.should){N.cancelable&&N.preventDefault();return}if(!M){var C=(d.current.shards||[]).map(yx).filter(Boolean).filter(function(_){return _.contains(N.target)}),A=C.length>0?f(N,C[0]):!d.current.noIsolation;A&&N.cancelable&&N.preventDefault()}}},[]),p=w.useCallback(function(S,N,E,M){var C={name:S,delta:N,target:E,should:M,shadowParent:lE(E)};a.current.push(C),setTimeout(function(){a.current=a.current.filter(function(A){return A!==C})},1)},[]),y=w.useCallback(function(S){i.current=yd(S),r.current=void 0},[]),g=w.useCallback(function(S){p(S.type,vx(S),S.target,f(S,e.lockRef.current))},[]),b=w.useCallback(function(S){p(S.type,yd(S),S.target,f(S,e.lockRef.current))},[]);w.useEffect(function(){return is.push(c),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",h,as),document.addEventListener("touchmove",h,as),document.addEventListener("touchstart",y,as),function(){is=is.filter(function(S){return S!==c}),document.removeEventListener("wheel",h,as),document.removeEventListener("touchmove",h,as),document.removeEventListener("touchstart",y,as)}},[]);var j=e.removeScrollBar,k=e.inert;return w.createElement(w.Fragment,null,k?w.createElement(c,{styles:aE(s)}):null,j?w.createElement(KN,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function lE(e){for(var a=null;e!==null;)e instanceof ShadowRoot&&(a=e.host,e=e.host),e=e.parentNode;return a}const oE=zN(r3,rE);var cf=w.forwardRef(function(e,a){return w.createElement(sf,Bi({},e,{ref:a,sideCar:oE}))});cf.classNames=sf.classNames;var sE=function(e){if(typeof document>"u")return null;var a=Array.isArray(e)?e[0]:e;return a.ownerDocument.body},rs=new WeakMap,xd=new WeakMap,bd={},ip=0,u3=function(e){return e&&(e.host||u3(e.parentNode))},cE=function(e,a){return a.map(function(i){if(e.contains(i))return i;var r=u3(i);return r&&e.contains(r)?r:(console.error("aria-hidden",i,"in not contained inside",e,". Doing nothing"),null)}).filter(function(i){return!!i})},uE=function(e,a,i,r){var s=cE(a,Array.isArray(e)?e:[e]);bd[i]||(bd[i]=new WeakMap);var c=bd[i],d=[],f=new Set,h=new Set(s),p=function(g){!g||f.has(g)||(f.add(g),p(g.parentNode))};s.forEach(p);var y=function(g){!g||h.has(g)||Array.prototype.forEach.call(g.children,function(b){if(f.has(b))y(b);else try{var j=b.getAttribute(r),k=j!==null&&j!=="false",S=(rs.get(b)||0)+1,N=(c.get(b)||0)+1;rs.set(b,S),c.set(b,N),d.push(b),S===1&&k&&xd.set(b,!0),N===1&&b.setAttribute(i,"true"),k||b.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",b,E)}})};return y(a),f.clear(),ip++,function(){d.forEach(function(g){var b=rs.get(g)-1,j=c.get(g)-1;rs.set(g,b),c.set(g,j),b||(xd.has(g)||g.removeAttribute(r),xd.delete(g)),j||g.removeAttribute(i)}),ip--,ip||(rs=new WeakMap,rs=new WeakMap,xd=new WeakMap,bd={})}},Q0=function(e,a,i){i===void 0&&(i="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=sE(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),uE(r,s,i,"aria-hidden")):function(){return null}},dE=Object.defineProperty,vi=(e,a)=>dE(e,"name",{value:a,configurable:!0}),Z0="Dialog",[d3,Iq]=pl(Z0),[fE,br]=d3(Z0),hE=vi(e=>{const{__scopeDialog:a,children:i,open:r,defaultOpen:s,onOpenChange:c,modal:d=!0}=e,f=w.useRef(null),h=w.useRef(null),[p,y]=Ac({prop:r,defaultProp:s??!1,onChange:c,caller:Z0}),[g,b]=w.useState(0),[j,k]=w.useState(0);return o.jsx(fE,{scope:a,triggerRef:f,contentRef:h,contentId:ao(),titleId:ao(),descriptionId:ao(),titlePresent:g>0,descriptionPresent:j>0,setTitleCount:b,setDescriptionCount:k,open:p,onOpenChange:y,onOpenToggle:w.useCallback(()=>y(S=>!S),[y]),modal:d,children:i})},"Dialog"),f3="DialogPortal",[mE,h3]=d3(f3,{forceMount:void 0}),pE=vi(e=>{const{__scopeDialog:a,forceMount:i,children:r,container:s}=e,c=br(f3,a);return o.jsx(mE,{scope:a,forceMount:i,children:w.Children.map(r,d=>o.jsx(Gi,{present:i||c.open,children:o.jsx(K0,{asChild:!0,container:s,children:d})}))})},"DialogPortal"),a0="DialogOverlay",gE=w.forwardRef(vi(function(a,i){const r=h3(a0,a.__scopeDialog),{forceMount:s=r.forceMount,...c}=a,d=br(a0,a.__scopeDialog);return d.modal?o.jsx(Gi,{present:s||d.open,children:o.jsx(yE,{...c,ref:i})}):null},"DialogOverlay")),vE=Ui("DialogOverlay.RemoveScroll"),yE=w.forwardRef(vi(function(a,i){const{__scopeDialog:r,...s}=a,c=br(a0,r),d=K4(),f=Ot(i,d);return o.jsx(cf,{as:vE,allowPinchZoom:!0,shards:[c.contentRef],children:o.jsx(Kt.div,{"data-state":J0(c.open),...s,ref:f,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),Mc="DialogContent",xE=w.forwardRef(vi(function(a,i){const r=h3(Mc,a.__scopeDialog),{forceMount:s=r.forceMount,...c}=a,d=br(Mc,a.__scopeDialog);return o.jsx(Gi,{present:s||d.open,children:d.modal?o.jsx(bE,{...c,ref:i}):o.jsx(jE,{...c,ref:i})})},"DialogContent")),bE=w.forwardRef(vi(function(a,i){const r=br(Mc,a.__scopeDialog),s=w.useRef(null),c=Ot(i,r.contentRef,s);return w.useEffect(()=>{const d=s.current;if(d)return Q0(d)},[]),o.jsx(m3,{...a,ref:c,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:St(a.onCloseAutoFocus,d=>{var f;d.preventDefault(),(f=r.triggerRef.current)==null||f.focus()}),onPointerDownOutside:St(a.onPointerDownOutside,d=>{const f=d.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0;(f.button===2||h)&&d.preventDefault()}),onFocusOutside:St(a.onFocusOutside,d=>d.preventDefault())})},"DialogContentModal")),jE=w.forwardRef(vi(function(a,i){const r=br(Mc,a.__scopeDialog),s=w.useRef(!1),c=w.useRef(!1);return o.jsx(m3,{...a,ref:i,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var f,h;(f=a.onCloseAutoFocus)==null||f.call(a,d),d.defaultPrevented||(s.current||(h=r.triggerRef.current)==null||h.focus(),d.preventDefault()),s.current=!1,c.current=!1},onInteractOutside:d=>{var p,y;(p=a.onInteractOutside)==null||p.call(a,d),d.defaultPrevented||(s.current=!0,d.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const f=d.target;((y=r.triggerRef.current)==null?void 0:y.contains(f))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&c.current&&d.preventDefault()}})},"DialogContentNonModal")),m3=w.forwardRef(vi(function(a,i){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:c,onCloseAutoFocus:d,...f}=a,h=br(Mc,r);return qc(),o.jsx(o.Fragment,{children:o.jsx(G0,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:c,onUnmountAutoFocus:d,children:o.jsx(V0,{role:"dialog",id:h.contentId,"aria-describedby":h.descriptionPresent?h.descriptionId:void 0,"aria-labelledby":h.titlePresent?h.titleId:void 0,"data-state":J0(h.open),...f,ref:i,deferPointerDownOutside:!0,onDismiss:()=>h.onOpenChange(!1)})})})},"DialogContentImpl")),wE="DialogTitle",kE=w.forwardRef(vi(function(a,i){const{__scopeDialog:r,...s}=a,c=br(wE,r),{setTitleCount:d}=c;return In(()=>(d(f=>f+1),()=>d(f=>f-1)),[d]),o.jsx(Kt.h2,{id:c.titleId,...s,ref:i})},"DialogTitle")),SE="DialogClose",CE=w.forwardRef(vi(function(a,i){const{__scopeDialog:r,...s}=a,c=br(SE,r);return o.jsx(Kt.button,{type:"button",...s,ref:i,onClick:St(a.onClick,()=>c.onOpenChange(!1))})},"DialogClose"));function J0(e){return e?"open":"closed"}vi(J0,"getState");var NE=Object.defineProperty,EE=(e,a)=>NE(e,"name",{value:a,configurable:!0});function p3(e){const[a,i]=w.useState(void 0);return In(()=>{if(e){i({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const c=s[0];let d,f;if("borderBoxSize"in c){const h=c.borderBoxSize,p=Array.isArray(h)?h[0]:h;d=p.inlineSize,f=p.blockSize}else d=e.offsetWidth,f=e.offsetHeight;i({width:d,height:f})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else i(void 0)},[e]),a}EE(p3,"useSize");const TE=["top","right","bottom","left"],dl=Math.min,dr=Math.max,$d=Math.round,jd=Math.floor,fr=e=>({x:e,y:e}),AE={left:"right",right:"left",bottom:"top",top:"bottom"};function g3(e,a,i){return dr(e,dl(a,i))}function mr(e,a){return typeof e=="function"?e(a):e}function fl(e){return e.split("-")[0]}function js(e){return e.split("-")[1]}function W0(e){return e==="x"?"y":"x"}function eg(e){return e==="y"?"height":"width"}function Pi(e){const a=e[0];return a==="t"||a==="b"?"y":"x"}function tg(e){return W0(Pi(e))}function ME(e,a,i){i===void 0&&(i=!1);const r=js(e),s=tg(e),c=eg(s);let d=s==="x"?r===(i?"end":"start")?"right":"left":r==="start"?"bottom":"top";return a.reference[c]>a.floating[c]&&(d=Gd(d)),[d,Gd(d)]}function _E(e){const a=Gd(e);return[i0(e),a,i0(a)]}function i0(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const xx=["left","right"],bx=["right","left"],RE=["top","bottom"],OE=["bottom","top"];function DE(e,a,i){switch(e){case"top":case"bottom":return i?a?bx:xx:a?xx:bx;case"left":case"right":return a?RE:OE;default:return[]}}function zE(e,a,i,r){const s=js(e);let c=DE(fl(e),i==="start",r);return s&&(c=c.map(d=>d+"-"+s),a&&(c=c.concat(c.map(i0)))),c}function Gd(e){const a=fl(e);return AE[a]+e.slice(a.length)}function LE(e){var a,i,r,s;return{top:(a=e.top)!=null?a:0,right:(i=e.right)!=null?i:0,bottom:(r=e.bottom)!=null?r:0,left:(s=e.left)!=null?s:0}}function v3(e){return typeof e!="number"?LE(e):{top:e,right:e,bottom:e,left:e}}function Yd(e){const{x:a,y:i,width:r,height:s}=e;return{width:r,height:s,top:i,left:a,right:a+r,bottom:i+s,x:a,y:i}}function jx(e,a,i){let{reference:r,floating:s}=e;const c=Pi(a),d=tg(a),f=eg(d),h=fl(a),p=c==="y",y=r.x+r.width/2-s.width/2,g=r.y+r.height/2-s.height/2,b=r[f]/2-s[f]/2;let j;switch(h){case"top":j={x:y,y:r.y-s.height};break;case"bottom":j={x:y,y:r.y+r.height};break;case"right":j={x:r.x+r.width,y:g};break;case"left":j={x:r.x-s.width,y:g};break;default:j={x:r.x,y:r.y}}const k=js(a);return k&&(j[d]+=b*(k==="end"?1:-1)*(i&&p?-1:1)),j}async function BE(e,a){var i;a===void 0&&(a={});const{x:r,y:s,platform:c,rects:d,elements:f,strategy:h}=e,{boundary:p="clippingAncestors",rootBoundary:y="viewport",elementContext:g="floating",altBoundary:b=!1,padding:j=0}=mr(a,e),k=v3(j),N=f[b?g==="floating"?"reference":"floating":g],E=Yd(await c.getClippingRect({element:(i=await(c.isElement==null?void 0:c.isElement(N)))==null||i?N:N.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(f.floating)),boundary:p,rootBoundary:y,strategy:h})),M=g==="floating"?{x:r,y:s,width:d.floating.width,height:d.floating.height}:d.reference,C=await(c.getOffsetParent==null?void 0:c.getOffsetParent(f.floating)),A=await(c.isElement==null?void 0:c.isElement(C))&&await(c.getScale==null?void 0:c.getScale(C))||{x:1,y:1},_=Yd(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:M,offsetParent:C,strategy:h}):M);return{top:(E.top-_.top+k.top)/A.y,bottom:(_.bottom-E.bottom+k.bottom)/A.y,left:(E.left-_.left+k.left)/A.x,right:(_.right-E.right+k.right)/A.x}}const IE=50,PE=async(e,a,i)=>{const{placement:r="bottom",strategy:s="absolute",middleware:c=[],platform:d}=i,f=d.detectOverflow?d:{...d,detectOverflow:BE},h=await(d.isRTL==null?void 0:d.isRTL(a));let p=await d.getElementRects({reference:e,floating:a,strategy:s}),{x:y,y:g}=jx(p,r,h),b=r,j=0;const k={};for(let S=0;S<c.length;S++){const N=c[S];if(!N)continue;const{name:E,fn:M}=N,{x:C,y:A,data:_,reset:R}=await M({x:y,y:g,initialPlacement:r,placement:b,strategy:s,middlewareData:k,rects:p,platform:f,elements:{reference:e,floating:a}});y=C??y,g=A??g,k[E]={...k[E],..._},R&&j<IE&&(j++,typeof R=="object"&&(R.placement&&(b=R.placement),R.rects&&(p=R.rects===!0?await d.getElementRects({reference:e,floating:a,strategy:s}):R.rects),{x:y,y:g}=jx(p,b,h)),S=-1)}return{x:y,y:g,placement:b,strategy:s,middlewareData:k}},HE=e=>({name:"arrow",options:e,async fn(a){const{x:i,y:r,placement:s,rects:c,platform:d,elements:f,middlewareData:h}=a,{element:p,padding:y=0}=mr(e,a)||{};if(p==null)return{};const g=v3(y),b={x:i,y:r},j=tg(s),k=eg(j),S=await d.getDimensions(p),N=j==="y",E=N?"top":"left",M=N?"bottom":"right",C=N?"clientHeight":"clientWidth",A=c.reference[k]+c.reference[j]-b[j]-c.floating[k],_=b[j]-c.reference[j],R=await(d.getOffsetParent==null?void 0:d.getOffsetParent(p));let I=R?R[C]:0;(!I||!await(d.isElement==null?void 0:d.isElement(R)))&&(I=f.floating[C]||c.floating[k]);const G=A/2-_/2,Y=I/2-S[k]/2-1,L=dl(g[E],Y),P=dl(g[M],Y),q=I-S[k]-P,Z=I/2-S[k]/2+G,U=g3(L,Z,q),F=!h.arrow&&js(s)!=null&&Z!==U&&c.reference[k]/2-(Z<L?L:P)-S[k]/2<0,X=F?Z<L?Z-L:Z-q:0;return{[j]:b[j]+X,data:{[j]:U,centerOffset:Z-U-X,...F&&{alignmentOffset:X}},reset:F}}}),qE=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(a){var i,r;const{placement:s,middlewareData:c,rects:d,initialPlacement:f,platform:h,elements:p}=a,{mainAxis:y=!0,crossAxis:g=!0,fallbackPlacements:b,fallbackStrategy:j="bestFit",fallbackAxisSideDirection:k="none",flipAlignment:S=!0,...N}=mr(e,a);if((i=c.arrow)!=null&&i.alignmentOffset)return{};const E=fl(s),M=Pi(f),C=fl(f)===f,A=await(h.isRTL==null?void 0:h.isRTL(p.floating)),_=b||(C||!S?[Gd(f)]:_E(f)),R=k!=="none";!b&&R&&_.push(...zE(f,S,k,A));const I=[f,..._],G=await h.detectOverflow(a,N),Y=[];let L=((r=c.flip)==null?void 0:r.overflows)||[];if(y&&Y.push(G[E]),g){const U=ME(s,d,A);Y.push(G[U[0]],G[U[1]])}if(L=[...L,{placement:s,overflows:Y}],!Y.every(U=>U<=0)){var P,q;const U=(((P=c.flip)==null?void 0:P.index)||0)+1,F=I[U];if(F&&(!(g==="alignment"?M!==Pi(F):!1)||L.every(H=>Pi(H.placement)===M?H.overflows[0]>0:!0)))return{data:{index:U,overflows:L},reset:{placement:F}};let X=(q=L.filter($=>$.overflows[0]<=0).sort(($,H)=>$.overflows[1]-H.overflows[1])[0])==null?void 0:q.placement;if(!X)switch(j){case"bestFit":{var Z;const $=(Z=L.filter(H=>{if(R){const ie=Pi(H.placement);return ie===M||ie==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(ie=>ie>0).reduce((ie,O)=>ie+O,0)]).sort((H,ie)=>H[1]-ie[1])[0])==null?void 0:Z[0];$&&(X=$);break}case"initialPlacement":X=f;break}if(s!==X)return{reset:{placement:X}}}return{}}}};function wx(e,a){return{top:e.top-a.height,right:e.right-a.width,bottom:e.bottom-a.height,left:e.left-a.width}}function kx(e){return TE.some(a=>e[a]>=0)}const UE=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(a){const{rects:i,platform:r}=a,{strategy:s="referenceHidden",...c}=mr(e,a);switch(s){case"referenceHidden":{const d=await r.detectOverflow(a,{...c,elementContext:"reference"}),f=wx(d,i.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:kx(f)}}}case"escaped":{const d=await r.detectOverflow(a,{...c,altBoundary:!0}),f=wx(d,i.floating);return{data:{escapedOffsets:f,escaped:kx(f)}}}default:return{}}}}},y3=new Set(["left","top"]);async function FE(e,a){const{placement:i,platform:r,elements:s}=e,c=await(r.isRTL==null?void 0:r.isRTL(s.floating)),d=fl(i),f=js(i),h=Pi(i)==="y",p=y3.has(d)?-1:1,y=c&&h?-1:1,g=mr(a,e);let{mainAxis:b,crossAxis:j,alignmentAxis:k}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return f&&typeof k=="number"&&(j=f==="end"?k*-1:k),h?{x:j*y,y:b*p}:{x:b*p,y:j*y}}const VE=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(a){var i,r;const{x:s,y:c,placement:d,middlewareData:f}=a,h=await FE(a,e);return d===((i=f.offset)==null?void 0:i.placement)&&(r=f.arrow)!=null&&r.alignmentOffset?{}:{x:s+h.x,y:c+h.y,data:{...h,placement:d}}}}},$E=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(a){const{x:i,y:r,placement:s,platform:c}=a,{mainAxis:d=!0,crossAxis:f=!1,limiter:h={fn:M=>{let{x:C,y:A}=M;return{x:C,y:A}}},...p}=mr(e,a),y={x:i,y:r},g=await c.detectOverflow(a,p),b=Pi(s),j=W0(b);let k=y[j],S=y[b];const N=(M,C)=>g3(C+g[M==="y"?"top":"left"],C,C-g[M==="y"?"bottom":"right"]);d&&(k=N(j,k)),f&&(S=N(b,S));const E=h.fn({...a,[j]:k,[b]:S});return{...E,data:{x:E.x-i,y:E.y-r,enabled:{[j]:d,[b]:f}}}}}},GE=function(e){return e===void 0&&(e={}),{options:e,fn(a){var i,r;const{x:s,y:c,placement:d,rects:f,middlewareData:h}=a,{offset:p=0,mainAxis:y=!0,crossAxis:g=!0}=mr(e,a),b={x:s,y:c},j=Pi(d),k=W0(j);let S=b[k],N=b[j];const E=mr(p,a),M=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:(i=E.mainAxis)!=null?i:0,crossAxis:(r=E.crossAxis)!=null?r:0};if(y){const _=k==="y"?"height":"width",R=f.reference[k]-f.floating[_]+M.mainAxis,I=f.reference[k]+f.reference[_]-M.mainAxis;S<R?S=R:S>I&&(S=I)}if(g){var C,A;const _=k==="y"?"width":"height",R=y3.has(fl(d)),I=f.reference[j]-f.floating[_]+(R&&((C=h.offset)==null?void 0:C[j])||0)+(R?0:M.crossAxis),G=f.reference[j]+f.reference[_]+(R?0:((A=h.offset)==null?void 0:A[j])||0)-(R?M.crossAxis:0);N<I?N=I:N>G&&(N=G)}return{[k]:S,[j]:N}}}},YE=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(a){const{placement:i,rects:r,platform:s,elements:c}=a,{apply:d=()=>{},...f}=mr(e,a),h=await s.detectOverflow(a,f),p=fl(i),y=js(i),g=Pi(i)==="y",{width:b,height:j}=r.floating;let k,S;p==="top"||p==="bottom"?(k=p,S=y===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(S=p,k=y==="end"?"top":"bottom");const N=j-h.top-h.bottom,E=b-h.left-h.right,M=dl(j-h[k],N),C=dl(b-h[S],E),A=a.middlewareData.shift,_=!A;let R=M,I=C;A!=null&&A.enabled.x&&(I=E),A!=null&&A.enabled.y&&(R=N),_&&!y&&(g?I=b-2*dr(h.left,h.right):R=j-2*dr(h.top,h.bottom)),await d({...a,availableWidth:I,availableHeight:R});const G=await s.getDimensions(c.floating);return b!==G.width||j!==G.height?{reset:{rects:!0}}:{}}}};function uf(){return typeof window<"u"}function ws(e){return x3(e)?(e.nodeName||"").toLowerCase():"#document"}function ha(e){var a;return(e==null||(a=e.ownerDocument)==null?void 0:a.defaultView)||window}function jr(e){var a;return(a=(x3(e)?e.ownerDocument:e.document)||window.document)==null?void 0:a.documentElement}function x3(e){return uf()?e instanceof Node||e instanceof ha(e).Node:!1}function Fi(e){return uf()?e instanceof Element||e instanceof ha(e).Element:!1}function gl(e){return uf()?e instanceof HTMLElement||e instanceof ha(e).HTMLElement:!1}function Sx(e){return!uf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ha(e).ShadowRoot}function df(e){const{overflow:a,overflowX:i,overflowY:r,display:s}=Vi(e);return/auto|scroll|overlay|hidden|clip/.test(a+r+i)&&s!=="inline"&&s!=="contents"}function KE(e){return/^(table|td|th)$/.test(ws(e))}function ff(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const XE=/transform|translate|scale|rotate|perspective|filter/,QE=/paint|layout|strict|content/,Ql=e=>!!e&&e!=="none";let rp;function ng(e){const a=Fi(e)?Vi(e):e;return Ql(a.transform)||Ql(a.translate)||Ql(a.scale)||Ql(a.rotate)||Ql(a.perspective)||!ag()&&(Ql(a.backdropFilter)||Ql(a.filter))||XE.test(a.willChange||"")||QE.test(a.contain||"")}function ZE(e){let a=oo(e);for(;gl(a)&&!_c(a);){if(ng(a))return a;if(ff(a))return null;a=oo(a)}return null}function ag(){return rp==null&&(rp=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),rp}function _c(e){return/^(html|body|#document)$/.test(ws(e))}function Vi(e){return ha(e).getComputedStyle(e)}function hf(e){return Fi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oo(e){if(ws(e)==="html")return e;const a=e.assignedSlot||e.parentNode||Sx(e)&&e.host||jr(e);return Sx(a)?a.host:a}function b3(e){const a=oo(e);return _c(a)?(e.ownerDocument||e).body:gl(a)&&df(a)?a:b3(a)}function Rc(e,a,i){var r;a===void 0&&(a=[]),i===void 0&&(i=!0);const s=b3(e),c=s===((r=e.ownerDocument)==null?void 0:r.body),d=ha(s);if(c){const f=r0(d);return a.concat(d,d.visualViewport||[],df(s)?s:[],f&&i?Rc(f):[])}else return a.concat(s,Rc(s,[],i))}function r0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function j3(e){const a=Vi(e);let i=parseFloat(a.width)||0,r=parseFloat(a.height)||0;const s=gl(e),c=s?e.offsetWidth:i,d=s?e.offsetHeight:r,f=$d(i)!==c||$d(r)!==d;return f&&(i=c,r=d),{width:i,height:r,$:f}}function ig(e){return Fi(e)?e:e.contextElement}function hs(e){const a=ig(e);if(!gl(a))return fr(1);const i=a.getBoundingClientRect(),{width:r,height:s,$:c}=j3(a);let d=(c?$d(i.width):i.width)/r,f=(c?$d(i.height):i.height)/s;return(!d||!Number.isFinite(d))&&(d=1),(!f||!Number.isFinite(f))&&(f=1),{x:d,y:f}}const JE=fr(0);function w3(e){const a=ha(e);return!ag()||!a.visualViewport?JE:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function WE(e,a,i){return a===void 0&&(a=!1),!!i&&a&&i===ha(e)}function so(e,a,i,r){a===void 0&&(a=!1),i===void 0&&(i=!1);const s=e.getBoundingClientRect(),c=ig(e);let d=fr(1);a&&(r?Fi(r)&&(d=hs(r)):d=hs(e));const f=WE(c,i,r)?w3(c):fr(0);let h=(s.left+f.x)/d.x,p=(s.top+f.y)/d.y,y=s.width/d.x,g=s.height/d.y;if(c&&r){const b=ha(c),j=Fi(r)?ha(r):r;let k=b,S=r0(k);for(;S&&j!==k;){const N=hs(S),E=S.getBoundingClientRect(),M=Vi(S),C=E.left+(S.clientLeft+parseFloat(M.paddingLeft))*N.x,A=E.top+(S.clientTop+parseFloat(M.paddingTop))*N.y;h*=N.x,p*=N.y,y*=N.x,g*=N.y,h+=C,p+=A,k=ha(S),S=r0(k)}}return Yd({width:y,height:g,x:h,y:p})}function mf(e,a){const i=hf(e).scrollLeft;return a?a.left+i:so(jr(e)).left+i}function k3(e,a){const i=e.getBoundingClientRect(),r=i.left+a.scrollLeft-mf(e,i),s=i.top+a.scrollTop;return{x:r,y:s}}function eT(e){let{elements:a,rect:i,offsetParent:r,strategy:s}=e;const c=s==="fixed",d=jr(r),f=a?ff(a.floating):!1;if(r===d||f&&c)return i;let h={scrollLeft:0,scrollTop:0},p=fr(1);const y=fr(0),g=gl(r);if((g||!c)&&((ws(r)!=="body"||df(d))&&(h=hf(r)),g)){const j=so(r);p=hs(r),y.x=j.x+r.clientLeft,y.y=j.y+r.clientTop}const b=d&&!g&&!c?k3(d,h):fr(0);return{width:i.width*p.x,height:i.height*p.y,x:i.x*p.x-h.scrollLeft*p.x+y.x+b.x,y:i.y*p.y-h.scrollTop*p.y+y.y+b.y}}function tT(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function nT(e){const a=hf(e),i=e.ownerDocument.body,r=dr(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=dr(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let c=-a.scrollLeft+mf(e);const d=-a.scrollTop;return Vi(i).direction==="rtl"&&(c+=dr(e.clientWidth,i.clientWidth)-r),{width:r,height:s,x:c,y:d}}const aT=25;function iT(e,a,i){i===void 0&&(i="viewport");const r=i==="layoutViewport",s=ha(e),c=jr(e),d=s.visualViewport;let f=c.clientWidth,h=c.clientHeight,p=0,y=0;if(d){const b=!ag()||a==="fixed";r?b||(p=-d.offsetLeft,y=-d.offsetTop):(f=d.width,h=d.height,b&&(p=d.offsetLeft,y=d.offsetTop))}if(mf(c)<=0){const b=c.ownerDocument,j=b.body,k=getComputedStyle(j),S=b.compatMode==="CSS1Compat"&&parseFloat(k.marginLeft)+parseFloat(k.marginRight)||0,N=Math.abs(c.clientWidth-j.clientWidth-S),E=getComputedStyle(c).scrollbarGutter==="stable both-edges"?N/2:N;E<=aT&&(f-=E)}return{width:f,height:h,x:p,y}}function rT(e,a){const i=so(e,!0,a==="fixed"),r=i.top+e.clientTop,s=i.left+e.clientLeft,c=hs(e),d=e.clientWidth*c.x,f=e.clientHeight*c.y,h=s*c.x,p=r*c.y;return{width:d,height:f,x:h,y:p}}function Cx(e,a,i){let r;if(a==="viewport"||a==="layoutViewport")r=iT(e,i,a);else if(a==="document")r=nT(jr(e));else if(Fi(a))r=rT(a,i);else{const s=w3(e);r={x:a.x-s.x,y:a.y-s.y,width:a.width,height:a.height}}return Yd(r)}function lT(e,a){const i=a.get(e);if(i)return i;let r=Rc(e,[],!1).filter(f=>Fi(f)&&ws(f)!=="body"),s=null;const c=Vi(e).position==="fixed";let d=c?oo(e):e;for(;Fi(d)&&!_c(d);){const f=Vi(d),h=ng(d),p=s?s.position:c?"fixed":"";!h&&(p==="fixed"||p==="absolute"&&f.position==="static")?r=r.filter(g=>g!==d):s=f,d=oo(d)}return a.set(e,r),r}function oT(e){let{element:a,boundary:i,rootBoundary:r,strategy:s}=e;const d=[...i==="clippingAncestors"?ff(a)?[]:lT(a,this._c):[].concat(i),r],f=Cx(a,d[0],s);let h=f.top,p=f.right,y=f.bottom,g=f.left;for(let b=1;b<d.length;b++){const j=Cx(a,d[b],s);h=dr(j.top,h),p=dl(j.right,p),y=dl(j.bottom,y),g=dr(j.left,g)}return{width:p-g,height:y-h,x:g,y:h}}function sT(e){const{width:a,height:i}=j3(e);return{width:a,height:i}}function cT(e,a,i){const r=gl(a),s=jr(a),c=i==="fixed",d=so(e,!0,c,a);let f={scrollLeft:0,scrollTop:0};const h=fr(0);if((r||!c)&&((ws(a)!=="body"||df(s))&&(f=hf(a)),r)){const b=so(a,!0,c,a);h.x=b.x+a.clientLeft,h.y=b.y+a.clientTop}!r&&s&&(h.x=mf(s));const p=s&&!r&&!c?k3(s,f):fr(0),y=d.left+f.scrollLeft-h.x-p.x,g=d.top+f.scrollTop-h.y-p.y;return{x:y,y:g,width:d.width,height:d.height}}function lp(e){return Vi(e).position==="static"}function Nx(e,a){if(!gl(e)||Vi(e).position==="fixed")return null;if(a)return a(e);let i=e.offsetParent;return jr(e)===i&&(i=i.ownerDocument.body),i}function S3(e,a){const i=ha(e);if(ff(e))return i;if(!gl(e)){let s=oo(e);for(;s&&!_c(s);){if(Fi(s)&&!lp(s))return s;s=oo(s)}return i}let r=Nx(e,a);for(;r&&KE(r)&&lp(r);)r=Nx(r,a);return r&&_c(r)&&lp(r)&&!ng(r)?i:r||ZE(e)||i}const uT=async function(e){const a=this.getOffsetParent||S3,i=this.getDimensions,r=await i(e.floating);return{reference:cT(e.reference,await a(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function dT(e){return Vi(e).direction==="rtl"}const fT={convertOffsetParentRelativeRectToViewportRelativeRect:eT,getDocumentElement:jr,getClippingRect:oT,getOffsetParent:S3,getElementRects:uT,getClientRects:tT,getDimensions:sT,getScale:hs,isElement:Fi,isRTL:dT};function C3(e,a){return e.x===a.x&&e.y===a.y&&e.width===a.width&&e.height===a.height}function hT(e,a,i){let r=null,s;const c=jr(e);function d(){var y;clearTimeout(s),(y=r)==null||y.disconnect(),r=null}function f(y,g){y===void 0&&(y=!1),g===void 0&&(g=1),d();const b=e.getBoundingClientRect(),{left:j,top:k,width:S,height:N}=b;if(y||a(),!S||!N)return;const E=jd(k),M=jd(c.clientWidth-(j+S)),C=jd(c.clientHeight-(k+N)),A=jd(j),R={rootMargin:-E+"px "+-M+"px "+-C+"px "+-A+"px",threshold:dr(0,dl(1,g))||1};let I=!0;function G(Y){const L=Y[0].intersectionRatio;if(!C3(b,e.getBoundingClientRect()))return f();if(L!==g){if(!I)return f();L?f(!1,L):s=setTimeout(()=>{f(!1,1e-7)},1e3)}I=!1}try{r=new IntersectionObserver(G,{...R,root:c.ownerDocument})}catch{r=new IntersectionObserver(G,R)}r.observe(e)}const h=ha(e),p=()=>f(i);return h.addEventListener("resize",p),f(!0),()=>{h.removeEventListener("resize",p),d()}}function mT(e,a,i,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:c=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,p=ig(e),y=s||c?[...p?Rc(p):[],...a?Rc(a):[]]:[];y.forEach(E=>{s&&E.addEventListener("scroll",i),c&&E.addEventListener("resize",i)});const g=p&&f?hT(p,i,c):null;let b=-1,j=null;d&&(j=new ResizeObserver(E=>{let[M]=E;M&&M.target===p&&j&&a&&(j.unobserve(a),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var C;(C=j)==null||C.observe(a)})),i()}),p&&!h&&j.observe(p),a&&j.observe(a));let k,S=h?so(e):null;h&&N();function N(){const E=so(e);S&&!C3(S,E)&&i(),S=E,k=requestAnimationFrame(N)}return i(),()=>{var E;y.forEach(M=>{s&&M.removeEventListener("scroll",i),c&&M.removeEventListener("resize",i)}),g==null||g(),(E=j)==null||E.disconnect(),j=null,h&&cancelAnimationFrame(k)}}const pT=VE,gT=$E,vT=qE,yT=YE,xT=UE,Ex=HE,bT=GE,jT=(e,a,i)=>{const r=new Map,s=i??{},c={...fT,...s.platform,_c:r};return PE(e,a,{...s,platform:c})};var wT=typeof document<"u",kT=function(){},Pd=wT?w.useLayoutEffect:kT;function Kd(e,a){if(e===a)return!0;if(typeof e!=typeof a)return!1;if(typeof e=="function"&&e.toString()===a.toString())return!0;let i,r,s;if(e&&a&&typeof e=="object"){if(Array.isArray(e)){if(i=e.length,i!==a.length)return!1;for(r=i;r--!==0;)if(!Kd(e[r],a[r]))return!1;return!0}if(s=Object.keys(e),i=s.length,i!==Object.keys(a).length)return!1;for(r=i;r--!==0;)if(!{}.hasOwnProperty.call(a,s[r]))return!1;for(r=i;r--!==0;){const c=s[r];if(!(c==="_owner"&&e.$$typeof)&&!Kd(e[c],a[c]))return!1}return!0}return e!==e&&a!==a}function N3(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Tx(e,a){const i=N3(e);return Math.round(a*i)/i}function op(e){const a=w.useRef(e);return Pd(()=>{a.current=e}),a}function ST(e){e===void 0&&(e={});const{placement:a="bottom",strategy:i="absolute",middleware:r=[],platform:s,elements:{reference:c,floating:d}={},transform:f=!0,whileElementsMounted:h,open:p}=e,[y,g]=w.useState({x:0,y:0,strategy:i,placement:a,middlewareData:{},isPositioned:!1}),[b,j]=w.useState(r);Kd(b,r)||j(r);const[k,S]=w.useState(null),[N,E]=w.useState(null),M=w.useCallback(H=>{H!==R.current&&(R.current=H,S(H))},[]),C=w.useCallback(H=>{H!==I.current&&(I.current=H,E(H))},[]),A=c||k,_=d||N,R=w.useRef(null),I=w.useRef(null),G=w.useRef(y),Y=h!=null,L=op(h),P=op(s),q=op(p),Z=w.useCallback(()=>{if(!R.current||!I.current)return;const H={placement:a,strategy:i,middleware:b};P.current&&(H.platform=P.current),jT(R.current,I.current,H).then(ie=>{const O={...ie,isPositioned:q.current!==!1};U.current&&!Kd(G.current,O)&&(G.current=O,ho.flushSync(()=>{g(O)}))})},[b,a,i,P,q]);Pd(()=>{p===!1&&G.current.isPositioned&&(G.current.isPositioned=!1,g(H=>({...H,isPositioned:!1})))},[p]);const U=w.useRef(!1);Pd(()=>(U.current=!0,()=>{U.current=!1}),[]),Pd(()=>{if(A&&(R.current=A),_&&(I.current=_),A&&_){if(L.current)return L.current(A,_,Z);Z()}},[A,_,Z,L,Y]);const F=w.useMemo(()=>({reference:R,floating:I,setReference:M,setFloating:C}),[M,C]),X=w.useMemo(()=>({reference:A,floating:_}),[A,_]),$=w.useMemo(()=>{const H={position:i,left:0,top:0};if(!X.floating)return H;const ie=Tx(X.floating,y.x),O=Tx(X.floating,y.y);return f?{...H,transform:"translate("+ie+"px, "+O+"px)",...N3(X.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:ie,top:O}},[i,f,X.floating,y.x,y.y]);return w.useMemo(()=>({...y,update:Z,refs:F,elements:X,floatingStyles:$}),[y,Z,F,X,$])}const CT=e=>{function a(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){const{element:r,padding:s}=typeof e=="function"?e(i):e;return r&&a(r)?r.current!=null?Ex({element:r.current,padding:s}).fn(i):{}:r?Ex({element:r,padding:s}).fn(i):{}}}},NT=(e,a)=>{const i=pT(e);return{name:i.name,fn:i.fn,options:[e,a]}},ET=(e,a)=>{const i=gT(e);return{name:i.name,fn:i.fn,options:[e,a]}},TT=(e,a)=>({fn:bT(e).fn,options:[e,a]}),AT=(e,a)=>{const i=vT(e);return{name:i.name,fn:i.fn,options:[e,a]}},MT=(e,a)=>{const i=yT(e);return{name:i.name,fn:i.fn,options:[e,a]}},_T=(e,a)=>{const i=xT(e);return{name:i.name,fn:i.fn,options:[e,a]}},RT=(e,a)=>{const i=CT(e);return{name:i.name,fn:i.fn,options:[e,a]}};var OT=Object.defineProperty,ll=(e,a)=>OT(e,"name",{value:a,configurable:!0}),E3="Popper",[T3,pf]=pl(E3),[DT,A3]=T3(E3),zT=ll(e=>{const{__scopePopper:a,children:i}=e,[r,s]=w.useState(null),[c,d]=w.useState(void 0);return o.jsx(DT,{scope:a,anchor:r,onAnchorChange:s,placementState:c,setPlacementState:d,children:i})},"Popper"),LT="PopperAnchor",BT=w.forwardRef(ll(function(a,i){const{__scopePopper:r,virtualRef:s,...c}=a,d=A3(LT,r),f=w.useRef(null),h=d.onAnchorChange,p=w.useCallback(S=>{f.current=S,S&&h(S)},[h]),y=Ot(i,p),g=w.useRef(null);w.useEffect(()=>{if(!s)return;const S=g.current;g.current=s.current,S!==g.current&&h(g.current)});const b=d.placementState&&gf(d.placementState),j=b==null?void 0:b[0],k=b==null?void 0:b[1];return s?null:o.jsx(Kt.div,{"data-radix-popper-side":j,"data-radix-popper-align":k,...c,ref:y})},"PopperAnchor")),M3="PopperContent",[IT,Pq]=T3(M3),PT=w.forwardRef(ll(function(a,i){var Se,Me,xe,oe,Ee,Xe,Be;const{__scopePopper:r,side:s="bottom",sideOffset:c=0,align:d="center",alignOffset:f=0,arrowPadding:h=0,avoidCollisions:p=!0,collisionBoundary:y=[],collisionPadding:g=0,sticky:b="partial",hideWhenDetached:j=!1,updatePositionStrategy:k="optimized",onPlaced:S,...N}=a,E=A3(M3,r),[M,C]=w.useState(null),A=Ot(i,C),[_,R]=w.useState(null),I=p3(_),G=(I==null?void 0:I.width)??0,Y=(I==null?void 0:I.height)??0,L=s+(d!=="center"?"-"+d:""),P=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},q=Array.isArray(y)?y:[y],Z=q.length>0,U={padding:P,boundary:q.filter(_3),altBoundary:Z},{refs:F,floatingStyles:X,placement:$,isPositioned:H,middlewareData:ie}=ST({strategy:"fixed",placement:L,whileElementsMounted:ll((...Je)=>mT(...Je,{animationFrame:k==="always"}),"whileElementsMounted"),elements:{reference:E.anchor},middleware:[NT({mainAxis:c+Y,alignmentAxis:f}),p&&ET({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?TT():void 0,...U}),p&&AT({...U}),MT({...U,apply:ll(({elements:Je,rects:Qe,availableWidth:et,availableHeight:Lt})=>{const{width:cn,height:jn}=Qe.reference,Xt=Je.floating.style;Xt.setProperty("--radix-popper-available-width",`${et}px`),Xt.setProperty("--radix-popper-available-height",`${Lt}px`),Xt.setProperty("--radix-popper-anchor-width",`${cn}px`),Xt.setProperty("--radix-popper-anchor-height",`${jn}px`)},"apply")}),_&&RT({element:_,padding:h}),HT({arrowWidth:G,arrowHeight:Y}),j&&_T({strategy:"referenceHidden",...U,boundary:Z?U.boundary:void 0})]}),O=E.setPlacementState;In(()=>(O($),()=>{O(void 0)}),[$,O]);const[le,ne]=gf($),D=Bn(S);In(()=>{H&&(D==null||D())},[H,D]);const B=(Se=ie.arrow)==null?void 0:Se.x,W=(Me=ie.arrow)==null?void 0:Me.y,ue=((xe=ie.arrow)==null?void 0:xe.centerOffset)!==0,[me,ge]=w.useState();return In(()=>{M&&ge(window.getComputedStyle(M).zIndex)},[M]),o.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...X,transform:H?X.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[(oe=ie.transformOrigin)==null?void 0:oe.x,(Ee=ie.transformOrigin)==null?void 0:Ee.y].join(" "),...((Xe=ie.hide)==null?void 0:Xe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:a.dir,children:o.jsx(IT,{scope:r,placedSide:le,placedAlign:ne,onArrowChange:R,arrowX:B,arrowY:W,shouldHideArrow:ue,children:o.jsx(Kt.div,{"data-side":le,"data-align":ne,...N,ref:A,style:{...N.style,animation:H?(Be=N.style)==null?void 0:Be.animation:"none"}})})})},"PopperContent"));function _3(e){return e!==null}ll(_3,"isNotNull");var HT=ll(e=>({name:"transformOrigin",options:e,fn(a){var N,E,M;const{placement:i,rects:r,middlewareData:s}=a,d=((N=s.arrow)==null?void 0:N.centerOffset)!==0,f=d?0:e.arrowWidth,h=d?0:e.arrowHeight,[p,y]=gf(i),g={start:"0%",center:"50%",end:"100%"}[y],b=(((E=s.arrow)==null?void 0:E.x)??0)+f/2,j=(((M=s.arrow)==null?void 0:M.y)??0)+h/2;let k="",S="";return p==="bottom"?(k=d?g:`${b}px`,S=`${-h}px`):p==="top"?(k=d?g:`${b}px`,S=`${r.floating.height+h}px`):p==="right"?(k=`${-h}px`,S=d?g:`${j}px`):p==="left"&&(k=`${r.floating.width+h}px`,S=d?g:`${j}px`),{data:{x:k,y:S}}}}),"transformOrigin");function gf(e){const[a,i="center"]=e.split("-");return[a,i]}ll(gf,"getSideAndAlignFromPlacement");var R3=zT,O3=BT,D3=PT,qT=Object.defineProperty,UT=(e,a)=>qT(e,"name",{value:a,configurable:!0}),FT=w.forwardRef(UT(function(a,i){return o.jsx(Kt.label,{...a,ref:i,onMouseDown:r=>{var c;r.target.closest("button, input, select, textarea")||((c=a.onMouseDown)==null||c.call(a,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}})},"Label")),VT=FT,$T=Object.defineProperty,GT=(e,a)=>$T(e,"name",{value:a,configurable:!0});function z3(e){const a=w.useRef({value:e,previous:e});return w.useMemo(()=>(a.current.value!==e&&(a.current.previous=a.current.value,a.current.value=e),a.current.previous),[e])}GT(z3,"usePrevious");var YT=Object.defineProperty,KT=(e,a)=>YT(e,"name",{value:a,configurable:!0});function Xd(e,[a,i]){return Math.min(i,Math.max(a,e))}KT(Xd,"clamp");var XT=Object.defineProperty,vl=(e,a)=>XT(e,"name",{value:a,configurable:!0}),rg="Popover",[L3,Hq]=pl(rg,[pf]),lg=pf(),[QT,ks]=L3(rg),ZT=vl(e=>{const{__scopePopover:a,children:i,open:r,defaultOpen:s,onOpenChange:c,modal:d=!1}=e,f=lg(a),h=w.useRef(null),[p,y]=w.useState(!1),[g,b]=Ac({prop:r,defaultProp:s??!1,onChange:c,caller:rg});return o.jsx(R3,{...f,children:o.jsx(QT,{scope:a,contentId:ao(),triggerRef:h,open:g,onOpenChange:b,onOpenToggle:w.useCallback(()=>b(j=>!j),[b]),hasCustomAnchor:p,onCustomAnchorAdd:w.useCallback(()=>y(!0),[]),onCustomAnchorRemove:w.useCallback(()=>y(!1),[]),modal:d,children:i})})},"Popover"),JT="PopoverTrigger",WT=w.forwardRef(vl(function(a,i){const{__scopePopover:r,...s}=a,c=ks(JT,r),d=lg(r),f=Ot(i,c.triggerRef),h=o.jsx(Kt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":og(c.open),...s,ref:f,onClick:St(a.onClick,c.onOpenToggle)});return c.hasCustomAnchor?h:o.jsx(O3,{asChild:!0,...d,children:h})},"PopoverTrigger")),B3="PopoverPortal",[eA,tA]=L3(B3,{forceMount:void 0}),nA=vl(e=>{const{__scopePopover:a,forceMount:i,children:r,container:s}=e,c=ks(B3,a);return o.jsx(eA,{scope:a,forceMount:i,children:o.jsx(Gi,{present:i||c.open,children:o.jsx(K0,{asChild:!0,container:s,children:r})})})},"PopoverPortal"),Oc="PopoverContent",aA=w.forwardRef(vl(function(a,i){const r=tA(Oc,a.__scopePopover),{forceMount:s=r.forceMount,...c}=a,d=ks(Oc,a.__scopePopover);return o.jsx(Gi,{present:s||d.open,children:d.modal?o.jsx(rA,{...c,ref:i}):o.jsx(lA,{...c,ref:i})})},"PopoverContent")),iA=Ui("PopoverContent.RemoveScroll"),rA=w.forwardRef(vl(function(a,i){const r=ks(Oc,a.__scopePopover),s=w.useRef(null),c=Ot(i,s),d=w.useRef(!1);return w.useEffect(()=>{const f=s.current;if(f)return Q0(f)},[]),o.jsx(cf,{as:iA,allowPinchZoom:!0,children:o.jsx(I3,{...a,ref:c,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:St(a.onCloseAutoFocus,f=>{var h;f.preventDefault(),d.current||(h=r.triggerRef.current)==null||h.focus()}),onPointerDownOutside:St(a.onPointerDownOutside,f=>{const h=f.detail.originalEvent,p=h.button===0&&h.ctrlKey===!0,y=h.button===2||p;d.current=y},{checkForDefaultPrevented:!1}),onFocusOutside:St(a.onFocusOutside,f=>f.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),lA=w.forwardRef(vl(function(a,i){const r=ks(Oc,a.__scopePopover),s=w.useRef(!1),c=w.useRef(!1);return o.jsx(I3,{...a,ref:i,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var f,h;(f=a.onCloseAutoFocus)==null||f.call(a,d),d.defaultPrevented||(s.current||(h=r.triggerRef.current)==null||h.focus(),d.preventDefault()),s.current=!1,c.current=!1},onInteractOutside:d=>{var p,y;(p=a.onInteractOutside)==null||p.call(a,d),d.defaultPrevented||(s.current=!0,d.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const f=d.target;((y=r.triggerRef.current)==null?void 0:y.contains(f))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&c.current&&d.preventDefault()}})},"PopoverContentNonModal")),I3=w.forwardRef(vl(function(a,i){const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:c,onCloseAutoFocus:d,disableOutsidePointerEvents:f,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:y,onInteractOutside:g,...b}=a,j=ks(Oc,r),k=lg(r);return qc(),o.jsx(G0,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:c,onUnmountAutoFocus:d,children:o.jsx(V0,{asChild:!0,disableOutsidePointerEvents:f,onInteractOutside:g,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:y,onDismiss:()=>j.onOpenChange(!1),deferPointerDownOutside:!0,children:o.jsx(D3,{"data-state":og(j.open),role:"dialog",id:j.contentId,...k,...b,ref:i,style:{...b.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl"));function og(e){return e?"open":"closed"}vl(og,"getState");var sg=ZT,cg=WT,ug=nA,dg=aA,oA=Object.defineProperty,pt=(e,a)=>oA(e,"name",{value:a,configurable:!0});function P3(e,a){return w.useReducer((i,r)=>a[i][r]??i,e)}pt(P3,"useStateMachine");var H3="ScrollArea",[q3,qq]=pl(H3),[sA,Za]=q3(H3),cA=w.forwardRef(pt(function(a,i){const{__scopeScrollArea:r,type:s="hover",dir:c,scrollHideDelay:d=600,...f}=a,[h,p]=w.useState(null),[y,g]=w.useState(null),[b,j]=w.useState(null),[k,S]=w.useState(null),[N,E]=w.useState(null),[M,C]=w.useState(0),[A,_]=w.useState(0),[R,I]=w.useState(!1),[G,Y]=w.useState(!1),L=Ot(i,p),P=F0(c);return o.jsx(sA,{scope:r,type:s,dir:P,scrollHideDelay:d,scrollArea:h,viewport:y,onViewportChange:g,content:b,onContentChange:j,scrollbarX:k,onScrollbarXChange:S,scrollbarXEnabled:R,onScrollbarXEnabledChange:I,scrollbarY:N,onScrollbarYChange:E,scrollbarYEnabled:G,onScrollbarYEnabledChange:Y,onCornerWidthChange:C,onCornerHeightChange:_,children:o.jsx(Kt.div,{dir:P,...f,ref:L,style:{position:"relative","--radix-scroll-area-corner-width":M+"px","--radix-scroll-area-corner-height":A+"px",...a.style}})})},"ScrollArea")),uA="ScrollAreaViewport",dA=w.forwardRef(pt(function(a,i){const{__scopeScrollArea:r,children:s,nonce:c,...d}=a,f=Za(uA,r),h=w.useRef(null),p=Ot(i,h,f.onViewportChange);return o.jsxs(o.Fragment,{children:[o.jsx(fA,{nonce:c}),o.jsx(Kt.div,{"data-radix-scroll-area-viewport":"",...d,ref:p,style:{overflowX:f.scrollbarXEnabled?"scroll":"hidden",overflowY:f.scrollbarYEnabled?"scroll":"hidden",...a.style},children:o.jsx("div",{ref:f.onContentChange,style:{minWidth:"100%",display:"table"},children:s})})]})},"ScrollAreaViewport")),fA=w.memo(pt(function({nonce:a}){return o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a})},"ScrollAreaViewportStyle"),(e,a)=>e.nonce===a.nonce),wr="ScrollAreaScrollbar",hA=w.forwardRef(pt(function(a,i){const{forceMount:r,...s}=a,c=Za(wr,a.__scopeScrollArea),{onScrollbarXEnabledChange:d,onScrollbarYEnabledChange:f}=c,h=a.orientation==="horizontal";return w.useEffect(()=>(h?d(!0):f(!0),()=>{h?d(!1):f(!1)}),[h,d,f]),c.type==="hover"?o.jsx(mA,{...s,ref:i,forceMount:r}):c.type==="scroll"?o.jsx(pA,{...s,ref:i,forceMount:r}):c.type==="auto"?o.jsx(U3,{...s,ref:i,forceMount:r}):c.type==="always"?o.jsx(fg,{...s,ref:i,"data-state":"visible"}):null},"ScrollAreaScrollbar")),mA=w.forwardRef(pt(function(a,i){const{forceMount:r,...s}=a,c=Za(wr,a.__scopeScrollArea),[d,f]=w.useState(!1);return w.useEffect(()=>{const h=c.scrollArea;let p=0;if(h){const y=pt(()=>{window.clearTimeout(p),f(!0)},"handlePointerEnter"),g=pt(()=>{p=window.setTimeout(()=>f(!1),c.scrollHideDelay)},"handlePointerLeave");return h.addEventListener("pointerenter",y),h.addEventListener("pointerleave",g),()=>{window.clearTimeout(p),h.removeEventListener("pointerenter",y),h.removeEventListener("pointerleave",g)}}},[c.scrollArea,c.scrollHideDelay]),o.jsx(Gi,{present:r||d,children:o.jsx(U3,{"data-state":d?"visible":"hidden",...s,ref:i})})},"ScrollAreaScrollbarHover")),pA=w.forwardRef(pt(function(a,i){const{forceMount:r,...s}=a,c=Za(wr,a.__scopeScrollArea),d=a.orientation==="horizontal",f=Fc(()=>p("SCROLL_END"),100),[h,p]=P3("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return w.useEffect(()=>{if(h==="idle"){const y=window.setTimeout(()=>p("HIDE"),c.scrollHideDelay);return()=>window.clearTimeout(y)}},[h,c.scrollHideDelay,p]),w.useEffect(()=>{const y=c.viewport,g=d?"scrollLeft":"scrollTop";if(y){let b=y[g];const j=pt(()=>{const k=y[g];b!==k&&(p("SCROLL"),f()),b=k},"handleScroll");return y.addEventListener("scroll",j),()=>y.removeEventListener("scroll",j)}},[c.viewport,d,p,f]),o.jsx(Gi,{present:r||h!=="hidden",children:o.jsx(fg,{"data-state":h==="hidden"?"hidden":"visible",...s,ref:i,onPointerEnter:St(a.onPointerEnter,()=>p("POINTER_ENTER")),onPointerLeave:St(a.onPointerLeave,()=>p("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),U3=w.forwardRef(pt(function(a,i){const r=Za(wr,a.__scopeScrollArea),{forceMount:s,...c}=a,[d,f]=w.useState(!1),h=a.orientation==="horizontal",p=Fc(()=>{if(r.viewport){const y=r.viewport.offsetWidth<r.viewport.scrollWidth,g=r.viewport.offsetHeight<r.viewport.scrollHeight;f(h?y:g)}},10);return co(r.viewport,p),co(r.content,p),o.jsx(Gi,{present:s||d,children:o.jsx(fg,{"data-state":d?"visible":"hidden",...c,ref:i})})},"ScrollAreaScrollbarAuto")),fg=w.forwardRef(pt(function(a,i){const{orientation:r="vertical",...s}=a,c=Za(wr,a.__scopeScrollArea),d=w.useRef(null),f=w.useRef(0),[h,p]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),y=hg(h.viewport,h.content),g={...s,sizes:h,onSizesChange:p,hasThumb:y>0&&y<1,onThumbChange:pt(j=>d.current=j,"onThumbChange"),onThumbPointerUp:pt(()=>f.current=0,"onThumbPointerUp"),onThumbPointerDown:pt(j=>f.current=j,"onThumbPointerDown")};function b(j,k){return G3(j,f.current,h,k)}return pt(b,"getScrollPosition"),r==="horizontal"?o.jsx(gA,{...g,ref:i,onThumbPositionChange:()=>{if(c.viewport&&d.current){const j=c.viewport.scrollLeft,k=o0(j,h,c.dir);d.current.style.transform=`translate3d(${k}px, 0, 0)`}},onWheelScroll:j=>{c.viewport&&(c.viewport.scrollLeft=j)},onDragScroll:j=>{c.viewport&&(c.viewport.scrollLeft=b(j,c.dir))}}):r==="vertical"?o.jsx(vA,{...g,ref:i,onThumbPositionChange:()=>{if(c.viewport&&d.current){const j=c.viewport.scrollTop,k=o0(j,h);d.current.style.transform=`translate3d(0, ${k}px, 0)`}},onWheelScroll:j=>{c.viewport&&(c.viewport.scrollTop=j)},onDragScroll:j=>{c.viewport&&(c.viewport.scrollTop=b(j))}}):null},"ScrollAreaScrollbarVisible")),gA=w.forwardRef(pt(function(a,i){const{sizes:r,onSizesChange:s,...c}=a,d=Za(wr,a.__scopeScrollArea),[f,h]=w.useState(),p=w.useRef(null),y=Ot(i,p,d.onScrollbarXChange);return w.useEffect(()=>{p.current&&h(getComputedStyle(p.current))},[p]),o.jsx(V3,{"data-orientation":"horizontal",...c,ref:y,sizes:r,style:{bottom:0,left:d.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:d.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Uc(r)+"px",...a.style},onThumbPointerDown:g=>a.onThumbPointerDown(g.x),onDragScroll:g=>a.onDragScroll(g.x),onWheelScroll:(g,b)=>{if(d.viewport){const j=d.viewport.scrollLeft+g.deltaX;a.onWheelScroll(j),pg(j,b)&&g.preventDefault()}},onResize:()=>{p.current&&d.viewport&&f&&s({content:d.viewport.scrollWidth,viewport:d.viewport.offsetWidth,scrollbar:{size:p.current.clientWidth,paddingStart:Dc(f.paddingLeft),paddingEnd:Dc(f.paddingRight)}})}})},"ScrollAreaScrollbarX")),vA=w.forwardRef(pt(function(a,i){const{sizes:r,onSizesChange:s,...c}=a,d=Za(wr,a.__scopeScrollArea),[f,h]=w.useState(),p=w.useRef(null),y=Ot(i,p,d.onScrollbarYChange);return w.useEffect(()=>{p.current&&h(getComputedStyle(p.current))},[p]),o.jsx(V3,{"data-orientation":"vertical",...c,ref:y,sizes:r,style:{top:0,right:d.dir==="ltr"?0:void 0,left:d.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Uc(r)+"px",...a.style},onThumbPointerDown:g=>a.onThumbPointerDown(g.y),onDragScroll:g=>a.onDragScroll(g.y),onWheelScroll:(g,b)=>{if(d.viewport){const j=d.viewport.scrollTop+g.deltaY;a.onWheelScroll(j),pg(j,b)&&g.preventDefault()}},onResize:()=>{p.current&&d.viewport&&f&&s({content:d.viewport.scrollHeight,viewport:d.viewport.offsetHeight,scrollbar:{size:p.current.clientHeight,paddingStart:Dc(f.paddingTop),paddingEnd:Dc(f.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[yA,F3]=q3(wr),V3=w.forwardRef(pt(function(a,i){const{__scopeScrollArea:r,sizes:s,hasThumb:c,onThumbChange:d,onThumbPointerUp:f,onThumbPointerDown:h,onThumbPositionChange:p,onDragScroll:y,onWheelScroll:g,onResize:b,...j}=a,k=Za(wr,r),[S,N]=w.useState(null),E=Ot(i,N),M=w.useRef(null),C=w.useRef(""),A=k.viewport,_=s.content-s.viewport,R=Bn(g),I=Bn(p),G=Fc(b,10);function Y(L){if(M.current){const P=L.clientX-M.current.left,q=L.clientY-M.current.top;y({x:P,y:q})}}return pt(Y,"handleDragScroll"),w.useEffect(()=>{const L=pt(P=>{const q=P.target;(S==null?void 0:S.contains(q))&&R(P,_)},"handleWheel");return document.addEventListener("wheel",L,{passive:!1}),()=>document.removeEventListener("wheel",L,{passive:!1})},[A,S,_,R]),w.useEffect(I,[s,I]),co(S,G),co(k.content,G),o.jsx(yA,{scope:r,scrollbar:S,hasThumb:c,onThumbChange:Bn(d),onThumbPointerUp:Bn(f),onThumbPositionChange:I,onThumbPointerDown:Bn(h),children:o.jsx(Kt.div,{...j,ref:E,style:{position:"absolute",...j.style},onPointerDown:St(a.onPointerDown,L=>{L.button===0&&(L.target.setPointerCapture(L.pointerId),M.current=S.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",k.viewport&&(k.viewport.style.scrollBehavior="auto"),Y(L))}),onPointerMove:St(a.onPointerMove,Y),onPointerUp:St(a.onPointerUp,L=>{const P=L.target;P.hasPointerCapture(L.pointerId)&&P.releasePointerCapture(L.pointerId),document.body.style.webkitUserSelect=C.current,k.viewport&&(k.viewport.style.scrollBehavior=""),M.current=null})})})},"ScrollAreaScrollbarImpl")),l0="ScrollAreaThumb",xA=w.forwardRef(pt(function(a,i){const{forceMount:r,...s}=a,c=F3(l0,a.__scopeScrollArea);return o.jsx(Gi,{present:r||c.hasThumb,children:o.jsx(bA,{ref:i,...s})})},"ScrollAreaThumb")),bA=w.forwardRef(pt(function(a,i){const{__scopeScrollArea:r,style:s,...c}=a,d=Za(l0,r),f=F3(l0,r),{onThumbPositionChange:h}=f,p=Ot(i,f.onThumbChange),y=w.useRef(void 0),g=Fc(()=>{y.current&&(y.current(),y.current=void 0)},100);return w.useEffect(()=>{const b=d.viewport;if(b){const j=pt(()=>{if(g(),!y.current){const k=kA(b,h);y.current=k,h()}},"handleScroll");return h(),b.addEventListener("scroll",j),()=>b.removeEventListener("scroll",j)}},[d.viewport,g,h]),o.jsx(Kt.div,{"data-state":f.hasThumb?"visible":"hidden",...c,ref:p,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...s},onPointerDownCapture:St(a.onPointerDownCapture,b=>{const k=b.target.getBoundingClientRect(),S=b.clientX-k.left,N=b.clientY-k.top;f.onThumbPointerDown({x:S,y:N})}),onPointerUp:St(a.onPointerUp,f.onThumbPointerUp)})},"ScrollAreaThumbImpl")),$3="ScrollAreaCorner",jA=w.forwardRef(pt(function(a,i){const r=Za($3,a.__scopeScrollArea),s=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&s?o.jsx(wA,{...a,ref:i}):null},"ScrollAreaCorner")),wA=w.forwardRef(pt(function(a,i){const{__scopeScrollArea:r,...s}=a,c=Za($3,r),[d,f]=w.useState(0),[h,p]=w.useState(0),y=!!(d&&h),{onCornerWidthChange:g,onCornerHeightChange:b}=c;return co(c.scrollbarX,()=>{var k;const j=((k=c.scrollbarX)==null?void 0:k.offsetHeight)||0;c.onCornerHeightChange(j),p(j)}),co(c.scrollbarY,()=>{var k;const j=((k=c.scrollbarY)==null?void 0:k.offsetWidth)||0;c.onCornerWidthChange(j),f(j)}),w.useEffect(()=>()=>{g(0),b(0)},[g,b]),y?o.jsx(Kt.div,{...s,ref:i,style:{width:d,height:h,position:"absolute",right:c.dir==="ltr"?0:void 0,left:c.dir==="rtl"?0:void 0,bottom:0,...a.style}}):null},"ScrollAreaCornerImpl"));function Dc(e){return e?parseInt(e,10):0}pt(Dc,"toInt");function hg(e,a){const i=e/a;return isNaN(i)?0:i}pt(hg,"getThumbRatio");function Uc(e){const a=hg(e.viewport,e.content),i=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-i)*a;return Math.max(r,18)}pt(Uc,"getThumbSize");function G3(e,a,i,r="ltr"){const s=Uc(i),c=s/2,d=a||c,f=s-d,h=i.scrollbar.paddingStart+d,p=i.scrollbar.size-i.scrollbar.paddingEnd-f,y=i.content-i.viewport,g=r==="ltr"?[0,y]:[y*-1,0];return mg([h,p],g)(e)}pt(G3,"getScrollPositionFromPointer");function o0(e,a,i="ltr"){const r=Uc(a),s=a.scrollbar.paddingStart+a.scrollbar.paddingEnd,c=a.scrollbar.size-s,d=a.content-a.viewport,f=c-r,h=i==="ltr"?[0,d]:[d*-1,0],p=Xd(e,h);return mg([0,d],[0,f])(p)}pt(o0,"getThumbOffsetFromScroll");function mg(e,a){return i=>{if(e[0]===e[1]||a[0]===a[1])return a[0];const r=(a[1]-a[0])/(e[1]-e[0]);return a[0]+r*(i-e[0])}}pt(mg,"linearScale");function pg(e,a){return e>0&&e<a}pt(pg,"isScrollingWithinScrollbarBounds");var kA=pt((e,a=()=>{})=>{let i={left:e.scrollLeft,top:e.scrollTop},r=0;return pt((function s(){const c={left:e.scrollLeft,top:e.scrollTop},d=i.left!==c.left,f=i.top!==c.top;(d||f)&&a(),i=c,r=window.requestAnimationFrame(s)}),"loop")(),()=>window.cancelAnimationFrame(r)},"addUnlinkedScrollListener");function Fc(e,a){const i=Bn(e),r=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),w.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(i,a)},[i,a])}pt(Fc,"useDebounceCallback");function co(e,a){const i=Bn(a);In(()=>{let r=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(i)});return s.observe(e),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}},[e,i])}pt(co,"useResizeObserver");var SA=cA,CA=dA,NA=jA,EA=Object.defineProperty,zt=(e,a)=>EA(e,"name",{value:a,configurable:!0}),TA=[" ","Enter","ArrowUp","ArrowDown"],AA=[" ","Enter"],ms="Select",[vf,gg,MA]=R4(ms),[mo,Uq]=pl(ms,[MA,pf]),vg=pf(),[_A,yl]=mo(ms),[RA,OA]=mo(ms);function Y3(e){const{__scopeSelect:a,children:i,open:r,defaultOpen:s,onOpenChange:c,value:d,defaultValue:f,onValueChange:h,dir:p,name:y,autoComplete:g,disabled:b,required:j,form:k,internal_do_not_use_render:S}=e,N=vg(a),[E,M]=w.useState(null),[C,A]=w.useState(null),[_,R]=w.useState(!1),I=F0(p),[G,Y]=Ac({prop:r,defaultProp:s??!1,onChange:c,caller:ms}),[L,P]=Ac({prop:d,defaultProp:f,onChange:h,caller:ms}),q=w.useRef(null),Z=w.useRef(L);w.useEffect(()=>{const ne=k?E==null?void 0:E.ownerDocument.getElementById(k):E==null?void 0:E.form;if(ne instanceof HTMLFormElement){const D=zt(()=>P(Z.current),"reset");return ne.addEventListener("reset",D),()=>ne.removeEventListener("reset",D)}},[k,E,P]);const U=E?!!k||!!E.closest("form"):!0,[F,X]=w.useState(new Set),$=ao(),H=Array.from(F).map(ne=>ne.props.value).join(";"),ie=w.useCallback(ne=>{X(D=>new Set(D).add(ne))},[]),O=w.useCallback(ne=>{X(D=>{const B=new Set(D);return B.delete(ne),B})},[]),le={required:j,trigger:E,onTriggerChange:M,valueNode:C,onValueNodeChange:A,valueNodeHasChildren:_,onValueNodeHasChildrenChange:R,contentId:$,value:L,onValueChange:P,open:G,onOpenChange:Y,dir:I,triggerPointerDownPosRef:q,disabled:b,name:y,autoComplete:g,form:k,nativeOptions:F,nativeSelectKey:H,isFormControl:U};return o.jsx(R3,{...N,children:o.jsx(_A,{scope:a,...le,children:o.jsx(vf.Provider,{scope:a,children:o.jsx(RA,{scope:a,onNativeOptionAdd:ie,onNativeOptionRemove:O,children:Q3(S)?S(le):i})})})})}zt(Y3,"SelectProvider");var DA=zt(e=>{const{__scopeSelect:a,children:i,...r}=e;return o.jsx(Y3,{__scopeSelect:a,...r,internal_do_not_use_render:({isFormControl:s})=>o.jsxs(o.Fragment,{children:[i,s?o.jsx(rM,{__scopeSelect:a}):null]})})},"Select"),zA="SelectTrigger",LA=w.forwardRef(zt(function(a,i){const{__scopeSelect:r,disabled:s=!1,...c}=a,d=vg(r),f=yl(zA,r),h=f.disabled||s,p=Ot(i,f.onTriggerChange),y=gg(r),g=w.useRef("touch"),[b,j,k]=yg(N=>{const E=y().filter(A=>!A.disabled),M=E.find(A=>A.value===f.value),C=xg(E,N,M);C!==void 0&&f.onValueChange(C.value)}),S=zt(N=>{h||(f.onOpenChange(!0),k()),N&&(f.triggerPointerDownPosRef.current={x:Math.round(N.pageX),y:Math.round(N.pageY)})},"handleOpen");return o.jsx(O3,{asChild:!0,...d,children:o.jsx(Kt.button,{type:"button",role:"combobox","aria-controls":f.open?f.contentId:void 0,"aria-expanded":f.open,"aria-required":f.required,"aria-autocomplete":"none",dir:f.dir,"data-state":f.open?"open":"closed",disabled:h,"data-disabled":h?"":void 0,"data-placeholder":Vc(f.value)?"":void 0,...c,ref:p,onClick:St(c.onClick,N=>{N.currentTarget.focus(),g.current!=="mouse"&&S(N)}),onPointerDown:St(c.onPointerDown,N=>{g.current=N.pointerType;const E=N.target;E.hasPointerCapture(N.pointerId)&&E.releasePointerCapture(N.pointerId),N.button===0&&N.ctrlKey===!1&&N.pointerType==="mouse"&&(S(N),N.preventDefault())}),onKeyDown:St(c.onKeyDown,N=>{const E=b.current!=="";!(N.ctrlKey||N.altKey||N.metaKey)&&N.key.length===1&&j(N.key),!(E&&N.key===" ")&&TA.includes(N.key)&&(S(),N.preventDefault())})})})},"SelectTrigger")),BA="SelectValue",IA=w.forwardRef(zt(function(a,i){const{__scopeSelect:r,className:s,style:c,children:d,placeholder:f="",...h}=a,p=yl(BA,r),{onValueNodeHasChildrenChange:y}=p,g=d!==void 0,b=Ot(i,p.onValueNodeChange);In(()=>{y(g)},[y,g]);const j=Vc(p.value);return o.jsx(Kt.span,{...h,asChild:j?!1:h.asChild,ref:b,style:{pointerEvents:"none"},children:o.jsx(w.Fragment,{children:j?f:d},j?"placeholder":"value")})},"SelectValue")),PA=w.forwardRef(zt(function(a,i){const{__scopeSelect:r,children:s,...c}=a;return o.jsx(Kt.span,{"aria-hidden":!0,...c,ref:i,children:s||"▼"})},"SelectIcon")),HA="SelectPortal",[qA,UA]=mo(HA,{forceMount:void 0}),FA=zt(e=>{const{__scopeSelect:a,forceMount:i,...r}=e;return o.jsx(qA,{scope:e.__scopeSelect,forceMount:i,children:o.jsx(K0,{asChild:!0,...r})})},"SelectPortal"),uo="SelectContent",VA=w.forwardRef(zt(function(a,i){const r=UA(uo,a.__scopeSelect),{forceMount:s=r.forceMount,...c}=a,d=yl(uo,a.__scopeSelect),[f,h]=w.useState();return In(()=>{h(new DocumentFragment)},[]),o.jsx(Gi,{present:s||d.open,children:({present:p})=>p?o.jsx(YA,{...c,ref:i}):o.jsx($A,{...c,fragment:f})})},"SelectContent")),$A=w.forwardRef(zt(function(a,i){const{__scopeSelect:r,children:s,fragment:c}=a;return c?ho.createPortal(o.jsx(K3,{scope:r,children:o.jsx(vf.Slot,{scope:r,children:o.jsx("div",{ref:i,children:s})})}),c):null},"SelectContentFragment")),ci=10,[K3,yf]=mo(uo),GA=Ui("SelectContent.RemoveScroll"),YA=w.forwardRef(zt(function(a,i){const{__scopeSelect:r}=a,{position:s="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:d,onPointerDownOutside:f,side:h,sideOffset:p,align:y,alignOffset:g,arrowPadding:b,collisionBoundary:j,collisionPadding:k,sticky:S,hideWhenDetached:N,avoidCollisions:E,...M}=a,C=yl(uo,r),[A,_]=w.useState(null),[R,I]=w.useState(null),G=Ot(i,_),[Y,L]=w.useState(null),[P,q]=w.useState(null),Z=gg(r),[U,F]=w.useState(!1),X=w.useRef(!1);w.useEffect(()=>{if(A)return Q0(A)},[A]),qc();const $=w.useCallback(ge=>{const[Se,...Me]=Z().map(Ee=>Ee.ref.current),[xe]=Me.slice(-1),oe=document.activeElement;for(const Ee of ge)if(Ee===oe||(Ee==null||Ee.scrollIntoView({block:"nearest"}),Ee===Se&&R&&(R.scrollTop=0),Ee===xe&&R&&(R.scrollTop=R.scrollHeight),Ee==null||Ee.focus(),document.activeElement!==oe))return},[Z,R]),H=w.useCallback(()=>$([Y,A]),[$,Y,A]);w.useEffect(()=>{U&&H()},[U,H]);const{onOpenChange:ie,triggerPointerDownPosRef:O}=C;w.useEffect(()=>{if(A){let ge={x:0,y:0};const Se=zt(xe=>{var oe,Ee;ge={x:Math.abs(Math.round(xe.pageX)-(((oe=O.current)==null?void 0:oe.x)??0)),y:Math.abs(Math.round(xe.pageY)-(((Ee=O.current)==null?void 0:Ee.y)??0))}},"handlePointerMove"),Me=zt(xe=>{ge.x<=10&&ge.y<=10?xe.preventDefault():xe.composedPath().includes(A)||ie(!1),document.removeEventListener("pointermove",Se),O.current=null},"handlePointerUp");return O.current!==null&&(document.addEventListener("pointermove",Se),document.addEventListener("pointerup",Me,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Se),document.removeEventListener("pointerup",Me,{capture:!0})}}},[A,ie,O]),w.useEffect(()=>{const ge=zt(()=>ie(!1),"close");return window.addEventListener("blur",ge),window.addEventListener("resize",ge),()=>{window.removeEventListener("blur",ge),window.removeEventListener("resize",ge)}},[ie]);const[le,ne]=yg(ge=>{const Se=Z().filter(oe=>!oe.disabled),Me=Se.find(oe=>oe.ref.current===document.activeElement),xe=xg(Se,ge,Me);xe&&setTimeout(()=>{var oe;return(oe=xe.ref.current)==null?void 0:oe.focus()})}),D=w.useCallback((ge,Se,Me)=>{const xe=!X.current&&!Me;(C.value!==void 0&&C.value===Se||xe)&&(L(ge),xe&&(X.current=!0))},[C.value]),B=w.useCallback(()=>A==null?void 0:A.focus(),[A]),W=w.useCallback((ge,Se,Me)=>{const xe=!X.current&&!Me;(C.value!==void 0&&C.value===Se||xe)&&q(ge)},[C.value]),ue=s==="popper"?Ax:KA,me=ue===Ax?{side:h,sideOffset:p,align:y,alignOffset:g,arrowPadding:b,collisionBoundary:j,collisionPadding:k,sticky:S,hideWhenDetached:N,avoidCollisions:E}:{};return o.jsx(K3,{scope:r,content:A,viewport:R,onViewportChange:I,itemRefCallback:D,selectedItem:Y,onItemLeave:B,itemTextRefCallback:W,focusSelectedItem:H,selectedItemText:P,position:s,isPositioned:U,searchRef:le,children:o.jsx(cf,{as:GA,allowPinchZoom:!0,children:o.jsx(G0,{asChild:!0,trapped:C.open,onMountAutoFocus:ge=>{ge.preventDefault()},onUnmountAutoFocus:St(c,ge=>{var Se;(Se=C.trigger)==null||Se.focus({preventScroll:!0}),ge.preventDefault()}),children:o.jsx(V0,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:ge=>ge.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:o.jsx(ue,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:ge=>ge.preventDefault(),...M,...me,onPlaced:()=>F(!0),ref:G,style:{display:"flex",flexDirection:"column",outline:"none",...M.style},onKeyDown:St(M.onKeyDown,ge=>{const Se=ge.ctrlKey||ge.altKey||ge.metaKey;if(ge.key==="Tab"&&ge.preventDefault(),!Se&&ge.key.length===1&&ne(ge.key),["ArrowUp","ArrowDown","Home","End"].includes(ge.key)){let xe=Z().filter(oe=>!oe.disabled).map(oe=>oe.ref.current);if(["ArrowUp","End"].includes(ge.key)&&(xe=xe.slice().reverse()),["ArrowUp","ArrowDown"].includes(ge.key)){const oe=ge.target,Ee=xe.indexOf(oe);xe=xe.slice(Ee+1)}setTimeout(()=>$(xe)),ge.preventDefault()}})})})})})})},"SelectContentImpl")),KA=w.forwardRef(zt(function(a,i){const{__scopeSelect:r,onPlaced:s,...c}=a,d=yl(uo,r),f=yf(uo,r),[h,p]=w.useState(null),[y,g]=w.useState(null),b=Ot(i,g),j=gg(r),k=w.useRef(!1),S=w.useRef(!0),{viewport:N,selectedItem:E,selectedItemText:M,focusSelectedItem:C}=f,A=w.useCallback(()=>{if(d.trigger&&d.valueNode&&h&&y&&N&&E&&M){const G=d.trigger.getBoundingClientRect(),Y=y.getBoundingClientRect(),L=d.valueNode.getBoundingClientRect(),P=M.getBoundingClientRect();if(d.dir!=="rtl"){const oe=P.left-Y.left,Ee=L.left-oe,Xe=G.left-Ee,Be=G.width+Xe,Je=Math.max(Be,Y.width),Qe=window.innerWidth-ci,et=Xd(Ee,[ci,Math.max(ci,Qe-Je)]);h.style.minWidth=Be+"px",h.style.left=et+"px"}else{const oe=Y.right-P.right,Ee=window.innerWidth-L.right-oe,Xe=window.innerWidth-G.right-Ee,Be=G.width+Xe,Je=Math.max(Be,Y.width),Qe=window.innerWidth-ci,et=Xd(Ee,[ci,Math.max(ci,Qe-Je)]);h.style.minWidth=Be+"px",h.style.right=et+"px"}const q=j(),Z=window.innerHeight-ci*2,U=N.scrollHeight,F=window.getComputedStyle(y),X=parseInt(F.borderTopWidth,10),$=parseInt(F.paddingTop,10),H=parseInt(F.borderBottomWidth,10),ie=parseInt(F.paddingBottom,10),O=X+$+U+ie+H,le=Math.min(E.offsetHeight*5,O),ne=window.getComputedStyle(N),D=parseInt(ne.paddingTop,10),B=parseInt(ne.paddingBottom,10),W=G.top+G.height/2-ci,ue=Z-W,me=E.offsetHeight/2,ge=E.offsetTop+me,Se=X+$+ge,Me=O-Se;if(Se<=W){const oe=q.length>0&&E===q[q.length-1].ref.current;h.style.bottom="0px";const Ee=y.clientHeight-N.offsetTop-N.offsetHeight,Xe=Math.max(ue,me+(oe?B:0)+Ee+H),Be=Se+Xe;h.style.height=Be+"px"}else{const oe=q.length>0&&E===q[0].ref.current;h.style.top="0px";const Xe=Math.max(W,X+N.offsetTop+(oe?D:0)+me)+Me;h.style.height=Xe+"px",N.scrollTop=Se-W+N.offsetTop}h.style.margin=`${ci}px 0`,h.style.minHeight=le+"px",h.style.maxHeight=Z+"px",s==null||s(),requestAnimationFrame(()=>k.current=!0)}},[j,d.trigger,d.valueNode,h,y,N,E,M,d.dir,s]);In(()=>A(),[A]);const[_,R]=w.useState();In(()=>{y&&R(window.getComputedStyle(y).zIndex)},[y]);const I=w.useCallback(G=>{G&&S.current===!0&&(A(),C==null||C(),S.current=!1)},[A,C]);return o.jsx(XA,{scope:r,contentWrapper:h,shouldExpandOnScrollRef:k,onScrollButtonChange:I,children:o.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:o.jsx(Kt.div,{...c,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})},"SelectItemAlignedPosition")),Ax=w.forwardRef(zt(function(a,i){const{__scopeSelect:r,align:s="start",collisionPadding:c=ci,...d}=a,f=vg(r);return o.jsx(D3,{...f,...d,ref:i,align:s,collisionPadding:c,style:{boxSizing:"border-box",...d.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[XA,QA]=mo(uo,{}),Mx="SelectViewport",ZA=w.forwardRef(zt(function(a,i){const{__scopeSelect:r,nonce:s,...c}=a,d=yf(Mx,r),f=QA(Mx,r),h=Ot(i,d.onViewportChange),p=w.useRef(0);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),o.jsx(vf.Slot,{scope:r,children:o.jsx(Kt.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:h,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:St(c.onScroll,y=>{const g=y.currentTarget,{contentWrapper:b,shouldExpandOnScrollRef:j}=f;if(j!=null&&j.current&&b){const k=Math.abs(p.current-g.scrollTop);if(k>0){const S=window.innerHeight-ci*2,N=parseFloat(b.style.minHeight),E=parseFloat(b.style.height),M=Math.max(N,E);if(M<S){const C=M+k,A=Math.min(S,C),_=C-A;b.style.height=A+"px",b.style.bottom==="0px"&&(g.scrollTop=_>0?_:0,b.style.justifyContent="flex-end")}}}p.current=g.scrollTop})})})]})},"SelectViewport")),JA="SelectGroup",[Fq,Vq]=mo(JA),s0="SelectItem",[WA,X3]=mo(s0),eM=w.forwardRef(zt(function(a,i){const{__scopeSelect:r,value:s,disabled:c=!1,textValue:d,...f}=a,h=yl(s0,r),p=yf(s0,r),y=h.value===s,[g,b]=w.useState(d??""),[j,k]=w.useState(!1),S=Bn(A=>{var _;return(_=p.itemRefCallback)==null?void 0:_.call(p,A,s,c)}),N=Ot(i,S),E=ao(),M=w.useRef("touch"),C=zt(()=>{c||(h.onValueChange(s),h.onOpenChange(!1))},"handleSelect");return o.jsx(WA,{scope:r,value:s,disabled:c,textId:E,isSelected:y,onItemTextChange:w.useCallback(A=>{b(_=>_||((A==null?void 0:A.textContent)??"").trim())},[]),children:o.jsx(vf.ItemSlot,{scope:r,value:s,disabled:c,textValue:g,children:o.jsx(Kt.div,{role:"option","aria-labelledby":E,"data-highlighted":j?"":void 0,"aria-selected":y&&j,"data-state":y?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...f,ref:N,onFocus:St(f.onFocus,()=>k(!0)),onBlur:St(f.onBlur,()=>k(!1)),onClick:St(f.onClick,()=>{M.current!=="mouse"&&C()}),onPointerUp:St(f.onPointerUp,()=>{M.current==="mouse"&&C()}),onPointerDown:St(f.onPointerDown,A=>{M.current=A.pointerType}),onPointerMove:St(f.onPointerMove,A=>{var _;M.current=A.pointerType,c?(_=p.onItemLeave)==null||_.call(p):M.current==="mouse"&&A.currentTarget.focus({preventScroll:!0})}),onPointerLeave:St(f.onPointerLeave,A=>{var _;A.currentTarget===document.activeElement&&((_=p.onItemLeave)==null||_.call(p))}),onKeyDown:St(f.onKeyDown,A=>{var R;c||A.target!==A.currentTarget||((R=p.searchRef)==null?void 0:R.current)!==""&&A.key===" "||(AA.includes(A.key)&&C(),A.key===" "&&A.preventDefault())})})})})},"SelectItem")),wd="SelectItemText",tM=w.forwardRef(zt(function(a,i){const{__scopeSelect:r,className:s,style:c,...d}=a,f=yl(wd,r),h=yf(wd,r),p=X3(wd,r),y=OA(wd,r),[g,b]=w.useState(null),j=Bn(C=>{var A;return(A=h.itemTextRefCallback)==null?void 0:A.call(h,C,p.value,p.disabled)}),k=Ot(i,b,p.onItemTextChange,j),S=g==null?void 0:g.textContent,N=w.useMemo(()=>o.jsx("option",{value:p.value,disabled:p.disabled,children:S},p.value),[p.disabled,p.value,S]),{onNativeOptionAdd:E,onNativeOptionRemove:M}=y;return In(()=>(E(N),()=>M(N)),[E,M,N]),o.jsxs(o.Fragment,{children:[o.jsx(Kt.span,{id:p.textId,...d,ref:k}),p.isSelected&&f.valueNode&&!f.valueNodeHasChildren&&!Vc(f.value)?ho.createPortal(d.children,f.valueNode):null]})},"SelectItemText")),nM="SelectItemIndicator",aM=w.forwardRef(zt(function(a,i){const{__scopeSelect:r,...s}=a;return X3(nM,r).isSelected?o.jsx(Kt.span,{"aria-hidden":!0,...s,ref:i}):null},"SelectItemIndicator")),iM="SelectBubbleInput",rM=w.forwardRef(zt(function({__scopeSelect:a,...i},r){const s=yl(iM,a),{value:c,onValueChange:d,required:f,disabled:h,name:p,autoComplete:y,form:g}=s,{nativeOptions:b,nativeSelectKey:j}=s,k=w.useRef(null),S=Ot(r,k),N=c??"",E=z3(N),M=Array.from(b).some(C=>(C.props.value??"")==="");return w.useEffect(()=>{const C=k.current;if(!C)return;const A=window.HTMLSelectElement.prototype,R=Object.getOwnPropertyDescriptor(A,"value").set;if(E!==N&&R){const I=new Event("change",{bubbles:!0});R.call(C,N),C.dispatchEvent(I)}},[E,N]),o.jsxs(Kt.select,{"aria-hidden":!0,required:f,tabIndex:-1,name:p,autoComplete:y,disabled:h,form:g,onChange:C=>d(C.target.value),...i,style:{...X9,...i.style},ref:S,defaultValue:N,children:[Vc(c)&&!M?o.jsx("option",{value:""}):null,Array.from(b)]},j)},"SelectBubbleInput"));function Q3(e){return typeof e=="function"}zt(Q3,"isFunction");function Vc(e){return e===""||e===void 0}zt(Vc,"shouldShowPlaceholder");function yg(e){const a=Bn(e),i=w.useRef(""),r=w.useRef(0),s=w.useCallback(d=>{const f=i.current+d;a(f),zt((function h(p){i.current=p,window.clearTimeout(r.current),p!==""&&(r.current=window.setTimeout(()=>h(""),1e3))}),"updateSearch")(f)},[a]),c=w.useCallback(()=>{i.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[i,s,c]}zt(yg,"useTypeaheadSearch");function xg(e,a,i){const s=a.length>1&&Array.from(a).every(p=>p===a[0])?a[0]:a,c=i?e.indexOf(i):-1;let d=Z3(e,Math.max(c,0));s.length===1&&(d=d.filter(p=>p!==i));const h=d.find(p=>p.textValue.toLowerCase().startsWith(s.toLowerCase()));return h!==i?h:void 0}zt(xg,"findNextItem");function Z3(e,a){return e.map((i,r)=>e[(a+r)%e.length])}zt(Z3,"wrapArray");const lM=H0("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Ne({className:e,variant:a="default",size:i="default",asChild:r=!1,...s}){const c=r?H9:"button";return o.jsx(c,{"data-slot":"button","data-variant":a,"data-size":i,className:bn(lM({variant:a,size:i,className:e})),...s})}const bg=e=>na(e,{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});function to({value:e}){return o.jsx("pre",{className:"jv-history-json",children:JSON.stringify(e,null,2)})}function J3({blocks:e,links:a,onSelect:i}){return o.jsx(o.Fragment,{children:e.map((r,s)=>{if(r.type==="text"||r.type==="reasoning")return o.jsxs("section",{className:"jv-history-block",children:[o.jsx("h4",{children:x(r.type==="reasoning"?"history.reasoning":"history.text")}),o.jsx("pre",{className:"jv-history-text",children:r.text||x("history.empty")})]},s);if(r.type==="image")return o.jsxs("section",{className:"jv-history-block",children:[o.jsxs("h4",{children:[x("files.kindImage")," · ",r.mime_type]}),o.jsx("img",{className:"jv-history-image",src:`data:${r.mime_type};base64,${r.data}`,alt:x("history.image")})]},s);if(r.type==="tool_call"||r.type==="tool_result"){const c=a.filter(d=>d.tool_call_id===r.tool_call_id);return o.jsxs("section",{className:"jv-history-block",children:[o.jsxs("h4",{children:[x(r.type==="tool_call"?"history.toolCall":"history.toolResult")," · ",o.jsx("strong",{children:r.name}),r.type==="tool_result"&&r.is_error&&o.jsx("span",{className:"jv-history-error-tag",children:x("history.error")})]}),o.jsxs("div",{className:"jv-history-call",children:[o.jsx("code",{children:r.tool_call_id}),c.map(d=>o.jsxs("button",{type:"button",onClick:()=>i(d.id),"aria-label":x("history.related",{id:d.id}),children:[x(d.role==="tool"?"history.result":"history.call")," #",d.id]},d.id))]}),r.type==="tool_call"?o.jsx(to,{value:r.arguments}):o.jsxs(o.Fragment,{children:[o.jsx(J3,{blocks:r.result.content,links:[],onSelect:i}),r.result.details!==void 0&&o.jsxs("details",{children:[o.jsx("summary",{children:x("history.details")}),o.jsx(to,{value:r.result.details})]})]})]},s)}})})}function oM({detail:e,onSelect:a}){const[i,r]=w.useState("content"),{record:s,links:c}=e;return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"jv-history-detail-head",children:[o.jsxs("div",{children:[o.jsxs("h3",{children:["#",s.id," ",o.jsx("span",{children:s.role})]}),o.jsx("p",{children:bg(s.timestamp)})]}),o.jsxs("div",{role:"tablist","aria-label":x("history.view"),children:[o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",role:"tab","aria-selected":i==="content",onClick:()=>r("content"),children:x("history.content")}),o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",role:"tab","aria-selected":i==="json",onClick:()=>r("json"),children:x("history.json")})]})]}),o.jsx("div",{className:"jv-history-detail-scroll",role:"tabpanel","aria-label":x(i==="content"?"history.contentLabel":"history.json"),children:i==="json"?o.jsx(to,{value:s}):o.jsxs(o.Fragment,{children:[s.model&&o.jsxs("div",{className:"jv-history-model",children:[o.jsx("span",{children:x("usage.model")}),o.jsx("strong",{children:s.model.id}),o.jsx("small",{children:s.model.provider})]}),o.jsx(J3,{blocks:s.message.content,links:c,onSelect:a}),s.message.tools&&o.jsxs("details",{className:"jv-history-fold",children:[o.jsxs("summary",{children:[x("history.tools")," · ",s.message.tools.length]}),o.jsx(to,{value:s.message.tools})]}),s.message.tools_removed!==void 0&&o.jsxs("details",{className:"jv-history-fold",children:[o.jsx("summary",{children:x("history.toolsRemoved")}),o.jsx(to,{value:s.message.tools_removed})]}),s.message.stop_reason&&o.jsxs("p",{className:"jv-history-note",children:[x("history.stopReason")," · ",s.message.stop_reason]}),s.message.error&&o.jsx("pre",{className:"jv-history-failure",children:s.message.error}),o.jsxs("details",{className:"jv-history-fold",children:[o.jsx("summary",{children:"Usage"}),o.jsx(to,{value:s.usage})]}),o.jsxs("details",{className:"jv-history-fold",children:[o.jsx("summary",{children:"Extra"}),o.jsx(to,{value:s.extra})]})]})})]})}const _x={system:"activity.roleSystem",user:"activity.roleUser",assistant:"activity.roleAssistant",tool:"history.toolResult"},Rx=e=>na(e,{year:"numeric",month:"long",day:"numeric"}),sM=e=>[e.preview,...e.tools.map(a=>x(a.kind==="call"?"activity.toolCall":a.error?"activity.toolFailed":"activity.toolResult",{name:a.name})),e.images?x("activity.images",{count:e.images}):""].filter(Boolean).join(" "),cM=e=>na(e,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});function uM({items:e,onSelect:a}){return o.jsx("ol",{className:"jv-activity-timeline","aria-label":x("activity.timeline"),children:e.map((i,r)=>{const{record:s}=i,c=Rx(s.timestamp);return o.jsxs(w.Fragment,{children:[(r===0||Rx(e[r-1].record.timestamp)!==c)&&o.jsx("li",{className:"jv-activity-day",children:o.jsx("span",{children:c})}),o.jsxs("li",{className:`jv-activity-row is-${i.kind}`,"data-kind":i.kind,children:[o.jsxs("div",{className:"jv-activity-time",children:[o.jsx("time",{dateTime:new Date(s.timestamp).toISOString(),title:`${bg(s.timestamp)}.${String(s.timestamp%1e3).padStart(3,"0")}`,children:cM(s.timestamp)}),o.jsx("span",{className:"jv-activity-dot"})]}),i.kind==="chat"?o.jsxs("article",{className:"jv-activity-card jv-activity-chat","aria-label":x("activity.chatMessage",{id:i.record.id}),children:[o.jsxs("button",{type:"button",className:"jv-activity-card-main",onClick:()=>a({kind:"chat",id:i.record.id}),"aria-label":x("activity.viewMessage",{sequence:i.record.sequence,chat:i.record.chatTitle}),children:[o.jsxs("span",{className:"jv-activity-card-head",children:[o.jsx(P7,{}),o.jsx("strong",{title:i.record.chatTitle,children:i.record.chatTitle}),o.jsxs("span",{children:["#",i.record.sequence]})]}),o.jsx("span",{className:"jv-activity-preview",children:i.record.preview||x("activity.attachmentOnly")}),i.record.attachmentCount>0&&o.jsxs("span",{className:"jv-activity-attachment",children:[o.jsx(B0,{}),x("activity.attachments",{count:i.record.attachmentCount})]})]}),i.record.source&&o.jsxs("button",{type:"button",className:"jv-activity-source",onClick:()=>a({kind:"history",id:i.record.source.historyId}),"aria-label":x("activity.viewSentBy",{id:i.record.source.historyId}),children:[x("activity.sentBy",{id:i.record.source.historyId}),o.jsx(qp,{})]})]}):o.jsx("article",{className:"jv-activity-card jv-activity-history","aria-label":x("activity.historyRecord",{id:i.record.id}),children:o.jsxs("button",{type:"button",className:"jv-activity-card-main",onClick:()=>a({kind:"history",id:i.record.id}),"aria-label":x("activity.viewHistory",{id:i.record.id,role:i.record.role}),children:[o.jsxs("span",{className:"jv-activity-card-head",children:[o.jsx("strong",{children:_x[i.record.role]?x(_x[i.record.role]):i.record.role}),o.jsxs("span",{children:["#",i.record.id]})]}),o.jsx("span",{className:"jv-activity-preview",children:sM(i.record)||x("activity.emptyMessage")})]})})]})]},`${i.kind}:${s.id}`)})})}const dM={read:(e,a)=>we(`/bots/${e}/history/${a}`)};function fM(e,a){const i={};return(e[e.length-1]===""?[...e,""]:e).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const hM=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,mM=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pM={};function Ox(e,a){return(pM.jsx?mM:hM).test(e)}const gM=/[ \t\n\f\r]/g;function vM(e){return typeof e=="object"?e.type==="text"?Dx(e.value):!1:Dx(e)}function Dx(e){return e.replace(gM,"")===""}class $c{constructor(a,i,r){this.normal=i,this.property=a,r&&(this.space=r)}}$c.prototype.normal={};$c.prototype.property={};$c.prototype.space=void 0;function W3(e,a){const i={},r={};for(const s of e)Object.assign(i,s.property),Object.assign(r,s.normal);return new $c(i,r,a)}function c0(e){return e.toLowerCase()}class pa{constructor(a,i){this.attribute=i,this.property=a}}pa.prototype.attribute="";pa.prototype.booleanish=!1;pa.prototype.boolean=!1;pa.prototype.commaOrSpaceSeparated=!1;pa.prototype.commaSeparated=!1;pa.prototype.defined=!1;pa.prototype.mustUseProperty=!1;pa.prototype.number=!1;pa.prototype.overloadedBoolean=!1;pa.prototype.property="";pa.prototype.spaceSeparated=!1;pa.prototype.space=void 0;let yM=0;const rt=po(),pn=po(),u0=po(),Ae=po(),It=po(),io=po(),Ra=po();function po(){return 2**++yM}const d0=Object.freeze(Object.defineProperty({__proto__:null,boolean:rt,booleanish:pn,commaOrSpaceSeparated:Ra,commaSeparated:io,number:Ae,overloadedBoolean:u0,spaceSeparated:It},Symbol.toStringTag,{value:"Module"})),sp=Object.keys(d0);class jg extends pa{constructor(a,i,r,s){let c=-1;if(super(a,i),zx(this,"space",s),typeof r=="number")for(;++c<sp.length;){const d=sp[c];zx(this,sp[c],(r&d0[d])===d0[d])}}}jg.prototype.defined=!0;function zx(e,a,i){i&&(e[a]=i)}function Ss(e){const a={},i={};for(const[r,s]of Object.entries(e.properties)){const c=new jg(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(c.mustUseProperty=!0),a[r]=c,i[c0(r)]=r,i[c0(c.attribute)]=r}return new $c(a,i,e.space)}const ek=Ss({properties:{ariaActiveDescendant:null,ariaAtomic:pn,ariaAutoComplete:null,ariaBusy:pn,ariaChecked:pn,ariaColCount:Ae,ariaColIndex:Ae,ariaColSpan:Ae,ariaControls:It,ariaCurrent:null,ariaDescribedBy:It,ariaDetails:null,ariaDisabled:pn,ariaDropEffect:It,ariaErrorMessage:null,ariaExpanded:pn,ariaFlowTo:It,ariaGrabbed:pn,ariaHasPopup:null,ariaHidden:pn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:It,ariaLevel:Ae,ariaLive:null,ariaModal:pn,ariaMultiLine:pn,ariaMultiSelectable:pn,ariaOrientation:null,ariaOwns:It,ariaPlaceholder:null,ariaPosInSet:Ae,ariaPressed:pn,ariaReadOnly:pn,ariaRelevant:null,ariaRequired:pn,ariaRoleDescription:It,ariaRowCount:Ae,ariaRowIndex:Ae,ariaRowSpan:Ae,ariaSelected:pn,ariaSetSize:Ae,ariaSort:null,ariaValueMax:Ae,ariaValueMin:Ae,ariaValueNow:Ae,ariaValueText:null,role:null},transform(e,a){return a==="role"?a:"aria-"+a.slice(4).toLowerCase()}});function tk(e,a){return a in e?e[a]:a}function nk(e,a){return tk(e,a.toLowerCase())}const xM=Ss({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:io,acceptCharset:It,accessKey:It,action:null,allow:null,allowFullScreen:rt,allowPaymentRequest:rt,allowUserMedia:rt,alpha:rt,alt:null,as:null,async:rt,autoCapitalize:null,autoComplete:It,autoFocus:rt,autoPlay:rt,blocking:It,capture:null,charSet:null,checked:rt,cite:null,className:It,closedBy:null,colorSpace:null,cols:Ae,colSpan:Ae,command:null,commandFor:null,content:null,contentEditable:pn,controls:rt,controlsList:It,coords:Ae|io,crossOrigin:null,data:null,dateTime:null,decoding:null,default:rt,defer:rt,dir:null,dirName:null,disabled:rt,download:u0,draggable:pn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:rt,formTarget:null,headers:It,height:Ae,hidden:u0,high:Ae,href:null,hrefLang:null,htmlFor:It,httpEquiv:It,id:null,imageSizes:null,imageSrcSet:null,inert:rt,inputMode:null,integrity:null,is:null,isMap:rt,itemId:null,itemProp:It,itemRef:It,itemScope:rt,itemType:It,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:rt,low:Ae,manifest:null,max:null,maxLength:Ae,media:null,method:null,min:null,minLength:Ae,multiple:rt,muted:rt,name:null,nonce:null,noModule:rt,noValidate:rt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:rt,optimum:Ae,pattern:null,ping:It,placeholder:null,playsInline:rt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:rt,referrerPolicy:null,rel:It,required:rt,reversed:rt,rows:Ae,rowSpan:Ae,sandbox:It,scope:null,scoped:rt,seamless:rt,selected:rt,shadowRootClonable:rt,shadowRootCustomElementRegistry:rt,shadowRootDelegatesFocus:rt,shadowRootMode:null,shadowRootSerializable:rt,shape:null,size:Ae,sizes:null,slot:null,span:Ae,spellCheck:pn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ae,step:null,style:null,tabIndex:Ae,target:null,title:null,translate:null,type:null,typeMustMatch:rt,useMap:null,value:pn,width:Ae,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:It,axis:null,background:null,bgColor:null,border:Ae,borderColor:null,bottomMargin:Ae,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:rt,declare:rt,event:null,face:null,frame:null,frameBorder:null,hSpace:Ae,leftMargin:Ae,link:null,longDesc:null,lowSrc:null,marginHeight:Ae,marginWidth:Ae,noResize:rt,noHref:rt,noShade:rt,noWrap:rt,object:null,profile:null,prompt:null,rev:null,rightMargin:Ae,rules:null,scheme:null,scrolling:pn,standby:null,summary:null,text:null,topMargin:Ae,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ae,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:rt,disablePictureInPicture:rt,disableRemotePlayback:rt,exportParts:io,part:It,prefix:null,property:null,results:Ae,security:null,unselectable:null},space:"html",transform:nk}),bM=Ss({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ra,accentHeight:Ae,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ae,amplitude:Ae,arabicForm:null,ascent:Ae,attributeName:null,attributeType:null,azimuth:Ae,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ae,by:null,calcMode:null,capHeight:Ae,className:It,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ae,diffuseConstant:Ae,direction:null,display:null,dur:null,divisor:Ae,dominantBaseline:null,download:rt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ae,enableBackground:null,end:null,event:null,exponent:Ae,externalResourcesRequired:null,fill:null,fillOpacity:Ae,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:io,g2:io,glyphName:io,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ae,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ae,horizOriginX:Ae,horizOriginY:Ae,id:null,ideographic:Ae,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ae,k:Ae,k1:Ae,k2:Ae,k3:Ae,k4:Ae,kernelMatrix:Ra,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ae,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ae,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ae,overlineThickness:Ae,paintOrder:null,panose1:null,path:null,pathLength:Ae,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:It,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ae,pointsAtY:Ae,pointsAtZ:Ae,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ra,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ra,rev:Ra,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ra,requiredFeatures:Ra,requiredFonts:Ra,requiredFormats:Ra,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ae,specularExponent:Ae,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ae,strikethroughThickness:Ae,string:null,stroke:null,strokeDashArray:Ra,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ae,strokeOpacity:Ae,strokeWidth:null,style:null,surfaceScale:Ae,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ra,tabIndex:Ae,tableValues:null,target:null,targetX:Ae,targetY:Ae,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ra,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ae,underlineThickness:Ae,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ae,values:null,vAlphabetic:Ae,vMathematical:Ae,vectorEffect:null,vHanging:Ae,vIdeographic:Ae,version:null,vertAdvY:Ae,vertOriginX:Ae,vertOriginY:Ae,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ae,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:tk}),ak=Ss({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,a){return"xlink:"+a.slice(5).toLowerCase()}}),ik=Ss({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:nk}),rk=Ss({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,a){return"xml:"+a.slice(3).toLowerCase()}}),jM={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},wM=/[A-Z]/g,Lx=/-[a-z]/g,kM=/^data[-\w.:]+$/i;function SM(e,a){const i=c0(a);let r=a,s=pa;if(i in e.normal)return e.property[e.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&kM.test(a)){if(a.charAt(4)==="-"){const c=a.slice(5).replace(Lx,NM);r="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=a.slice(4);if(!Lx.test(c)){let d=c.replace(wM,CM);d.charAt(0)!=="-"&&(d="-"+d),a="data"+d}}s=jg}return new s(r,a)}function CM(e){return"-"+e.toLowerCase()}function NM(e){return e.charAt(1).toUpperCase()}const EM=W3([ek,xM,ak,ik,rk],"html"),wg=W3([ek,bM,ak,ik,rk],"svg");function TM(e){return e.join(" ").trim()}var ls={},cp,Bx;function AM(){if(Bx)return cp;Bx=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,a=/\n/g,i=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
565
+ `,p="/",y="*",g="",b="comment",j="declaration";function k(N,E){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];E=E||{};var M=1,C=1;function A(U){var F=U.match(a);F&&(M+=F.length);var X=U.lastIndexOf(h);C=~X?U.length-X:C+U.length}function _(){var U={line:M,column:C};return function(F){return F.position=new R(U),Y(),F}}function R(U){this.start=U,this.end={line:M,column:C},this.source=E.source}R.prototype.content=N;function I(U){var F=new Error(E.source+":"+M+":"+C+": "+U);if(F.reason=U,F.filename=E.source,F.line=M,F.column=C,F.source=N,!E.silent)throw F}function G(U){var F=U.exec(N);if(F){var X=F[0];return A(X),N=N.slice(X.length),F}}function Y(){G(i)}function L(U){var F;for(U=U||[];F=P();)F!==!1&&U.push(F);return U}function P(){var U=_();if(!(p!=N.charAt(0)||y!=N.charAt(1))){for(var F=2;g!=N.charAt(F)&&(y!=N.charAt(F)||p!=N.charAt(F+1));)++F;if(F+=2,g===N.charAt(F-1))return I("End of comment missing");var X=N.slice(2,F-2);return C+=2,A(X),N=N.slice(F),C+=2,U({type:b,comment:X})}}function q(){var U=_(),F=G(r);if(F){if(P(),!G(s))return I("property missing ':'");var X=G(c),$=U({type:j,property:S(F[0].replace(e,g)),value:X?S(X[0].replace(e,g)):g});return G(d),$}}function Z(){var U=[];L(U);for(var F;F=q();)F!==!1&&(U.push(F),L(U));return U}return Y(),Z()}function S(N){return N?N.replace(f,g):g}return cp=k,cp}var Ix;function MM(){if(Ix)return ls;Ix=1;var e=ls&&ls.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ls,"__esModule",{value:!0}),ls.default=i;const a=e(AM());function i(r,s){let c=null;if(!r||typeof r!="string")return c;const d=(0,a.default)(r),f=typeof s=="function";return d.forEach(h=>{if(h.type!=="declaration")return;const{property:p,value:y}=h;f?s(p,y,h):y&&(c=c||{},c[p]=y)}),c}return ls}var bc={},Px;function _M(){if(Px)return bc;Px=1,Object.defineProperty(bc,"__esModule",{value:!0}),bc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,a=/-([a-z])/g,i=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,c=function(p){return!p||i.test(p)||e.test(p)},d=function(p,y){return y.toUpperCase()},f=function(p,y){return"".concat(y,"-")},h=function(p,y){return y===void 0&&(y={}),c(p)?p:(p=p.toLowerCase(),y.reactCompat?p=p.replace(s,f):p=p.replace(r,f),p.replace(a,d))};return bc.camelCase=h,bc}var jc,Hx;function RM(){if(Hx)return jc;Hx=1;var e=jc&&jc.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},a=e(MM()),i=_M();function r(s,c){var d={};return!s||typeof s!="string"||(0,a.default)(s,function(f,h){f&&h&&(d[(0,i.camelCase)(f,c)]=h)}),d}return r.default=r,jc=r,jc}var OM=RM();const DM=A0(OM),lk=ok("end"),kg=ok("start");function ok(e){return a;function a(i){const r=i&&i.position&&i.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function zM(e){const a=kg(e),i=lk(e);if(a&&i)return{start:a,end:i}}function Cc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?qx(e.position):"start"in e||"end"in e?qx(e):"line"in e||"column"in e?f0(e):""}function f0(e){return Ux(e&&e.line)+":"+Ux(e&&e.column)}function qx(e){return f0(e&&e.start)+"-"+f0(e&&e.end)}function Ux(e){return e&&typeof e=="number"?e:1}class Vn extends Error{constructor(a,i,r){super(),typeof i=="string"&&(r=i,i=void 0);let s="",c={},d=!1;if(i&&("line"in i&&"column"in i?c={place:i}:"start"in i&&"end"in i?c={place:i}:"type"in i?c={ancestors:[i],place:i.position}:c={...i}),typeof a=="string"?s=a:!c.cause&&a&&(d=!0,s=a.message,c.cause=a),!c.ruleId&&!c.source&&typeof r=="string"){const h=r.indexOf(":");h===-1?c.ruleId=r:(c.source=r.slice(0,h),c.ruleId=r.slice(h+1))}if(!c.place&&c.ancestors&&c.ancestors){const h=c.ancestors[c.ancestors.length-1];h&&(c.place=h.position)}const f=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=f?f.line:void 0,this.name=Cc(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=d&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Vn.prototype.file="";Vn.prototype.name="";Vn.prototype.reason="";Vn.prototype.message="";Vn.prototype.stack="";Vn.prototype.column=void 0;Vn.prototype.line=void 0;Vn.prototype.ancestors=void 0;Vn.prototype.cause=void 0;Vn.prototype.fatal=void 0;Vn.prototype.place=void 0;Vn.prototype.ruleId=void 0;Vn.prototype.source=void 0;const Sg={}.hasOwnProperty,LM=new Map,BM=/[A-Z]/g,IM=new Set(["table","tbody","thead","tfoot","tr"]),PM=new Set(["td","th"]),sk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function HM(e,a){if(!a||a.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const i=a.filePath||void 0;let r;if(a.development){if(typeof a.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=KM(i,a.jsxDEV)}else{if(typeof a.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof a.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=YM(i,a.jsx,a.jsxs)}const s={Fragment:a.Fragment,ancestors:[],components:a.components||{},create:r,elementAttributeNameCase:a.elementAttributeNameCase||"react",evaluater:a.createEvaluater?a.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:a.ignoreInvalidStyle||!1,passKeys:a.passKeys!==!1,passNode:a.passNode||!1,schema:a.space==="svg"?wg:EM,stylePropertyNameCase:a.stylePropertyNameCase||"dom",tableCellAlignToStyle:a.tableCellAlignToStyle!==!1},c=ck(s,e,void 0);return c&&typeof c!="string"?c:s.create(e,s.Fragment,{children:c||void 0},void 0)}function ck(e,a,i){if(a.type==="element")return qM(e,a,i);if(a.type==="mdxFlowExpression"||a.type==="mdxTextExpression")return UM(e,a);if(a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement")return VM(e,a,i);if(a.type==="mdxjsEsm")return FM(e,a);if(a.type==="root")return $M(e,a,i);if(a.type==="text")return GM(e,a)}function qM(e,a,i){const r=e.schema;let s=r;a.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=wg,e.schema=s),e.ancestors.push(a);const c=dk(e,a.tagName,!1),d=XM(e,a);let f=Ng(e,a);return IM.has(a.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!vM(h):!0})),uk(e,d,c,a),Cg(d,f),e.ancestors.pop(),e.schema=r,e.create(a,c,d,i)}function UM(e,a){if(a.data&&a.data.estree&&e.evaluater){const r=a.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}zc(e,a.position)}function FM(e,a){if(a.data&&a.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(a.data.estree);zc(e,a.position)}function VM(e,a,i){const r=e.schema;let s=r;a.name==="svg"&&r.space==="html"&&(s=wg,e.schema=s),e.ancestors.push(a);const c=a.name===null?e.Fragment:dk(e,a.name,!0),d=QM(e,a),f=Ng(e,a);return uk(e,d,c,a),Cg(d,f),e.ancestors.pop(),e.schema=r,e.create(a,c,d,i)}function $M(e,a,i){const r={};return Cg(r,Ng(e,a)),e.create(a,e.Fragment,r,i)}function GM(e,a){return a.value}function uk(e,a,i,r){typeof i!="string"&&i!==e.Fragment&&e.passNode&&(a.node=r)}function Cg(e,a){if(a.length>0){const i=a.length>1?a:a[0];i&&(e.children=i)}}function YM(e,a,i){return r;function r(s,c,d,f){const p=Array.isArray(d.children)?i:a;return f?p(c,d,f):p(c,d)}}function KM(e,a){return i;function i(r,s,c,d){const f=Array.isArray(c.children),h=kg(r);return a(s,c,d,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function XM(e,a){const i={};let r,s;for(s in a.properties)if(s!=="children"&&Sg.call(a.properties,s)){const c=ZM(e,s,a.properties[s]);if(c){const[d,f]=c;e.tableCellAlignToStyle&&d==="align"&&typeof f=="string"&&PM.has(a.tagName)?r=f:i[d]=f}}if(r){const c=i.style||(i.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return i}function QM(e,a){const i={};for(const r of a.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const c=r.data.estree.body[0];c.type;const d=c.expression;d.type;const f=d.properties[0];f.type,Object.assign(i,e.evaluater.evaluateExpression(f.argument))}else zc(e,a.position);else{const s=r.name;let c;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const f=r.value.data.estree.body[0];f.type,c=e.evaluater.evaluateExpression(f.expression)}else zc(e,a.position);else c=r.value===null?!0:r.value;i[s]=c}return i}function Ng(e,a){const i=[];let r=-1;const s=e.passKeys?new Map:LM;for(;++r<a.children.length;){const c=a.children[r];let d;if(e.passKeys){const h=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(h){const p=s.get(h)||0;d=h+"-"+p,s.set(h,p+1)}}const f=ck(e,c,d);f!==void 0&&i.push(f)}return i}function ZM(e,a,i){const r=SM(e.schema,a);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=r.commaSeparated?fM(i):TM(i)),r.property==="style"){let s=typeof i=="object"?i:JM(e,String(i));return e.stylePropertyNameCase==="css"&&(s=WM(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?jM[r.property]||r.property:r.attribute,i]}}function JM(e,a){try{return DM(a,{reactCompat:!0})}catch(i){if(e.ignoreInvalidStyle)return{};const r=i,s=new Vn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=sk+"#cannot-parse-style-attribute",s}}function dk(e,a,i){let r;if(!i)r={type:"Literal",value:a};else if(a.includes(".")){const s=a.split(".");let c=-1,d;for(;++c<s.length;){const f=Ox(s[c])?{type:"Identifier",name:s[c]}:{type:"Literal",value:s[c]};d=d?{type:"MemberExpression",object:d,property:f,computed:!!(c&&f.type==="Literal"),optional:!1}:f}r=d}else r=Ox(a)&&!/^[a-z]/.test(a)?{type:"Identifier",name:a}:{type:"Literal",value:a};if(r.type==="Literal"){const s=r.value;return Sg.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);zc(e)}function zc(e,a){const i=new Vn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:a,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=sk+"#cannot-handle-mdx-estrees-without-createevaluater",i}function WM(e){const a={};let i;for(i in e)Sg.call(e,i)&&(a[e_(i)]=e[i]);return a}function e_(e){let a=e.replace(BM,t_);return a.slice(0,3)==="ms-"&&(a="-"+a),a}function t_(e){return"-"+e.toLowerCase()}const up={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},n_={};function Eg(e,a){const i=n_,r=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,s=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return fk(e,r,s)}function fk(e,a,i){if(a_(e)){if("value"in e)return e.type==="html"&&!i?"":e.value;if(a&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Fx(e.children,a,i)}return Array.isArray(e)?Fx(e,a,i):""}function Fx(e,a,i){const r=[];let s=-1;for(;++s<e.length;)r[s]=fk(e[s],a,i);return r.join("")}function a_(e){return!!(e&&typeof e=="object")}const Vx=document.createElement("i");function Tg(e){const a="&"+e+";";Vx.innerHTML=a;const i=Vx.textContent;return i.charCodeAt(i.length-1)===59&&e!=="semi"||i===a?!1:i}function Da(e,a,i,r){const s=e.length;let c=0,d;if(a<0?a=-a>s?0:s+a:a=a>s?s:a,i=i>0?i:0,r.length<1e4)d=Array.from(r),d.unshift(a,i),e.splice(...d);else for(i&&e.splice(a,i);c<r.length;)d=r.slice(c,c+1e4),d.unshift(a,0),e.splice(...d),c+=1e4,a+=1e4}function Xa(e,a){return e.length>0?(Da(e,e.length,0,a),e):a}const $x={}.hasOwnProperty;function hk(e){const a={};let i=-1;for(;++i<e.length;)i_(a,e[i]);return a}function i_(e,a){let i;for(i in a){const s=($x.call(e,i)?e[i]:void 0)||(e[i]={}),c=a[i];let d;if(c)for(d in c){$x.call(s,d)||(s[d]=[]);const f=c[d];r_(s[d],Array.isArray(f)?f:f?[f]:[])}}}function r_(e,a){let i=-1;const r=[];for(;++i<a.length;)(a[i].add==="after"?e:r).push(a[i]);Da(e,0,0,r)}function mk(e,a){const i=Number.parseInt(e,a);return i<9||i===11||i>13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":String.fromCodePoint(i)}function fi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ea=xl(/[A-Za-z]/),Fn=xl(/[\dA-Za-z]/),l_=xl(/[#-'*+\--9=?A-Z^-~]/);function Qd(e){return e!==null&&(e<32||e===127)}const h0=xl(/\d/),o_=xl(/[\dA-Fa-f]/),s_=xl(/[!-/:-@[-`{-~]/);function Ze(e){return e!==null&&e<-2}function Pt(e){return e!==null&&(e<0||e===32)}function mt(e){return e===-2||e===-1||e===32}const xf=xl(new RegExp("\\p{P}|\\p{S}","u")),fo=xl(/\s/);function xl(e){return a;function a(i){return i!==null&&i>-1&&e.test(String.fromCharCode(i))}}function Cs(e){const a=[];let i=-1,r=0,s=0;for(;++i<e.length;){const c=e.charCodeAt(i);let d="";if(c===37&&Fn(e.charCodeAt(i+1))&&Fn(e.charCodeAt(i+2)))s=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(d=String.fromCharCode(c));else if(c>55295&&c<57344){const f=e.charCodeAt(i+1);c<56320&&f>56319&&f<57344?(d=String.fromCharCode(c,f),s=1):d="�"}else d=String.fromCharCode(c);d&&(a.push(e.slice(r,i),encodeURIComponent(d)),r=i+s+1,d=""),s&&(i+=s,s=0)}return a.join("")+e.slice(r)}function wt(e,a,i,r){const s=r?r-1:Number.POSITIVE_INFINITY;let c=0;return d;function d(h){return mt(h)?(e.enter(i),f(h)):a(h)}function f(h){return mt(h)&&c++<s?(e.consume(h),f):(e.exit(i),a(h))}}const c_={tokenize:u_};function u_(e){const a=e.attempt(this.parser.constructs.contentInitial,r,s);let i;return a;function r(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),wt(e,a,"linePrefix")}function s(f){return e.enter("paragraph"),c(f)}function c(f){const h=e.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=h),i=h,d(f)}function d(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Ze(f)?(e.consume(f),e.exit("chunkText"),c):(e.consume(f),d)}}const d_={tokenize:f_},Gx={tokenize:h_};function f_(e){const a=this,i=[];let r=0,s,c,d;return f;function f(C){if(r<i.length){const A=i[r];return a.containerState=A[1],e.attempt(A[0].continuation,h,p)(C)}return p(C)}function h(C){if(r++,a.containerState._closeFlow){a.containerState._closeFlow=void 0,s&&M();const A=a.events.length;let _=A,R;for(;_--;)if(a.events[_][0]==="exit"&&a.events[_][1].type==="chunkFlow"){R=a.events[_][1].end;break}E(r);let I=A;for(;I<a.events.length;)a.events[I][1].end={...R},I++;return Da(a.events,_+1,0,a.events.slice(A)),a.events.length=I,p(C)}return f(C)}function p(C){if(r===i.length){if(!s)return b(C);if(s.currentConstruct&&s.currentConstruct.concrete)return k(C);a.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return a.containerState={},e.check(Gx,y,g)(C)}function y(C){return s&&M(),E(r),b(C)}function g(C){return a.parser.lazy[a.now().line]=r!==i.length,d=a.now().offset,k(C)}function b(C){return a.containerState={},e.attempt(Gx,j,k)(C)}function j(C){return r++,i.push([a.currentConstruct,a.containerState]),b(C)}function k(C){if(C===null){s&&M(),E(0),e.consume(C);return}return s=s||a.parser.flow(a.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:c}),S(C)}function S(C){if(C===null){N(e.exit("chunkFlow"),!0),E(0),e.consume(C);return}return Ze(C)?(e.consume(C),N(e.exit("chunkFlow")),r=0,a.interrupt=void 0,f):(e.consume(C),S)}function N(C,A){const _=a.sliceStream(C);if(A&&_.push(null),C.previous=c,c&&(c.next=C),c=C,s.defineSkip(C.start),s.write(_),a.parser.lazy[C.start.line]){let R=s.events.length;for(;R--;)if(s.events[R][1].start.offset<d&&(!s.events[R][1].end||s.events[R][1].end.offset>d))return;const I=a.events.length;let G=I,Y,L;for(;G--;)if(a.events[G][0]==="exit"&&a.events[G][1].type==="chunkFlow"){if(Y){L=a.events[G][1].end;break}Y=!0}for(E(r),R=I;R<a.events.length;)a.events[R][1].end={...L},R++;Da(a.events,G+1,0,a.events.slice(I)),a.events.length=R}}function E(C){let A=i.length;for(;A-- >C;){const _=i[A];a.containerState=_[1],_[0].exit.call(a,e)}i.length=C}function M(){s.write([null]),c=void 0,s=void 0,a.containerState._closeFlow=void 0}}function h_(e,a,i){return wt(e,e.attempt(this.parser.constructs.document,a,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ps(e){if(e===null||Pt(e)||fo(e))return 1;if(xf(e))return 2}function bf(e,a,i){const r=[];let s=-1;for(;++s<e.length;){const c=e[s].resolveAll;c&&!r.includes(c)&&(a=c(a,i),r.push(c))}return a}const m0={name:"attention",resolveAll:m_,tokenize:p_};function m_(e,a){let i=-1,r,s,c,d,f,h,p,y;for(;++i<e.length;)if(e[i][0]==="enter"&&e[i][1].type==="attentionSequence"&&e[i][1]._close){for(r=i;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&a.sliceSerialize(e[r][1]).charCodeAt(0)===a.sliceSerialize(e[i][1]).charCodeAt(0)){if((e[r][1]._close||e[i][1]._open)&&(e[i][1].end.offset-e[i][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[i][1].end.offset-e[i][1].start.offset)%3))continue;h=e[r][1].end.offset-e[r][1].start.offset>1&&e[i][1].end.offset-e[i][1].start.offset>1?2:1;const g={...e[r][1].end},b={...e[i][1].start};Yx(g,-h),Yx(b,h),d={type:h>1?"strongSequence":"emphasisSequence",start:g,end:{...e[r][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[i][1].start},end:b},c={type:h>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[i][1].start}},s={type:h>1?"strong":"emphasis",start:{...d.start},end:{...f.end}},e[r][1].end={...d.start},e[i][1].start={...f.end},p=[],e[r][1].end.offset-e[r][1].start.offset&&(p=Xa(p,[["enter",e[r][1],a],["exit",e[r][1],a]])),p=Xa(p,[["enter",s,a],["enter",d,a],["exit",d,a],["enter",c,a]]),p=Xa(p,bf(a.parser.constructs.insideSpan.null,e.slice(r+1,i),a)),p=Xa(p,[["exit",c,a],["enter",f,a],["exit",f,a],["exit",s,a]]),e[i][1].end.offset-e[i][1].start.offset?(y=2,p=Xa(p,[["enter",e[i][1],a],["exit",e[i][1],a]])):y=0,Da(e,r-1,i-r+3,p),i=r+p.length-y-2;break}}for(i=-1;++i<e.length;)e[i][1].type==="attentionSequence"&&(e[i][1].type="data");return e}function p_(e,a){const i=this.parser.constructs.attentionMarkers.null,r=this.previous,s=ps(r);let c;return d;function d(h){return c=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===c)return e.consume(h),f;const p=e.exit("attentionSequence"),y=ps(h),g=!y||y===2&&s||i.includes(h),b=!s||s===2&&y||i.includes(r);return p._open=!!(c===42?g:g&&(s||!b)),p._close=!!(c===42?b:b&&(y||!g)),a(h)}}function Yx(e,a){e.column+=a,e.offset+=a,e._bufferIndex+=a}const g_={name:"autolink",tokenize:v_};function v_(e,a,i){let r=0;return s;function s(j){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(j),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),c}function c(j){return ea(j)?(e.consume(j),d):j===64?i(j):p(j)}function d(j){return j===43||j===45||j===46||Fn(j)?(r=1,f(j)):p(j)}function f(j){return j===58?(e.consume(j),r=0,h):(j===43||j===45||j===46||Fn(j))&&r++<32?(e.consume(j),f):(r=0,p(j))}function h(j){return j===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(j),e.exit("autolinkMarker"),e.exit("autolink"),a):j===null||j===32||j===60||Qd(j)?i(j):(e.consume(j),h)}function p(j){return j===64?(e.consume(j),y):l_(j)?(e.consume(j),p):i(j)}function y(j){return Fn(j)?g(j):i(j)}function g(j){return j===46?(e.consume(j),r=0,y):j===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(j),e.exit("autolinkMarker"),e.exit("autolink"),a):b(j)}function b(j){if((j===45||Fn(j))&&r++<63){const k=j===45?b:g;return e.consume(j),k}return i(j)}}const Gc={partial:!0,tokenize:y_};function y_(e,a,i){return r;function r(c){return mt(c)?wt(e,s,"linePrefix")(c):s(c)}function s(c){return c===null||Ze(c)?a(c):i(c)}}const pk={continuation:{tokenize:b_},exit:j_,name:"blockQuote",tokenize:x_};function x_(e,a,i){const r=this;return s;function s(d){if(d===62){const f=r.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),c}return i(d)}function c(d){return mt(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),a):(e.exit("blockQuotePrefix"),a(d))}}function b_(e,a,i){const r=this;return s;function s(d){return mt(d)?wt(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):c(d)}function c(d){return e.attempt(pk,a,i)(d)}}function j_(e){e.exit("blockQuote")}const gk={name:"characterEscape",tokenize:w_};function w_(e,a,i){return r;function r(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),s}function s(c){return s_(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),a):i(c)}}const vk={name:"characterReference",tokenize:k_};function k_(e,a,i){const r=this;let s=0,c,d;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),h}function h(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),c=31,d=Fn,y(g))}function p(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,d=o_,y):(e.enter("characterReferenceValue"),c=7,d=h0,y(g))}function y(g){if(g===59&&s){const b=e.exit("characterReferenceValue");return d===Fn&&!Tg(r.sliceSerialize(b))?i(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),a)}return d(g)&&s++<c?(e.consume(g),y):i(g)}}const Kx={partial:!0,tokenize:C_},Xx={concrete:!0,name:"codeFenced",tokenize:S_};function S_(e,a,i){const r=this,s={partial:!0,tokenize:_};let c=0,d=0,f;return h;function h(R){return p(R)}function p(R){const I=r.events[r.events.length-1];return c=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,f=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(R)}function y(R){return R===f?(d++,e.consume(R),y):d<3?i(R):(e.exit("codeFencedFenceSequence"),mt(R)?wt(e,g,"whitespace")(R):g(R))}function g(R){return R===null||Ze(R)?(e.exit("codeFencedFence"),r.interrupt?a(R):e.check(Kx,S,A)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(R))}function b(R){return R===null||Ze(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(R)):mt(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),wt(e,j,"whitespace")(R)):R===96&&R===f?i(R):(e.consume(R),b)}function j(R){return R===null||Ze(R)?g(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(R))}function k(R){return R===null||Ze(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(R)):R===96&&R===f?i(R):(e.consume(R),k)}function S(R){return e.attempt(s,A,N)(R)}function N(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),E}function E(R){return c>0&&mt(R)?wt(e,M,"linePrefix",c+1)(R):M(R)}function M(R){return R===null||Ze(R)?e.check(Kx,S,A)(R):(e.enter("codeFlowValue"),C(R))}function C(R){return R===null||Ze(R)?(e.exit("codeFlowValue"),M(R)):(e.consume(R),C)}function A(R){return e.exit("codeFenced"),a(R)}function _(R,I,G){let Y=0;return L;function L(F){return R.enter("lineEnding"),R.consume(F),R.exit("lineEnding"),P}function P(F){return R.enter("codeFencedFence"),mt(F)?wt(R,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):q(F)}function q(F){return F===f?(R.enter("codeFencedFenceSequence"),Z(F)):G(F)}function Z(F){return F===f?(Y++,R.consume(F),Z):Y>=d?(R.exit("codeFencedFenceSequence"),mt(F)?wt(R,U,"whitespace")(F):U(F)):G(F)}function U(F){return F===null||Ze(F)?(R.exit("codeFencedFence"),I(F)):G(F)}}}function C_(e,a,i){const r=this;return s;function s(d){return d===null?i(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c)}function c(d){return r.parser.lazy[r.now().line]?i(d):a(d)}}const dp={name:"codeIndented",tokenize:E_},N_={partial:!0,tokenize:T_};function E_(e,a,i){const r=this;return s;function s(p){return e.enter("codeIndented"),wt(e,c,"linePrefix",5)(p)}function c(p){const y=r.events[r.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?d(p):i(p)}function d(p){return p===null?h(p):Ze(p)?e.attempt(N_,d,h)(p):(e.enter("codeFlowValue"),f(p))}function f(p){return p===null||Ze(p)?(e.exit("codeFlowValue"),d(p)):(e.consume(p),f)}function h(p){return e.exit("codeIndented"),a(p)}}function T_(e,a,i){const r=this;return s;function s(d){return r.parser.lazy[r.now().line]?i(d):Ze(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),s):wt(e,c,"linePrefix",5)(d)}function c(d){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?a(d):Ze(d)?s(d):i(d)}}const A_={name:"codeText",previous:__,resolve:M_,tokenize:R_};function M_(e){let a=e.length-4,i=3,r,s;if((e[i][1].type==="lineEnding"||e[i][1].type==="space")&&(e[a][1].type==="lineEnding"||e[a][1].type==="space")){for(r=i;++r<a;)if(e[r][1].type==="codeTextData"){e[i][1].type="codeTextPadding",e[a][1].type="codeTextPadding",i+=2,a-=2;break}}for(r=i-1,a++;++r<=a;)s===void 0?r!==a&&e[r][1].type!=="lineEnding"&&(s=r):(r===a||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),a-=r-s-2,r=s+2),s=void 0);return e}function __(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function R_(e,a,i){let r=0,s,c;return d;function d(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),r++,f):(e.exit("codeTextSequence"),h(g))}function h(g){return g===null?i(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),h):g===96?(c=e.enter("codeTextSequence"),s=0,y(g)):Ze(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),h):(e.enter("codeTextData"),p(g))}function p(g){return g===null||g===32||g===96||Ze(g)?(e.exit("codeTextData"),h(g)):(e.consume(g),p)}function y(g){return g===96?(e.consume(g),s++,y):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),a(g)):(c.type="codeTextData",p(g))}}class O_{constructor(a){this.left=a?[...a]:[],this.right=[]}get(a){if(a<0||a>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+a+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return a<this.left.length?this.left[a]:this.right[this.right.length-a+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(a,i){const r=i??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(a,r):a>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-a+this.left.length).reverse():this.left.slice(a).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(a,i,r){const s=i||0;this.setCursor(Math.trunc(a));const c=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&wc(this.left,r),c.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(a){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(a)}pushMany(a){this.setCursor(Number.POSITIVE_INFINITY),wc(this.left,a)}unshift(a){this.setCursor(0),this.right.push(a)}unshiftMany(a){this.setCursor(0),wc(this.right,a.reverse())}setCursor(a){if(!(a===this.left.length||a>this.left.length&&this.right.length===0||a<0&&this.left.length===0))if(a<this.left.length){const i=this.left.splice(a,Number.POSITIVE_INFINITY);wc(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-a,Number.POSITIVE_INFINITY);wc(this.left,i.reverse())}}}function wc(e,a){let i=0;if(a.length<1e4)e.push(...a);else for(;i<a.length;)e.push(...a.slice(i,i+1e4)),i+=1e4}function yk(e){const a={};let i=-1,r,s,c,d,f,h,p;const y=new O_(e);for(;++i<y.length;){for(;i in a;)i=a[i];if(r=y.get(i),i&&r[1].type==="chunkFlow"&&y.get(i-1)[1].type==="listItemPrefix"&&(h=r[1]._tokenizer.events,c=0,c<h.length&&h[c][1].type==="lineEndingBlank"&&(c+=2),c<h.length&&h[c][1].type==="content"))for(;++c<h.length&&h[c][1].type!=="content";)h[c][1].type==="chunkText"&&(h[c][1]._isInFirstContentOfListItem=!0,c++);if(r[0]==="enter")r[1].contentType&&(Object.assign(a,D_(y,i)),i=a[i],p=!0);else if(r[1]._container){for(c=i,s=void 0;c--;)if(d=y.get(c),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(s&&(y.get(s)[1].type="lineEndingBlank"),d[1].type="lineEnding",s=c);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;s&&(r[1].end={...y.get(s)[1].start},f=y.slice(s,i),f.unshift(r),y.splice(s,i-s+1,f))}}return Da(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!p}function D_(e,a){const i=e.get(a)[1],r=e.get(a)[2];let s=a-1;const c=[];let d=i._tokenizer;d||(d=r.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const f=d.events,h=[],p={};let y,g,b=-1,j=i,k=0,S=0;const N=[S];for(;j;){for(;e.get(++s)[1]!==j;);c.push(s),j._tokenizer||(y=r.sliceStream(j),j.next||y.push(null),g&&d.defineSkip(j.start),j._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(y),j._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),g=j,j=j.next}for(j=i;++b<f.length;)f[b][0]==="exit"&&f[b-1][0]==="enter"&&f[b][1].type===f[b-1][1].type&&f[b][1].start.line!==f[b][1].end.line&&(S=b+1,N.push(S),j._tokenizer=void 0,j.previous=void 0,j=j.next);for(d.events=[],j?(j._tokenizer=void 0,j.previous=void 0):N.pop(),b=N.length;b--;){const E=f.slice(N[b],N[b+1]),M=c.pop();h.push([M,M+E.length-1]),e.splice(M,2,E)}for(h.reverse(),b=-1;++b<h.length;)p[k+h[b][0]]=k+h[b][1],k+=h[b][1]-h[b][0]-1;return p}const z_={resolve:B_,tokenize:I_},L_={partial:!0,tokenize:P_};function B_(e){return yk(e),e}function I_(e,a){let i;return r;function r(f){return e.enter("content"),i=e.enter("chunkContent",{contentType:"content"}),s(f)}function s(f){return f===null?c(f):Ze(f)?e.check(L_,d,c)(f):(e.consume(f),s)}function c(f){return e.exit("chunkContent"),e.exit("content"),a(f)}function d(f){return e.consume(f),e.exit("chunkContent"),i.next=e.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,s}}function P_(e,a,i){const r=this;return s;function s(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),wt(e,c,"linePrefix")}function c(d){if(d===null||Ze(d))return i(d);const f=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?a(d):e.interrupt(r.parser.constructs.flow,i,a)(d)}}function xk(e,a,i,r,s,c,d,f,h){const p=h||Number.POSITIVE_INFINITY;let y=0;return g;function g(E){return E===60?(e.enter(r),e.enter(s),e.enter(c),e.consume(E),e.exit(c),b):E===null||E===32||E===41||Qd(E)?i(E):(e.enter(r),e.enter(d),e.enter(f),e.enter("chunkString",{contentType:"string"}),S(E))}function b(E){return E===62?(e.enter(c),e.consume(E),e.exit(c),e.exit(s),e.exit(r),a):(e.enter(f),e.enter("chunkString",{contentType:"string"}),j(E))}function j(E){return E===62?(e.exit("chunkString"),e.exit(f),b(E)):E===null||E===60||Ze(E)?i(E):(e.consume(E),E===92?k:j)}function k(E){return E===60||E===62||E===92?(e.consume(E),j):j(E)}function S(E){return!y&&(E===null||E===41||Pt(E))?(e.exit("chunkString"),e.exit(f),e.exit(d),e.exit(r),a(E)):y<p&&E===40?(e.consume(E),y++,S):E===41?(e.consume(E),y--,S):E===null||E===32||E===40||Qd(E)?i(E):(e.consume(E),E===92?N:S)}function N(E){return E===40||E===41||E===92?(e.consume(E),S):S(E)}}function bk(e,a,i,r,s,c){const d=this;let f=0,h;return p;function p(j){return e.enter(r),e.enter(s),e.consume(j),e.exit(s),e.enter(c),y}function y(j){return f>999||j===null||j===91||j===93&&!h||j===94&&!f&&"_hiddenFootnoteSupport"in d.parser.constructs?i(j):j===93?(e.exit(c),e.enter(s),e.consume(j),e.exit(s),e.exit(r),a):Ze(j)?(e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(j))}function g(j){return j===null||j===91||j===93||Ze(j)||f++>999?(e.exit("chunkString"),y(j)):(e.consume(j),h||(h=!mt(j)),j===92?b:g)}function b(j){return j===91||j===92||j===93?(e.consume(j),f++,g):g(j)}}function jk(e,a,i,r,s,c){let d;return f;function f(b){return b===34||b===39||b===40?(e.enter(r),e.enter(s),e.consume(b),e.exit(s),d=b===40?41:b,h):i(b)}function h(b){return b===d?(e.enter(s),e.consume(b),e.exit(s),e.exit(r),a):(e.enter(c),p(b))}function p(b){return b===d?(e.exit(c),h(d)):b===null?i(b):Ze(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),wt(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(b))}function y(b){return b===d||b===null||Ze(b)?(e.exit("chunkString"),p(b)):(e.consume(b),b===92?g:y)}function g(b){return b===d||b===92?(e.consume(b),y):y(b)}}function Nc(e,a){let i;return r;function r(s){return Ze(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i=!0,r):mt(s)?wt(e,r,i?"linePrefix":"lineSuffix")(s):a(s)}}const H_={name:"definition",tokenize:U_},q_={partial:!0,tokenize:F_};function U_(e,a,i){const r=this;let s;return c;function c(j){return e.enter("definition"),d(j)}function d(j){return bk.call(r,e,f,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(j)}function f(j){return s=fi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),j===58?(e.enter("definitionMarker"),e.consume(j),e.exit("definitionMarker"),h):i(j)}function h(j){return Pt(j)?Nc(e,p)(j):p(j)}function p(j){return xk(e,y,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(j)}function y(j){return e.attempt(q_,g,g)(j)}function g(j){return mt(j)?wt(e,b,"whitespace")(j):b(j)}function b(j){return j===null||Ze(j)?(e.exit("definition"),r.parser.defined.push(s),a(j)):i(j)}}function F_(e,a,i){return r;function r(f){return Pt(f)?Nc(e,s)(f):i(f)}function s(f){return jk(e,c,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function c(f){return mt(f)?wt(e,d,"whitespace")(f):d(f)}function d(f){return f===null||Ze(f)?a(f):i(f)}}const V_={name:"hardBreakEscape",tokenize:$_};function $_(e,a,i){return r;function r(c){return e.enter("hardBreakEscape"),e.consume(c),s}function s(c){return Ze(c)?(e.exit("hardBreakEscape"),a(c)):i(c)}}const G_={name:"headingAtx",resolve:Y_,tokenize:K_};function Y_(e,a){let i=e.length-2,r=3,s,c;return e[r][1].type==="whitespace"&&(r+=2),i-2>r&&e[i][1].type==="whitespace"&&(i-=2),e[i][1].type==="atxHeadingSequence"&&(r===i-1||i-4>r&&e[i-2][1].type==="whitespace")&&(i-=r+1===i?2:4),i>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[i][1].end},c={type:"chunkText",start:e[r][1].start,end:e[i][1].end,contentType:"text"},Da(e,r,i-r+1,[["enter",s,a],["enter",c,a],["exit",c,a],["exit",s,a]])),e}function K_(e,a,i){let r=0;return s;function s(y){return e.enter("atxHeading"),c(y)}function c(y){return e.enter("atxHeadingSequence"),d(y)}function d(y){return y===35&&r++<6?(e.consume(y),d):y===null||Pt(y)?(e.exit("atxHeadingSequence"),f(y)):i(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),h(y)):y===null||Ze(y)?(e.exit("atxHeading"),a(y)):mt(y)?wt(e,f,"whitespace")(y):(e.enter("atxHeadingText"),p(y))}function h(y){return y===35?(e.consume(y),h):(e.exit("atxHeadingSequence"),f(y))}function p(y){return y===null||y===35||Pt(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),p)}}const X_=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Qx=["pre","script","style","textarea"],Q_={concrete:!0,name:"htmlFlow",resolveTo:W_,tokenize:eR},Z_={partial:!0,tokenize:nR},J_={partial:!0,tokenize:tR};function W_(e){let a=e.length;for(;a--&&!(e[a][0]==="enter"&&e[a][1].type==="htmlFlow"););return a>1&&e[a-2][1].type==="linePrefix"&&(e[a][1].start=e[a-2][1].start,e[a+1][1].start=e[a-2][1].start,e.splice(a-2,2)),e}function eR(e,a,i){const r=this;let s,c,d,f,h;return p;function p(D){return y(D)}function y(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),g}function g(D){return D===33?(e.consume(D),b):D===47?(e.consume(D),c=!0,S):D===63?(e.consume(D),s=3,r.interrupt?a:O):ea(D)?(e.consume(D),d=String.fromCharCode(D),N):i(D)}function b(D){return D===45?(e.consume(D),s=2,j):D===91?(e.consume(D),s=5,f=0,k):ea(D)?(e.consume(D),s=4,r.interrupt?a:O):i(D)}function j(D){return D===45?(e.consume(D),r.interrupt?a:O):i(D)}function k(D){const B="CDATA[";return D===B.charCodeAt(f++)?(e.consume(D),f===B.length?r.interrupt?a:q:k):i(D)}function S(D){return ea(D)?(e.consume(D),d=String.fromCharCode(D),N):i(D)}function N(D){if(D===null||D===47||D===62||Pt(D)){const B=D===47,W=d.toLowerCase();return!B&&!c&&Qx.includes(W)?(s=1,r.interrupt?a(D):q(D)):X_.includes(d.toLowerCase())?(s=6,B?(e.consume(D),E):r.interrupt?a(D):q(D)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?i(D):c?M(D):C(D))}return D===45||Fn(D)?(e.consume(D),d+=String.fromCharCode(D),N):i(D)}function E(D){return D===62?(e.consume(D),r.interrupt?a:q):i(D)}function M(D){return mt(D)?(e.consume(D),M):L(D)}function C(D){return D===47?(e.consume(D),L):D===58||D===95||ea(D)?(e.consume(D),A):mt(D)?(e.consume(D),C):L(D)}function A(D){return D===45||D===46||D===58||D===95||Fn(D)?(e.consume(D),A):_(D)}function _(D){return D===61?(e.consume(D),R):mt(D)?(e.consume(D),_):C(D)}function R(D){return D===null||D===60||D===61||D===62||D===96?i(D):D===34||D===39?(e.consume(D),h=D,I):mt(D)?(e.consume(D),R):G(D)}function I(D){return D===h?(e.consume(D),h=null,Y):D===null||Ze(D)?i(D):(e.consume(D),I)}function G(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||Pt(D)?_(D):(e.consume(D),G)}function Y(D){return D===47||D===62||mt(D)?C(D):i(D)}function L(D){return D===62?(e.consume(D),P):i(D)}function P(D){return D===null||Ze(D)?q(D):mt(D)?(e.consume(D),P):i(D)}function q(D){return D===45&&s===2?(e.consume(D),X):D===60&&s===1?(e.consume(D),$):D===62&&s===4?(e.consume(D),le):D===63&&s===3?(e.consume(D),O):D===93&&s===5?(e.consume(D),ie):Ze(D)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(Z_,ne,Z)(D)):D===null||Ze(D)?(e.exit("htmlFlowData"),Z(D)):(e.consume(D),q)}function Z(D){return e.check(J_,U,ne)(D)}function U(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),F}function F(D){return D===null||Ze(D)?Z(D):(e.enter("htmlFlowData"),q(D))}function X(D){return D===45?(e.consume(D),O):q(D)}function $(D){return D===47?(e.consume(D),d="",H):q(D)}function H(D){if(D===62){const B=d.toLowerCase();return Qx.includes(B)?(e.consume(D),le):q(D)}return ea(D)&&d.length<8?(e.consume(D),d+=String.fromCharCode(D),H):q(D)}function ie(D){return D===93?(e.consume(D),O):q(D)}function O(D){return D===62?(e.consume(D),le):D===45&&s===2?(e.consume(D),O):q(D)}function le(D){return D===null||Ze(D)?(e.exit("htmlFlowData"),ne(D)):(e.consume(D),le)}function ne(D){return e.exit("htmlFlow"),a(D)}}function tR(e,a,i){const r=this;return s;function s(d){return Ze(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):i(d)}function c(d){return r.parser.lazy[r.now().line]?i(d):a(d)}}function nR(e,a,i){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Gc,a,i)}}const aR={name:"htmlText",tokenize:iR};function iR(e,a,i){const r=this;let s,c,d;return f;function f(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),h}function h(O){return O===33?(e.consume(O),p):O===47?(e.consume(O),_):O===63?(e.consume(O),C):ea(O)?(e.consume(O),G):i(O)}function p(O){return O===45?(e.consume(O),y):O===91?(e.consume(O),c=0,k):ea(O)?(e.consume(O),M):i(O)}function y(O){return O===45?(e.consume(O),j):i(O)}function g(O){return O===null?i(O):O===45?(e.consume(O),b):Ze(O)?(d=g,$(O)):(e.consume(O),g)}function b(O){return O===45?(e.consume(O),j):g(O)}function j(O){return O===62?X(O):O===45?b(O):g(O)}function k(O){const le="CDATA[";return O===le.charCodeAt(c++)?(e.consume(O),c===le.length?S:k):i(O)}function S(O){return O===null?i(O):O===93?(e.consume(O),N):Ze(O)?(d=S,$(O)):(e.consume(O),S)}function N(O){return O===93?(e.consume(O),E):S(O)}function E(O){return O===62?X(O):O===93?(e.consume(O),E):S(O)}function M(O){return O===null||O===62?X(O):Ze(O)?(d=M,$(O)):(e.consume(O),M)}function C(O){return O===null?i(O):O===63?(e.consume(O),A):Ze(O)?(d=C,$(O)):(e.consume(O),C)}function A(O){return O===62?X(O):C(O)}function _(O){return ea(O)?(e.consume(O),R):i(O)}function R(O){return O===45||Fn(O)?(e.consume(O),R):I(O)}function I(O){return Ze(O)?(d=I,$(O)):mt(O)?(e.consume(O),I):X(O)}function G(O){return O===45||Fn(O)?(e.consume(O),G):O===47||O===62||Pt(O)?Y(O):i(O)}function Y(O){return O===47?(e.consume(O),X):O===58||O===95||ea(O)?(e.consume(O),L):Ze(O)?(d=Y,$(O)):mt(O)?(e.consume(O),Y):X(O)}function L(O){return O===45||O===46||O===58||O===95||Fn(O)?(e.consume(O),L):P(O)}function P(O){return O===61?(e.consume(O),q):Ze(O)?(d=P,$(O)):mt(O)?(e.consume(O),P):Y(O)}function q(O){return O===null||O===60||O===61||O===62||O===96?i(O):O===34||O===39?(e.consume(O),s=O,Z):Ze(O)?(d=q,$(O)):mt(O)?(e.consume(O),q):(e.consume(O),U)}function Z(O){return O===s?(e.consume(O),s=void 0,F):O===null?i(O):Ze(O)?(d=Z,$(O)):(e.consume(O),Z)}function U(O){return O===null||O===34||O===39||O===60||O===61||O===96?i(O):O===47||O===62||Pt(O)?Y(O):(e.consume(O),U)}function F(O){return O===47||O===62||Pt(O)?Y(O):i(O)}function X(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),a):i(O)}function $(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),H}function H(O){return mt(O)?wt(e,ie,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):ie(O)}function ie(O){return e.enter("htmlTextData"),d(O)}}const Ag={name:"labelEnd",resolveAll:sR,resolveTo:cR,tokenize:uR},rR={tokenize:dR},lR={tokenize:fR},oR={tokenize:hR};function sR(e){let a=-1;const i=[];for(;++a<e.length;){const r=e[a][1];if(i.push(e[a]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",a+=s}}return e.length!==i.length&&Da(e,0,e.length,i),e}function cR(e,a){let i=e.length,r=0,s,c,d,f;for(;i--;)if(s=e[i][1],c){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[i][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(d){if(e[i][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(c=i,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(d=i);const h={type:e[c][1].type==="labelLink"?"link":"image",start:{...e[c][1].start},end:{...e[e.length-1][1].end}},p={type:"label",start:{...e[c][1].start},end:{...e[d][1].end}},y={type:"labelText",start:{...e[c+r+2][1].end},end:{...e[d-2][1].start}};return f=[["enter",h,a],["enter",p,a]],f=Xa(f,e.slice(c+1,c+r+3)),f=Xa(f,[["enter",y,a]]),f=Xa(f,bf(a.parser.constructs.insideSpan.null,e.slice(c+r+4,d-3),a)),f=Xa(f,[["exit",y,a],e[d-2],e[d-1],["exit",p,a]]),f=Xa(f,e.slice(d+1)),f=Xa(f,[["exit",h,a]]),Da(e,c,e.length,f),e}function uR(e,a,i){const r=this;let s=r.events.length,c,d;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){c=r.events[s][1];break}return f;function f(b){return c?c._inactive?g(b):(d=r.parser.defined.includes(fi(r.sliceSerialize({start:c.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),h):i(b)}function h(b){return b===40?e.attempt(rR,y,d?y:g)(b):b===91?e.attempt(lR,y,d?p:g)(b):d?y(b):g(b)}function p(b){return e.attempt(oR,y,g)(b)}function y(b){return a(b)}function g(b){return c._balanced=!0,i(b)}}function dR(e,a,i){return r;function r(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),s}function s(g){return Pt(g)?Nc(e,c)(g):c(g)}function c(g){return g===41?y(g):xk(e,d,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function d(g){return Pt(g)?Nc(e,h)(g):y(g)}function f(g){return i(g)}function h(g){return g===34||g===39||g===40?jk(e,p,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function p(g){return Pt(g)?Nc(e,y)(g):y(g)}function y(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),a):i(g)}}function fR(e,a,i){const r=this;return s;function s(f){return bk.call(r,e,c,d,"reference","referenceMarker","referenceString")(f)}function c(f){return r.parser.defined.includes(fi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?a(f):i(f)}function d(f){return i(f)}}function hR(e,a,i){return r;function r(c){return e.enter("reference"),e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),s}function s(c){return c===93?(e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),e.exit("reference"),a):i(c)}}const mR={name:"labelStartImage",resolveAll:Ag.resolveAll,tokenize:pR};function pR(e,a,i){const r=this;return s;function s(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),c}function c(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),d):i(f)}function d(f){return f===94&&"_hiddenFootnoteSupport"in r.parser.constructs?i(f):a(f)}}const gR={name:"labelStartLink",resolveAll:Ag.resolveAll,tokenize:vR};function vR(e,a,i){const r=this;return s;function s(d){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelLink"),c}function c(d){return d===94&&"_hiddenFootnoteSupport"in r.parser.constructs?i(d):a(d)}}const fp={name:"lineEnding",tokenize:yR};function yR(e,a){return i;function i(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),wt(e,a,"linePrefix")}}const Hd={name:"thematicBreak",tokenize:xR};function xR(e,a,i){let r=0,s;return c;function c(p){return e.enter("thematicBreak"),d(p)}function d(p){return s=p,f(p)}function f(p){return p===s?(e.enter("thematicBreakSequence"),h(p)):r>=3&&(p===null||Ze(p))?(e.exit("thematicBreak"),a(p)):i(p)}function h(p){return p===s?(e.consume(p),r++,h):(e.exit("thematicBreakSequence"),mt(p)?wt(e,f,"whitespace")(p):f(p))}}const da={continuation:{tokenize:kR},exit:CR,name:"list",tokenize:wR},bR={partial:!0,tokenize:NR},jR={partial:!0,tokenize:SR};function wR(e,a,i){const r=this,s=r.events[r.events.length-1];let c=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,d=0;return f;function f(j){const k=r.containerState.type||(j===42||j===43||j===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!r.containerState.marker||j===r.containerState.marker:h0(j)){if(r.containerState.type||(r.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),j===42||j===45?e.check(Hd,i,p)(j):p(j);if(!r.interrupt||j===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(j)}return i(j)}function h(j){return h0(j)&&++d<10?(e.consume(j),h):(!r.interrupt||d<2)&&(r.containerState.marker?j===r.containerState.marker:j===41||j===46)?(e.exit("listItemValue"),p(j)):i(j)}function p(j){return e.enter("listItemMarker"),e.consume(j),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||j,e.check(Gc,r.interrupt?i:y,e.attempt(bR,b,g))}function y(j){return r.containerState.initialBlankLine=!0,c++,b(j)}function g(j){return mt(j)?(e.enter("listItemPrefixWhitespace"),e.consume(j),e.exit("listItemPrefixWhitespace"),b):i(j)}function b(j){return r.containerState.size=c+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,a(j)}}function kR(e,a,i){const r=this;return r.containerState._closeFlow=void 0,e.check(Gc,s,c);function s(f){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,wt(e,a,"listItemIndent",r.containerState.size+1)(f)}function c(f){return r.containerState.furtherBlankLines||!mt(f)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,d(f)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(jR,a,d)(f))}function d(f){return r.containerState._closeFlow=!0,r.interrupt=void 0,wt(e,e.attempt(da,a,i),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function SR(e,a,i){const r=this;return wt(e,s,"listItemIndent",r.containerState.size+1);function s(c){const d=r.events[r.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===r.containerState.size?a(c):i(c)}}function CR(e){e.exit(this.containerState.type)}function NR(e,a,i){const r=this;return wt(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(c){const d=r.events[r.events.length-1];return!mt(c)&&d&&d[1].type==="listItemPrefixWhitespace"?a(c):i(c)}}const Zx={name:"setextUnderline",resolveTo:ER,tokenize:TR};function ER(e,a){let i=e.length,r,s,c;for(;i--;)if(e[i][0]==="enter"){if(e[i][1].type==="content"){r=i;break}e[i][1].type==="paragraph"&&(s=i)}else e[i][1].type==="content"&&e.splice(i,1),!c&&e[i][1].type==="definition"&&(c=i);const d={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",c?(e.splice(s,0,["enter",d,a]),e.splice(c+1,0,["exit",e[r][1],a]),e[r][1].end={...e[c][1].end}):e[r][1]=d,e.push(["exit",d,a]),e}function TR(e,a,i){const r=this;let s;return c;function c(p){let y=r.events.length,g;for(;y--;)if(r.events[y][1].type!=="lineEnding"&&r.events[y][1].type!=="linePrefix"&&r.events[y][1].type!=="content"){g=r.events[y][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||g)?(e.enter("setextHeadingLine"),s=p,d(p)):i(p)}function d(p){return e.enter("setextHeadingLineSequence"),f(p)}function f(p){return p===s?(e.consume(p),f):(e.exit("setextHeadingLineSequence"),mt(p)?wt(e,h,"lineSuffix")(p):h(p))}function h(p){return p===null||Ze(p)?(e.exit("setextHeadingLine"),a(p)):i(p)}}const AR={tokenize:MR};function MR(e){const a=this,i=e.attempt(Gc,r,e.attempt(this.parser.constructs.flowInitial,s,wt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(z_,s)),"linePrefix")));return i;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),a.currentConstruct=void 0,i}function s(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),a.currentConstruct=void 0,i}}const _R={resolveAll:kk()},RR=wk("string"),OR=wk("text");function wk(e){return{resolveAll:kk(e==="text"?DR:void 0),tokenize:a};function a(i){const r=this,s=this.parser.constructs[e],c=i.attempt(s,d,f);return d;function d(y){return p(y)?c(y):f(y)}function f(y){if(y===null){i.consume(y);return}return i.enter("data"),i.consume(y),h}function h(y){return p(y)?(i.exit("data"),c(y)):(i.consume(y),h)}function p(y){if(y===null)return!0;const g=s[y];let b=-1;if(g)for(;++b<g.length;){const j=g[b];if(!j.previous||j.previous.call(r,r.previous))return!0}return!1}}}function kk(e){return a;function a(i,r){let s=-1,c;for(;++s<=i.length;)c===void 0?i[s]&&i[s][1].type==="data"&&(c=s,s++):(!i[s]||i[s][1].type!=="data")&&(s!==c+2&&(i[c][1].end=i[s-1][1].end,i.splice(c+2,s-c-2),s=c+2),c=void 0);return e?e(i,r):i}}function DR(e,a){let i=0;for(;++i<=e.length;)if((i===e.length||e[i][1].type==="lineEnding")&&e[i-1][1].type==="data"){const r=e[i-1][1],s=a.sliceStream(r);let c=s.length,d=-1,f=0,h;for(;c--;){const p=s[c];if(typeof p=="string"){for(d=p.length;p.charCodeAt(d-1)===32;)f++,d--;if(d)break;d=-1}else if(p===-2)h=!0,f++;else if(p!==-1){c++;break}}if(a._contentTypeTextTrailing&&i===e.length&&(f=0),f){const p={type:i===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?d:r.start._bufferIndex+d,_index:r.start._index+c,line:r.end.line,column:r.end.column-f,offset:r.end.offset-f},end:{...r.end}};r.end={...p.start},r.start.offset===r.end.offset?Object.assign(r,p):(e.splice(i,0,["enter",p,a],["exit",p,a]),i+=2)}i++}return e}const zR={42:da,43:da,45:da,48:da,49:da,50:da,51:da,52:da,53:da,54:da,55:da,56:da,57:da,62:pk},LR={91:H_},BR={[-2]:dp,[-1]:dp,32:dp},IR={35:G_,42:Hd,45:[Zx,Hd],60:Q_,61:Zx,95:Hd,96:Xx,126:Xx},PR={38:vk,92:gk},HR={[-5]:fp,[-4]:fp,[-3]:fp,33:mR,38:vk,42:m0,60:[g_,aR],91:gR,92:[V_,gk],93:Ag,95:m0,96:A_},qR={null:[m0,_R]},UR={null:[42,95]},FR={null:[]},VR=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:UR,contentInitial:LR,disable:FR,document:zR,flow:IR,flowInitial:BR,insideSpan:qR,string:PR,text:HR},Symbol.toStringTag,{value:"Module"}));function $R(e,a,i){let r={_bufferIndex:-1,_index:0,line:i&&i.line||1,column:i&&i.column||1,offset:i&&i.offset||0};const s={},c=[];let d=[],f=[];const h={attempt:I(_),check:I(R),consume:M,enter:C,exit:A,interrupt:I(R,{interrupt:!0})},p={code:null,containerState:{},defineSkip:S,events:[],now:k,parser:e,previous:null,sliceSerialize:b,sliceStream:j,write:g};let y=a.tokenize.call(p,h);return a.resolveAll&&c.push(a),p;function g(P){return d=Xa(d,P),N(),d[d.length-1]!==null?[]:(G(a,0),p.events=bf(c,p.events,p),p.events)}function b(P,q){return YR(j(P),q)}function j(P){return GR(d,P)}function k(){const{_bufferIndex:P,_index:q,line:Z,column:U,offset:F}=r;return{_bufferIndex:P,_index:q,line:Z,column:U,offset:F}}function S(P){s[P.line]=P.column,L()}function N(){let P;for(;r._index<d.length;){const q=d[r._index];if(typeof q=="string")for(P=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===P&&r._bufferIndex<q.length;)E(q.charCodeAt(r._bufferIndex));else E(q)}}function E(P){y=y(P)}function M(P){Ze(P)?(r.line++,r.column=1,r.offset+=P===-3?2:1,L()):P!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===d[r._index].length&&(r._bufferIndex=-1,r._index++)),p.previous=P}function C(P,q){const Z=q||{};return Z.type=P,Z.start=k(),p.events.push(["enter",Z,p]),f.push(Z),Z}function A(P){const q=f.pop();return q.end=k(),p.events.push(["exit",q,p]),q}function _(P,q){G(P,q.from)}function R(P,q){q.restore()}function I(P,q){return Z;function Z(U,F,X){let $,H,ie,O;return Array.isArray(U)?ne(U):"tokenize"in U?ne([U]):le(U);function le(ue){return me;function me(ge){const Se=ge!==null&&ue[ge],Me=ge!==null&&ue.null,xe=[...Array.isArray(Se)?Se:Se?[Se]:[],...Array.isArray(Me)?Me:Me?[Me]:[]];return ne(xe)(ge)}}function ne(ue){return $=ue,H=0,ue.length===0?X:D(ue[H])}function D(ue){return me;function me(ge){return O=Y(),ie=ue,ue.partial||(p.currentConstruct=ue),ue.name&&p.parser.constructs.disable.null.includes(ue.name)?W():ue.tokenize.call(q?Object.assign(Object.create(p),q):p,h,B,W)(ge)}}function B(ue){return P(ie,O),F}function W(ue){return O.restore(),++H<$.length?D($[H]):X}}}function G(P,q){P.resolveAll&&!c.includes(P)&&c.push(P),P.resolve&&Da(p.events,q,p.events.length-q,P.resolve(p.events.slice(q),p)),P.resolveTo&&(p.events=P.resolveTo(p.events,p))}function Y(){const P=k(),q=p.previous,Z=p.currentConstruct,U=p.events.length,F=Array.from(f);return{from:U,restore:X};function X(){r=P,p.previous=q,p.currentConstruct=Z,p.events.length=U,f=F,L()}}function L(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function GR(e,a){const i=a.start._index,r=a.start._bufferIndex,s=a.end._index,c=a.end._bufferIndex;let d;if(i===s)d=[e[i].slice(r,c)];else{if(d=e.slice(i,s),r>-1){const f=d[0];typeof f=="string"?d[0]=f.slice(r):d.shift()}c>0&&d.push(e[s].slice(0,c))}return d}function YR(e,a){let i=-1;const r=[];let s;for(;++i<e.length;){const c=e[i];let d;if(typeof c=="string")d=c;else switch(c){case-5:{d="\r";break}case-4:{d=`
566
+ `;break}case-3:{d=`\r
567
+ `;break}case-2:{d=a?" ":" ";break}case-1:{if(!a&&s)continue;d=" ";break}default:d=String.fromCharCode(c)}s=c===-2,r.push(d)}return r.join("")}function KR(e){const r={constructs:hk([VR,...(e||{}).extensions||[]]),content:s(c_),defined:[],document:s(d_),flow:s(AR),lazy:{},string:s(RR),text:s(OR)};return r;function s(c){return d;function d(f){return $R(r,c,f)}}}function XR(e){for(;!yk(e););return e}const Jx=/[\0\t\n\r]/g;function QR(){let e=1,a="",i=!0,r;return s;function s(c,d,f){const h=[];let p,y,g,b,j;for(c=a+(typeof c=="string"?c.toString():new TextDecoder(d||void 0).decode(c)),g=0,a="",i&&(c.charCodeAt(0)===65279&&g++,i=void 0);g<c.length;){if(Jx.lastIndex=g,p=Jx.exec(c),b=p&&p.index!==void 0?p.index:c.length,j=c.charCodeAt(b),!p){a=c.slice(g);break}if(j===10&&g===b&&r)h.push(-3),r=void 0;else switch(r&&(h.push(-5),r=void 0),g<b&&(h.push(c.slice(g,b)),e+=b-g),j){case 0:{h.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,h.push(-2);e++<y;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:r=!0,e=1}g=b+1}return f&&(r&&h.push(-5),a&&h.push(a),h.push(null)),h}}const ZR=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function JR(e){return e.replace(ZR,WR)}function WR(e,a,i){if(a)return a;if(i.charCodeAt(0)===35){const s=i.charCodeAt(1),c=s===120||s===88;return mk(i.slice(c?2:1),c?16:10)}return Tg(i)||e}const Sk={}.hasOwnProperty;function eO(e,a,i){return a&&typeof a=="object"&&(i=a,a=void 0),tO(i)(XR(KR(i).document().write(QR()(e,a,!0))))}function tO(e){const a={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(Lt),autolinkProtocol:Y,autolinkEmail:Y,atxHeading:c(Be),blockQuote:c(Me),characterEscape:Y,characterReference:Y,codeFenced:c(xe),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:c(xe,d),codeText:c(oe,d),codeTextData:Y,data:Y,codeFlowValue:Y,definition:c(Ee),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:c(Xe),hardBreakEscape:c(Je),hardBreakTrailing:c(Je),htmlFlow:c(Qe,d),htmlFlowData:Y,htmlText:c(Qe,d),htmlTextData:Y,image:c(et),label:d,link:c(Lt),listItem:c(jn),listItemValue:b,listOrdered:c(cn,g),listUnordered:c(cn),paragraph:c(Xt),reference:D,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:c(Be),strong:c($n),thematicBreak:c(ga)},exit:{atxHeading:h(),atxHeadingSequence:_,autolink:h(),autolinkEmail:Se,autolinkProtocol:ge,blockQuote:h(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:W,characterReferenceMarkerNumeric:W,characterReferenceValue:ue,characterReference:me,codeFenced:h(N),codeFencedFence:S,codeFencedFenceInfo:j,codeFencedFenceMeta:k,codeFlowValue:L,codeIndented:h(E),codeText:h(F),codeTextData:L,data:L,definition:h(),definitionDestinationString:A,definitionLabelString:M,definitionTitleString:C,emphasis:h(),hardBreakEscape:h(q),hardBreakTrailing:h(q),htmlFlow:h(Z),htmlFlowData:L,htmlText:h(U),htmlTextData:L,image:h($),label:ie,labelText:H,lineEnding:P,link:h(X),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:B,resourceDestinationString:O,resourceTitleString:le,resource:ne,setextHeading:h(G),setextHeadingLineSequence:I,setextHeadingText:R,strong:h(),thematicBreak:h()}};Ck(a,(e||{}).mdastExtensions||[]);const i={};return r;function r(pe){let Ce={type:"root",children:[]};const Ge={stack:[Ce],tokenStack:[],config:a,enter:f,exit:p,buffer:d,resume:y,data:i},Ke=[];let ot=-1;for(;++ot<pe.length;)if(pe[ot][1].type==="listOrdered"||pe[ot][1].type==="listUnordered")if(pe[ot][0]==="enter")Ke.push(ot);else{const At=Ke.pop();ot=s(pe,At,ot)}for(ot=-1;++ot<pe.length;){const At=a[pe[ot][0]];Sk.call(At,pe[ot][1].type)&&At[pe[ot][1].type].call(Object.assign({sliceSerialize:pe[ot][2].sliceSerialize},Ge),pe[ot][1])}if(Ge.tokenStack.length>0){const At=Ge.tokenStack[Ge.tokenStack.length-1];(At[1]||Wx).call(Ge,void 0,At[0])}for(Ce.position={start:rl(pe.length>0?pe[0][1].start:{line:1,column:1,offset:0}),end:rl(pe.length>0?pe[pe.length-2][1].end:{line:1,column:1,offset:0})},ot=-1;++ot<a.transforms.length;)Ce=a.transforms[ot](Ce)||Ce;return Ce}function s(pe,Ce,Ge){let Ke=Ce-1,ot=-1,At=!1,Qt,de,Te,Re;for(;++Ke<=Ge;){const Ie=pe[Ke];switch(Ie[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ie[0]==="enter"?ot++:ot--,Re=void 0;break}case"lineEndingBlank":{Ie[0]==="enter"&&(Qt&&!Re&&!ot&&!Te&&(Te=Ke),Re=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Re=void 0}if(!ot&&Ie[0]==="enter"&&Ie[1].type==="listItemPrefix"||ot===-1&&Ie[0]==="exit"&&(Ie[1].type==="listUnordered"||Ie[1].type==="listOrdered")){if(Qt){let He=Ke;for(de=void 0;He--;){const at=pe[He];if(at[1].type==="lineEnding"||at[1].type==="lineEndingBlank"){if(at[0]==="exit")continue;de&&(pe[de][1].type="lineEndingBlank",At=!0),at[1].type="lineEnding",de=He}else if(!(at[1].type==="linePrefix"||at[1].type==="blockQuotePrefix"||at[1].type==="blockQuotePrefixWhitespace"||at[1].type==="blockQuoteMarker"||at[1].type==="listItemIndent"))break}Te&&(!de||Te<de)&&(Qt._spread=!0),Qt.end=Object.assign({},de?pe[de][1].start:Ie[1].end),pe.splice(de||Ke,0,["exit",Qt,Ie[2]]),Ke++,Ge++}if(Ie[1].type==="listItemPrefix"){const He={type:"listItem",_spread:!1,start:Object.assign({},Ie[1].start),end:void 0};Qt=He,pe.splice(Ke,0,["enter",He,Ie[2]]),Ke++,Ge++,Te=void 0,Re=!0}}}return pe[Ce][1]._spread=At,Ge}function c(pe,Ce){return Ge;function Ge(Ke){f.call(this,pe(Ke),Ke),Ce&&Ce.call(this,Ke)}}function d(){this.stack.push({type:"fragment",children:[]})}function f(pe,Ce,Ge){this.stack[this.stack.length-1].children.push(pe),this.stack.push(pe),this.tokenStack.push([Ce,Ge||void 0]),pe.position={start:rl(Ce.start),end:void 0}}function h(pe){return Ce;function Ce(Ge){pe&&pe.call(this,Ge),p.call(this,Ge)}}function p(pe,Ce){const Ge=this.stack.pop(),Ke=this.tokenStack.pop();if(Ke)Ke[0].type!==pe.type&&(Ce?Ce.call(this,pe,Ke[0]):(Ke[1]||Wx).call(this,pe,Ke[0]));else throw new Error("Cannot close `"+pe.type+"` ("+Cc({start:pe.start,end:pe.end})+"): it’s not open");Ge.position.end=rl(pe.end)}function y(){return Eg(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function b(pe){if(this.data.expectingFirstListItemValue){const Ce=this.stack[this.stack.length-2];Ce.start=Number.parseInt(this.sliceSerialize(pe),10),this.data.expectingFirstListItemValue=void 0}}function j(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.lang=pe}function k(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.meta=pe}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=pe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=pe.replace(/(\r?\n|\r)$/g,"")}function M(pe){const Ce=this.resume(),Ge=this.stack[this.stack.length-1];Ge.label=Ce,Ge.identifier=fi(this.sliceSerialize(pe)).toLowerCase()}function C(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=pe}function A(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=pe}function _(pe){const Ce=this.stack[this.stack.length-1];if(!Ce.depth){const Ge=this.sliceSerialize(pe).length;Ce.depth=Ge}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function I(pe){const Ce=this.stack[this.stack.length-1];Ce.depth=this.sliceSerialize(pe).codePointAt(0)===61?1:2}function G(){this.data.setextHeadingSlurpLineEnding=void 0}function Y(pe){const Ge=this.stack[this.stack.length-1].children;let Ke=Ge[Ge.length-1];(!Ke||Ke.type!=="text")&&(Ke=Pn(),Ke.position={start:rl(pe.start),end:void 0},Ge.push(Ke)),this.stack.push(Ke)}function L(pe){const Ce=this.stack.pop();Ce.value+=this.sliceSerialize(pe),Ce.position.end=rl(pe.end)}function P(pe){const Ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ge=Ce.children[Ce.children.length-1];Ge.position.end=rl(pe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&a.canContainEols.includes(Ce.type)&&(Y.call(this,pe),L.call(this,pe))}function q(){this.data.atHardBreak=!0}function Z(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=pe}function U(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=pe}function F(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=pe}function X(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Ce,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function $(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Ce,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function H(pe){const Ce=this.sliceSerialize(pe),Ge=this.stack[this.stack.length-2];Ge.label=JR(Ce),Ge.identifier=fi(Ce).toLowerCase()}function ie(){const pe=this.stack[this.stack.length-1],Ce=this.resume(),Ge=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ge.type==="link"){const Ke=pe.children;Ge.children=Ke}else Ge.alt=Ce}function O(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=pe}function le(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=pe}function ne(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function B(pe){const Ce=this.resume(),Ge=this.stack[this.stack.length-1];Ge.label=Ce,Ge.identifier=fi(this.sliceSerialize(pe)).toLowerCase(),this.data.referenceType="full"}function W(pe){this.data.characterReferenceType=pe.type}function ue(pe){const Ce=this.sliceSerialize(pe),Ge=this.data.characterReferenceType;let Ke;Ge?(Ke=mk(Ce,Ge==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ke=Tg(Ce);const ot=this.stack[this.stack.length-1];ot.value+=Ke}function me(pe){const Ce=this.stack.pop();Ce.position.end=rl(pe.end)}function ge(pe){L.call(this,pe);const Ce=this.stack[this.stack.length-1];Ce.url=this.sliceSerialize(pe)}function Se(pe){L.call(this,pe);const Ce=this.stack[this.stack.length-1];Ce.url="mailto:"+this.sliceSerialize(pe)}function Me(){return{type:"blockquote",children:[]}}function xe(){return{type:"code",lang:null,meta:null,value:""}}function oe(){return{type:"inlineCode",value:""}}function Ee(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Xe(){return{type:"emphasis",children:[]}}function Be(){return{type:"heading",depth:0,children:[]}}function Je(){return{type:"break"}}function Qe(){return{type:"html",value:""}}function et(){return{type:"image",title:null,url:"",alt:null}}function Lt(){return{type:"link",title:null,url:"",children:[]}}function cn(pe){return{type:"list",ordered:pe.type==="listOrdered",start:null,spread:pe._spread,children:[]}}function jn(pe){return{type:"listItem",spread:pe._spread,checked:null,children:[]}}function Xt(){return{type:"paragraph",children:[]}}function $n(){return{type:"strong",children:[]}}function Pn(){return{type:"text",value:""}}function ga(){return{type:"thematicBreak"}}}function rl(e){return{line:e.line,column:e.column,offset:e.offset}}function Ck(e,a){let i=-1;for(;++i<a.length;){const r=a[i];Array.isArray(r)?Ck(e,r):nO(e,r)}}function nO(e,a){let i;for(i in a)if(Sk.call(a,i))switch(i){case"canContainEols":{const r=a[i];r&&e[i].push(...r);break}case"transforms":{const r=a[i];r&&e[i].push(...r);break}case"enter":case"exit":{const r=a[i];r&&Object.assign(e[i],r);break}}}function Wx(e,a){throw e?new Error("Cannot close `"+e.type+"` ("+Cc({start:e.start,end:e.end})+"): a different token (`"+a.type+"`, "+Cc({start:a.start,end:a.end})+") is open"):new Error("Cannot close document, a token (`"+a.type+"`, "+Cc({start:a.start,end:a.end})+") is still open")}function aO(e){const a=this;a.parser=i;function i(r){return eO(r,{...a.data("settings"),...e,extensions:a.data("micromarkExtensions")||[],mdastExtensions:a.data("fromMarkdownExtensions")||[]})}}function iO(e,a){const i={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(a),!0)};return e.patch(a,i),e.applyData(a,i)}function rO(e,a){const i={type:"element",tagName:"br",properties:{},children:[]};return e.patch(a,i),[e.applyData(a,i),{type:"text",value:`
568
+ `}]}function lO(e,a){const i=a.value?a.value+`
569
+ `:"",r={},s=a.lang?a.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let c={type:"element",tagName:"code",properties:r,children:[{type:"text",value:i}]};return a.meta&&(c.data={meta:a.meta}),e.patch(a,c),c=e.applyData(a,c),c={type:"element",tagName:"pre",properties:{},children:[c]},e.patch(a,c),c}function oO(e,a){const i={type:"element",tagName:"del",properties:{},children:e.all(a)};return e.patch(a,i),e.applyData(a,i)}function sO(e,a){const i={type:"element",tagName:"em",properties:{},children:e.all(a)};return e.patch(a,i),e.applyData(a,i)}function cO(e,a){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(a.identifier).toUpperCase(),s=Cs(r.toLowerCase()),c=e.footnoteOrder.indexOf(r);let d,f=e.footnoteCounts.get(r);f===void 0?(f=0,e.footnoteOrder.push(r),d=e.footnoteOrder.length):d=c+1,f+=1,e.footnoteCounts.set(r,f);const h={type:"element",tagName:"a",properties:{href:"#"+i+"fn-"+s,id:i+"fnref-"+s+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(a,h);const p={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(a,p),e.applyData(a,p)}function uO(e,a){const i={type:"element",tagName:"h"+a.depth,properties:{},children:e.all(a)};return e.patch(a,i),e.applyData(a,i)}function dO(e,a){if(e.options.allowDangerousHtml){const i={type:"raw",value:a.value};return e.patch(a,i),e.applyData(a,i)}}function Nk(e,a){const i=a.referenceType;let r="]";if(i==="collapsed"?r+="[]":i==="full"&&(r+="["+(a.label||a.identifier)+"]"),a.type==="imageReference")return[{type:"text",value:"!["+a.alt+r}];const s=e.all(a),c=s[0];c&&c.type==="text"?c.value="["+c.value:s.unshift({type:"text",value:"["});const d=s[s.length-1];return d&&d.type==="text"?d.value+=r:s.push({type:"text",value:r}),s}function fO(e,a){const i=String(a.identifier).toUpperCase(),r=e.definitionById.get(i);if(!r)return Nk(e,a);const s={src:Cs(r.url||""),alt:a.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const c={type:"element",tagName:"img",properties:s,children:[]};return e.patch(a,c),e.applyData(a,c)}function hO(e,a){const i={src:Cs(a.url)};a.alt!==null&&a.alt!==void 0&&(i.alt=a.alt),a.title!==null&&a.title!==void 0&&(i.title=a.title);const r={type:"element",tagName:"img",properties:i,children:[]};return e.patch(a,r),e.applyData(a,r)}function mO(e,a){const i={type:"text",value:a.value.replace(/\r?\n|\r/g," ")};e.patch(a,i);const r={type:"element",tagName:"code",properties:{},children:[i]};return e.patch(a,r),e.applyData(a,r)}function pO(e,a){const i=String(a.identifier).toUpperCase(),r=e.definitionById.get(i);if(!r)return Nk(e,a);const s={href:Cs(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const c={type:"element",tagName:"a",properties:s,children:e.all(a)};return e.patch(a,c),e.applyData(a,c)}function gO(e,a){const i={href:Cs(a.url)};a.title!==null&&a.title!==void 0&&(i.title=a.title);const r={type:"element",tagName:"a",properties:i,children:e.all(a)};return e.patch(a,r),e.applyData(a,r)}function vO(e,a,i){const r=e.all(a),s=i?yO(i):Ek(a),c={},d=[];if(typeof a.checked=="boolean"){const y=r[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},r.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:a.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let f=-1;for(;++f<r.length;){const y=r[f];(s||f!==0||y.type!=="element"||y.tagName!=="p")&&d.push({type:"text",value:`
570
+ `}),y.type==="element"&&y.tagName==="p"&&!s?d.push(...y.children):d.push(y)}const h=r[r.length-1];h&&(s||h.type!=="element"||h.tagName!=="p")&&d.push({type:"text",value:`
571
+ `});const p={type:"element",tagName:"li",properties:c,children:d};return e.patch(a,p),e.applyData(a,p)}function yO(e){let a=!1;if(e.type==="list"){a=e.spread||!1;const i=e.children;let r=-1;for(;!a&&++r<i.length;)a=Ek(i[r])}return a}function Ek(e){const a=e.spread;return a??e.children.length>1}function xO(e,a){const i={},r=e.all(a);let s=-1;for(typeof a.start=="number"&&a.start!==1&&(i.start=a.start);++s<r.length;){const d=r[s];if(d.type==="element"&&d.tagName==="li"&&d.properties&&Array.isArray(d.properties.className)&&d.properties.className.includes("task-list-item")){i.className=["contains-task-list"];break}}const c={type:"element",tagName:a.ordered?"ol":"ul",properties:i,children:e.wrap(r,!0)};return e.patch(a,c),e.applyData(a,c)}function bO(e,a){const i={type:"element",tagName:"p",properties:{},children:e.all(a)};return e.patch(a,i),e.applyData(a,i)}function jO(e,a){const i={type:"root",children:e.wrap(e.all(a))};return e.patch(a,i),e.applyData(a,i)}function wO(e,a){const i={type:"element",tagName:"strong",properties:{},children:e.all(a)};return e.patch(a,i),e.applyData(a,i)}function kO(e,a){const i=e.all(a),r=i.shift(),s=[];if(r){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(a.children[0],d),s.push(d)}if(i.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(i,!0)},f=kg(a.children[1]),h=lk(a.children[a.children.length-1]);f&&h&&(d.position={start:f,end:h}),s.push(d)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(a,c),e.applyData(a,c)}function SO(e,a,i){const r=i?i.children:void 0,c=(r?r.indexOf(a):1)===0?"th":"td",d=i&&i.type==="table"?i.align:void 0,f=d?d.length:a.children.length;let h=-1;const p=[];for(;++h<f;){const g=a.children[h],b={},j=d?d[h]:void 0;j&&(b.align=j);let k={type:"element",tagName:c,properties:b,children:[]};g&&(k.children=e.all(g),e.patch(g,k),k=e.applyData(g,k)),p.push(k)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(p,!0)};return e.patch(a,y),e.applyData(a,y)}function CO(e,a){const i={type:"element",tagName:"td",properties:{},children:e.all(a)};return e.patch(a,i),e.applyData(a,i)}const eb=9,tb=32;function NO(e){const a=String(e),i=/\r?\n|\r/g;let r=i.exec(a),s=0;const c=[];for(;r;)c.push(nb(a.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=i.exec(a);return c.push(nb(a.slice(s),s>0,!1)),c.join("")}function nb(e,a,i){let r=0,s=e.length;if(a){let c=e.codePointAt(r);for(;c===eb||c===tb;)r++,c=e.codePointAt(r)}if(i){let c=e.codePointAt(s-1);for(;c===eb||c===tb;)s--,c=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function EO(e,a){const i={type:"text",value:NO(String(a.value))};return e.patch(a,i),e.applyData(a,i)}function TO(e,a){const i={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(a,i),e.applyData(a,i)}const AO={blockquote:iO,break:rO,code:lO,delete:oO,emphasis:sO,footnoteReference:cO,heading:uO,html:dO,imageReference:fO,image:hO,inlineCode:mO,linkReference:pO,link:gO,listItem:vO,list:xO,paragraph:bO,root:jO,strong:wO,table:kO,tableCell:CO,tableRow:SO,text:EO,thematicBreak:TO,toml:kd,yaml:kd,definition:kd,footnoteDefinition:kd};function kd(){}const Tk=-1,jf=0,Ec=1,Zd=2,Mg=3,_g=4,Rg=5,Og=6,Ak=7,Mk=8,{defineProperty:MO}=Object,_k=typeof self=="object"?self:globalThis,ab=(e,a)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new _k[e](a)},_O=(e,a)=>{const i=(s,c)=>(e.set(c,s),s),r=s=>{if(e.has(s))return e.get(s);const[c,d]=a[s];switch(c){case jf:case Tk:return i(d,s);case Ec:{const f=i([],s);for(const h of d)f.push(r(h));return f}case Zd:{const f=i({},s);for(const[h,p]of d){const y=r(h),g=r(p);y==="__proto__"?MO(f,y,{value:g,configurable:!0,enumerable:!0,writable:!0}):f[y]=g}return f}case Mg:return i(new Date(d),s);case _g:{const{source:f,flags:h}=d;return i(new RegExp(f,h),s)}case Rg:{const f=i(new Map,s);for(const[h,p]of d)f.set(r(h),r(p));return f}case Og:{const f=i(new Set,s);for(const h of d)f.add(r(h));return f}case Ak:{const{name:f,message:h}=d;return i(typeof _k[f]=="function"?ab(f,h):new Error(h),s)}case Mk:return i(BigInt(d),s);case"BigInt":return i(Object(BigInt(d)),s);case"ArrayBuffer":return i(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:f}=new Uint8Array(d);return i(new DataView(f),d)}case"-0":return-0}return i(ab(c,d),s)};return r},ib=e=>_O(new Map,e)(0),eo="",{toString:RO}={},{keys:OO,is:DO}=Object,kc=e=>{const a=typeof e;if(a!=="object"||!e)return[jf,a];const i=RO.call(e).slice(8,-1);switch(i){case"Array":return[Ec,eo];case"Object":return[Zd,eo];case"Date":return[Mg,eo];case"RegExp":return[_g,eo];case"Map":return[Rg,eo];case"Set":return[Og,eo];case"DataView":return[Ec,i]}return i.includes("Array")?[Ec,i]:e instanceof Error?[Ak,e.name||"Error"]:[Zd,i]},Sd=([e,a])=>e===jf&&(a==="function"||a==="symbol"),zO=(e,a,i,r)=>{const s=(d,f)=>{const h=r.push(d)-1;return i.set(f,h),h},c=d=>{if(i.has(d))return i.get(d);let[f,h]=kc(d);switch(f){case jf:{let y=d;switch(h){case"bigint":f=Mk,y=d.toString();break;case"number":if(!d&&DO(d,-0))return r.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);y=null;break;case"undefined":return s([Tk],d)}return s([f,y],d)}case Ec:{if(h){let b=d;return h==="DataView"?b=new Uint8Array(d.buffer):h==="ArrayBuffer"&&(b=new Uint8Array(d)),s([h,[...b]],d)}const y=[],g=s([f,y],d);for(const b of d)y.push(c(b));return g}case Zd:{if(h)switch(h){case"BigInt":return s([h,d.toString()],d);case"Boolean":case"Number":case"String":return s([h,d.valueOf()],d)}if(a&&"toJSON"in d)return c(d.toJSON());const y=[],g=s([f,y],d);for(const b of OO(d))(e||!Sd(kc(d[b])))&&y.push([c(b),c(d[b])]);return g}case Mg:return s([f,isNaN(d.getTime())?eo:d.toISOString()],d);case _g:{const{source:y,flags:g}=d;return s([f,{source:y,flags:g}],d)}case Rg:{const y=[],g=s([f,y],d);for(const[b,j]of d)(e||!(Sd(kc(b))||Sd(kc(j))))&&y.push([c(b),c(j)]);return g}case Og:{const y=[],g=s([f,y],d);for(const b of d)(e||!Sd(kc(b)))&&y.push(c(b));return g}}const{message:p}=d;return s([f,{name:h,message:p}],d)};return c},rb=(e,{json:a,lossy:i}={})=>{const r=[];return zO(!(a||i),!!a,new Map,r)(e),r},Jd=typeof structuredClone=="function"?(e,a)=>a&&("json"in a||"lossy"in a)?ib(rb(e,a)):structuredClone(e):(e,a)=>ib(rb(e,a));function LO(e,a){const i=[{type:"text",value:"↩"}];return a>1&&i.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(a)}]}),i}function BO(e,a){return"Back to reference "+(e+1)+(a>1?"-"+a:"")}function IO(e){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=e.options.footnoteBackContent||LO,r=e.options.footnoteBackLabel||BO,s=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let h=-1;for(;++h<e.footnoteOrder.length;){const p=e.footnoteById.get(e.footnoteOrder[h]);if(!p)continue;const y=e.all(p),g=String(p.identifier).toUpperCase(),b=Cs(g.toLowerCase());let j=0;const k=[],S=e.footnoteCounts.get(g);for(;S!==void 0&&++j<=S;){k.length>0&&k.push({type:"text",value:" "});let M=typeof i=="string"?i:i(h,j);typeof M=="string"&&(M={type:"text",value:M}),k.push({type:"element",tagName:"a",properties:{href:"#"+a+"fnref-"+b+(j>1?"-"+j:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(h,j),className:["data-footnote-backref"]},children:Array.isArray(M)?M:[M]})}const N=y[y.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const M=N.children[N.children.length-1];M&&M.type==="text"?M.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...k)}else y.push(...k);const E={type:"element",tagName:"li",properties:{id:a+"fn-"+b},children:e.wrap(y,!0)};e.patch(p,E),f.push(E)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...Jd(d),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
572
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
573
+ `}]}}const wf=(function(e){if(e==null)return UO;if(typeof e=="function")return kf(e);if(typeof e=="object")return Array.isArray(e)?PO(e):HO(e);if(typeof e=="string")return qO(e);throw new Error("Expected function, string, or object as test")});function PO(e){const a=[];let i=-1;for(;++i<e.length;)a[i]=wf(e[i]);return kf(r);function r(...s){let c=-1;for(;++c<a.length;)if(a[c].apply(this,s))return!0;return!1}}function HO(e){const a=e;return kf(i);function i(r){const s=r;let c;for(c in e)if(s[c]!==a[c])return!1;return!0}}function qO(e){return kf(a);function a(i){return i&&i.type===e}}function kf(e){return a;function a(i,r,s){return!!(FO(i)&&e.call(this,i,typeof r=="number"?r:void 0,s||void 0))}}function UO(){return!0}function FO(e){return e!==null&&typeof e=="object"&&"type"in e}const Rk=[],VO=!0,p0=!1,$O="skip";function Ok(e,a,i,r){let s;typeof a=="function"&&typeof i!="function"?(r=i,i=a):s=a;const c=wf(s),d=r?-1:1;f(e,void 0,[])();function f(h,p,y){const g=h&&typeof h=="object"?h:{};if(typeof g.type=="string"){const j=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(h.type+(j?"<"+j+">":""))+")"})}return b;function b(){let j=Rk,k,S,N;if((!a||c(h,p,y[y.length-1]||void 0))&&(j=GO(i(h,y)),j[0]===p0))return j;if("children"in h&&h.children){const E=h;if(E.children&&j[0]!==$O)for(S=(r?E.children.length:-1)+d,N=y.concat(E);S>-1&&S<E.children.length;){const M=E.children[S];if(k=f(M,S,N)(),k[0]===p0)return k;S=typeof k[1]=="number"?k[1]:S+d}}return j}}}function GO(e){return Array.isArray(e)?e:typeof e=="number"?[VO,e]:e==null?Rk:[e]}function Dg(e,a,i,r){let s,c,d;typeof a=="function"&&typeof i!="function"?(c=void 0,d=a,s=i):(c=a,d=i,s=r),Ok(e,c,f,s);function f(h,p){const y=p[p.length-1],g=y?y.children.indexOf(h):void 0;return d(h,g,y)}}const g0={}.hasOwnProperty,YO={};function KO(e,a){const i=a||YO,r=new Map,s=new Map,c=new Map,d={...AO,...i.handlers},f={all:p,applyData:QO,definitionById:r,footnoteById:s,footnoteCounts:c,footnoteOrder:[],handlers:d,one:h,options:i,patch:XO,wrap:JO};return Dg(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const g=y.type==="definition"?r:s,b=String(y.identifier).toUpperCase();g.has(b)||g.set(b,y)}}),f;function h(y,g){const b=y.type,j=f.handlers[b];if(g0.call(f.handlers,b)&&j)return j(f,y,g);if(f.options.passThrough&&f.options.passThrough.includes(b)){if("children"in y){const{children:S,...N}=y,E=Jd(N);return E.children=f.all(y),E}return Jd(y)}return(f.options.unknownHandler||ZO)(f,y,g)}function p(y){const g=[];if("children"in y){const b=y.children;let j=-1;for(;++j<b.length;){const k=f.one(b[j],y);if(k){if(j&&b[j-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=lb(k.value)),!Array.isArray(k)&&k.type==="element")){const S=k.children[0];S&&S.type==="text"&&(S.value=lb(S.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function XO(e,a){e.position&&(a.position=zM(e))}function QO(e,a){let i=a;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,c=e.data.hProperties;if(typeof r=="string")if(i.type==="element")i.tagName=r;else{const d="children"in i?i.children:[i];i={type:"element",tagName:r,properties:{},children:d}}i.type==="element"&&c&&Object.assign(i.properties,Jd(c)),"children"in i&&i.children&&s!==null&&s!==void 0&&(i.children=s)}return i}function ZO(e,a){const i=a.data||{},r="value"in a&&!(g0.call(i,"hProperties")||g0.call(i,"hChildren"))?{type:"text",value:a.value}:{type:"element",tagName:"div",properties:{},children:e.all(a)};return e.patch(a,r),e.applyData(a,r)}function JO(e,a){const i=[];let r=-1;for(a&&i.push({type:"text",value:`
574
+ `});++r<e.length;)r&&i.push({type:"text",value:`
575
+ `}),i.push(e[r]);return a&&e.length>0&&i.push({type:"text",value:`
576
+ `}),i}function lb(e){let a=0,i=e.charCodeAt(a);for(;i===9||i===32;)a++,i=e.charCodeAt(a);return e.slice(a)}function ob(e,a){const i=KO(e,a),r=i.one(e,void 0),s=IO(i),c=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&c.children.push({type:"text",value:`
577
+ `},s),c}function WO(e,a){return e&&"run"in e?async function(i,r){const s=ob(i,{file:r,...a});await e.run(s,r)}:function(i,r){return ob(i,{file:r,...e||a})}}function sb(e){if(e)throw e}var hp,cb;function eD(){if(cb)return hp;cb=1;var e=Object.prototype.hasOwnProperty,a=Object.prototype.toString,i=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(p){return typeof Array.isArray=="function"?Array.isArray(p):a.call(p)==="[object Array]"},c=function(p){if(!p||a.call(p)!=="[object Object]")return!1;var y=e.call(p,"constructor"),g=p.constructor&&p.constructor.prototype&&e.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!y&&!g)return!1;var b;for(b in p);return typeof b>"u"||e.call(p,b)},d=function(p,y){i&&y.name==="__proto__"?i(p,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):p[y.name]=y.newValue},f=function(p,y){if(y==="__proto__")if(e.call(p,y)){if(r)return r(p,y).value}else return;return p[y]};return hp=function h(){var p,y,g,b,j,k,S=arguments[0],N=1,E=arguments.length,M=!1;for(typeof S=="boolean"&&(M=S,S=arguments[1]||{},N=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});N<E;++N)if(p=arguments[N],p!=null)for(y in p)g=f(S,y),b=f(p,y),S!==b&&(M&&b&&(c(b)||(j=s(b)))?(j?(j=!1,k=g&&s(g)?g:[]):k=g&&c(g)?g:{},d(S,{name:y,newValue:h(M,k,b)})):typeof b<"u"&&d(S,{name:y,newValue:b}));return S},hp}var tD=eD();const mp=A0(tD);function v0(e){if(typeof e!="object"||e===null)return!1;const a=Object.getPrototypeOf(e);return(a===null||a===Object.prototype||Object.getPrototypeOf(a)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function nD(){const e=[],a={run:i,use:r};return a;function i(...s){let c=-1;const d=s.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);f(null,...s);function f(h,...p){const y=e[++c];let g=-1;if(h){d(h);return}for(;++g<s.length;)(p[g]===null||p[g]===void 0)&&(p[g]=s[g]);s=p,y?aD(y,f)(...p):d(null,...p)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),a}}function aD(e,a){let i;return r;function r(...d){const f=e.length>d.length;let h;f&&d.push(s);try{h=e.apply(this,d)}catch(p){const y=p;if(f&&i)throw y;return s(y)}f||(h&&h.then&&typeof h.then=="function"?h.then(c,s):h instanceof Error?s(h):c(h))}function s(d,...f){i||(i=!0,a(d,...f))}function c(d){s(null,d)}}const zi={basename:iD,dirname:rD,extname:lD,join:oD,sep:"/"};function iD(e,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');Yc(e);let i=0,r=-1,s=e.length,c;if(a===void 0||a.length===0||a.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(c){i=s+1;break}}else r<0&&(c=!0,r=s+1);return r<0?"":e.slice(i,r)}if(a===e)return"";let d=-1,f=a.length-1;for(;s--;)if(e.codePointAt(s)===47){if(c){i=s+1;break}}else d<0&&(c=!0,d=s+1),f>-1&&(e.codePointAt(s)===a.codePointAt(f--)?f<0&&(r=s):(f=-1,r=d));return i===r?r=d:r<0&&(r=e.length),e.slice(i,r)}function rD(e){if(Yc(e),e.length===0)return".";let a=-1,i=e.length,r;for(;--i;)if(e.codePointAt(i)===47){if(r){a=i;break}}else r||(r=!0);return a<0?e.codePointAt(0)===47?"/":".":a===1&&e.codePointAt(0)===47?"//":e.slice(0,a)}function lD(e){Yc(e);let a=e.length,i=-1,r=0,s=-1,c=0,d;for(;a--;){const f=e.codePointAt(a);if(f===47){if(d){r=a+1;break}continue}i<0&&(d=!0,i=a+1),f===46?s<0?s=a:c!==1&&(c=1):s>-1&&(c=-1)}return s<0||i<0||c===0||c===1&&s===i-1&&s===r+1?"":e.slice(s,i)}function oD(...e){let a=-1,i;for(;++a<e.length;)Yc(e[a]),e[a]&&(i=i===void 0?e[a]:i+"/"+e[a]);return i===void 0?".":sD(i)}function sD(e){Yc(e);const a=e.codePointAt(0)===47;let i=cD(e,!a);return i.length===0&&!a&&(i="."),i.length>0&&e.codePointAt(e.length-1)===47&&(i+="/"),a?"/"+i:i}function cD(e,a){let i="",r=0,s=-1,c=0,d=-1,f,h;for(;++d<=e.length;){if(d<e.length)f=e.codePointAt(d);else{if(f===47)break;f=47}if(f===47){if(!(s===d-1||c===1))if(s!==d-1&&c===2){if(i.length<2||r!==2||i.codePointAt(i.length-1)!==46||i.codePointAt(i.length-2)!==46){if(i.length>2){if(h=i.lastIndexOf("/"),h!==i.length-1){h<0?(i="",r=0):(i=i.slice(0,h),r=i.length-1-i.lastIndexOf("/")),s=d,c=0;continue}}else if(i.length>0){i="",r=0,s=d,c=0;continue}}a&&(i=i.length>0?i+"/..":"..",r=2)}else i.length>0?i+="/"+e.slice(s+1,d):i=e.slice(s+1,d),r=d-s-1;s=d,c=0}else f===46&&c>-1?c++:c=-1}return i}function Yc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const uD={cwd:dD};function dD(){return"/"}function y0(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function fD(e){if(typeof e=="string")e=new URL(e);else if(!y0(e)){const a=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw a.code="ERR_INVALID_ARG_TYPE",a}if(e.protocol!=="file:"){const a=new TypeError("The URL must be of scheme file");throw a.code="ERR_INVALID_URL_SCHEME",a}return hD(e)}function hD(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const a=e.pathname;let i=-1;for(;++i<a.length;)if(a.codePointAt(i)===37&&a.codePointAt(i+1)===50){const r=a.codePointAt(i+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(a)}const pp=["history","path","basename","stem","extname","dirname"];class Dk{constructor(a){let i;a?y0(a)?i={path:a}:typeof a=="string"||mD(a)?i={value:a}:i=a:i={},this.cwd="cwd"in i?"":uD.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<pp.length;){const c=pp[r];c in i&&i[c]!==void 0&&i[c]!==null&&(this[c]=c==="history"?[...i[c]]:i[c])}let s;for(s in i)pp.includes(s)||(this[s]=i[s])}get basename(){return typeof this.path=="string"?zi.basename(this.path):void 0}set basename(a){vp(a,"basename"),gp(a,"basename"),this.path=zi.join(this.dirname||"",a)}get dirname(){return typeof this.path=="string"?zi.dirname(this.path):void 0}set dirname(a){ub(this.basename,"dirname"),this.path=zi.join(a||"",this.basename)}get extname(){return typeof this.path=="string"?zi.extname(this.path):void 0}set extname(a){if(gp(a,"extname"),ub(this.dirname,"extname"),a){if(a.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(a.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=zi.join(this.dirname,this.stem+(a||""))}get path(){return this.history[this.history.length-1]}set path(a){y0(a)&&(a=fD(a)),vp(a,"path"),this.path!==a&&this.history.push(a)}get stem(){return typeof this.path=="string"?zi.basename(this.path,this.extname):void 0}set stem(a){vp(a,"stem"),gp(a,"stem"),this.path=zi.join(this.dirname||"",a+(this.extname||""))}fail(a,i,r){const s=this.message(a,i,r);throw s.fatal=!0,s}info(a,i,r){const s=this.message(a,i,r);return s.fatal=void 0,s}message(a,i,r){const s=new Vn(a,i,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(a){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(a||void 0).decode(this.value)}}function gp(e,a){if(e&&e.includes(zi.sep))throw new Error("`"+a+"` cannot be a path: did not expect `"+zi.sep+"`")}function vp(e,a){if(!e)throw new Error("`"+a+"` cannot be empty")}function ub(e,a){if(!e)throw new Error("Setting `"+a+"` requires `path` to be set too")}function mD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const pD=(function(e){const r=this.constructor.prototype,s=r[e],c=function(){return s.apply(c,arguments)};return Object.setPrototypeOf(c,r),c}),gD={}.hasOwnProperty;class zg extends pD{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=nD()}copy(){const a=new zg;let i=-1;for(;++i<this.attachers.length;){const r=this.attachers[i];a.use(...r)}return a.data(mp(!0,{},this.namespace)),a}data(a,i){return typeof a=="string"?arguments.length===2?(bp("data",this.frozen),this.namespace[a]=i,this):gD.call(this.namespace,a)&&this.namespace[a]||void 0:a?(bp("data",this.frozen),this.namespace=a,this):this.namespace}freeze(){if(this.frozen)return this;const a=this;for(;++this.freezeIndex<this.attachers.length;){const[i,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=i.call(a,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(a){this.freeze();const i=Cd(a),r=this.parser||this.Parser;return yp("parse",r),r(String(i),i)}process(a,i){const r=this;return this.freeze(),yp("process",this.parser||this.Parser),xp("process",this.compiler||this.Compiler),i?s(void 0,i):new Promise(s);function s(c,d){const f=Cd(a),h=r.parse(f);r.run(h,f,function(y,g,b){if(y||!g||!b)return p(y);const j=g,k=r.stringify(j,b);xD(k)?b.value=k:b.result=k,p(y,b)});function p(y,g){y||!g?d(y):c?c(g):i(void 0,g)}}}processSync(a){let i=!1,r;return this.freeze(),yp("processSync",this.parser||this.Parser),xp("processSync",this.compiler||this.Compiler),this.process(a,s),fb("processSync","process",i),r;function s(c,d){i=!0,sb(c),r=d}}run(a,i,r){db(a),this.freeze();const s=this.transformers;return!r&&typeof i=="function"&&(r=i,i=void 0),r?c(void 0,r):new Promise(c);function c(d,f){const h=Cd(i);s.run(a,h,p);function p(y,g,b){const j=g||a;y?f(y):d?d(j):r(void 0,j,b)}}}runSync(a,i){let r=!1,s;return this.run(a,i,c),fb("runSync","run",r),s;function c(d,f){sb(d),s=f,r=!0}}stringify(a,i){this.freeze();const r=Cd(i),s=this.compiler||this.Compiler;return xp("stringify",s),db(a),s(a,r)}use(a,...i){const r=this.attachers,s=this.namespace;if(bp("use",this.frozen),a!=null)if(typeof a=="function")h(a,i);else if(typeof a=="object")Array.isArray(a)?f(a):d(a);else throw new TypeError("Expected usable value, not `"+a+"`");return this;function c(p){if(typeof p=="function")h(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[y,...g]=p;h(y,g)}else d(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function d(p){if(!("plugins"in p)&&!("settings"in p))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(p.plugins),p.settings&&(s.settings=mp(!0,s.settings,p.settings))}function f(p){let y=-1;if(p!=null)if(Array.isArray(p))for(;++y<p.length;){const g=p[y];c(g)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function h(p,y){let g=-1,b=-1;for(;++g<r.length;)if(r[g][0]===p){b=g;break}if(b===-1)r.push([p,...y]);else if(y.length>0){let[j,...k]=y;const S=r[b][1];v0(S)&&v0(j)&&(j=mp(!0,S,j)),r[b]=[p,j,...k]}}}}const vD=new zg().freeze();function yp(e,a){if(typeof a!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function xp(e,a){if(typeof a!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function bp(e,a){if(a)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function db(e){if(!v0(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function fb(e,a,i){if(!i)throw new Error("`"+e+"` finished async. Use `"+a+"` instead")}function Cd(e){return yD(e)?e:new Dk(e)}function yD(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function xD(e){return typeof e=="string"||bD(e)}function bD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const jD="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",hb=[],mb={allowDangerousHtml:!0},wD=/^(https?|ircs?|mailto|xmpp)$/i,kD=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function SD(e){const a=CD(e),i=ND(e);return ED(a.runSync(a.parse(i),i),e)}function CD(e){const a=e.rehypePlugins||hb,i=e.remarkPlugins||hb,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...mb}:mb;return vD().use(aO).use(i).use(WO,r).use(a)}function ND(e){const a=e.children||"",i=new Dk;return typeof a=="string"&&(i.value=a),i}function ED(e,a){const i=a.allowedElements,r=a.allowElement,s=a.components,c=a.disallowedElements,d=a.skipHtml,f=a.unwrapDisallowed,h=a.urlTransform||TD;for(const y of kD)Object.hasOwn(a,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+jD+y.id,void 0);return Dg(e,p),HM(e,{Fragment:o.Fragment,components:s,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function p(y,g,b){if(y.type==="raw"&&b&&typeof g=="number")return d?b.children.splice(g,1):b.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let j;for(j in up)if(Object.hasOwn(up,j)&&Object.hasOwn(y.properties,j)){const k=y.properties[j],S=up[j];(S===null||S.includes(y.tagName))&&(y.properties[j]=h(String(k||""),j,y))}}if(y.type==="element"){let j=i?!i.includes(y.tagName):c?c.includes(y.tagName):!1;if(!j&&r&&typeof g=="number"&&(j=!r(y,g,b)),j&&b&&typeof g=="number")return f&&y.children?b.children.splice(g,1,...y.children):b.children.splice(g,1),g}}}function TD(e){const a=e.indexOf(":"),i=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return a===-1||s!==-1&&a>s||i!==-1&&a>i||r!==-1&&a>r||wD.test(e.slice(0,a))?e:""}function AD(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function zk(e,a,i){const s=wf((i||{}).ignore||[]),c=MD(a);let d=-1;for(;++d<c.length;)Ok(e,"text",f);function f(p,y){let g=-1,b;for(;++g<y.length;){const j=y[g],k=b?b.children:void 0;if(s(j,k?k.indexOf(j):void 0,b))return;b=j}if(b)return h(p,y)}function h(p,y){const g=y[y.length-1],b=c[d][0],j=c[d][1];let k=0;const N=g.children.indexOf(p);let E=!1,M=[];b.lastIndex=0;let C=b.exec(p.value);for(;C;){const A=C.index,_={index:C.index,input:C.input,stack:[...y,p]};let R=j(...C,_);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?b.lastIndex=A+1:(k!==A&&M.push({type:"text",value:p.value.slice(k,A)}),Array.isArray(R)?M.push(...R):R&&M.push(R),k=A+C[0].length,E=!0),!b.global)break;C=b.exec(p.value)}return E?(k<p.value.length&&M.push({type:"text",value:p.value.slice(k)}),g.children.splice(N,1,...M)):M=[p],N+M.length}}function MD(e){const a=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const i=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<i.length;){const s=i[r];a.push([_D(s[0]),RD(s[1])])}return a}function _D(e){return typeof e=="string"?new RegExp(AD(e),"g"):e}function RD(e){return typeof e=="function"?e:function(){return e}}function OD(e){zk(e,[/\r?\n|\r/g,DD])}function DD(){return{type:"break"}}function zD(){return function(e){OD(e)}}const LD=/[\u3000-\u303f\uff00-\uffef\u2014\u2018-\u201f\u2026]/,BD=/https?:\/\/[^\s<\u3000-\u303f\uff00-\uffef\u2014\u2018-\u201f\u2026]+/g;function ID(e){var r;const a=((r=e.children)==null?void 0:r.length)===1?e.children[0]:void 0;if((a==null?void 0:a.type)!=="text"||!a.value)return;const i=a.value;return e.url===i||e.url===`http://${i}`||e.url===`mailto:${i}`?i:void 0}function Lk(e,a){return{type:"link",url:e,children:[{type:"text",value:a}]}}function PD(e){const a=[];let i=0;for(const r of e.matchAll(BD))r.index>i&&a.push({type:"text",value:e.slice(i,r.index)}),a.push(Lk(r[0],r[0])),i=r.index+r[0].length;return i<e.length&&a.push({type:"text",value:e.slice(i)}),a}function Bk(e){const a=e.children;if(a)for(let i=0;i<a.length;i++){const r=a[i];if(r.type!=="link"){Bk(r);continue}const s=ID(r),c=s===void 0?-1:s.search(LD);if(s===void 0||c<=0)continue;const d=s.slice(0,c),f=r.url.slice(0,r.url.length-s.length),h=PD(s.slice(c));a.splice(i,1,Lk(f+d,d),...h),i+=h.length}}function HD(){return e=>Bk(e)}const qD=new RegExp("(?<![A-Za-z0-9_/#.@-])m\\d{1,9}(?![A-Za-z0-9_-]|\\.[A-Za-z0-9])","g");function UD(e){const a=[];let i=0;for(const r of e.matchAll(qD))r.index>i&&a.push({type:"text",value:e.slice(i,r.index)}),a.push({type:"link",url:`#ref-${r[0]}`,children:[{type:"text",value:r[0]}]}),i=r.index+r[0].length;return a.length?(i<e.length&&a.push({type:"text",value:e.slice(i)}),a):null}function Ik(e){const a=e.children;if(!(!a||e.type==="link"||e.type==="linkReference"))for(let i=0;i<a.length;i++){const r=a[i];if(r.type!=="text"){Ik(r);continue}const s=r.value?UD(r.value):null;s&&(a.splice(i,1,...s),i+=s.length-1)}}function FD(){return e=>Ik(e)}function pb(e,a){const i=String(e);if(typeof a!="string")throw new TypeError("Expected character");let r=0,s=i.indexOf(a);for(;s!==-1;)r++,s=i.indexOf(a,s+a.length);return r}const jp="phrasing",wp=["autolink","link","image","label"];function VD(){return{transforms:[ZD],enter:{literalAutolink:GD,literalAutolinkEmail:kp,literalAutolinkHttp:kp,literalAutolinkWww:kp},exit:{literalAutolink:QD,literalAutolinkEmail:XD,literalAutolinkHttp:YD,literalAutolinkWww:KD}}}function $D(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:jp,notInConstruct:wp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:jp,notInConstruct:wp},{character:":",before:"[ps]",after:"\\/",inConstruct:jp,notInConstruct:wp}]}}function GD(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function kp(e){this.config.enter.autolinkProtocol.call(this,e)}function YD(e){this.config.exit.autolinkProtocol.call(this,e)}function KD(e){this.config.exit.data.call(this,e);const a=this.stack[this.stack.length-1];a.type,a.url="http://"+this.sliceSerialize(e)}function XD(e){this.config.exit.autolinkEmail.call(this,e)}function QD(e){this.exit(e)}function ZD(e){zk(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,JD],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),WD]],{ignore:["link","linkReference"]})}function JD(e,a,i,r,s){let c="";if(!Pk(s)||(/^w/i.test(a)&&(i=a+i,a="",c="http://"),!ez(i)))return!1;const d=tz(i+r);if(!d[0])return!1;const f={type:"link",title:null,url:c+a+d[0],children:[{type:"text",value:a+d[0]}]};return d[1]?[f,{type:"text",value:d[1]}]:f}function WD(e,a,i,r){return!Pk(r,!0)||/[-\d_]$/.test(i)?!1:{type:"link",title:null,url:"mailto:"+a+"@"+i,children:[{type:"text",value:a+"@"+i}]}}function ez(e){const a=e.split(".");return!(a.length<2||a[a.length-1]&&(/_/.test(a[a.length-1])||!/[a-zA-Z\d]/.test(a[a.length-1]))||a[a.length-2]&&(/_/.test(a[a.length-2])||!/[a-zA-Z\d]/.test(a[a.length-2])))}function tz(e){const a=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!a)return[e,void 0];e=e.slice(0,a.index);let i=a[0],r=i.indexOf(")");const s=pb(e,"(");let c=pb(e,")");for(;r!==-1&&s>c;)e+=i.slice(0,r+1),i=i.slice(r+1),r=i.indexOf(")"),c++;return[e,i]}function Pk(e,a){const i=e.input.charCodeAt(e.index-1);return(e.index===0||fo(i)||xf(i))&&(!a||i!==47)}Hk.peek=uz;function nz(){this.buffer()}function az(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function iz(){this.buffer()}function rz(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function lz(e){const a=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=fi(this.sliceSerialize(e)).toLowerCase(),i.label=a}function oz(e){this.exit(e)}function sz(e){const a=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=fi(this.sliceSerialize(e)).toLowerCase(),i.label=a}function cz(e){this.exit(e)}function uz(){return"["}function Hk(e,a,i,r){const s=i.createTracker(r);let c=s.move("[^");const d=i.enter("footnoteReference"),f=i.enter("reference");return c+=s.move(i.safe(i.associationId(e),{after:"]",before:c})),f(),d(),c+=s.move("]"),c}function dz(){return{enter:{gfmFootnoteCallString:nz,gfmFootnoteCall:az,gfmFootnoteDefinitionLabelString:iz,gfmFootnoteDefinition:rz},exit:{gfmFootnoteCallString:lz,gfmFootnoteCall:oz,gfmFootnoteDefinitionLabelString:sz,gfmFootnoteDefinition:cz}}}function fz(e){let a=!1;return e&&e.firstLineBlank&&(a=!0),{handlers:{footnoteDefinition:i,footnoteReference:Hk},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function i(r,s,c,d){const f=c.createTracker(d);let h=f.move("[^");const p=c.enter("footnoteDefinition"),y=c.enter("label");return h+=f.move(c.safe(c.associationId(r),{before:h,after:"]"})),y(),h+=f.move("]:"),r.children&&r.children.length>0&&(f.shift(4),h+=f.move((a?`
578
+ `:" ")+c.indentLines(c.containerFlow(r,f.current()),a?qk:hz))),p(),h}}function hz(e,a,i){return a===0?e:qk(e,a,i)}function qk(e,a,i){return(i?"":" ")+e}const mz=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Uk.peek=xz;function pz(){return{canContainEols:["delete"],enter:{strikethrough:vz},exit:{strikethrough:yz}}}function gz(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:mz}],handlers:{delete:Uk}}}function vz(e){this.enter({type:"delete",children:[]},e)}function yz(e){this.exit(e)}function Uk(e,a,i,r){const s=i.createTracker(r),c=i.enter("strikethrough");let d=s.move("~~");return d+=i.containerPhrasing(e,{...s.current(),before:d,after:"~"}),d+=s.move("~~"),c(),d}function xz(){return"~"}function bz(e){return e.length}function jz(e,a){const i=a||{},r=(i.align||[]).concat(),s=i.stringLength||bz,c=[],d=[],f=[],h=[];let p=0,y=-1;for(;++y<e.length;){const S=[],N=[];let E=-1;for(e[y].length>p&&(p=e[y].length);++E<e[y].length;){const M=wz(e[y][E]);if(i.alignDelimiters!==!1){const C=s(M);N[E]=C,(h[E]===void 0||C>h[E])&&(h[E]=C)}S.push(M)}d[y]=S,f[y]=N}let g=-1;if(typeof r=="object"&&"length"in r)for(;++g<p;)c[g]=gb(r[g]);else{const S=gb(r);for(;++g<p;)c[g]=S}g=-1;const b=[],j=[];for(;++g<p;){const S=c[g];let N="",E="";S===99?(N=":",E=":"):S===108?N=":":S===114&&(E=":");let M=i.alignDelimiters===!1?1:Math.max(1,h[g]-N.length-E.length);const C=N+"-".repeat(M)+E;i.alignDelimiters!==!1&&(M=N.length+M+E.length,M>h[g]&&(h[g]=M),j[g]=M),b[g]=C}d.splice(1,0,b),f.splice(1,0,j),y=-1;const k=[];for(;++y<d.length;){const S=d[y],N=f[y];g=-1;const E=[];for(;++g<p;){const M=S[g]||"";let C="",A="";if(i.alignDelimiters!==!1){const _=h[g]-(N[g]||0),R=c[g];R===114?C=" ".repeat(_):R===99?_%2?(C=" ".repeat(_/2+.5),A=" ".repeat(_/2-.5)):(C=" ".repeat(_/2),A=C):A=" ".repeat(_)}i.delimiterStart!==!1&&!g&&E.push("|"),i.padding!==!1&&!(i.alignDelimiters===!1&&M==="")&&(i.delimiterStart!==!1||g)&&E.push(" "),i.alignDelimiters!==!1&&E.push(C),E.push(M),i.alignDelimiters!==!1&&E.push(A),i.padding!==!1&&E.push(" "),(i.delimiterEnd!==!1||g!==p-1)&&E.push("|")}k.push(i.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return k.join(`
579
+ `)}function wz(e){return e==null?"":String(e)}function gb(e){const a=typeof e=="string"?e.codePointAt(0):0;return a===67||a===99?99:a===76||a===108?108:a===82||a===114?114:0}function kz(e,a,i,r){const s=i.enter("blockquote"),c=i.createTracker(r);c.move("> "),c.shift(2);const d=i.indentLines(i.containerFlow(e,c.current()),Sz);return s(),d}function Sz(e,a,i){return">"+(i?"":" ")+e}function Cz(e,a){return vb(e,a.inConstruct,!0)&&!vb(e,a.notInConstruct,!1)}function vb(e,a,i){if(typeof a=="string"&&(a=[a]),!a||a.length===0)return i;let r=-1;for(;++r<a.length;)if(e.includes(a[r]))return!0;return!1}function yb(e,a,i,r){let s=-1;for(;++s<i.unsafe.length;)if(i.unsafe[s].character===`
580
+ `&&Cz(i.stack,i.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
581
+ `}function Nz(e,a){const i=String(e);let r=i.indexOf(a),s=r,c=0,d=0;if(typeof a!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++c>d&&(d=c):c=1,s=r+a.length,r=i.indexOf(a,s);return d}function Ez(e,a){return!!(a.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Tz(e){const a=e.options.fence||"`";if(a!=="`"&&a!=="~")throw new Error("Cannot serialize code with `"+a+"` for `options.fence`, expected `` ` `` or `~`");return a}function Az(e,a,i,r){const s=Tz(i),c=e.value||"",d=s==="`"?"GraveAccent":"Tilde";if(Ez(e,i)){const g=i.enter("codeIndented"),b=i.indentLines(c,Mz);return g(),b}const f=i.createTracker(r),h=s.repeat(Math.max(Nz(c,s)+1,3)),p=i.enter("codeFenced");let y=f.move(h);if(e.lang){const g=i.enter(`codeFencedLang${d}`);y+=f.move(i.safe(e.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(e.lang&&e.meta){const g=i.enter(`codeFencedMeta${d}`);y+=f.move(" "),y+=f.move(i.safe(e.meta,{before:y,after:`
582
+ `,encode:["`"],...f.current()})),g()}return y+=f.move(`
583
+ `),c&&(y+=f.move(c+`
584
+ `)),y+=f.move(h),p(),y}function Mz(e,a,i){return(i?"":" ")+e}function Lg(e){const a=e.options.quote||'"';if(a!=='"'&&a!=="'")throw new Error("Cannot serialize title with `"+a+"` for `options.quote`, expected `\"`, or `'`");return a}function _z(e,a,i,r){const s=Lg(i),c=s==='"'?"Quote":"Apostrophe",d=i.enter("definition");let f=i.enter("label");const h=i.createTracker(r);let p=h.move("[");return p+=h.move(i.safe(i.associationId(e),{before:p,after:"]",...h.current()})),p+=h.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=i.enter("destinationLiteral"),p+=h.move("<"),p+=h.move(i.safe(e.url,{before:p,after:">",...h.current()})),p+=h.move(">")):(f=i.enter("destinationRaw"),p+=h.move(i.safe(e.url,{before:p,after:e.title?" ":`
585
+ `,...h.current()}))),f(),e.title&&(f=i.enter(`title${c}`),p+=h.move(" "+s),p+=h.move(i.safe(e.title,{before:p,after:s,...h.current()})),p+=h.move(s),f()),d(),p}function Rz(e){const a=e.options.emphasis||"*";if(a!=="*"&&a!=="_")throw new Error("Cannot serialize emphasis with `"+a+"` for `options.emphasis`, expected `*`, or `_`");return a}function Lc(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Wd(e,a,i){const r=ps(e),s=ps(a);return r===void 0?s===void 0?i==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Fk.peek=Oz;function Fk(e,a,i,r){const s=Rz(i),c=i.enter("emphasis"),d=i.createTracker(r),f=d.move(s);let h=d.move(i.containerPhrasing(e,{after:s,before:f,...d.current()}));const p=h.charCodeAt(0),y=Wd(r.before.charCodeAt(r.before.length-1),p,s);y.inside&&(h=Lc(p)+h.slice(1));const g=h.charCodeAt(h.length-1),b=Wd(r.after.charCodeAt(0),g,s);b.inside&&(h=h.slice(0,-1)+Lc(g));const j=d.move(s);return c(),i.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+h+j}function Oz(e,a,i){return i.options.emphasis||"*"}function Dz(e,a){let i=!1;return Dg(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return i=!0,p0}),!!((!e.depth||e.depth<3)&&Eg(e)&&(a.options.setext||i))}function zz(e,a,i,r){const s=Math.max(Math.min(6,e.depth||1),1),c=i.createTracker(r);if(Dz(e,i)){const y=i.enter("headingSetext"),g=i.enter("phrasing"),b=i.containerPhrasing(e,{...c.current(),before:`
586
+ `,after:`
587
+ `});return g(),y(),b+`
588
+ `+(s===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
589
+ `))+1))}const d="#".repeat(s),f=i.enter("headingAtx"),h=i.enter("phrasing");c.move(d+" ");let p=i.containerPhrasing(e,{before:"# ",after:`
590
+ `,...c.current()});return/^[\t ]/.test(p)&&(p=Lc(p.charCodeAt(0))+p.slice(1)),p=p?d+" "+p:d,i.options.closeAtx&&(p+=" "+d),h(),f(),p}Vk.peek=Lz;function Vk(e){return e.value||""}function Lz(){return"<"}$k.peek=Bz;function $k(e,a,i,r){const s=Lg(i),c=s==='"'?"Quote":"Apostrophe",d=i.enter("image");let f=i.enter("label");const h=i.createTracker(r);let p=h.move("![");return p+=h.move(i.safe(e.alt,{before:p,after:"]",...h.current()})),p+=h.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=i.enter("destinationLiteral"),p+=h.move("<"),p+=h.move(i.safe(e.url,{before:p,after:">",...h.current()})),p+=h.move(">")):(f=i.enter("destinationRaw"),p+=h.move(i.safe(e.url,{before:p,after:e.title?" ":")",...h.current()}))),f(),e.title&&(f=i.enter(`title${c}`),p+=h.move(" "+s),p+=h.move(i.safe(e.title,{before:p,after:s,...h.current()})),p+=h.move(s),f()),p+=h.move(")"),d(),p}function Bz(){return"!"}Gk.peek=Iz;function Gk(e,a,i,r){const s=e.referenceType,c=i.enter("imageReference");let d=i.enter("label");const f=i.createTracker(r);let h=f.move("![");const p=i.safe(e.alt,{before:h,after:"]",...f.current()});h+=f.move(p+"]["),d();const y=i.stack;i.stack=[],d=i.enter("reference");const g=i.safe(i.associationId(e),{before:h,after:"]",...f.current()});return d(),i.stack=y,c(),s==="full"||!p||p!==g?h+=f.move(g+"]"):s==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function Iz(){return"!"}Yk.peek=Pz;function Yk(e,a,i){let r=e.value||"",s="`",c=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++c<i.unsafe.length;){const d=i.unsafe[c],f=i.compilePattern(d);let h;if(d.atBreak)for(;h=f.exec(r);){let p=h.index;r.charCodeAt(p)===10&&r.charCodeAt(p-1)===13&&p--,r=r.slice(0,p)+" "+r.slice(h.index+1)}}return s+r+s}function Pz(){return"`"}function Kk(e,a){const i=Eg(e);return!!(!a.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(i===e.url||"mailto:"+i===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Xk.peek=Hz;function Xk(e,a,i,r){const s=Lg(i),c=s==='"'?"Quote":"Apostrophe",d=i.createTracker(r);let f,h;if(Kk(e,i)){const y=i.stack;i.stack=[],f=i.enter("autolink");let g=d.move("<");return g+=d.move(i.containerPhrasing(e,{before:g,after:">",...d.current()})),g+=d.move(">"),f(),i.stack=y,g}f=i.enter("link"),h=i.enter("label");let p=d.move("[");return p+=d.move(i.containerPhrasing(e,{before:p,after:"](",...d.current()})),p+=d.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=i.enter("destinationLiteral"),p+=d.move("<"),p+=d.move(i.safe(e.url,{before:p,after:">",...d.current()})),p+=d.move(">")):(h=i.enter("destinationRaw"),p+=d.move(i.safe(e.url,{before:p,after:e.title?" ":")",...d.current()}))),h(),e.title&&(h=i.enter(`title${c}`),p+=d.move(" "+s),p+=d.move(i.safe(e.title,{before:p,after:s,...d.current()})),p+=d.move(s),h()),p+=d.move(")"),f(),p}function Hz(e,a,i){return Kk(e,i)?"<":"["}Qk.peek=qz;function Qk(e,a,i,r){const s=e.referenceType,c=i.enter("linkReference");let d=i.enter("label");const f=i.createTracker(r);let h=f.move("[");const p=i.containerPhrasing(e,{before:h,after:"]",...f.current()});h+=f.move(p+"]["),d();const y=i.stack;i.stack=[],d=i.enter("reference");const g=i.safe(i.associationId(e),{before:h,after:"]",...f.current()});return d(),i.stack=y,c(),s==="full"||!p||p!==g?h+=f.move(g+"]"):s==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function qz(){return"["}function Bg(e){const a=e.options.bullet||"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bullet`, expected `*`, `+`, or `-`");return a}function Uz(e){const a=Bg(e),i=e.options.bulletOther;if(!i)return a==="*"?"-":"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(i===a)throw new Error("Expected `bullet` (`"+a+"`) and `bulletOther` (`"+i+"`) to be different");return i}function Fz(e){const a=e.options.bulletOrdered||".";if(a!=="."&&a!==")")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOrdered`, expected `.` or `)`");return a}function Zk(e){const a=e.options.rule||"*";if(a!=="*"&&a!=="-"&&a!=="_")throw new Error("Cannot serialize rules with `"+a+"` for `options.rule`, expected `*`, `-`, or `_`");return a}function Vz(e,a,i,r){const s=i.enter("list"),c=i.bulletCurrent;let d=e.ordered?Fz(i):Bg(i);const f=e.ordered?d==="."?")":".":Uz(i);let h=a&&i.bulletLastUsed?d===i.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((d==="*"||d==="-")&&y&&(!y.children||!y.children[0])&&i.stack[i.stack.length-1]==="list"&&i.stack[i.stack.length-2]==="listItem"&&i.stack[i.stack.length-3]==="list"&&i.stack[i.stack.length-4]==="listItem"&&i.indexStack[i.indexStack.length-1]===0&&i.indexStack[i.indexStack.length-2]===0&&i.indexStack[i.indexStack.length-3]===0&&(h=!0),Zk(i)===d&&y){let g=-1;for(;++g<e.children.length;){const b=e.children[g];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(d=f),i.bulletCurrent=d;const p=i.containerFlow(e,r);return i.bulletLastUsed=d,i.bulletCurrent=c,s(),p}function $z(e){const a=e.options.listItemIndent||"one";if(a!=="tab"&&a!=="one"&&a!=="mixed")throw new Error("Cannot serialize items with `"+a+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return a}function Gz(e,a,i,r){const s=$z(i);let c=i.bulletCurrent||Bg(i);a&&a.type==="list"&&a.ordered&&(c=(typeof a.start=="number"&&a.start>-1?a.start:1)+(i.options.incrementListMarker===!1?0:a.children.indexOf(e))+c);let d=c.length+1;(s==="tab"||s==="mixed"&&(a&&a.type==="list"&&a.spread||e.spread))&&(d=Math.ceil(d/4)*4);const f=i.createTracker(r);f.move(c+" ".repeat(d-c.length)),f.shift(d);const h=i.enter("listItem"),p=i.indentLines(i.containerFlow(e,f.current()),y);return h(),p;function y(g,b,j){return b?(j?"":" ".repeat(d))+g:(j?c:c+" ".repeat(d-c.length))+g}}function Yz(e,a,i,r){const s=i.enter("paragraph"),c=i.enter("phrasing"),d=i.containerPhrasing(e,r);return c(),s(),d}const Kz=wf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Xz(e,a,i,r){return(e.children.some(function(d){return Kz(d)})?i.containerPhrasing:i.containerFlow).call(i,e,r)}function Qz(e){const a=e.options.strong||"*";if(a!=="*"&&a!=="_")throw new Error("Cannot serialize strong with `"+a+"` for `options.strong`, expected `*`, or `_`");return a}Jk.peek=Zz;function Jk(e,a,i,r){const s=Qz(i),c=i.enter("strong"),d=i.createTracker(r),f=d.move(s+s);let h=d.move(i.containerPhrasing(e,{after:s,before:f,...d.current()}));const p=h.charCodeAt(0),y=Wd(r.before.charCodeAt(r.before.length-1),p,s);y.inside&&(h=Lc(p)+h.slice(1));const g=h.charCodeAt(h.length-1),b=Wd(r.after.charCodeAt(0),g,s);b.inside&&(h=h.slice(0,-1)+Lc(g));const j=d.move(s+s);return c(),i.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+h+j}function Zz(e,a,i){return i.options.strong||"*"}function Jz(e,a,i,r){return i.safe(e.value,r)}function Wz(e){const a=e.options.ruleRepetition||3;if(a<3)throw new Error("Cannot serialize rules with repetition `"+a+"` for `options.ruleRepetition`, expected `3` or more");return a}function eL(e,a,i){const r=(Zk(i)+(i.options.ruleSpaces?" ":"")).repeat(Wz(i));return i.options.ruleSpaces?r.slice(0,-1):r}const Wk={blockquote:kz,break:yb,code:Az,definition:_z,emphasis:Fk,hardBreak:yb,heading:zz,html:Vk,image:$k,imageReference:Gk,inlineCode:Yk,link:Xk,linkReference:Qk,list:Vz,listItem:Gz,paragraph:Yz,root:Xz,strong:Jk,text:Jz,thematicBreak:eL};function tL(){return{enter:{table:nL,tableData:xb,tableHeader:xb,tableRow:iL},exit:{codeText:rL,table:aL,tableData:Sp,tableHeader:Sp,tableRow:Sp}}}function nL(e){const a=e._align;this.enter({type:"table",align:a.map(function(i){return i==="none"?null:i}),children:[]},e),this.data.inTable=!0}function aL(e){this.exit(e),this.data.inTable=void 0}function iL(e){this.enter({type:"tableRow",children:[]},e)}function Sp(e){this.exit(e)}function xb(e){this.enter({type:"tableCell",children:[]},e)}function rL(e){let a=this.resume();this.data.inTable&&(a=a.replace(/\\([\\|])/g,lL));const i=this.stack[this.stack.length-1];i.type,i.value=a,this.exit(e)}function lL(e,a){return a==="|"?a:e}function oL(e){const a=e||{},i=a.tableCellPadding,r=a.tablePipeAlign,s=a.stringLength,c=i?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
591
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:d,tableCell:h,tableRow:f}};function d(j,k,S,N){return p(y(j,S,N),j.align)}function f(j,k,S,N){const E=g(j,S,N),M=p([E]);return M.slice(0,M.indexOf(`
592
+ `))}function h(j,k,S,N){const E=S.enter("tableCell"),M=S.enter("phrasing"),C=S.containerPhrasing(j,{...N,before:c,after:c});return M(),E(),C}function p(j,k){return jz(j,{align:k,alignDelimiters:r,padding:i,stringLength:s})}function y(j,k,S){const N=j.children;let E=-1;const M=[],C=k.enter("table");for(;++E<N.length;)M[E]=g(N[E],k,S);return C(),M}function g(j,k,S){const N=j.children;let E=-1;const M=[],C=k.enter("tableRow");for(;++E<N.length;)M[E]=h(N[E],j,k,S);return C(),M}function b(j,k,S){let N=Wk.inlineCode(j,k,S);return S.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function sL(){return{exit:{taskListCheckValueChecked:bb,taskListCheckValueUnchecked:bb,paragraph:uL}}}function cL(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:dL}}}function bb(e){const a=this.stack[this.stack.length-2];a.type,a.checked=e.type==="taskListCheckValueChecked"}function uL(e){const a=this.stack[this.stack.length-2];if(a&&a.type==="listItem"&&typeof a.checked=="boolean"){const i=this.stack[this.stack.length-1];i.type;const r=i.children[0];if(r&&r.type==="text"){const s=a.children;let c=-1,d;for(;++c<s.length;){const f=s[c];if(f.type==="paragraph"){d=f;break}}d===i&&(r.value=r.value.slice(1),r.value.length===0?i.children.shift():i.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,i.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function dL(e,a,i,r){const s=e.children[0],c=typeof e.checked=="boolean"&&s&&s.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",f=i.createTracker(r);c&&f.move(d);let h=Wk.listItem(e,a,i,{...r,...f.current()});return c&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,p)),h;function p(y){return y+d}}function fL(){return[VD(),dz(),pz(),tL(),sL()]}function hL(e){return{extensions:[$D(),fz(e),gz(),oL(e),cL()]}}const mL={tokenize:bL,partial:!0},e5={tokenize:jL,partial:!0},t5={tokenize:wL,partial:!0},n5={tokenize:kL,partial:!0},pL={tokenize:SL,partial:!0},a5={name:"wwwAutolink",tokenize:yL,previous:r5},i5={name:"protocolAutolink",tokenize:xL,previous:l5},kr={name:"emailAutolink",tokenize:vL,previous:o5},Yi={};function gL(){return{text:Yi}}let Zl=48;for(;Zl<123;)Yi[Zl]=kr,Zl++,Zl===58?Zl=65:Zl===91&&(Zl=97);Yi[43]=kr;Yi[45]=kr;Yi[46]=kr;Yi[95]=kr;Yi[72]=[kr,i5];Yi[104]=[kr,i5];Yi[87]=[kr,a5];Yi[119]=[kr,a5];function vL(e,a,i){const r=this;let s,c;return d;function d(g){return!x0(g)||!o5.call(r,r.previous)||Ig(r.events)?i(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return x0(g)?(e.consume(g),f):g===64?(e.consume(g),h):i(g)}function h(g){return g===46?e.check(pL,y,p)(g):g===45||g===95||Fn(g)?(c=!0,e.consume(g),h):y(g)}function p(g){return e.consume(g),s=!0,h}function y(g){return c&&s&&ea(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),a(g)):i(g)}}function yL(e,a,i){const r=this;return s;function s(d){return d!==87&&d!==119||!r5.call(r,r.previous)||Ig(r.events)?i(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(mL,e.attempt(e5,e.attempt(t5,c),i),i)(d))}function c(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),a(d)}}function xL(e,a,i){const r=this;let s="",c=!1;return d;function d(g){return(g===72||g===104)&&l5.call(r,r.previous)&&!Ig(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(g),e.consume(g),f):i(g)}function f(g){if(ea(g)&&s.length<5)return s+=String.fromCodePoint(g),e.consume(g),f;if(g===58){const b=s.toLowerCase();if(b==="http"||b==="https")return e.consume(g),h}return i(g)}function h(g){return g===47?(e.consume(g),c?p:(c=!0,h)):i(g)}function p(g){return g===null||Qd(g)||Pt(g)||fo(g)||xf(g)?i(g):e.attempt(e5,e.attempt(t5,y),i)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),a(g)}}function bL(e,a,i){let r=0;return s;function s(d){return(d===87||d===119)&&r<3?(r++,e.consume(d),s):d===46&&r===3?(e.consume(d),c):i(d)}function c(d){return d===null?i(d):a(d)}}function jL(e,a,i){let r,s,c;return d;function d(p){return p===46||p===95?e.check(n5,h,f)(p):p===null||Pt(p)||fo(p)||p!==45&&xf(p)?h(p):(c=!0,e.consume(p),d)}function f(p){return p===95?r=!0:(s=r,r=void 0),e.consume(p),d}function h(p){return s||r||!c?i(p):a(p)}}function wL(e,a){let i=0,r=0;return s;function s(d){return d===40?(i++,e.consume(d),s):d===41&&r<i?c(d):d===33||d===34||d===38||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===60||d===63||d===93||d===95||d===126?e.check(n5,a,c)(d):d===null||Pt(d)||fo(d)?a(d):(e.consume(d),s)}function c(d){return d===41&&r++,e.consume(d),s}}function kL(e,a,i){return r;function r(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),r):f===38?(e.consume(f),c):f===93?(e.consume(f),s):f===60||f===null||Pt(f)||fo(f)?a(f):i(f)}function s(f){return f===null||f===40||f===91||Pt(f)||fo(f)?a(f):r(f)}function c(f){return ea(f)?d(f):i(f)}function d(f){return f===59?(e.consume(f),r):ea(f)?(e.consume(f),d):i(f)}}function SL(e,a,i){return r;function r(c){return e.consume(c),s}function s(c){return Fn(c)?i(c):a(c)}}function r5(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Pt(e)}function l5(e){return!ea(e)}function o5(e){return!(e===47||x0(e))}function x0(e){return e===43||e===45||e===46||e===95||Fn(e)}function Ig(e){let a=e.length,i=!1;for(;a--;){const r=e[a][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){i=!0;break}if(r._gfmAutolinkLiteralWalkedInto){i=!1;break}}return e.length>0&&!i&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),i}const CL={tokenize:OL,partial:!0};function NL(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:ML,continuation:{tokenize:_L},exit:RL}},text:{91:{name:"gfmFootnoteCall",tokenize:AL},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:EL,resolveTo:TL}}}}function EL(e,a,i){const r=this;let s=r.events.length;const c=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let d;for(;s--;){const h=r.events[s][1];if(h.type==="labelImage"){d=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return f;function f(h){if(!d||!d._balanced)return i(h);const p=fi(r.sliceSerialize({start:d.end,end:r.now()}));return p.codePointAt(0)!==94||!c.includes(p.slice(1))?i(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),a(h))}}function TL(e,a){let i=e.length;for(;i--;)if(e[i][1].type==="labelImage"&&e[i][0]==="enter"){e[i][1];break}e[i+1][1].type="data",e[i+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[i+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[i+3][1].end),end:Object.assign({},e[i+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},f=[e[i+1],e[i+2],["enter",r,a],e[i+3],e[i+4],["enter",s,a],["exit",s,a],["enter",c,a],["enter",d,a],["exit",d,a],["exit",c,a],e[e.length-2],e[e.length-1],["exit",r,a]];return e.splice(i,e.length-i+1,...f),e}function AL(e,a,i){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c=0,d;return f;function f(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),h}function h(g){return g!==94?i(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",p)}function p(g){if(c>999||g===93&&!d||g===null||g===91||Pt(g))return i(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return s.includes(fi(r.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),a):i(g)}return Pt(g)||(d=!0),c++,e.consume(g),g===92?y:p}function y(g){return g===91||g===92||g===93?(e.consume(g),c++,p):p(g)}}function ML(e,a,i){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c,d=0,f;return h;function h(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",y):i(k)}function y(k){if(d>999||k===93&&!f||k===null||k===91||Pt(k))return i(k);if(k===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return c=fi(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return Pt(k)||(f=!0),d++,e.consume(k),k===92?g:y}function g(k){return k===91||k===92||k===93?(e.consume(k),d++,y):y(k)}function b(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),s.includes(c)||s.push(c),wt(e,j,"gfmFootnoteDefinitionWhitespace")):i(k)}function j(k){return a(k)}}function _L(e,a,i){return e.check(Gc,a,e.attempt(CL,a,i))}function RL(e){e.exit("gfmFootnoteDefinition")}function OL(e,a,i){const r=this;return wt(e,s,"gfmFootnoteDefinitionIndent",5);function s(c){const d=r.events[r.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?a(c):i(c)}}function DL(e){let i=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:c,resolveAll:s};return i==null&&(i=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(d,f){let h=-1;for(;++h<d.length;)if(d[h][0]==="enter"&&d[h][1].type==="strikethroughSequenceTemporary"&&d[h][1]._close){let p=h;for(;p--;)if(d[p][0]==="exit"&&d[p][1].type==="strikethroughSequenceTemporary"&&d[p][1]._open&&d[h][1].end.offset-d[h][1].start.offset===d[p][1].end.offset-d[p][1].start.offset){d[h][1].type="strikethroughSequence",d[p][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},d[p][1].start),end:Object.assign({},d[h][1].end)},g={type:"strikethroughText",start:Object.assign({},d[p][1].end),end:Object.assign({},d[h][1].start)},b=[["enter",y,f],["enter",d[p][1],f],["exit",d[p][1],f],["enter",g,f]],j=f.parser.constructs.insideSpan.null;j&&Da(b,b.length,0,bf(j,d.slice(p+1,h),f)),Da(b,b.length,0,[["exit",g,f],["enter",d[h][1],f],["exit",d[h][1],f],["exit",y,f]]),Da(d,p-1,h-p+3,b),h=p+b.length-2;break}}for(h=-1;++h<d.length;)d[h][1].type==="strikethroughSequenceTemporary"&&(d[h][1].type="data");return d}function c(d,f,h){const p=this.previous,y=this.events;let g=0;return b;function b(k){return p===126&&y[y.length-1][1].type!=="characterEscape"?h(k):(d.enter("strikethroughSequenceTemporary"),j(k))}function j(k){const S=ps(p);if(k===126)return g>1?h(k):(d.consume(k),g++,j);if(g<2&&!i)return h(k);const N=d.exit("strikethroughSequenceTemporary"),E=ps(k);return N._open=!E||E===2&&!!S,N._close=!S||S===2&&!!E,f(k)}}}class zL{constructor(){this.map=[],this.index=new Map}add(a,i,r){LL(this,a,i,r)}consume(a){if(this.map.sort(function(c,d){return c[0]-d[0]}),this.map.length===0)return;let i=this.map.length;const r=[];for(;i>0;)i-=1,r.push(a.slice(this.map[i][0]+this.map[i][1]),this.map[i][2]),a.length=this.map[i][0];r.push(a.slice()),a.length=0;let s=r.pop();for(;s;){for(const c of s)a.push(c);s=r.pop()}this.map.length=0,this.index.clear()}}function LL(e,a,i,r){if(i===0&&r.length===0)return;const s=e.index.get(a);if(s){s[1]+=i,s[2].push(...r);return}const c=[a,i,r];e.map.push(c),e.index.set(a,c)}function BL(e,a){let i=!1;const r=[];for(;a<e.length;){const s=e[a];if(i){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[a+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[a-1][1].type==="tableDelimiterMarker"){const c=r.length-1;r[c]=r[c]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(i=!0);a+=1}return r}function IL(){return{flow:{null:{name:"table",tokenize:PL,resolveAll:HL}}}}function PL(e,a,i){const r=this;let s=0,c=0,d;return f;function f(L){let P=r.events.length-1;for(;P>-1;){const{type:U}=r.events[P][1];if(U==="lineEnding"||U==="linePrefix")P--;else break}const q=P>-1?r.events[P][1].type:null,Z=q==="tableHead"||q==="tableRow"?R:h;return Z===R&&r.parser.lazy[r.now().line]?i(L):Z(L)}function h(L){return e.enter("tableHead"),e.enter("tableRow"),p(L)}function p(L){return L===124||(d=!0,c+=1),y(L)}function y(L){return L===null?i(L):Ze(L)?c>1?(c=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),j):i(L):mt(L)?wt(e,y,"whitespace")(L):(c+=1,d&&(d=!1,s+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),d=!0,y):(e.enter("data"),g(L)))}function g(L){return L===null||L===124||Pt(L)?(e.exit("data"),y(L)):(e.consume(L),L===92?b:g)}function b(L){return L===92||L===124?(e.consume(L),g):g(L)}function j(L){return r.interrupt=!1,r.parser.lazy[r.now().line]?i(L):(e.enter("tableDelimiterRow"),d=!1,mt(L)?wt(e,k,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):k(L))}function k(L){return L===45||L===58?N(L):L===124?(d=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),S):_(L)}function S(L){return mt(L)?wt(e,N,"whitespace")(L):N(L)}function N(L){return L===58?(c+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),E):L===45?(c+=1,E(L)):L===null||Ze(L)?A(L):_(L)}function E(L){return L===45?(e.enter("tableDelimiterFiller"),M(L)):_(L)}function M(L){return L===45?(e.consume(L),M):L===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(L))}function C(L){return mt(L)?wt(e,A,"whitespace")(L):A(L)}function A(L){return L===124?k(L):L===null||Ze(L)?!d||s!==c?_(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),a(L)):_(L)}function _(L){return i(L)}function R(L){return e.enter("tableRow"),I(L)}function I(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),I):L===null||Ze(L)?(e.exit("tableRow"),a(L)):mt(L)?wt(e,I,"whitespace")(L):(e.enter("data"),G(L))}function G(L){return L===null||L===124||Pt(L)?(e.exit("data"),I(L)):(e.consume(L),L===92?Y:G)}function Y(L){return L===92||L===124?(e.consume(L),G):G(L)}}function HL(e,a){let i=-1,r=!0,s=0,c=[0,0,0,0],d=[0,0,0,0],f=!1,h=0,p,y,g;const b=new zL;for(;++i<e.length;){const j=e[i],k=j[1];j[0]==="enter"?k.type==="tableHead"?(f=!1,h!==0&&(jb(b,a,h,p,y),y=void 0,h=0),p={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(i,0,[["enter",p,a]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(r=!0,g=void 0,c=[0,0,0,0],d=[0,i+1,0,0],f&&(f=!1,y={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(i,0,[["enter",y,a]])),s=k.type==="tableDelimiterRow"?2:y?3:1):s&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(r=!1,d[2]===0&&(c[1]!==0&&(d[0]=d[1],g=Nd(b,a,c,s,void 0,g),c=[0,0,0,0]),d[2]=i)):k.type==="tableCellDivider"&&(r?r=!1:(c[1]!==0&&(d[0]=d[1],g=Nd(b,a,c,s,void 0,g)),c=d,d=[c[1],i,0,0])):k.type==="tableHead"?(f=!0,h=i):k.type==="tableRow"||k.type==="tableDelimiterRow"?(h=i,c[1]!==0?(d[0]=d[1],g=Nd(b,a,c,s,i,g)):d[1]!==0&&(g=Nd(b,a,d,s,i,g)),s=0):s&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(d[3]=i)}for(h!==0&&jb(b,a,h,p,y),b.consume(a.events),i=-1;++i<a.events.length;){const j=a.events[i];j[0]==="enter"&&j[1].type==="table"&&(j[1]._align=BL(a.events,i))}return e}function Nd(e,a,i,r,s,c){const d=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",f="tableContent";i[0]!==0&&(c.end=Object.assign({},us(a.events,i[0])),e.add(i[0],0,[["exit",c,a]]));const h=us(a.events,i[1]);if(c={type:d,start:Object.assign({},h),end:Object.assign({},h)},e.add(i[1],0,[["enter",c,a]]),i[2]!==0){const p=us(a.events,i[2]),y=us(a.events,i[3]),g={type:f,start:Object.assign({},p),end:Object.assign({},y)};if(e.add(i[2],0,[["enter",g,a]]),r!==2){const b=a.events[i[2]],j=a.events[i[3]];if(b[1].end=Object.assign({},j[1].end),b[1].type="chunkText",b[1].contentType="text",i[3]>i[2]+1){const k=i[2]+1,S=i[3]-i[2]-1;e.add(k,S,[])}}e.add(i[3]+1,0,[["exit",g,a]])}return s!==void 0&&(c.end=Object.assign({},us(a.events,s)),e.add(s,0,[["exit",c,a]]),c=void 0),c}function jb(e,a,i,r,s){const c=[],d=us(a.events,i);s&&(s.end=Object.assign({},d),c.push(["exit",s,a])),r.end=Object.assign({},d),c.push(["exit",r,a]),e.add(i+1,0,c)}function us(e,a){const i=e[a],r=i[0]==="enter"?"start":"end";return i[1][r]}const qL={name:"tasklistCheck",tokenize:FL};function UL(){return{text:{91:qL}}}function FL(e,a,i){const r=this;return s;function s(h){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?i(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),c)}function c(h){return Pt(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),d):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),d):i(h)}function d(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):i(h)}function f(h){return Ze(h)?a(h):mt(h)?e.check({tokenize:VL},a,i)(h):i(h)}}function VL(e,a,i){return wt(e,r,"whitespace");function r(s){return s===null?i(s):a(s)}}function $L(e){return hk([gL(),NL(),DL(e),IL(),UL()])}const GL={};function YL(e){const a=this,i=e||GL,r=a.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),c=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),d=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push($L(i)),c.push(fL()),d.push(hL(i))}function ef(e){document.documentElement.dataset.theme=e,document.documentElement.classList.toggle("dark",e==="dark"),document.documentElement.style.colorScheme=e,localStorage.setItem("jarvy-theme",e)}const KL={add:xr,"chat-bubble":B7,window:l7,close:xs,"chevron-left":Gj,"chevron-right":ml,"chevron-down":cl,gear:K7,"person-add":i9,"arrow-bracket-to-left":z7,"arrow-up":c7,copy:Pc,check:ma,"cloud-download":O0,bell:d7,"bell-slash":u7,image:R7,paperclip:B0,"smiley-plus":x7,info:L0,people:r9,pencil:V7,file:S7,"file-video":w7,"file-audio":j7,folder:E7,"layout-sidebar-left":U7,sun:t9,moon:q7,"arrows-expand":y7,"arrows-contract":Z7,"arrow-u-up-right":Y7,"list-bullets":D7,eye:z0,"eye-slash":D0,pin:Fp,megaphone:L7,trash:Fd,search:ys,quote:G7,fold:N7,unfold:a9};function Ue({name:e}){const a=KL[e]??L0;return o.jsx(a,{className:"ui-icon","aria-hidden":"true",focusable:"false"})}function gt({icon:e,label:a,className:i="",...r}){return o.jsx("button",{type:"button",className:`ui-iconbtn ${i}`,"aria-label":a,title:a,...r,children:o.jsx(Ue,{name:e})})}function gs({title:e,onClose:a,children:i,className:r=""}){const s=w.useRef(null),c=w.useId();return w.useEffect(()=>{const d=s.current,f=document.activeElement;return d.showModal(),()=>{d.close(),f==null||f.focus({preventScroll:!0})}},[]),ho.createPortal(o.jsxs("dialog",{ref:s,className:`ui-small-dialog ${r}`,"aria-labelledby":c,onCancel:d=>{d.preventDefault(),a()},children:[o.jsx(gt,{icon:"close",label:x("ui.closeNamed",{name:e}),className:"ui-dialog-close",onClick:a}),o.jsxs("div",{className:"ui-dialog-body",children:[o.jsx("h1",{id:c,children:e}),i]})]}),document.body)}async function Ns(e){if(window.isSecureContext&&navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}const a=document.createElement("textarea");a.value=e,a.setAttribute("readonly",""),a.style.position="fixed",a.style.opacity="0",document.body.append(a),a.select();try{return document.execCommand("copy")}finally{a.remove()}}function XL({children:e}){const a=w.useRef(null),[i,r]=w.useState("idle");w.useEffect(()=>{if(i==="idle")return;const c=setTimeout(()=>r("idle"),1500);return()=>clearTimeout(c)},[i]);const s=async()=>{var c;return r(await Ns((((c=a.current)==null?void 0:c.textContent)??"").replace(/\n$/,""))?"copied":"failed")};return o.jsxs("figure",{className:"ui-code-figure",children:[o.jsx("pre",{ref:a,children:e}),o.jsx(gt,{icon:i==="copied"?"check":"copy",label:x(i==="copied"?"ui.copied":i==="failed"?"ui.copyFailed":"ui.copyCode"),onClick:()=>void s()})]})}const QL=[YL,HD,FD,zD],s5=w.createContext({});function ZL({href:e,children:a}){var r;const i=w.useContext(s5);return e==="#mention"||e==="#mention-me"?o.jsx("span",{className:"jv-mention","data-me":e==="#mention-me"||void 0,children:a}):i.quote&&(e!=null&&e.startsWith("#quote-"))?i.quote(Number(e.slice(7))):e!=null&&e.startsWith("#ref-")?((r=i.ref)==null?void 0:r.call(i,e.slice(5)))??o.jsx(o.Fragment,{children:a}):o.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:a})}const JL={a:ZL,img:({alt:e})=>o.jsx("span",{children:x("ui.image",{alt:e||x("ui.imageHidden")})}),pre:({children:e})=>o.jsx(XL,{children:e})},Kc=w.memo(function({text:a,renderQuote:i,renderRef:r}){return Aj(),o.jsx(s5.Provider,{value:{quote:i,ref:r},children:o.jsx(SD,{remarkPlugins:QL,skipHtml:!0,components:JL,children:a})})}),wb={agent_undeletable:"error.agentUndeletable",autoconfig_model:"error.autoconfigModel",autoconfig_source:"error.autoconfigSource",bot_missing:"error.botMissing",chat_access_changed:"error.chatAccessChanged",computer_failed:"error.computerFailed",computer_missing:"error.computerMissing",docker_unavailable:"error.dockerUnavailable",file_too_large:"error.fileTooLarge",connection_in_use:"error.connectionInUse",connection_missing:"error.connectionMissing",credential_changed:"error.credentialChanged",credential_unreadable:"error.credentialUnreadable",credential_scope:"error.credentialScope",credentials_missing:"error.credentialsMissing",data_locked:"error.dataLocked",discovery_format:"error.discoveryFormat",discovery_http:"error.discoveryHttp",discovery_key:"error.discoveryKey",discovery_protocol:"error.discoveryProtocol",discovery_url:"error.discoveryUrl",discovery_url_missing:"error.discoveryUrlMissing",discovery_unreachable:"error.discoveryUnreachable",machine_missing:"error.machineMissing",machine_name_taken:"error.machineNameTaken",ssh_auth_failed:"error.sshAuthFailed",ssh_bad_directory:"error.sshBadDirectory",ssh_bad_host:"error.sshBadHost",ssh_bad_port:"error.sshBadPort",ssh_bad_user:"error.sshBadUser",ssh_failed:"error.sshFailed",ssh_host_key_changed:"error.sshHostKeyChanged",ssh_key_unreadable:"error.sshKeyUnreadable",ssh_password_missing:"error.sshPasswordMissing",ssh_unreachable:"error.sshUnreachable",ssh_unsupported:"error.sshUnsupported",ssh_password_refused:"error.sshPasswordRefused",ssh_key_refused:"error.sshKeyRefused",ssh_key_expired:"error.sshKeyExpired",history_missing:"error.historyMissing",invalid_credential:"error.invalidCredential",invalid_run:"error.invalidRun",limits_invalid:"error.limitsInvalid",login_input:"error.loginInput",login_option:"error.loginOption",login_step:"error.loginStep",message_missing:"error.messageMissing",model_incomplete:"error.modelIncomplete",model_missing:"error.modelMissing",model_request_failed:"error.modelRequestFailed",model_required:"error.modelRequired",model_switch_uncertain:"error.modelSwitchUncertain",name_taken:"error.nameTaken",provider_name_taken:"error.providerNameTaken",reset_custom:"error.resetCustom",port_invalid:"error.portInvalid",port_missing:"error.portMissing",port_range_invalid:"error.portRangeInvalid",port_range_own:"error.portRangeOwn",ports_exhausted:"error.portsExhausted",question_closed:"error.questionClosed",question_expired:"error.questionExpired",secret_description_invalid:"error.secretDescriptionInvalid",secret_missing:"error.secretMissing",secret_name_invalid:"error.secretNameInvalid",secret_name_taken:"error.secretNameTaken",secret_value_missing:"error.secretValueMissing",secret_value_too_long:"error.secretValueTooLong",runtime_failed:"error.runtimeFailed",session_corrupt:"error.sessionCorrupt",session_mismatch:"error.sessionMismatch",session_missing:"error.sessionMissing",session_path:"error.sessionPath",stopping:"error.stopping",task_invalid:"error.taskInvalid",task_schedule_invalid:"error.taskScheduleInvalid",task_time_past:"error.taskTimePast",thinking_format:"error.thinkingFormat",tools_missing:"error.toolsMissing",unsafe_replay:"error.unsafeReplay",type_invalid:"error.typeInvalid",vm_size_invalid:"error.vmSizeInvalid",vm_unavailable:"error.vmUnavailable"},c5=(e,a)=>{const i=e&&Object.hasOwn(wb,e)?wb[e]:void 0;return i?x(i,a):null};function en(e,a="common.failed"){return e instanceof qi?c5(e.code,e.params)??(e.status<500?e.message:x(a)):e instanceof Error&&e.message?e.message:x(a)}const WL=e=>c5(e.errorCode,e.errorParams)??e.error??"";function eB({botId:e,selected:a,onSelect:i,onOpenChat:r}){const[s,c]=w.useState(null),[d,f]=w.useState(!0),[h,p]=w.useState(""),[y,g]=w.useState(0);if(w.useEffect(()=>{let k=!0;return f(!0),p(""),c(null),(a.kind==="history"?dM.read(e,a.id).then(N=>({kind:"history",data:N})):y4.message(e,a.id).then(N=>({kind:"chat",data:N}))).then(N=>{k&&c(N)}).catch(N=>{k&&p(en(N,"activity.detailFailed"))}).finally(()=>{k&&f(!1)}),()=>{k=!1}},[e,a.kind,a.id,y]),d)return o.jsx("p",{className:"jv-activity-state",role:"status",children:x("activity.detailLoading")});if(h)return o.jsxs("div",{className:"jv-activity-state",children:[o.jsx("p",{role:"alert",children:h}),o.jsx(Ne,{variant:"outline",size:"sm",onClick:()=>g(k=>k+1),children:x("common.retry")})]});if(!s)return null;if(s.kind==="history")return o.jsx(oM,{detail:s.data,onSelect:k=>i({kind:"history",id:k})},s.data.record.id);const{chat:b,message:j}=s.data;return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"jv-activity-message-head",children:[o.jsxs("div",{children:[o.jsx("h3",{children:b.title}),o.jsx("p",{children:bg(j.createdAt)})]}),o.jsxs(Ne,{variant:"ghost",size:"sm",onClick:()=>r(b.id),children:[x("activity.openChat"),o.jsx(qp,{})]})]}),o.jsxs("div",{className:"jv-activity-message-body",children:[j.content&&o.jsx(Kc,{text:j.content}),j.attachments.length>0&&o.jsx("div",{className:"jv-activity-message-files",children:j.attachments.map(k=>o.jsxs("a",{href:`/api/attachments/${k.id}`,download:k.name,children:[o.jsx(B0,{}),k.name]},k.id))}),j.source&&o.jsxs(Ne,{className:"jv-activity-message-source",variant:"outline",size:"sm",onClick:()=>i({kind:"history",id:j.source.historyId}),children:[x("activity.sentBy",{id:j.source.historyId}),o.jsx(qp,{})]})]})]})}function tB({botId:e,onOpenChat:a}){const[i,r]=w.useState([void 0]),s=i.at(-1),[c,d]=w.useState({items:[],nextBefore:null}),[f,h]=w.useState(!0),[p,y]=w.useState(""),[g,b]=w.useState(0),[j,k]=w.useState(null),S=w.useRef(null),N=w.useRef(0),E=w.useRef(null);w.useEffect(()=>{let A=!0;return h(!0),y(""),d({items:[],nextBefore:null}),S.current&&(S.current.scrollTop=0),y4.list(e,s).then(_=>{A&&d(_)}).catch(_=>{A&&y(en(_,"activity.loadFailed"))}).finally(()=>{A&&h(!1)}),()=>{A=!1}},[e,s,g]);const M=A=>{var _;j||(N.current=((_=S.current)==null?void 0:_.scrollTop)??0,E.current=document.activeElement),k(A)},C=()=>{k(null),requestAnimationFrame(()=>{var A;S.current&&(S.current.scrollTop=N.current),(A=E.current)==null||A.focus({preventScroll:!0})})};return o.jsxs("div",{className:"jv-activity",children:[o.jsxs("div",{className:"jv-activity-list",hidden:j!==null,children:[o.jsxs("div",{className:"jv-activity-toolbar",children:[o.jsx("span",{children:x("activity.newestFirst")}),o.jsxs(Ne,{type:"button",variant:"ghost",size:"sm",disabled:f,onClick:()=>{r([void 0]),b(A=>A+1)},"aria-label":x("activity.refresh"),children:[o.jsx(I0,{}),x(f?"activity.reading":"usage.refresh")]})]}),o.jsxs("div",{className:"jv-activity-columns","aria-hidden":"true",children:[o.jsx("span",{children:x("activity.columnChat")}),o.jsx("span",{children:x("activity.columnTime")}),o.jsx("span",{children:"History"})]}),o.jsx("div",{className:"jv-activity-scroll",ref:S,children:f?o.jsx("p",{className:"jv-activity-state",role:"status",children:x("activity.loading")}):p?o.jsxs("div",{className:"jv-activity-state",children:[o.jsx("p",{role:"alert",children:p}),o.jsx(Ne,{variant:"outline",size:"sm",onClick:()=>b(A=>A+1),children:x("common.retry")})]}):c.items.length?o.jsx(uM,{items:c.items,onSelect:M}):o.jsx("div",{className:"jv-activity-state jv-activity-empty",children:o.jsx("p",{children:x("activity.empty")})})}),o.jsxs("div",{className:"jv-activity-pagination",children:[o.jsxs(Ne,{type:"button",variant:"ghost",size:"sm",disabled:f||i.length===1,onClick:()=>r(A=>A.slice(0,-1)),children:[o.jsx(Gj,{}),x("activity.newer")]}),o.jsx("span",{children:x("activity.page",{page:i.length})}),o.jsxs(Ne,{type:"button",variant:"ghost",size:"sm",disabled:f||c.nextBefore===null,onClick:()=>r(A=>[...A,c.nextBefore]),children:[x("activity.older"),o.jsx(ml,{})]})]})]}),j&&o.jsxs("section",{className:"jv-activity-detail","aria-label":x(j.kind==="history"?"activity.historyDetail":"activity.chatDetail"),children:[o.jsx("div",{className:"jv-activity-toolbar",children:o.jsxs(Ne,{type:"button",variant:"ghost",size:"sm",onClick:C,children:[o.jsx(R0,{}),x("activity.backToTimeline")]})}),o.jsx(eB,{botId:e,selected:j,onSelect:M,onOpenChat:a})]})]})}const u5={list:(e,a)=>we(`/bots/${e}/usage?since=${a}`),overview:e=>we(`/usage?since=${e}`)},nB=["today","7d","30d","all"],aB=e=>e==="today"?x("usage.today"):e==="all"?x("usage.all"):x("usage.days",{count:e==="7d"?7:30}),Ed=[["calls","usage.calls"],["input","usage.input"],["output","usage.output"],["cacheRead","usage.cacheRead"],["cacheWrite","usage.cacheWrite"]];function iB(e){if(e==="all")return 0;const a=new Date;return a.setHours(0,0,0,0),a.setDate(a.getDate()-(e==="7d"?6:e==="30d"?29:0)),a.getTime()}const b0=e=>mi(e,e<1e4?void 0:{notation:"compact",maximumFractionDigits:1}),rB=e=>e>0&&e<.01?"< $0.01":`$${e.toFixed(2)}`,j0=e=>o.jsx("td",{"data-label":x("usage.cost"),className:e===null?"jv-usage-unpriced":void 0,title:e===null?void 0:`$${e.toFixed(4)}`,children:e===null?x("usage.unpriced"):rB(e)});function d5(e,a){const[i,r]=w.useState("today"),[s,c]=w.useState(null),[d,f]=w.useState(""),[h,p]=w.useState(0);return w.useEffect(()=>{let y=!0;return c(null),f(""),e(iB(i)).then(g=>{y&&c(g)}).catch(g=>{y&&f(en(g,"usage.loadFailed"))}),()=>{y=!1}},[a,i,h]),{range:i,setRange:r,data:s,error:d,reload:()=>p(y=>y+1)}}function f5({range:e,setRange:a,busy:i,reload:r}){return o.jsxs("div",{className:"jv-usage-toolbar",children:[o.jsx("div",{className:"jv-tabs",role:"tablist","aria-label":x("usage.range"),children:nB.map(s=>o.jsx("button",{type:"button",role:"tab","aria-selected":e===s,onClick:()=>a(s),children:aB(s)},s))}),o.jsxs(Ne,{type:"button",variant:"ghost",size:"sm",disabled:i,onClick:r,"aria-label":x("usage.refreshLabel"),children:[o.jsx(I0,{}),x("usage.refresh")]})]})}function h5({loading:e,error:a,empty:i,reload:r}){return a?o.jsxs("div",{className:"jv-usage-state",children:[o.jsx("p",{role:"alert",children:a}),o.jsx(Ne,{variant:"outline",size:"sm",onClick:r,children:x("usage.retry")})]}):e?o.jsx("p",{className:"jv-usage-state",role:"status",children:x("usage.loading")}):i?o.jsx("div",{className:"jv-usage-state jv-usage-empty",children:o.jsx("p",{children:x("usage.empty")})}):null}function m5({models:e,note:a=!0}){const i=e.filter(s=>s.cost!==null),r=Object.fromEntries(Ed.map(([s])=>[s,e.reduce((c,d)=>c+d[s],0)]));return o.jsxs(o.Fragment,{children:[o.jsxs("table",{className:"jv-usage-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"col",children:x("usage.model")}),Ed.map(([s,c])=>o.jsx("th",{scope:"col",children:x(c)},s)),o.jsx("th",{scope:"col",children:x("usage.cost")})]})}),o.jsx("tbody",{children:e.map(s=>o.jsxs("tr",{children:[o.jsx("th",{scope:"row",children:o.jsxs("span",{className:"jv-usage-model",children:[o.jsx("strong",{children:s.model}),o.jsx("span",{children:s.provider})]})}),Ed.map(([c,d])=>o.jsx("td",{"data-label":x(d),title:mi(s[c]),children:b0(s[c])},c)),j0(s.cost)]},`${s.provider}/${s.model}`))}),e.length>1&&o.jsx("tfoot",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"row",children:o.jsx("strong",{children:x("usage.total")})}),Ed.map(([s,c])=>o.jsx("td",{"data-label":x(c),title:mi(r[s]),children:b0(r[s])},s)),j0(i.length?i.reduce((s,c)=>s+c.cost,0):null)]})})]}),a&&i.length>0&&i.length<e.length&&o.jsx("p",{className:"jv-usage-note",children:x("usage.notePartial")})]})}function lB({botId:e}){const{range:a,setRange:i,data:r,error:s,reload:c}=d5(d=>u5.list(e,d).then(f=>f.models),e);return o.jsxs("div",{className:"jv-usage",children:[o.jsx(f5,{range:a,setRange:i,busy:!r&&!s,reload:c}),o.jsxs("div",{className:"jv-usage-scroll",children:[o.jsx(h5,{loading:!r,error:s,empty:!(r!=null&&r.length),reload:c}),r&&r.length>0&&!s&&o.jsx(m5,{models:r})]})]})}const ui={gray:{hex:9146265,label:"color.gray"},blue:{hex:2000636,label:"color.blue"},green:{hex:3129195,label:"color.green"},amber:{hex:16093970,label:"color.amber"},rose:{hex:15881087,label:"color.rose"},violet:{hex:9067766,label:"color.violet"}},p5=e=>{var a;return`#${(((a=ui[e])==null?void 0:a.hex)??ui.gray.hex).toString(16).padStart(6,"0")}`},oB={open:1,happy:0,eyeScale:1,kind:0,lid:0,lidTilt:0,smile:0,blush:0,mouth:0,mouthOpen:1,earL:.22,earR:.22,tilt:0,lift:0,squash:1,yaw:0,look:[0,0]},sB={body:.85,waist:.1,ears:1,earSize:1.1,earX:.3,earY:.26,earW:.16,earH:.32,earBlend:.03,earThick:.06,eyeGap:.205,eyeSize:1.22},kb={lit:.55,rim:.5},cB="attribute vec2 p; void main(){ gl_Position = vec4(p, 0., 1.); }",uB=`
593
+ precision highp float;
594
+ uniform vec2 uRes, uLook;
595
+ uniform vec3 uColor, uInk;
596
+ uniform float uSquash, uEarL, uEarR, uOpen, uHappy, uTilt, uLift, uZoom, uShadow, uYaw;
597
+ uniform float uEars, uEarSize, uBody, uEyeGap, uEyeSize, uWaist, uEarX, uEarY, uEarW, uEarH, uEarBlend;
598
+ uniform float uKind, uEyeScale, uLid, uLidTilt, uSmile, uBlush, uMouth, uMouthOpen, uEarThick;
599
+ uniform float uLit, uRim;
600
+
601
+ float smin(float a, float b, float k){ float h = max(k - abs(a - b), 0.) / k; return min(a, b) - h * h * k * .25; }
602
+ float sdEllipsoid(vec3 p, vec3 r){ float k0 = length(p / r), k1 = length(p / (r * r)); return k0 * (k0 - 1.) / k1; }
603
+ float sdTri(vec2 p, vec2 q){
604
+ p.x = abs(p.x);
605
+ vec2 a = p - q * clamp(dot(p, q) / dot(q, q), 0., 1.);
606
+ vec2 b = p - q * vec2(clamp(p.x / q.x, 0., 1.), 1.);
607
+ float s = -sign(q.y);
608
+ vec2 d = min(vec2(dot(a, a), s * (p.x * q.y - p.y * q.x)), vec2(dot(b, b), s * (p.y - q.y)));
609
+ return -sqrt(d.x) * sign(d.y);
610
+ }
611
+ float sdPill(vec2 q, float a, float r){ return length(vec2(q.x, q.y - clamp(q.y, -a, a))) - r; }
612
+ float sdSeg(vec2 p, vec2 a, vec2 b){ vec2 pa = p - a, ba = b - a; float h = clamp(dot(pa, ba) / dot(ba, ba), 0., 1.); return length(pa - ba * h); }
613
+ float sdStar5(vec2 p, float r, float rf){
614
+ const vec2 k1 = vec2(.809016994375, -.587785252292);
615
+ const vec2 k2 = vec2(-k1.x, k1.y);
616
+ p.x = abs(p.x);
617
+ p -= 2. * max(dot(k1, p), 0.) * k1; p -= 2. * max(dot(k2, p), 0.) * k2;
618
+ p.x = abs(p.x); p.y -= r;
619
+ vec2 ba = rf * vec2(-k1.y, k1.x) - vec2(0., 1.);
620
+ float h = clamp(dot(p, ba) / dot(ba, ba), 0., r);
621
+ return length(p - ba * h) * sign(p.y * ba.x - p.x * ba.y);
622
+ }
623
+ mat2 rot(float a){ float c = cos(a), s = sin(a); return mat2(c, -s, s, c); }
624
+ float fill(float d){ return 1. - smoothstep(-.0035, .0035, d); }
625
+
626
+ // An ear: a fin standing on the head, thick down the middle and thin at both edges, thinner toward the tip — so from the
627
+ // side it is a pointed rhombus, not a slab. Melted in at the base, so it grows out of the ball instead of sitting on it.
628
+ float sdEar(vec3 q, float ang){
629
+ q.xy = rot(ang) * q.xy;
630
+ float h = uEarH * uEarSize, w = uEarW * uEarSize, round_ = .030 * uEarSize;
631
+ float d2 = sdTri(q.xy - vec2(0., h), vec2(w, -h));
632
+ float up = clamp((q.y + h * .05) / (h * 1.45), 0., 1.), across = clamp(abs(q.x) / w, 0., 1.);
633
+ float half_ = uEarThick * uEarSize * (1. - .45 * up) * (1. - .55 * across * across);
634
+ vec2 e = vec2(d2, abs(q.z) - half_);
635
+ return min(max(e.x, e.y), 0.) + length(max(e, 0.)) - round_;
636
+ }
637
+
638
+ // Down to body space: lifted, tilted about the bottom edge, then squashed at a constant volume, so a squat ball widens.
639
+ vec3 toBody(vec3 p){
640
+ p.y -= uLift;
641
+ p.xz = rot(uYaw) * p.xz;
642
+ float floorY = -.58 * uBody;
643
+ p.y -= floorY; p.xy = rot(uTilt) * p.xy; p.y += floorY;
644
+ float widen = 1. / sqrt(max(uSquash, .55));
645
+ p.x *= widen; p.z *= widen; p.y = (p.y - floorY) * uSquash + floorY;
646
+ return p;
647
+ }
648
+ float map(vec3 p){
649
+ vec3 b = toBody(p);
650
+ vec3 bp = b;
651
+ bp.x /= (1. + uWaist * clamp(-b.y, 0., 1.));
652
+ float d = sdEllipsoid(bp, vec3(.58, .58 * uBody, .55));
653
+ if (uEars > .5){
654
+ float el = sdEar(bp - vec3(-uEarX, uEarY, -.01), uEarL);
655
+ float er = sdEar(bp - vec3(uEarX, uEarY, -.01), -uEarR);
656
+ d = smin(d, min(el, er), uEarBlend);
657
+ }
658
+ return d;
659
+ }
660
+ vec3 normal(vec3 p){ vec2 e = vec2(.0015, 0.); return normalize(vec3(map(p + e.xyy) - map(p - e.xyy), map(p + e.yxy) - map(p - e.yxy), map(p + e.yyx) - map(p - e.yyx))); }
661
+ float ao(vec3 p, vec3 n){ float o = 0., s = 1.; for (int i = 1; i <= 5; i++){ float h = .02 + .05 * float(i); o += (h - map(p + n * h)) * s; s *= .7; } return clamp(1. - 1.5 * o, 0., 1.); }
662
+
663
+ // One eye. 0 pill (with lids, or a smile arc), 1 squeezed chevron, 2 star, 3 spiral, 4 closed in content.
664
+ float eye(vec2 q, float side){
665
+ q /= uEyeScale;
666
+ float open = max(uOpen, .10), H = .105 * open, d;
667
+ if (uKind < .5){
668
+ float dPill = sdPill(vec2(q.x, q.y / open), .055, .05) * min(open, 1.);
669
+ // Lids: the top cut slants (inner corner low = cross, high = worried); the bottom cut is a curve (a smiling eye).
670
+ dPill = max(dPill, q.y - (H - 2. * H * uLid + uLidTilt * side * q.x));
671
+ vec2 c = vec2(0., -H - .10 + uSmile * .14);
672
+ dPill = max(dPill, -(length(q - c) - .10));
673
+ vec2 qa = q - vec2(0., -.04);
674
+ float dArc = max(abs(length(qa) - .062 * uEyeSize) - .019, -qa.y + .004);
675
+ d = mix(dPill * uEyeSize, dArc, uHappy);
676
+ } else if (uKind < 1.5){
677
+ vec2 tip = vec2(-side * .045, 0.);
678
+ d = min(sdSeg(q, tip, vec2(side * .04, .062)), sdSeg(q, tip, vec2(side * .04, -.062))) - .02;
679
+ } else if (uKind < 2.5){
680
+ d = sdStar5(q * rot(side * .12), .092, .48) - .012;
681
+ } else if (uKind < 3.5){
682
+ float r = length(q), a = atan(q.y, q.x) * side, k = .036;
683
+ d = max(abs(fract(r / k - a / 6.2831853) - .5) * k - .0095, r - .088);
684
+ } else {
685
+ vec2 qa = q - vec2(0., .035);
686
+ d = max(abs(length(qa) - .062 * uEyeSize) - .019, qa.y + .004);
687
+ }
688
+ return d * uEyeScale;
689
+ }
690
+
691
+ // Every mouth is a white line, the same pen as the eyes: no filled cavity, no tongue.
692
+ // 1 cat ω, 2 a smile, 3 an O (a yawn), 4 a short line, 5 wavy (a wry face), 6 a frown
693
+ float mouth(vec2 q){
694
+ if (uMouth < .5) return 0.;
695
+ float w = .0145, d = 1.;
696
+ if (uMouth < 1.5){
697
+ float r = .034;
698
+ float a = max(abs(length(q - vec2(-r, .012)) - r) - w, q.y - .012);
699
+ float b = max(abs(length(q - vec2(r, .012)) - r) - w, q.y - .012);
700
+ d = min(a, b);
701
+ } else if (uMouth < 2.5){
702
+ vec2 c = vec2(0., .048 * uMouthOpen);
703
+ float R = .062 * uMouthOpen;
704
+ d = max(abs(length(q - c) - R) - w, max(q.y - c.y + .004, abs(q.x) - R * .92));
705
+ } else if (uMouth < 3.5){
706
+ d = abs(length(q / vec2(.060, .080 * uMouthOpen)) - 1.) * .060 - .018;
707
+ } else if (uMouth < 4.5){
708
+ d = sdSeg(q, vec2(-.032, 0.), vec2(.032, 0.)) - w;
709
+ } else if (uMouth < 5.5){
710
+ d = max(abs(q.y - .011 * sin(q.x * 95.)) - .0125, abs(q.x) - .05);
711
+ } else {
712
+ d = max(abs(length(q - vec2(0., -.05)) - .05) - w, -(q.y + .022));
713
+ }
714
+ return fill(d);
715
+ }
716
+
717
+ // The face is painted on the ball's surface, so it sits on the curve rather than floating in front of it.
718
+ vec3 paintFace(vec3 b, vec3 base){
719
+ if (b.z < 0.) return base;
720
+ float ink = 0., blush = 0.;
721
+ for (int i = 0; i < 2; i++){
722
+ float side = i == 0 ? -1. : 1.;
723
+ vec2 q = b.xy - (vec2(side * uEyeGap, .01) + uLook);
724
+ ink = max(ink, fill(eye(q, side)));
725
+ vec2 qb = (b.xy - vec2(side * (uEyeGap + .092), .01 - .142) - uLook * .4) / vec2(.080, .050);
726
+ blush = max(blush, 1. - smoothstep(.75, 1.02, length(qb)));
727
+ }
728
+ base = mix(base, mix(uColor, vec3(1., .56, .72), .86), blush * uBlush);
729
+ base = mix(base, uInk, max(ink, mouth(b.xy - vec2(uLook.x * .7, .01 - .215 + uLook.y * .5))));
730
+ return base;
731
+ }
732
+
733
+ void main(){
734
+ vec2 uv = (gl_FragCoord.xy - .5 * uRes) / uRes.y;
735
+ vec3 ro = vec3(0., .30, 3.4), ta = vec3(0., -.02, 0.);
736
+ vec3 ww = normalize(ta - ro), uu = normalize(cross(ww, vec3(0., 1., 0.))), vv = cross(uu, ww);
737
+ vec3 rd = normalize(uv.x * uu + uv.y * vv + 2.45 * uZoom * ww);
738
+ float t = 0., near = 9.; bool hit = false;
739
+ for (int i = 0; i < 110; i++){
740
+ float d = map(ro + rd * t);
741
+ near = min(near, d);
742
+ if (d < .0008){ hit = true; break; }
743
+ t += d * .8; if (t > 6.) break;
744
+ }
745
+ vec4 col = vec4(0.);
746
+ float tf = (-.585 - ro.y) / rd.y;
747
+ if (tf > 0. && uShadow > 0.){
748
+ vec3 g = ro + rd * tf;
749
+ float s = exp(-pow(length(vec2(g.x / .95, g.z / .8)) / .58, 2.) * 2.0);
750
+ col = vec4(0., 0., 0., .20 * s * uShadow);
751
+ }
752
+ if (hit){
753
+ vec3 p = ro + rd * t, n = normal(p);
754
+ vec3 L = normalize(vec3(-.5, .8, .75));
755
+ // One solid colour, deepened toward the bottom edge and in the hollows, then a soft light from the upper left and a
756
+ // rim that catches the far edge — with the outline, that is what makes a flat colour read as a round body.
757
+ vec3 base = uColor * mix(.94, 1., smoothstep(-.62, .30, p.y)) * mix(.90, 1., ao(p, n));
758
+ float lam = clamp((dot(n, L) + .45) / 1.45, 0., 1.);
759
+ vec3 soft = uColor * mix(vec3(.80, .83, .93), vec3(1.), smoothstep(.08, .86, lam)) * mix(.88, 1., ao(p, n));
760
+ base = mix(base, soft, uLit);
761
+ base += uColor * uRim * pow(1. - max(dot(n, -rd), 0.), 3.2) * .55;
762
+ base = paintFace(toBody(p), base);
763
+ // The crease where the ears meet the head turns edge-on when the head turns, and takes the outline with it.
764
+ base = mix(base, uColor * vec3(.55, .57, .65), (1. - smoothstep(.10, .17, max(dot(n, -rd), 0.))) * .85);
765
+ col = vec4(base, 1.);
766
+ }
767
+ if (!hit && near < 9.){
768
+ // The outline is a band of even width just outside the silhouette, so it does not vanish where the surface turns away
769
+ // fast; a near miss inside the band paints the line over the shadow. Its width is a fixed share of the picture, so
770
+ // the DM figure gets a clear edge and a 22 px avatar a hairline, as in the design study.
771
+ float w = .003 * t;
772
+ float edge = 1. - smoothstep(w * .55, w, near);
773
+ if (edge > 0.) col = vec4(mix(col.rgb, uColor * vec3(.55, .57, .65), edge), max(col.a, edge));
774
+ }
775
+ gl_FragColor = vec4(col.rgb * col.a, col.a);
776
+ }`;function g5(e,a){const i=2.45*a/3.4,r=.92,s=r/e.squash;return{x:.5-s*Math.sin(e.tilt)*i,y:.5-.39*a/.92-(s*Math.cos(e.tilt)+e.lift-r)*i,scale:a/.92,angle:-e.tilt}}const Sb=e=>[(e>>16&255)/255,(e>>8&255)/255,(e&255)/255],dB=256;function v5(){const e=document.createElement("canvas"),a=e.getContext("webgl",{premultipliedAlpha:!0,preserveDrawingBuffer:!0,antialias:!1});if(!a)return;const i=(p,y)=>{const g=a.createShader(p);if(a.shaderSource(g,y),a.compileShader(g),!a.getShaderParameter(g,a.COMPILE_STATUS))throw new Error(a.getShaderInfoLog(g)??"shader");return g},r=a.createProgram();a.attachShader(r,i(a.VERTEX_SHADER,cB)),a.attachShader(r,i(a.FRAGMENT_SHADER,uB)),a.linkProgram(r),a.useProgram(r),a.bindBuffer(a.ARRAY_BUFFER,a.createBuffer()),a.bufferData(a.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),a.STATIC_DRAW);const s=a.getAttribLocation(r,"p");a.enableVertexAttribArray(s),a.vertexAttribPointer(s,2,a.FLOAT,!1,0,0);const c=p=>a.getUniformLocation(r,p),d=Sb(16777215),f=[document.createElement("canvas"),document.createElement("canvas")],h=(p,y,g,b,j)=>{e.width!==p&&(e.width=e.height=p),a.viewport(0,0,p,p),a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT),a.uniform2f(c("uRes"),p,p),a.uniform3fv(c("uColor"),Sb(y)),a.uniform3fv(c("uInk"),d),a.uniform2fv(c("uLook"),g.look);for(const[k,S]of[["uSquash",g.squash],["uEarL",g.earL],["uEarR",g.earR],["uOpen",g.open],["uHappy",g.happy],["uTilt",g.tilt],["uLift",g.lift],["uKind",g.kind],["uEyeScale",g.eyeScale],["uLid",g.lid],["uLidTilt",g.lidTilt],["uSmile",g.smile],["uBlush",g.blush],["uMouth",g.mouth],["uMouthOpen",g.mouthOpen],["uYaw",-g.yaw]])a.uniform1f(c(k),S);for(const[k,S]of Object.entries(sB))a.uniform1f(c("u"+k[0].toUpperCase()+k.slice(1)),S);a.uniform1f(c("uZoom"),j),a.uniform1f(c("uShadow"),b?1:0),a.uniform1f(c("uLit"),kb.lit),a.uniform1f(c("uRim"),kb.rim),a.drawArrays(a.TRIANGLES,0,3)};return{paint(p,y,g,b,{shadow:j=!0,zoom:k=.9}={}){let S=y*2;for(;S<dB;)S*=2;h(S,g,b,j,k);let N=e;for(let E=0;S>y*2;S/=2,E^=1){const M=f[E],C=M.getContext("2d");M.width!==S/2?M.width=M.height=S/2:C.clearRect(0,0,S/2,S/2),C.drawImage(N,0,0,S,S,0,0,S/2,S/2),N=M}p.drawImage(N,0,0,S,S,0,0,y,y)},dispose(){var p;(p=a.getExtension("WEBGL_lose_context"))==null||p.loseContext()}}}const fB={normal:{},happy:{happy:1,blush:1,earL:.16,earR:.16},sad:{lid:.28,lidTilt:-.62,look:[0,-.02],earL:.62,earR:.62,mouth:6,squash:.97},angry:{lid:.4,lidTilt:1.1,earL:.56,earR:.56,mouth:4,look:[0,-.01]},dizzy:{kind:3,mouth:5,tilt:.08,earL:.1,earR:.46}},y5=e=>({...oB,...fB[e]}),hB=40,Cp=new Map;let Td;function x5(e,a,i){const r=a/100;e.save(),e.translate(i.x*a,i.y*a),e.rotate(i.angle),e.scale(i.scale,i.scale),e.fillStyle="#f2b830",e.strokeStyle="#c98d12",e.lineWidth=1.6*r,e.lineJoin="round",e.beginPath(),e.moveTo(-13*r,6*r),e.lineTo(-13*r,-2*r),e.lineTo(-6*r,3*r),e.lineTo(0,-7*r),e.lineTo(6*r,3*r),e.lineTo(13*r,-2*r),e.lineTo(13*r,6*r),e.closePath(),e.fill(),e.stroke(),e.fillStyle="#fff6dc";for(const[s,c]of[[-13,-2],[0,-7],[13,-2]])e.beginPath(),e.arc(s*r,c*r,2.2*r,0,Math.PI*2),e.fill();e.restore()}function mB(e,a,i,r,s){var y;if(Td===void 0){const g=v5();Td=g?{figure:g,out:document.createElement("canvas")}:null}if(!Td)return"";const{figure:c,out:d}=Td,f=y5(a),h=r?.92:.9;d.width=d.height=i;const p=d.getContext("2d");return p?(c.paint(p,i,((y=ui[e])==null?void 0:y.hex)??ui.gray.hex,f,{shadow:r,zoom:h}),s&&x5(p,i,g5(f,h)),d.toDataURL("image/png")):""}function pB(e,a,i,r,s=!1){const c=Math.round(i*Math.min(3,Math.max(1,r))),d=i>=hB,f=s&&d,h=`${e}:${a}:${c}:${f}`;let p=Cp.get(h);return p||(p=Promise.resolve().then(()=>mB(e,a,c,d,f)),Cp.set(h,p),p.catch(()=>Cp.delete(h))),p}function gB(e){let a;const i=()=>{e(),r()},r=()=>{a=matchMedia(`(resolution: ${devicePixelRatio}dppx)`),a.addEventListener("change",i,{once:!0})};return r(),()=>a==null?void 0:a.removeEventListener("change",i)}function hl({color:e,mood:a="normal",size:i=36,badge:r,crown:s=!1}){const[c,d]=w.useState(),f=w.useSyncExternalStore(gB,()=>devicePixelRatio||1);return w.useEffect(()=>{let h=!0;return pB(e,a,i,f,s).then(p=>{h&&d(p)}).catch(()=>{}),()=>{h=!1}},[e,a,i,f,s]),o.jsxs("span",{className:"jv-bot-avatar",style:{"--jv-avatar-size":`${i}px`,"--jv-avatar-color":p5(e)},"aria-hidden":"true",children:[c?o.jsx("img",{src:c,alt:""}):o.jsx("span",{className:"jv-bot-avatar-tile"}),r==="working"&&o.jsxs("span",{className:"jv-typing",title:x("avatar.working"),children:[o.jsx("i",{}),o.jsx("i",{}),o.jsx("i",{})]}),r==="asking"&&o.jsx("span",{className:"jv-typing jv-asking",title:x("activity.asking"),children:"?"})]})}const b5=hE;function j5({className:e,children:a,showCloseButton:i=!0,...r}){return o.jsxs(pE,{children:[o.jsx(gE,{"data-slot":"dialog-overlay",className:"fixed inset-0 z-[80] bg-black/50"}),o.jsxs(xE,{"data-slot":"dialog-content",className:bn("fixed top-1/2 left-1/2 z-[81] flex max-h-[calc(100dvh-24px)] w-[min(720px,calc(100vw-24px))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border bg-background text-foreground shadow-lg outline-none",e),...r,children:[a,i&&o.jsx(CE,{className:"absolute top-4 right-4 rounded-sm p-1 text-muted-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring","aria-label":x("common.close"),children:o.jsx(xs,{className:"size-4"})})]})]})}function w5({className:e,...a}){return o.jsx(kE,{"data-slot":"dialog-title",className:bn("text-lg font-semibold",e),...a})}const vB={running:"activity.running",idle:"activity.idle",stop:"activity.stopped"};function yB({bot:e,status:a,onSaved:i}){const[r,s]=w.useState(null),[c,d]=w.useState(!1),[f,h]=w.useState(""),p=(a==null?void 0:a.status)??"stop";async function y(b){s(b),h("");try{await he.controlBot(e.id,b)}catch(j){h(en(j,"common.failed"))}finally{s(null)}}async function g(b){if(b!==e.color){d(!0),h("");try{i(await he.setBotColor(e.id,b))}catch(j){h(en(j,"bot.changeFailed"))}finally{d(!1)}}}return o.jsxs("header",{className:"jv-bot-head",children:[o.jsx(hl,{color:e.color,mood:e.mood,size:56,crown:e.agent}),o.jsxs("div",{className:"jv-bot-identity",children:[o.jsx(w5,{children:e.name}),e.description&&o.jsx("span",{children:e.description}),o.jsx("div",{className:"jv-bot-colors",role:"radiogroup","aria-label":x("bot.color"),children:Object.keys(ui).map(b=>o.jsx("button",{type:"button",role:"radio","aria-checked":e.color===b,"aria-label":x(ui[b].label),title:x(ui[b].label),disabled:c,style:{background:p5(b)},onClick:()=>void g(b)},b))})]}),o.jsxs("div",{className:"jv-bot-run",children:[o.jsx("span",{className:"jv-status","data-ok":p!=="stop"||void 0,"data-busy":p==="running"||void 0,children:x(vB[p])}),p==="running"&&o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",disabled:!!r,onClick:()=>void y("abort"),children:x(r==="abort"?"bot.aborting":"bot.abort")}),o.jsx(Ne,{type:"button",variant:"outline",size:"sm",disabled:!!r||!e.connectionId,onClick:()=>void y(p==="stop"?"start":"stop"),children:x(r==="start"?"bot.starting":r==="stop"?"bot.stopping":p==="stop"?"bot.start":"bot.stop")})]}),f&&o.jsx("p",{className:"jv-note-error jv-bot-head-error",role:"alert",children:f})]})}const pr=DA,gr=IA;function vr({className:e,children:a,...i}){return o.jsxs(LA,{"data-slot":"select-trigger",className:bn("flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-background px-3 text-sm outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50",e),...i,children:[a,o.jsx(PA,{asChild:!0,children:o.jsx(cl,{className:"size-4 opacity-50"})})]})}function yr({className:e,children:a,container:i,...r}){return o.jsx(FA,{container:i??void 0,children:o.jsx(VA,{"data-slot":"select-content",position:"popper",sideOffset:5,className:bn("z-[100] max-h-[min(300px,70dvh)] min-w-[var(--radix-select-trigger-width)] overflow-hidden rounded-md border bg-popover bg-background p-1 text-foreground shadow-md",e),...r,children:o.jsx(ZA,{children:a})})})}function fa({className:e,children:a,...i}){return o.jsxs(eM,{"data-slot":"select-item",className:bn("relative flex cursor-default items-center rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:opacity-50",e),...i,children:[o.jsx(tM,{children:a}),o.jsx(aM,{"data-slot":"select-indicator",className:"absolute right-2",children:o.jsx(ma,{className:"size-4"})})]})}function xn(){const[e,a]=w.useState(null),[i,r]=w.useState(""),s=w.useCallback(async(c,d,f)=>{a(c),r("");try{return await d(),!0}catch(h){return r(en(h,f)),!1}finally{a(null)}},[]);return{busy:e!==null,doing:e,error:i,setError:r,run:s}}const Cb={auto:"botModel.auto",off:"botModel.off",minimal:"botModel.minimal",low:"botModel.low",medium:"botModel.medium",high:"botModel.high",xhigh:"botModel.xhigh",max:"botModel.max"},xB=(e,a)=>JSON.stringify([e,a]);function k5({bot:e,connections:a,onSaved:i,onManage:r}){const[s,c]=w.useState([]),[d,f]=w.useState(!0),[h,p]=w.useState(""),[y,g]=w.useState(0),{busy:b,error:j,run:k}=xn(),[S,N]=w.useState(!1),[E,M]=w.useState(""),[C,A]=w.useState(-1),_=w.useRef(null),R=w.useRef(null),[I,G]=w.useState(null),Y=w.useId();w.useEffect(()=>{let ne=!0;return f(!0),p(""),he.modelOptions().then(D=>{ne&&c(D.connections)}).catch(D=>{ne&&p(en(D,"botModel.loadFailed"))}).finally(()=>{ne&&f(!1)}),()=>{ne=!1}},[a,y]);const L=s.flatMap(ne=>ne.models.map(D=>({...D,connectionId:ne.id,connectionName:ne.name,key:xB(ne.id,D.id)}))).sort((ne,D)=>ne.name.localeCompare(D.name,void 0,{numeric:!0})),P=L.find(ne=>ne.connectionId===e.connectionId&&ne.id===e.modelId),q=a.find(ne=>ne.id===e.connectionId),Z=q==null?void 0:q.models.find(ne=>ne.id===e.modelId),U=L.filter(ne=>`${ne.name} ${ne.id} ${ne.connectionName}`.toLocaleLowerCase().includes(E.trim().toLocaleLowerCase())),F=s.map(ne=>({...ne,models:U.filter(D=>D.connectionId===ne.id)})).filter(ne=>ne.models.length),X=F.flatMap(ne=>ne.models),$=L.length>8,H=e.thinkingLevel==="auto"?`auto${e.effectiveThinkingLevel?` · ${e.effectiveThinkingLevel}`:""}`:e.effectiveThinkingLevel??e.thinkingLevel;function ie(ne){N(ne),M(""),A(-1)}async function O(ne,D,B){ie(!1),await k("choose",async()=>i(await he.selectBotModel(e.id,ne,D,B,ol())),"botModel.switchFailed")}function le(ne){var D;if(ne.key==="ArrowDown"||ne.key==="ArrowUp"){ne.preventDefault();const B=ne.key==="ArrowDown"?Math.min(C+1,X.length-1):Math.max(C-1,0);A(B),(D=document.getElementById(`${Y}-${B}`))==null||D.scrollIntoView({block:"nearest"})}else if(ne.key==="Enter"&&X[C]){ne.preventDefault();const B=X[C];O(B.connectionId,B.id,e.thinkingLevel)}}return o.jsxs("div",{className:"jv-bot-model jv-ui","aria-busy":b||d,ref:ne=>G((ne==null?void 0:ne.closest("[data-slot=dialog-content]"))??null),children:[o.jsxs("div",{className:"jv-bot-model-fields",children:[o.jsxs("div",{className:"jv-bot-model-field",children:[o.jsx("span",{className:"jv-field-label",children:x("usage.model")}),o.jsxs(sg,{open:S,onOpenChange:ie,children:[o.jsxs(cg,{className:"jv-model-trigger","aria-label":x("botModel.pick"),"aria-haspopup":"listbox",disabled:b||d||!!h,children:[o.jsx("span",{children:(P==null?void 0:P.name)??(Z==null?void 0:Z.name)??x(e.connectionId?"botModel.broken":"botModel.choose")}),b?o.jsx(Sw,{className:"animate-spin"}):o.jsx(cl,{})]}),o.jsx(ug,{container:I,children:o.jsxs(dg,{className:"jv-model-menu jv-ui",align:"start",sideOffset:6,collisionPadding:12,collisionBoundary:I,onOpenAutoFocus:ne=>{var D;ne.preventDefault(),(D=$?_.current:R.current)==null||D.focus()},onKeyDown:le,children:[$&&o.jsxs("div",{className:"jv-model-search",children:[o.jsx(ys,{}),o.jsx("input",{ref:_,role:"combobox","aria-label":x("botModel.filter"),"aria-expanded":"true","aria-controls":Y,"aria-activedescendant":C>=0?`${Y}-${C}`:void 0,placeholder:x("botModel.filterPlaceholder"),value:E,onChange:ne=>{M(ne.target.value),A(-1)},autoComplete:"off",spellCheck:!1})]}),o.jsxs("div",{ref:R,id:Y,role:"listbox","aria-label":x("botModel.list"),tabIndex:-1,"aria-activedescendant":C>=0?`${Y}-${C}`:void 0,className:"jv-model-options",children:[F.map(ne=>o.jsxs("div",{role:"group","aria-label":ne.name,children:[o.jsx("div",{className:"jv-model-group-label",children:ne.name}),ne.models.map(D=>{const B=X.indexOf(D),W=D.connectionId===e.connectionId&&D.id===e.modelId;return o.jsxs("button",{type:"button",role:"option",tabIndex:-1,id:`${Y}-${B}`,"aria-selected":W,"data-active":B===C||void 0,title:D.id,onClick:()=>void O(D.connectionId,D.id,e.thinkingLevel),children:[o.jsx("span",{className:"jv-option-check",children:W&&o.jsx(ma,{})}),o.jsx("span",{children:D.name})]},D.key)})]},ne.id)),!X.length&&o.jsx("p",{className:"jv-menu-empty",children:x(L.length?"botModel.noMatch":"botModel.none")})]}),o.jsx("button",{type:"button",className:"jv-menu-manage",onClick:()=>{ie(!1),r()},children:x("botModel.manage")})]})})]}),(P||q)&&o.jsx("span",{className:"jv-field-note",children:(P==null?void 0:P.connectionName)??(q==null?void 0:q.displayName)})]}),o.jsxs("div",{className:"jv-bot-model-field",children:[o.jsx("span",{className:"jv-field-label",children:x("botModel.thinking")}),o.jsxs(pr,{value:e.thinkingLevel==="auto"?"auto":e.effectiveThinkingLevel??e.thinkingLevel,disabled:b||d||!P||!!h,onValueChange:ne=>{e.connectionId&&O(e.connectionId,e.modelId,ne)},children:[o.jsx(vr,{className:"jv-thinking-trigger","aria-label":x("botModel.pickThinking"),children:o.jsx(gr,{children:H})}),o.jsx(yr,{className:"jv-select-menu jv-thinking-menu",align:"end",children:["auto",...(P==null?void 0:P.thinking.levels)??[]].map(ne=>{const D=P==null?void 0:P.thinkingLevelMap[ne],B=D&&D!==ne?D:ne;return o.jsx(fa,{value:ne,children:o.jsxs("span",{className:"jv-thinking-option",children:[o.jsxs("span",{children:[B,D&&D!==ne&&o.jsxs("small",{children:[" (",ne,")"]})]}),o.jsx("small",{children:Cb[ne]&&x(Cb[ne])})]})},ne)})})]})]})]}),d&&o.jsx("p",{className:"jv-field-note",role:"status",children:x("botModel.loading")}),b&&o.jsx("p",{className:"jv-field-note",role:"status",children:x("botModel.switching")}),h&&o.jsxs("p",{className:"jv-model-error",role:"alert",children:[h," ",o.jsx("button",{type:"button",onClick:()=>g(ne=>ne+1),children:x("common.retry")})]}),j&&o.jsx("p",{className:"jv-model-error",role:"alert",children:j})]})}function bB(){const[e,a]=w.useState(!1),i=r=>s=>{s.pointerType==="mouse"&&a(r)};return o.jsxs(sg,{open:e,onOpenChange:a,children:[o.jsx(cg,{className:"jv-context-stale",title:"","aria-label":x("bot.contextStale"),onPointerEnter:i(!0),onPointerLeave:i(!1),children:o.jsx(P0,{"aria-hidden":"true"})}),o.jsx(ug,{children:o.jsx(dg,{className:"jv-context-tip jv-ui",side:"top",align:"end",sideOffset:6,collisionPadding:12,onOpenAutoFocus:r=>r.preventDefault(),children:x("bot.contextStale")})})]})}function jB({bot:e,status:a,connections:i,chats:r,onSaved:s,onManageModels:c,onOpenSubscription:d}){const[f,h]=w.useState(!1),[p,y]=w.useState(null);w.useEffect(()=>{let b=!0;return he.botSubscriptions(e.id).then(j=>{b&&y(j.chats)}).catch(()=>{}),()=>{b=!1}},[e.id]),w.useEffect(()=>{if(!f)return;const b=setTimeout(()=>h(!1),1500);return()=>clearTimeout(b)},[f]);const g=a==null?void 0:a.context;return o.jsxs(o.Fragment,{children:[e.agent&&o.jsxs("section",{className:"jv-section","aria-label":x("agent.title"),children:[o.jsx("h3",{className:"jv-section-title",children:x("agent.title")}),o.jsxs("div",{className:"jv-panel jv-agent-about",children:[o.jsx("p",{children:x("agent.intro",{name:e.name})}),o.jsx("ul",{children:["agent.create","agent.model","agent.run","agent.delete"].map(b=>o.jsx("li",{children:x(b)},b))})]})]}),o.jsxs("section",{className:"jv-section","aria-label":x("usage.model"),children:[o.jsx("h3",{className:"jv-section-title",children:x("usage.model")}),o.jsxs("div",{className:"jv-panel",children:[o.jsx(k5,{bot:e,connections:i,onSaved:s,onManage:c}),g&&o.jsxs("div",{className:"jv-context",title:x("bot.contextHint"),children:[o.jsxs("div",{className:"jv-context-label",children:[o.jsx("span",{children:x("bot.context")}),o.jsxs("span",{"data-stale":g.stale&&g.tokens!==null||void 0,children:[g.stale&&g.tokens!==null&&o.jsx(bB,{}),g.tokens===null?x("bot.unknown"):x("bot.tokens",{used:mi(g.tokens),window:mi(g.contextWindow)})]})]}),g.tokens!==null&&o.jsx("div",{className:"jv-context-bar",children:o.jsx("span",{style:{width:`${Math.min(100,Math.max(1,g.tokens/g.contextWindow*100))}%`}})})]})]})]}),o.jsxs("section",{className:"jv-section","aria-label":x("bot.workspace"),children:[o.jsx("h3",{className:"jv-section-title",children:x("bot.workspace")}),o.jsx("div",{className:"jv-list",children:o.jsxs("div",{className:"jv-list-row jv-static-row",children:[o.jsx("span",{className:"jv-row-text",children:o.jsx("code",{title:e.workspacePath,children:e.workspacePath})}),o.jsx(Ne,{type:"button",variant:"ghost",size:"icon-sm","aria-label":x(f?"ui.copied":"bot.copyWorkspace"),onClick:()=>void Ns(e.workspacePath).then(b=>h(b)),children:f?o.jsx(ma,{}):o.jsx(Pc,{})})]})})]}),p&&o.jsxs("section",{className:"jv-section","aria-label":x("bot.subscriptions"),children:[o.jsx("h3",{className:"jv-section-title",children:x("bot.subscriptions")}),o.jsx("div",{className:"jv-list",children:p.length===0?o.jsx("div",{className:"jv-list-row jv-static-row",children:o.jsx("span",{className:"jv-row-text",children:o.jsx("span",{children:x("bot.noSubscriptions")})})}):p.map(b=>{var j;return o.jsxs("button",{type:"button",className:"jv-list-row",onClick:()=>d(b),children:[o.jsx("span",{className:"jv-row-icon",children:b.type==="thread"?o.jsx(Ow,{}):o.jsx(M7,{})}),o.jsxs("span",{className:"jv-row-text",children:[o.jsx("strong",{children:b.title}),o.jsx("span",{children:b.type==="thread"?x("bot.threadIn",{channel:((j=r.find(k=>k.id===b.parentId))==null?void 0:j.title)??""}):x("info.menu")})]}),o.jsx(ml,{className:"jv-row-chevron"})]},b.id)})})]})]})}function xt({className:e,type:a,...i}){return o.jsx("input",{type:a,"data-slot":"input",className:bn("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e),...i})}function vs({className:e,...a}){return o.jsx("textarea",{"data-slot":"textarea",className:bn("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",e),...a})}function wB({bot:e,onSaved:a}){const[i,r]=w.useState(e.name),[s,c]=w.useState(e.description),[d,f]=w.useState(e.systemPrompt),[h,p]=w.useState(!1),[y,g]=w.useState(null),b=i!==e.name||s!==e.description||d!==e.systemPrompt;async function j(S){S.preventDefault(),p(!0),g(null);try{a(await he.saveBot(e.id,{name:i,description:s,systemPrompt:d})),g({kind:"ok",text:x("bot.saved")})}catch(N){g({kind:"error",text:en(N,"common.saveFailed")})}finally{p(!1)}}const k=(y==null?void 0:y.kind)==="error"||!b?y:null;return o.jsxs("form",{className:"jv-bot-profile",onSubmit:S=>void j(S),children:[o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:x("info.name")}),o.jsx(xt,{id:"jarvy-bot-name",required:!0,maxLength:80,value:i,onChange:S=>r(S.target.value)})]}),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:x("bot.description")}),o.jsx(vs,{id:"jarvy-bot-description",maxLength:1e3,rows:2,value:s,onChange:S=>c(S.target.value),placeholder:x("bot.descriptionPlaceholder")})]}),o.jsxs("label",{className:"jv-field jv-bot-persona",children:[o.jsx("span",{children:"Persona"}),o.jsx(vs,{id:"jarvy-bot-persona",maxLength:16e3,value:d,onChange:S=>f(S.target.value),placeholder:x("bot.personaPlaceholder")}),o.jsx("small",{className:"jv-hint",children:x("bot.personaHint")})]}),o.jsxs("div",{className:"jv-form-footer",children:[k?o.jsx("p",{className:k.kind==="error"?"jv-note-error":"jv-note-ok",role:k.kind==="error"?"alert":"status",children:k.text}):b?o.jsx("p",{className:"jv-hint",children:x("bot.unsaved")}):o.jsx("span",{}),o.jsx(Ne,{type:"submit",className:"jv-primary",disabled:h||!b,children:x(h?"bot.saving":"common.save")})]})]})}const no=2**30,kB=2**20,ro=(e,a=2)=>String(Number(e.toFixed(a))),Nb=e=>e<no?`${Math.round(e/kB)} MB`:`${ro(e/no,1)} GB`,SB=e=>`${e<10?ro(e,1):Math.round(e)}%`,CB=e=>e===1?x("environment.limits.oneCore"):x("environment.limits.cores",{count:ro(e)});function NB({memory:e,cpus:a}){if(e===null&&a===null)return x("environment.limits.none");const i=x("environment.limits.unlimited");return`${x("environment.limits.memory",{value:e===null?i:`${ro(e/no)} GB`})} · ${x("environment.limits.cpu",{value:a===null?i:CB(a)})}`}function EB({bot:e,onSaved:a}){const i=e.environment.computer,r=i.state==="running",s=i.type==="vm",c=s?{memory:1,cpus:1}:{memory:.25,cpus:.1},d=Y=>s?Y==="memory"?"4":"2":x("environment.limits.unlimited"),[f,h]=w.useState(null),[p,y]=w.useState(!1),[g,b]=w.useState(""),[j,k]=w.useState(""),{busy:S,error:N,setError:E,run:M}=xn();w.useEffect(()=>{let Y=!0;const L=()=>void he.computerResources(e.id).then(q=>{Y&&h(q)}).catch(()=>{});L();const P=r?setInterval(L,1e4):void 0;return()=>{Y=!1,clearInterval(P)}},[e.id,r]);const C=r?(f==null?void 0:f.usage)??null:null,A=(f==null?void 0:f.capacity)??null;function _(){b(i.limits.memory===null?"":ro(i.limits.memory/no)),k(i.limits.cpus===null?"":ro(i.limits.cpus)),E(""),y(!0)}const R={memory:g.trim()?Math.round(Number(g)*no):null,cpus:j.trim()?Number(j):null},I=!s&&C&&R.memory!==null&&R.memory<C.memory,G=Y=>{Y.preventDefault(),M("save",async()=>{a(await he.setComputerLimits(e.id,R)),y(!1)},"environment.limits.failed")};return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"jv-list-row jv-env-fact jv-env-limits","aria-expanded":p,onClick:()=>p?y(!1):_(),children:[o.jsx("span",{children:x(s?"environment.limits.vm":"environment.limits")}),o.jsx("span",{className:"jv-env-value",children:NB(i.limits)}),o.jsx(ml,{className:"jv-row-chevron"})]}),C&&!p&&o.jsxs("div",{className:"jv-list-row jv-static-row jv-env-fact",children:[o.jsx("span",{children:x("environment.usage")}),o.jsx("span",{className:"jv-env-value",children:x("environment.usage.value",{memory:Nb(C.memory),cpu:SB(C.cpu)})})]}),p&&o.jsx("div",{className:"jv-list-row jv-static-row jv-env-details",children:o.jsxs("form",{className:"jv-env-limits-form","aria-label":x(s?"environment.limits.vmEdit":"environment.limits.edit"),onSubmit:G,children:[o.jsxs("div",{className:"jv-env-limit-fields",children:[o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:x("environment.limits.memoryField")}),o.jsx(xt,{type:"number",inputMode:"decimal",min:c.memory,max:A?Number((A.memory/no).toFixed(2)):void 0,step:"any",placeholder:d("memory"),value:g,onChange:Y=>{b(Y.target.value),E("")}})]}),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:x("environment.limits.cpuField")}),o.jsx(xt,{type:"number",inputMode:"decimal",min:c.cpus,max:A==null?void 0:A.cpus,step:"any",placeholder:d("cpus"),value:j,onChange:Y=>{k(Y.target.value),E("")}})]})]}),A&&o.jsx("small",{className:"jv-hint",children:x("environment.limits.machine",{cpus:A.cpus,memory:ro(A.memory/no,1)})}),s&&o.jsx("small",{className:"jv-hint",children:x("environment.limits.vmDefault")}),s&&r&&o.jsx("small",{className:"jv-hint",children:x("environment.limits.vmLater")}),I&&o.jsx("p",{className:"jv-env-warn",role:"status",children:x("environment.limits.below",{usage:Nb(C.memory)})}),N&&o.jsx("p",{className:"jv-note-error",role:"alert",children:N}),o.jsxs("div",{className:"jv-env-confirm-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",onClick:()=>y(!1),children:x("common.cancel")}),o.jsx(Ne,{type:"submit",className:"jv-primary",size:"sm",disabled:S,children:x("common.save")})]})]})})]})}const TB=["container","vm"];function AB({bot:e,disabled:a,onSaved:i}){const r=e.environment.computer,[s,c]=w.useState(null),[d,f]=w.useState(null),{doing:h,error:p,run:y}=xn();w.useEffect(()=>{let k=!0;const S=E=>void E().then(M=>{k&&c(M)}).catch(()=>{});s||S(he.vmSupport);const N=(s==null?void 0:s.state)==="checking"||(s==null?void 0:s.state)==="unknown"?setTimeout(()=>S(he.vmSupport),2e3):void 0;return()=>{k=!1,clearTimeout(N)}},[s]);const g=r.type==="vm"||(s==null?void 0:s.state)==="available",b=(s==null?void 0:s.state)==="checking"||(s==null?void 0:s.state)==="unknown"?x("environment.type.checking"):(s==null?void 0:s.state)==="unavailable"&&r.type!=="vm"?x("environment.type.unavailable",{why:x(`environment.type.why.${s.reason??"failed"}`)}):null,j=k=>void y("switch",async()=>{i(await he.setComputerType(e.id,k)),f(null)},"common.failed");return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"jv-list-row jv-static-row jv-env-fact jv-env-type",children:[o.jsx("span",{children:x("environment.type")}),o.jsx("div",{className:"jv-seg",role:"radiogroup","aria-label":x("environment.type"),children:TB.map(k=>o.jsx("button",{type:"button",role:"radio","aria-checked":r.type===k,disabled:a||!!h||k==="vm"&&!g,onClick:()=>{k!==r.type&&f(k)},children:x(`environment.type.${k}`)},k))})]}),(b||d||p)&&o.jsxs("div",{className:"jv-list-row jv-static-row jv-env-details",children:[b&&!d&&o.jsxs("p",{className:"jv-env-type-note",children:[b,(s==null?void 0:s.state)==="unavailable"&&o.jsx(Ne,{type:"button",variant:"link",size:"sm",disabled:!!h,onClick:()=>void y("check",async()=>c(await he.checkVmSupport())),children:x("environment.type.recheck")})]}),d&&o.jsxs("div",{className:"jv-env-confirm",role:"group","aria-label":x(`environment.type.${d}Title`,{name:e.name}),children:[o.jsx("strong",{children:x(`environment.type.${d}Title`,{name:e.name})}),o.jsx("p",{children:x(`environment.type.${d}Body`)}),o.jsxs("div",{className:"jv-env-confirm-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",onClick:()=>f(null),children:x("common.cancel")}),o.jsx(Ne,{type:"button",className:"jv-primary",size:"sm",disabled:!!h,onClick:()=>j(d),children:x(h==="switch"?"environment.type.switching":"environment.type.confirm")})]})]}),p&&o.jsx("p",{className:"jv-note-error",role:"alert",children:p})]})]})}const MB={preparing:"environment.state.preparing",running:"environment.state.running",stopped:"environment.state.stopped",failed:"environment.state.failed",unavailable:"environment.state.unavailable"},_B=e=>e==="missing"||e==="stopped"||e==="denied"?e:"failed";function RB({bot:e,onSaved:a,onAddMachine:i}){const{doing:r,error:s,run:c}=xn(),[d,f]=w.useState(null),{computer:h,current:p,currentName:y,machines:g=[]}=e.environment,b=(E,M,C)=>c(E,async()=>a(await M()),C),j=E=>void b(E,()=>he.computer(e.id,E),"common.failed"),k=h==null?void 0:h.state,S=(h==null?void 0:h.type)==="vm",N=k?MB[k]:null;return o.jsxs("section",{className:"jv-section","aria-label":x("environment.title"),children:[o.jsx("h3",{className:"jv-section-title",children:x("environment.title")}),h&&k&&N&&o.jsxs("div",{className:"jv-list jv-env-sandbox",children:[o.jsxs("div",{className:"jv-list-row jv-static-row",children:[o.jsxs("span",{className:"jv-row-text",children:[o.jsx("strong",{children:x("environment.own")}),p==="ssh"&&o.jsx("span",{className:"jv-env-away",children:x("environment.awayMachine",{name:y??""})})]}),o.jsx("span",{className:"jv-status","data-ok":k==="running"||void 0,"data-busy":k==="preparing"||void 0,children:x(N)})]}),k!=="unavailable"&&o.jsx(AB,{bot:e,disabled:!!r||k==="preparing",onSaved:a}),o.jsxs("div",{className:"jv-list-row jv-static-row jv-env-fact",children:[o.jsx("span",{children:x("environment.container")}),o.jsx("code",{children:h.container})]}),o.jsxs("div",{className:"jv-list-row jv-static-row jv-env-fact",children:[o.jsx("span",{children:x("environment.image")}),o.jsx("code",{children:h.image})]}),o.jsxs("div",{className:"jv-list-row jv-static-row jv-env-fact",children:[o.jsx("span",{children:x("environment.mount")}),o.jsx("code",{children:h.mount})]}),k!=="unavailable"&&o.jsx(EB,{bot:e,onSaved:a}),o.jsxs("div",{className:"jv-list-row jv-static-row jv-env-details",children:[h.restartNeeded&&k==="running"&&!d&&o.jsx("p",{children:x("environment.restartNote")}),k==="unavailable"?o.jsx("p",{children:x("environment.unavailable",{why:x(`environment.unavailable.${_B(h.error)}`)})}):!d&&o.jsxs("div",{className:"jv-env-actions",children:[h.restartNeeded&&k==="running"&&o.jsx(Ne,{type:"button",className:"jv-primary",size:"sm",disabled:!!r,onClick:()=>f("restart"),children:x("environment.restart")}),o.jsx(Ne,{type:"button",variant:"outline",size:"sm",disabled:!!r||k==="preparing",onClick:()=>k==="running"?f("stop"):j("start"),children:x(r==="start"?"environment.starting":r==="stop"?"environment.stopping":k==="running"?"environment.stop":"environment.start")}),o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",disabled:!!r||k==="preparing",onClick:()=>f("reset"),children:x("environment.reset")})]}),d&&o.jsxs("div",{className:"jv-env-confirm",role:"group","aria-label":x(`environment.${d}Title`,{name:e.name}),children:[o.jsx("strong",{children:x(`environment.${d}Title`,{name:e.name})}),o.jsx("p",{children:x(d==="reset"&&S?"environment.resetBodyVm":`environment.${d}Body`)}),o.jsxs("div",{className:"jv-env-confirm-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",onClick:()=>f(null),children:x("common.cancel")}),o.jsx(Ne,{type:"button",className:"jv-primary",size:"sm",onClick:()=>{const E=d;f(null),j(E)},children:x(`environment.${d}Confirm`)})]})]})]})]}),o.jsx("h4",{className:"jv-env-heading",children:x("environment.external")}),o.jsxs("div",{className:"jv-list",role:"group","aria-label":x("environment.external"),children:[g.length===0&&o.jsxs("button",{type:"button",className:"jv-list-row jv-env-add",onClick:i,children:[o.jsx("span",{className:"jv-row-icon",children:o.jsx(xr,{})}),o.jsx("span",{className:"jv-row-text",children:o.jsx("strong",{children:x("machines.add")})})]}),g.map(E=>o.jsxs("button",{type:"button",role:"switch","aria-checked":E.granted,disabled:!!r,className:"jv-list-row jv-choice-row jv-env-access",onClick:()=>void b("grant",()=>he.grantBotMachine(e.id,E.id,!E.granted),"environment.accessFailed"),children:[o.jsx("span",{className:"jv-row-text",children:o.jsx("strong",{children:E.name})}),o.jsx("span",{className:"jv-env-switch","aria-hidden":"true"})]},E.id))]}),s&&o.jsx("p",{className:"jv-note-error",role:"alert",children:s})]})}const Eb=(e,a)=>sl(new Date(2e3,0,1,e,a)),S5=e=>na(new Date(2023,0,1+e),{weekday:"long"}),C5=e=>`${lf(e)} ${sl(e)}`;function OB(e){switch(e.kind){case"once":return x("tasks.schedule.once",{time:C5(e.at)});case"every":return e.minutes%60===0?x("tasks.schedule.hours",{count:e.minutes/60}):x("tasks.schedule.minutes",{count:e.minutes});case"daily":return x("tasks.schedule.daily",{time:Eb(e.hour,e.minute)});case"weekly":return x("tasks.schedule.weekly",{day:S5(e.weekday),time:Eb(e.hour,e.minute)})}}const ds=e=>String(e).padStart(2,"0"),Tb=e=>{const a=new Date(e);return`${a.getFullYear()}-${ds(a.getMonth()+1)}-${ds(a.getDate())}T${ds(a.getHours())}:${ds(a.getMinutes())}`},DB=(e,a)=>`${ds(e)}:${ds(a)}`,zB=["once","every","daily","weekly"],N5=5;function LB(e){const a=Date.now()+36e5,i={at:Tb(a-a%(300*1e3)),count:"30",unit:"minutes",time:"09:00",weekday:"1"};return e&&(e.kind==="once"&&(i.at=Tb(e.at)),e.kind==="every"&&Object.assign(i,e.minutes%60===0?{count:String(e.minutes/60),unit:"hours"}:{count:String(e.minutes),unit:"minutes"}),(e.kind==="daily"||e.kind==="weekly")&&(i.time=DB(e.hour,e.minute)),e.kind==="weekly"&&(i.weekday=String(e.weekday))),i}function BB(e,a){const[i,r]=a.time.split(":").map(Number),s=Number.isInteger(i)&&Number.isInteger(r)?{hour:i,minute:r}:null;if(e==="once"){const c=new Date(a.at).getTime();return Number.isFinite(c)?{kind:e,at:c}:null}if(e==="every"){const c=Number(a.count)*(a.unit==="hours"?60:1);return Number.isInteger(c)&&c>=N5?{kind:e,minutes:c}:null}return s?e==="daily"?{kind:e,...s}:{kind:e,weekday:Number(a.weekday),...s}:null}function IB({task:e,busy:a,error:i,onSave:r,onDelete:s,onCancel:c}){const[d,f]=w.useState((e==null?void 0:e.name)??""),[h,p]=w.useState((e==null?void 0:e.instruction)??""),[y,g]=w.useState((e==null?void 0:e.schedule.kind)??"daily"),[b,j]=w.useState(()=>LB(e==null?void 0:e.schedule)),[k,S]=w.useState(!1),N=BB(y,b),E=C=>j(A=>({...A,...C}));function M(C){C.preventDefault(),N&&d.trim()&&h.trim()&&r({name:d.trim(),instruction:h.trim(),schedule:N})}return o.jsxs("form",{className:"jv-panel jv-task-editor",onSubmit:M,"aria-label":x(e?"tasks.editTitle":"tasks.newTitle"),children:[o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:x("tasks.name")}),o.jsx(xt,{required:!0,maxLength:80,value:d,placeholder:x("tasks.namePlaceholder"),onChange:C=>f(C.target.value)})]}),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:x("tasks.instruction")}),o.jsx(vs,{required:!0,maxLength:8e3,rows:4,value:h,placeholder:x("tasks.instructionPlaceholder"),onChange:C=>p(C.target.value)})]}),o.jsxs("div",{className:"jv-field",children:[o.jsx("span",{children:x("tasks.when")}),o.jsx("div",{className:"jv-seg jv-task-kinds",role:"radiogroup","aria-label":x("tasks.when"),children:zB.map(C=>o.jsx("button",{type:"button",role:"radio","aria-checked":y===C,onClick:()=>g(C),children:x(`tasks.kind.${C}`)},C))}),o.jsxs("div",{className:"jv-task-when","data-kind":y,children:[y==="once"&&o.jsx(xt,{type:"datetime-local","aria-label":x("tasks.at"),value:b.at,onChange:C=>E({at:C.target.value})}),y==="every"&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"jv-task-label",children:x("tasks.everyCount")}),o.jsx(xt,{type:"number",min:b.unit==="hours"?1:N5,step:1,"aria-label":x("tasks.everyCount"),value:b.count,onChange:C=>E({count:C.target.value})}),o.jsxs(pr,{value:b.unit,onValueChange:C=>E({unit:C}),children:[o.jsx(vr,{"aria-label":x("tasks.everyCount"),children:o.jsx(gr,{})}),o.jsx(yr,{className:"jv-select-menu",children:["minutes","hours"].map(C=>o.jsx(fa,{value:C,children:x(`tasks.unit.${C}`)},C))})]})]}),y==="weekly"&&o.jsxs(pr,{value:b.weekday,onValueChange:C=>E({weekday:C}),children:[o.jsx(vr,{"aria-label":x("tasks.weekday"),children:o.jsx(gr,{})}),o.jsx(yr,{className:"jv-select-menu",children:[1,2,3,4,5,6,0].map(C=>o.jsx(fa,{value:String(C),children:S5(C)},C))})]}),(y==="daily"||y==="weekly")&&o.jsx(xt,{type:"time","aria-label":x("tasks.time"),value:b.time,onChange:C=>E({time:C.target.value})})]}),y==="every"&&!N&&o.jsx("small",{className:"jv-hint",children:x("tasks.minimum")})]}),i&&o.jsx("p",{className:"jv-note-error",role:"alert",children:i}),k&&s&&o.jsxs("div",{className:"jv-env-confirm jv-task-confirm",role:"group","aria-label":x("tasks.deleteTitle",{name:d||(e==null?void 0:e.name)||""}),children:[o.jsx("strong",{children:x("tasks.deleteTitle",{name:d||(e==null?void 0:e.name)||""})}),o.jsx("p",{children:x("tasks.deleteBody")}),o.jsxs("div",{className:"jv-env-confirm-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",onClick:()=>S(!1),children:x("common.cancel")}),o.jsx(Ne,{type:"button",variant:"ghost",className:"jv-task-delete",size:"sm",disabled:a,onClick:s,children:x("tasks.delete")})]})]}),o.jsxs("div",{className:"jv-form-footer",children:[o.jsx("div",{className:"jv-task-editor-actions",children:s&&o.jsx(Ne,{type:"button",variant:"ghost",className:"jv-task-delete",disabled:a,onClick:()=>S(!0),children:x("tasks.delete")})}),o.jsxs("div",{className:"jv-task-editor-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",onClick:c,children:x("common.cancel")}),o.jsx(Ne,{type:"submit",className:"jv-primary",disabled:a||!N||!d.trim()||!h.trim(),children:x("common.save")})]})]})]})}function PB({bot:e,runs:a}){const[i,r]=w.useState(null),[s,c]=w.useState(null),{busy:d,error:f,setError:h,run:p}=xn(),y=xn(),g=d||y.busy,b=y.error;w.useEffect(()=>{let _=!0;return he.tasks(e.id).then(R=>{_&&r(R.tasks)}).catch(R=>{_&&h(en(R,"tasks.loadFailed"))}),()=>{_=!1}},[e.id,a]);const j=_=>r(R=>(R??[]).some(I=>I.id===_.id)?R.map(I=>I.id===_.id?_:I):[...R??[],_]);function k(_){h(""),y.setError(""),c(_)}async function S(_){await y.run("save",async()=>{j(s==="new"||!s?await he.createTask(e.id,_):await he.updateTask(e.id,s.id,_)),c(null)},"tasks.saveFailed")}const N=_=>p("change",_,"tasks.changeFailed"),E=_=>N(async()=>j(await he.setTaskOn(e.id,_.id,_.state!=="active"))),M=_=>N(async()=>{await he.deleteTask(e.id,_.id),r(R=>(R==null?void 0:R.filter(I=>I.id!==_.id))??null),c(null)}),C=_=>_.state==="active"?_.schedule.kind==="once"||!_.nextRunAt?"":x("tasks.next",{time:C5(_.nextRunAt)}):x(_.state==="done"?"tasks.done":"tasks.paused"),A=_=>[OB(_.schedule),C(_)].filter(Boolean).join(" · ");return o.jsxs("section",{className:"jv-section","aria-label":x("tasks.title"),children:[o.jsxs("div",{className:"jv-task-head",children:[o.jsx("h3",{className:"jv-section-title",children:x("tasks.title")}),!s&&o.jsxs(Ne,{type:"button",variant:"ghost",size:"sm",disabled:g||i===null,onClick:()=>k("new"),children:[o.jsx(xr,{}),x("tasks.add")]})]}),s?o.jsx(IB,{task:s==="new"?void 0:s,busy:g,error:b,onSave:_=>void S(_),onCancel:()=>c(null),...s==="new"?{}:{onDelete:()=>void M(s)}}):i&&o.jsx("div",{className:"jv-list",children:i.length===0?o.jsx("div",{className:"jv-list-row jv-static-row",children:o.jsx("span",{className:"jv-row-text",children:o.jsx("span",{children:x("tasks.empty")})})}):i.map(_=>o.jsxs("div",{className:"jv-task-row","data-state":_.state,children:[o.jsx("button",{type:"button",className:"jv-list-row jv-task-open","aria-label":_.name,onClick:()=>k(_),children:o.jsxs("span",{className:"jv-row-text",children:[o.jsx("strong",{children:_.name}),o.jsx("span",{children:A(_)})]})}),_.state!=="done"&&o.jsx("button",{type:"button",role:"switch","aria-checked":_.state==="active","aria-label":x("tasks.toggle",{name:_.name}),disabled:g,className:"jv-env-access jv-task-switch",onClick:()=>void E(_),children:o.jsx("span",{className:"jv-env-switch","aria-hidden":"true"})})]},_.id))}),f&&o.jsx("p",{className:"jv-note-error",role:"alert",children:f})]})}const Ab={local:"ports.hint.local",idle:"ports.hint.idle",stopped:"ports.hint.stopped"};function Mb(e){const a=`${location.protocol}//${location.hostname.includes(":")?`[${location.hostname}]`:location.hostname}:${e.hostPort}`;return[a,...e.urls.filter(i=>i!==a)]}function HB({bot:e,runs:a}){const[i,r]=w.useState(null),[s,c]=w.useState(null),[d,f]=w.useState(!1),[h,p]=w.useState(null),{busy:y,error:g,setError:b,run:j}=xn();w.useEffect(()=>{let M=!0;return he.ports(e.id).then(C=>{M&&r(C.ports)}).catch(C=>{M&&b(en(C,"ports.loadFailed"))}),()=>{M=!1}},[e.id,a]);const k=s===null?null:(i==null?void 0:i.find(M=>M.port===s))??null;function S(M){b(""),f(!1),c(M)}const N=M=>j("unpublish",async()=>{await he.unpublishPort(e.id,M.port),r(C=>(C==null?void 0:C.filter(A=>A.port!==M.port))??null),S(null)},"ports.changeFailed"),E=M=>o.jsx("span",{className:"jv-port-state","data-state":M.state,children:x(`ports.state.${M.state}`)});return o.jsxs("section",{className:"jv-section","aria-label":x("ports.title"),children:[o.jsx("h3",{className:"jv-section-title",children:x("ports.title")}),k?o.jsxs("div",{className:"jv-list jv-port-details",role:"group","aria-label":k.name,children:[o.jsxs("div",{className:"jv-list-row jv-static-row jv-port-head",children:[o.jsxs("span",{className:"jv-row-text",children:[o.jsx("strong",{children:k.name}),o.jsx("span",{children:k.description})]}),o.jsx("span",{className:"jv-status","data-ok":k.state==="live"||void 0,"data-busy":k.state==="local"||k.state==="idle"||void 0,children:x(`ports.state.${k.state}`)})]}),Ab[k.state]&&o.jsx("div",{className:"jv-list-row jv-static-row jv-port-hint",role:"note",children:x(Ab[k.state])}),o.jsxs("div",{className:"jv-list-row jv-static-row",children:[o.jsx("span",{className:"jv-row-text",children:o.jsx("strong",{children:x("ports.sandboxPort")})}),o.jsx("code",{className:"jv-port-value",children:k.port})]}),Mb(k).map((M,C)=>o.jsxs("div",{className:"jv-list-row jv-static-row jv-port-link",children:[o.jsxs("span",{className:"jv-row-text",children:[o.jsx("strong",{children:x(C?"ports.linkOther":"ports.link")}),o.jsx("code",{title:M,children:M})]}),o.jsx(Ne,{type:"button",variant:"ghost",size:"icon-sm","aria-label":x(h===M?"ui.copied":"ports.copy"),onClick:()=>void Ns(M).then(A=>p(A?M:null)),children:h===M?o.jsx(ma,{}):o.jsx(Pc,{})}),o.jsx(Ne,{asChild:!0,variant:"ghost",size:"icon-sm",children:o.jsx("a",{href:M,target:"_blank",rel:"noopener noreferrer","aria-label":x("ports.open",{name:k.name}),children:o.jsx(Up,{})})})]},M)),d?o.jsxs("div",{className:"jv-list-row jv-static-row jv-port-confirm",role:"group","aria-label":x("ports.stopTitle",{name:k.name}),children:[o.jsxs("span",{className:"jv-row-text",children:[o.jsx("strong",{children:x("ports.stopTitle",{name:k.name})}),o.jsx("span",{children:x("ports.stopBody")})]}),o.jsxs("div",{className:"jv-port-actions-end",children:[o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",onClick:()=>f(!1),children:x("common.cancel")}),o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",className:"jv-port-unpublish",disabled:y,onClick:()=>void N(k),children:x("ports.stop")})]})]}):o.jsxs("div",{className:"jv-list-row jv-static-row jv-port-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",className:"jv-port-unpublish",disabled:y,onClick:()=>f(!0),children:x("ports.stop")}),o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",onClick:()=>S(null),children:x("ports.back")})]})]}):i&&o.jsx("div",{className:"jv-list",children:i.length===0?o.jsx("div",{className:"jv-list-row jv-static-row",children:o.jsx("span",{className:"jv-row-text",children:o.jsx("span",{children:x("ports.empty")})})}):i.map(M=>o.jsxs("div",{className:"jv-port-row","data-state":M.state,children:[o.jsxs("button",{type:"button",className:"jv-list-row jv-port-open","aria-label":M.name,onClick:()=>S(M.port),children:[o.jsxs("span",{className:"jv-row-text",children:[o.jsx("strong",{children:M.name}),o.jsxs("span",{className:"jv-port-line",children:[x("ports.port",{port:M.port})," · ",E(M)]})]}),o.jsx(ml,{className:"jv-row-chevron"})]}),o.jsx(Ne,{asChild:!0,variant:"ghost",size:"icon-sm",className:"jv-port-go",children:o.jsx("a",{href:Mb(M)[0],target:"_blank",rel:"noopener noreferrer","aria-label":x("ports.open",{name:M.name}),children:o.jsx(Up,{})})})]},M.port))}),g&&o.jsx("p",{className:"jv-note-error",role:"alert",children:g})]})}const os=[["overview","bot.tab.overview"],["profile","bot.tab.profile"],["environment","bot.tab.environment"],["tasks","bot.tab.tasks"],["activity","bot.tab.activity"],["usage","usage.title"]];function qB({bot:e,status:a,connections:i,chats:r,onSaved:s,onManageModels:c,onAddMachine:d,onClose:f,onOpenChat:h,onOpenSubscription:p}){const[y,g]=w.useState("overview"),[b,j]=w.useState(()=>new Set(["overview"])),k=w.useRef(null);w.useEffect(()=>{var C;(C=k.current)==null||C.scrollIntoView({block:"nearest",inline:"nearest"})},[y]);const S=C=>{g(C),j(A=>A.has(C)?A:new Set(A).add(C))},N=C=>{const A=os.findIndex(([R])=>R===y),_={ArrowRight:A+1,ArrowLeft:A-1,Home:0,End:os.length-1}[C.key];_!==void 0&&(C.preventDefault(),S(os[(_+os.length)%os.length][0]),requestAnimationFrame(()=>{var R;return(R=k.current)==null?void 0:R.focus()}))},E=`${(a==null?void 0:a.status)??"stop"}:${(a==null?void 0:a.runId)??""}`,M=(C,A,_=!1)=>b.has(C)&&o.jsx("div",{id:`jv-bot-panel-${C}`,role:"tabpanel","aria-labelledby":`jv-bot-tab-${C}`,hidden:y!==C,className:_?"jv-bot-fill":"jv-bot-scroll",children:A},C);return o.jsx(b5,{open:!0,onOpenChange:C=>{C||f()},children:o.jsxs(j5,{className:"jv-bot-info jv-ui","aria-describedby":void 0,children:[o.jsx(yB,{bot:e,status:a,onSaved:s}),o.jsx("div",{className:"jv-bot-tabs",role:"tablist","aria-label":x("entry.botInfo"),onKeyDown:N,children:os.map(([C,A])=>o.jsx("button",{id:`jv-bot-tab-${C}`,ref:y===C?k:void 0,type:"button",role:"tab","aria-selected":y===C,"aria-controls":`jv-bot-panel-${C}`,tabIndex:y===C?0:-1,onClick:()=>S(C),children:x(A)},C))}),M("overview",o.jsx(jB,{bot:e,status:a,connections:i,chats:r,onSaved:s,onManageModels:c,onOpenSubscription:p})),M("profile",o.jsx(wB,{bot:e,onSaved:s})),M("environment",o.jsxs(o.Fragment,{children:[o.jsx(RB,{bot:e,onSaved:s,onAddMachine:d}),o.jsx(HB,{bot:e,runs:E})]})),M("tasks",o.jsx(PB,{bot:e,runs:E})),M("activity",o.jsx(tB,{botId:e.id,onOpenChat:h}),!0),M("usage",o.jsx(lB,{botId:e.id}),!0)]})})}function E5({id:e,value:a,sections:i,onChange:r}){const[s,c]=w.useState(null);return o.jsxs(pr,{value:a??"none",onValueChange:d=>r(d==="none"?null:d),children:[o.jsx(vr,{id:e,ref:d=>c((d==null?void 0:d.closest("dialog"))??null),className:"jv-select jv-section-select",children:o.jsx(gr,{})}),o.jsxs(yr,{className:"jv-select-menu",position:"popper",sideOffset:4,container:s,children:[o.jsx(fa,{value:"none",children:x("info.noSection")}),i.map(d=>o.jsx(fa,{value:d.id,children:d.name},d.id))]})]})}const UB=1024*1024,FB=e=>e==="text"||e==="markdown"||e==="html"||e==="svg",VB=["txt","json","jsonl","yaml","yml","ts","tsx","js","jsx","mjs","cjs","css","log","csv","py","sh","sql","toml","xml","ini","env","diff","patch"],di=e=>`/api/attachments/${e.id}`,$B=e=>Pg(e)==="gif"||e.mimeType==="image/gif"?di(e):`${di(e)}/thumb`,Pg=e=>e.name.includes(".")?e.name.split(".").pop().toLowerCase():"";function Xc(e){const a=Pg(e),i=e.mimeType.toLowerCase();return a==="svg"||i==="image/svg+xml"?"svg":i.startsWith("image/")||["png","jpg","jpeg","gif","webp","avif","bmp"].includes(a)?"image":i.startsWith("video/")?"video":i.startsWith("audio/")?"audio":["webm","mp4","mov"].includes(a)?"video":["mp3","wav","ogg"].includes(a)?"audio":["html","htm"].includes(a)||i==="text/html"?"html":["md","markdown"].includes(a)?"markdown":i.startsWith("text/")||VB.includes(a)?"text":"download"}const Tc=e=>e==="image"||e==="svg",T5=e=>e==="video"||e==="audio",A5={image:"files.kindImage",svg:"files.kindSvg",video:"files.kindVideo",audio:"files.kindAudio",html:"files.kindHtml",markdown:"files.kindMarkdown",text:"files.kindText",download:"files.kindFile"};function M5(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024**3?`${(e/1024/1024).toFixed(1)} MB`:`${(e/1024**3).toFixed(2)} GB`}async function _5(e,a){const i=await fetch(di(e),{signal:a,credentials:"same-origin"});if(!i.ok)throw new Error(i.status===404?x("files.gone"):x("files.readFailed",{status:i.status}));return i.text()}async function R5(e,a){return Xc(e)==="svg"?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(await _5(e,a))}`:di(e)}const _b=e=>`/api/attachments/${e.id}/run`;function GB(e){const a=new DOMParser().parseFromString(e,"text/html");let i=a.querySelectorAll("script").length;const r=new Set;return a.querySelectorAll("*").forEach(s=>{for(const c of[...s.attributes])if(c.name.startsWith("on"))i++;else if(/^\s*javascript:/i.test(c.value)&&["href","src","action","formaction","xlink:href"].includes(c.name))i++;else if(["src","href"].includes(c.name)&&s.tagName!=="A")try{const d=new URL(c.value);(d.protocol==="http:"||d.protocol==="https:")&&r.add(d.host)}catch{}}),i?{count:i,hosts:[...r]}:null}function YB(e){const a=new DOMParser().parseFromString(e,"text/html");return a.querySelectorAll("script,iframe,frame,object,embed,link,meta,base,audio,video,source,track").forEach(i=>i.remove()),a.querySelectorAll("*").forEach(i=>{for(const r of[...i.attributes])(r.name.startsWith("on")||["href","xlink:href","srcset","action","formaction","target","autofocus","contenteditable"].includes(r.name)||r.name==="src"&&!r.value.startsWith("data:image/"))&&i.removeAttribute(r.name);["BUTTON","INPUT","SELECT","TEXTAREA"].includes(i.tagName)&&i.setAttribute("disabled","")}),`<!doctype html><meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; img-src data:; form-action 'none'; base-uri 'none'"><meta charset="utf-8">${a.documentElement.outerHTML}`}const Rb=new Map;function KB({file:e,onSize:a}){const i=Xc(e)==="svg",[r,s]=w.useState(()=>i?void 0:$B(e)),[c,d]=w.useState(!1);w.useEffect(()=>{if(!i)return;const h=new AbortController;return d(!1),R5(e,h.signal).then(s).catch(()=>{h.signal.aborted||d(!0)}),()=>h.abort()},[e.id]);const f=()=>{!i&&r!==di(e)?s(di(e)):d(!0)};return c?o.jsx("span",{className:"ui-broken-image",children:o.jsx(Ue,{name:"image"})}):r?o.jsx("img",{src:r,alt:e.name,loading:"lazy",onError:f,onLoad:h=>{const{naturalWidth:p,naturalHeight:y}=h.currentTarget;p&&y&&a({width:p,height:y})}}):o.jsx(Ue,{name:"image"})}function XB({file:e,onOpen:a}){const[i,r]=w.useState(()=>Rb.get(e.id)),s=Xc(e),c=Tc(s),d=T5(s),f=Pg(e).toUpperCase(),h=c&&i?{"--image-w":`${i.width}px`,"--image-ratio":`${i.width/i.height}`}:void 0;return o.jsxs("div",{className:`ui-message-file ${c?"ui-message-image":""}`,"data-sized":h?"":void 0,style:h,children:[o.jsxs("button",{type:"button",className:"ui-message-open",onClick:a,"aria-label":x("files.preview",{name:e.name}),children:[c?o.jsx("span",{className:"ui-image-frame",children:o.jsx(KB,{file:e,onSize:p=>{Rb.set(e.id,p),r(p)}})}):o.jsx("span",{className:"ui-file-icon","data-kind":d?s:void 0,children:o.jsx(Ue,{name:d?`file-${s}`:"file"})}),o.jsxs("span",{className:"ui-file-copy",children:[o.jsx("strong",{title:e.name,children:e.name}),o.jsxs("small",{children:[d?`${x(A5[s])} · `:"",f?`${f} · `:"",M5(e.size)]})]})]}),o.jsx("a",{className:"ui-iconbtn",href:di(e),download:e.name,"aria-label":x("files.download",{name:e.name}),title:x("files.download",{name:e.name}),children:o.jsx(Ue,{name:"cloud-download"})})]})}function O5({files:e,onOpen:a}){const i=e.some(r=>Tc(Xc(r)));return o.jsx("div",{className:`ui-message-files ${i?"ui-has-images":""}`,children:e.map((r,s)=>o.jsx(XB,{file:r,onOpen:()=>a(s)},r.id))})}function D5({icon:e,title:a,titleClass:i,purpose:r,label:s,busy:c,error:d,ready:f,decline:h,confirm:p,onDecline:y,onConfirm:g,children:b}){const j=k=>{k.preventDefault(),f&&g()};return o.jsxs("form",{className:"jv-question jv-secret-request",autoComplete:"off","aria-label":s,"aria-busy":c||void 0,onSubmit:j,children:[o.jsxs("div",{className:"jv-question-head",children:[o.jsx("span",{className:"jv-question-icon",children:e}),o.jsxs("div",{className:"jv-question-heading",children:[o.jsx("p",{className:i?`jv-question-title ${i}`:"jv-question-title",children:a}),o.jsx("p",{className:"jv-question-detail",children:r})]})]}),o.jsxs("div",{className:"jv-question-body",children:[b,d&&o.jsx("p",{className:"jv-question-error",role:"alert",children:d})]}),o.jsxs("div",{className:"jv-question-foot",children:[o.jsx("button",{type:"button",className:"ui-button",disabled:c,onClick:y,children:h}),o.jsx("button",{type:"submit",className:"ui-button ui-primary",disabled:c||!f,children:p})]})]})}function z5({state:e,text:a,purpose:i}){return o.jsxs("p",{className:"jv-question-done","data-state":e,title:`${a}
777
+ ${i}`,children:[e==="answered"?o.jsx(ma,{"aria-hidden":"true"}):o.jsx(Lw,{"aria-hidden":"true"}),o.jsx("span",{className:"jv-question-answer",children:a}),o.jsx("span",{className:"jv-question-asked",children:i})]})}function L5({label:e,value:a,visible:i,disabled:r,autoFocus:s,placeholder:c,hint:d,short:f,onChange:h,onVisible:p}){return o.jsxs("label",{className:"ui-field jv-secret-request-value",children:[o.jsx("span",{children:e}),o.jsxs("span",{className:"jv-secret-request-field",children:[o.jsx("input",{type:i?"text":"password",autoComplete:"new-password",spellCheck:!1,autoFocus:s,placeholder:c,value:a,disabled:r,onChange:y=>h(y.target.value)}),o.jsx("button",{type:"button","aria-label":x(i?"secrets.hideValue":"secrets.showValue"),onClick:()=>p(!i),children:i?o.jsx(D0,{}):o.jsx(z0,{})})]}),o.jsx("small",{"data-short":f||void 0,children:d})]})}function QB({message:e,onSettled:a}){var M;const i=e.question,r=i.secret,[s,c]=w.useState(""),[d,f]=w.useState(!1),[h,p]=w.useState(!1),[y,g]=w.useState("always"),{busy:b,error:j,run:k}=xn();if(i.state!=="pending"){const C=((M=i.answer)==null?void 0:M.selected[0])===1?"once":"always",A=i.state==="answered"?x(C==="once"?"secretCard.allowedOnce":"secretCard.allowedAlways",{name:r.name}):x(i.state==="dismissed"?"secretCard.declined":"secretCard.ignored",{name:r.name});return o.jsx(z5,{state:i.state,text:A,purpose:r.purpose})}const S=r.needsValue||h,N=s.length>0&&s.length<8,E=C=>{b||k("answer",async()=>a(await C()),"question.failed")};return o.jsxs(D5,{icon:o.jsx(bw,{"aria-hidden":"true"}),title:r.name,titleClass:"jv-secret-request-name",purpose:r.purpose,label:x("secretCard.title",{name:r.name}),busy:b,error:j,ready:!S||!!s,decline:x("secretCard.decline"),confirm:x(S?"secretCard.saveAllow":"secretCard.allow"),onDecline:()=>E(()=>he.answerQuestion(e.chatId,e.id,{action:"dismiss"})),onConfirm:()=>E(()=>he.fulfilSecret(e.chatId,e.id,{scope:y,...S?{value:s}:{}})),children:[!window.isSecureContext&&o.jsxs("p",{className:"jv-secret-request-warning",role:"alert",children:[o.jsx(P0,{"aria-hidden":"true"}),x("secretCard.insecure")]}),r.exists&&!r.needsValue&&o.jsxs("p",{className:"jv-secret-request-note",children:[x("secretCard.exists"),o.jsx("button",{type:"button",className:"jv-secret-request-link",onClick:()=>{p(!h),c("")},children:x(h?"secretCard.keepValue":"secretCard.replace")})]}),r.exists&&r.needsValue&&o.jsx("p",{className:"jv-secret-request-note",children:x("secretCard.unreadable")}),S&&o.jsx(L5,{label:x("secretCard.value"),value:s,visible:d,disabled:b,autoFocus:!0,placeholder:x("secretCard.valuePlaceholder"),hint:x(N?"secrets.shortValue":"secretCard.valueHint"),short:N,onChange:c,onVisible:f}),o.jsxs("div",{className:"jv-secret-request-scope",children:[o.jsx("div",{className:"jv-secret-request-seg",role:"radiogroup","aria-label":x("secretCard.scope"),children:["always","once"].map(C=>o.jsx("button",{type:"button",role:"radio","aria-checked":y===C,disabled:b,onClick:()=>g(C),children:x(C==="always"?"secretCard.always":"secretCard.once")},C))}),o.jsx("small",{children:x(y==="always"?"secretCard.alwaysHint":"secretCard.onceHint")})]})]})}function Hg({publicKey:e}){const[a,i]=w.useState(!1);return w.useEffect(()=>{if(!a)return;const r=setTimeout(()=>i(!1),1500);return()=>clearTimeout(r)},[a]),o.jsxs("div",{className:"jv-machine-key",children:[o.jsx("code",{children:e}),o.jsxs("button",{type:"button",className:"ui-button jv-machine-copy","aria-label":x("machines.copy"),onClick:()=>void Ns(e).then(i),children:[a?o.jsx(ma,{"aria-hidden":"true"}):o.jsx(Pc,{"aria-hidden":"true"}),o.jsx("span",{children:x(a?"machines.copied":"machines.copy")})]})]})}function B5(e){const[a,i]=w.useState(null),[r,s]=w.useState(null);return w.useEffect(()=>{if(!e||a)return;let c=!0;return he.prepareMachineKey().then(d=>{c&&i(d)}).catch(d=>{c&&s(en(d))}),()=>{c=!1}},[e,a]),{key:a,error:r,renew:()=>{i(null),s(null)}}}function ZB({message:e,onSettled:a}){const i=e.question,r=i.machine,[s,c]=w.useState(""),[d,f]=w.useState(!1),{busy:h,error:p,setError:y,run:g}=xn(),[b,j]=w.useState("password"),k=B5(i.state==="pending"&&!r.existing&&b==="key"),S=`${r.user}@${r.host}${r.port===22?"":`:${r.port}`}`;if(i.state!=="pending"){const C=x(i.state==="answered"?r.existing?"machineCard.granted":"machineCard.added":i.state==="dismissed"?"machineCard.declined":"machineCard.ignored",{name:r.name});return o.jsx(z5,{state:i.state,text:C,purpose:r.purpose})}const N=C=>{h||g("answer",async()=>{try{a(await C())}catch(A){throw A instanceof qi&&A.code==="ssh_key_expired"&&k.renew(),A}},"question.failed")},E=!r.existing,M=!E||(b==="key"?!!k.key:!!s);return o.jsxs(D5,{icon:o.jsx(Jw,{"aria-hidden":"true"}),title:r.name,purpose:r.purpose,label:x("machineCard.title",{name:r.name}),busy:h,error:p,ready:M,decline:x("machineCard.decline"),confirm:x(E?b==="key"?h?"machines.verifying":"machines.verify":h?"machines.connecting":"machineCard.add":"machineCard.allow"),onDecline:()=>N(()=>he.answerQuestion(e.chatId,e.id,{action:"dismiss"})),onConfirm:()=>N(()=>he.fulfilMachine(e.chatId,e.id,b==="key"&&k.key?{keyId:k.key.keyId}:{password:s})),children:[o.jsxs("p",{className:"jv-machine-where",children:[o.jsx("code",{children:S}),r.directory&&o.jsx("code",{children:r.directory})]}),r.existing?o.jsx("p",{className:"jv-secret-request-note",children:x("machineCard.existing")}):o.jsxs(o.Fragment,{children:[!window.isSecureContext&&o.jsxs("p",{className:"jv-secret-request-warning",role:"alert",children:[o.jsx(P0,{"aria-hidden":"true"}),x("secretCard.insecure")]}),o.jsxs("div",{className:"jv-machine-card-field",children:[o.jsx("span",{children:x("machines.fingerprint")}),o.jsx("div",{className:"jv-machine-prints",children:r.hostKeys.fingerprints.map(C=>o.jsx("code",{children:C},C))}),o.jsx("small",{children:x("machines.fingerprintHint")})]}),o.jsx("div",{className:"jv-secret-request-seg",role:"radiogroup","aria-label":x("machines.login"),children:["password","key"].map(C=>o.jsx("button",{type:"button",role:"radio","aria-checked":b===C,disabled:h,onClick:()=>{j(C),y("")},children:x(C==="password"?"machines.byPassword":"machines.byKey")},C))}),b==="password"?o.jsx(L5,{label:x("machines.password"),value:s,visible:d,disabled:h,hint:x("machines.passwordHint"),onChange:c,onVisible:f}):o.jsxs("div",{className:"jv-machine-card-field",children:[o.jsx("span",{children:x("machines.publicKey")}),k.key?o.jsx(Hg,{publicKey:k.key.publicKey}):k.error?o.jsx("p",{className:"jv-question-error",role:"alert",children:k.error}):o.jsx("small",{children:"…"}),o.jsx("small",{children:x("machines.keyHint",{user:r.user})})]})]})]})}const Ob=e=>String.fromCharCode(65+e),Db=e=>e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLElement&&e.isContentEditable;function I5(e){const{message:a}=e,{secret:i,machine:r}=a.question;return i?o.jsx(QB,{message:{...a,question:{...a.question,secret:i}},onSettled:e.onSettled}):r?o.jsx(ZB,{message:{...a,question:{...a.question,machine:r}},onSettled:e.onSettled}):o.jsx(JB,{...e})}function JB({message:e,keyboard:a,onSettled:i}){var E,M;const r=e.question,s=r.state==="pending",c=w.useId(),[d,f]=w.useState([]),[h,p]=w.useState(""),{busy:y,error:g,run:b}=xn();async function j(C){y||!s||await b("settle",async()=>i(await he.answerQuestion(e.chatId,e.id,C)),"question.failed")}const k=C=>{if(!r.multiple){j({action:"answer",selected:[C]});return}f(A=>A.includes(C)?A.filter(_=>_!==C):[...A,C])},S=()=>void j({action:"answer",selected:d,...h.trim()?{custom:h.trim()}:{}}),N=()=>{h.trim()&&(r.multiple?S():j({action:"answer",selected:[],custom:h.trim()}))};if(w.useEffect(()=>{if(!a||!s)return;const C=A=>{if(A.defaultPrevented||A.metaKey||A.ctrlKey||A.altKey||A.key.length!==1||Db(A.target)||Db(document.activeElement)||document.querySelector("dialog[open], [role=dialog]"))return;const _=A.key.toUpperCase().charCodeAt(0)-65;_<0||_>=r.options.length||(A.preventDefault(),k(_))};return document.addEventListener("keydown",C,!0),()=>document.removeEventListener("keydown",C,!0)}),!s){const C=r.state==="answered"?[...(((E=r.answer)==null?void 0:E.selected)??[]).map(A=>{var _;return((_=r.options[A])==null?void 0:_.label)??""}),...(M=r.answer)!=null&&M.custom?[r.answer.custom]:[]].filter(Boolean).join(x("common.listSeparator")):null;return o.jsxs("p",{className:"jv-question-done","data-state":r.state,title:`${r.question}
778
+ ${C===null?x("question.dismissed"):x("question.chose",{answer:C})}`,children:[C===null?o.jsx(Lw,{"aria-hidden":"true"}):o.jsx(ma,{"aria-hidden":"true"}),o.jsx("span",{className:"jv-question-answer",children:C===null?x("question.dismissed"):_0("question.chose",{answer:o.jsx("strong",{children:C})})}),o.jsx("span",{className:"jv-question-asked",children:r.question})]})}return o.jsxs("div",{className:"jv-question",role:"group","aria-labelledby":c,"aria-busy":y||void 0,children:[o.jsxs("div",{className:"jv-question-head",children:[o.jsx("span",{className:"jv-question-icon",children:o.jsx(Tw,{"aria-hidden":"true"})}),o.jsxs("div",{className:"jv-question-heading",children:[o.jsx("p",{id:c,className:"jv-question-title",children:r.question}),r.detail&&o.jsx("p",{className:"jv-question-detail",children:r.detail})]}),o.jsx("button",{type:"button",className:"jv-question-dismiss","aria-label":x("question.dismissLabel"),title:x("question.dismiss"),disabled:y,onClick:()=>void j({action:"dismiss"}),children:o.jsx(xs,{"aria-hidden":"true"})})]}),o.jsxs("div",{className:"jv-question-body",children:[o.jsx("div",{className:"jv-question-options",role:r.multiple?"group":void 0,"aria-label":r.multiple?x("question.multiple"):void 0,children:r.options.map((C,A)=>{const _=d.includes(A);return o.jsxs("button",{type:"button",className:"jv-question-option","data-style":C.style,"data-on":_||void 0,"aria-pressed":r.multiple?_:void 0,"aria-keyshortcuts":a?Ob(A).toLowerCase():void 0,disabled:y,onClick:()=>k(A),children:[o.jsx("span",{className:"jv-question-key","aria-hidden":"true",children:_?o.jsx(ma,{}):Ob(A)}),o.jsxs("span",{className:"jv-question-copy",children:[o.jsx("strong",{children:C.label}),C.description&&o.jsx("small",{children:C.description})]})]},C.label)})}),g&&o.jsx("p",{className:"jv-question-error",role:"alert",children:g})]}),(r.allowCustom||r.multiple)&&o.jsxs("div",{className:"jv-question-foot",children:[r.allowCustom&&o.jsx("input",{className:"jv-question-custom",value:h,maxLength:2e3,placeholder:x(r.multiple?"question.note":"question.own"),"aria-label":x("question.ownLabel"),disabled:y,onChange:C=>p(C.target.value),onKeyDown:C=>{C.key==="Enter"&&!C.nativeEvent.isComposing&&(C.preventDefault(),N())}}),r.multiple?o.jsx("button",{type:"button",className:"ui-button ui-primary jv-question-submit",disabled:y||!d.length&&!h.trim(),onClick:S,children:d.length?x("question.confirmCount",{count:d.length}):x("question.confirm")}):o.jsx("button",{type:"button",className:"ui-button ui-primary jv-question-submit",disabled:y||!h.trim(),onClick:N,children:x("question.send")})]})]})}function pi(e){return e?e.deleted?x("member.deleted",{name:e.name}):e.name:x("member.unknown")}const WB={reasoning:"activity.reasoning",texting:"activity.texting",tool_calling:"activity.toolCalling",asking:"activity.asking"},P5=e=>x(WB[e??""]??"activity.running"),hi=e=>e.filter(a=>!a.deleted);function eI(e){const a=new Set(e.map(r=>r.toLowerCase()));let i=x("bot.newName");for(let r=2;a.has(i.toLowerCase());r++)i=x("bot.newNameN",{n:r});return i}const Np=/[\p{Script=Latin}\p{Nd}_]/u;function qg(e,a){const i=e.replace(/```[\s\S]*?```|`[^`\n]*`/g,d=>" ".repeat(d.length)),r=i.toLowerCase(),s=[...a].sort((d,f)=>f.name.length-d.name.length),c=[];for(let d=r.indexOf("@");d>=0;d=r.indexOf("@",d+1)){if(d>0&&Np.test(i[d-1]))continue;const f=s.find(h=>{const p=h.name.toLowerCase();if(!p||!r.startsWith(p,d+1))return!1;const y=i[d+1+p.length];return!(y&&Np.test(y)&&Np.test(p.at(-1)))});f&&(c.push({member:f,at:d,length:f.name.length+1}),d+=f.name.length)}return c}function tI(e,a,i){let r="",s=0;for(const c of qg(e,a))r+=e.slice(s,c.at)+`[${e.slice(c.at,c.at+c.length)}](${c.member.id===i?"#mention-me":"#mention"})`,s=c.at+c.length;return r+e.slice(s)}function nI(e){return e.type==="dm"?x("ref.dm",{title:e.title}):e.type==="thread"&&e.parentTitle?`# ${e.parentTitle} › ${e.title}`:`# ${e.title}`}function aI({target:e,members:a,onJump:i}){const[r,s]=w.useState(!1),c=w.useRef(""),d=w.useRef(void 0);w.useEffect(()=>()=>window.clearTimeout(d.current),[]);const f=pi(a.find(b=>b.id===e.senderId)),h=go(e),p=(b,j)=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>s(b),j)},y=b=>j=>{j.pointerType==="mouse"&&p(b,b?350:150)},g=()=>{window.clearTimeout(d.current),s(!1),i==null||i()};return o.jsxs(sg,{open:r,onOpenChange:s,children:[o.jsxs(cg,{className:"jv-ref-tag",title:"","aria-label":x("ref.label",{name:f,text:h}),onPointerDown:b=>{c.current=b.pointerType},onPointerEnter:y(!0),onPointerLeave:y(!1),onClick:b=>{const j=c.current==="touch"||c.current==="pen";c.current="",!j&&i&&(b.preventDefault(),g())},children:[o.jsx(Ue,{name:"chat-bubble"}),o.jsx("span",{className:"jv-quote-name",children:x("quote.by",{name:f})}),o.jsx("span",{className:"jv-quote-text",children:h})]}),o.jsx(ug,{children:o.jsxs(dg,{className:"jv-ref-card jv-ui",side:"top",align:"start",sideOffset:6,collisionPadding:12,onOpenAutoFocus:b=>b.preventDefault(),onPointerEnter:y(!0),onPointerLeave:y(!1),children:[o.jsxs("div",{className:"jv-ref-place",children:[o.jsx("span",{children:nI(e.chat)}),o.jsxs("span",{children:[lf(e.createdAt)," ",sl(e.createdAt)]})]}),o.jsx("div",{className:"jv-ref-name",children:f}),o.jsx("p",{className:"jv-ref-text",children:h}),i&&o.jsx("button",{type:"button",className:"jv-ref-open",onClick:g,children:x("ref.open")})]})})]})}const H5=/\[\[q(\d+)\]\]/g,w0=(e,a=40)=>{const i=e.replace(/\s+/g," ").trim();return i.length>a?`${i.slice(0,a)}…`:i};function Ug(e){return e.content.replace(H5,(a,i)=>{const r=e.quotes[Number(i)-1];return r?x("quote.inline",{text:r.text}):a})}function go(e){return Ug(e).replace(/[*`~#>]/g,"").replace(/\s+/g," ").trim()||x("common.attachment")}function q5({message:e,members:a,me:i,onJump:r}){const s=tI(e.content,a.filter(f=>e.mentions.includes(f.id)),i).replace(H5,(f,h)=>e.quotes[Number(h)-1]?`[q${h}](#quote-${h})`:f),c=f=>{const h=e.quotes[f-1];if(!h)return null;const p=pi(a.find(y=>y.id===h.senderId));return o.jsxs("button",{type:"button",className:"jv-quote-tag",title:x("sidebar.said",{name:p,text:h.text}),"data-gone":h.messageId?void 0:"",onClick:()=>r==null?void 0:r(h.messageId,h.text),children:[o.jsx(Ue,{name:"quote"}),o.jsx("span",{className:"jv-quote-name",children:x("quote.by",{name:p})}),o.jsx("span",{className:"jv-quote-text",children:w0(h.text,80)})]})},d=f=>{const h=e.refs.find(p=>p.id===f);return h?o.jsx(aI,{target:h,members:a,onJump:r&&(()=>r(f))}):null};return o.jsx(Kc,{text:s,renderQuote:c,renderRef:d})}function U5(e,a){var g;const i=a.replace(/\s+/g,"");if(!i||typeof CSS>"u"||!("highlights"in CSS))return!1;const r=e.querySelector(".ui-bubble")??e,s=document.createTreeWalker(r,NodeFilter.SHOW_TEXT),c=[];for(let b=s.nextNode();b;b=s.nextNode())if(!((g=b.parentElement)!=null&&g.closest(".jv-quote-tag, button")))for(let j=0;j<b.data.length;j++)/\s/.test(b.data[j])||c.push({node:b,offset:j});const d=c.map(b=>b.node.data[b.offset]).join(""),f=d.indexOf(i);if(f<0)return!1;const h=c[f],p=c[f+i.length-1],y=new Range;return y.setStart(h.node,h.offset),y.setEnd(p.node,p.offset+1),CSS.highlights.set("jv-passage",new Highlight(y)),setTimeout(()=>CSS.highlights.delete("jv-passage"),2400),!0}function k0(e,a){var i;(i=e.querySelector(".jv-long-toggle[aria-expanded='false']"))==null||i.click(),e.scrollIntoView({block:"center",behavior:"smooth"}),!(a&&U5(e,a))&&(e.classList.add("jv-jump"),setTimeout(()=>e.classList.remove("jv-jump"),1200))}function iI({quotes:e,onRemove:a}){return e.length?o.jsx("div",{className:"jv-compose-quotes",children:e.map((i,r)=>o.jsxs("span",{className:"jv-quote-tag",title:x("sidebar.said",{name:i.name,text:i.text}),children:[o.jsx(Ue,{name:"quote"}),o.jsx("span",{className:"jv-quote-name",children:x("quote.by",{name:i.name})}),o.jsx("span",{className:"jv-quote-text",children:w0(i.text)}),o.jsx("button",{type:"button","aria-label":x("quote.remove",{text:w0(i.text,20)}),onClick:()=>a(r),children:"×"})]},r))}):null}function F5({container:e,drafts:a,chatId:i,source:r,members:s,onNotice:c}){const d=(y,g)=>{const b=r(y);b&&!rI(a,i,b,s,g)&&c(x("quote.tooMany",{count:10}))},[f,h]=w.useState(null);if(w.useEffect(()=>{const y=e.current;if(!y||!matchMedia("(hover: hover) and (pointer: fine)").matches)return;const g=E=>{var M;return(M=E instanceof Element?E:E==null?void 0:E.parentElement)==null?void 0:M.closest(".ui-bubble")},b=()=>{var R,I;const E=getSelection(),M=(E==null?void 0:E.toString())??"";if(!E||E.isCollapsed||!M.trim()){h(null);return}const C=g(E.anchorNode),A=C==null?void 0:C.closest("[data-message]");if(!C||!A||!y.contains(C)||g(E.focusNode)!==C||(I=(R=E.anchorNode)==null?void 0:R.parentElement)!=null&&I.closest(".jv-quote-tag, button")){h(null);return}const _=E.getRangeAt(0).getBoundingClientRect();h({x:Math.min(Math.max(_.left+_.width/2,90),innerWidth-90),y:Math.max(_.top-8,48),messageId:A.getAttribute("data-message"),text:M.trim()})},j=()=>requestAnimationFrame(b),k=()=>h(null),S=E=>{E.key==="Escape"&&k()},N=()=>{var E;(E=getSelection())!=null&&E.isCollapsed&&k()};return y.addEventListener("mouseup",j),y.addEventListener("scroll",k,!0),document.addEventListener("keydown",S),document.addEventListener("selectionchange",N),()=>{y.removeEventListener("mouseup",j),y.removeEventListener("scroll",k,!0),document.removeEventListener("keydown",S),document.removeEventListener("selectionchange",N)}},[e]),!f)return null;const p=()=>{var y;h(null),(y=getSelection())==null||y.removeAllRanges()};return o.jsxs("div",{className:"ui-popover jv-selection-menu",role:"menu","aria-label":x("quote.selection"),style:{left:f.x,top:f.y},onMouseDown:y=>y.preventDefault(),children:[o.jsxs("button",{type:"button",role:"menuitem",className:"ui-menu-item",onClick:()=>{Ns(f.text),p()},children:[o.jsx(Ue,{name:"copy"}),o.jsx("span",{className:"ui-menu-copy",children:x("quote.copy")})]}),o.jsxs("button",{type:"button",role:"menuitem",className:"ui-menu-item",onClick:()=>{d(f.messageId,f.text),p()},children:[o.jsx(Ue,{name:"quote"}),o.jsx("span",{className:"ui-menu-copy",children:x("quote.quote")})]})]})}function rI(e,a,i,r,s){if(e.get(a).passages.length>=10)return!1;const c={messageId:i.id,name:pi(r.find(d=>d.id===i.senderId)),text:s};return e.update(a,d=>({passages:[...d.passages,c]})),!0}const lI="modulepreload",oI=function(e){return"/"+e},zb={},sI=function(a,i,r){let s=Promise.resolve();if(i&&i.length>0){let d=function(p){return Promise.all(p.map(y=>Promise.resolve(y).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),h=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));s=d(i.map(p=>{if(p=oI(p),p in zb)return;zb[p]=!0;const y=p.endsWith(".css"),g=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const b=document.createElement("link");if(b.rel=y?"stylesheet":lI,y||(b.as="script"),b.crossOrigin="",b.href=p,h&&b.setAttribute("nonce",h),document.head.appendChild(b),y)return new Promise((j,k)=>{b.addEventListener("load",j),b.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${p}`)))})}))}function c(d){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=d,window.dispatchEvent(f),!f.defaultPrevented)throw d}return s.then(d=>{for(const f of d||[])f.status==="rejected"&&c(f.reason);return a().catch(c)})};let Lb;function cI(){return Lb??(Lb=sI(()=>import("./data-uMIXh-O1.js"),[]).then(e=>e.default.groups)),Lb}const uI=["👍","👎","👌","✅","❌","👀","🙏","🤔"],V5=9,$5="jarvy-emoji-recent",dI={"Smileys & Emotion":b7,"People & Body":A7,"Animals & Nature":h7,"Food & Drink":l9,"Travel & Places":$7,Activities:n9,Objects:O7,Symbols:_7,Flags:C7};function fI(){try{const e=JSON.parse(localStorage.getItem($5)??"[]");return Array.isArray(e)?e.filter(a=>typeof a=="string").slice(0,V5):[]}catch{return[]}}function hI(e,a){const[,i,r,s,c]=e,d=a.toLowerCase(),f=i.toLowerCase().split(/[\s:]+/),h=r.toLowerCase().split(" "),p=c.split(" "),y=f.includes(d)||s.split(/:\s*/).includes(a)?5:h.includes(d)||p.includes(a)?4:f.some(g=>g.startsWith(d))||s.startsWith(a)?3:h.some(g=>g.startsWith(d))||p.some(g=>g.startsWith(a))?2:d.length>3&&h.some(g=>g.includes(d))||s.includes(a)||c.includes(a)?1:0;return y&&y*1e3-Math.min(h.length+p.length,999)}function mI({onPick:e}){const[a,i]=w.useState(""),[r,s]=w.useState(fI),[c,d]=w.useState(0),[f,h]=w.useState([]);w.useEffect(()=>{let M=!0;return cI().then(C=>{M&&h(C)}),()=>{M=!1}},[]);const p=w.useRef(null),y=w.useRef(null),g=w.useRef([]),b=w.useMemo(()=>{if(!f.length)return[];const M=new Map(f.flatMap(A=>A.emoji.map(_=>[_[0],_]))),C=f.map(({name:A,emoji:_})=>({key:A,label:x(`actions.emoji.${A}`),Icon:dI[A],emoji:_}));return r.length?[{key:"recent",label:x("actions.recent"),Icon:p7,emoji:r.map(A=>M.get(A)??[A,"","","",""])},...C]:C},[f,r]),j=w.useMemo(()=>{const M=a.trim();return!M||!f.length?null:f.flatMap(C=>C.emoji).map(C=>[C,hI(C,M)]).filter(([,C])=>C>0).sort((C,A)=>A[1]-C[1]).map(([C])=>C)},[a,f]),k=M=>{const C=[M,...r.filter(A=>A!==M)].slice(0,V5);s(C);try{localStorage.setItem($5,JSON.stringify(C))}catch{}e(M)};w.useEffect(()=>{const M=y.current;if(!M||j)return;const C=()=>{const A=M.getBoundingClientRect().top;let _=0;g.current.forEach((R,I)=>{R&&R.getBoundingClientRect().top-A<40&&(_=I)}),d(_)};return M.addEventListener("scroll",C,{passive:!0}),()=>M.removeEventListener("scroll",C)},[j]);const S=M=>{const C=g.current[M];!C||!y.current||(y.current.scrollTop+=C.getBoundingClientRect().top-y.current.getBoundingClientRect().top,d(M))},N=M=>o.jsx("button",{type:"button",className:"jv-emoji-cell",title:ol()==="zh"?M[3]:M[1],onClick:()=>k(M[0]),children:M[0]},M[0]),E=M=>{var I;const C=[...((I=p.current)==null?void 0:I.querySelectorAll(".jv-emoji-grid button"))??[]],A=C.indexOf(document.activeElement),_={ArrowRight:1,ArrowLeft:-1,ArrowDown:9,ArrowUp:-9,Home:0,End:0}[M.key];if(A<0||_===void 0)return;const R=C[M.key==="Home"?A-A%9:M.key==="End"?A-A%9+8:Math.max(0,Math.min(C.length-1,A+_))];R&&(M.preventDefault(),R.focus())};return o.jsxs("div",{className:"jv-emoji-panel",ref:p,onKeyDown:E,children:[o.jsx("div",{className:"jv-emoji-quick",children:uI.map(M=>o.jsx("button",{type:"button",onClick:()=>k(M),children:M},M))}),o.jsxs("label",{className:"jv-emoji-search",children:[o.jsx(ys,{"aria-hidden":"true"}),o.jsx("input",{value:a,onChange:M=>i(M.target.value),placeholder:x("actions.searchEmoji"),"aria-label":x("actions.searchEmoji"),autoFocus:matchMedia("(hover: hover)").matches,onKeyDown:M=>{M.key==="Escape"&&a&&(M.stopPropagation(),i("")),M.key==="Enter"&&(j!=null&&j[0])&&(M.preventDefault(),k(j[0][0]))}})]}),o.jsx("div",{className:"jv-emoji-groups",role:"tablist","data-hidden":!b.length||void 0,children:b.map(({key:M,label:C,Icon:A},_)=>o.jsx("button",{type:"button",role:"tab","aria-selected":!j&&_===c,title:C,onKeyDown:R=>{var G,Y;if(R.key!=="ArrowLeft"&&R.key!=="ArrowRight")return;R.preventDefault();const I=(_+(R.key==="ArrowRight"?1:-1)+b.length)%b.length;S(I),(Y=(G=p.current)==null?void 0:G.querySelectorAll(".jv-emoji-groups button")[I])==null||Y.focus()},onClick:()=>{j?(i(""),requestAnimationFrame(()=>S(_))):S(_)},children:o.jsx(A,{"aria-hidden":"true"})},M))}),o.jsx("div",{className:"jv-emoji-scroll",ref:y,role:j?void 0:"tabpanel",children:j?j.length?o.jsx("div",{className:"jv-emoji-grid",children:j.map(N)}):o.jsx("p",{className:"jv-emoji-empty",children:x("actions.noEmoji")}):b.map(({key:M,label:C,emoji:A},_)=>o.jsxs("section",{className:"jv-emoji-section",ref:R=>{g.current[_]=R},children:[o.jsx("h2",{children:C}),o.jsx("div",{className:"jv-emoji-grid",children:A.map(N)})]},M))})]})}const pI=380,Bb=310;function G5({message:e,members:a,onJump:i}){if(!e.replyTo)return null;const r=a.find(s=>s.id===e.replyTo.senderId);return o.jsxs("button",{type:"button",className:"jv-reply-quote",onClick:()=>i(e.replyTo.id),children:[o.jsx("span",{className:"jv-reply-author",children:pi(r)}),o.jsx("span",{className:"jv-reply-text",children:go(e.replyTo)})]})}function Y5({message:e,me:a,members:i,onReact:r,onError:s}){return e.reactions.length?o.jsx("div",{className:"jv-reactions",children:e.reactions.map(c=>{const d=c.memberIds.includes(a);return o.jsxs("button",{type:"button",className:"jv-reaction","data-mine":d||void 0,title:c.memberIds.map(f=>pi(i.find(h=>h.id===f))).join(x("common.listSeparator")),onClick:()=>{try{r(e,c.emoji,!d)}catch(f){s(f)}},children:[o.jsx("span",{className:"jv-reaction-emoji",children:c.emoji}),o.jsx("span",{className:"jv-reaction-count",children:c.memberIds.length})]},c.emoji)})}):null}function K5({message:e,me:a,onReply:i,onReact:r,onError:s}){const[c,d]=w.useState(!1),[f,h]=w.useState(!1),[p,y]=w.useState(!1),g=w.useRef(null);w.useEffect(()=>{if(!c)return;const k=S=>{var N;(N=g.current)!=null&&N.contains(S.target)||d(!1)};return document.addEventListener("pointerdown",k),()=>document.removeEventListener("pointerdown",k)},[c]);const b=k=>{var N;const S=!((N=e.reactions.find(E=>E.emoji===k))!=null&&N.memberIds.includes(a));try{r(e,k,S)}catch(E){s(E)}d(!1)},j=()=>{var N,E,M,C;const k=(N=g.current)==null?void 0:N.getBoundingClientRect(),S=(M=(E=g.current)==null?void 0:E.closest(".ui-transcript, .ui-pane-body"))==null?void 0:M.getBoundingClientRect();if(k){const A=((S==null?void 0:S.right)??window.innerWidth)-k.left,_=k.right-((S==null?void 0:S.left)??0),R=!!((C=g.current)!=null&&C.closest(".ui-user"));h(((S==null?void 0:S.bottom)??window.innerHeight)-k.bottom<pI),y(R?A>=Bb||A>_:_<Bb&&A>_)}d(!c)};return o.jsxs("div",{className:"jv-message-actions",ref:g,children:[i&&o.jsx(gt,{icon:"arrow-u-up-right",label:x("actions.reply"),onClick:()=>i(e)}),o.jsx(gt,{icon:"smiley-plus",label:x("actions.react"),"aria-expanded":c,onClick:j}),c&&o.jsx("div",{className:"jv-emoji-menu",role:"dialog","aria-label":x("actions.pickEmoji"),"data-up":f||void 0,"data-right":p||void 0,onKeyDown:k=>{k.key==="Escape"&&d(!1)},children:o.jsx(mI,{onPick:b})})]})}const gI=12;function X5({children:e,whole:a=!1}){const i=w.useRef(null),[r,s]=w.useState(null),[c,d]=w.useState(a);w.useLayoutEffect(()=>{const h=i.current;if(!h)return;const p=()=>{const g=parseFloat(getComputedStyle(h).lineHeight)||24,b=Math.round(gI*g);s(h.scrollHeight>b+2*g?b:null)};p();const y=new ResizeObserver(p);return y.observe(h),()=>y.disconnect()},[]);const f=r!==null&&!c;return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:i,className:"jv-long","data-cut":f||void 0,style:f?{maxHeight:r}:void 0,children:e}),r!==null&&o.jsx("button",{type:"button",className:"jv-long-toggle","aria-expanded":c,onClick:()=>d(!c),children:x(c?"fold.less":"fold.more")})]})}function Q5(){const[e,a]=w.useState(new Set);return{has:i=>e.has(i),add:i=>a(r=>new Set(r).add(i))}}function Z5({message:e}){return o.jsxs("div",{className:"jv-folded",children:[o.jsx("span",{className:"jv-folded-text",children:go(e)}),o.jsxs("span",{className:"jv-folded-tag",children:[o.jsx(Ue,{name:"fold"}),x("fold.folded")]})]})}const vI=5*6e4,lo=e=>new Date(e).toDateString(),Fg=(e,a)=>a===void 0||lo(e)!==lo(a),J5=(e,a,i=a==null?void 0:a.createdAt)=>Fg(e.createdAt,i)||(a==null?void 0:a.senderId)!==e.senderId||e.createdAt-a.createdAt>=vI;function yI(e){const a=new Date,i=new Date(e),r=new Date(a.getFullYear(),a.getMonth(),a.getDate()-1);if(lo(e)===lo(a.getTime()))return x("chat.today");if(lo(e)===r.toDateString())return x("chat.yesterday");const s=ol()==="zh"?"long":"short";return i.getFullYear()===a.getFullYear()?na(e,{weekday:"short",month:s,day:"numeric"}):na(e,{year:"numeric",month:s,day:"numeric"})}const xI=e=>na(e,{year:"numeric",month:ol()==="zh"?"long":"short",day:"numeric",hour:ol()==="zh"?"2-digit":"numeric",minute:"2-digit"}),bI=e=>lo(e)===lo(Date.now())?sl(e):`${lf(e)} ${sl(e)}`;function W5({time:e}){return o.jsx("div",{className:"jv-day",role:"separator",children:o.jsx("span",{children:yI(e)})})}function S0({time:e,className:a}){return o.jsx("time",{className:a,dateTime:new Date(e).toISOString(),title:xI(e),children:sl(e)})}const eS="jarvy-notice-closed",jI=()=>{try{return JSON.parse(localStorage.getItem(eS)??"[]")}catch{return[]}};function Sr({member:e,bots:a,size:i,working:r=!1}){const s=(e==null?void 0:e.kind)==="bot"?a.find(c=>c.id===e.id):void 0;return s?o.jsx(hl,{color:s.color,mood:s.mood,size:i,badge:r?"working":void 0,crown:s.agent}):o.jsx("span",{className:"ui-user-avatar jv-user-avatar",style:{width:i,height:i,fontSize:Math.round(i*.38)},children:((e==null?void 0:e.name)??"?").slice(0,2).toUpperCase()})}function wI({chat:e,members:a,bots:i,infoOpen:r,membersOpen:s,threadsOpen:c,searchOpen:d,onNav:f,onInfo:h,onMembers:p,onThreads:y,onSearch:g}){const b=a.filter(j=>e.memberIds.includes(j.id));return o.jsxs("header",{className:"ui-chat-header jv-channel-header",children:[o.jsxs("div",{className:"ui-header-left",children:[o.jsx(gt,{icon:"layout-sidebar-left",className:"ui-mobile-only",label:x("common.openNav"),onClick:f}),o.jsxs("button",{type:"button",className:"jv-channel-title","aria-label":x("channel.infoFor",{name:e.title}),"aria-pressed":r,onClick:h,children:[o.jsx("span",{className:"jv-hash",children:"#"}),e.title,o.jsx(Ue,{name:"chevron-down"})]}),e.topic&&o.jsx("span",{className:"jv-channel-topic",children:e.topic})]}),o.jsxs("div",{className:"ui-header-actions",children:[o.jsxs("button",{type:"button",className:"jv-members-button","aria-label":x("channel.membersCount",{count:b.length}),"aria-pressed":s,title:x("channel.members"),onClick:p,children:[o.jsx("span",{className:"jv-stack",children:b.slice(0,3).map(j=>o.jsx("span",{className:"jv-stack-item",children:o.jsx(Sr,{member:j,bots:i,size:22})},j.id))}),o.jsx("span",{className:"jv-members-count",children:b.length})]}),o.jsx(gt,{icon:"search",label:x("channel.search"),"aria-pressed":d,className:"jv-threads-button",onClick:g}),o.jsx(gt,{icon:"chat-bubble",label:x("channel.threads"),"aria-pressed":c,className:"jv-threads-button",onClick:y})]})]})}function kI({chat:e,onSave:a}){var j;const[i,r]=w.useState(jI),[s,c]=w.useState(null),[d,f]=w.useState(!1);w.useEffect(()=>c(null),[e.id]);const h=!i.includes(e.id),p=e.note,y=()=>r(k=>{const S=h?[...k,e.id]:k.filter(N=>N!==e.id);return localStorage.setItem(eS,JSON.stringify(S)),S}),g=async()=>{if(s!=null&&s.trim()){f(!0);try{await a(s.trim()),c(null)}finally{f(!1)}}};if(s!==null)return o.jsxs("div",{className:"jv-notice","data-editing":!0,children:[o.jsxs("div",{className:"jv-notice-head",children:[o.jsx(Ue,{name:"megaphone"}),o.jsx("strong",{children:x("notice.edit")})]}),o.jsx("textarea",{className:"jv-notice-input",value:s,autoFocus:!0,"aria-label":x("notice.content"),onChange:k=>c(k.target.value)}),o.jsxs("div",{className:"jv-notice-actions",children:[o.jsx("button",{type:"button",className:"ui-button",onClick:()=>c(null),children:x("common.cancel")}),o.jsx("button",{type:"button",className:"ui-button ui-primary",disabled:d||!s.trim(),onClick:()=>void g(),children:x("common.save")})]})]});if(!p)return o.jsxs("div",{className:"jv-notice","data-empty":!0,children:[o.jsx(Ue,{name:"megaphone"}),o.jsx("span",{className:"jv-muted",children:x("notice.none")}),o.jsx(gt,{icon:"pencil",label:x("notice.edit"),onClick:()=>c("")})]});const b=((j=p.text.split(`
779
+ `).find(k=>k.trim()&&!k.startsWith("#")))==null?void 0:j.replace(/[*`|>-]/g,"").trim())??"";return o.jsxs("div",{className:"jv-notice","data-open":h||void 0,children:[o.jsxs("div",{className:"jv-notice-head",children:[o.jsxs("button",{type:"button",className:"jv-notice-toggle","aria-expanded":h,onClick:y,children:[o.jsx(Ue,{name:"megaphone"}),o.jsx("strong",{children:x("notice.title")}),!h&&o.jsx("span",{className:"jv-notice-first",children:b}),o.jsx(Ue,{name:h?"chevron-down":"chevron-right"})]}),o.jsxs("span",{className:"jv-muted jv-notice-meta",children:[p.updatedBy.name," · ",na(p.updatedAt,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})," · ",x("notice.version",{version:p.version})]}),o.jsx(gt,{icon:"pencil",label:x("notice.edit"),onClick:()=>c(p.text)})]}),h&&o.jsx("div",{className:"jv-notice-body ui-bubble jv-flat",children:o.jsx(Kc,{text:p.text})})]})}function tf({messages:e,members:a,bots:i,me:r,divider:s,before:c,activeQuestion:d,onSettled:f,onPreview:h,onReply:p,onOpenThread:y,onQuote:g,onReact:b,onFold:j,onJump:k,onError:S}){var M;const N=(M=e.find(C=>C.sequence>s&&C.senderId!==r))==null?void 0:M.id,E=Q5();return o.jsx(o.Fragment,{children:e.map((C,A)=>{const _=e[A-1],R=a.find(L=>L.id===C.senderId),I=(_==null?void 0:_.createdAt)??c,G=!J5(C,_,I)&&C.id!==N,Y=C.folded;return o.jsxs("div",{children:[Fg(C.createdAt,I)&&o.jsx(W5,{time:C.createdAt}),C.id===N&&o.jsx("div",{className:"jv-divider",role:"separator",children:o.jsx("span",{children:x("chat.newBelow")})}),o.jsxs("div",{className:"jv-row",tabIndex:-1,"data-message":C.id,"data-folded":G||void 0,"data-mention":C.mentions.includes(r)||void 0,"data-shut":Y||void 0,children:[o.jsx("div",{className:"jv-row-gutter",children:G?o.jsx(S0,{time:C.createdAt,className:"jv-row-time"}):o.jsx(Sr,{member:R,bots:i,size:32})}),o.jsxs("div",{className:"jv-row-body",children:[!G&&o.jsxs("div",{className:"jv-row-head",children:[o.jsx("strong",{children:pi(R)}),(R==null?void 0:R.kind)==="bot"&&o.jsx("span",{className:"jv-role",children:"Bot"}),o.jsx(S0,{time:C.createdAt})]}),Y?o.jsx(Z5,{message:C}):o.jsxs(o.Fragment,{children:[C.echoOf&&o.jsx("button",{type:"button",className:"jv-echo",onClick:()=>y==null?void 0:y(C.echoOf.id),children:x("channel.echo",{title:C.echoOf.title})}),C.replyTo&&o.jsx(G5,{message:C,members:a,onJump:L=>k==null?void 0:k(L)}),C.question?o.jsx(I5,{message:{...C,question:C.question},keyboard:C.id===d,onSettled:f}):o.jsxs("div",{className:"ui-bubble jv-flat",children:[C.content&&o.jsx(X5,{whole:E.has(C.id),children:o.jsx(q5,{message:C,members:a,me:r,onJump:k})}),C.attachments.length>0&&o.jsx(O5,{files:C.attachments,onOpen:L=>h(C.attachments,L)})]}),b&&o.jsx(Y5,{message:C,me:r,members:a,onReact:b,onError:S??(()=>{})})]}),C.thread&&C.thread.replies>0&&o.jsxs("button",{type:"button",className:"jv-thread-link","data-done":C.thread.status==="done"||void 0,onClick:()=>y==null?void 0:y(C.thread.id),children:[x("channel.replies",{count:C.thread.replies}),C.thread.status==="done"&&` · ${x("channel.threadDone")}`,C.thread.lastReplyAt&&o.jsx("span",{className:"jv-muted",children:x("channel.lastReply",{time:bI(C.thread.lastReplyAt)})})]})]}),o.jsxs("div",{className:"jv-row-actions",children:[p&&!C.echoOf&&o.jsx(gt,{icon:"chat-bubble",label:x("channel.replyInThread"),onClick:()=>p(C)}),b&&o.jsx(K5,{message:C,me:r,onReply:g,onReact:b,onError:S??(()=>{})}),j&&o.jsx(gt,{icon:C.folded?"unfold":"fold",label:x(C.folded?"actions.unfold":"actions.fold"),onClick:()=>{C.folded&&E.add(C.id),j(C,!C.folded)}})]})]})]},C.id)})})}function tS({candidates:e,bots:a,busy:i,onCancel:r,onConfirm:s}){const[c,d]=w.useState(""),[f,h]=w.useState([]),p=e.filter(g=>g.name.toLowerCase().includes(c.trim().toLowerCase())),y=g=>h(b=>b.includes(g)?b.filter(j=>j!==g):[...b,g]);return o.jsxs("div",{className:"jv-picker",children:[o.jsx("div",{className:"ui-field",children:o.jsx("input",{type:"search",value:c,autoFocus:!0,placeholder:x("common.searchMembers"),"aria-label":x("common.searchMembers"),onChange:g=>d(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),p.length===1&&y(p[0].id))}})}),o.jsxs("div",{className:"jv-picker-list",role:"listbox","aria-multiselectable":"true","aria-label":x("dialogs.candidates"),children:[p.map(g=>o.jsxs("button",{type:"button",role:"option","aria-selected":f.includes(g.id),className:"jv-member-option",onClick:()=>y(g.id),children:[o.jsx(Sr,{member:g,bots:a,size:24}),o.jsx("span",{className:"jv-member-name",children:g.name}),o.jsx("span",{className:"jv-muted",children:g.kind==="bot"?"Bot":x("common.member")}),o.jsx("span",{className:"jv-check",children:f.includes(g.id)&&o.jsx(Ue,{name:"check"})})]},g.id)),p.length===0&&o.jsx("p",{className:"jv-picker-empty",children:x(e.length?"common.noMatch":"dialogs.allInside")})]}),o.jsxs("div",{className:"ui-dialog-actions",children:[o.jsx("span",{className:"jv-spacer"}),o.jsx("button",{type:"button",className:"ui-button",onClick:r,children:x("common.cancel")}),o.jsx("button",{type:"button",className:"ui-button ui-primary",disabled:i||f.length===0,onClick:()=>s(f),children:f.length?x("dialogs.addCount",{count:f.length}):x("common.add")})]})]})}function SI({chat:e,members:a,bots:i,onClose:r,onChanged:s}){const{busy:c,error:d,run:f}=xn();async function h(p){await f("add",async()=>{let y=e;for(const g of p)y=await he.addMember(e.id,g);s(y),r()},"dialogs.addFailed")}return o.jsxs(gs,{title:x("info.addMembers"),onClose:r,className:"jv-channel-dialog",children:[o.jsx(tS,{candidates:a.filter(p=>!e.memberIds.includes(p.id)),bots:i,busy:c,onCancel:r,onConfirm:p=>void h(p)}),d&&o.jsx("p",{className:"jv-form-error",role:"alert",children:d})]})}function CI({sections:e,members:a,bots:i,me:r,onClose:s,onSaved:c}){const d=w.useId(),[f,h]=w.useState(""),[p,y]=w.useState(""),[g,b]=w.useState(null),[j,k]=w.useState([r]),[S,N]=w.useState(!1),{busy:E,error:M,run:C}=xn();async function A(R){R.preventDefault(),!(!f.trim()||E)&&await C("save",async()=>c(await he.createChannel({name:f.trim(),topic:p.trim(),sectionId:g,memberIds:j.filter(I=>I!==r)})),"common.saveFailed")}const _=a.filter(R=>j.includes(R.id));return S?o.jsx(gs,{title:x("info.addMembers"),onClose:s,className:"jv-channel-dialog",children:o.jsx(tS,{candidates:a.filter(R=>!j.includes(R.id)),bots:i,busy:!1,onCancel:()=>N(!1),onConfirm:R=>{k(I=>[...I,...R]),N(!1)}})}):o.jsx(gs,{title:x("sidebar.newChannel"),onClose:s,className:"jv-channel-dialog",children:o.jsxs("form",{onSubmit:R=>void A(R),children:[o.jsxs("div",{className:"ui-field",children:[o.jsx("label",{htmlFor:`${d}-name`,children:x("info.name")}),o.jsx("input",{id:`${d}-name`,value:f,maxLength:80,autoFocus:!0,placeholder:x("info.newChannel"),onChange:R=>h(R.target.value)})]}),o.jsxs("div",{className:"ui-field",children:[o.jsx("label",{htmlFor:`${d}-topic`,children:x("info.topic")}),o.jsx("input",{id:`${d}-topic`,value:p,maxLength:200,placeholder:x("dialogs.optional"),onChange:R=>y(R.target.value)})]}),o.jsxs("div",{className:"ui-field",children:[o.jsx("label",{htmlFor:`${d}-section`,children:x("info.section")}),o.jsx(E5,{id:`${d}-section`,value:g,sections:e,onChange:b})]}),o.jsxs("div",{className:"jv-members",children:[o.jsxs("div",{className:"jv-members-head",children:[o.jsxs("span",{children:[x("channel.members")," · ",_.length]}),o.jsxs("button",{type:"button",className:"ui-button",onClick:()=>N(!0),children:[o.jsx(Ue,{name:"person-add"}),x("info.addMembers")]})]}),_.map(R=>o.jsxs("div",{className:"jv-member-option",children:[o.jsx(Sr,{member:R,bots:i,size:24}),o.jsx("span",{className:"jv-member-name",children:R.name}),o.jsx("span",{className:"jv-muted",children:R.id===r?x("common.you"):R.kind==="bot"?"Bot":x("common.member")}),R.id!==r&&o.jsx(gt,{icon:"close",label:x("members.remove",{name:R.name}),className:"jv-member-remove",onClick:()=>k(I=>I.filter(G=>G!==R.id))})]},R.id))]}),M&&o.jsx("p",{className:"jv-form-error",role:"alert",children:M}),o.jsxs("div",{className:"ui-dialog-actions",children:[o.jsx("span",{className:"jv-spacer"}),o.jsx("button",{type:"button",className:"ui-button",onClick:s,children:x("common.cancel")}),o.jsx("button",{type:"submit",className:"ui-button ui-primary",disabled:E||!f.trim(),children:x("common.create")})]})]})})}function NI({section:e,onClose:a,onSaved:i,onDeleted:r}){const s=w.useId(),[c,d]=w.useState((e==null?void 0:e.name)??""),[f,h]=w.useState(!1),[p,y]=w.useState("");async function g(j){if(j.preventDefault(),!(!c.trim()||f)){h(!0),y("");try{i(e?await he.updateSection(e.id,{name:c.trim()}):await he.createSection({name:c.trim()}))}catch(k){y(en(k,"common.saveFailed")),h(!1)}}}async function b(){if(!(!e||!confirm(x("dialogs.deleteSection",{name:e.name})))){h(!0);try{await he.deleteSection(e.id),r==null||r(e.id)}catch(j){y(en(j,"dialogs.deleteFailed")),h(!1)}}}return o.jsx(gs,{title:x(e?"dialogs.editSection":"sidebar.newSection"),onClose:a,children:o.jsxs("form",{onSubmit:j=>void g(j),children:[o.jsxs("div",{className:"ui-field",children:[o.jsx("label",{htmlFor:`${s}-name`,children:x("dialogs.sectionName")}),o.jsx("input",{id:`${s}-name`,value:c,maxLength:80,autoFocus:!0,placeholder:x("dialogs.newSection"),onChange:j=>d(j.target.value)})]}),p&&o.jsx("p",{className:"jv-form-error",role:"alert",children:p}),o.jsxs("div",{className:"ui-dialog-actions",children:[e&&o.jsx("button",{type:"button",className:"ui-button jv-danger",disabled:f,onClick:()=>void b(),children:x("common.delete")}),o.jsx("span",{className:"jv-spacer"}),o.jsx("button",{type:"button",className:"ui-button",onClick:a,children:x("common.cancel")}),o.jsx("button",{type:"submit",className:"ui-button ui-primary",disabled:f||!c.trim(),children:x(e?"common.save":"common.create")})]})]})})}function EI({bot:e,chats:a,onClose:i,onConfirm:r}){const[s,c]=w.useState(!1),[d,f]=w.useState(!1);return o.jsx(gs,{title:x("deleteBot.title",{name:e.name}),onClose:i,className:"jv-dialog",children:o.jsxs("div",{className:"jv-dialog-body",children:[o.jsx("p",{children:x("deleteBot.after")}),o.jsxs("ul",{className:"jv-dialog-list",children:[o.jsx("li",{children:x("deleteBot.chats",{count:a})}),o.jsx("li",{children:x("deleteBot.messages",{name:x("member.deleted",{name:e.name})})}),o.jsx("li",{children:x("deleteBot.history")})]}),o.jsxs("label",{className:"jv-checkline",children:[o.jsx("input",{type:"checkbox",checked:s,onChange:h=>c(h.target.checked)}),o.jsx("span",{children:x("deleteBot.files")})]}),o.jsx("p",{className:"jv-hint",children:x("deleteBot.filesHint")}),o.jsxs("div",{className:"jv-dialog-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",onClick:i,children:x("common.cancel")}),o.jsx(Ne,{type:"button",className:"jv-primary",disabled:d,onClick:()=>{f(!0),r(s).finally(()=>f(!1))},children:x(d?"deleteBot.deleting":"common.delete")})]})]})})}function nS({title:e,body:a,confirm:i,onClose:r,onConfirm:s}){const[c,d]=w.useState(!1);return o.jsx(gs,{title:e,onClose:r,className:"jv-dialog",children:o.jsxs("div",{className:"jv-dialog-body",children:[o.jsx("p",{children:a}),o.jsxs("div",{className:"jv-dialog-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",onClick:r,children:x("common.cancel")}),o.jsx(Ne,{type:"button",className:"jv-primary",disabled:c,onClick:()=>{d(!0),s().finally(()=>d(!1))},children:c?x("deleteBot.working"):i})]})]})})}function TI({target:e,x:a,y:i,onClose:r,onOpenBot:s,onSettings:c,onPin:d,onMute:f,onDeleteChat:h,onDeleteBot:p}){const y=w.useRef(null);w.useEffect(()=>{const j=S=>{var N;(N=y.current)!=null&&N.contains(S.target)||r()},k=S=>{S.key==="Escape"&&r()};return document.addEventListener("pointerdown",j),document.addEventListener("keydown",k),()=>{document.removeEventListener("pointerdown",j),document.removeEventListener("keydown",k)}},[r]);const g=e.chat,b={left:Math.max(8,Math.min(a,window.innerWidth-200)),top:Math.max(8,Math.min(i,window.innerHeight-210))};return o.jsxs("div",{ref:y,className:"ui-popover jv-entry-menu",role:"menu","aria-label":x("entry.menu"),style:b,children:[g&&o.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>{d(g,!g.pinned),r()},children:[o.jsx(Ue,{name:"pin"}),o.jsx("span",{className:"ui-menu-copy",children:x(g.pinned?"entry.unpin":"entry.pin")})]}),g&&o.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>{f(g,!g.muted),r()},children:[o.jsx(Ue,{name:g.muted?"bell":"bell-slash"}),o.jsx("span",{className:"ui-menu-copy",children:x(g.muted?"entry.unmute":"entry.mute")})]}),e.kind==="dm"?o.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>{s(e.bot),r()},children:[o.jsx(Ue,{name:"gear"}),o.jsx("span",{className:"ui-menu-copy",children:x("entry.botInfo")})]}):o.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>{c(e.chat),r()},children:[o.jsx(Ue,{name:"info"}),o.jsx("span",{className:"ui-menu-copy",children:x("entry.channelInfo")})]}),!(e.kind==="dm"&&e.bot.agent)&&o.jsx("hr",{className:"ui-menu-divider"}),e.kind==="dm"?!e.bot.agent&&o.jsxs("button",{role:"menuitem",className:"ui-menu-item jv-menu-danger",onClick:()=>{p(e.bot),r()},children:[o.jsx(Ue,{name:"close"}),o.jsx("span",{className:"ui-menu-copy",children:x("entry.deleteBot")})]}):o.jsxs("button",{role:"menuitem",className:"ui-menu-item jv-menu-danger",onClick:()=>{h(e.chat),r()},children:[o.jsx(Ue,{name:"close"}),o.jsx("span",{className:"ui-menu-copy",children:x("entry.deleteChannel")})]})]})}function AI({files:e,initialIndex:a=0,onClose:i}){const[r,s]=w.useState(a),[c,d]=w.useState("preview"),[f,h]=w.useState(!1),[p,y]=w.useState(""),[g,b]=w.useState(""),[j,k]=w.useState(""),[S,N]=w.useState(!0),[E,M]=w.useState(0),[C,A]=w.useState(!1),[_,R]=w.useState(!1),I=w.useRef(null),G=w.useRef(null),Y=w.useRef(new Map),L=e[r],P=Xc(L),q=T5(P),Z=FB(P)&&L.size>UB,U=!q&&!Z&&P!=="download";w.useEffect(()=>{const le=I.current,ne=document.activeElement;return le.showModal(),()=>{le.close(),ne!=null&&ne.isConnected&&ne.focus({preventScroll:!0})}},[]),w.useEffect(()=>{const le=new AbortController;return y(""),b(""),k(""),d("preview"),A(!1),R(!1),N(U),U&&(Tc(P)?R5(L,le.signal).then(b):_5(L,le.signal).then(y)).then(()=>N(!1)).catch(ne=>{le.signal.aborted||(k(en(ne,"files.readError")),N(!1))}),()=>le.abort()},[L.id,E]),w.useEffect(()=>{G.current&&(G.current.scrollTop=Y.current.get(`${r}:${c}`)??0)},[r,c,S]);const F=()=>{var le;return Y.current.set(`${r}:${c}`,((le=G.current)==null?void 0:le.scrollTop)??0)},X=le=>{F(),s(Math.max(0,Math.min(e.length-1,le)))},$=w.useMemo(()=>P==="html"&&p?GB(p):null,[P,p]),H=U&&["markdown","html"].includes(P)&&!S&&!j,ie=Tc(P)||q&&!_?"ui-image-view":P==="html"&&c==="preview"?"ui-html-view":P==="markdown"&&c==="preview"?"ui-document":"",O=o.jsxs("a",{className:"ui-button",href:di(L),download:L.name,children:[o.jsx(Ue,{name:"cloud-download"}),x("files.downloadFile")]});return ho.createPortal(o.jsxs("dialog",{ref:I,className:"ui-viewer","aria-labelledby":"jvPreviewTitle","data-wide":f||void 0,onCancel:le=>{le.preventDefault(),i()},onKeyDown:le=>{!["ArrowLeft","ArrowRight"].includes(le.key)||["SELECT","INPUT","TEXTAREA"].includes(le.target.tagName)||(le.preventDefault(),X(r+(le.key==="ArrowLeft"?-1:1)))},children:[o.jsxs("header",{className:"ui-preview-header",children:[o.jsxs("div",{className:"ui-preview-heading",children:[o.jsx("h1",{id:"jvPreviewTitle",children:L.name}),o.jsxs("small",{children:[x(A5[P])," · ",M5(L.size)]})]}),o.jsxs("div",{className:"ui-preview-actions",children:[H&&o.jsx("button",{type:"button",className:"ui-button",onClick:()=>{F(),d(c==="source"?"preview":"source")},children:x(c==="source"?"files.showPreview":P==="html"?"files.showSource":"files.showText")}),C&&o.jsx(gt,{icon:"window",label:x("files.openTab"),onClick:()=>window.open(_b(L),"_blank","noopener,noreferrer")}),o.jsx("a",{className:"ui-iconbtn",href:di(L),download:L.name,"aria-label":x("files.download",{name:L.name}),title:x("files.download",{name:L.name}),children:o.jsx(Ue,{name:"cloud-download"})}),o.jsx(gt,{icon:f?"arrows-contract":"arrows-expand",label:x(f?"files.narrow":"files.widen"),"data-action":"ui-wide",onClick:()=>h(!f)}),o.jsx(gt,{icon:"close",label:x("files.closePreview"),"data-action":"ui-close",onClick:i})]})]}),$&&c==="preview"&&!S&&!j&&o.jsxs("div",{className:"jv-run-tip",role:"status",children:[o.jsx("p",{children:C?x("files.running"):x("files.scripts",{count:$.count,hosts:$.hosts.length?x("files.scriptHosts",{hosts:$.hosts.slice(0,3).join(x("common.listSeparator"))+($.hosts.length>3?x("files.andMore"):"")}):""})}),o.jsx("button",{type:"button",className:"ui-button",onClick:()=>A(!C),children:x(C?"files.stop":"files.run")})]}),o.jsx("div",{className:`ui-preview-body ${ie}`,ref:G,tabIndex:-1,children:q?_?o.jsxs("div",{className:"ui-fallback",children:[o.jsx(Ue,{name:`file-${P}`}),o.jsx("strong",{children:x("files.cantPlay")}),o.jsx("p",{children:x("files.cantPlayHint")}),O]}):P==="video"?o.jsx("video",{className:"ui-preview-video",src:di(L),controls:!0,preload:"metadata",playsInline:!0,onError:()=>R(!0)},L.id):o.jsx("audio",{className:"ui-preview-audio",src:di(L),controls:!0,preload:"metadata",onError:()=>R(!0)},L.id):U?S?o.jsx("p",{className:"ui-unloaded",children:x("files.reading")}):j?o.jsxs("div",{className:"ui-error",role:"alert",children:[o.jsx("p",{children:j}),o.jsx("button",{type:"button",className:"ui-button",onClick:()=>M(le=>le+1),children:x("common.retry")})]}):Tc(P)?o.jsx("img",{className:"ui-preview-image",src:g,alt:L.name}):c==="source"||P==="text"?o.jsx("pre",{className:"ui-source",tabIndex:0,children:p}):P==="html"?C?o.jsx("iframe",{title:x("files.runningTitle",{name:L.name}),sandbox:"allow-scripts",src:_b(L),referrerPolicy:"no-referrer",className:"ui-html-frame"},"run"):o.jsx("iframe",{title:L.name,sandbox:"",srcDoc:YB(p),referrerPolicy:"no-referrer",className:"ui-html-frame"},"static"):o.jsx("article",{className:"ui-prose",children:o.jsx(Kc,{text:p})}):o.jsxs("div",{className:"ui-fallback",children:[o.jsx(Ue,{name:"file"}),o.jsx("strong",{children:x("files.downloadToView")}),o.jsx("p",{children:x(Z?"files.tooLarge":"files.unsupported")}),O]})}),e.length>1&&o.jsxs("footer",{className:"ui-preview-nav",children:[o.jsx(gt,{icon:"chevron-left",label:x("files.previous"),disabled:r===0,onClick:()=>X(r-1)}),o.jsx("select",{id:"ui-preview-select","aria-label":x("files.choose"),value:r,onChange:le=>X(Number(le.target.value)),children:e.map((le,ne)=>o.jsx("option",{value:ne,children:le.name},le.id))}),o.jsxs("span",{children:[r+1," / ",e.length]}),o.jsx(gt,{icon:"chevron-right",label:x("files.next"),disabled:r===e.length-1,onClick:()=>X(r+1)})]})]}),document.body)}function MI({dialog:e,entryMenu:a,confirm:i,preview:r,infoBot:s,bots:c,statuses:d,chats:f,sections:h,members:p,connections:y,meId:g,onDialog:b,onEntryMenu:j,onConfirm:k,onPreview:S,onInfoBot:N,onSettings:E,onChannelInfo:M,onOpenChatId:C,chatSaved:A,openChat:_,onSectionSaved:R,onSectionDeleted:I,updateBot:G,openAnywhere:Y,removeChannel:L,deleteBot:P,pinChat:q,muteChat:Z}){return o.jsxs(o.Fragment,{children:[(e==null?void 0:e.kind)==="channel"&&o.jsx(CI,{sections:h,members:hi(p),bots:c,me:g,onClose:()=>b(null),onSaved:U=>{A(U),b(null),_(U)}}),(e==null?void 0:e.kind)==="members"&&o.jsx(SI,{chat:f.find(U=>U.id===e.chat.id)??e.chat,members:hi(p),bots:c,onClose:()=>b(null),onChanged:A}),(e==null?void 0:e.kind)==="section"&&o.jsx(NI,{section:e.section,onClose:()=>b(null),onSaved:R,onDeleted:I}),a&&o.jsx(TI,{target:a.target,x:a.at.x,y:a.at.y,onClose:()=>j(null),onOpenBot:U=>N(U.id),onSettings:U=>{U.type==="channel"&&M(U)},onPin:(U,F)=>void q(U,F),onMute:(U,F)=>void Z(U,F),onDeleteChat:U=>k({kind:"chat",chat:U}),onDeleteBot:U=>k({kind:"bot",bot:U})}),(i==null?void 0:i.kind)==="chat"&&o.jsx(nS,{title:x("app.deleteChannelTitle",{name:i.chat.title}),confirm:x("common.delete"),onClose:()=>k(null),body:x("app.deleteChannelBody"),onConfirm:async()=>{await L(i.chat),k(null)}}),(i==null?void 0:i.kind)==="bot"&&o.jsx(EI,{bot:i.bot,chats:f.filter(U=>U.type==="dm"&&U.botId===i.bot.id).length,onClose:()=>k(null),onConfirm:async U=>{await P(i.bot,U),k(null)}}),s&&o.jsx(qB,{bot:s,status:d[s.id],connections:y,chats:f,onSaved:G,onOpenChat:U=>{N(null),C(U)},onOpenSubscription:Y,onManageModels:()=>{N(null),E("models")},onAddMachine:()=>{N(null),E("addMachine")},onClose:()=>N(null)},s.id),r&&o.jsx(AI,{files:r.files,initialIndex:r.index,onClose:()=>S(null)})]})}function aS(e,a,i){const[r,s]=w.useState(null),[c,d]=w.useState(!1);return w.useEffect(()=>{const f=e.trim();if(!f){s(null),d(!1);return}let h=!0;d(!0);const p=setTimeout(()=>void he.search(f,a).then(y=>{h&&s(y)}).catch(y=>{h&&i(y)}).finally(()=>{h&&d(!1)}),250);return()=>{h=!1,clearTimeout(p)}},[e,a]),{result:r,loading:c}}function iS(e,a,i){var r;return e.type==="thread"?`#${((r=a.find(s=>s.id===e.parentId))==null?void 0:r.title)??x("search.channel")} › ${e.title}`:e.type==="channel"?`#${e.title}`:pi(i.find(s=>s.id===e.botId))}function rS({text:e,query:a,room:i=24}){const r=e.replace(/[*`~#>|]/g,"").replace(/\s+/g," ").trim(),s=r.toLocaleLowerCase().indexOf(a.trim().toLocaleLowerCase());if(s<0||!a.trim())return o.jsx(o.Fragment,{children:r.slice(0,120)});const c=Math.max(0,s-i),d=s+a.trim().length;return o.jsxs(o.Fragment,{children:[c>0&&"…",r.slice(c,s),o.jsx("mark",{className:"jv-hit",children:r.slice(s,d)}),r.slice(d,d+120)]})}const _I=e=>new Date(e).toDateString()===new Date().toDateString()?sl(e):lf(e);function lS({message:e,chat:a,chats:i,members:r,query:s,showPlace:c=!0,onOpen:d}){return o.jsxs("button",{type:"button",className:"jv-hit-row",onClick:()=>d(a,e.id),children:[o.jsxs("span",{className:"jv-hit-head",children:[o.jsx("strong",{children:pi(r.find(f=>f.id===e.senderId))}),c&&o.jsx("span",{className:"jv-hit-place",children:iS(a,i,r)}),o.jsx("time",{dateTime:new Date(e.createdAt).toISOString(),children:_I(e.createdAt)})]}),o.jsx("span",{className:"jv-hit-text",children:o.jsx(rS,{text:Ug(e),query:s})})]})}const Ib=5;function qd({label:e,items:a,empty:i}){const[r,s]=w.useState(!1);return!a.length&&!i?null:o.jsxs("section",{className:"jv-result-group","aria-label":e,children:[o.jsxs("h3",{className:"jv-result-head",children:[e,o.jsx("span",{children:a.length})]}),a.length?r?a:a.slice(0,Ib):o.jsx("p",{className:"jv-result-empty",children:i}),!r&&a.length>Ib&&o.jsxs("button",{type:"button",className:"jv-result-more",onClick:()=>s(!0),children:[x("search.showAll",{count:a.length}),o.jsx(Ue,{name:"chevron-down"})]})]})}function RI({query:e,shown:a,chats:i,members:r,onOpenChat:s,onOpenMessage:c,onError:d}){const{result:f,loading:h}=aS(e,void 0,d),p=((f==null?void 0:f.chats)??[]).filter(g=>!a.has(g.id)),y=g=>{var b,j;return o.jsxs("button",{type:"button",className:"jv-hit-row",onClick:()=>s(g),children:[o.jsxs("span",{className:"jv-hit-head",children:[o.jsx("strong",{children:g.type==="thread"?g.title:`#${g.title}`}),g.type==="thread"&&o.jsx("span",{className:"jv-hit-place",children:iS(g,i,r).split(" › ")[0]})]}),(((b=g.note)==null?void 0:b.text)||g.topic)&&o.jsx("span",{className:"jv-hit-text",children:o.jsx(rS,{text:((j=g.note)==null?void 0:j.text)||g.topic,query:e})})]},g.id)};return o.jsxs("div",{className:"jv-results","aria-live":"polite",children:[o.jsx(qd,{label:x("search.threads"),items:p.filter(g=>g.type==="thread").map(y)}),o.jsx(qd,{label:x("search.channels"),items:p.filter(g=>g.type==="channel").map(y)}),f?o.jsx(qd,{label:x("search.messages"),empty:x("search.noMessages"),items:f.messages.map(({message:g,chat:b})=>o.jsx(lS,{message:g,chat:b,chats:i,members:r,query:e,onOpen:c},g.id))}):h&&o.jsx("p",{className:"jv-result-empty",children:x("search.searching")})]})}function OI({className:e,...a}){return o.jsx("div",{"data-slot":"input-group",role:"group",className:bn("group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30","h-9 min-w-0 has-[>textarea]:h-auto","has-[>[data-align=inline-start]]:[&>input]:pl-2","has-[>[data-align=inline-end]]:[&>input]:pr-2","has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3","has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50","has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",e),...a})}const DI=H0("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]","inline-end":"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]","block-start":"order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3","block-end":"order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3"}},defaultVariants:{align:"inline-start"}});function zI({className:e,align:a="inline-start",...i}){return o.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":a,className:bn(DI({align:a}),e),onClick:r=>{var s,c;r.target.closest("button")||(c=(s=r.currentTarget.parentElement)==null?void 0:s.querySelector("input"))==null||c.focus()},...i})}function LI({className:e,...a}){return o.jsx(xt,{"data-slot":"input-group-control",className:bn("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",e),...a})}function BI({className:e,children:a,...i}){return o.jsxs(SA,{"data-slot":"scroll-area",className:bn("relative",e),...i,children:[o.jsx(CA,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:a}),o.jsx(II,{}),o.jsx(NA,{})]})}function II({className:e,orientation:a="vertical",...i}){return o.jsx(hA,{"data-slot":"scroll-area-scrollbar",orientation:a,className:bn("flex touch-none p-px transition-colors select-none",a==="vertical"&&"h-full w-2.5 border-l border-l-transparent",a==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...i,children:o.jsx(xA,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}const oS="jarvy-collapsed-sections",PI=()=>{try{return JSON.parse(localStorage.getItem(oS)??"[]")}catch{return[]}};function Pb({chat:e}){return e.alerts>0?o.jsx("span",{className:"jv-badge","aria-label":x("sidebar.alerts",{count:e.alerts}),children:e.alerts}):e.unread>0?o.jsx("span",{className:"jv-count","aria-label":x("sidebar.unread",{count:e.unread}),children:e.unread}):null}function sS(e){const a=e.hint;if(!a||a.createdAt<e.updatedAt-1e3)return null;const i=a.chatType==="thread"&&a.chatId!==e.id,r={actor:a.actor,emoji:a.detail,title:a.title.length>16?`${a.title.slice(0,16)}…`:a.title};return a.kind==="reaction"?x(i?"hint.reactionInThread":"hint.reaction",r):x(i?"hint.threadSummary":a.chatType==="thread"?"hint.summary":"hint.notice",r)}function HI(e){var a;return e.type==="channel"&&sS(e)&&((a=e.hint)==null?void 0:a.chatType)==="thread"&&e.hint.chatId!==e.id?e.hint.chatId:null}function Hb({chat:e,channel:a}){const i=sS(e),r=e.lastMessage&&go(e.lastMessage),s=i??(r?a&&e.lastSender?x("sidebar.said",{name:e.lastSender,text:r}):r:a?e.topic:"");return o.jsxs("span",{className:"jv-digest",children:[e.atMe&&o.jsx("span",{className:"jv-at-me",children:x("sidebar.atMe")}),o.jsx("span",{className:i?"jv-hint-line":void 0,children:s})]})}const qb=e=>{const a=e.getBoundingClientRect();return{x:a.right-168,y:a.bottom+4}};function qI({chats:e,sections:a,bots:i,members:r,onOpenMessage:s,onOpenFound:c,onError:d,working:f,asking:h,selected:p,filter:y,followed:g,followedOpen:b,onFilterChange:j,onSelect:k,onOpenBot:S,onOpenFollowed:N,onMenu:E,onEditSection:M}){const[C,A]=w.useState(PI),_=$=>A(H=>{const ie=H.includes($)?H.filter(O=>O!==$):[...H,$];return localStorage.setItem(oS,JSON.stringify(ie)),ie}),R=y.toLocaleLowerCase(),I=e.filter($=>{var H;return $.type!=="thread"&&`${$.title} ${$.topic} ${((H=i.find(ie=>ie.id===$.botId))==null?void 0:H.name)??""}`.toLocaleLowerCase().includes(R)}),G=(g==null?void 0:g.unread)??0,Y=(g==null?void 0:g.mentions)??0,L=I.filter($=>$.type==="channel").sort(($,H)=>Number(H.pinned)-Number($.pinned)||$.title.localeCompare(H.title,"zh-CN")),P=i.map($=>({bot:$,chat:e.find(H=>H.type==="dm"&&H.botId===$.id)})).filter(({bot:$})=>$.name.toLocaleLowerCase().includes(R)).sort(($,H)=>{var ie,O,le,ne;return Number(H.bot.agent)-Number($.bot.agent)||+!!((ie=H.chat)!=null&&ie.pinned)-+!!((O=$.chat)!=null&&O.pinned)||(((le=H.chat)==null?void 0:le.updatedAt)??0)-(((ne=$.chat)==null?void 0:ne.updatedAt)??0)}),q=$=>o.jsxs("div",{className:"jv-side-wrap",onContextMenu:H=>{H.preventDefault(),E({kind:"channel",chat:$},{x:H.clientX,y:H.clientY})},children:[o.jsxs("button",{type:"button",className:"jv-side-row","data-active":p===$.id||void 0,"data-unread":$.unread>0||void 0,"aria-current":p===$.id?"page":void 0,onClick:()=>k($),children:[$.pinned?o.jsx(Fp,{className:"jv-side-pin","aria-label":x("sidebar.pinned")}):o.jsx("span",{className:"jv-hash","aria-hidden":"true",children:"#"}),o.jsxs("span",{className:"jv-side-text",children:[o.jsxs("span",{className:"jv-side-line",children:[o.jsx("span",{className:"jv-side-label",title:$.title,children:$.title}),$.muted&&o.jsx("span",{className:"jv-side-muted","aria-label":x("sidebar.muted"),children:o.jsx(Ue,{name:"bell-slash"})})]}),o.jsxs("span",{className:"jv-side-line",children:[o.jsx(Hb,{chat:$,channel:!0}),o.jsx(Pb,{chat:$})]})]})]}),o.jsx("button",{type:"button",className:"jv-side-more","aria-label":x("sidebar.more",{name:$.title}),onClick:H=>E({kind:"channel",chat:$},qb(H.currentTarget)),children:o.jsx(tx,{"aria-hidden":"true"})})]},$.id),Z=({bot:$,chat:H})=>{const ie=h.has($.id)?"asking":f.has($.id)?"working":void 0,O=!!H&&p===H.id;return o.jsxs("div",{className:"shadcn-chat-row relative",onContextMenu:le=>{le.preventDefault(),E({kind:"dm",bot:$,chat:H},{x:le.clientX,y:le.clientY})},children:[o.jsxs(Ne,{type:"button",variant:"ghost","data-active":O,"aria-current":O?"page":void 0,className:"h-15 w-full justify-start gap-2.5 rounded-md px-2 text-left hover:bg-accent/70 data-[active=true]:bg-accent data-[active=true]:text-accent-foreground",onClick:()=>H?k(H):S($),children:[o.jsx(hl,{color:$.color,mood:$.mood,size:36,badge:ie,crown:$.agent}),ie&&o.jsx("span",{className:"sr-only",children:x(ie==="asking"?"sidebar.asking":"sidebar.working")}),o.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[o.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[o.jsx("span",{className:`min-w-0 flex-1 truncate text-sm ${H!=null&&H.unread?"font-semibold":"font-medium"}`,title:$.name,children:$.name}),(H==null?void 0:H.muted)&&o.jsx("span",{className:"jv-side-muted","aria-label":x("sidebar.muted"),children:o.jsx(Ue,{name:"bell-slash"})}),(H==null?void 0:H.pinned)&&o.jsx(Fp,{className:"jv-dm-pin shrink-0","aria-label":x("sidebar.pinned")}),H&&o.jsx("time",{className:"shadcn-chat-time shrink-0 text-[11px] font-normal text-muted-foreground",dateTime:new Date(H.updatedAt).toISOString(),children:sl(H.updatedAt)})]}),o.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-normal text-muted-foreground",children:H?o.jsx(Hb,{chat:H,channel:!1}):""}),H&&o.jsx(Pb,{chat:H})]})]})]}),o.jsx(Ne,{type:"button",variant:"ghost",size:"icon-xs","aria-label":x("sidebar.more",{name:$.name}),className:"shadcn-chat-more absolute top-4 right-2 opacity-0",onClick:le=>E({kind:"dm",bot:$,chat:H},qb(le.currentTarget)),children:o.jsx(tx,{"aria-hidden":"true"})})]},$.id)},U=($,H,ie,O,le)=>o.jsxs("div",{className:"jv-side-section-head",children:[o.jsxs("button",{type:"button",className:"jv-side-section-toggle","aria-expanded":!ie,onClick:()=>_($),children:[o.jsx("span",{className:"jv-side-chevron",children:o.jsx(Ue,{name:ie?"chevron-right":"chevron-down"})}),o.jsxs("span",{className:"jv-side-section-name",children:[H,ie&&O&&o.jsx("span",{className:"jv-dot","aria-label":x("sidebar.hasUnread")})]})]}),le&&o.jsx("button",{type:"button",className:"jv-side-section-edit","aria-label":x("sidebar.editSection",{name:H}),onClick:()=>M(le),children:o.jsx(Ue,{name:"pencil"})})]}),F=$=>!R&&C.includes($),X=($,H,ie,O)=>o.jsxs("div",{className:"jv-side-section",children:[U($,H,F($),ie.some(le=>le.unread>0),O),!F($)&&ie.map(q)]},$);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"mx-3 mt-1 mb-2 shrink-0",role:"search",children:o.jsxs(OI,{className:"h-9 bg-background",children:[o.jsx(LI,{id:"jarvy-search",type:"search",value:y,onChange:$=>j($.target.value),placeholder:x("sidebar.search"),"aria-label":x("sidebar.search"),onKeyDown:$=>{$.key==="Escape"&&y&&($.preventDefault(),j(""))},className:"text-sm"}),o.jsx(zI,{align:"inline-start",children:o.jsx(ys,{"aria-hidden":"true"})})]})}),o.jsx(BI,{className:"min-h-0 flex-1",type:"auto",children:R?o.jsxs("nav",{className:"jv-side-nav jv-side-search px-3 pb-6","aria-label":x("sidebar.results"),children:[o.jsx(qd,{label:x("sidebar.chats"),items:[...L.map(q),...P.map(Z)]}),o.jsx(RI,{query:y,shown:new Set(L.map($=>$.id)),chats:e,members:r,onOpenChat:c,onOpenMessage:s,onError:d})]}):o.jsxs("nav",{className:"jv-side-nav px-3 pb-6","aria-label":x("sidebar.nav"),children:[!!(g!=null&&g.total)&&o.jsxs("button",{type:"button",className:"jv-side-row jv-side-top","data-active":b||void 0,"data-unread":G>0||void 0,"aria-current":b?"page":void 0,onClick:N,children:[o.jsx(Ue,{name:"chat-bubble"}),o.jsx("span",{className:"jv-side-label",children:x("sidebar.followed")}),Y>0?o.jsx("span",{className:"jv-badge",children:Y}):G>0&&o.jsx("span",{className:"jv-count",children:G})]}),a.map($=>X(`s:${$.id}`,$.name,L.filter(H=>H.sectionId===$.id),$)),L.some($=>!$.sectionId||!a.some(H=>H.id===$.sectionId))&&X("channels",x("sidebar.channels"),L.filter($=>!$.sectionId||!a.some(H=>H.id===$.sectionId))),o.jsxs("div",{className:"jv-side-section",children:[U("dms",x("sidebar.dms"),F("dms"),P.some(({chat:$})=>!!($!=null&&$.unread))),!F("dms")&&o.jsx("div",{className:"space-y-1",children:P.map(Z)}),!F("dms")&&P.length===0&&o.jsx("p",{className:"jv-side-empty",children:x("sidebar.noDms")})]})]})})]})}function UI({username:e,chats:a,sections:i,bots:r,members:s,followed:c,followedOpen:d,working:f,asking:h,selected:p,filter:y,creating:g,createMenu:b,accountMenu:j,onFilterChange:k,onOpenFollowed:S,onOpenChat:N,onOpenBot:E,onOpenMenu:M,onEditSection:C,onCreate:A,onFind:_,onOpenFound:R,onError:I,onToggleCreate:G,onToggleAccount:Y,onSettings:L,onToggleTheme:P,onLogOut:q}){const Z=w.useRef(null),U=w.useRef(null);return w.useEffect(()=>{if(!j&&!b)return;const F=X=>{var $,H;j&&!(($=U.current)!=null&&$.contains(X.target))&&Y(!1),b&&!((H=Z.current)!=null&&H.contains(X.target))&&G(!1)};return document.addEventListener("pointerdown",F),()=>document.removeEventListener("pointerdown",F)},[j,b]),o.jsxs(o.Fragment,{children:[o.jsxs("aside",{className:"ui-sidebar","aria-label":x("sidebar.label"),children:[o.jsx("header",{className:"ui-sidebar-header",children:o.jsxs("div",{className:"jarvy-sidebar-create",ref:Z,children:[o.jsx(gt,{icon:"add",label:x("sidebar.create"),"aria-expanded":b,"aria-haspopup":"menu",disabled:g,onClick:()=>G(!b)}),b&&o.jsxs("div",{className:"ui-popover jarvy-create-menu",role:"menu","aria-label":x("sidebar.createMenu"),children:[o.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>A("channel"),children:[o.jsx(Ue,{name:"list-bullets"}),o.jsx("span",{className:"ui-menu-copy",children:x("sidebar.newChannel")})]}),o.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>A("section"),children:[o.jsx(Ue,{name:"folder"}),o.jsx("span",{className:"ui-menu-copy",children:x("sidebar.newSection")})]}),o.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:()=>A("bot"),children:[o.jsx(Ue,{name:"person-add"}),o.jsx("span",{className:"ui-menu-copy",children:x("sidebar.newBot")})]})]})]})}),o.jsx(qI,{chats:a,sections:i,bots:r,members:s,onOpenMessage:_,onOpenFound:R,onError:I,working:f,asking:h,selected:p,filter:y,onFilterChange:k,followed:c,followedOpen:d,onOpenFollowed:S,onSelect:N,onOpenBot:E,onMenu:M,onEditSection:C}),o.jsx("footer",{className:"ui-sidebar-footer",children:o.jsxs("button",{type:"button",className:"ui-footer-entry","aria-label":x("account.menuFor",{name:e}),"aria-expanded":j,onClick:()=>Y(!j),children:[o.jsx("span",{className:"ui-user-avatar",children:e.slice(0,2).toUpperCase()}),o.jsx("span",{children:e}),o.jsx(Ue,{name:"chevron-down"})]})})]}),j&&o.jsxs("div",{ref:U,className:"ui-popover jarvy-account-menu",role:"menu","aria-label":x("account.menu"),children:[o.jsx("div",{className:"ui-menu-note ui-small",children:e}),o.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:L,children:[o.jsx(Ue,{name:"gear"}),o.jsx("span",{className:"ui-menu-copy",children:x("settings.title")})]}),o.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:P,children:[o.jsx(Ue,{name:"moon"}),o.jsx("span",{className:"ui-menu-copy",children:x("account.toggleTheme")})]}),o.jsx("hr",{className:"ui-menu-divider"}),o.jsxs("button",{role:"menuitem",className:"ui-menu-item",onClick:q,children:[o.jsx(Ue,{name:"arrow-bracket-to-left"}),o.jsx("span",{className:"ui-menu-copy",children:x("account.signOut")})]})]})]})}function FI({textarea:e,value:a,setValue:i,inside:r,outside:s,bots:c,onInvite:d,participants:f}){const[h,p]=w.useState(null),[y,g]=w.useState(0),[b,j]=w.useState(null),k=w.useRef(null),S=w.useRef(null),N=w.useRef(null);w.useLayoutEffect(()=>{N.current===null||!e.current||(e.current.focus(),e.current.setSelectionRange(N.current,N.current),N.current=null)},[a,e]);const E=(O,le)=>O.name.toLowerCase().includes(le.toLowerCase()),M=h===null?[]:r.filter(O=>E(O,h)),C=f?M.filter(O=>f.has(O.id)):M,A=f?M.filter(O=>!f.has(O.id)):[],_=C.length>0&&A.length>0,R=[...C,...A],I=h===null?[]:s.filter(O=>E(O,h)),G=b?s.filter(O=>E(O,b.search)):[],Y=R.length+(I.length?1:0),L=()=>{p(null),j(null)};function P(O=a){const le=e.current,ne=le?/(?:^|[^\p{Script=Latin}\p{Nd}_])@([^\s@]*)$/u.exec(O.slice(0,le.selectionStart)):null;p(ne?ne[1]:null),g(0),j(null)}function q(O){const le=e.current;if(!le)return;r.some(B=>B.id===O.id)||d(O);const ne=a.slice(0,le.selectionStart).replace(/@([^\s@]*)$/u,`@${O.name} `),D=ne+a.slice(le.selectionStart);N.current=ne.length,i(D),L()}function Z(O){b||j({search:h??"",active:0}),O&&requestAnimationFrame(()=>{var le;return(le=S.current)==null?void 0:le.focus()})}function U(){var O;j(null),(O=e.current)==null||O.focus()}function F(O){if(!Y||O.nativeEvent.isComposing)return!1;const le=y===R.length;return O.key==="ArrowDown"||O.key==="ArrowUp"?(O.preventDefault(),g((y+(O.key==="ArrowDown"?1:-1)+Y)%Y),j(null),!0):(O.key==="Enter"||O.key==="Tab")&&!le?(O.preventDefault(),q(R[y]),!0):(O.key==="Enter"||O.key==="Tab"||O.key==="ArrowRight")&&le?(O.preventDefault(),Z(!0),!0):O.key==="Escape"?(O.preventDefault(),L(),!0):!1}function X(O){!b||O.nativeEvent.isComposing||((O.key==="ArrowDown"||O.key==="ArrowUp")&&G.length?(O.preventDefault(),j({...b,active:(b.active+(O.key==="ArrowDown"?1:-1)+G.length)%G.length})):O.key==="Enter"?(O.preventDefault(),G[b.active]&&q(G[b.active])):(O.key==="Escape"||O.key==="ArrowLeft"&&!b.search)&&(O.preventDefault(),U()))}const $=O=>{var ne;const le=O.relatedTarget;(!le||!((ne=k.current)!=null&&ne.contains(le))&&le!==e.current)&&L()},H=(O,le)=>o.jsxs("button",{type:"button",role:"option","aria-selected":le,className:"ui-menu-item","data-active":le||void 0,onMouseDown:ne=>{ne.preventDefault(),q(O)},children:[o.jsx(Sr,{member:O,bots:c,size:20}),o.jsx("span",{className:"ui-menu-copy",children:O.name}),o.jsx("span",{className:"jv-muted",children:O.kind==="bot"?"Bot":x("common.member")})]},O.id);return{menu:Y>0?o.jsxs("div",{ref:k,className:"jv-mention-box","data-side":b?"":void 0,onBlur:$,children:[o.jsxs("div",{className:"ui-popover jv-mention-menu",role:"listbox","aria-label":x("mention.menu"),children:[_&&o.jsx("p",{className:"jv-mention-group","aria-hidden":"true",children:x("mention.inThread")}),C.map((O,le)=>H(O,le===y)),_&&o.jsx("div",{className:"jv-mention-sep",role:"separator"}),_&&o.jsx("p",{className:"jv-mention-group","aria-hidden":"true",children:x("mention.inChannel")}),A.map((O,le)=>H(O,C.length+le===y)),I.length>0&&o.jsxs("button",{type:"button",className:"ui-menu-item jv-mention-more","aria-haspopup":"listbox","aria-expanded":!!b,"data-active":y===R.length||void 0,onMouseEnter:()=>{g(R.length),Z(!1)},onMouseDown:O=>{O.preventDefault(),g(R.length),Z(!0)},children:[o.jsx("span",{className:"ui-menu-copy",children:x("mention.outside")}),o.jsx("span",{className:"jv-muted",children:I.length}),o.jsx(Ue,{name:"chevron-right"})]})]}),b&&o.jsxs("div",{className:"ui-popover jv-mention-side",role:"listbox","aria-label":x("mention.outsideList"),children:[o.jsxs("div",{className:"jv-mention-side-head",children:[o.jsx("button",{type:"button",className:"jv-mention-back","aria-label":x("common.back"),onMouseDown:O=>{O.preventDefault(),U()},children:o.jsx(Ue,{name:"chevron-left"})}),o.jsx("input",{ref:S,type:"search",value:b.search,placeholder:x("common.searchMembers"),"aria-label":x("mention.searchOutside"),onChange:O=>j({search:O.target.value,active:0}),onKeyDown:X})]}),o.jsx("div",{className:"jv-mention-side-list",children:G.length?G.map((O,le)=>H(O,le===b.active)):o.jsx("p",{className:"jv-mention-empty",children:x("common.noMatch")})}),o.jsx("p",{className:"ui-menu-note ui-small",children:x("mention.invites")})]})]}):null,track:P,onKeyDown:F,close:L,leaves:$}}const Ub={text:null,files:[],quote:null,passages:[],key:null,signature:null,outgoing:null,sending:!1};function cS(e,a){var s;const i=((s=a.text)==null?void 0:s.trim())??"",r=e.text??"";return{text:r.trim()?i?`${i}
780
+
781
+ ${r}`:r:i||e.text,files:[...a.files.filter(c=>!e.files.some(d=>d.id===c.id)),...e.files],quote:e.quote??a.quote,passages:[...a.passages,...e.passages],outgoing:null}}class VI{constructor(a){Wt(this,"drafts",new Map);Wt(this,"listeners",new Set);Wt(this,"timer",null);Wt(this,"subscribe",a=>(this.listeners.add(a),()=>{this.listeners.delete(a)}));this.storageKey=a;try{const i=JSON.parse(localStorage.getItem(a)??"{}");for(const[r,s]of Object.entries(i)){const c={...Ub,...s,sending:!1};this.drafts.set(r,c.outgoing?{...c,...cS(c,c.outgoing)}:c)}}catch{localStorage.removeItem(a)}}get(a){return this.drafts.get(a)??Ub}update(a,i){const r=this.get(a),s=typeof i=="function"?i(r):i;this.drafts.set(a,{...r,...s}),this.listeners.forEach(d=>d());const c=Object.keys(s).every(d=>d==="text"||d==="sending");this.timer&&clearTimeout(this.timer),c?this.timer=setTimeout(()=>this.save(),300):this.save()}save(){var i;this.timer&&(clearTimeout(this.timer),this.timer=null);const a={};for(const[r,{sending:s,...c}]of this.drafts)((i=c.text)!=null&&i.trim()||c.files.length||c.quote||c.passages.length||c.outgoing)&&(a[r]=c);Object.keys(a).length?localStorage.setItem(this.storageKey,JSON.stringify(a)):localStorage.removeItem(this.storageKey)}async clear(a){this.timer&&(clearTimeout(this.timer),this.timer=null);const i=[...this.drafts.values()].flatMap(r=>{var s;return[...r.files,...((s=r.outgoing)==null?void 0:s.files)??[]]});await Promise.all(i.map(r=>a(r.id).catch(s=>console.warn(`Pending attachment ${r.id} was not deleted on log-out`,s)))),this.drafts.clear(),localStorage.removeItem(this.storageKey),this.listeners.forEach(r=>r())}}const $I=e=>`jarvy-drafts:${e}`;function uS(e,a,i){e.update(a.chatId,{quote:{id:a.id,name:pi(i.find(r=>r.id===a.senderId)),text:Ug(a).replace(/\s+/g," ").slice(0,160)}})}function GI(e,a){return w.useSyncExternalStore(e.subscribe,()=>e.get(a))}const Fb=()=>Array.from(crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,"0")).join("");function dS({chatId:e,id:a,drafts:i,placeholder:r,disabled:s=!1,mention:c,initialText:d,formRef:f,scrollRef:h,onSend:p,onError:y,onNotice:g}){const b=GI(i,e),j=b.sending,[k,S]=w.useState([]),[N,E]=w.useState(!1),M=k.filter(H=>H.chatId===e),C=M.length>0,A=w.useRef(new Map),_=w.useRef(null),R=b.text??d??"",I=b.files,G=b.quote,Y=H=>i.update(e,{text:H}),L=FI({textarea:_,value:R,setValue:Y,inside:(c==null?void 0:c.inside)??[],outside:(c==null?void 0:c.outside)??[],bots:(c==null?void 0:c.bots)??[],onInvite:H=>c==null?void 0:c.onInvite(H),participants:c==null?void 0:c.participants});async function P(H){var D;const ie=e;if(!H.length)return;if(C){g(x("composer.busy"));return}if(I.length+H.length>5){g(x("composer.tooMany",{count:5}));return}if(H.some(B=>B.size===0||B.size>ex)){g(x("composer.size",{limit:`${ex/1024**3} GB`}));return}const O=H.map(B=>({key:Fb(),chatId:ie,name:B.name,done:0})),le=O.map(B=>B.key),ne=(B,W)=>S(ue=>ue.map(me=>me.key===B?{...me,done:W}:me));S(B=>[...B,...O]);for(const B of le)A.current.set(B,new AbortController);try{for(const[B,W]of H.entries()){const ue=le[B];try{const me=await he.uploadAttachment(ie,W,ge=>ne(ue,ge),(D=A.current.get(ue))==null?void 0:D.signal);i.update(ie,ge=>({files:[...ge.files,me]}))}catch(me){if(!(me instanceof DOMException&&me.name==="AbortError"))throw me}finally{S(me=>me.filter(ge=>ge.key!==ue))}}}catch(B){y(B)}finally{S(B=>B.filter(W=>!le.includes(W.key)));for(const B of le)A.current.delete(B)}}async function q(H){const ie=e;try{await he.removeAttachment(H),i.update(ie,O=>({files:O.files.filter(le=>le.id!==H)}))}catch(O){y(O)}}function Z(H){const ie=[...H.clipboardData.files];if(!ie.length)return;H.preventDefault();const O=new Date().toISOString().replace(/\D/g,"").slice(0,14);P(ie.map((le,ne)=>le.type.startsWith("image/")&&/^image\.\w+$/.test(le.name)?new File([le],`${x("composer.pasted")}-${O}${ie.length>1?`-${ne+1}`:""}.${le.name.split(".").pop()}`,{type:le.type}):le))}const U=H=>H.dataTransfer.types.includes("Files");function F(H){!U(H)||s||(H.preventDefault(),H.dataTransfer.dropEffect="copy",E(!0))}function X(H){U(H)&&(H.preventDefault(),E(!1),s||P([...H.dataTransfer.files]))}async function $(H){H==null||H.preventDefault();const ie=e,O=i.get(ie),le=(O.text??d??"").trim(),ne=O.files,D=O.quote,B=O.passages,ue=[B.map((Me,xe)=>`[[q${xe+1}]]`).join(`
782
+ `),le].filter(Boolean).join(`
783
+
784
+ `);if(!ue&&!ne.length||O.sending||C||s)return;const me=JSON.stringify([ue,ne.map(Me=>Me.id),(D==null?void 0:D.id)??null,B]),ge=O.signature===me&&O.key?O.key:Fb(),Se={text:le,files:ne,quote:D,passages:B};i.update(ie,{text:"",files:[],quote:null,passages:[],key:ge,signature:me,outgoing:Se,sending:!0});try{await p(ue,ne.map(Me=>Me.id),ge,D==null?void 0:D.id,B.map(({messageId:Me,text:xe})=>({messageId:Me,text:xe}))),i.update(ie,{key:null,signature:null,outgoing:null})}catch(Me){i.update(ie,xe=>cS(xe,Se)),y(Me)}finally{i.update(ie,{sending:!1})}}return w.useLayoutEffect(()=>{const H=()=>{const ie=_.current,O=h==null?void 0:h.current;if(!ie)return;const le=O==null?void 0:O.scrollTop;ie.style.height="auto",ie.style.height=`${ie.scrollHeight}px`,O&&le!==void 0&&O.scrollTop!==le&&O.scrollTo({top:le,behavior:"instant"})};return H(),window.addEventListener("resize",H),()=>window.removeEventListener("resize",H)},[R,e,h]),o.jsxs("form",{ref:f,className:`ui-compose-wrap${N?" jarvy-dropping":""}`,onSubmit:H=>void $(H),onDragEnter:F,onDragOver:F,onDragLeave:H=>{H.currentTarget.contains(H.relatedTarget)||E(!1)},onDrop:X,children:[I.length+M.length>0&&o.jsxs("div",{className:"jarvy-pending-files",children:[I.map(H=>o.jsxs("span",{className:"jarvy-file-chip",children:[o.jsx(Ue,{name:"paperclip"}),o.jsx("span",{title:H.name,children:H.name}),o.jsx("button",{type:"button","aria-label":x("composer.removeFile",{name:H.name}),onClick:()=>void q(H.id),children:"×"})]},H.id)),M.map(H=>o.jsxs("span",{className:"jarvy-file-chip","data-uploading":!0,children:[o.jsx(Ue,{name:"paperclip"}),o.jsx("span",{title:H.name,children:H.name}),o.jsxs("span",{className:"jarvy-file-percent",children:[Math.floor(H.done*100),"%"]}),o.jsx("button",{type:"button","aria-label":x("composer.cancelUpload",{name:H.name}),onClick:()=>{var ie;return(ie=A.current.get(H.key))==null?void 0:ie.abort()},children:"×"}),o.jsx("span",{className:"jarvy-file-progress",role:"progressbar","aria-label":x("composer.uploading",{name:H.name}),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(H.done*100),children:o.jsx("span",{style:{width:`${H.done*100}%`}})})]},H.key))]}),G&&o.jsxs("div",{className:"jv-compose-quote",children:[o.jsx("span",{className:"jv-compose-quote-label",children:x("composer.replying")}),o.jsx("span",{className:"jv-reply-author",children:G.name}),o.jsx("span",{className:"jv-reply-text",children:G.text||x("common.attachment")}),o.jsx("button",{type:"button","aria-label":x("composer.cancelReply"),onClick:()=>i.update(e,{quote:null}),children:"×"})]}),o.jsx(iI,{quotes:b.passages,onRemove:H=>i.update(e,ie=>({passages:ie.passages.filter((O,le)=>le!==H)}))}),o.jsxs("div",{className:"ui-composer jv-composer",children:[c&&L.menu,N&&o.jsx("span",{className:"jarvy-drop-hint",role:"status",children:x("composer.drop")}),o.jsxs("label",{className:"jarvy-attach-trigger",title:x("composer.attach"),children:[o.jsx(Ue,{name:"add"}),o.jsx("input",{type:"file",multiple:!0,"aria-label":x("composer.attach"),disabled:j||C||s||I.length>=5,onChange:H=>{const ie=[...H.target.files??[]];H.target.value="",P(ie)}})]}),o.jsx("textarea",{ref:_,id:a,rows:1,maxLength:32e3,value:R,onPaste:Z,placeholder:r,disabled:s,"aria-label":x("composer.input"),onChange:H=>{Y(H.target.value),c&&L.track(H.target.value)},onKeyDown:H=>{c&&L.onKeyDown(H)||H.key==="Enter"&&!H.shiftKey&&!H.nativeEvent.isComposing&&(H.preventDefault(),$())},onClick:()=>{c&&L.track()},onBlur:c?L.leaves:void 0}),o.jsx("button",{type:"submit",className:"ui-round ui-send","aria-label":x("composer.send"),disabled:j||C||s||!R.trim()&&!I.length&&!b.passages.length,children:o.jsx(Ue,{name:"arrow-up"})})]})]})}function YI({messages:e,members:a,me:i,activeQuestion:r,onSettled:s,onPreview:c,onQuote:d,onReact:f,onFold:h,onJump:p,onError:y,bot:g}){const b=Q5();return o.jsx(o.Fragment,{children:e.map((j,k)=>{const S=e[k-1],N=e[k+1],E=j.role==="assistant"&&!!(N!=null&&N.question)&&N.senderId===j.senderId,M=j.folded;return o.jsxs(w.Fragment,{children:[Fg(j.createdAt,S==null?void 0:S.createdAt)&&o.jsx(W5,{time:j.createdAt}),o.jsxs("div",{className:`ui-message-row ${j.role==="user"?"ui-user":""}`,"data-message":j.id,"data-asks":E||void 0,"data-shut":M||void 0,tabIndex:-1,children:[j.role==="assistant"&&o.jsx("span",{className:"jarvy-bubble-avatar",children:o.jsx(hl,{color:(g==null?void 0:g.color)??"gray",mood:g==null?void 0:g.mood,size:22,crown:g==null?void 0:g.agent})}),o.jsxs("div",{className:"jv-dm-stack",children:[J5(j,S)&&o.jsx(S0,{time:j.createdAt,className:"jv-dm-time"}),M?o.jsx("div",{className:"ui-bubble jv-folded-bubble",children:o.jsx(Z5,{message:j})}):o.jsxs(o.Fragment,{children:[j.replyTo&&o.jsx(G5,{message:j,members:a,onJump:p}),j.question?o.jsx(I5,{message:{...j,question:j.question},keyboard:j.id===r,onSettled:s}):o.jsxs("div",{className:"ui-bubble",children:[j.content&&o.jsx(X5,{whole:b.has(j.id),children:o.jsx(q5,{message:j,members:a,me:i,onJump:p})}),j.attachments.length>0&&o.jsx(O5,{files:j.attachments,onOpen:C=>c(j.attachments,C)})]}),o.jsx(Y5,{message:j,me:i,members:a,onReact:f,onError:y})]})]}),o.jsxs("div",{className:"jv-row-actions",children:[o.jsx(K5,{message:j,me:i,onReply:d,onReact:f,onError:y}),o.jsx(gt,{icon:j.folded?"unfold":"fold",label:x(j.folded?"actions.unfold":"actions.fold"),onClick:()=>{j.folded&&b.add(j.id),h(j,!j.folded)}})]})]})]},j.id)})})}const KI={sleep:"zz",busy:"sweat",ask:"ask",stretch:"sparkle"},XI={sleep:{kind:4,earL:.36,earR:.36,look:[0,-.02]},think:{lid:.16,earL:.16,earR:.46},work:{open:.55,earL:.14,earR:.14},busy:{kind:1,mouth:5,earL:.5,earR:.5},read:{lid:.34},turn:{mouth:2,mouthOpen:.8,earL:.1,earR:.1},ask:{eyeScale:1.08,earL:.12,earR:.38},yawn:{kind:4,mouth:5,earL:.42,earR:.42},stretch:{kind:2,mouth:2,mouthOpen:.8,blush:.8,earL:.06,earR:.06},groom:{kind:4}},Vb={rest:.2,turn:.02,ask:.08,read:.12},$b=Math.PI*2,Sc=(e,a,i)=>e+(a-e)*i;class QI{constructor(){Wt(this,"x",0);Wt(this,"v",0);Wt(this,"last",0)}kick(a){this.v+=a}step(a){const i=this.last?Math.min(.05,Math.max(0,(a-this.last)/1e3)):0;this.last=a;const r=9.5;return this.v+=(-180*this.x-r*this.v)*i,this.x+=this.v*i,this.x}}class ZI{constructor(){Wt(this,"squash",new QI);Wt(this,"start",0);Wt(this,"motion",null);Wt(this,"motionAt",0);Wt(this,"blinkAt",1400);Wt(this,"blinkStart",-1e9);Wt(this,"lookX",0);Wt(this,"lookY",0);Wt(this,"yaw",0);Wt(this,"lift",0);Wt(this,"tilt",0)}frame(a,i){const r=i.motion,s=!!i.reduced,c=r==="sleep",d=i.faceX??0,f=(r==="turn"||r==="ask"||r==="read"?Vb[r]:Vb.rest)*d;this.start||(this.start=a,this.yaw=f),r!==this.motion&&(this.motion&&!s&&this.squash.kick(c?-.4:.6),this.motion=r,this.motionAt=a);const h=(a-this.start)/1e3,p=(a-this.motionAt)/1e3,y={...y5(i.mood),...XI[r]},g=(A,_)=>s?0:Math.sin(h*A)*_,b=!c&&i.mood==="dizzy",j=r==="idle"?1:c?.25:.45;this.lookX=Sc(this.lookX,(b?0:i.lookX*j)*.055,.18),this.lookY=Sc(this.lookY,(b?0:i.lookY*j)*.045,.15),this.yaw=Sc(this.yaw,f,.07);let k=(c?1.05:1)+(s?0:Math.sin($b*h/(c?4.4:3.4))*(c?.014:.008)),S=0,N=y.tilt,E=y.look;if(r==="think")E=[g(.9,.045)+.03,.04],N+=.06+g(1.3,.03);else if(r==="work"||r==="busy"){const A=r==="busy"||i.fast,_=s?0:Math.abs(Math.sin($b*h*(A?1.9:1.5)));k+=.032*(1-_),S=.013*_,E=A?[g(6.5,.012)+g(2.3,.005),-.03]:[g(1.9,.02),-.03],r==="busy"&&(N+=g(1.6,.02))}else if(r==="read")E=[s?0:p*.55%1*.09-.045,-.045],N+=g(.7,.02);else if(r==="ask")E=[0,.03],N+=.14+g(1.1,.03);else if(r==="yawn"){const A=s?0:Math.sin(Math.PI*Math.min(1,p%3.2/1.8));k+=.05*A,S=.02*A}else if(r==="stretch"){const A=s?0:Math.sin(Math.PI*Math.min(1,p%3.6/1.8));k-=.04*A,S=.03*A}else r==="groom"&&(N-=.1,E=[.04,-.03]);this.lift=Sc(this.lift,S,.2),this.tilt=Sc(this.tilt,N,.2),y.kind===0&&y.open>.5&&a-this.start>this.blinkAt&&a-this.blinkStart>400&&(this.blinkStart=a,this.blinkAt=a-this.start+2200+Math.random()*3200);const M=(a-this.blinkStart)/160,C=M>=0&&M<=1?1-.94*Math.sin(Math.PI*M):1;return{...y,open:y.open*C,squash:k*y.squash+this.squash.step(a),lift:this.lift,tilt:this.tilt,yaw:this.yaw,look:[this.lookX+E[0],this.lookY+E[1]]}}shake(){this.squash.kick(-2.2)}}function JI(e,a,i,r,s,c=0){const p=a.offsetWidth,y=a.offsetLeft,g=a.offsetTop,b=Math.max(300,Math.round(i*.4));e.style.maxHeight="";const j=e.hasAttribute("data-fit"),k=e.offsetHeight,S=$=>$==="left"||$==="right",N=$=>$==="left"?y-10-8:$==="right"?i-y-p-10-8:$==="below"?r-g-p-10-8:g-10-8,E=y+p/2>i/2,M=$=>j?S($)?Math.min(b,Math.max(160,N($))):Math.min(b,E?y+p-8:i-y-8):e.offsetWidth,C=$=>S($)?M($)<=N($):Math.min(120,k)<=N($),A=c>.05?"right":c<-.05?"left":null,R=(A==="left"||A===null&&N("left")>=N("right")?["left","right"]:["right","left"]).find(C)??(N("below")>=N("above")?"below":"above"),I=e.dataset.side,Y=I!==void 0&&I!==R&&S(I)===S(R)&&C(I)&&N(I)+40>=N(R)?I:R,L=j&&(Y==="left"||!S(Y)&&E),P=Y==="left"?y-10:Y==="right"?y+p+10:E?y+p:y;e.style.width="",e.style.maxWidth=j?`${M(Y)}px`:"",L?(e.style.left="",e.style.right=`${i-P}px`):(e.style.right="",j&&(e.style.left=`${P}px`));const q=e.offsetWidth,Z=j?L?P-q:P:Y==="left"?y-10-q:Y==="right"?y+p+10:Math.min(Math.max(8,y+p-q),Math.max(8,i-q-8)),U=s&&Z<s.right&&Z+q>s.left?s.bottom+6:0,F=Math.min(Math.max(8,U),Math.max(8,r-140));let X;Y==="below"?(X=Math.max(8,Math.min(g+p+10,r-8-Math.min(k,120))),e.style.maxHeight=`${Math.max(40,r-X-8)}px`):Y==="above"?(e.style.maxHeight=`${Math.max(40,g-10-F)}px`,X=Math.max(F,g-10-e.offsetHeight)):(e.style.maxHeight=`${Math.max(120,r-F-8)}px`,X=Math.min(Math.max(F,g+6),Math.max(F,r-e.offsetHeight-8))),j||(e.style.left=`${Z}px`),e.style.top=`${X}px`,e.dataset.side=Y,e.style.setProperty("--npc-tail",S(Y)?`${Math.min(e.offsetHeight-18,Math.max(18,g+p/2-X))}px`:`${Math.min(q-18,Math.max(18,y+p/2-Z))}px`)}const Gb=.06,WI=matchMedia("(prefers-reduced-motion: reduce)");function Ad({text:e,limit:a,streaming:i=!1}){const[,r]=w.useState(0),s=w.useRef({text:"",count:0,rate:Gb,at:performance.now()}),c=performance.now(),d=s.current;d.count=Math.min(d.text.length,d.count+d.rate*(c-d.at)),d.at=c,e!==d.text&&(d.text=e,d.count=Math.min(d.count,e.length),d.rate=Math.max(Gb,(e.length-d.count)/a));const f=!WI.matches&&d.count<e.length;w.useEffect(()=>{if(!f)return;const p=requestAnimationFrame(()=>r(y=>y+1));return()=>cancelAnimationFrame(p)});const h=f?e.slice(0,Math.floor(d.count)).replace(/[\uD800-\uDBFF]$/,""):e;return o.jsxs(o.Fragment,{children:[h,(f||i)&&o.jsx("i",{className:"jv-npc-caret"})]})}function eP({className:e,children:a,onReading:i}){const r=w.useRef(null),s=w.useRef(null),c=w.useRef(i),[d,f]=w.useState(!1);return c.current=i,w.useEffect(()=>{const h=r.current,p=s.current;if(!h||!p)return;let y=!0,g=0;const b=()=>{h.scrollTop=h.scrollHeight,g=h.scrollTop},j=()=>{y&&b(),f(h.scrollTop>1)},k=()=>{const N=h.scrollHeight-h.scrollTop-h.clientHeight<4;N&&!y?(y=!0,g=h.scrollTop,c.current(!1)):!N&&y&&(h.scrollTop<g-1?(y=!1,c.current(!0)):b()),f(h.scrollTop>1)},S=new ResizeObserver(j);return S.observe(p),S.observe(h),j(),h.addEventListener("scroll",k,{passive:!0}),()=>{S.disconnect(),h.removeEventListener("scroll",k),c.current(!1)}},[]),o.jsx("span",{ref:r,className:`${e} jv-npc-tail`,"data-above":d||void 0,children:o.jsx("span",{ref:s,children:a})})}const fS={think:f7,mutter:W7,read:k7,write:F7,run:e9,script:g7,compact:o7,retry:I0,ask:Tw,say:I7,chat:Ow,tool:o9},C0=e=>x("npc.duration",{value:mi(Math.max(0,e)/1e3,{maximumFractionDigits:1,minimumFractionDigits:1})}),tP={completed:"npc.done",interrupted:"npc.done.interrupted",failed:"npc.done.failed"};function nP({view:e,name:a,cat:i,area:r,avoid:s,layout:c,facing:d,toolbar:f}){var P,q,Z;const h=w.useRef(null),p=w.useRef(null),[y,g]=w.useState(!1),[,b]=w.useState(0);w.useLayoutEffect(()=>{c.current=()=>{var H;if(!h.current||!i.current||!r.current)return;const F=r.current.getBoundingClientRect(),X=s.current?s.current.getBoundingClientRect().top-F.top:F.height,$=(H=p.current)==null?void 0:H.getBoundingClientRect();y?h.current.removeAttribute("data-fit"):h.current.setAttribute("data-fit",""),JI(h.current,i.current,F.width,X,$?{left:$.left-F.left,right:$.right-F.left,bottom:$.bottom-F.top}:null,d())},c.current();const U=new ResizeObserver(()=>{var F;return(F=c.current)==null?void 0:F.call(c)});for(const F of[h.current,p.current])F&&U.observe(F);return()=>{U.disconnect(),c.current=null}},[y]);const j=e.steps.some(U=>U.state==="running");w.useEffect(()=>{if(!y||!j)return;const U=setInterval(()=>b(F=>F+1),200);return()=>clearInterval(U)},[y,j]),w.useEffect(()=>{if(!y)return;const U=F=>{F.key==="Escape"&&g(!1)};return addEventListener("keydown",U),()=>removeEventListener("keydown",U)},[y]);const k=(P=e.steps[0])==null?void 0:P.id;w.useEffect(()=>{g(!1)},[k]);const[S,N]=w.useState(!1),[E,M]=w.useState(!1),[C,A]=w.useState(null),_=S||E;w.useEffect(()=>{var U;A(_?((U=e.shown)==null?void 0:U.id)??null:null)},[_]);const R=C&&e.steps.find(U=>U.id===C)||e.shown,I=R?R.look:e.done?"action":null;let G=null;if((R==null?void 0:R.look)==="thought"||(R==null?void 0:R.look)==="mutter"){const U=(R.line??"").replace(/\n\s*\n\s*/g,`
785
+
786
+ `).trim(),F=o.jsx(Ad,{text:U,limit:300,streaming:R.look==="thought"&&R.state==="running"},R.id),[X,$]=x("npc.mutter",{text:""}).split("");G=o.jsx(eP,{className:R.look==="thought"?"jv-npc-thought":"jv-npc-murmur",onReading:M,children:R.look==="thought"?F:o.jsxs(o.Fragment,{children:[X,F,$]})},R.id)}else if((R==null?void 0:R.look)==="speech")G=o.jsx("span",{className:"jv-npc-speech",children:o.jsx(Ad,{text:R.line??"",limit:1500,streaming:R.state==="running"&&R.icon==="say"},R.id)});else if(R){const U=fS[R.icon];G=o.jsxs("span",{className:"jv-npc-action","data-state":R.state,children:[o.jsx(U,{}),o.jsx(Ad,{text:R.title,limit:300},R.id),R.state==="running"&&o.jsx("i",{className:"jv-npc-dots"})]})}else e.done&&(G=o.jsxs("span",{className:"jv-npc-action","data-state":e.done.outcome==="completed"?"ok":"failed",children:[e.done.outcome==="completed"?o.jsx(ma,{}):o.jsx(xs,{}),o.jsx(Ad,{text:x(tP[e.done.outcome],{duration:C0(e.done.ms)}),limit:300},`done:${e.done.ms}`)]}));const Y=e.steps.length>0,L=(R==null?void 0:R.icon)==="ask"&&R.state==="running";return w.useEffect(()=>{G||N(!1)},[!G]),o.jsxs(o.Fragment,{children:[f==null?void 0:f(p,()=>g(!1)),o.jsx("div",{ref:h,className:"jv-npc","data-open":y||void 0,"data-look":y?void 0:I??void 0,"data-kind":R==null?void 0:R.icon,"data-fading":!y&&!R&&((q=e.done)==null?void 0:q.fading)||void 0,hidden:!y&&!G,onPointerEnter:U=>{U.pointerType==="mouse"&&N(!0)},onPointerLeave:()=>N(!1),children:y?o.jsxs("section",{className:"jv-npc-panel","aria-label":x("npc.panel"),children:[o.jsxs("header",{children:[o.jsx("strong",{children:x("npc.panel")}),e.startedAt>0&&o.jsx("span",{children:C0((e.endedAt??Date.now()+e.skew)-e.startedAt)}),o.jsx("button",{type:"button",onClick:()=>g(!1),"aria-label":x("npc.collapse"),title:x("npc.collapse"),children:o.jsx(H7,{})})]}),o.jsx("ol",{children:e.steps.map(U=>o.jsx(aP,{step:U,skew:e.skew},U.id))})]}):o.jsxs(o.Fragment,{children:[I==="speech"&&o.jsxs("span",{className:"jv-npc-name",children:[a,(R==null?void 0:R.to)&&o.jsx("em",{children:x("npc.to",{chat:R.to})})]}),Y?o.jsx("div",{role:"button",tabIndex:0,className:"jv-npc-line",onClick:()=>g(!0),title:x("npc.expand"),onKeyDown:U=>{(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),g(!0))},children:G}):o.jsx("div",{className:"jv-npc-line",children:G}),L&&e.answer&&((Z=R.options)==null?void 0:Z.some(U=>U.value))&&o.jsx("div",{className:"jv-npc-options",children:R.options.map(U=>o.jsx("button",{type:"button",onClick:()=>e.answer(U.value),children:U.label},U.label))}),L&&!e.answer&&R.hint&&o.jsx("p",{className:"jv-npc-hint",children:R.hint})]})})]})}function aP({step:e,skew:a}){const[i,r]=w.useState(!1),s=fS[e.icon],c=e.detail;return o.jsxs("li",{"data-state":e.state,style:e.depth?{paddingLeft:`${e.depth*16}px`}:void 0,children:[o.jsxs("button",{type:"button","aria-expanded":c?i:void 0,disabled:!c,onClick:()=>r(d=>!d),children:[o.jsx(s,{className:"jv-npc-kind"}),o.jsx("span",{className:"jv-npc-title",children:e.title}),o.jsxs("span",{className:"jv-npc-state",children:[e.state==="running"?o.jsx(Sw,{}):e.state==="ok"?o.jsx(ma,{}):o.jsx(xs,{}),x(`npc.state.${e.state}`)]}),o.jsx("span",{className:"jv-npc-time",children:C0((e.endedAt??Date.now()+a)-e.startedAt)}),c&&o.jsx(ml,{className:"jv-npc-chevron"})]}),i&&c&&o.jsx("pre",{"data-kind":e.icon,children:c})]})}const Ud="src/web/thread/ThreadPane.tsx",nf="npm run build",iP=["export function ThreadPane({ thread, replies }: Props) {"," const scroll = useRef<HTMLDivElement>(null);"," useLayoutEffect(() => {"," scroll.current!.scrollTop = scroll.current!.scrollHeight;"," }, [thread.id]);"," …"].join(`
787
+ `),rP=["> tsc -p tsconfig.web.json","src/web/thread/ThreadPane.tsx:58:41 - error TS2345: Argument of type","'HTMLDivElement | null' is not assignable to parameter of type 'HTMLDivElement'.","","Found 1 error."].join(`
788
+ `),hS={question:"npc.demo.question",options:[{value:"yes",label:"npc.demo.yes"},{value:"no",label:"npc.demo.no"}]},lP=[{kind:"think",text:"npc.demo.think1",ms:4200},{kind:"read",target:Ud,ms:2600,output:iP},{kind:"think",text:"npc.demo.think2",ms:3800},{kind:"write",target:Ud,ms:2600,output:["- useLayoutEffect(() => scrollToEnd(), [thread.id]);","+ useLayoutEffect(() => {","+ requestAnimationFrame(() => scrollToEnd(scroll.current));","+ }, [thread.id, replies.length]);"].join(`
789
+ `)},{kind:"mutter",text:"npc.demo.mutter1"},{kind:"run",target:nf,ms:3200,failed:!0,output:rP},{kind:"mutter",text:"npc.demo.mutter2"},{kind:"compact",ms:3400,output:"context: 412,380 → 38,210 tokens"},{kind:"write",target:Ud,ms:2e3,output:"+ const el = scroll.current; if (el) scrollToEnd(el);"},{kind:"run",target:nf,ms:3e3,output:["> vite build","✓ 2331 modules transformed.","✓ built in 4.9s"].join(`
790
+ `)},{kind:"say",text:"npc.demo.post",to:"npc.demo.channel"},{kind:"ask",...hS},{kind:"say",replies:{yes:"npc.demo.replyYes",no:"npc.demo.replyNo"}}],N0=[{key:"sleep",label:"npc.pose.sleep",motion:"sleep"},{key:"idle",label:"npc.pose.idle",motion:"idle"},{key:"think",label:"npc.pose.think",motion:"think",step:{kind:"think",text:"npc.demo.think1"}},{key:"mutter",label:"npc.pose.mutter",motion:"work",step:{kind:"mutter",text:"npc.demo.mutter2"}},{key:"say",label:"npc.pose.say",motion:"turn",step:{kind:"say",text:"npc.demo.replyNo"}},{key:"ask",label:"npc.pose.ask",motion:"ask",step:{kind:"ask",...hS}},{key:"read",label:"npc.pose.read",motion:"read",step:{kind:"read",target:Ud}},{key:"work",label:"npc.pose.work",motion:"work",fast:!0,step:{kind:"run",target:nf}},{key:"compact",label:"npc.pose.compact",motion:"yawn",step:{kind:"compact"}},{key:"busy",label:"npc.pose.busy",motion:"busy"},{key:"failed",label:"npc.pose.failed",motion:"idle",mood:"dizzy",shake:!0,step:{kind:"run",target:nf,failed:!0}},{key:"done",label:"npc.pose.done",motion:"stretch",mood:"happy",done:!0},{key:"groom",label:"npc.pose.groom",motion:"groom"}];function oP({controls:e,onReplay:a,toolbar:i}){const[r,s]=w.useState(!1);return o.jsxs("div",{ref:i,className:"jv-npc-toolbar",role:"toolbar","aria-label":x("npc.toolbar"),children:[o.jsxs("div",{className:"jv-npc-toolbar-row",children:[o.jsx("span",{children:x("npc.toolbar")}),o.jsx("button",{type:"button",className:"jv-npc-icon",onClick:a,"aria-label":x("npc.replay"),title:x("npc.replay"),children:o.jsx(Xw,{})}),o.jsxs(pr,{value:e.baseMood,onValueChange:c=>e.setBaseMood(c),children:[o.jsx(vr,{className:"jv-npc-mood","aria-label":x("npc.mood"),title:x("npc.mood"),children:o.jsx(gr,{})}),o.jsx(yr,{className:"jv-select-menu",position:"popper",sideOffset:4,children:X8.map(c=>o.jsx(fa,{value:c,children:x(`npc.mood.${c}`)},c))})]}),o.jsxs("button",{type:"button",className:"jv-npc-toggle","aria-expanded":r,onClick:()=>s(c=>!c),children:[o.jsx(X7,{}),x("npc.poses")]})]}),r&&o.jsx("div",{className:"jv-npc-poses",role:"group","aria-label":x("npc.poses"),children:N0.map(c=>{var d;return o.jsx("button",{type:"button","aria-pressed":((d=e.pose)==null?void 0:d.key)===c.key,onClick:()=>e.hold(c.key),children:x(c.label)},c.key)})})]})}const sP={think:"think",mutter:"mutter",read:"read",write:"write",run:"run",compact:"compact",ask:"ask",say:"say"},Yb=e=>e.text?[...x(e.text)].slice(0,e.typed).join(""):"";function cP(e){var r;if(e.kind==="think"||e.kind==="mutter")return x(`npc.step.${e.kind}`);if(e.kind==="ask"&&e.answer)return x("npc.step.ask.ok",{answer:x(e.answer.label)});const a=e.state==="failed"&&e.kind==="run"?"failed":e.state==="running"?"running":"ok",i=e.kind==="say"&&e.to?"post":e.kind;return x(`npc.step.${i}.${a}`,{target:((r=e.target)==null?void 0:r.split("/").pop())??"",chat:e.to?`#${x(e.to)}`:""})}function Kb(e){var r;const a=e.kind==="think"?"thought":e.kind==="mutter"?"mutter":e.kind==="say"||e.kind==="ask"?"speech":"action",i=e.kind==="ask"?x(e.question):Yb(e);return{id:String(e.id),look:a,icon:sP[e.kind],state:e.state,startedAt:e.startedAt,endedAt:e.endedAt,depth:0,title:cP(e),line:a==="action"?void 0:i,to:e.to?`#${x(e.to)}`:void 0,options:e.kind==="ask"&&e.state==="running"?(r=e.options)==null?void 0:r.map(s=>({label:x(s.label),value:s.value})):void 0,detail:e.kind==="ask"?x(e.question):e.text?Yb(e):e.output}}const Ep={steps:[],phase:"before",startedAt:0,endedAt:null,flash:null,shake:0,recapUntil:0},uP=40,Xb=6e3,Qb=500,dP={think:"think",mutter:"work",read:"read",write:"work",run:"work",compact:"yawn",ask:"ask",say:"turn"};class Tp extends Error{}const fP=e=>({...e,id:-1,state:e.failed?"failed":"running",startedAt:Date.now(),endedAt:null,typed:e.text?[...x(e.text)].length:0});function hP(e,a){const[i,r]=w.useState(Ep),[s,c]=w.useState(a),[d,f]=w.useState(0),[h,p]=w.useState(null),[,y]=w.useState(0),g=w.useRef(null);w.useEffect(()=>{if(!e||h)return;let A=!0;const _=new Set,R=L=>new Promise((P,q)=>{const Z=setTimeout(()=>{_.delete(Z),A?P():q(new Tp)},L);_.add(Z)}),I=(L,P)=>r(q=>({...q,steps:q.steps.map(Z=>Z.id===L?{...Z,...P}:Z)})),G=(L,P)=>r(q=>({...q,flash:{mood:L,until:Date.now()+P}})),Y=async(L,P,q)=>{const Z=[...x(P)].length,U=q?Math.max(16,q/Z):uP;for(let F=1;F<=Z;F++)I(L,{typed:F}),await R(U)};return(async()=>{r({...Ep}),await R(700);const L=Date.now();let P="";r(Z=>({...Z,phase:"turn",startedAt:L}));for(const[Z,U]of lP.entries()){const{ms:F,failed:X,replies:$,...H}=U,ie=$?$[P]:U.text;if(r(O=>({...O,steps:[...O.steps,{...H,text:ie,id:Z,state:"running",startedAt:Date.now(),endedAt:null,typed:0}]})),U.kind==="ask"){if(P=await new Promise(O=>{g.current=O}),g.current=null,!A)throw new Tp;I(Z,{state:"ok",endedAt:Date.now(),answer:U.options.find(O=>O.value===P)});continue}ie?await Y(Z,ie,U.kind==="think"?F??null:null):await R(F??1e3),(U.kind==="mutter"||U.kind==="say")&&await R(1100),I(Z,{state:X?"failed":"ok",endedAt:Date.now()}),X&&(r(O=>({...O,shake:O.shake+1})),G("dizzy",2600),await R(900))}const q=Date.now();for(r(Z=>({...Z,phase:"stretch",endedAt:q,recapUntil:q+Xb})),q-L>2e4&&G("happy",3200),await R(2200);;)r(Z=>({...Z,phase:"idle"})),await R(9e3),r(Z=>({...Z,phase:"groom"})),await R(2800)})().catch(L=>{if(!(L instanceof Tp))throw L}),()=>{var L;A=!1;for(const P of _)clearTimeout(P);(L=g.current)==null||L.call(g,"")}},[e,d,h]),w.useEffect(()=>{var I;const A=Date.now(),_=[((I=i.flash)==null?void 0:I.until)??0,i.recapUntil-Qb,i.recapUntil].filter(G=>G>A);if(!_.length)return;const R=setTimeout(()=>y(G=>G+1),Math.min(..._)-A+20);return()=>clearTimeout(R)});const b=N0.find(A=>A.key===h)??null,j=Date.now(),k=b?null:i.phase==="turn"?[...i.steps].reverse().find(A=>A.state==="running")??null:null,S=b?b.motion:k?dP[k.kind]:i.phase==="stretch"?"stretch":i.phase==="groom"?"groom":i.phase==="turn"?"think":"idle",N=i.flash&&i.flash.until>j?i.flash.mood:null,E=i.endedAt!==null&&j<i.recapUntil,M=b?b.step?fP(b.step):null:k??(i.phase==="turn"?i.steps.at(-1)??null:null);return{...{view:{steps:i.steps.map(Kb),shown:M?Kb(M):null,startedAt:i.startedAt,endedAt:i.endedAt,skew:0,answer:A=>{var _;return(_=g.current)==null?void 0:_.call(g,A)},done:b!=null&&b.done?{ms:31400,outcome:"completed",fading:!1}:!b&&E?{ms:i.endedAt-i.startedAt,outcome:"completed",fading:j>=i.recapUntil-Qb}:null},motion:S,fast:b?!!b.fast:(k==null?void 0:k.kind)==="write"||(k==null?void 0:k.kind)==="run",mood:(b==null?void 0:b.mood)??N??s,shake:i.shake,canRecap:!b&&i.endedAt!==null&&!E,showRecap:()=>r(A=>({...A,recapUntil:Date.now()+Xb}))},controls:{pose:b,baseMood:s,setBaseMood:c,replay:()=>{p(null),f(A=>A+1)},hold:A=>{p(A),r(_=>{var R;return{...Ep,shake:_.shake+((R=N0.find(I=>I.key===A))!=null&&R.shake?1:0)}})}}}}const mP=4e3,Zb={turn:null,last:null,skew:0};function pP(e,a){const i=[...e.steps];let r=e.dropped;for(const s of a)if(s.op==="step"){const c=i.findIndex(d=>d.id===s.step.id);c>=0?i[c]=s.step:i.push(s.step)}else if(s.op==="text"){const c=i.findIndex(p=>p.id===s.id),d=i[c];if(!d)continue;const f=(d.text??"")+s.append,h=Math.max(0,f.length-mP);i[c]={...d,text:f.slice(h),omitted:(d.omitted??0)+h}}else{const c=i.findIndex(d=>d.id===s.id);c>=0&&(i.splice(c,1),r++)}return{...e,steps:i,dropped:r}}function gP(e){const[a,i]=w.useState(Zb);return w.useEffect(()=>{if(i(Zb),!e)return;const r=new EventSource(`/api/bots/${encodeURIComponent(e)}/live`),s=c=>JSON.parse(c.data);return r.addEventListener("snapshot",c=>{const d=s(c);i(f=>({...f,turn:d.turn,skew:d.now-Date.now()}))}),r.addEventListener("start",c=>{const{turn:d}=s(c);i(f=>({...f,turn:d}))}),r.addEventListener("patch",c=>{const{patches:d}=s(c);i(f=>f.turn?{...f,turn:pP(f.turn,d)}:f)}),r.addEventListener("end",c=>{const{outcome:d,endedAt:f}=s(c);i(h=>h.turn?{...h,turn:null,last:{...h.turn,outcome:d,endedAt:f}}:h)}),()=>r.close()},[e]),a}const Ap=new Set(["messages.read","messages.search","chats.list","chats.info","threads.list","members.list","bots.list","sections.list","history.read","list","describe"]),Li=e=>e.state==="running"?"running":e.state==="failed"?"failed":"ok",Mp=e=>(e==null?void 0:e.split("/").filter(Boolean).pop())??"",vP=e=>{const a=(e??"").split(`
791
+ `)[0].trim();return a.length>40?`${a.slice(0,39)}…`:a},Jb=e=>e.type==="channel"?`#${e.title}`:e.title;function _p(e){return e?e.omitted?`${e.head}
792
+ ${x("npc.live.omitted",{count:mi(e.omitted)})}
793
+ ${e.tail}`:e.head+e.tail:""}const Wb=e=>e.omitted?`${x("npc.live.omitted",{count:mi(e.omitted)})}
794
+ `:"";function Rp(e){switch(e.icon){case"think":return{motion:"think",fast:!1};case"mutter":return{motion:"work",fast:!1};case"read":case"chat":return{motion:"read",fast:!1};case"say":return{motion:"turn",fast:!1};case"ask":return{motion:"ask",fast:!1};case"compact":return{motion:"yawn",fast:!1};case"retry":return{motion:"busy",fast:!1};default:return{motion:"work",fast:!0}}}function yP(e,a,i){const r={id:e.id,state:e.state,startedAt:e.startedAt,endedAt:e.endedAt,depth:a},s=(h,p,y)=>({...r,look:"action",icon:h,title:p,detail:y});switch(e.kind){case"thinking":return{...r,look:"thought",icon:"think",title:x("npc.step.think"),line:e.text??"",detail:Wb(e)+(e.text??"")};case"text":return{...r,look:"mutter",icon:"mutter",title:x("npc.step.mutter"),line:e.text??"",detail:Wb(e)+(e.text??"")};case"compaction":return s("compact",x(`npc.live.compact.${Li(e)}`),e.tokensBefore!=null&&e.tokensAfter!=null?x("npc.live.tokens",{before:mi(e.tokensBefore),after:mi(e.tokensAfter)}):_p(e.output));case"retry":return s("retry",e.state==="running"?x("npc.live.retry.running",{attempt:e.attempt??1,max:e.maxAttempts??1}):x(`npc.live.retry.${Li(e)}`),_p(e.output))}const c=e.input??{},d=_p(e.output),f=[c.path??c.command??c.args,d].filter(Boolean).join(`
795
+
796
+ `);switch(e.tool){case"read":return s("read",x(`npc.live.read.${Li(e)}`,{target:Mp(c.path)}),f);case"edit":return s("write",x(`npc.live.edit.${Li(e)}`,{target:Mp(c.path)}),f);case"write":return s("write",x(`npc.live.write.${Li(e)}`,{target:Mp(c.path)}),f);case"bash":return s("run",x(`npc.live.run.${Li(e)}`,{target:vP(c.command)}),f);case"codemode":return s("script",x(`npc.live.script.${Li(e)}`),f);case"chat":return xP(e,r,i,d);default:return s("tool",x(`npc.live.tool.${Li(e)}`,{tool:e.tool??""}),f)}}function xP(e,a,i,r){const s=e.input??{},c=s.action??"",d=s.chat,f=d&&(d.id===null?d.type!=="dm":d.id!==i)?Jb(d):void 0;if(c==="messages.send")return{...a,look:"speech",icon:"say",to:f,line:s.text??"",detail:[s.text,e.state==="failed"?r:""].filter(Boolean).join(`
797
+
798
+ `),title:e.state==="failed"?x("npc.live.sendFailed"):f?x(`npc.step.post.${e.state==="running"?"running":"ok"}`,{chat:f}):x(`npc.step.say.${e.state==="running"?"running":"ok"}`)};if(c==="messages.ask"){const y=bP(e);return{...a,look:"speech",icon:"ask",to:f,line:s.text??"",options:(s.options??[]).map(g=>({label:g})),hint:f?x("npc.live.answerIn",{chat:f}):x("npc.live.answerBelow"),detail:[s.text,...(s.options??[]).map(g=>`· ${g}`),r].filter(Boolean).join(`
799
+ `),title:e.state==="running"?x("npc.step.ask.running"):y?x("npc.step.ask.ok",{answer:y}):x(e.state==="failed"?"npc.live.askFailed":"npc.live.askClosed")}}if(c==="environments.switch")return{...a,look:"action",icon:"tool",title:x(`npc.live.switch.${Li(e)}`),detail:r};const h=d?Jb(d):"",p=Ap.has(c)?h?x(`npc.live.browse.${e.state==="running"?"running":"ok"}`,{chat:h}):x(`npc.live.browseAll.${e.state==="running"?"running":"ok"}`):x(`npc.live.tool.${Li(e)}`,{tool:c||"chat"});return{...a,look:"action",icon:Ap.has(c)?"chat":"tool",title:e.state==="failed"&&Ap.has(c)?x("npc.live.tool.failed",{tool:c}):p,detail:r}}function bP(e){try{const a=JSON.parse(e.output?e.output.head+e.output.tail:"");return a.status!=="answered"?null:[...(a.selected??[]).map(i=>i.label??""),a.custom??""].filter(Boolean).join(x("common.listSeparator"))}catch{return null}}function ej(e,a){const i=new Map(e.steps.map(s=>[s.id,s.parentId])),r=s=>{let c=0,d=s.parentId;for(;d&&c<4;)c++,d=i.get(d)??null;return c};return e.steps.map(s=>yP(s,r(s),a))}function Md(e){var i;const a=((i=e.line)==null?void 0:i.length)??0;if(e.look==="speech"){const r=Math.min(7e3,Math.max(2500,1500+50*a))+Math.min(1500,a/.06);return{firm:r,light:r}}return e.look==="mutter"?{firm:1500,light:Math.min(3500,Math.max(1500,800+30*a))}:e.state==="failed"?{firm:2e3,light:2e3}:{firm:0,light:e.look==="action"?900:0}}const jP=4e3,tj=1500;function nj(e,a,i,r){var j;const s=k=>k-i;let c=null;for(const k of e)k.state==="running"&&(!c||k.startedAt>=c.startedAt)&&(c=k);const d=[];for(const k of e.filter(S=>S.state!=="running"&&S.endedAt!==null&&Md(S).firm).sort((S,N)=>S.endedAt-N.endedAt)){const S=s(k.endedAt),N=d.at(-1);N&&k.look==="speech"&&(N.end=Math.min(N.end,Math.max(N.start+tj,S)));const E=Math.max(S,(N==null?void 0:N.end)??0);E-S>jP||d.push({step:k,start:E,end:E+Md(k).firm})}const f=(c==null?void 0:c.look)==="speech"?c:null;if(f){const k=s(f.startedAt);for(let S=d.length-1;S>=0;S--){const N=d[S];N.start>=k&&N.start>a?d.splice(S,1):N.end>k&&(N.end=Math.max(N.start+tj,k))}}let h=null;for(const k of e){if(k.state==="running"||k.endedAt===null||!Md(k).light)continue;const S=s(k.endedAt)+Md(k).light;S>a&&(!h||k.endedAt>=h.step.endedAt)&&(h={step:k,end:S})}const p=d.find(k=>k.start<=a&&a<k.end),y=(p==null?void 0:p.step)??(f||c&&c.look!=="thought"||h==null?void 0:h.step),g=y??f??c??(r?e.at(-1)??null:null),b=[...d.flatMap(k=>[k.start,k.end]),(h==null?void 0:h.end)??0].filter(k=>k>a);return{shown:g,lingering:!!y,next:b.length?Math.min(...b):0,wordsEnd:((j=d.at(-1))==null?void 0:j.end)??0}}const aj=6e3,ij=500,rj=2200,wP=2e4,kP=10*6e4,lj=3e4,SP=2e4,CP=2800;function NP(e,a,i,r,s){var P;const{turn:c,last:d,skew:f}=gP(e),[h,p]=w.useState(null),[y,g]=w.useState(0),[b,j]=w.useState(0),[,k]=w.useState(0),S=w.useRef(new Set),N=w.useRef(Date.now()),E=w.useMemo(()=>c?ej(c,a):d?ej(d,a):[],[c,d,a]);w.useEffect(()=>{for(const q of(c==null?void 0:c.steps)??[])q.state==="failed"&&!S.current.has(q.id)&&(S.current.add(q.id),g(Z=>Z+1),p({mood:"dizzy",until:Date.now()+2600}))},[c]),w.useEffect(()=>{d&&(S.current.clear(),N.current=Date.now(),j(Math.max(Date.now(),nj(E,Date.now(),f,!1).wordsEnd)+aj),d.outcome==="completed"&&d.endedAt-d.startedAt>wP&&p({mood:"happy",until:Date.now()+3200}))},[d]),w.useEffect(()=>{c&&(N.current=Date.now())},[c!==null]);const M=Date.now(),C=nj(E,M,f,c!==null),A=C.shown,_=E.filter(q=>q.state==="running").sort((q,Z)=>Z.startedAt-q.startedAt)[0],R=!c&&(d==null?void 0:d.outcome)==="completed"&&M+f-d.endedAt<rj,I=M-N.current,G=!c&&(i==null?void 0:i.status)==="idle"&&I>lj&&(I-lj)%SP<CP,Y=_&&_.look!=="thought"?Rp(_):C.lingering&&A?Rp(A):_?Rp(_):c?{motion:"think",fast:!1}:R?{motion:"stretch",fast:!1}:G?{motion:"groom",fast:!1}:s,L=!c&&!A&&d!==null&&M<b;return w.useEffect(()=>{const q=[(h==null?void 0:h.until)??0,b-ij,b,((d==null?void 0:d.endedAt)??0)-f+rj,C.next].filter(U=>U>Date.now()),Z=setTimeout(()=>k(U=>U+1),q.length?Math.min(...q)-Date.now()+20:1e3);return()=>clearTimeout(Z)}),{view:{steps:E,shown:A,skew:f,startedAt:((P=c??d)==null?void 0:P.startedAt)??0,endedAt:c?null:(d==null?void 0:d.endedAt)??null,done:L?{ms:d.endedAt-d.startedAt,outcome:d.outcome,fading:M>=b-ij}:null},motion:Y.motion,fast:Y.fast,mood:h&&h.until>M?h.mood:r,shake:y,canRecap:!c&&d!==null&&!L&&M+f-d.endedAt<kP,showRecap:()=>j(Date.now()+aj)}}const mS="jarvy-floating-bot",ss=10,EP=4,_d=new URLSearchParams(location.search).get("npc")==="demo",TP={zz:o.jsxs(o.Fragment,{children:[o.jsx("i",{children:"z"}),o.jsx("i",{children:"Z"})]}),ask:"?",sweat:o.jsxs("svg",{viewBox:"0 0 20 28",children:[o.jsx("path",{d:"M10 1C10 1 2 13 2 18.5a8 8 0 0 0 16 0C18 13 10 1 10 1Z"}),o.jsx("ellipse",{cx:"7",cy:"18",rx:"1.8",ry:"3"})]}),sparkle:o.jsx("svg",{viewBox:"0 0 100 100",children:[[14,22,9],[86,18,7],[90,46,4.5]].map(([e,a,i])=>o.jsx("path",{d:`M${e} ${a-i}Q${e} ${a} ${e+i} ${a}Q${e} ${a} ${e} ${a+i}Q${e} ${a} ${e-i} ${a}Q${e} ${a} ${e} ${a-i}Z`},e))})};function AP(e){return!e||e.status==="stop"?{motion:"sleep",fast:!1}:e.status!=="running"||e.activity==="asking"?{motion:"idle",fast:!1}:["compacting","retrying","aborting"].includes(e.phase)?{motion:"busy",fast:!1}:e.activity==="tool_calling"||e.phase==="tool"?{motion:"work",fast:!0}:e.activity==="texting"||e.phase==="texting"?{motion:"work",fast:!1}:{motion:"think",fast:!1}}function MP(){try{const e=JSON.parse(localStorage.getItem(mS)??"");if(e.x>=0&&e.x<=1&&e.y>=0&&e.y<=1)return e}catch{}return{x:1,y:0}}function _P({bot:e,chatId:a,status:i,area:r,avoid:s,onOpen:c}){const d=w.useRef(null),f=w.useRef(null),h=w.useRef(MP()),p=w.useRef(null),y=w.useRef(!1),g=w.useRef(null),b=w.useRef({motion:"sleep",mood:"normal",lookX:0,lookY:0}),j=w.useRef(null),[k,S]=w.useState(!1),N=w.useRef(null),E=hP(_d,e.mood),M=NP(_d?null:e.id,a,i,e.mood,AP(i)),C=_d?E:M;b.current.motion=C.motion,b.current.fast=C.fast,b.current.mood=C.mood;const A=KI[C.motion];function _(){const P=r.current.getBoundingClientRect(),q=d.current.offsetWidth,Z=s.current?s.current.getBoundingClientRect().top-P.top:P.height,U=Math.max(ss,P.width-q-ss),F=Math.max(ss,Z-q-ss);return{minX:ss,minY:ss,maxX:U,maxY:F}}function R(){var U;const P=(U=r.current)==null?void 0:U.getBoundingClientRect(),q=d.current;if(!P||!q)return 0;const Z=P.width/2-q.offsetWidth/2;return Z>0?Math.max(-1,Math.min(1,(Z-q.offsetLeft)/Z)):0}function I(){var Z;if(!d.current||!r.current)return;const P=_(),q=d.current;q.style.left=`${P.minX+h.current.x*(P.maxX-P.minX)}px`,q.style.top=`${P.minY+h.current.y*(P.maxY-P.minY)}px`,(Z=N.current)==null||Z.call(N)}w.useLayoutEffect(()=>{I();const P=new ResizeObserver(I);for(const q of[r.current,s.current,d.current])q&&P.observe(q);return()=>P.disconnect()},[]);const G=i!=null&&i.error?`${i.runId??""}:${i.error}`:null;w.useEffect(()=>{var P;(G||C.shake)&&((P=j.current)==null||P.shake())},[G,C.shake]),w.useEffect(()=>{const P=U=>{(U.pointerType==="mouse"||U.type==="pointerdown")&&(g.current={x:U.clientX,y:U.clientY})},q=U=>{U.relatedTarget||(g.current=null)},Z=U=>{const F=U.target;if(F.id!=="jarvy-composer")return;const X=F.getBoundingClientRect();g.current={x:X.left+X.width/2,y:X.top+X.height/2}};return window.addEventListener("pointermove",P),window.addEventListener("pointerdown",P),document.addEventListener("pointerout",q),document.addEventListener("input",Z),document.addEventListener("focusin",Z),()=>{window.removeEventListener("pointermove",P),window.removeEventListener("pointerdown",P),document.removeEventListener("pointerout",q),document.removeEventListener("input",Z),document.removeEventListener("focusin",Z)}},[]);const Y=w.useRef((ui[e.color]??ui.gray).hex),L=w.useRef(e.agent);return w.useEffect(()=>{Y.current=(ui[e.color]??ui.gray).hex},[e.color]),w.useEffect(()=>{L.current=e.agent},[e.agent]),w.useEffect(()=>{const P=f.current,q=P==null?void 0:P.getContext("2d");let Z;try{Z=v5()}catch{}if(!P||!q||!Z)return;const U=Z,F=new ZI,X=matchMedia("(prefers-reduced-motion: reduce)");let $=0;j.current={shake:()=>F.shake()};const H=O=>{var ne;const le=d.current;if(le!=null&&le.offsetWidth){const D=Math.round(le.offsetWidth*Math.min(2,devicePixelRatio||1)),B=le.getBoundingClientRect(),W=g.current;b.current.lookX=W?Math.max(-1,Math.min(1,(W.x-B.left-B.width/2)/320)):0,b.current.lookY=W?Math.max(-1,Math.min(1,(W.y-B.top-B.height/2)/320)):0,b.current.reduced=X.matches;const ue=b.current.motion,me=!!((ne=p.current)!=null&&ne.moved)&&(ue==="idle"||ue==="groom"||ue==="stretch");(b.current.faceX===void 0||!(me||ue==="sleep"))&&(b.current.faceX=R());const ge=F.frame(O,b.current),Se=.86;P.width!==D?P.width=P.height=D:q.clearRect(0,0,D,D),U.paint(q,D,Y.current,ge,{zoom:Se}),L.current&&x5(q,D,g5(ge,Se))}$=requestAnimationFrame(H)},ie=()=>{cancelAnimationFrame($),document.hidden||($=requestAnimationFrame(H))};return document.addEventListener("visibilitychange",ie),ie(),S(!0),()=>{document.removeEventListener("visibilitychange",ie),cancelAnimationFrame($),j.current=null,U.dispose()}},[]),o.jsxs(o.Fragment,{children:[o.jsxs("button",{ref:d,type:"button",className:"jv-floating-bot","data-live":k||void 0,"data-motion":C.motion,title:e.name,"aria-label":x("avatar.openInfo",{name:e.name}),onPointerDown:P=>{if(P.button!==0)return;const q=P.currentTarget;q.setPointerCapture(P.pointerId),p.current={id:P.pointerId,x:P.clientX,y:P.clientY,left:q.offsetLeft,top:q.offsetTop,moved:!1}},onPointerMove:P=>{const q=p.current;if(!q||q.id!==P.pointerId)return;const Z=P.clientX-q.x,U=P.clientY-q.y;if(!q.moved&&Math.hypot(Z,U)<EP)return;q.moved=!0;const F=_(),X=Math.min(F.maxX,Math.max(F.minX,q.left+Z)),$=Math.min(F.maxY,Math.max(F.minY,q.top+U));h.current={x:F.maxX>F.minX?(X-F.minX)/(F.maxX-F.minX):0,y:F.maxY>F.minY?($-F.minY)/(F.maxY-F.minY):0},I()},onPointerUp:P=>{const q=p.current;!q||q.id!==P.pointerId||(p.current=null,y.current=q.moved,q.moved&&localStorage.setItem(mS,JSON.stringify(h.current)))},onPointerCancel:()=>{p.current=null},onClick:()=>{if(y.current){y.current=!1;return}C.canRecap?C.showRecap():c()},style:{"--jv-avatar-size":"100%"},children:[o.jsx("canvas",{ref:f,"aria-hidden":"true"}),!k&&o.jsx(hl,{color:e.color,mood:e.mood,size:88,crown:e.agent}),k&&A&&o.jsx("span",{className:"jv-figure-mark","data-mark":A,"aria-hidden":"true",children:TP[A]})]}),o.jsx(nP,{view:C.view,name:e.name,cat:d,area:r,avoid:s,layout:N,facing:R,toolbar:_d?(P,q)=>o.jsx(oP,{controls:E.controls,toolbar:P,onReplay:()=>{q(),E.controls.replay()}}):void 0})]})}function RP({className:e,...a}){return o.jsx("div",{"data-slot":"card",className:bn("flex flex-col gap-4 rounded-xl border bg-card py-5 text-card-foreground shadow-sm",e),...a})}function OP({className:e,...a}){return o.jsx("div",{"data-slot":"card-header",className:bn("grid gap-1 px-5",e),...a})}function DP({className:e,...a}){return o.jsx("div",{"data-slot":"card-title",className:bn("font-semibold leading-none",e),...a})}function zP({className:e,...a}){return o.jsx("div",{"data-slot":"card-content",className:bn("px-5",e),...a})}function LP({bot:e,connections:a,onSaved:i,onManage:r}){return o.jsxs(RP,{className:"jarvy-model-picker jv-ui",children:[o.jsx(OP,{children:o.jsx(DP,{children:x("botModel.pickFor",{name:e.name})})}),o.jsx(zP,{children:o.jsx(k5,{bot:e,connections:a,onSaved:i,onManage:r})})]})}function BP({chat:e,inChannel:a,bots:i,members:r,meId:s,drafts:c,composeReady:d,botName:f,activeBot:h,status:p,connections:y,activity:g,history:b,divider:j,activeQuestion:k,pane:S,onPane:N,onToggleInfo:E,find:M,onNav:C,onBot:A,hasBotDirects:_,onInvite:R,onQuote:I,onReply:G,onReact:Y,onFold:L,onJump:P,onSettled:q,onSend:Z,onPreview:U,onSaveNote:F,notice:X,createBot:$,creating:H,updateBot:ie,onManageModels:O,error:le,chatArea:ne,transcript:D,composeWrap:B,hidden:W,onOpenThread:ue}){const{messages:me,loading:ge,hasOlder:Se,loadingOlder:Me,top:xe,away:oe,unseen:Ee,toLatest:Xe}=b;return o.jsxs("main",{className:"ui-chat","aria-label":x("chat.area"),ref:ne,hidden:W,children:[!a&&o.jsx(gt,{icon:"layout-sidebar-left",className:"ui-mobile-only jv-floating-nav",label:x("common.openNav"),onClick:C}),!a&&_&&o.jsx(gt,{icon:"people",className:"jv-floating-dms",label:x("chat.botDms",{name:f}),"aria-pressed":(S==null?void 0:S.kind)==="botdms",onClick:()=>N((S==null?void 0:S.kind)==="botdms"?null:{kind:"botdms"})}),o.jsx("span",{className:"sr-only",role:"status","aria-label":x("chat.botStatus"),children:a?"":g}),e?o.jsxs(o.Fragment,{children:[a?o.jsx(wI,{chat:e,members:hi(r),bots:i,onNav:C,infoOpen:(S==null?void 0:S.kind)==="info"&&S.page==="main",onInfo:()=>E("main"),membersOpen:(S==null?void 0:S.kind)==="info"&&S.page==="members",onMembers:()=>E("members"),threadsOpen:(S==null?void 0:S.kind)==="threads",onThreads:()=>N((S==null?void 0:S.kind)==="threads"?null:{kind:"threads"}),searchOpen:(S==null?void 0:S.kind)==="search",onSearch:()=>(S==null?void 0:S.kind)==="search"?N(null):M.search(e)}):h&&o.jsx(_P,{bot:h,chatId:e.id,status:p,area:ne,avoid:B,onOpen:()=>A(h.id)}),a&&o.jsx(kI,{chat:e,onSave:F}),o.jsxs("div",{className:"jv-transcript",children:[o.jsxs("div",{className:`ui-transcript jarvy-transcript${a?" jv-channel-transcript":""}`,ref:D,"aria-label":x("chat.transcript"),role:"log",children:[!a&&!(h!=null&&h.connectionId)&&h&&o.jsx("div",{className:"jarvy-model-onboarding",children:o.jsx(LP,{bot:h,connections:y,onSaved:ie,onManage:O})}),ge?o.jsx("p",{className:"jarvy-empty-text",children:x("chat.loading")}):me.length===0?a?o.jsx("div",{className:"jarvy-empty-chat",children:o.jsx("p",{children:x("chat.empty")})}):h!=null&&h.connectionId?o.jsx("div",{className:"jarvy-empty-chat",children:o.jsx("h2",{children:x("chat.start",{name:f})})}):null:o.jsxs(o.Fragment,{children:[Se&&o.jsx("div",{ref:xe,className:"jv-history-more","aria-live":"polite",children:Me?x("chat.loadingOlder"):""}),a?o.jsx(tf,{messages:me,members:r,bots:i,me:s,divider:j,activeQuestion:k,onSettled:q,onPreview:U,onReply:G,onOpenThread:ue,onQuote:I,onReact:Y,onFold:L,onJump:P,onError:le}):o.jsx(YI,{messages:me,members:r,me:s,activeQuestion:k,bot:h,onSettled:q,onPreview:U,onQuote:I,onReact:Y,onFold:L,onJump:P,onError:le})]})]}),oe&&me.length>0&&o.jsx("div",{className:"jv-to-latest",children:o.jsxs("button",{type:"button",onClick:Xe,"aria-label":x("chat.toLatest"),children:[Ee>0&&o.jsx("span",{children:x("chat.unseen",{count:Ee})}),o.jsx(Ue,{name:"chevron-down"})]})})]}),o.jsx(dS,{chatId:e.id,id:"jarvy-composer",drafts:c,formRef:B,scrollRef:D,disabled:!d,placeholder:a?x("chat.toChannel",{name:e.title}):h!=null&&h.connectionId?x("chat.toBot",{name:f}):x("chat.pickModel"),mention:a?{bots:i,inside:hi(r).filter(Be=>Be.id!==s&&e.memberIds.includes(Be.id)),outside:hi(r).filter(Be=>!e.memberIds.includes(Be.id)),onInvite:Be=>R(e.id,Be)}:void 0,onSend:Z,onError:le,onNotice:X})]}):o.jsx("div",{className:"jarvy-empty-chat jarvy-first-chat",children:i.length?o.jsx("p",{children:x("chat.pick")}):o.jsxs("button",{className:"ui-button ui-primary",onClick:$,disabled:H,children:[o.jsx(Ue,{name:"person-add"}),x("sidebar.newBot")]})}),e&&o.jsx(F5,{container:D,drafts:c,chatId:e.id,source:Be=>me.find(Je=>Je.id===Be),members:r,onNotice:X})]})}class IP{constructor(){Wt(this,"listeners",new Set)}emit(a){for(const i of this.listeners)i(a)}on(a){return this.listeners.add(a),()=>{this.listeners.delete(a)}}}function pS(e,a){const i=w.useRef(a);i.current=a,w.useEffect(()=>e.on(r=>i.current(r)),[e])}const Qc=(e,a)=>e.some(i=>i.id===a.id)?e.map(i=>i.id===a.id?a:i):e;function Sf(e,a){if(e.some(r=>r.id===a.id))return Qc(e,a);if(e[0]&&a.sequence<e[0].sequence)return e;const i=e.findIndex(r=>r.sequence>a.sequence);return i<0?[...e,a]:[...e.slice(0,i),a,...e.slice(i)]}const Vg=(e,a)=>e.sequence>a+1;function gS(e,a,i){var s;const r=((s=a.at(-1))==null?void 0:s.sequence)??i;return[...e.filter(c=>c.sequence<=i),...a,...e.filter(c=>c.sequence>r)]}const PP=e=>na(e,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"});function HP(e,a){const[i,r]=w.useState([]);return w.useEffect(()=>{if(r([]),!e)return;let s=!0;return he.botDirects(e).then(c=>{s&&r(c.chats)}).catch(()=>{}),()=>{s=!1}},[e,a]),i}function qP({bot:e,chats:a,members:i,bots:r,me:s,live:c,onClose:d,onPreview:f,onError:h}){const[p,y]=w.useState(null),[g,b]=w.useState(null);w.useEffect(()=>{if(b(null),!p)return;let S=!0;return he.messages(p).then(N=>{S&&b(N.messages)}).catch(N=>{S&&h(N)}),()=>{S=!1}},[p]),pS(c,S=>{if(S.kind==="chat"||S.message.chatId!==p)return;const N=S.message;b(E=>E&&(S.kind==="message"?Sf(E,N):Qc(E,N)))});const j=S=>i.find(N=>N.id!==e.id&&S.memberIds.includes(N.id)),k=a.find(S=>S.id===p);return o.jsxs("aside",{className:"ui-pane jv-pane","aria-label":x("chat.botDms",{name:e.name}),children:[o.jsxs("header",{className:"ui-pane-header jv-pane-header",children:[k&&o.jsx(gt,{icon:"chevron-left",label:x("directs.back"),onClick:()=>y(null)}),o.jsx("strong",{children:k?x("directs.between",{name:e.name,other:pi(j(k))}):x("chat.botDms",{name:e.name})}),o.jsx("span",{className:"jv-spacer"}),o.jsx(gt,{icon:"close",label:x("common.close"),onClick:d})]}),k?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"ui-pane-body jv-pane-body",children:g===null?o.jsx("p",{className:"jv-picker-empty",children:x("threads.loading")}):g.length===0?o.jsx("p",{className:"jv-picker-empty",children:x("chat.empty")}):o.jsx(tf,{messages:g,members:i,bots:r,me:s,divider:Number.MAX_SAFE_INTEGER,onSettled:()=>{},onPreview:f})}),o.jsx("p",{className:"jv-readonly",children:x("directs.readOnly")})]}):o.jsx("div",{className:"ui-pane-body jv-pane-body",children:a.length===0?o.jsx("p",{className:"jv-picker-empty",children:x("sidebar.noDms")}):a.map(S=>{const N=j(S);return o.jsxs("button",{type:"button",className:"jv-thread-item",onClick:()=>y(S.id),children:[o.jsxs("span",{className:"jv-thread-item-head",children:[o.jsx(Sr,{member:N,bots:r,size:20}),o.jsx("strong",{children:pi(N)}),o.jsx("span",{className:"jv-muted",children:PP(S.updatedAt)})]}),S.lastMessage&&o.jsx("span",{className:"jv-muted jv-thread-item-meta",children:go(S.lastMessage)})]},S.id)})})]})}function UP(e,a){return e!=null&&e.connectionId?a!=null&&a.error?{label:x("activity.error"),tone:"error"}:(a==null?void 0:a.status)==="running"?{label:P5(a.activity),tone:"busy"}:{label:x((a==null?void 0:a.status)==="idle"?"activity.idle":"activity.stopped")}:{label:x("activity.noModel")}}function FP({channel:e,members:a,bots:i,statuses:r,me:s,onAdd:c,onBot:d,onChanged:f,onError:h}){const[p,y]=w.useState(null),g=a.filter(S=>e.memberIds.includes(S.id)),b=g.filter(S=>S.kind!=="bot").sort((S,N)=>+(N.id===s)-+(S.id===s)),j=g.filter(S=>S.kind==="bot"),k=S=>{const N=S.kind==="bot"?i.find(A=>A.id===S.id):void 0,E=r[S.id],M=S.kind==="bot"?UP(N,E):void 0,C=o.jsxs(o.Fragment,{children:[o.jsx(Sr,{member:S,bots:i,size:28,working:(E==null?void 0:E.status)==="running"&&E.activity!=="asking"}),o.jsxs("span",{className:"jv-member-name",children:[S.name,S.id===s&&o.jsx("span",{className:"jv-role",children:x("common.you")})]}),M&&o.jsx("span",{className:"jv-member-state","data-tone":M.tone,children:M.label})]});return o.jsxs("div",{className:"jv-member-row",children:[N?o.jsx("button",{type:"button",className:"jv-member-main","aria-label":x("members.view",{name:S.name}),onClick:()=>d(S.id),children:C}):o.jsx("div",{className:"jv-member-main",children:C}),S.id!==s&&o.jsx(gt,{icon:"close",label:x("members.remove",{name:S.name}),className:"jv-member-remove",onClick:()=>y(S)})]},S.id)};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"jv-member-bar",children:[o.jsx("span",{children:x("members.count",{count:g.length})}),o.jsxs("button",{type:"button",className:"ui-button ui-primary jv-member-pane-add",onClick:c,children:[o.jsx(Ue,{name:"person-add"}),x("common.add")]})]}),o.jsx("div",{className:"ui-pane-body jv-pane-body",children:[["people",x("members.people"),b],["bots","Bot",j]].map(([S,N,E])=>E.length>0&&o.jsxs("section",{className:"jv-member-group","aria-label":N,children:[o.jsxs("h3",{children:[N," · ",E.length]}),E.map(k)]},S))}),p&&o.jsx(nS,{title:x("members.removeTitle",{name:p.name,channel:e.title}),body:x("members.removeBody"),confirm:x("members.removeConfirm"),onClose:()=>y(null),onConfirm:async()=>{try{f(await he.removeMember(e.id,p.id)),y(null)}catch(S){h(S)}}})]})}function oj({label:e,value:a,empty:i,maxLength:r,required:s=!1,onSave:c}){const d=w.useId(),[f,h]=w.useState(null),[p,y]=w.useState(!1);w.useEffect(()=>h(null),[a]);const g=async()=>{if(!(f===null||p||s&&!f.trim())){if(f.trim()===a){h(null);return}y(!0);try{await c(f.trim()),h(null)}catch{}finally{y(!1)}}};return o.jsxs("div",{className:"jv-info-field",children:[o.jsxs("div",{className:"jv-info-label",children:[o.jsx("label",{htmlFor:d,children:e}),f===null&&o.jsx(gt,{icon:"pencil",label:x("info.edit",{name:e}),className:"jv-info-edit",onClick:()=>h(a)})]}),f===null?o.jsx("p",{className:"jv-info-value","data-empty":!a||void 0,children:a||i}):o.jsxs("div",{className:"jv-inline-edit",children:[o.jsx("input",{id:d,value:f,maxLength:r,autoFocus:!0,placeholder:i,onChange:b=>h(b.target.value),onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),g()),b.key==="Escape"&&(b.stopPropagation(),h(null))}}),o.jsx("button",{type:"button",className:"ui-button",onClick:()=>h(null),children:x("common.cancel")}),o.jsx("button",{type:"button",className:"ui-button ui-primary",disabled:p||s&&!f.trim(),onClick:()=>void g(),children:x("common.save")})]})]})}function VP({channel:e,page:a,sections:i,members:r,bots:s,statuses:c,me:d,onPage:f,onPin:h,onMute:p,onAdd:y,onBot:g,onDelete:b,onChanged:j,onClose:k,onError:S}){const N=w.useId(),E=async C=>{try{j(await he.updateChannel(e.id,C))}catch(A){throw S(A),A}},M=r.filter(C=>e.memberIds.includes(C.id)).length;return o.jsxs("aside",{className:"ui-pane jv-pane","aria-label":x(a==="members"?"info.memberList":"entry.channelInfo"),children:[o.jsxs("header",{className:"ui-pane-header jv-pane-header",children:[a==="members"&&o.jsx(gt,{icon:"chevron-left",label:x("info.back"),className:"jv-pane-back",onClick:()=>f("main")}),o.jsx("strong",{children:x(a==="members"?"channel.members":"entry.channelInfo")}),o.jsxs("span",{className:"jv-muted jv-pane-sub",children:["#",e.title]}),o.jsx("span",{className:"jv-spacer"}),o.jsx(gt,{icon:"close",label:x("common.close"),onClick:k})]}),a==="members"?o.jsx(FP,{channel:e,members:r,bots:s,statuses:c,me:d,onAdd:y,onBot:g,onChanged:j,onError:S}):o.jsxs("div",{className:"ui-pane-body jv-pane-body jv-info",children:[o.jsxs("div",{className:"jv-info-actions",children:[o.jsxs("button",{type:"button","aria-pressed":e.pinned,onClick:h,children:[o.jsx(Ue,{name:"pin"}),x("entry.pin")]}),o.jsxs("button",{type:"button","aria-pressed":e.muted,onClick:p,children:[o.jsx(Ue,{name:e.muted?"bell-slash":"bell"}),x("entry.mute")]}),o.jsxs("button",{type:"button",onClick:y,children:[o.jsx(Ue,{name:"person-add"}),x("info.addMembers")]})]}),o.jsx(oj,{label:x("info.name"),value:e.title,empty:x("info.newChannel"),maxLength:80,required:!0,onSave:C=>E({name:C})}),o.jsx(oj,{label:x("info.topic"),value:e.topic,empty:x("info.noTopic"),maxLength:200,onSave:C=>E({topic:C})}),o.jsxs("div",{className:"jv-info-field",children:[o.jsx("div",{className:"jv-info-label",children:o.jsx("label",{htmlFor:N,children:x("info.section")})}),o.jsx(E5,{id:N,value:e.sectionId,sections:i,onChange:C=>void E({sectionId:C}).catch(()=>{})})]}),o.jsxs("nav",{className:"jv-info-menu","aria-label":x("info.menu"),children:[o.jsxs("button",{type:"button",className:"ui-menu-item",onClick:()=>f("members"),children:[o.jsx(Ue,{name:"people"}),o.jsx("span",{className:"ui-menu-copy",children:x("channel.members")}),o.jsx("span",{className:"jv-muted",children:M}),o.jsx(Ue,{name:"chevron-right"})]}),o.jsxs("button",{type:"button",className:"ui-menu-item jv-menu-danger",onClick:b,children:[o.jsx(Ue,{name:"trash"}),o.jsx("span",{className:"ui-menu-copy",children:x("entry.deleteChannel")})]})]})]})]})}function $P({chat:e,chats:a,members:i,focusKey:r,onOpenMessage:s,onClose:c,onError:d}){const[f,h]=w.useState(""),p=w.useRef(null);w.useEffect(()=>{var j,k;(j=p.current)==null||j.focus(),(k=p.current)==null||k.select()},[r,e.id]);const{result:y,loading:g}=aS(f,e.id,d),b=e.type==="channel"?`#${e.title}`:x(e.type==="thread"?"search.inThread":"search.inDm");return o.jsxs("aside",{className:"ui-pane jv-pane jv-search-pane","aria-label":x("search.paneLabel"),children:[o.jsxs("header",{className:"ui-pane-header jv-pane-header",children:[o.jsx("strong",{children:x("search.title")}),o.jsx("span",{className:"jv-muted jv-pane-sub",children:b}),o.jsx("span",{className:"jv-spacer"}),o.jsx(gt,{icon:"close",label:x("search.close"),onClick:c})]}),o.jsx("div",{className:"jv-pane-search",children:o.jsx("input",{ref:p,type:"search",value:f,placeholder:x(e.type==="channel"?"search.channelPlaceholder":"search.placeholder"),"aria-label":x("search.placeholder"),onChange:j=>h(j.target.value),onKeyDown:j=>{j.key==="Escape"&&(j.preventDefault(),f?h(""):c())}})}),o.jsx("div",{className:"ui-pane-body jv-pane-body jv-results","aria-live":"polite",children:f.trim()?y?y.messages.length?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"jv-result-count",children:x(y.messages.length>=60?"search.countLatest":"search.count",{count:y.messages.length})}),y.messages.map(({message:j,chat:k})=>o.jsx(lS,{message:j,chat:k,chats:a,members:i,query:f,showPlace:k.id!==e.id,onOpen:s},j.id))]}):o.jsx("p",{className:"jv-result-empty",children:x("search.noMessages")}):g&&o.jsx("p",{className:"jv-result-empty",children:x("search.searching")}):o.jsx("p",{className:"jv-result-empty",children:x("search.prompt")})})]})}const GP=e=>na(e,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"});function YP({chat:e,channelName:a,expanded:i=!1,onTitle:r,onStatus:s,onSummary:c,onConclude:d}){var C;const[f,h]=w.useState(null),[p,y]=w.useState(null),[g,b]=w.useState(!1),[j,k]=w.useState(i);w.useEffect(()=>{h(null),y(null),k(i)},[e.id,i]);const S=async(A,_)=>{b(!0);try{await A(),_()}catch{}finally{b(!1)}},N=e.status==="done",E=e.note,M=((C=E==null?void 0:E.text.split(`
800
+ `).find(A=>A.trim()&&!A.startsWith("#")))==null?void 0:C.replace(/[*`|>-]/g,"").trim())??"";return o.jsxs("div",{className:"jv-thread-meta","data-open":j||void 0,children:[o.jsxs("div",{className:"jv-thread-title-row",children:[f===null?o.jsxs(o.Fragment,{children:[o.jsx("h2",{className:"jv-thread-title",title:e.title,children:e.title}),o.jsx(gt,{icon:"pencil",label:x("thread.rename"),onClick:()=>h(e.title)})]}):o.jsxs("form",{className:"jv-inline-edit",onSubmit:A=>{A.preventDefault(),f.trim()&&S(()=>r(f.trim()),()=>h(null))},children:[o.jsx("input",{value:f,autoFocus:!0,maxLength:80,"aria-label":x("thread.title"),onChange:A=>h(A.target.value),onKeyDown:A=>{A.key==="Escape"&&h(null)}}),o.jsx("button",{type:"submit",className:"ui-button ui-primary",disabled:g||!f.trim(),children:x("common.save")})]}),o.jsx("button",{type:"button",className:"jv-thread-status","data-done":N||void 0,disabled:g,title:x("thread.toggleStatus"),onClick:()=>void S(()=>s(N?"open":"done"),()=>{}),children:N?o.jsxs(o.Fragment,{children:[o.jsx(Ue,{name:"check"}),x("channel.threadDone")]}):x("threads.open")})]}),p!==null?o.jsxs("div",{className:"jv-summary","data-editing":!0,children:[o.jsx("textarea",{className:"jv-notice-input",value:p,autoFocus:!0,"aria-label":x("thread.summary"),onChange:A=>y(A.target.value)}),o.jsxs("div",{className:"jv-notice-actions",children:[o.jsx("button",{type:"button",className:"ui-button",onClick:()=>y(null),children:x("common.cancel")}),o.jsx("button",{type:"button",className:"ui-button ui-primary",disabled:g||!p.trim(),onClick:()=>void S(()=>c(p.trim()),()=>y(null)),children:x("common.save")})]})]}):E?o.jsxs("div",{className:"jv-summary",children:[o.jsxs("div",{className:"jv-summary-head",children:[o.jsxs("button",{type:"button",className:"jv-summary-toggle","aria-expanded":j,onClick:()=>k(!j),children:[o.jsx("strong",{children:x("thread.summary")}),!j&&o.jsx("span",{className:"jv-summary-first",children:M}),o.jsx(Ue,{name:j?"chevron-down":"chevron-right"})]}),j&&o.jsxs("span",{className:"jv-muted jv-summary-meta",children:[E.updatedBy.name," · ",GP(E.updatedAt)," · ",x("notice.version",{version:E.version})]}),o.jsx(gt,{icon:"pencil",label:x("thread.editSummary"),onClick:()=>y(E.text)})]}),j&&o.jsx("div",{className:"jv-summary-body ui-bubble jv-flat",children:o.jsx(Kc,{text:E.text})}),j&&!N&&o.jsxs("button",{type:"button",className:"ui-button jv-conclude",disabled:g,onClick:()=>void S(d,()=>{}),children:[o.jsx(Ue,{name:"check"}),x("thread.conclude",{channel:a})]})]}):o.jsxs("button",{type:"button",className:"jv-summary-empty",onClick:()=>y(""),children:[o.jsx(Ue,{name:"add"}),x("thread.addSummary")]})]})}const KP=20,sj=500;class XP{constructor(){Wt(this,"kept",new Map)}take(a){const i=this.kept.get(a);return this.kept.delete(a),i}keep(a,i){if(this.kept.delete(a),!(i.messages.length>sj)){this.kept.set(a,i);for(const r of this.kept.keys()){if(this.kept.size<=KP)break;this.kept.delete(r)}}}removed(a){var i;for(const[r,s]of this.kept)(r===a||((i=s.chat)==null?void 0:i.parentId)===a)&&this.kept.delete(r)}clear(){this.kept.clear()}heard(a){var c;if(a.kind==="chat"){const d=this.kept.get(a.chat.id);d!=null&&d.chat&&(d.chat=a.chat);return}const i=a.message;for(const d of this.kept.values())((c=d.root)==null?void 0:c.id)===i.id&&(d.root=i);const r=this.kept.get(i.chatId);if(!r)return;if(a.kind==="updated"||r.messages.some(d=>d.id===i.id)){r.messages=Qc(r.messages,i);return}const s=r.messages.at(-1);if(s&&Vg(i,s.sequence)||r.messages.length>=sj){this.kept.delete(i.chatId);return}r.messages=Sf(r.messages,i)}}function vS(e,a){if(e.scrollHeight-e.scrollTop-e.clientHeight<a)return{bottom:!0};const i=e.getBoundingClientRect();let r;for(const s of e.querySelectorAll("[data-message]")){const c=s.getBoundingClientRect();if(c.bottom<=i.top)continue;const d={bottom:!1,id:s.dataset.message,offset:c.top-i.top};if(c.top>=i.top&&c.top<i.bottom)return d;if(r??(r=d),c.top>=i.bottom)break}return r??{bottom:!0}}function af(e,a){if(a.bottom)return!1;const i=e.querySelector(`[data-message="${a.id}"]`);return i?(e.scrollTo({top:e.scrollTop+i.getBoundingClientRect().top-e.getBoundingClientRect().top-a.offset,behavior:"instant"}),!0):!1}class yS{constructor(){Wt(this,"stop")}get on(){return this.stop!==void 0}start(a,i){this.release();const r=new ResizeObserver(()=>af(a,i));for(const d of a.children)r.observe(d);const s=["wheel","touchstart","pointerdown","keydown"],c=()=>this.release();for(const d of s)a.addEventListener(d,c,{passive:!0});this.stop=()=>{r.disconnect();for(const d of s)a.removeEventListener(d,c)}}release(){var a;(a=this.stop)==null||a.call(this),this.stop=void 0}}const Op=50;function cj({threadId:e,mode:a,showSummary:i=!1,focus:r,onSearch:s,channel:c,drafts:d,members:f,bots:h,me:p,live:y,memory:g,onClose:b,onToggleMode:j,onNav:k,onChanged:S,onInvite:N,onPreview:E,onError:M,onNotice:C,onOpenMessage:A}){var Qt;const[_,R]=w.useState(null),[I,G]=w.useState(null),[Y,L]=w.useState([]),[P,q]=w.useState(null),[Z,U]=w.useState(!1),[F,X]=w.useState(!1),$=w.useRef(Y),H=w.useRef(Z),ie=w.useRef(null),O=w.useRef(null),le=w.useRef(!1);$.current=Y,H.current=Z;const ne=w.useRef(null),D=w.useRef(null),B=w.useRef(null),W=w.useRef(!1),ue=w.useRef(!0),[me,ge]=w.useState(!1),Se=w.useRef(0),Me=w.useRef(0),xe=w.useRef(0),oe=w.useRef({bottom:!0}),Ee=w.useRef(null),Xe=w.useRef(_),Be=w.useRef(I),[Je]=w.useState(()=>new yS);Xe.current=_,Be.current=I,w.useEffect(()=>{R(null),G(null),L([]),U(!1),q(null),W.current=!1,ue.current=!0,ge(!1),Se.current=0,Me.current=0,xe.current=0},[e]);const Qe=async de=>{const Te=await he.message(de).catch(()=>null);if(!Te||Te.chatId!==e)return(Te==null?void 0:Te.chatId)??null;const Re=Math.max(0,Te.sequence-1-Op/2);return{...await he.messages(e,Re),hasOlder:Re>0}},et=async()=>{const de=$.current[0];if((de==null?void 0:de.chatId)===e)return{...await he.messages(e,de.sequence-1),after:de.sequence-1};const Te=r&&B.current!==e?await Qe(r.id):null;return Te&&typeof Te=="object"?Te:await he.latestMessages(e,Op)},Lt=de=>{const Te=de.after;L(Re=>Te===void 0?de.messages:gS(Re.filter(Ie=>Ie.chatId===e),de.messages,Te)),de.hasOlder!==void 0&&U(de.hasOlder)},cn=de=>{const Te=$.current,Re=Te.at(-1),Ie=Math.max((Re==null?void 0:Re.chatId)===e?Re.sequence:0,xe.current);if(Vg(de,Ie)&&!Te.some(He=>He.id===de.id)){et().then(Lt).catch(M);return}xe.current=Math.max(xe.current,de.sequence),L(He=>Sf(He,de))};pS(y,de=>{if(de.kind==="chat"){const Re=de.chat;Re.id===e&&R(Ie=>Ie&&{...Re,readSequence:Math.max(Ie.readSequence,Re.readSequence)});return}const Te=de.message;Te.id===(I==null?void 0:I.id)?G(Te):Te.chatId===e&&(de.kind==="message"?cn(Te):L(Re=>Qc(Re,Te)))});const jn=async()=>{var Re;const de=$.current[0],Te=ne.current;if(!(!de||!H.current||le.current)){le.current=!0,X(!0);try{const Ie=await he.olderMessages(e,de.sequence,Op);if(((Re=$.current[0])==null?void 0:Re.id)!==de.id)return;O.current=Te?Te.scrollHeight-Te.scrollTop:null,L(He=>{var at;return((at=He[0])==null?void 0:at.id)===de.id?[...Ie.messages,...He]:He}),U(Ie.hasOlder)}catch(Ie){M(Ie)}finally{le.current=!1,X(!1)}}};w.useEffect(()=>{let de=!0;oe.current={bottom:!0},Ee.current=null;const Te=()=>{de=!1,Je.release();const Ie=Xe.current;W.current&&(Ie==null?void 0:Ie.id)===e&&g.keep(e,{messages:$.current.filter(He=>He.chatId===e),hasOlder:H.current,place:oe.current,seen:Se.current,chat:Ie,root:Be.current})},Re=r?void 0:g.take(e);return Re!=null&&Re.chat?(Ee.current=Re.place,Se.current=Re.seen,R(Re.chat),G(Re.root??null),L(Re.messages),U(Re.hasOlder),B.current!==e&&(B.current=e,q(Re.chat.readSequence)),Te):(Promise.all([he.chat(e),et()]).then(async([Ie,He])=>{if(de&&(R(Ie),Lt(He),B.current!==e&&(B.current=e,q(Ie.readSequence)),Ie.rootMessageId)){const at=await he.message(Ie.rootMessageId);de&&G(at)}}).catch(Ie=>{de&&M(Ie)}),Te)},[e]),w.useLayoutEffect(()=>{const de=ne.current;if(!de||!_)return;if(O.current!==null){de.scrollTo({top:de.scrollHeight-O.current,behavior:"instant"}),O.current=null;return}const Te=()=>de.scrollTo({top:de.scrollHeight,behavior:"instant"}),Re=Y.at(-1),Ie=(Re==null?void 0:Re.senderId)===p&&Re.sequence>Me.current;if(Me.current=Math.max(Me.current,(Re==null?void 0:Re.sequence)??0),W.current)(ue.current||Ie)&&(Je.release(),de.scrollTo({top:de.scrollHeight,behavior:"smooth"}));else{if(!Y.length&&!I)return;W.current=!0;const He=r?de.querySelector(`[data-message="${r.id}"]`):null;if(He){if(ue.current=!1,He.scrollIntoView({block:"center"}),r!=null&&r.passage&&U5(He,r.passage))return;He.classList.add("jv-jump"),setTimeout(()=>He.classList.remove("jv-jump"),1600);return}const at=Ee.current;if(Ee.current=null,at&&af(de,at)){ue.current=!1,oe.current=at,Je.start(de,at),ge(!0);return}Te(),requestAnimationFrame(Te)}(ue.current||Ie)&&(Se.current=(Re==null?void 0:Re.sequence)??0)},[Y,I,_]),w.useLayoutEffect(()=>{const de=ne.current,Te=oe.current;de&&W.current&&af(de,Te)&&Je.start(de,Te)},[a]),w.useEffect(()=>{W.current&&r&&ga(r.id,r.passage)},[r]),w.useEffect(()=>{const de=ne.current,Te=ie.current;if(!de||!Te||!Z||!W.current)return;const Re=new IntersectionObserver(Ie=>{var He;(He=Ie[0])!=null&&He.isIntersecting&&W.current&&jn()},{root:de,rootMargin:"400px 0px 0px 0px"});return Re.observe(Te),()=>Re.disconnect()},[Z,Y,e,_]),w.useEffect(()=>{const de=ne.current,Te=D.current;if(!de||!Te)return;let Re=0;const Ie=()=>{cancelAnimationFrame(Re),Re=requestAnimationFrame(()=>{W.current&&de.clientHeight&&!Je.on&&(oe.current=vS(de,120))})},He=new ResizeObserver(()=>{if(Ie(),!!W.current){if(de.scrollHeight-de.clientHeight<8){at();return}ue.current&&(de.scrollHeight-de.scrollTop-de.clientHeight<8||de.scrollTo({top:de.scrollHeight,behavior:"instant"}))}});He.observe(Te),He.observe(de);const at=()=>{var Gt;Je.on||(ue.current=de.scrollHeight-de.scrollTop-de.clientHeight<120,ue.current&&(Se.current=Math.max(Se.current,((Gt=$.current.at(-1))==null?void 0:Gt.sequence)??0)),ge(!ue.current),Ie())};return at(),de.addEventListener("scroll",at,{passive:!0}),()=>{He.disconnect(),de.removeEventListener("scroll",at),cancelAnimationFrame(Re)}},[ne.current,e,_]),w.useEffect(()=>{const de=Y.at(-1);if(!_||!de||de.chatId!==_.id)return;const Te=()=>{if(document.visibilityState!=="visible"||_.readSequence>=de.sequence)return;const Re={..._,readSequence:de.sequence,unread:0,mentions:0,alerts:0,atMe:!1,hint:null};R(Re),he.markRead(_.id,de.sequence).then(()=>S(Re)).catch(M)};return Te(),document.addEventListener("visibilitychange",Te),()=>document.removeEventListener("visibilitychange",Te)},[Y,_]);const Xt=async de=>{try{const Te=await de();R(Te),S(Te)}catch(Te){throw M(Te),Te}},$n=async(de,Te,Re)=>{try{const Ie=await he.react(de.id,Te,Re),He=at=>at.id===Ie.id?{...at,reactions:Ie.reactions}:at;L(at=>at.map(He)),G(at=>at&&He(at))}catch(Ie){M(Ie)}},Pn=async(de,Te)=>{try{const Re=await he.fold(de.id,Te),Ie=He=>He.id===Re.id?{...He,folded:Re.folded}:He;L(He=>He.map(Ie)),G(He=>He&&Ie(He))}catch(Re){M(Re)}},ga=(de,Te)=>{Je.release();const Re=()=>{var He;return de?(He=ne.current)==null?void 0:He.querySelector(`[data-message="${de}"]`):null},Ie=Re();if(Ie){k0(Ie,Te);return}if(!de){C(x("app.sourceGone"));return}Qe(de).then(He=>{if(typeof He=="string"&&A){A(He,de,Te);return}if(!He||typeof He=="string"){C(x("thread.sourceElsewhere"));return}Lt(He),requestAnimationFrame(()=>{const at=Re();at&&k0(at,Te)})})},pe={onQuote:de=>uS(d,de,f),onReact:$n,onFold:Pn,onJump:ga,onError:M},Ce=async(de,Te,Re,Ie,He=[],at=!1)=>{const Gt=await he.send(e,de,Te,Re,at,Ie,He),za=c?[...new Set(qg(de,hi(f)).filter(Gn=>!c.memberIds.includes(Gn.member.id)).map(Gn=>Gn.member.name))]:[];za.length&&C(x("app.notInChannel",{names:za.join(x("common.listSeparator")),count:za.length})),cn(Gt)},Ge=(c==null?void 0:c.title)??x("search.channel"),Ke=f.find(de=>de.id===(I==null?void 0:I.senderId)),ot=me?Y.filter(de=>de.sequence>Se.current&&de.senderId!==p).length:0,At=new Set([...I?[I.senderId,...I.mentions]:[],...Y.flatMap(de=>[de.senderId,...de.mentions])]);return At.delete(p),o.jsxs("section",{role:a==="pane"?"complementary":a==="full"?"main":void 0,className:a==="pane"?"ui-pane jv-pane":a==="embed"?"ui-chat jv-thread-full jv-thread-embed":"ui-chat jv-thread-full","aria-label":x("thread.label"),onKeyDown:de=>{_&&s&&(de.ctrlKey||de.metaKey)&&de.key.toLowerCase()==="f"&&(de.preventDefault(),s(_))},children:[o.jsxs("header",{className:a==="pane"?"ui-pane-header jv-pane-header":"ui-chat-header jv-pane-header",children:[a==="full"&&o.jsx(gt,{icon:"layout-sidebar-left",className:"ui-mobile-only",label:x("common.openNav"),onClick:k}),a==="embed"&&o.jsx(gt,{icon:"chevron-left",className:"ui-mobile-only",label:x("thread.backToList"),onClick:b}),a==="full"?o.jsxs("button",{type:"button",className:"jv-crumb",onClick:b,children:[o.jsx(Ue,{name:"chevron-left"}),o.jsx("span",{className:"jv-hash",children:"#"}),Ge]}):a==="embed"?o.jsxs("button",{type:"button",className:"jv-crumb",title:x("thread.inChannel"),onClick:j,children:[o.jsx("span",{className:"jv-hash",children:"#"}),Ge]}):o.jsxs(o.Fragment,{children:[o.jsx("strong",{children:x("thread.label")}),o.jsxs("span",{className:"jv-muted jv-pane-sub",children:["#",Ge]})]}),o.jsx("span",{className:"jv-spacer"}),_&&s&&o.jsx(gt,{icon:"search",label:x("thread.search"),onClick:()=>s(_)}),_&&o.jsxs("button",{type:"button",className:"ui-button jv-follow","data-on":_.following||void 0,title:x(_.following?"thread.followingHint":"thread.notFollowingHint"),onClick:()=>void Xt(()=>he.follow(e,!_.following)).catch(()=>{}),children:[o.jsx(Ue,{name:"bell"}),x(_.following?"threads.following":"thread.follow")]}),a!=="embed"&&o.jsx(gt,{icon:a==="pane"?"arrows-expand":"arrows-contract",className:"jv-desktop-only",label:x(a==="pane"?"thread.expand":"thread.collapse"),onClick:j}),a==="pane"&&o.jsx(gt,{icon:"close",label:x("thread.close"),onClick:b})]}),_&&o.jsx("div",{className:a==="pane"?"jv-thread-pin":"jv-thread-pin jv-thread-pin-wide",children:o.jsx(YP,{chat:_,channelName:Ge,expanded:i,onTitle:de=>Xt(()=>he.updateThread(e,{title:de})),onStatus:de=>Xt(()=>he.updateThread(e,{status:de})),onSummary:de=>Xt(()=>he.setNote(e,de)),onConclude:async()=>{var de;try{await Ce(`${x("thread.conclusion")}
801
+
802
+ ${((de=_.note)==null?void 0:de.text)??""}`,[],Array.from(crypto.getRandomValues(new Uint8Array(16)),Te=>Te.toString(16).padStart(2,"0")).join(""),void 0,[],!0),await Xt(()=>he.updateThread(e,{status:"done"})),C(x("thread.concluded",{channel:Ge}))}catch(Te){throw M(Te),Te}}})}),o.jsxs("div",{className:"jv-transcript",children:[o.jsx("div",{ref:ne,className:a==="pane"?"ui-pane-body jv-pane-body":"ui-transcript jv-thread-wide",children:o.jsxs("div",{ref:D,children:[I&&o.jsx(tf,{messages:[{...I,thread:null}],members:f,bots:h,me:p,divider:Number.MAX_SAFE_INTEGER,onSettled:()=>{},onPreview:E,onReact:$n,onFold:Pn,onJump:ga,onError:M}),o.jsx("div",{className:"jv-divider","data-tone":"count",role:"separator",children:o.jsx("span",{children:Y.length?x("channel.replies",{count:((Qt=I==null?void 0:I.thread)==null?void 0:Qt.replies)??Y.length}):x("thread.noReplies")})}),Z&&o.jsx("div",{ref:ie,className:"jv-history-more","aria-live":"polite",children:F?x("chat.loadingOlder"):""}),o.jsx(tf,{messages:Y,members:f,bots:h,me:p,divider:P??Number.MAX_SAFE_INTEGER,before:I==null?void 0:I.createdAt,onSettled:de=>L(Te=>Te.map(Re=>Re.id===de.id?de:Re)),onPreview:E,...pe})]})}),me&&Y.length>0&&o.jsx("div",{className:"jv-to-latest",children:o.jsxs("button",{type:"button","aria-label":x("thread.toLatest"),onClick:()=>{var de;Je.release(),(de=ne.current)==null||de.scrollTo({top:ne.current.scrollHeight,behavior:"smooth"})},children:[ot>0&&o.jsx("span",{children:x("chat.unseen",{count:ot})}),o.jsx(Ue,{name:"chevron-down"})]})})]}),o.jsx(dS,{chatId:e,id:"jarvy-thread-composer",drafts:d,placeholder:x("thread.reply"),scrollRef:ne,disabled:!_,initialText:Y.length===0&&I&&I.senderId!==p&&Ke&&!Ke.deleted?`@${Ke.name} `:void 0,mention:{bots:h,inside:hi(f).filter(de=>de.id!==p&&!!(c!=null&&c.memberIds.includes(de.id))),outside:hi(f).filter(de=>!(c!=null&&c.memberIds.includes(de.id))),onInvite:N,participants:At},onSend:Ce,onError:M,onNotice:C}),o.jsx(F5,{container:ne,drafts:d,chatId:e,members:f,onNotice:C,source:de=>de===(I==null?void 0:I.id)?I:Y.find(Te=>Te.id===de)})]})}function uj(e,a){const i=e.lastReplyAt??e.createdAt;return a==="created"?[0,-e.createdAt,e.id]:a==="status"?[e.status==="done"?1:0,-i,e.id]:[0,-i,e.id]}function QP(e,a){return e[0]-a[0]||e[1]-a[1]||(e[2]<a[2]?-1:e[2]>a[2]?1:0)}const rf=e=>(a,i)=>QP(uj(a,e),uj(i,e)),Dp={updated:"threadSort.updated",created:"threadSort.created",status:"threadSort.status"},ZP=(e,a)=>[...e].sort(rf(a));function xS(e){const a=`jarvy-thread-sort-${e}`,[i,r]=w.useState(()=>{const s=localStorage.getItem(a);return s==="created"||s==="status"?s:"updated"});return[i,s=>{r(s),localStorage.setItem(a,s)}]}function bS({value:e,onChange:a}){return o.jsxs(pr,{value:e,onValueChange:i=>a(i),children:[o.jsxs(vr,{className:"jv-thread-sort","aria-label":x("threadSort.current",{order:x(Dp[e])}),title:x("threadSort.title"),children:[o.jsx(s7,{}),o.jsx(gr,{})]}),o.jsx(yr,{className:"jv-select-menu",position:"popper",sideOffset:4,align:"end",children:Object.keys(Dp).map(i=>o.jsx(fa,{value:i,children:x(Dp[i])},i))})]})}const dj={epoch:0,unlisted:0,counts:{}},JP=(e,a,i)=>({epoch:e.epoch,unlisted:e.unlisted+(i?1:0),counts:{...e.counts,[a]:(e.counts[a]??0)+1}}),WP=e=>({...e,epoch:e.epoch+1}),eH=(e,a)=>`${e.epoch}:${a?e.counts[a]??0:0}`,tH=e=>`${e.epoch}:${e.unlisted}`,nH=e=>na(e,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"});function aH({channel:e,members:a,bots:i,changes:r,onOpen:s,onClose:c,onError:d}){const[f,h]=w.useState(null),[p,y]=w.useState("open"),[g,b]=xS("channel");w.useEffect(()=>{let S=!0;return he.channelThreads(e.id).then(N=>{S&&h(N.threads)}).catch(N=>{S&&d(N)}),()=>{S=!1}},[e.id,eH(r,e.id)]);const j=ZP((f??[]).filter(S=>p==="all"||S.status===p),g),k=S=>(f??[]).filter(N=>N.status===S).length;return o.jsxs("aside",{className:"ui-pane jv-pane","aria-label":x("threads.list"),children:[o.jsxs("header",{className:"ui-pane-header jv-pane-header",children:[o.jsx("strong",{children:x("channel.threads")}),o.jsxs("span",{className:"jv-muted jv-pane-sub",children:["#",e.title]}),o.jsx("span",{className:"jv-spacer"}),o.jsx(bS,{value:g,onChange:b}),o.jsx(gt,{icon:"close",label:x("threads.closeList"),onClick:c})]}),o.jsx("div",{className:"jv-tabs",role:"tablist","aria-label":x("threads.byStatus"),children:[["open",x("threads.openCount",{count:k("open")})],["done",x("threads.doneCount",{count:k("done")})],["all",x("threads.all")]].map(([S,N])=>o.jsx("button",{type:"button",role:"tab","aria-selected":p===S,onClick:()=>y(S),children:N},S))}),o.jsx("div",{className:"ui-pane-body jv-pane-body",children:f===null?o.jsx("p",{className:"jv-picker-empty",children:x("threads.loading")}):j.length===0?o.jsx("p",{className:"jv-picker-empty",children:x("threads.none")}):j.map(S=>{const N=a.find(E=>{var M;return E.id===((M=S.root)==null?void 0:M.senderId)});return o.jsxs("button",{type:"button",className:"jv-thread-item","data-unread":S.unread>0||void 0,onClick:()=>s(S.id),children:[o.jsxs("span",{className:"jv-thread-item-head",children:[o.jsx("strong",{children:S.title}),S.alerts>0?o.jsx("span",{className:"jv-badge",children:S.alerts}):S.unread>0&&o.jsx("span",{className:"jv-count",children:S.unread}),o.jsx("span",{className:"jv-thread-status","data-done":S.status==="done"||void 0,children:x(S.status==="done"?"channel.threadDone":"threads.open")})]}),S.root&&o.jsxs("span",{className:"jv-thread-item-root",children:[o.jsx(Sr,{member:N,bots:i,size:16}),o.jsx("span",{children:go(S.root)})]}),o.jsxs("span",{className:"jv-muted jv-thread-item-meta",children:[x("channel.replies",{count:S.replies}),S.lastReplyAt?` · ${nH(S.lastReplyAt)}`:"",S.following?` · ${x("threads.following")}`:""]})]},S.id)})})]})}class iH{constructor(){Wt(this,"listeners",new Set)}emit(a){for(const i of this.listeners)i(a)}on(a){return this.listeners.add(a),()=>{this.listeners.delete(a)}}}const zp=(e,a)=>a==="all"||(a==="unread"?e.unread>0:e.status===a),Rd=(e,a)=>[...new Map(e.map(i=>[i.id,i])).values()].sort(rf(a));function rH(e,a,i){const[r,s]=w.useState({items:[],next:null,ready:!1}),[c,d]=w.useState(!1),[f,h]=w.useState(!1),p=w.useRef({filter:a,sort:i,generation:0}),y=w.useRef(r),g=w.useRef(new Map);y.current=r;const b=C=>{y.current=C,s(C)};async function j(C){const A=p.current.generation;d(!0),h(!1);try{const _=await he.followedThreads({filter:a,sort:i,cursor:C});if(A!==p.current.generation)return;const R=y.current,I=_.next?_.threads.at(-1):void 0,G=[...g.current.values()].filter(Y=>zp(Y,a)&&(!I||rf(i)(Y,I)<=0));b({items:Rd([...C?R.items:[],..._.threads,...G],i),next:_.next,ready:!0})}catch{A===p.current.generation&&h(!0)}finally{A===p.current.generation&&d(!1)}}w.useEffect(()=>{p.current={filter:a,sort:i,generation:p.current.generation+1},b({items:[],next:null,ready:!1}),j()},[a,i]);const k=w.useRef(new Map);function S(C){if(k.current.has(C)){k.current.set(C,!0);return}k.current.set(C,!1);const A=p.current.generation;he.followedThread(C).then(_=>N(_,A),_=>{_ instanceof qi&&_.status===404&&A===p.current.generation&&b({...y.current,items:y.current.items.filter(R=>R.id!==C)})}).finally(()=>{const _=k.current.get(C);k.current.delete(C),_&&S(C)})}function N(C,A){if(A!==p.current.generation)return;E(C);const _=y.current,R=_.items.some(Y=>Y.id===C.id),I=_.items.at(-1),G=C.following&&zp(C,p.current.filter)&&(_.next===null||!I||rf(p.current.sort)(C,I)<0);(R||_.ready&&G)&&b({..._,items:Rd([..._.items,C],p.current.sort)})}w.useEffect(()=>e.on(C=>{if(C.kind==="changed")S(C.id);else if(C.kind==="reconnected")M();else{const A=C.chat,_=y.current,R=_.items.find(G=>G.id===A.id);if(!R){A.following&&S(A.id);return}const I={...R,title:A.title,status:A.status??R.status,unread:A.unread,mentions:A.mentions,alerts:A.alerts,following:A.following};E(I),b({..._,items:Rd([..._.items,I],p.current.sort)})}}),[e]);function E(C){C.following?g.current.delete(C.id):y.current.items.some(A=>A.id===C.id)&&g.current.set(C.id,C)}async function M(){const C=p.current.generation,A=await he.followedThreads({filter:p.current.filter,sort:p.current.sort}).catch(()=>null);if(!A||C!==p.current.generation)return;const _=y.current,R=_.items.length>A.threads.length;b({items:Rd([..._.items,...A.threads],p.current.sort),next:R?_.next:A.next,ready:!0})}return{items:r.items.filter(C=>zp(C,a)),find:C=>r.items.find(A=>A.id===C),ready:r.ready,more:r.next!==null,loading:c,failed:f,loadMore:()=>{r.next&&!c&&j(r.next)},retry:()=>void j(r.next??void 0)}}const lH=e=>na(e,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}),oH={all:"threads.none",unread:"threads.noneUnread",open:"threads.noneOpen",done:"threads.noneDone"};function sH({events:e,summary:a,chats:i,members:r,bots:s,onNav:c,renderThread:d}){const[f,h]=w.useState(null),[p,y]=w.useState("all"),[g,b]=xS("followed"),j=rH(e,p,g),k=f?j.find(f.id)??f:void 0,S=w.useRef(null),N=w.useRef(null);w.useEffect(()=>{if(!S.current||!N.current||!j.more||j.loading||j.failed)return;const M=new IntersectionObserver(C=>{var A;(A=C[0])!=null&&A.isIntersecting&&j.loadMore()},{root:S.current,rootMargin:"0px 0px 400px 0px"});return M.observe(N.current),()=>M.disconnect()},[j.more,j.loading,j.failed,j.items]);const E=[["all",x("threads.all")],["unread",a!=null&&a.unreadThreads?x("threads.unreadCount",{count:a.unreadThreads}):x("threads.unread")],["open",x("threads.openCount",{count:(a==null?void 0:a.open)??0})],["done",x("threads.doneCount",{count:(a==null?void 0:a.done)??0})]];return o.jsxs("main",{className:"ui-chat jv-followed-page","aria-label":x("sidebar.followed"),"data-open":k?"":void 0,children:[o.jsxs("section",{className:"jv-followed-list","aria-label":x("threads.list"),children:[o.jsxs("header",{className:"ui-chat-header jv-channel-header",children:[o.jsxs("div",{className:"ui-header-left",children:[o.jsx(gt,{icon:"layout-sidebar-left",className:"ui-mobile-only",label:x("common.openNav"),onClick:c}),o.jsx("strong",{className:"jv-channel-title",children:x("sidebar.followed")})]}),o.jsx(bS,{value:g,onChange:b})]}),o.jsx("div",{className:"jv-tabs",role:"tablist","aria-label":x("threads.filter"),children:E.map(([M,C])=>o.jsx("button",{type:"button",role:"tab","aria-selected":p===M,onClick:()=>y(M),children:C},M))}),o.jsxs("div",{className:"jv-followed-items",ref:S,children:[j.ready&&j.items.length===0&&!j.more?o.jsx("p",{className:"jv-picker-empty",children:x(oH[p])}):j.items.map(M=>{const C=r.find(_=>{var R;return _.id===((R=M.root)==null?void 0:R.senderId)}),A=i.find(_=>_.id===M.parentId);return o.jsxs("button",{type:"button",className:"jv-thread-item","data-unread":M.unread>0||void 0,"aria-current":M.id===(f==null?void 0:f.id)||void 0,onClick:()=>h(M),children:[o.jsxs("span",{className:"jv-thread-item-head",children:[o.jsx("strong",{children:M.title}),M.alerts>0?o.jsx("span",{className:"jv-badge",children:M.alerts}):M.unread>0&&o.jsx("span",{className:"jv-count",children:M.unread}),o.jsx("span",{className:"jv-thread-status","data-done":M.status==="done"||void 0,children:x(M.status==="done"?"channel.threadDone":"threads.open")})]}),M.root&&o.jsxs("span",{className:"jv-thread-item-root",children:[o.jsx(Sr,{member:C,bots:s,size:16}),o.jsx("span",{children:go(M.root)})]}),o.jsxs("span",{className:"jv-muted jv-thread-item-meta",children:["#",(A==null?void 0:A.title)??""," · ",x("channel.replies",{count:M.replies}),M.lastReplyAt?` · ${lH(M.lastReplyAt)}`:"",M.following?"":` · ${x("threads.notFollowing")}`]})]},M.id)}),o.jsx("div",{ref:N,className:"jv-followed-end",children:j.failed?o.jsxs(o.Fragment,{children:[o.jsx("p",{role:"alert",children:x("threads.loadFailed")}),o.jsx(Ne,{variant:"outline",size:"sm",onClick:j.retry,children:x("common.retry")})]}):(j.loading||!j.ready)&&o.jsx("p",{role:"status",children:x("threads.loading")})})]})]}),k?d(k,()=>h(null)):o.jsx("div",{className:"jv-followed-empty",children:o.jsx("p",{children:x("threads.pick")})})]})}function cH({pane:e,followedView:a,threadEvents:i,followed:r,chats:s,sections:c,members:d,bots:f,statuses:h,meId:p,drafts:y,changes:g,live:b,memory:j,paneChannel:k,activeBot:S,botDirects:N,find:E,onPane:M,onNav:C,onBackToChannel:A,onAddMembers:_,onOpenBot:R,onPin:I,onMute:G,onDeleteChannel:Y,onChannelSaved:L,onThreadChanged:P,onInvite:q,onPreview:Z,onNotice:U,onError:F,paneWidth:X,onResize:$}){var ne,D;const H=(e==null?void 0:e.kind)==="thread"?e:null,ie=(H==null?void 0:H.mode)==="full",O=()=>M(null),le=(B,W,ue)=>void he.chat(B).then(me=>E.openMessage(me,W,ue),F);return o.jsxs(o.Fragment,{children:[a&&!ie&&o.jsx(sH,{events:i,summary:r,chats:s,members:d,bots:f,onNav:C,renderThread:(B,W)=>o.jsx(cj,{threadId:B.id,mode:"embed",channel:s.find(ue=>ue.id===B.parentId),drafts:y,members:d,bots:f,me:p,live:b,memory:j,onNav:C,onChanged:P,onClose:W,onToggleMode:()=>A({id:B.id,parentId:B.parentId},!0),onInvite:ue=>q(B.parentId,ue),onPreview:Z,onError:F,onNotice:U,onOpenMessage:le},B.id)}),H&&o.jsx(cj,{threadId:H.id,mode:H.mode,showSummary:H.summary,focus:H.focus,onSearch:E.search,channel:s.find(B=>B.id===H.parentId),drafts:y,members:d,bots:f,me:p,live:b,memory:j,onNav:C,onChanged:P,onClose:()=>ie?A(H,!1):O(),onToggleMode:()=>ie?A(H,!0):M({...H,mode:"full"}),onInvite:B=>q(H.parentId,B),onPreview:Z,onError:F,onNotice:U,onOpenMessage:le},`${H.id}:${((ne=H.focus)==null?void 0:ne.id)??""}:${((D=H.focus)==null?void 0:D.passage)??""}`),(e==null?void 0:e.kind)==="search"&&o.jsx($P,{chat:e.chat,chats:s,members:d,focusKey:E.focusKey,onOpenMessage:E.openMessage,onClose:O,onError:F}),(e==null?void 0:e.kind)==="threads"&&k&&o.jsx(aH,{channel:k,members:d,bots:f,changes:g,onOpen:B=>M({kind:"thread",id:B,parentId:k.id,mode:"pane"}),onClose:O,onError:F}),(e==null?void 0:e.kind)==="info"&&k&&o.jsx(VP,{channel:k,page:e.page,sections:c,members:hi(d),bots:f,statuses:h,me:p,onPage:B=>M({kind:"info",page:B}),onPin:()=>I(k),onMute:()=>G(k),onAdd:()=>_(k),onBot:R,onDelete:()=>Y(k),onChanged:L,onClose:O,onError:F}),(e==null?void 0:e.kind)==="botdms"&&S&&!k&&o.jsx(qP,{bot:S,chats:N,members:d,bots:f,me:p,live:b,onClose:O,onPreview:Z,onError:F}),e&&!ie&&o.jsx("div",{className:"jv-resize",style:{right:X-4},onPointerDown:$,role:"separator","aria-orientation":"vertical","aria-label":x("app.resizePane")})]})}const fj="@goodfish/jarvy",jS="0.13.0",uH={url:"git+https://github.com/AzzzGoodFish/Jarvy.git"},dH="Apache-2.0",E0=uH.url.replace(/^git\+/,"").replace(/\.git$/,""),hj=`${E0}/blob/v${jS}`,fH=[{label:"about.source",detail:E0.replace(/^https:\/\//,""),href:E0},{label:"about.package",detail:fj,href:`https://www.npmjs.com/package/${fj}`},{label:"about.license",detail:dH,href:`${hj}/LICENSE`},{label:"about.notices",detail:"THIRD_PARTY_NOTICE.md",href:`${hj}/THIRD_PARTY_NOTICE.md`}];function hH(){return o.jsxs("div",{className:"jv-page",children:[o.jsx("header",{className:"jv-page-header",children:o.jsx("h2",{children:x("settings.about")})}),o.jsxs("div",{className:"jv-list",children:[o.jsxs("div",{className:"jv-list-row jv-static-row jv-about-intro",children:[o.jsxs("div",{className:"jv-row-text",children:[o.jsx("strong",{children:"Jarvy"}),o.jsx("span",{children:x("about.tagline")})]}),o.jsx("span",{className:"jv-row-meta",children:x("about.version",{version:jS})})]}),fH.map(e=>o.jsxs("a",{className:"jv-list-row jv-link-row",href:e.href,target:"_blank",rel:"noreferrer",children:[o.jsxs("div",{className:"jv-row-text",children:[o.jsx("strong",{children:x(e.label)}),o.jsx("span",{children:e.detail})]}),o.jsx(Up,{"aria-hidden":"true"})]},e.label))]})]})}function mH(){const[e,a]=w.useState(document.documentElement.classList.contains("dark")),i=s=>{ef(s?"dark":"light"),a(s)},r=(s,c,d,f,h)=>o.jsxs("button",{type:"button",role:"radio","aria-checked":d,lang:h,className:"jv-list-row jv-choice-row",onClick:f,children:[o.jsx("span",{className:"jv-row-text",children:o.jsx("strong",{children:c})}),d&&o.jsx(ma,{"aria-hidden":"true"})]},s);return o.jsxs("div",{className:"jv-page",children:[o.jsx("header",{className:"jv-page-header",children:o.jsx("h2",{children:x("settings.general")})}),o.jsxs("section",{className:"jv-section","aria-labelledby":"general-language",children:[o.jsx("h3",{id:"general-language",className:"jv-section-title",children:x("general.language")}),o.jsx("div",{className:"jv-list",role:"radiogroup","aria-labelledby":"general-language",children:Cj.map(s=>r(s,Pp(s,"name"),ol()===s,()=>Tj(s),s))})]}),o.jsxs("section",{className:"jv-section","aria-labelledby":"general-theme",children:[o.jsx("h3",{id:"general-theme",className:"jv-section-title",children:x("general.theme")}),o.jsxs("div",{className:"jv-list",role:"radiogroup","aria-labelledby":"general-theme",children:[r("light",x("general.light"),!e,()=>i(!1)),r("dark",x("general.dark"),e,()=>i(!0))]})]})]})}const pH=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9.797 6.282a.451.451 0 01-.336-.315 1.019 1.019 0 010-.505c.156-.86.3-1.725.501-2.577.14-.7.42-1.367.823-1.96.305-.431.75-.746 1.262-.89.877-.217 1.24.629.937 1.348-.259.593-.877.914-1.334 1.348-.835.795-1.096 2.14-1.336 3.212a.427.427 0 01-.186.277.437.437 0 01-.331.062z" fill="url(#lobe-icons-ant-group-0-_R_0_)" transform="translate(3)"></path><path d="M6.334 4.672c.33-.121.682.146.946.297.278.145.587.219.901.214.231.01.466 0 .688.018 4.098.176 7.484 3.22 8.05 7.237.565 4.016-1.852 7.859-5.745 9.134-3.894 1.276-8.153-.38-10.126-3.935A8.339 8.339 0 013.133 7.081c.348-.278.716-.53 1.102-.755a8.404 8.404 0 001.318-.79c.28-.243.45-.742.781-.864zm4.406 2.15c-2.841.003-4.898 2.533-4.628 5.642.27 3.109 2.781 5.641 5.613 5.665 2.832.024 4.932-2.512 4.658-5.644-.273-3.133-2.802-5.666-5.643-5.663zm.357.57a4.707 4.707 0 013.304 1.446 5.703 5.703 0 011.643 3.49 4.841 4.841 0 01-1.141 3.705v.015a3.923 3.923 0 01-2.808 1.303 4.664 4.664 0 01-3.367-1.387 5.678 5.678 0 01-1.71-3.518 4.832 4.832 0 011.14-3.753 3.923 3.923 0 012.813-1.3h.126z" fill="url(#lobe-icons-ant-group-1-_R_0_)" transform="translate(3)"></path><path d="M2.346 2.054a1.26 1.26 0 01.384-.594.842.842 0 011.165.11c.694.82.169 2.078.142 3.02.013.805.208 1.597.57 2.318.084.134.147.279.186.43a.539.539 0 01-.3.577c-.345.17-.568-.19-.709-.446-.324-.6-.617-1.216-.877-1.846a8.698 8.698 0 01-.618-1.987 7.523 7.523 0 01-.051-.37 3.717 3.717 0 01-.024-.34 2.506 2.506 0 01.132-.872z" fill="url(#lobe-icons-ant-group-2-_R_0_)" transform="translate(3)"></path><defs><linearGradient id="lobe-icons-ant-group-0-_R_0_" x1="31.373%" x2="61.365%" y1="95.551%" y2="-.348%"><stop offset="0%" stop-color="#06F"></stop><stop offset="20%" stop-color="#1677FF"></stop><stop offset="100%" stop-color="#04A6FF"></stop></linearGradient><linearGradient id="lobe-icons-ant-group-1-_R_0_" x1="4.366%" x2="94.359%" y1="65.982%" y2="32.918%"><stop offset="0%" stop-color="#06F"></stop><stop offset="20%" stop-color="#1677FF"></stop><stop offset="100%" stop-color="#04A6FF"></stop></linearGradient><linearGradient id="lobe-icons-ant-group-2-_R_0_" x1="56.255%" x2="45.986%" y1="99.257%" y2="1.384%"><stop offset="0%" stop-color="#06F"></stop><stop offset="20%" stop-color="#1677FF"></stop><stop offset="100%" stop-color="#04A6FF"></stop></linearGradient></defs></svg>
803
+ `,gH=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M13.827 3.52h3.603L24 20h-3.603l-6.57-16.48zm-7.258 0h3.767L16.906 20h-3.674l-1.343-3.461H5.017l-1.344 3.46H0L6.57 3.522zm4.132 9.959L8.453 7.687 6.205 13.48H10.7z"></path></svg>
804
+ `,vH=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7.242 1.613A1.11 1.11 0 018.295.857h6.977L8.03 22.316a1.11 1.11 0 01-1.052.755h-5.43a1.11 1.11 0 01-1.053-1.466L7.242 1.613z" fill="url(#lobe-icons-azure-0-_R_0_)"></path><path d="M18.397 15.296H7.4a.51.51 0 00-.347.882l7.066 6.595c.206.192.477.298.758.298h6.226l-2.706-7.775z" fill="#0078D4"></path><path d="M15.272.857H7.497L0 23.071h7.775l1.596-4.73 5.068 4.73h6.665l-2.707-7.775h-7.998L15.272.857z" fill="url(#lobe-icons-azure-1-_R_0_)"></path><path d="M17.193 1.613a1.11 1.11 0 00-1.052-.756h-7.81.035c.477 0 .9.304 1.052.756l6.748 19.992a1.11 1.11 0 01-1.052 1.466h-.12 7.895a1.11 1.11 0 001.052-1.466L17.193 1.613z" fill="url(#lobe-icons-azure-2-_R_0_)"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-azure-0-_R_0_" x1="8.247" x2="1.002" y1="1.626" y2="23.03"><stop stop-color="#114A8B"></stop><stop offset="1" stop-color="#0669BC"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-azure-1-_R_0_" x1="14.042" x2="12.324" y1="15.302" y2="15.888"><stop stop-opacity=".3"></stop><stop offset=".071" stop-opacity=".2"></stop><stop offset=".321" stop-opacity=".1"></stop><stop offset=".623" stop-opacity=".05"></stop><stop offset="1" stop-opacity="0"></stop></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="lobe-icons-azure-2-_R_0_" x1="12.841" x2="20.793" y1="1.626" y2="22.814"><stop stop-color="#3CCBF4"></stop><stop offset="1" stop-color="#2892DF"></stop></linearGradient></defs></svg>
805
+ `,yH=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2.316 4.8h14.682v4.8H7.31a.302.302 0 00-.308.3v4.2c0 .171.14.3.308.3h9.688v4.8h-4.686a.302.302 0 00-.308.3v4.2c0 .171.141.3.308.3h4.378a.297.297 0 00.308-.3v-4.5h4.694a.302.302 0 00.308-.3v-4.2c0-.171-.14-.3-.308-.3h-4.694V9.6h4.694A.302.302 0 0022 9.3V5.1c0-.171-.14-.3-.308-.3h-4.694V.3c0-.171-.14-.3-.308-.3H2.316A.31.31 0 002 .3v4.2c0 .171.14.3.316.3z"></path></svg>
806
+ `,xH=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="lobe-icons-bedrock-_R_0_" x1="80%" x2="20%" y1="20%" y2="80%"><stop offset="0%" stop-color="#6350FB"></stop><stop offset="50%" stop-color="#3D8FFF"></stop><stop offset="100%" stop-color="#9AD8F8"></stop></linearGradient></defs><path d="M13.05 15.513h3.08c.214 0 .389.177.389.394v1.82a1.704 1.704 0 011.296 1.661c0 .943-.755 1.708-1.685 1.708-.931 0-1.686-.765-1.686-1.708 0-.807.554-1.484 1.297-1.662v-1.425h-2.69v4.663a.395.395 0 01-.188.338l-2.69 1.641a.385.385 0 01-.405-.002l-4.926-3.086a.395.395 0 01-.185-.336V16.3L2.196 14.87A.395.395 0 012 14.555L2 14.528V9.406c0-.14.073-.27.192-.34l2.465-1.462V4.448c0-.129.062-.249.165-.322l.021-.014L9.77 1.058a.385.385 0 01.407 0l2.69 1.675a.395.395 0 01.185.336V7.6h3.856V5.683a1.704 1.704 0 01-1.296-1.662c0-.943.755-1.708 1.685-1.708.931 0 1.685.765 1.685 1.708 0 .807-.553 1.484-1.296 1.662v2.311a.391.391 0 01-.389.394h-4.245v1.806h6.624a1.69 1.69 0 011.64-1.313c.93 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708a1.69 1.69 0 01-1.64-1.314H13.05v1.937h4.953l.915 1.18a1.66 1.66 0 01.84-.227c.931 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708-.93 0-1.685-.765-1.685-1.708 0-.346.102-.668.276-.937l-.724-.935H13.05v1.806zM9.973 1.856L7.93 3.122V6.09h-.778V3.604L5.435 4.669v2.945l2.11 1.36L9.712 7.61V5.334h.778V7.83c0 .136-.07.263-.184.335L7.963 9.638v2.081l1.422 1.009-.446.646-1.406-.998-1.53 1.005-.423-.66 1.605-1.055v-1.99L5.038 8.29l-2.26 1.34v1.676l1.972-1.189.398.677-2.37 1.429V14.3l2.166 1.258 2.27-1.368.397.677-2.176 1.311V19.3l1.876 1.175 2.365-1.426.398.678-2.017 1.216 1.918 1.201 2.298-1.403v-5.78l-4.758 2.893-.4-.675 5.158-3.136V3.289L9.972 1.856zM16.13 18.47a.913.913 0 00-.908.92c0 .507.406.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zm3.63-3.81a.913.913 0 00-.908.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92zm1.555-4.99a.913.913 0 00-.908.92c0 .507.407.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zM17.296 3.1a.913.913 0 00-.907.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92z" fill="url(#lobe-icons-bedrock-_R_0_)" fill-rule="nonzero"></path></svg>
807
+ `,bH=`<svg fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M14.121 2.701a9.299 9.299 0 000 18.598V22.7c-5.91 0-10.7-4.791-10.7-10.701S8.21 1.299 14.12 1.299V2.7zm4.752 3.677A7.353 7.353 0 109.42 17.643l-.901 1.074a8.754 8.754 0 01-1.08-12.334 8.755 8.755 0 0112.335-1.08l-.901 1.075zm-2.255.844a5.407 5.407 0 00-5.048 9.563l-.656 1.24a6.81 6.81 0 016.358-12.043l-.654 1.24zM14.12 8.539a3.46 3.46 0 100 6.922v1.402a4.863 4.863 0 010-9.726v1.402z" fill="#F15A29" fill-rule="evenodd"></path><path d="M15.407 10.836a2.24 2.24 0 00-.51-.409 1.084 1.084 0 00-.544-.152c-.255 0-.483.047-.684.14a1.58 1.58 0 00-.84.912c-.074.203-.11.416-.11.631 0 .218.036.43.11.631a1.594 1.594 0 00.84.913c.2.093.43.14.684.14.216 0 .417-.046.602-.135.188-.09.35-.225.475-.392l.928 1.006c-.14.14-.3.261-.482.363a3.367 3.367 0 01-1.083.38c-.17.026-.317.04-.44.04a3.315 3.315 0 01-1.182-.21 2.825 2.825 0 01-.961-.597 2.816 2.816 0 01-.644-.929 2.987 2.987 0 01-.238-1.21c0-.444.08-.847.238-1.21.15-.35.368-.666.643-.929.278-.261.605-.464.962-.596a3.315 3.315 0 011.182-.21c.355 0 .712.068 1.072.204.361.138.685.36.944.649l-.962.97z"></path></svg>
808
+ `,jH=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M16.493 17.4c.135-.52.08-.983-.161-1.338-.215-.328-.592-.519-1.05-.519l-8.663-.109a.148.148 0 01-.135-.082c-.027-.054-.027-.109-.027-.163.027-.082.108-.164.189-.164l8.744-.11c1.05-.054 2.153-.9 2.556-1.937l.511-1.31c.027-.055.027-.11.027-.164C17.92 8.91 15.66 7 12.942 7c-2.503 0-4.628 1.638-5.381 3.903a2.432 2.432 0 00-1.803-.491c-1.21.109-2.153 1.092-2.287 2.32-.027.328 0 .628.054.9C1.56 13.688 0 15.326 0 17.319c0 .19.027.355.027.545 0 .082.08.137.161.137h15.983c.08 0 .188-.055.215-.164l.107-.437" fill="#F38020"></path><path d="M19.238 11.75h-.242c-.054 0-.108.054-.135.109l-.35 1.2c-.134.52-.08.983.162 1.338.215.328.592.518 1.05.518l1.855.11c.054 0 .108.027.135.082.027.054.027.109.027.163-.027.082-.108.164-.188.164l-1.91.11c-1.05.054-2.153.9-2.557 1.937l-.134.355c-.027.055.026.137.107.137h6.592c.081 0 .162-.055.162-.137.107-.41.188-.846.188-1.31-.027-2.62-2.153-4.777-4.762-4.777" fill="#FCAD32"></path></svg>
809
+ `,wH=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z" fill="#4D6BFE"></path></svg>
810
+ `,kH=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M14.8 5l-2.801 6.795L9.195 5H7.397l3.072 7.428a1.64 1.64 0 003.038.002L16.598 5H14.8zm1.196 10.352l5.124-5.244-.699-1.669-5.596 5.739a1.664 1.664 0 00-.343 1.807 1.642 1.642 0 001.516 1.012L16 17l8-.02-.699-1.669-7.303.041h-.002zM2.88 10.104l.699-1.669 5.596 5.739c.468.479.603 1.189.343 1.807a1.643 1.643 0 01-1.516 1.012l-8-.018-.002.002.699-1.669 7.303.042-5.122-5.246z"></path></svg>
811
+ `,SH=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z"></path></svg>
812
+ `,CH=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M23 12.245c0-.905-.075-1.565-.236-2.25h-10.54v4.083h6.186c-.124 1.014-.797 2.542-2.294 3.569l-.021.136 3.332 2.53.23.022C21.779 18.417 23 15.593 23 12.245z" fill="#4285F4"></path><path d="M12.225 23c3.03 0 5.574-.978 7.433-2.665l-3.542-2.688c-.948.648-2.22 1.1-3.891 1.1a6.745 6.745 0 01-6.386-4.572l-.132.011-3.465 2.628-.045.124C4.043 20.531 7.835 23 12.225 23z" fill="#34A853"></path><path d="M5.84 14.175A6.65 6.65 0 015.463 12c0-.758.138-1.491.361-2.175l-.006-.147-3.508-2.67-.115.054A10.831 10.831 0 001 12c0 1.772.436 3.447 1.197 4.938l3.642-2.763z" fill="#FBBC05"></path><path d="M12.225 5.253c2.108 0 3.529.892 4.34 1.638l3.167-3.031C17.787 2.088 15.255 1 12.225 1 7.834 1 4.043 3.469 2.197 7.062l3.63 2.763a6.77 6.77 0 016.398-4.572z" fill="#EB4335"></path></svg>
813
+ `,NH=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.036 2c-3.853-.035-7 3-7.036 6.781-.035 3.782 3.055 6.872 6.908 6.907h2.42v-2.566h-2.292c-2.407.028-4.38-1.866-4.408-4.23-.029-2.362 1.901-4.298 4.308-4.326h.1c2.407 0 4.358 1.915 4.365 4.278v6.305c0 2.342-1.944 4.25-4.323 4.279a4.375 4.375 0 01-3.033-1.252l-1.851 1.818A7 7 0 0012.029 22h.092c3.803-.056 6.858-3.083 6.879-6.816v-6.5C18.907 4.963 15.817 2 12.036 2z"></path></svg>
814
+ `,EH=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z" fill="#FF9D0B"></path><path d="M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z" fill="#FFD21E"></path><path d="M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-.576-.393-.394-1.023-.089-.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-.586 0 1.107.79 3.263 3.25 3.263h-.003z" fill="#FF323D"></path><path d="M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003zm1.12 5.34a2.166 2.166 0 011.325-1.106c.07-.02.144.06.219.171l.192.306c.069.1.139.175.209.175.074 0 .15-.074.223-.172l.205-.302c.08-.11.157-.188.234-.165.537.168.986.536 1.25 1.026.932-.724 1.275-1.905 1.275-2.633 0-.508-.306-.426-.81-.19l-.616.296c-.52.24-1.148.48-1.824.48-.676 0-1.302-.24-1.823-.48l-.589-.283c-.52-.248-.838-.342-.838.177 0 .703.32 1.831 1.187 2.56l.18.14z" fill="#3A3B45"></path><path d="M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8zM4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-.553.718-.694.244-.162.523-.265.814-.3l.176-.012z" fill="#FF9D0B"></path><path d="M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-.573.534-.375-.677-1.405-2.416-1.94-2.751-.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-.522z" fill="#FFD21E"></path></svg>
815
+ `,TH=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z"></path><path d="M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z"></path></svg>
816
+ `,AH=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6.897 4h-.024l-.031 2.615h.022c1.715 0 3.046 1.357 5.94 6.246l.175.297.012.02 1.62-2.438-.012-.019a48.763 48.763 0 00-1.098-1.716 28.01 28.01 0 00-1.175-1.629C10.413 4.932 8.812 4 6.896 4z" fill="url(#lobe-icons-meta-0-_R_0_)"></path><path d="M6.873 4C4.95 4.01 3.247 5.258 2.02 7.17a4.352 4.352 0 00-.01.017l2.254 1.231.011-.017c.718-1.083 1.61-1.774 2.568-1.785h.021L6.896 4h-.023z" fill="url(#lobe-icons-meta-1-_R_0_)"></path><path d="M2.019 7.17l-.011.017C1.2 8.447.598 9.995.274 11.664l-.005.022 2.534.6.004-.022c.27-1.467.786-2.828 1.456-3.845l.011-.017L2.02 7.17z" fill="url(#lobe-icons-meta-2-_R_0_)"></path><path d="M2.807 12.264l-2.533-.6-.005.022c-.177.918-.267 1.851-.269 2.786v.023l2.598.233v-.023a12.591 12.591 0 01.21-2.44z" fill="url(#lobe-icons-meta-3-_R_0_)"></path><path d="M2.677 15.537a5.462 5.462 0 01-.079-.813v-.022L0 14.468v.024a8.89 8.89 0 00.146 1.652l2.535-.585a4.106 4.106 0 01-.004-.022z" fill="url(#lobe-icons-meta-4-_R_0_)"></path><path d="M3.27 16.89c-.284-.31-.484-.756-.589-1.328l-.004-.021-2.535.585.004.021c.192 1.01.568 1.85 1.106 2.487l.014.017 2.018-1.745a2.106 2.106 0 01-.015-.016z" fill="url(#lobe-icons-meta-5-_R_0_)"></path><path d="M10.78 9.654c-1.528 2.35-2.454 3.825-2.454 3.825-2.035 3.2-2.739 3.917-3.871 3.917a1.545 1.545 0 01-1.186-.508l-2.017 1.744.014.017C2.01 19.518 3.058 20 4.356 20c1.963 0 3.374-.928 5.884-5.33l1.766-3.13a41.283 41.283 0 00-1.227-1.886z" fill="#0082FB"></path><path d="M13.502 5.946l-.016.016c-.4.43-.786.908-1.16 1.416.378.483.768 1.024 1.175 1.63.48-.743.928-1.345 1.367-1.807l.016-.016-1.382-1.24z" fill="url(#lobe-icons-meta-6-_R_0_)"></path><path d="M20.918 5.713C19.853 4.633 18.583 4 17.225 4c-1.432 0-2.637.787-3.723 1.944l-.016.016 1.382 1.24.016-.017c.715-.747 1.408-1.12 2.176-1.12.826 0 1.6.39 2.27 1.075l.015.016 1.589-1.425-.016-.016z" fill="#0082FB"></path><path d="M23.998 14.125c-.06-3.467-1.27-6.566-3.064-8.396l-.016-.016-1.588 1.424.015.016c1.35 1.392 2.277 3.98 2.361 6.971v.023h2.292v-.022z" fill="url(#lobe-icons-meta-7-_R_0_)"></path><path d="M23.998 14.15v-.023h-2.292v.022c.004.14.006.282.006.424 0 .815-.121 1.474-.368 1.95l-.011.022 1.708 1.782.013-.02c.62-.96.946-2.293.946-3.91 0-.083 0-.165-.002-.247z" fill="url(#lobe-icons-meta-8-_R_0_)"></path><path d="M21.344 16.52l-.011.02c-.214.402-.519.67-.917.787l.778 2.462a3.493 3.493 0 00.438-.182 3.558 3.558 0 001.366-1.218l.044-.065.012-.02-1.71-1.784z" fill="url(#lobe-icons-meta-9-_R_0_)"></path><path d="M19.92 17.393c-.262 0-.492-.039-.718-.14l-.798 2.522c.449.153.927.222 1.46.222.492 0 .943-.073 1.352-.215l-.78-2.462c-.167.05-.341.075-.517.073z" fill="url(#lobe-icons-meta-10-_R_0_)"></path><path d="M18.323 16.534l-.014-.017-1.836 1.914.016.017c.637.682 1.246 1.105 1.937 1.337l.797-2.52c-.291-.125-.573-.353-.9-.731z" fill="url(#lobe-icons-meta-11-_R_0_)"></path><path d="M18.309 16.515c-.55-.642-1.232-1.712-2.303-3.44l-1.396-2.336-.011-.02-1.62 2.438.012.02.989 1.668c.959 1.61 1.74 2.774 2.493 3.585l.016.016 1.834-1.914a2.353 2.353 0 01-.014-.017z" fill="url(#lobe-icons-meta-12-_R_0_)"></path><defs><linearGradient id="lobe-icons-meta-0-_R_0_" x1="75.897%" x2="26.312%" y1="89.199%" y2="12.194%"><stop offset=".06%" stop-color="#0867DF"></stop><stop offset="45.39%" stop-color="#0668E1"></stop><stop offset="85.91%" stop-color="#0064E0"></stop></linearGradient><linearGradient id="lobe-icons-meta-1-_R_0_" x1="21.67%" x2="97.068%" y1="75.874%" y2="23.985%"><stop offset="13.23%" stop-color="#0064DF"></stop><stop offset="99.88%" stop-color="#0064E0"></stop></linearGradient><linearGradient id="lobe-icons-meta-2-_R_0_" x1="38.263%" x2="60.895%" y1="89.127%" y2="16.131%"><stop offset="1.47%" stop-color="#0072EC"></stop><stop offset="68.81%" stop-color="#0064DF"></stop></linearGradient><linearGradient id="lobe-icons-meta-3-_R_0_" x1="47.032%" x2="52.15%" y1="90.19%" y2="15.745%"><stop offset="7.31%" stop-color="#007CF6"></stop><stop offset="99.43%" stop-color="#0072EC"></stop></linearGradient><linearGradient id="lobe-icons-meta-4-_R_0_" x1="52.155%" x2="47.591%" y1="58.301%" y2="37.004%"><stop offset="7.31%" stop-color="#007FF9"></stop><stop offset="100%" stop-color="#007CF6"></stop></linearGradient><linearGradient id="lobe-icons-meta-5-_R_0_" x1="37.689%" x2="61.961%" y1="12.502%" y2="63.624%"><stop offset="7.31%" stop-color="#007FF9"></stop><stop offset="100%" stop-color="#0082FB"></stop></linearGradient><linearGradient id="lobe-icons-meta-6-_R_0_" x1="34.808%" x2="62.313%" y1="68.859%" y2="23.174%"><stop offset="27.99%" stop-color="#007FF8"></stop><stop offset="91.41%" stop-color="#0082FB"></stop></linearGradient><linearGradient id="lobe-icons-meta-7-_R_0_" x1="43.762%" x2="57.602%" y1="6.235%" y2="98.514%"><stop offset="0%" stop-color="#0082FB"></stop><stop offset="99.95%" stop-color="#0081FA"></stop></linearGradient><linearGradient id="lobe-icons-meta-8-_R_0_" x1="60.055%" x2="39.88%" y1="4.661%" y2="69.077%"><stop offset="6.19%" stop-color="#0081FA"></stop><stop offset="100%" stop-color="#0080F9"></stop></linearGradient><linearGradient id="lobe-icons-meta-9-_R_0_" x1="30.282%" x2="61.081%" y1="59.32%" y2="33.244%"><stop offset="0%" stop-color="#027AF3"></stop><stop offset="100%" stop-color="#0080F9"></stop></linearGradient><linearGradient id="lobe-icons-meta-10-_R_0_" x1="20.433%" x2="82.112%" y1="50.001%" y2="50.001%"><stop offset="0%" stop-color="#0377EF"></stop><stop offset="99.94%" stop-color="#0279F1"></stop></linearGradient><linearGradient id="lobe-icons-meta-11-_R_0_" x1="40.303%" x2="72.394%" y1="35.298%" y2="57.811%"><stop offset=".19%" stop-color="#0471E9"></stop><stop offset="100%" stop-color="#0377EF"></stop></linearGradient><linearGradient id="lobe-icons-meta-12-_R_0_" x1="32.254%" x2="68.003%" y1="19.719%" y2="84.908%"><stop offset="27.65%" stop-color="#0867DF"></stop><stop offset="100%" stop-color="#0471E9"></stop></linearGradient></defs></svg>
817
+ `,MH=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="lobe-icons-minimax-_R_0_" x1="0%" x2="100.182%" y1="50.057%" y2="50.057%"><stop offset="0%" stop-color="#E2167E"></stop><stop offset="100%" stop-color="#FE603C"></stop></linearGradient></defs><path d="M16.278 2c1.156 0 2.093.927 2.093 2.07v12.501a.74.74 0 00.744.709.74.74 0 00.743-.709V9.099a2.06 2.06 0 012.071-2.049A2.06 2.06 0 0124 9.1v6.561a.649.649 0 01-.652.645.649.649 0 01-.653-.645V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v7.472a2.037 2.037 0 01-2.048 2.026 2.037 2.037 0 01-2.048-2.026v-12.5a.785.785 0 00-.788-.753.785.785 0 00-.789.752l-.001 15.904A2.037 2.037 0 0113.441 22a2.037 2.037 0 01-2.048-2.026V18.04c0-.356.292-.645.652-.645.36 0 .652.289.652.645v1.934c0 .263.142.506.372.638.23.131.514.131.744 0a.734.734 0 00.372-.638V4.07c0-1.143.937-2.07 2.093-2.07zm-5.674 0c1.156 0 2.093.927 2.093 2.07v11.523a.648.648 0 01-.652.645.648.648 0 01-.652-.645V4.07a.785.785 0 00-.789-.78.785.785 0 00-.789.78v14.013a2.06 2.06 0 01-2.07 2.048 2.06 2.06 0 01-2.071-2.048V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v3.8a2.06 2.06 0 01-2.071 2.049A2.06 2.06 0 010 12.9v-1.378c0-.357.292-.646.652-.646.36 0 .653.29.653.646V12.9c0 .418.343.757.766.757s.766-.339.766-.757V9.099a2.06 2.06 0 012.07-2.048 2.06 2.06 0 012.071 2.048v8.984c0 .419.343.758.767.758.423 0 .766-.339.766-.758V4.07c0-1.143.937-2.07 2.093-2.07z" fill="url(#lobe-icons-minimax-_R_0_)" fill-rule="nonzero"></path></svg>
818
+ `,_H=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3.428 3.4h3.429v3.428H3.428V3.4zm13.714 0h3.43v3.428h-3.43V3.4z" fill="gold"></path><path d="M3.428 6.828h6.857v3.429H3.429V6.828zm10.286 0h6.857v3.429h-6.857V6.828z" fill="#FFAF00"></path><path d="M3.428 10.258h17.144v3.428H3.428v-3.428z" fill="#FF8205"></path><path d="M3.428 13.686h3.429v3.428H3.428v-3.428zm6.858 0h3.429v3.428h-3.429v-3.428zm6.856 0h3.43v3.428h-3.43v-3.428z" fill="#FA500F"></path><path d="M0 17.114h10.286v3.429H0v-3.429zm13.714 0H24v3.429H13.714v-3.429z" fill="#E10500"></path></svg>
819
+ `,RH=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z"></path></svg>
820
+ `,OH=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10.212 8.976V7.62c.127-.01.256-.017.388-.021 3.596-.117 5.957 3.184 5.957 3.184s-2.548 3.647-5.282 3.647a3.227 3.227 0 01-1.063-.175v-4.109c1.4.174 1.681.812 2.523 2.258l1.873-1.627a4.905 4.905 0 00-3.67-1.846 6.594 6.594 0 00-.729.044m0-4.476v2.025c.13-.01.259-.019.388-.024 5.002-.174 8.261 4.226 8.261 4.226s-3.743 4.69-7.643 4.69c-.338 0-.675-.031-1.007-.092v1.25c.278.038.558.057.838.057 3.629 0 6.253-1.91 8.794-4.169.421.347 2.146 1.193 2.501 1.564-2.416 2.083-8.048 3.763-11.24 3.763-.308 0-.603-.02-.894-.048V19.5H24v-15H10.21zm0 9.756v1.068c-3.356-.616-4.287-4.21-4.287-4.21a7.173 7.173 0 014.287-2.138v1.172h-.005a3.182 3.182 0 00-2.502 1.178s.615 2.276 2.507 2.931m-5.961-3.3c1.436-1.935 3.604-3.148 5.961-3.336V6.523C5.81 6.887 2 10.723 2 10.723s2.158 6.427 8.21 7.015v-1.166C5.77 16 4.25 10.958 4.25 10.958h-.002z" fill="#74B71B" fill-rule="nonzero"></path></svg>
821
+ `,DH=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z"></path></svg>
822
+ `,zH=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M16 6H8v12h8V6zm4 16H4V2h16v20z"></path></svg>
823
+ `,LH=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M18.654 3.87a5.087 5.087 0 110 10.174L23.7 19.09c.64.641.187 1.737-.72 1.737H8.48a8.479 8.479 0 010-16.958h10.175zM8.479 7.26a5.087 5.087 0 100 10.176 5.087 5.087 0 000-10.175z" fill="#C8FF00"></path></svg>
824
+ `,BH=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z" fill="url(#lobe-icons-qwen-_R_0_)" fill-rule="nonzero"></path><defs><linearGradient id="lobe-icons-qwen-_R_0_" x1="0%" x2="100%" y1="0%" y2="0%"><stop offset="0%" stop-color="#6336E7" stop-opacity=".84"></stop><stop offset="100%" stop-color="#6F69F7" stop-opacity=".84"></stop></linearGradient></defs></svg>
825
+ `,IH=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M23.197 4.503A6 6 0 0015 2.307a5.973 5.973 0 00-2.995 4.933l5.996.008v.515h-5.996c.039.937.298 1.87.8 2.74a6 6 0 1010.39-6z" fill="#EF2CC1"></path><path d="M.805 4.5A6 6 0 003 12.697a5.972 5.972 0 005.77.127L5.779 7.627l.446-.257 2.997 5.192A6 6 0 10.804 4.5z" fill="#CAAEF5"></path><path d="M12 23.894a6 6 0 005.999-6c0-2.13-1.1-3.996-2.775-5.06l-3.005 5.189-.444-.258 2.997-5.192A6 6 0 1012 23.894z" fill="#FC4C02"></path></svg>
826
+ `,PH=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 0l12 20.785H0L12 0z"></path></svg>
827
+ `,HH=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11.995 20.216a1.892 1.892 0 100 3.785 1.892 1.892 0 000-3.785zm0 2.806a.927.927 0 11.927-.914.914.914 0 01-.927.914z" fill="#4285F4"></path><path clip-rule="evenodd" d="M21.687 14.144c.237.038.452.16.605.344a.978.978 0 01-.18 1.3l-8.24 6.082a1.892 1.892 0 00-1.147-1.508l8.28-6.08a.991.991 0 01.682-.138z" fill="#669DF6" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M10.122 21.842l-8.217-6.066a.952.952 0 01-.206-1.287.978.978 0 011.287-.206l8.28 6.08a1.893 1.893 0 00-1.144 1.479z" fill="#AECBFA" fill-rule="evenodd"></path><path d="M4.273 4.475a.978.978 0 01-.965-.965V1.09a.978.978 0 111.943 0v2.42a.978.978 0 01-.978.965zM4.247 13.034a.978.978 0 100-1.956.978.978 0 000 1.956zM4.247 10.19a.978.978 0 100-1.956.978.978 0 000 1.956zM4.247 7.332a.978.978 0 100-1.956.978.978 0 000 1.956z" fill="#AECBFA"></path><path d="M19.718 7.307a.978.978 0 01-.965-.979v-2.42a.965.965 0 011.93 0v2.42a.964.964 0 01-.965.979zM19.743 13.047a.978.978 0 100-1.956.978.978 0 000 1.956zM19.743 10.151a.978.978 0 100-1.956.978.978 0 000 1.956zM19.743 2.068a.978.978 0 100-1.956.978.978 0 000 1.956z" fill="#4285F4"></path><path d="M11.995 15.917a.978.978 0 01-.965-.965v-2.459a.978.978 0 011.943 0v2.433a.976.976 0 01-.978.991zM11.995 18.762a.978.978 0 100-1.956.978.978 0 000 1.956zM11.995 10.64a.978.978 0 100-1.956.978.978 0 000 1.956zM11.995 7.783a.978.978 0 100-1.956.978.978 0 000 1.956z" fill="#669DF6"></path><path d="M15.856 10.177a.978.978 0 01-.965-.965v-2.42a.977.977 0 011.702-.763.979.979 0 01.241.763v2.42a.978.978 0 01-.978.965zM15.869 4.913a.978.978 0 100-1.956.978.978 0 000 1.956zM15.869 15.853a.978.978 0 100-1.956.978.978 0 000 1.956zM15.869 12.996a.978.978 0 100-1.956.978.978 0 000 1.956z" fill="#4285F4"></path><path d="M8.121 15.853a.978.978 0 100-1.956.978.978 0 000 1.956zM8.121 7.783a.978.978 0 100-1.956.978.978 0 000 1.956zM8.121 4.913a.978.978 0 100-1.957.978.978 0 000 1.957zM8.134 12.996a.978.978 0 01-.978-.94V9.611a.965.965 0 011.93 0v2.445a.966.966 0 01-.952.94z" fill="#AECBFA"></path></svg>
828
+ `,qH=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6.469 8.776L16.512 23h-4.464L2.005 8.776H6.47zm-.004 7.9l2.233 3.164L6.467 23H2l4.465-6.324zM22 2.582V23h-3.659V7.764L22 2.582zM22 1l-9.952 14.095-2.233-3.163L17.533 1H22z"></path></svg>
829
+ `,UH=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M.958 15.936a.459.459 0 01.459.44v2.729a.46.46 0 01-.918 0v-2.729a.459.459 0 01.459-.44zm4.814-2.035a.46.46 0 01.553.45v4.754a.458.458 0 11-.918 0V15.48L3.74 17.202a.462.462 0 01-.655.016.462.462 0 01-.065-.082L.628 14.67a.459.459 0 01.658-.637l2.124 2.187 2.127-2.188a.46.46 0 01.235-.13zm2.068.004a.46.46 0 01.458.445v4.755a.46.46 0 01-.458.458.459.459 0 01-.458-.458V14.35a.459.459 0 01.458-.445zm1.973 2.014a.46.46 0 01.46.457v2.729a.46.46 0 01-.784.324.46.46 0 01-.134-.324v-2.729a.46.46 0 01.458-.458zm.002-2.045a.458.458 0 01.328.157l2.127 2.19 2.125-2.19a.459.459 0 01.784.318v4.756a.46.46 0 01-.455.458.46.46 0 01-.458-.458V15.48l-1.667 1.723a.46.46 0 01-.65.008l-.005-.005c0-.002-.002-.002-.004-.003l-2.455-2.534a.46.46 0 01-.008-.667.461.461 0 01.338-.128zm6.797 1.206a.46.46 0 01.53.651A1.966 1.966 0 0019.81 18.4a.462.462 0 01.623.18.46.46 0 01-.181.624 2.863 2.863 0 01-1.38.353l-.142-.004a2.88 2.88 0 01-2.393-4.263.461.461 0 01.274-.21zm.864-.931a2.884 2.884 0 013.915 3.914.46.46 0 01-.402.24l-.057-.004a.458.458 0 01-.164-.055.46.46 0 01-.182-.622 1.967 1.967 0 00-2.669-2.67.459.459 0 11-.441-.803zM9.59 6.368c1.481 0 1.696 1.202 1.696 1.654v2.648h-.917v-.432c-.26.346-.792.535-1.36.535-.133 0-1.289-.03-1.384-1.136-.082-.932.675-1.61 2.053-1.61h.691c0-.563-.367-.886-.983-.886-.44.013-.864.174-1.2.458l-.36-.664c.484-.379 1.012-.567 1.764-.567zm4.427.1c1.263 0 2.082.97 2.083 2.15 0 1.181-.824 2.154-2.083 2.154-1.26 0-2.084-.972-2.084-2.152 0-1.18.82-2.153 2.084-2.153zm6.801.015c.68 0 1.202.465 1.197 1.548v2.642H21.1V8.29c0-.312-.002-.98-.63-.98s-.628.667-.628.838v2.524h-.89V8.148c0-.17-.001-.838-.63-.838-.628 0-.628.668-.628.98v2.383h-.917v-4.03h.917V7a1.22 1.22 0 01.947-.516c.398 0 .76.193.982.686a1.321 1.321 0 011.195-.686zm-18.093.872l1.457-1.772H5.32L3.311 8.07l2.14 2.602H4.24L2.725 8.796 1.21 10.672H0L2.138 8.07.13 5.583h1.138l1.458 1.772zm4.149 3.317h-.916V6.644h.916v4.028zm16.99 0h-.916V6.644h.916v4.028zM9.925 8.71c-1.055 0-1.359.412-1.326.742.032.329.324.537.757.537a1.013 1.013 0 001.014-.968l.002-.31h-.447zM14.018 7.3c-.663 0-1.184.487-1.184 1.32 0 .832.52 1.32 1.184 1.32.662 0 1.182-.49 1.182-1.32 0-.832-.52-1.32-1.182-1.32zM6.417 5.001a.568.568 0 01.587.582.588.588 0 01-1.175 0A.57.57 0 016.417 5zm16.991 0a.57.57 0 01.592.582.588.588 0 01-1.174 0 .57.57 0 01.357-.542.572.572 0 01.225-.04z"></path></svg>
830
+ `,FH=`<svg fill="currentColor" fill-rule="evenodd" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.105 2L9.927 4.953H.653L2.83 2h9.276zM23.254 19.048L21.078 22h-9.242l2.174-2.952h9.244zM24 2L9.264 22H0L14.736 2H24z"></path></svg>
831
+ `,VH=Object.assign({"./antgroup.svg":pH,"./anthropic.svg":gH,"./azure.svg":vH,"./baseten.svg":yH,"./bedrock.svg":xH,"./cerebras.svg":bH,"./cloudflare.svg":jH,"./deepseek.svg":wH,"./fireworks.svg":kH,"./githubcopilot.svg":SH,"./google.svg":CH,"./groq.svg":NH,"./huggingface.svg":EH,"./kimi.svg":TH,"./meta.svg":AH,"./minimax.svg":MH,"./mistral.svg":_H,"./moonshot.svg":RH,"./nvidia.svg":OH,"./openai.svg":DH,"./opencode.svg":zH,"./openrouter.svg":LH,"./qwen.svg":BH,"./together.svg":IH,"./vercel.svg":PH,"./vertexai.svg":HH,"./xai.svg":qH,"./xiaomimimo.svg":UH,"./zai.svg":FH}),mj={"amazon-bedrock":"bedrock","ant-ling":"antgroup",anthropic:"anthropic",azure:"azure",baseten:"baseten",cerebras:"cerebras","cloudflare-ai-gateway":"cloudflare","cloudflare-workers-ai":"cloudflare",deepseek:"deepseek",fireworks:"fireworks","github-copilot":"githubcopilot",google:"google","google-vertex":"vertexai",groq:"groq",huggingface:"huggingface","kimi-coding":"kimi",meta:"meta",minimax:"minimax","minimax-cn":"minimax",mistral:"mistral",moonshotai:"moonshot","moonshotai-cn":"moonshot",nvidia:"nvidia",openai:"openai","openai-codex":"openai",opencode:"opencode","opencode-go":"opencode",openrouter:"openrouter","qwen-token-plan":"qwen","qwen-token-plan-cn":"qwen","qwen-token-plan-individual":"qwen",together:"together","vercel-ai-gateway":"vercel",xai:"xai",xiaomi:"xiaomimimo","xiaomi-token-plan-ams":"xiaomimimo","xiaomi-token-plan-cn":"xiaomimimo","xiaomi-token-plan-sgp":"xiaomimimo",zai:"zai","zai-coding-cn":"zai"},$H=e=>e&&mj[e]?VH[`./${mj[e]}.svg`]:void 0;function $g({name:e,provider:a}){var r;const i=$H(a);return i?o.jsx("span",{className:"jv-provider-mark","data-logo":"","aria-hidden":"true",dangerouslySetInnerHTML:{__html:i}}):o.jsx("span",{className:"jv-provider-mark","aria-hidden":"true",children:((r=[...e.trim()][0])==null?void 0:r.toUpperCase())??"?"})}function wS(e){const a=e.authType==="oauth";return e.configured?{ok:!0,label:x(a?"status.signedIn":"status.configured")}:{ok:!1,label:x(a?"status.signedOut":"status.notConfigured")}}const kS=[{id:"custom",label:"group.custom"},{id:"subscription",label:"group.subscription"},{id:"api_key",label:"group.apiKey"}],SS=e=>e.custom?"custom":e.authType==="oauth"?"subscription":"api_key",GH={id:"custom",name:"OpenAI / Anthropic compatible",authType:"api_key",api:"openai-completions",modelCount:0};function YH({onBack:e,onSelect:a}){const[i,r]=w.useState([]),[s,c]=w.useState(""),[d,f]=w.useState(""),[h,p]=w.useState(!0),[y,g]=w.useState(0);w.useEffect(()=>{let k=!0;return p(!0),f(""),he.modelProviders().then(S=>{k&&r(S.providers)}).catch(S=>{k&&f(en(S,"picker.loadFailed"))}).finally(()=>{k&&p(!1)}),()=>{k=!1}},[y]);const b=[GH,...i].filter(k=>`${k.name} ${k.id}`.toLowerCase().includes(s.toLowerCase())),j=k=>SS({authType:k.authType,custom:k.id==="custom"});return o.jsxs("div",{className:"jv-page",children:[o.jsxs("header",{className:"jv-page-header",children:[o.jsx(Ne,{variant:"ghost",size:"icon-sm",className:"jv-back",onClick:e,"aria-label":x("picker.back"),children:o.jsx(R0,{})}),o.jsx("h2",{children:x("models.add")})]}),o.jsxs("label",{className:"jv-search",children:[o.jsx(ys,{}),o.jsx("input",{autoFocus:!0,"aria-label":x("picker.search"),placeholder:x("picker.searchPlaceholder"),value:s,onChange:k=>c(k.target.value)})]}),kS.filter(k=>b.some(S=>j(S)===k.id)).map(({id:k,label:S})=>o.jsxs("section",{className:"jv-section","aria-label":x(S),children:[o.jsx("h3",{className:"jv-section-title",children:x(S)}),o.jsx("div",{className:"jv-list",children:b.filter(N=>j(N)===k).map(N=>o.jsxs("button",{className:"jv-list-row",type:"button",onClick:()=>a(N),children:[o.jsx($g,{name:N.id==="custom"?"+":N.name,provider:N.id}),o.jsxs("span",{className:"jv-row-text",children:[o.jsx("strong",{children:N.name}),N.id!=="custom"&&N.authType!=="oauth"&&o.jsx("span",{children:x("picker.keyHint",{count:N.modelCount})})]}),o.jsx(ml,{className:"jv-row-chevron"})]},`${N.id}:${N.authType}`))})]},k)),h&&o.jsx("p",{role:"status",className:"jv-hint",children:x("picker.loading")}),d&&o.jsxs("div",{className:"jv-empty",role:"alert",children:[o.jsx("strong",{children:d}),o.jsx(Ne,{variant:"outline",onClick:()=>g(k=>k+1),children:x("picker.retry")})]}),!h&&!d&&!b.length&&o.jsx("div",{className:"jv-empty",children:o.jsx("strong",{children:x("picker.noMatch")})})]})}const KH=H0("inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-medium whitespace-nowrap",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",outline:"text-foreground",destructive:"border-transparent bg-destructive text-white"}},defaultVariants:{variant:"default"}});function XH({className:e,variant:a,...i}){return o.jsx("span",{"data-slot":"badge",className:bn(KH({variant:a}),e),...i})}function CS({className:e,...a}){return o.jsx(VT,{"data-slot":"label",className:bn("flex items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...a})}function QH({connection:e,providerName:a,authType:i,ensureConnection:r,onChanged:s}){var q,Z;const[c,d]=w.useState({phase:"idle"}),[f,h]=w.useState(""),{busy:p,error:y,setError:g,run:b}=xn(),[j,k]=w.useState(0),S=w.useRef(void 0),N=e==null?void 0:e.id,E=w.useRef(s);E.current=s;const M=w.useRef(c.phase);M.current=c.phase,w.useEffect(()=>{if(!N)return;const U=N;let F=!0,X;async function $(){var H;try{let ie=await he.authStatus(U);if(!F)return;if(S.current&&((H=ie.prompt)==null?void 0:H.type)==="select"){const le=S.current;if(S.current=void 0,ie=await he.authInput(U,ie.prompt.id,le),!F)return}const O=M.current==="running"&&ie.phase!=="running";M.current=ie.phase,d(ie),O&&await E.current(),ie.phase==="running"&&F&&(X=setTimeout(()=>void $(),750))}catch(ie){F&&g(en(ie,"auth.statusFailed"))}}return $(),()=>{F=!1,clearTimeout(X)}},[N,c.phase,j]),w.useEffect(()=>h(""),[(q=c.prompt)==null?void 0:q.id]);async function C(U){await b("act",async()=>{const F=await U();d(F),F.phase!=="running"&&await s()},"common.failed")}function A(U){S.current=U,C(async()=>{const F=N??await r();return he.authStart(F)})}const _=a==="openai-codex"&&i==="oauth",R=a==="openai"&&i==="oauth",I=c.phase==="running",G=c.prompt,Y=c.event,L=(Y==null?void 0:Y.type)==="auth_url"?Y.url:(Y==null?void 0:Y.type)==="device_code"?Y.verificationUri:null,P=U=>{G&&N&&C(()=>he.authInput(N,G.id,U))};return o.jsxs("section",{className:"jv-auth","aria-label":x("auth.title"),children:[o.jsxs("div",{className:"jv-auth-header",children:[o.jsx("h3",{children:x("auth.title")}),o.jsx(XH,{variant:"outline","data-state":I?"running":e!=null&&e.configured?"connected":"disconnected",children:x(I?"auth.running":e!=null&&e.configured?i==="oauth"?"status.signedIn":"status.configured":i==="oauth"?"status.signedOut":"status.notConfigured")})]}),I?o.jsxs("div",{className:"jv-auth-flow",children:[L&&o.jsx(Ne,{asChild:!0,variant:"outline",children:o.jsx("a",{style:{color:"inherit",textDecoration:"none"},href:L,target:"_blank",rel:"noopener noreferrer",children:x("auth.openPage")})}),(Y==null?void 0:Y.type)==="device_code"&&o.jsx("p",{children:x("auth.code",{code:Y.userCode})}),(G==null?void 0:G.type)==="select"&&o.jsx("div",{className:"flex flex-wrap gap-2",children:(Z=G.options)==null?void 0:Z.map(U=>o.jsx(Ne,{type:"button",variant:"outline",disabled:p,onClick:()=>P(U.id),children:_&&U.id==="browser"?x("auth.browser"):_&&U.id==="device_code"?x("auth.deviceCode"):U.label},U.id))}),G&&G.type!=="select"&&o.jsxs("div",{className:"jv-auth-input",children:[o.jsx(CS,{htmlFor:`oauth-input-${N??a}`,children:G.type==="manual_code"?x(R?"auth.redirectFull":"auth.redirectOrCode"):G.message}),G.type==="manual_code"&&o.jsx("p",{className:"jv-auth-note",children:x("auth.manualNote")}),o.jsx(xt,{id:`oauth-input-${N??a}`,type:G.type==="text"?"text":"password",autoComplete:"off",value:f,disabled:p,onChange:U=>h(U.target.value),onKeyDown:U=>{U.key==="Enter"&&(U.preventDefault(),P(f))}}),o.jsx(Ne,{type:"button",variant:"outline",disabled:p||!f.trim(),onClick:()=>P(f),children:x("common.continue")})]}),!G&&o.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:x("auth.waiting")}),(Y==null?void 0:Y.type)==="info"&&o.jsx("p",{className:"text-sm",children:Y.message}),o.jsx(Ne,{type:"button",variant:"ghost",disabled:p,onClick:()=>void C(()=>he.authCancel(N)),children:x("auth.cancel")})]}):o.jsxs("div",{className:"flex flex-wrap gap-2",children:[_?o.jsxs(o.Fragment,{children:[o.jsx(Ne,{type:"button",variant:"outline",disabled:p,onClick:()=>A("browser"),children:x("auth.browser")}),o.jsx(Ne,{type:"button",variant:"outline",disabled:p,onClick:()=>A("device_code"),children:x("auth.deviceCode")})]}):o.jsx(Ne,{type:"button",variant:"outline",disabled:p,onClick:()=>A(),children:x(i==="api_key"?"auth.configureCredential":e!=null&&e.configured?"auth.signInAgain":"auth.signIn")}),(e==null?void 0:e.configured)&&o.jsx(Ne,{type:"button",variant:"outline",disabled:p,onClick:()=>void C(async()=>(await he.authLogout(N),{phase:"idle"})),children:x(i==="api_key"?"auth.removeCredential":"auth.signOut")})]}),(y||c.phase==="error")&&o.jsx("p",{role:"alert",className:"jarvy-model-feedback",children:y||x("error.loginFailed")}),y&&o.jsx(Ne,{type:"button",variant:"link",disabled:p,onClick:()=>{g(""),k(U=>U+1)},children:x("auth.refresh")})]})}async function ZH(e,a,i){try{return await he.autoconfigModel({modelId:e.id,api:e.api||a,...i?{choice:i}:{}})}catch(r){return{status:"error",message:en(r,"auto.failed")}}}function JH(e,a){if(a.status!=="matched")return{...e,auto:a};const{fields:i,...r}=a,s=e.model.name&&e.model.name!==e.model.id;return{...e,model:{...e.model,...i,name:s?e.model.name:a.source.name||e.model.id},auto:r}}const NS=e=>`${e.provider} / ${e.modelId}`;function pj({items:e,onPick:a}){return o.jsx("div",{className:"jv-auto-sources",children:e.map(i=>o.jsxs("button",{type:"button",onClick:()=>a(i),children:[o.jsx("span",{className:"jv-mono",children:NS(i)}),i.official&&o.jsx("em",{children:x("auto.official")}),o.jsx("small",{children:i.api})]},`${i.provider}/${i.modelId}`))})}function WH({state:e,modelId:a,onRun:i}){const r=c=>i({provider:c.provider,modelId:c.modelId}),s=(e==null?void 0:e.status)==="pending";return o.jsxs("div",{className:"jv-autoconfig","aria-live":"polite",children:[o.jsxs(Ne,{type:"button",variant:"outline",size:"sm",disabled:!a.trim()||s,onClick:()=>i(),children:[o.jsx(r4,{}),x(s?"auto.pending":"auto.run")]}),e&&!s&&o.jsxs("div",{className:"jv-auto-result",children:[e.status==="matched"&&o.jsxs(o.Fragment,{children:[o.jsx("p",{children:_0("auto.matched",{source:o.jsx("strong",{className:"jv-mono",children:NS(e.source)}),note:e.reseller?x("auto.reseller"):"",suffix:x("auto.applied")})}),e.apiMismatch&&o.jsx("p",{className:"jv-auto-warn",children:x("auto.apiMismatch",{api:e.source.api})}),e.alternatives.length>0&&o.jsxs("details",{children:[o.jsx("summary",{children:x("auto.changeSource")}),o.jsx(pj,{items:e.alternatives,onPick:r})]})]}),e.status==="choose"&&o.jsxs(o.Fragment,{children:[o.jsx("p",{children:e.reason==="multiple"?x("auto.multiple"):x("auto.similar",{modelId:a})}),o.jsx(pj,{items:e.options,onPick:r})]}),e.status==="none"&&o.jsx("p",{children:x("auto.notFound")}),e.status==="error"&&o.jsx("p",{role:"alert",children:e.message})]})]})}const Lp=["openai","openrouter","deepseek","zai","qwen","together","baseten","chat-template","qwen-chat-template","string-thinking","ant-ling"],ES=[["off","thinking.level.off"],["minimal","thinking.level.minimal"],["low","thinking.level.low"],["medium","thinking.level.medium"],["high","thinking.level.high"],["xhigh","thinking.level.xhigh"],["max","thinking.level.max"]],TS=e=>e==="xhigh"||e==="max";function AS(e,a){const i=e[a];return i===null||i===void 0&&TS(a)?"unsupported":i===void 0?"default":"custom"}function eq(e){return e.reasoning?ES.filter(([a])=>AS(e.thinkingLevelMap,a)!=="unsupported").map(([,a])=>x(a)):[x("thinking.level.off")]}function tq({model:e,api:a,onChange:i}){const r=e.thinkingLevelMap,s=(f,h,p)=>{const y={...r};h==="default"?delete y[f]:h==="unsupported"?y[f]=null:y[f]=p??(typeof r[f]=="string"?r[f]:f),i({thinkingLevelMap:y})},c=a==="openai-completions",d=e.thinkingFormat&&!Lp.includes(e.thinkingFormat)?[...Lp,e.thinkingFormat]:Lp;return o.jsxs("section",{className:"jv-thinking",children:[o.jsx("h4",{children:x("thinking.title")}),o.jsxs("div",{className:"jv-field",children:[o.jsx("span",{children:x("thinking.format")}),o.jsxs(pr,{value:e.thinkingFormat||"default",disabled:!c&&!e.thinkingFormat,onValueChange:f=>i({thinkingFormat:f==="default"?"":f}),children:[o.jsx(vr,{"aria-label":x("thinking.format"),children:o.jsx(gr,{})}),o.jsxs(yr,{className:"jv-select-menu",children:[o.jsx(fa,{value:"default",children:x("thinking.protocolDefault")}),d.map(f=>o.jsx(fa,{value:f,children:f},f))]})]}),!c&&o.jsx("small",{className:"jv-field-hint",children:x("thinking.onlyCompletions")})]}),o.jsx("div",{className:"jv-thinking-levels",role:"group","aria-label":x("thinking.levels"),children:ES.map(([f,h])=>{const p=AS(r,f);return o.jsxs("div",{className:"jv-thinking-level",children:[o.jsxs("span",{children:[x(h),o.jsx("code",{children:f})]}),o.jsxs(pr,{value:p,onValueChange:y=>s(f,y),children:[o.jsx(vr,{"aria-label":x("thinking.levelName",{level:x(h)}),children:o.jsx(gr,{})}),o.jsxs(yr,{className:"jv-select-menu",children:[!TS(f)&&o.jsx(fa,{value:"default",children:x("thinking.supportedDefault")}),o.jsx(fa,{value:"unsupported",children:x("thinking.unsupported")}),o.jsx(fa,{value:"custom",children:x("thinking.supportedCustom")})]})]}),p==="custom"?o.jsx(xt,{className:"jv-mono",required:!0,"aria-label":x("thinking.levelValue",{level:x(h)}),maxLength:80,value:r[f]??"",onChange:y=>s(f,"custom",y.target.value)}):o.jsx("span",{})]},f)})}),o.jsx("p",{className:"jv-field-hint",children:x("thinking.supported",{levels:eq(e).join(" · ")})})]})}const Bp=[{id:"openai-completions",label:"OpenAI · Chat Completions"},{id:"openai-responses",label:"OpenAI · Responses"},{id:"anthropic-messages",label:"Anthropic · Messages"},{id:"google-generative-ai",label:"Google · Gemini"}],nq=()=>({id:"",name:"",reasoning:!1,input:["text"],contextWindow:null,maxTokens:null,thinkingFormat:"",thinkingLevelMap:{},compat:{},cost:null});function T0({value:e,onChange:a,allowDefault:i=!1}){const r=Bp.some(s=>s.id===e)||!e?Bp:[...Bp,{id:e,label:e}];return o.jsxs(pr,{value:e||"default",onValueChange:s=>a(s==="default"?"":s),children:[o.jsx(vr,{"aria-label":x("editor.protocol"),children:o.jsx(gr,{})}),o.jsxs(yr,{className:"jv-select-menu",children:[i&&o.jsx(fa,{value:"default",children:x("card.defaultProtocol")}),r.map(s=>o.jsx(fa,{value:s.id,children:s.label},s.id))]})]})}const aq=e=>e>=1e6?`${+(e/1e6).toFixed(2)}M`:e>=1e3?`${Math.round(e/1e3)}K`:String(e),gj={pending:"auto.pending",choose:"auto.tagChoose",none:"auto.tagNone",error:"auto.failed"};function iq({value:e,onChange:a}){const i=h=>Object.keys(h).length?JSON.stringify(h,null,2):"",[r,s]=w.useState(()=>i(e)),[c,d]=w.useState(""),f=w.useRef(null);return w.useEffect(()=>{var h;try{if(JSON.stringify(JSON.parse(r||"{}"))===JSON.stringify(e))return}catch{}s(i(e)),d(""),(h=f.current)==null||h.setCustomValidity("")},[e]),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:x("card.compat")}),o.jsx(vs,{ref:f,className:"jv-mono jv-compat",rows:Math.min(10,Math.max(2,r.split(`
832
+ `).length)),placeholder:"{}",value:r,onChange:h=>{s(h.target.value);try{const p=JSON.parse(h.target.value||"{}");if(!p||typeof p!="object"||Array.isArray(p))throw new Error;a(p),d(""),h.currentTarget.setCustomValidity("")}catch{d(x("card.jsonObject")),h.currentTarget.setCustomValidity(x("card.jsonObject"))}}}),c&&o.jsx("small",{role:"alert",children:c})]})}function rq({draft:e,protocol:a,onChange:i,onRemove:r,onAutoconfig:s}){const{model:c}=e,[d,f]=w.useState(!c.id),[h,p]=w.useState(!1),[y,g]=w.useState(()=>(c.headerNames??[]).map(S=>({name:S,value:"",saved:!0}))),b=S=>i({...e,model:{...c,...S}}),j=(S,N)=>o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:S}),N]}),k=(S,N,E)=>{const M=y.map((A,_)=>_===S?{...A,[N]:E}:A);g(M);const C={...c.headerUpdates};!y[S].saved&&y[S].name&&y[S].name!==M[S].name&&(C[y[S].name]=null);for(const A of M)A.name&&(A.value||!A.saved)&&(C[A.name]=A.value);b({headerUpdates:C})};return o.jsxs("article",{className:`jv-model-card ${e.selected?"is-selected":""}`,children:[o.jsxs("div",{className:"jv-model-summary",children:[o.jsx("input",{type:"checkbox",checked:e.selected,"aria-label":x("card.use",{name:c.id||x("card.newModel")}),onChange:S=>i({...e,selected:S.target.checked})}),o.jsxs("button",{type:"button","aria-expanded":d,className:"jv-model-expand",onClick:()=>f(!d),children:[o.jsxs("span",{className:"jv-row-text",children:[o.jsx("strong",{children:c.name||c.id||x("card.newModel")}),o.jsx("span",{className:"jv-mono",children:c.id||x("card.enterId")})]}),o.jsxs("span",{className:"jv-chips",children:[c.contextWindow&&o.jsx("span",{className:"jv-chip",children:aq(c.contextWindow)}),c.input.includes("image")&&o.jsx("span",{className:"jv-chip",children:x("card.image")}),c.reasoning&&o.jsx("span",{className:"jv-chip",children:x("card.reasoning")}),e.auto&&gj[e.auto.status]&&o.jsx("span",{className:"jv-chip jv-chip-warn",children:x(gj[e.auto.status])})]}),o.jsx(cl,{className:"jv-expand-icon"})]}),o.jsx(Ne,{type:"button",variant:"ghost",size:"icon-sm",className:"jv-model-remove","aria-label":x("card.remove",{name:c.id||x("card.newModel")}),onClick:r,children:o.jsx(Fd,{})})]}),d&&o.jsxs("div",{className:"jv-model-fields",children:[o.jsxs("div",{className:"jv-field-grid",children:[j(x("card.modelId"),o.jsx(xt,{className:"jv-mono",required:!0,value:c.id,onChange:S=>b({id:S.target.value}),placeholder:"model-id"})),j(x("card.modelName"),o.jsx(xt,{value:c.name,onChange:S=>b({name:S.target.value}),placeholder:x("card.optional")}))]}),o.jsx(WH,{state:e.auto,modelId:c.id,onRun:s}),o.jsxs("section",{children:[o.jsx("h4",{children:x("card.capabilities")}),o.jsxs("div",{className:"flex flex-wrap gap-5",children:[o.jsxs("label",{className:"jarvy-model-check",children:[o.jsx("input",{type:"checkbox",checked:c.reasoning,onChange:S=>b({reasoning:S.target.checked})}),x("card.reasoningThinking")]}),o.jsxs("label",{className:"jarvy-model-check",children:[o.jsx("input",{type:"checkbox",checked:c.input.includes("image"),onChange:S=>b({input:S.target.checked?["text","image"]:["text"]})}),x("card.imageInput")]})]})]}),c.reasoning&&o.jsx(tq,{model:c,api:c.api||a,onChange:b}),o.jsxs("section",{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h4",{children:x("card.specs")}),o.jsx(Ne,{type:"button",variant:"link",size:"sm",onClick:()=>p(!h),children:x(h?"card.hidePrices":"card.editPrices")})]}),o.jsxs("div",{className:"jv-field-grid",children:[j(x("card.context"),o.jsx(xt,{type:"number",min:1,value:c.contextWindow??"",placeholder:x("card.notProvided"),onChange:S=>b({contextWindow:S.target.value?Number(S.target.value):null})})),j(x("card.maxOutput"),o.jsx(xt,{type:"number",min:1,value:c.maxTokens??"",placeholder:x("card.notProvided"),onChange:S=>b({maxTokens:S.target.value?Number(S.target.value):null})}))]}),o.jsx("h4",{className:"jv-cost-title",children:x("card.costTitle")}),o.jsx("div",{className:"jv-costs",children:[["input","card.costInput"],["output","card.costOutput"],["cacheRead","card.costCacheRead"],["cacheWrite","card.costCacheWrite"]].map(([S,N])=>{var E,M;return o.jsxs("div",{children:[o.jsx(CS,{children:x(N)}),h?o.jsx(xt,{type:"number",step:"any",min:0,value:((E=c.cost)==null?void 0:E[S])??"",onChange:C=>b({cost:{input:0,output:0,cacheRead:0,cacheWrite:0,...c.cost,[S]:Number(C.target.value)}})}):o.jsx("span",{children:((M=c.cost)==null?void 0:M[S])??x("card.notProvided")})]},S)})})]}),o.jsxs("details",{className:"jv-advanced",children:[o.jsxs("summary",{children:[x("card.advanced"),o.jsx(cl,{className:"size-4"})]}),o.jsxs("div",{className:"jv-advanced-fields",children:[o.jsxs("div",{className:"jv-field",children:[o.jsx("span",{children:x("card.apiOverride")}),o.jsx(T0,{allowDefault:!0,value:c.api??"",onChange:S=>b({api:S,baseUrl:void 0})})]}),o.jsxs("div",{className:"jv-field",children:[o.jsx("span",{children:x("card.headers")}),y.map((S,N)=>o.jsxs("div",{className:"jv-header-row",children:[o.jsx(xt,{className:"jv-mono","aria-label":"Header Name",placeholder:"Header-Name",readOnly:S.saved,value:S.name,onChange:E=>k(N,"name",E.target.value)}),o.jsx(xt,{"aria-label":"Header Value",type:"password",autoComplete:"off",placeholder:S.saved?x("card.headerSaved"):"value",value:S.value,onChange:E=>k(N,"value",E.target.value)}),o.jsx(Ne,{type:"button",size:"icon-sm",variant:"ghost","aria-label":x("card.removeHeader"),onClick:()=>{g(y.filter((E,M)=>M!==N)),S.name&&b({headerUpdates:{...c.headerUpdates,[S.name]:null}})},children:o.jsx(Fd,{})})]},N)),o.jsxs(Ne,{type:"button",variant:"outline",size:"sm",className:"self-start",onClick:()=>g([...y,{name:"",value:"",saved:!1}]),children:[o.jsx(xr,{}),x("card.addHeader")]})]}),o.jsx(iq,{value:c.compat,onChange:S=>b({compat:S})})]})]})]})]})}let lq=0;const Od=(e,a,i=!1)=>({key:`draft-${++lq}`,model:e,selected:a,...i?{originalId:e.id}:{}});function oq({connection:e,preset:a,defaultName:i,saved:r=!1,onBack:s,onSaved:c,onConnected:d,onChanged:f}){const h=e?e.kind==="custom":(a==null?void 0:a.id)==="custom",p=(e==null?void 0:e.authType)??a.authType,[y,g]=w.useState(e?h?e.providerName:e.displayName:h?"":i),[b,j]=w.useState((e==null?void 0:e.baseUrl)??""),[k,S]=w.useState((e==null?void 0:e.api)??a.api),[N,E]=w.useState(""),[M,C]=w.useState(()=>((e==null?void 0:e.models)??[]).map(oe=>Od(oe,!0,!0))),[A,_]=w.useState([]),[R,I]=w.useState(""),{busy:G,error:Y,setError:L,run:P}=xn(),[q,Z]=w.useState(!1),[U,F]=w.useState(r?x("editor.saved"):""),[X,$]=w.useState(null),H=w.useRef(e==null?void 0:e.id);function ie(oe){C(Ee=>{const Xe=new Set(Ee.map(Be=>Be.model.id));return[...Ee,...oe.filter(Be=>!Xe.has(Be.id)).map(Be=>Od(Be,!1))]})}w.useEffect(()=>{if(h)return;let oe=!0;return Z(!0),(e?he.modelCatalog(e.id):he.providerModels(a.id)).then(Xe=>{oe&&ie(Xe.models)}).catch(Xe=>{oe&&L(en(Xe,"editor.fetchFailed"))}).finally(()=>{oe&&Z(!1)}),()=>{oe=!1}},[e==null?void 0:e.id,a==null?void 0:a.id,h]);async function O(){Z(!0),L(""),F("");try{const oe=await he.discoverModels({connectionId:H.current,baseUrl:b,api:k,...N.trim()?{apiKey:N}:{}});ie(oe.models),F(oe.models.length?x("editor.fetched",{count:oe.models.length}):x("editor.noneReturned"))}catch(oe){L(en(oe,"editor.fetchFailed"))}finally{Z(!1)}}async function le(oe,Ee){const Xe=M.filter(Je=>oe.includes(Je.key)&&Je.model.id.trim());if(!Xe.length)return;L(""),F(""),C(Je=>Je.map(Qe=>Xe.some(et=>et.key===Qe.key)?{...Qe,auto:{status:"pending"}}:Qe));const Be={matched:0,choose:0,none:0,error:0};for(const Je of Xe){const Qe=await ZH(Je.model,k,Ee);Be[Qe.status]++,C(et=>et.map(Lt=>Lt.key===Je.key?JH(Lt,Qe):Lt))}Xe.length>1&&F(x("editor.autoSummary",{parts:[x("editor.autoMatched",{count:Be.matched}),Be.choose&&x("editor.autoChoose",{count:Be.choose}),Be.none&&x("editor.autoNone",{count:Be.none}),Be.error&&x("editor.autoFailed",{count:Be.error})].filter(Boolean).join(x("common.listSeparator"))}))}async function ne(){if(!H.current){const oe=await he.createModelConnection({providerName:a.id,displayName:y,kind:"builtin",authType:p,baseUrl:b,api:k});H.current=oe.id}return await d(H.current),H.current}async function D(oe){oe.preventDefault(),F(""),await P("save",async()=>{let Ee;H.current?(Ee=await he.updateModelConnection(H.current,{displayName:y,...h?{providerName:y}:{},baseUrl:b,api:k}),h&&N.trim()&&await he.saveModelCredential(Ee.id,N)):(Ee=await he.createModelConnection({providerName:h?y:a.id,displayName:y,kind:h?"custom":"builtin",authType:p,baseUrl:b,api:k,...h&&N.trim()?{apiKey:N}:{}}),H.current=Ee.id);for(const Xe of M)Xe.selected&&await he.saveConnectionModel(Ee.id,Xe.model,Xe.originalId);for(const Xe of new Set([...A,...M.filter(Be=>Be.originalId&&!Be.selected).map(Be=>Be.originalId)]))await he.deleteConnectionModel(Ee.id,Xe);E(""),await c(Ee.id),F(x("editor.saved"))},"editor.saveFailed")}async function B(){F(""),await P("reset",async()=>$(await he.modelResetPlan(e.id)),"editor.resetFailed")}async function W(){F(""),await P("reset",async()=>{const Ee=await he.resetModelConnection(e.id);$(null),_([]),j(Ee.baseUrl),S(Ee.api),C(Ee.models.map(Xe=>Od(Xe,!0,!0))),ie((await he.modelCatalog(Ee.id)).models),await f()},"editor.resetFailed")&&F(x("editor.resetDone"))}async function ue(){!e||!confirm(x("editor.confirmDelete",{name:e.displayName}))||await P("delete",async()=>{await he.deleteModelConnection(e.id),await f(),s()},"editor.deleteFailed")}const me=M.filter(oe=>`${oe.model.id} ${oe.model.name}`.toLowerCase().includes(R.toLowerCase())),ge=M.filter(oe=>oe.selected).length,Se=h?(e==null?void 0:e.displayName)??x("group.custom"):(e==null?void 0:e.displayName)??a.name,Me=e?wS(e):null,xe=M.some(oe=>{var Ee;return((Ee=oe.auto)==null?void 0:Ee.status)==="pending"});return o.jsxs("form",{className:"jv-editor",onChange:()=>F(""),onSubmit:oe=>void D(oe),children:[o.jsxs("header",{className:"jv-editor-header",children:[o.jsx(Ne,{type:"button",variant:"ghost",size:"icon-sm",className:"jv-back",disabled:G,onClick:s,"aria-label":x("editor.back"),children:o.jsx(R0,{})}),o.jsx($g,{name:Se,provider:e?e.kind==="builtin"?e.providerName:void 0:a==null?void 0:a.id}),o.jsxs("div",{className:"jv-row-text",children:[o.jsx("strong",{children:Se}),o.jsx("span",{children:h?"OpenAI / Anthropic compatible":x(p==="oauth"?"group.subscription":"group.apiKey")})]}),Me&&o.jsx("span",{className:"jv-status","data-ok":Me.ok||void 0,children:Me.label}),e&&o.jsx(Ne,{type:"button",variant:"ghost",size:"icon-sm",className:"jv-danger-icon",disabled:G,onClick:()=>void ue(),"aria-label":x("editor.delete"),children:o.jsx(Fd,{})})]}),o.jsxs("div",{className:"jv-editor-scroll",children:[o.jsxs("section",{className:"jv-section","aria-label":x("editor.connection"),children:[o.jsx("h3",{className:"jv-section-title",children:x("editor.connection")}),o.jsx("div",{className:"jv-panel",children:h?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"jv-field-grid",children:[o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:x("editor.providerName")}),o.jsx(xt,{className:"jv-mono",required:!0,maxLength:80,"aria-label":x("editor.providerName"),placeholder:"my-provider",value:y,onChange:oe=>g(oe.target.value)})]}),o.jsxs("div",{className:"jv-field",children:[o.jsx("span",{children:x("editor.protocol")}),o.jsx(T0,{value:k,onChange:S})]})]}),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:x("editor.url")}),o.jsx(xt,{required:!0,type:"url","aria-label":x("editor.url"),value:b,placeholder:"https://api.example.com/v1",onChange:oe=>j(oe.target.value)})]}),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:x("editor.key")}),o.jsx(xt,{type:"password",autoComplete:"new-password","aria-label":x("editor.key"),placeholder:x(e!=null&&e.configured?"editor.keySaved":"editor.keyPlaceholder"),value:N,onChange:oe=>E(oe.target.value)})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:x("editor.name")}),o.jsx(xt,{required:!0,maxLength:100,"aria-label":x("editor.name"),value:y,onChange:oe=>g(oe.target.value)})]}),o.jsx(QH,{connection:e,providerName:(e==null?void 0:e.providerName)??a.id,authType:p,ensureConnection:ne,onChanged:f}),o.jsxs("details",{className:"jv-advanced",children:[o.jsxs("summary",{children:[o.jsx(cl,{}),x("editor.settings")]}),o.jsxs("div",{className:"jv-advanced-fields",children:[o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:x("editor.url")}),o.jsx(xt,{className:"jv-mono",value:b,placeholder:x("editor.defaultUrl"),onChange:oe=>j(oe.target.value)})]}),o.jsxs("div",{className:"jv-field",children:[o.jsx("span",{children:"API Protocol"}),o.jsx(T0,{value:k,onChange:S})]})]})]})]})})]}),o.jsxs("section",{className:"jv-section","aria-label":x("editor.models"),children:[o.jsxs("div",{className:"jv-section-head",children:[o.jsxs("h3",{className:"jv-section-title",children:[x("settings.models")," ",o.jsx("span",{children:x("editor.selected",{selected:ge,total:M.length})})]}),o.jsxs("div",{className:"jv-section-actions",children:[h&&o.jsxs(Ne,{type:"button",variant:"ghost",size:"sm",disabled:G||q||!b.trim()||!(N.trim()||e!=null&&e.configured),onClick:()=>void O(),children:[o.jsx(O0,{}),x(q?"editor.fetching":"editor.fetch")]}),ge>0&&o.jsxs(Ne,{type:"button",variant:"ghost",size:"sm",disabled:G||xe,onClick:()=>void le(M.filter(oe=>oe.selected).map(oe=>oe.key)),children:[o.jsx(r4,{}),x("editor.autoSelected")]}),o.jsxs(Ne,{type:"button",variant:"ghost",size:"sm",onClick:()=>C([...M,Od(nq(),!0)]),children:[o.jsx(xr,{}),x("editor.addManually")]}),e&&!h&&o.jsxs(Ne,{type:"button",variant:"ghost",size:"sm",disabled:G||q||!!X,onClick:()=>void B(),children:[o.jsx(Xw,{}),x("editor.reset")]})]})]}),X&&o.jsx(sq,{plan:X,busy:G,onCancel:()=>$(null),onConfirm:()=>void W()}),M.length>6&&o.jsxs("div",{className:"jv-models-filter",children:[o.jsxs("label",{className:"jv-search",children:[o.jsx(ys,{}),o.jsx("input",{"aria-label":x("editor.filter"),placeholder:x("editor.filterPlaceholder"),value:R,onChange:oe=>I(oe.target.value)})]}),o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",onClick:()=>C(oe=>oe.map(Ee=>me.includes(Ee)?{...Ee,selected:!0}:Ee)),children:x("editor.selectVisible")})]}),q&&!h&&o.jsx("p",{role:"status",className:"jv-hint",children:x("editor.loadingCatalog")}),o.jsx("div",{className:"jv-model-cards",children:me.map(oe=>o.jsx(rq,{draft:oe,protocol:k,onAutoconfig:Ee=>void le([oe.key],Ee),onChange:Ee=>C(Xe=>Xe.map(Be=>Be.key===oe.key?Ee:Be)),onRemove:()=>{oe.originalId&&_(Ee=>[...Ee,oe.originalId]),C(Ee=>Ee.filter(Xe=>Xe.key!==oe.key))}},oe.key))}),!q&&!M.length&&o.jsxs("div",{className:"jv-empty",children:[o.jsx("strong",{children:x("editor.empty")}),o.jsx("span",{children:x(h?"editor.emptyCustom":"editor.emptyBuiltin")})]})]})]}),o.jsxs("footer",{className:"jv-editor-footer",children:[o.jsx("div",{"aria-live":"polite",children:Y?o.jsx("p",{role:"alert",children:Y}):U?o.jsx("p",{role:"status",children:U}):null}),o.jsx(Ne,{type:"submit",className:"jv-primary",disabled:G||q||xe,children:x(G?"editor.saving":"editor.save")})]})]})}function sq({plan:e,busy:a,onCancel:i,onConfirm:r}){const s=[...new Set(e.removed.flatMap(d=>d.bots))],c=x("common.listSeparator");return o.jsxs("div",{className:"jv-reset-confirm",role:"group","aria-label":x("editor.resetTitle"),children:[o.jsx("strong",{children:x("editor.resetTitle")}),e.reset.length>0&&o.jsx("p",{children:x("editor.resetModels",{count:e.reset.length})}),e.removed.length>0&&o.jsx("p",{children:x("editor.resetRemoves",{count:e.removed.length,names:e.removed.map(d=>d.name||d.id).join(c)})}),s.length>0&&o.jsx("p",{className:"jv-reset-bots",children:x("editor.resetBots",{count:s.length,bots:s.join(c)})}),o.jsx("p",{children:x("editor.resetKeeps")}),o.jsxs("div",{className:"jv-reset-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",onClick:i,children:x("common.cancel")}),o.jsx(Ne,{type:"button",className:"jv-primary",size:"sm",disabled:a,onClick:r,children:x("editor.resetConfirm")})]})]})}function cq({connections:e,onChanged:a}){const[i,r]=w.useState("list"),[s,c]=w.useState(),[d,f]=w.useState(),[h,p]=w.useState(0),y=()=>{r("list"),f(void 0),c(void 0),p(0)},g=j=>SS({authType:j.authType,custom:j.kind==="custom"});let b=(s==null?void 0:s.name)??"";if(s){let j=2;for(;e.some(k=>k.displayName===b);)b=`${s.name} ${j++}`}return i==="choose"?o.jsx(YH,{onBack:y,onSelect:j=>{c(j),f(void 0),r("editor")}}):i==="editor"?o.jsx(oq,{connection:e.find(j=>j.id===d),preset:s,defaultName:b,saved:h>0,onBack:y,onChanged:a,onConnected:async j=>{await a(),f(j),c(void 0)},onSaved:async j=>{await a(),f(j),c(void 0),p(k=>k+1)}},h):o.jsxs("div",{className:"jv-page",children:[o.jsxs("header",{className:"jv-page-header",children:[o.jsx("h2",{children:x("settings.models")}),o.jsxs(Ne,{className:"jv-primary",onClick:()=>r("choose"),children:[o.jsx(xr,{}),x("models.add")]})]}),!e.length&&o.jsx("div",{className:"jv-empty",children:o.jsx("strong",{children:x("models.empty")})}),kS.filter(j=>e.some(k=>g(k)===j.id)).map(({id:j,label:k})=>o.jsxs("section",{className:"jv-section","aria-label":x(k),children:[o.jsx("h3",{className:"jv-section-title",children:x(k)}),o.jsx("div",{className:"jv-list",children:e.filter(S=>g(S)===j).map(S=>{const N=wS(S);return o.jsxs("button",{type:"button",className:"jv-list-row",onClick:()=>{f(S.id),c(void 0),r("editor")},children:[o.jsx($g,{name:S.displayName,provider:S.kind==="builtin"?S.providerName:void 0}),o.jsxs("span",{className:"jv-row-text",children:[o.jsx("strong",{children:S.displayName}),o.jsx("span",{children:S.models.length?x("models.count",{count:S.models.length}):x("models.none")})]}),o.jsx("span",{className:"jv-status","data-ok":N.ok||void 0,children:N.label}),o.jsx(ml,{className:"jv-row-chevron"})]},S.id)})})]},j))]})}function uq({info:e,onSaved:a}){const[i,r]=w.useState(String(e.ports.from)),[s,c]=w.useState(String(e.ports.to)),[d,f]=w.useState(null),[h,p]=w.useState(!1),y=i!==String(e.ports.from)||s!==String(e.ports.to),g=async b=>{b.preventDefault(),p(!0),f(null);try{const j=await he.setPortRange({from:Number(i),to:Number(s)});a(j),r(String(j.ports.from)),c(String(j.ports.to)),f({error:!1,text:x("ports.rangeSaved")})}catch(j){f({error:!0,text:en(j)})}finally{p(!1)}};return o.jsxs("section",{className:"jv-section","aria-labelledby":"network-ports",children:[o.jsx("h3",{id:"network-ports",className:"jv-section-title",children:x("ports.range")}),o.jsxs("form",{className:"jv-panel jv-conn-ports",onSubmit:b=>void g(b),children:[o.jsxs("div",{className:"jv-conn-range",children:[o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:x("ports.rangeFrom")}),o.jsx(xt,{type:"number",inputMode:"numeric",min:1024,max:65535,required:!0,value:i,onChange:b=>{r(b.target.value),f(null)}})]}),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:x("ports.rangeTo")}),o.jsx(xt,{type:"number",inputMode:"numeric",min:1024,max:65535,required:!0,value:s,onChange:b=>{c(b.target.value),f(null)}})]})]}),o.jsx("small",{className:"jv-hint",children:x("ports.rangeHint")}),o.jsxs("div",{className:"jv-form-footer",children:[d?o.jsx("p",{className:d.error?"jv-note-error":"jv-hint",role:d.error?"alert":"status",children:d.text}):o.jsx("span",{}),o.jsx(Ne,{type:"submit",className:"jv-primary",disabled:h||!y,children:x("common.save")})]})]})]})}function dq(){var b;const[e,a]=w.useState(null),[i,r]=w.useState(null),[s,c]=w.useState(!1),[d,f]=w.useState(!1),[h,p]=w.useState(!1);w.useEffect(()=>{he.connection().then(a).catch(()=>p(!0))},[]);const y=j=>o.jsxs("div",{className:"jv-page",children:[o.jsx("header",{className:"jv-page-header",children:o.jsx("h2",{children:x("settings.network")})}),o.jsxs("section",{className:"jv-section","aria-labelledby":"network-lan",children:[o.jsx("h3",{id:"network-lan",className:"jv-section-title",children:x("connection.lan")}),j]}),h&&o.jsx("p",{className:"jv-note-error",role:"alert",children:x("common.failed")}),e&&o.jsx(uq,{info:e,onSaved:a})]});if(!e)return y(null);if(!e.https)return y(o.jsx("div",{className:"jv-list",children:o.jsx("div",{className:"jv-list-row jv-static-row jv-conn-local",children:o.jsxs("span",{className:"jv-row-text",children:[o.jsx("strong",{children:x("connection.localOnly")}),o.jsx("span",{children:_0("connection.localOnlyHint",{flag:o.jsx("code",{children:"--host 0.0.0.0"})})})]})})}));const g=async()=>{f(!0),p(!1);try{a(await he.setConnection(!e.allowHttp))}catch{p(!0)}finally{f(!1)}};return y(o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"jv-list",role:"group","aria-label":x("connection.addresses"),children:e.addresses.map(j=>o.jsxs("div",{className:"jv-list-row jv-static-row",children:[o.jsx("span",{className:"jv-row-text",children:o.jsx("code",{children:j})}),o.jsx(Ne,{type:"button",variant:"ghost",size:"icon-sm","aria-label":x(i===j?"ui.copied":"connection.copy"),onClick:()=>void Ns(j).then(k=>r(k?j:null)),children:i===j?o.jsx(ma,{}):o.jsx(Pc,{})})]},j))}),o.jsxs("div",{className:"jv-list jv-conn-cert",children:[o.jsxs("div",{className:"jv-list-row jv-static-row jv-conn-root",children:[o.jsx("span",{className:"jv-row-text",children:o.jsx("strong",{children:x("connection.root")})}),o.jsx(Ne,{asChild:!0,variant:"outline",size:"sm",children:o.jsxs("a",{href:"/api/connection/root.crt",children:[o.jsx(O0,{}),x("connection.download")]})})]}),o.jsxs("div",{className:"jv-list-row jv-static-row jv-conn-print",children:[o.jsx("span",{children:x("connection.fingerprint")}),o.jsx("code",{children:(b=e.fingerprint)==null?void 0:b.replaceAll(":",":​")}),e.fingerprintSha1&&o.jsxs(o.Fragment,{children:[o.jsx("span",{children:x("connection.fingerprintSha1")}),o.jsx("code",{children:e.fingerprintSha1.replaceAll(":",":​")})]})]}),o.jsxs("button",{type:"button",className:"jv-list-row jv-conn-disclosure","aria-expanded":s,onClick:()=>c(!s),children:[o.jsx("span",{className:"jv-row-text",children:o.jsx("strong",{children:x("connection.howTo")})}),o.jsx(cl,{"aria-hidden":"true"})]}),s&&o.jsx("div",{className:"jv-list-row jv-static-row jv-conn-steps",children:o.jsxs("ul",{children:[o.jsx("li",{children:x("connection.howMac")}),o.jsx("li",{children:x("connection.howWindows")}),o.jsx("li",{children:x("connection.howIos")}),o.jsx("li",{children:x("connection.howAndroid")}),o.jsx("li",{children:x("connection.howRestart")})]})})]}),o.jsx("div",{className:"jv-list",children:o.jsxs("button",{type:"button",role:"switch","aria-checked":e.allowHttp,disabled:d,className:"jv-list-row jv-choice-row jv-conn-http",onClick:()=>void g(),children:[o.jsxs("span",{className:"jv-row-text",children:[o.jsx("strong",{children:x("connection.allowHttp")}),o.jsx("span",{children:x("connection.allowHttpHint")})]}),o.jsx("span",{className:"jv-conn-switch","aria-hidden":"true"})]})})]}))}function Cf({value:e,visible:a,onChange:i,onVisible:r,placeholder:s,required:c,warnShort:d=!0}){return o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"jv-secret-input",children:[o.jsx(xt,{type:a?"text":"password",autoComplete:"new-password",spellCheck:!1,required:c,className:"jv-mono",placeholder:s,value:e,onChange:f=>i(f.target.value)}),o.jsx(Ne,{type:"button",variant:"ghost",size:"icon-sm","aria-label":x(a?"secrets.hideValue":"secrets.showValue"),onClick:()=>r(!a),children:a?o.jsx(D0,{}):o.jsx(z0,{})})]}),d&&e.length>0&&e.length<8&&o.jsx("span",{className:"jv-field-hint jv-secret-short",children:x("secrets.shortValue")})]})}function fq({secret:e,bots:a,onChanged:i}){return o.jsx(MS,{grantedIds:e.grants.map(r=>r.botId),onceIds:new Set(e.grants.filter(r=>r.scope==="once").map(r=>r.botId)),bots:a,onGrant:async(r,s)=>{let c=e;for(const d of r)c=await he.grantSecret(e.id,d,s);i(c)}})}function MS({grantedIds:e,onceIds:a,bots:i,onGrant:r}){const[s,c]=w.useState(!1),[d,f]=w.useState(""),[h,p]=w.useState([]),{busy:y,error:g,run:b}=xn(),j=e.map(_=>i.find(R=>R.id===_)).filter(_=>!!_),k=a??new Set,S=i.filter(_=>!e.includes(_.id)),N=S.filter(_=>_.name.toLowerCase().includes(d.trim().toLowerCase())),E=()=>{c(!1),f(""),p([])},M=_=>p(R=>R.includes(_)?R.filter(I=>I!==_):[...R,_]),C=_=>b("grant",_),A=()=>C(async()=>{await r(h,!0),E()});return o.jsxs("section",{className:"jv-secret-grants","aria-label":x("secrets.grants"),children:[o.jsxs("div",{className:"jv-secret-grants-head",children:[o.jsxs("h4",{className:"jv-secret-heading",children:[x("secrets.grants"),j.length>0&&o.jsxs("span",{children:[" · ",j.length]})]}),!s&&o.jsxs(Ne,{type:"button",variant:"outline",size:"sm",disabled:y,onClick:()=>c(!0),children:[o.jsx(xr,{}),x("secrets.addBots")]})]}),j.length>0?o.jsx("ul",{className:"jv-secret-granted",children:j.map(_=>o.jsxs("li",{children:[o.jsx(hl,{color:_.color,mood:_.mood,size:20,crown:_.agent}),o.jsx("span",{className:"jv-secret-bot-name",children:_.name}),k.has(_.id)&&o.jsx("span",{className:"jv-secret-once",children:x("secrets.onceTag")}),o.jsx(Ne,{type:"button",variant:"ghost",size:"icon-sm",className:"jv-secret-revoke",disabled:y,"aria-label":x("secrets.revoke",{name:_.name}),onClick:()=>void C(()=>r([_.id],!1)),children:o.jsx(xs,{})})]},_.id))}):!s&&o.jsx("p",{className:"jv-hint",children:x("secrets.noGrants")}),s&&o.jsxs("div",{className:"jv-secret-picker",children:[o.jsx(xt,{type:"search",autoFocus:!0,value:d,placeholder:x("secrets.searchBots"),"aria-label":x("secrets.searchBots"),onChange:_=>f(_.target.value),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),N.length===1&&M(N[0].id))}}),o.jsxs("div",{className:"jv-secret-options",role:"listbox","aria-multiselectable":"true","aria-label":x("secrets.addBots"),children:[N.map(_=>o.jsxs("button",{type:"button",role:"option","aria-selected":h.includes(_.id),className:"jv-secret-option",onClick:()=>M(_.id),children:[o.jsx(hl,{color:_.color,mood:_.mood,size:24,crown:_.agent}),o.jsx("span",{className:"jv-secret-bot-name",children:_.name}),h.includes(_.id)&&o.jsx(ma,{"aria-hidden":"true"})]},_.id)),N.length===0&&o.jsx("p",{className:"jv-hint",children:x(i.length?S.length?"secrets.noMatch":"secrets.allGranted":"secrets.noBots")})]}),o.jsxs("div",{className:"jv-secret-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",onClick:E,children:x("common.cancel")}),o.jsx(Ne,{type:"button",className:"jv-primary",size:"sm",disabled:y||!h.length,onClick:()=>void A(),children:h.length?x("dialogs.addCount",{count:h.length}):x("common.add")})]})]}),g&&o.jsx("p",{className:"jv-note-error",role:"alert",children:g})]})}function _S({id:e,open:a,onToggle:i,text:r,meta:s,busy:c,error:d,remove:f,confirming:h,onAskRemove:p,onCancel:y,onConfirm:g,children:b}){return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:"jv-list-row jv-secret-row","aria-expanded":a,"aria-controls":e,onClick:i,children:[o.jsx("span",{className:"jv-row-text",children:r}),s,o.jsx(cl,{className:"jv-row-chevron","aria-hidden":"true"})]}),a&&o.jsxs("div",{id:e,className:"jv-list-row jv-static-row jv-secret-details",children:[b,h?o.jsxs("div",{className:"jv-secret-confirm",role:"group","aria-label":h.title,children:[o.jsx("strong",{children:h.title}),o.jsx("p",{children:h.body}),o.jsxs("div",{className:"jv-secret-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",onClick:y,children:x("common.cancel")}),o.jsx(Ne,{type:"button",className:"jv-primary",size:"sm",disabled:c,onClick:g,children:h.confirm})]})]}):o.jsx("div",{className:"jv-secret-actions jv-secret-danger",children:o.jsx(Ne,{type:"button",variant:"ghost",size:"sm",disabled:c,onClick:p,children:f})}),d&&o.jsx("p",{className:"jv-note-error",role:"alert",children:d})]})]})}const vj=e=>na(e,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});function hq({secret:e,bots:a,open:i,onToggle:r,onChanged:s,onDeleted:c}){const[d,f]=w.useState(null),[h,p]=w.useState(e.description),[y,g]=w.useState(""),[b,j]=w.useState(!1),[k,S]=w.useState(!1),{busy:N,error:E,run:M}=xn();w.useEffect(()=>{i&&he.secretUses(e.id).then(I=>f(I.uses)).catch(()=>f([]))},[i,e.id,e.uses]);const C=I=>{I.preventDefault(),M("save",async()=>{s(await he.updateSecret(e.id,{description:h.trim(),...y?{value:y}:{}})),g(""),j(!1)})},A=new Set(e.grants.map(I=>I.botId)),_=I=>{var G;return((G=a.find(Y=>Y.id===I))==null?void 0:G.name)??x("secrets.deletedBot")},R=h.trim()!==e.description||!!y;return o.jsxs(_S,{id:`secret-${e.id}`,open:i,onToggle:r,busy:N,error:E,text:o.jsxs(o.Fragment,{children:[o.jsx("strong",{className:"jv-mono",children:e.name}),o.jsx("span",{children:e.description||x("secrets.noDescription")})]}),meta:e.readable?o.jsx("span",{className:"jv-row-meta",children:A.size?x("secrets.grantCount",{count:A.size}):x("secrets.notGranted")}):o.jsx("span",{className:"jv-status","data-busy":"",children:x("secrets.unreadable")}),remove:x("secrets.delete"),confirming:k?{title:x("secrets.deleteTitle",{name:e.name}),body:x("secrets.deleteBody"),confirm:x("secrets.deleteConfirm")}:null,onAskRemove:()=>S(!0),onCancel:()=>S(!1),onConfirm:()=>void M("delete",async()=>{await he.deleteSecret(e.id),c()}),children:[o.jsxs("p",{className:"jv-secret-meta",children:[x("secrets.fingerprint")," ",o.jsx("code",{children:e.fingerprint})," · ",x("secrets.updated",{time:vj(e.updatedAt)})," · ",e.uses?x("secrets.usedCount",{count:e.uses}):x("secrets.neverUsed")]}),!e.readable&&o.jsx("p",{className:"jv-note-error",children:x("secrets.unreadableHint")}),o.jsx(fq,{secret:e,bots:a,onChanged:s}),o.jsxs("form",{className:"jv-secret-edit",onSubmit:C,"aria-label":x("secrets.edit"),children:[o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:x("secrets.description")}),o.jsx(xt,{maxLength:200,placeholder:x("secrets.descriptionPlaceholder"),value:h,onChange:I=>p(I.target.value)})]}),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:x("secrets.newValue")}),o.jsx(Cf,{value:y,visible:b,onChange:g,onVisible:j,placeholder:x("secrets.newValuePlaceholder")})]}),o.jsx("div",{className:"jv-secret-actions",children:o.jsx(Ne,{type:"submit",variant:"outline",size:"sm",disabled:N||!R,children:x("common.save")})})]}),o.jsx("h4",{className:"jv-secret-heading",children:x("secrets.uses")}),d&&d.length?o.jsx("ul",{className:"jv-secret-uses",children:d.map(I=>o.jsxs("li",{children:[o.jsxs("span",{children:[_(I.botId)," · ",vj(I.at)," · ",x(I.how==="ssh_sign"?"secrets.useSsh":"secrets.useCommand")]}),I.detail&&o.jsx("code",{children:I.detail})]},I.id))}):o.jsx("p",{className:"jv-hint",children:x("secrets.noUses")})]})}const yj=(e,a)=>e.name.localeCompare(a.name);function mq(){const[e,a]=w.useState(null),[i,r]=w.useState(""),[s,c]=w.useState([]),[d,f]=w.useState(!1),[h,p]=w.useState(null),[y,g]=w.useState(null);w.useEffect(()=>{he.secrets().then(j=>{a([...j.secrets].sort(yj)),r(j.keyLocation)}).catch(j=>g(en(j))),he.bots().then(j=>c(j.bots)).catch(()=>c([]))},[]);const b=j=>a(k=>k&&k.map(S=>S.id===j.id?j:S));return o.jsxs("div",{className:"jv-page",children:[o.jsxs("header",{className:"jv-page-header",children:[o.jsx("h2",{children:x("settings.secrets")}),!d&&o.jsxs(Ne,{className:"jv-primary",onClick:()=>f(!0),children:[o.jsx(xr,{}),x("secrets.add")]})]}),d&&o.jsx(pq,{onCancel:()=>f(!1),onSaved:j=>{f(!1),a(k=>[...k??[],j].sort(yj)),p(j.id)}}),e&&!e.length&&!d&&o.jsx("div",{className:"jv-empty",children:o.jsx("strong",{children:x("secrets.empty")})}),e&&e.length>0&&o.jsx("section",{className:"jv-section","aria-label":x("settings.secrets"),children:o.jsx("div",{className:"jv-list",children:e.map(j=>o.jsx(hq,{secret:j,bots:s,open:h===j.id,onToggle:()=>p(h===j.id?null:j.id),onChanged:b,onDeleted:()=>{p(null),a(k=>k&&k.filter(S=>S.id!==j.id))}},j.id))})}),i&&o.jsxs("section",{className:"jv-section","aria-labelledby":"secrets-key",children:[o.jsx("h3",{id:"secrets-key",className:"jv-section-title",children:x("secrets.masterKey")}),o.jsx("div",{className:"jv-list",children:o.jsx("div",{className:"jv-list-row jv-static-row jv-secret-key",children:o.jsxs("span",{className:"jv-row-text",children:[o.jsx("strong",{children:x("secrets.keyFile")}),o.jsx("code",{children:i}),o.jsx("span",{children:x("secrets.keyHint")})]})})})]}),y&&o.jsx("p",{className:"jv-note-error",role:"alert",children:y})]})}function pq({onCancel:e,onSaved:a}){const[i,r]=w.useState(""),[s,c]=w.useState(""),[d,f]=w.useState(""),[h,p]=w.useState(!1),{busy:y,error:g,run:b}=xn(),j=async k=>{k.preventDefault(),await b("add",async()=>a(await he.createSecret({name:i.trim(),description:s.trim(),value:d})))};return o.jsxs("form",{className:"jv-panel jv-secret-form",onSubmit:k=>void j(k),"aria-label":x("secrets.add"),children:[o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:x("secrets.name")}),o.jsx(xt,{className:"jv-mono",required:!0,autoFocus:!0,maxLength:64,placeholder:"GITHUB_TOKEN",value:i,onChange:k=>r(k.target.value.toUpperCase())})]}),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:x("secrets.description")}),o.jsx(xt,{maxLength:200,placeholder:x("secrets.descriptionPlaceholder"),value:s,onChange:k=>c(k.target.value)})]}),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:x("secrets.value")}),o.jsx(Cf,{value:d,visible:h,onChange:f,onVisible:p,required:!0})]}),g&&o.jsx("p",{className:"jv-note-error",role:"alert",children:g}),o.jsxs("div",{className:"jv-secret-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",onClick:e,children:x("common.cancel")}),o.jsx(Ne,{type:"submit",className:"jv-primary",disabled:y||!i.trim()||!d,children:x("common.save")})]})]})}function gq({machine:e,bots:a,open:i,onToggle:r,onChanged:s,onDeleted:c}){const[d,f]=w.useState(e.name),[h,p]=w.useState(e.directory),[y,g]=w.useState(e.description),[b,j]=w.useState(null),[k,S]=w.useState(null),{busy:N,doing:E,error:M,setError:C,run:A}=xn(),[_,R]=w.useState(""),[I,G]=w.useState(!1),[Y,L]=w.useState(null),P=`${e.user}@${e.host}${e.port===22?"":`:${e.port}`}`,q=X=>{X.preventDefault(),A("save",async()=>{const $=await he.updateMachine(e.id,{name:d.trim(),directory:h.trim(),description:y.trim()});s($),f($.name),p($.directory),g($.description)})},Z=X=>void A("delete",async()=>{try{await he.deleteMachine(e.id,X),c()}catch($){throw!X&&$ instanceof qi&&$.code!=="machine_missing"&&S("force"),$}}),U=d.trim()!==e.name||h.trim()!==e.directory||y.trim()!==e.description,F=k==="force";return o.jsxs(_S,{id:`machine-${e.id}`,open:i,onToggle:r,busy:N,error:M,text:o.jsxs(o.Fragment,{children:[o.jsx("strong",{children:e.name}),o.jsx("span",{className:"jv-mono",children:P})]}),meta:o.jsx("span",{className:"jv-row-meta",children:e.botIds.length?x("secrets.grantCount",{count:e.botIds.length}):x("secrets.notGranted")}),remove:x("machines.delete"),confirming:k&&{title:x(F?"machines.forceTitle":"machines.deleteTitle",{name:e.name}),body:F?x("machines.forceBody",{comment:`jarvy-${e.id}`}):x("machines.deleteBody"),confirm:x(F?"machines.forceConfirm":"machines.deleteConfirm")},onAskRemove:()=>S("delete"),onCancel:()=>{S(null),C("")},onConfirm:()=>Z(F),children:[o.jsxs("form",{className:"jv-secret-edit jv-machine-edit",onSubmit:q,"aria-label":e.name,children:[o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:x("machines.name")}),o.jsx(xt,{required:!0,maxLength:40,value:d,onChange:X=>f(X.target.value)})]}),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:x("machines.directory")}),o.jsx(xt,{className:"jv-mono",required:!0,maxLength:1e3,spellCheck:!1,value:h,onChange:X=>p(X.target.value)})]}),o.jsxs("label",{className:"jv-field jv-machine-description",children:[o.jsx("span",{children:x("machines.description")}),o.jsx(vs,{maxLength:2e3,rows:3,placeholder:x("machines.descriptionPlaceholder"),value:y,onChange:X=>g(X.target.value)})]}),o.jsx("div",{className:"jv-secret-actions",children:o.jsx(Ne,{type:"submit",variant:"outline",size:"sm",disabled:N||!U||!d.trim(),children:x("common.save")})})]}),o.jsxs("div",{className:"jv-machine-part",children:[o.jsxs("section",{className:"jv-secret-grants","aria-label":x("machines.fingerprint"),children:[o.jsx("h4",{className:"jv-secret-heading",children:x("machines.fingerprint")}),o.jsxs("div",{className:"jv-machine-key jv-machine-fingerprint",children:[o.jsx("div",{className:"jv-machine-codes",children:(b!=null&&b.changed?b.hostKeys.fingerprints:e.fingerprints).map(X=>o.jsx("code",{"data-new":(b==null?void 0:b.changed)||void 0,children:X},X))}),b!=null&&b.changed?o.jsx("button",{type:"button",className:"ui-button jv-machine-copy",disabled:N,onClick:()=>void A("trust",async()=>{s(await he.trustMachine(e.id,b.hostKeys.fingerprints)),j(null)}),children:x("machines.trust")}):o.jsx("button",{type:"button",className:"ui-button jv-machine-copy",disabled:N,onClick:()=>void A("check",async()=>{const X=await he.checkMachine(e.id);j(X),s(X.machine)}),children:x(E==="check"?"machines.checking":"machines.check")})]}),b&&o.jsx("p",{className:"jv-hint","data-warn":b.changed||void 0,children:x(b.changed?"machines.changed":"machines.unchanged")})]}),o.jsxs("section",{className:"jv-secret-grants","aria-label":x("machines.login"),children:[o.jsxs("div",{className:"jv-secret-grants-head",children:[o.jsx("h4",{className:"jv-secret-heading",children:x("machines.login")}),o.jsx("span",{className:"jv-row-meta",children:x(e.login==="password"?"machines.loginPassword":"machines.loginKey")})]}),e.publicKey&&o.jsx(Hg,{publicKey:e.publicKey}),e.login==="password"&&o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"jv-hint",children:x("machines.passwordLogin")}),o.jsxs("form",{className:"jv-machine-password",autoComplete:"off","aria-label":x("machines.updatePassword"),onSubmit:X=>{X.preventDefault(),A("password",async()=>{s(await he.setMachinePassword(e.id,_)),R(""),L(x("machines.passwordUpdated"))})},children:[o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:x("machines.newPassword")}),o.jsx(Cf,{value:_,visible:I,onChange:R,onVisible:G,required:!0,warnShort:!1})]}),o.jsxs("div",{className:"jv-secret-actions",children:[o.jsx(Ne,{type:"button",variant:"outline",size:"sm",disabled:N,onClick:()=>void A("key",async()=>{const X=await he.checkMachine(e.id);j(X),s(X.machine),L(x(X.machine.login==="key"?"machines.usingKey":"machines.stillPassword"))}),children:x("machines.useKey")}),o.jsx(Ne,{type:"submit",variant:"outline",size:"sm",disabled:N||!_,children:x("machines.updatePassword")})]})]})]}),Y&&o.jsx("p",{className:"jv-hint",children:Y})]})]}),o.jsx("div",{className:"jv-machine-part",children:o.jsx(MS,{grantedIds:e.botIds,bots:a,onGrant:async(X,$)=>{let H=e;for(const ie of X)H=await he.grantMachine(e.id,ie,$);s(H)}})})]})}function vq({adding:e=!1}){const[a,i]=w.useState(null),[r,s]=w.useState([]),[c,d]=w.useState(e),[f,h]=w.useState(null),[p,y]=w.useState(null);w.useEffect(()=>{he.machines().then(b=>i(b.machines)).catch(b=>y(en(b))),he.bots().then(b=>s(b.bots)).catch(()=>s([]))},[]);const g=b=>i(j=>j&&j.map(k=>k.id===b.id?b:k));return o.jsxs("div",{className:"jv-page",children:[o.jsxs("header",{className:"jv-page-header",children:[o.jsx("h2",{children:x("settings.machines")}),!c&&o.jsxs(Ne,{className:"jv-primary",onClick:()=>d(!0),children:[o.jsx(xr,{}),x("machines.add")]})]}),c&&o.jsx(yq,{onCancel:()=>d(!1),onSaved:b=>{d(!1),i(j=>[...j??[],b]),h(b.id)}}),a&&!a.length&&!c&&o.jsx("div",{className:"jv-empty",children:o.jsx("strong",{children:x("machines.empty")})}),a&&a.length>0&&o.jsx("section",{className:"jv-section","aria-label":x("settings.machines"),children:o.jsx("div",{className:"jv-list",children:a.map(b=>o.jsx(gq,{machine:b,bots:r,open:f===b.id,onToggle:()=>h(f===b.id?null:b.id),onChanged:g,onDeleted:()=>{h(null),i(j=>j&&j.filter(k=>k.id!==b.id))}},b.id))})}),p&&o.jsx("p",{className:"jv-note-error",role:"alert",children:p})]})}function yq({onCancel:e,onSaved:a}){const[i,r]=w.useState(""),[s,c]=w.useState("22"),[d,f]=w.useState(""),[h,p]=w.useState(""),[y,g]=w.useState(""),[b,j]=w.useState(""),[k,S]=w.useState(null),[N,E]=w.useState(""),[M,C]=w.useState(!1),[A,_]=w.useState("password"),{busy:R,error:I,setError:G,run:Y}=xn(),L=B5(!!k&&A==="key"),P={host:i.trim(),port:Number(s)||22,user:d.trim()},q=F=>Y("add",async()=>{try{await F()}catch(X){throw X instanceof qi&&X.code==="ssh_key_expired"&&L.renew(),X}}),Z=F=>{F.preventDefault(),q(k?async()=>a(await he.addMachine({...P,name:h.trim(),directory:y.trim(),description:b.trim(),hostKeys:k,...A==="key"?{keyId:L.key.keyId}:{password:N}})):async()=>S(await he.scanMachine(P)))},U=P.user&&P.host?`${P.user}@${P.host}`:"";return o.jsxs("form",{className:"jv-panel jv-machine-form",autoComplete:"off",onSubmit:Z,"aria-label":x("machines.add"),"aria-busy":R||void 0,children:[k?o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"jv-machine-where",children:[h.trim()&&o.jsx("strong",{children:h.trim()}),o.jsxs("code",{children:[P.user,"@",P.host,P.port===22?"":`:${P.port}`]})]}),o.jsxs("div",{className:"jv-field",children:[o.jsx("span",{children:x("machines.fingerprint")}),o.jsx("div",{className:"jv-machine-prints",children:k.fingerprints.map(F=>o.jsx("code",{children:F},F))}),o.jsx("span",{className:"jv-field-hint",children:x("machines.fingerprintHint")})]}),o.jsx("div",{className:"jv-seg jv-machine-login",role:"radiogroup","aria-label":x("machines.login"),children:["password","key"].map(F=>o.jsx("button",{type:"button",role:"radio","aria-checked":A===F,disabled:R,onClick:()=>{_(F),G("")},children:x(F==="password"?"machines.byPassword":"machines.byKey")},F))}),A==="password"?o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:x("machines.password")}),o.jsx(Cf,{value:N,visible:M,onChange:E,onVisible:C,required:!0,warnShort:!1}),o.jsx("span",{className:"jv-field-hint",children:x("machines.passwordHint")})]}):o.jsxs("div",{className:"jv-field",children:[o.jsx("span",{children:x("machines.publicKey")}),L.key?o.jsx(Hg,{publicKey:L.key.publicKey}):L.error?o.jsx("p",{className:"jv-note-error",role:"alert",children:L.error}):o.jsx("p",{className:"jv-hint",children:"…"}),o.jsx("span",{className:"jv-field-hint",children:x("machines.keyHint",{user:P.user})})]})]}):o.jsxs("div",{className:"jv-machine-fields",children:[o.jsxs("div",{className:"jv-machine-address",children:[o.jsxs("label",{className:"jv-field jv-machine-host",children:[o.jsx("span",{children:x("machines.host")}),o.jsx(xt,{required:!0,autoFocus:!0,maxLength:253,spellCheck:!1,placeholder:x("machines.hostPlaceholder"),value:i,onChange:F=>r(F.target.value)})]}),o.jsxs("label",{className:"jv-field jv-machine-port",children:[o.jsx("span",{children:x("machines.port")}),o.jsx(xt,{required:!0,inputMode:"numeric",maxLength:5,value:s,onChange:F=>c(F.target.value.replace(/\D/g,""))})]})]}),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:x("machines.user")}),o.jsx(xt,{required:!0,maxLength:64,spellCheck:!1,autoCapitalize:"off",value:d,onChange:F=>f(F.target.value)})]}),o.jsxs("label",{className:"jv-field",children:[o.jsx("span",{children:x("machines.name")}),o.jsx(xt,{maxLength:40,placeholder:U,value:h,onChange:F=>p(F.target.value)})]}),o.jsxs("label",{className:"jv-field jv-machine-wide",children:[o.jsx("span",{children:x("machines.directory")}),o.jsx(xt,{className:"jv-mono",maxLength:1e3,spellCheck:!1,placeholder:x("machines.directoryPlaceholder"),value:y,onChange:F=>g(F.target.value)})]}),o.jsxs("label",{className:"jv-field jv-machine-wide",children:[o.jsx("span",{children:x("machines.description")}),o.jsx(vs,{maxLength:2e3,rows:3,placeholder:x("machines.descriptionPlaceholder"),value:b,onChange:F=>j(F.target.value)})]})]}),I&&o.jsx("p",{className:"jv-note-error",role:"alert",children:I}),o.jsxs("div",{className:"jv-secret-actions",children:[o.jsx(Ne,{type:"button",variant:"ghost",disabled:R,onClick:()=>{k?(S(null),E(""),G("")):e()},children:x(k?"machines.back":"common.cancel")}),o.jsx(Ne,{type:"submit",className:"jv-primary",disabled:R||!P.host||!P.user||!!k&&(A==="key"?!L.key:!N),children:x(k?A==="key"?R?"machines.verifying":"machines.verify":R?"machines.connecting":"machines.connect":R?"machines.scanning":"machines.next")})]})]})}const xj=[["calls","usage.calls"],["input","usage.input"],["output","usage.output"]];function xq({bots:e}){const{range:a,setRange:i,data:r,error:s,reload:c}=d5(u5.overview,"all");return o.jsxs("div",{className:"jv-page jv-usage-page",children:[o.jsx("header",{className:"jv-page-header",children:o.jsx("h2",{children:x("settings.usage")})}),o.jsxs("div",{className:"jv-usage",children:[o.jsx(f5,{range:a,setRange:i,busy:!r&&!s,reload:c}),o.jsx(h5,{loading:!r,error:s,empty:!(r!=null&&r.models.length),reload:c}),r&&r.models.length>0&&!s&&o.jsxs(o.Fragment,{children:[o.jsxs("section",{className:"jv-section","aria-labelledby":"usage-models",children:[o.jsx("h3",{id:"usage-models",className:"jv-section-title",children:x("usage.byModel")}),o.jsx(m5,{models:r.models,note:!1})]}),o.jsxs("section",{className:"jv-section","aria-labelledby":"usage-bots",children:[o.jsx("h3",{id:"usage-bots",className:"jv-section-title",children:x("usage.byBot")}),o.jsx(bq,{rows:r.bots,bots:e})]}),r.models.some(d=>d.cost===null)&&r.models.some(d=>d.cost!==null)&&o.jsx("p",{className:"jv-usage-note",children:x("usage.noteCosts")})]})]})]})}function bq({rows:e,bots:a}){return o.jsxs("table",{className:"jv-usage-table jv-usage-bots",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"col",children:"Bot"}),xj.map(([i,r])=>o.jsx("th",{scope:"col",children:x(r)},i)),o.jsx("th",{scope:"col",children:x("usage.cost")})]})}),o.jsx("tbody",{children:e.map(i=>{const r=a.find(s=>s.id===i.botId);return o.jsxs("tr",{children:[o.jsx("th",{scope:"row",children:o.jsxs("span",{className:"jv-usage-bot",children:[r&&o.jsx(hl,{color:r.color,mood:r.mood,size:22}),o.jsx("strong",{children:(r==null?void 0:r.name)??i.botId})]})}),xj.map(([s,c])=>o.jsx("td",{"data-label":x(c),title:mi(i[s]),children:b0(i[s])},s)),j0(i.cost)]},i.botId)})})]})}const jq=[{id:"general",label:"settings.general",icon:J7},{id:"models",label:"settings.models",icon:v7},{id:"usage",label:"settings.usage",icon:m7},{id:"machines",label:"settings.machines",icon:Jw},{id:"secrets",label:"settings.secrets",icon:bw},{id:"network",label:"settings.network",icon:T7},{id:"about",label:"settings.about",icon:L0}];function wq({connections:e,bots:a,onChanged:i,onClose:r,initialTab:s="general"}){const[c,d]=w.useState(s==="addMachine"?"machines":s),f=w.useRef(null);return w.useEffect(()=>{var h;(h=f.current)==null||h.scrollIntoView({block:"nearest",inline:"nearest"})},[c]),o.jsx(b5,{open:!0,onOpenChange:h=>{h||r()},children:o.jsxs(j5,{className:"jv-settings-shell","aria-describedby":void 0,children:[o.jsxs("nav",{className:"jv-settings-nav","aria-label":x("settings.sections"),children:[o.jsx(w5,{className:"jv-settings-title",children:x("settings.title")}),o.jsx("div",{className:"jv-settings-tabs",children:jq.map(h=>o.jsxs("button",{type:"button",ref:c===h.id?f:void 0,className:"jv-nav-item","aria-current":c===h.id?"page":void 0,onClick:()=>d(h.id),children:[o.jsx(h.icon,{}),x(h.label)]},h.id))})]}),o.jsx("main",{className:"jv-settings-content",children:c==="general"?o.jsx(mH,{}):c==="models"?o.jsx(cq,{connections:e,onChanged:i}):c==="usage"?o.jsx(xq,{bots:a}):c==="machines"?o.jsx(vq,{adding:s==="addMachine"}):c==="secrets"?o.jsx(mq,{}):c==="network"?o.jsx(dq,{}):o.jsx(hH,{})})]})})}const bj="Jarvy";let jj=null,Ii=null,Jl=null;function kq(){return document.querySelector('link[rel="icon"][type="image/png"]')}function Sq(e){if(!(Ii!=null&&Ii.complete)||!Ii.naturalWidth)return null;const a=64,i=document.createElement("canvas");i.width=i.height=a;const r=i.getContext("2d");if(!r)return null;r.drawImage(Ii,0,0,a,a);const s=e>9?"9+":String(e),c=s.length>1?21:18;return r.fillStyle="#e5484d",r.beginPath(),r.arc(a-c,c,c,0,Math.PI*2),r.fill(),r.fillStyle="#fff",r.font=`bold ${s.length>1?26:30}px system-ui, sans-serif`,r.textAlign="center",r.textBaseline="middle",r.fillText(s,a-c,c+2),i.toDataURL("image/png")}function wj(e){document.title=e>0?`(${e>99?"99+":e}) ${bj}`:bj;const a=kq();if(!a)return;if(jj??(jj=a.href),Jl??(Jl=document.querySelector('link[rel="icon"][type="image/svg+xml"]')),e<=0){a.href=jj,Jl&&!Jl.isConnected&&document.head.prepend(Jl);return}const i=Sq(e);i&&(a.href=i,Jl==null||Jl.remove())}function Cq(e){w.useEffect(()=>{Ii||(Ii=new Image,Ii.src="/favicon.svg"),Ii.complete?wj(e):Ii.onload=()=>wj(e)},[e])}const Dd=50;function Nq({chatId:e,ready:a,scroller:i,me:r,memory:s,onError:c}){const[d,f]=w.useState([]),[h,p]=w.useState(!1),[y,g]=w.useState(!1),[b,j]=w.useState(!1),k=w.useRef(d),S=w.useRef(e),N=w.useRef(0),E=w.useRef(!1),M=w.useRef(!1),C=w.useRef(0);k.current=d,S.current=e,M.current=y;const A=w.useRef(null),_=w.useRef(!1),R=w.useRef(void 0),I=w.useRef(!0),G=w.useRef(!1),Y=w.useRef(null),[L,P]=w.useState(!1),q=w.useRef(0),Z=w.useRef({bottom:!0}),U=w.useRef(null),[F]=w.useState(()=>new yS);w.useEffect(()=>{if(f([]),g(!1),G.current=!1,I.current=!0,C.current=0,Z.current={bottom:!0},U.current=null,!a||!e)return;let D=!0;const B=++N.current;P(!1),q.current=0;const W=()=>{var me;D=!1,F.release(),G.current&&((me=k.current[0])==null?void 0:me.chatId)===e&&s.keep(e,{messages:k.current,hasOlder:M.current,place:Z.current,seen:q.current})},ue=s.take(e);return ue?(_.current=!0,U.current=ue.place,q.current=ue.seen,f(ue.messages),g(ue.hasOlder),p(!1),W):(p(!0),he.latestMessages(e,Dd).then(me=>{!D||B!==N.current||(_.current=!0,f(me.messages),g(me.hasOlder),p(!1))}).catch(me=>{D&&(p(!1),c(me))}),W)},[e,a]);function X(D,B){var me;if(D.chatId!==S.current)return;if(!B){f(ge=>Qc(ge,D));return}const W=k.current,ue=Math.max(((me=W.at(-1))==null?void 0:me.chatId)===D.chatId?W.at(-1).sequence:0,C.current);if(Vg(D,ue)&&!W.some(ge=>ge.id===D.id)){$(D.chatId).catch(c);return}C.current=Math.max(C.current,D.sequence),f(ge=>Sf(ge,D))}async function $(D){const B=k.current[0],W=++N.current;if(!B||B.chatId!==D){const ge=await he.latestMessages(D,Dd);S.current===D&&W===N.current&&(_.current=!0,f(ge.messages),g(ge.hasOlder),p(!1));return}const ue=B.sequence-1,me=await he.messages(D,ue);S.current!==D||W!==N.current||(f(ge=>gS(ge.filter(Se=>Se.chatId===D),me.messages,ue)),p(!1))}async function H(){const D=k.current[0],B=i.current;if(!(!D||!M.current||E.current)){E.current=!0,j(!0);try{const W=await he.olderMessages(D.chatId,D.sequence,Dd);if(S.current!==D.chatId)return;A.current=B?B.scrollHeight-B.scrollTop:null,f(ue=>{var me;return((me=ue[0])==null?void 0:me.id)===D.id?[...W.messages,...ue]:ue}),g(W.hasOlder)}catch(W){c(W)}finally{E.current=!1,j(!1)}}}w.useEffect(()=>{const D=i.current;if(!D)return;let B=0;const W=()=>{cancelAnimationFrame(B),B=requestAnimationFrame(()=>{G.current&&D.clientHeight&&!F.on&&(Z.current=vS(D,160))})},ue=new ResizeObserver(()=>{if(W(),!!G.current){if(D.scrollHeight-D.clientHeight<8){Se();return}I.current&&(D.scrollHeight-D.scrollTop-D.clientHeight<8||D.scrollTo({top:D.scrollHeight,behavior:"instant"}))}}),me=()=>{ue.disconnect(),ue.observe(D);for(const Me of D.children)ue.observe(Me)};me();const ge=new MutationObserver(me);ge.observe(D,{childList:!0});const Se=()=>{var Me;if(!G.current){I.current=!0,P(!1);return}F.on||(I.current=D.scrollHeight-D.scrollTop-D.clientHeight<160,P(!I.current),I.current&&(q.current=((Me=k.current.at(-1))==null?void 0:Me.sequence)??0),W())};return Se(),D.addEventListener("scroll",Se,{passive:!0}),()=>{ue.disconnect(),ge.disconnect(),D.removeEventListener("scroll",Se),cancelAnimationFrame(B)}},[i.current,e]),w.useLayoutEffect(()=>{const D=i.current,B=d.at(-1);if(D){if(A.current!==null)D.scrollTo({top:D.scrollHeight-A.current,behavior:"instant"}),A.current=null;else if(U.current&&d.length&&af(D,U.current))Z.current=U.current,F.start(D,U.current),U.current=null,_.current=!1,G.current=!0,I.current=!1,P(!0);else if(_.current&&d.length){U.current=null;const W=()=>D.scrollTo({top:D.scrollHeight,behavior:"instant"});W(),requestAnimationFrame(W),_.current=!1,G.current=!0,I.current=!0}else B&&B.id!==R.current&&(I.current||B.senderId===r)&&(F.release(),D.scrollTo({top:D.scrollHeight,behavior:"smooth"}));R.current=B==null?void 0:B.id,I.current&&(q.current=(B==null?void 0:B.sequence)??0)}},[d]),w.useEffect(()=>{const D=i.current,B=Y.current;if(!D||!B||!y||!G.current)return;const W=new IntersectionObserver(ue=>{var me;(me=ue[0])!=null&&me.isIntersecting&&G.current&&H()},{root:D,rootMargin:"400px 0px 0px 0px"});return W.observe(B),()=>W.disconnect()},[y,d,e,h]);async function ie(D,B){if(F.release(),k.current.some(Se=>Se.id===D)){O(D,B);return}const ue=S.current,me=await he.message(D);if(me.chatId!==ue)return me.chatId;const ge=await he.olderMessages(me.chatId,me.sequence+1,Dd);S.current===me.chatId&&(_.current=!0,C.current=0,f([...ge.messages,me]),g(ge.hasOlder),requestAnimationFrame(()=>O(D,B)))}function O(D,B){var ue;F.release();const W=(ue=i.current)==null?void 0:ue.querySelector(`[data-message="${D}"]`);W&&k0(W,B)}const le=L?d.filter(D=>D.sequence>q.current&&D.senderId!==r).length:0;return{messages:d,setMessages:f,loading:h,hasOlder:y,loadingOlder:b,refresh:$,heard:X,top:Y,away:L,unseen:le,toLatest:()=>{F.release();const D=i.current;D==null||D.scrollTo({top:D.scrollHeight,behavior:"smooth"})},toMessage:ie,cancel:()=>{N.current++}}}function Eq({ready:e,selected:a,messages:i,chats:r,chatList:s,setChats:c,onError:d}){const f=r.find(h=>h.id===a);w.useEffect(()=>{const h=a,p=i.at(-1);if(!e||!h||!p||p.chatId!==h)return;const y=()=>{const g=s.current.find(b=>b.id===h);document.visibilityState!=="visible"||((g==null?void 0:g.readSequence)??0)>=p.sequence&&!(g!=null&&g.hint)&&!(g!=null&&g.alerts)||(c(b=>b.map(j=>j.id===h?{...j,readSequence:Math.max(j.readSequence,p.sequence),unread:0,mentions:0,alerts:0,atMe:!1,hint:null}:j)),he.markRead(h,p.sequence).catch(d))};return y(),document.addEventListener("visibilitychange",y),()=>document.removeEventListener("visibilitychange",y)},[i,a,e,f==null?void 0:f.readSequence,f==null?void 0:f.alerts,f==null?void 0:f.hint])}function Tq({onLogin:e}){const[a,i]=w.useState(""),[r,s]=w.useState(""),[c,d]=w.useState(!1),[f,h]=w.useState(!1),[p,y]=w.useState(null),[g,b]=w.useState(document.documentElement.classList.contains("dark"));async function j(k){if(k.preventDefault(),!f){h(!0),y(null);try{const S=await he.login(a.trim(),r);s(""),e(S.username)}catch(S){y(S instanceof qi&&S.status===401?"login.wrong":S instanceof qi&&S.status===429?"login.tooMany":"login.offline")}finally{h(!1)}}}return o.jsxs("div",{className:"jv-login",children:[o.jsxs("div",{className:"jv-login-corner",children:[o.jsx("div",{className:"jv-login-locales",role:"group","aria-label":x("general.language"),children:Cj.map(k=>o.jsx("button",{type:"button",lang:k,"aria-pressed":ol()===k,title:Pp(k,"name"),onClick:()=>Tj(k),children:Pp(k,"short")},k))}),o.jsx("button",{className:"jv-login-theme",type:"button",onClick:()=>{ef(g?"light":"dark"),b(!g)},"aria-label":x(g?"login.themeLight":"login.themeDark"),children:o.jsx(Ue,{name:g?"sun":"moon"})})]}),o.jsx("main",{className:"jv-login-stage",children:o.jsxs("div",{className:"jv-login-wrap",children:[o.jsxs("header",{className:"jv-login-brand",children:[o.jsx("img",{className:"jv-login-logo",src:"/icon.svg",alt:"",width:64,height:64}),o.jsx("h1",{children:"Jarvy"}),o.jsx("p",{children:x("login.subtitle")})]}),o.jsxs("form",{className:"jv-login-form",onSubmit:k=>void j(k),"aria-label":x("login.form"),"aria-busy":f,children:[o.jsxs("div",{className:"jv-login-field",children:[o.jsx("label",{htmlFor:"login-username",children:x("login.username")}),o.jsx("input",{id:"login-username",autoComplete:"username",autoFocus:!0,required:!0,disabled:f,value:a,onChange:k=>i(k.target.value)})]}),o.jsxs("div",{className:"jv-login-field",children:[o.jsx("label",{htmlFor:"login-password",children:x("login.password")}),o.jsxs("div",{className:"jv-login-password",children:[o.jsx("input",{id:"login-password",type:c?"text":"password",autoComplete:"current-password",required:!0,disabled:f,value:r,onChange:k=>s(k.target.value)}),o.jsx("button",{type:"button",className:"jv-login-visibility","aria-label":x(c?"login.hidePassword":"login.showPassword"),onClick:()=>d(!c),children:o.jsx(Ue,{name:c?"eye-slash":"eye"})})]})]}),p&&o.jsx("p",{className:"jv-login-error",role:"alert",children:x(p)}),o.jsx("button",{className:"jv-login-submit",type:"submit",disabled:f,children:x(f?"login.submitting":"login.submit")})]})]})})]})}function Aq({selected:e,chats:a,transcript:i,openChat:r,setPane:s,paneRef:c,blocked:d}){const[f,h]=w.useState(null),[p,y]=w.useState(0);w.useEffect(()=>{var j;!f||e!==f.chatId||i.loading||((j=i.messages[0])==null?void 0:j.chatId)!==f.chatId||(i.toMessage(f.id,f.passage),h(null))},[f,e,i.loading,i.messages]);function g(j,k,S){if(j.type==="thread"){const A=a.find(_=>_.id===j.parentId);A&&r(A),s({kind:"thread",id:j.id,parentId:j.parentId,mode:"pane",focus:{id:k,passage:S}});return}const N=c.current,E=window.matchMedia("(max-width: 760px)").matches,M=(N==null?void 0:N.kind)==="thread"&&(E||N.mode==="full")||(N==null?void 0:N.kind)==="search"&&E;M&&s(null);const C=j.id===e;r(j),C&&!M?i.toMessage(k,S):h({chatId:j.id,id:k,passage:S})}function b(j){s({kind:"search",chat:j}),y(k=>k+1)}return w.useEffect(()=>{const j=k=>{var N,E;if(d||k.defaultPrevented||!(k.ctrlKey||k.metaKey)||k.key.toLowerCase()!=="f")return;const S=a.find(M=>M.id===e);S&&(((N=c.current)==null?void 0:N.kind)==="search"&&((E=document.activeElement)!=null&&E.closest(".jv-search-pane"))||(k.preventDefault(),b(S)))};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[d,a,e]),{openMessage:g,search:b,focusKey:p}}const Mq=45e3,_q=25e3;function Rq(e,a,i){let r,s=Date.now(),c="";const d=()=>{r==null||r.close(),s=Date.now();const y=new EventSource(c?`${e}?after=${encodeURIComponent(c)}`:e);y.addEventListener("heartbeat",()=>{s=Date.now()});for(const[g,b]of Object.entries(a))y.addEventListener(g,j=>{s=Date.now();const k=j;k.lastEventId&&(c=k.lastEventId),b(k)});y.onerror=i,r=y},f=y=>{Date.now()-s>y&&d()},h=setInterval(()=>f(Mq),1e4),p=()=>{document.visibilityState==="visible"&&f(_q)};return window.addEventListener("online",d),document.addEventListener("visibilitychange",p),window.addEventListener("pageshow",p),d(),()=>{clearInterval(h),window.removeEventListener("online",d),document.removeEventListener("visibilitychange",p),window.removeEventListener("pageshow",p),r==null||r.close()}}function Oq(e,a){let i=null,r=Promise.resolve();return()=>i??(i=new Promise((s,c)=>setTimeout(()=>{r=r.then(()=>{i=null;const d=e();return d.then(s,c),d.catch(()=>{})})},a)))}const Dq=null;function kj(){var wi,se,be,je,Ve,tt;const[e,a]=w.useState("loading"),[i,r]=w.useState(""),[s,c]=w.useState([]),[d,f]=w.useState({}),h=w.useRef(new Map),[p,y]=w.useState([]),[g,b]=w.useState([]),[j,k]=w.useState([]),[S,N]=w.useState(null),[E,M]=w.useState({}),[C,A]=w.useState(null),[_,R]=w.useState(null),[I,G]=w.useState(null),[Y,L]=w.useState([]),[P,q]=w.useState(null),[Z,U]=w.useState(!1),[F,X]=w.useState(!1),[$,H]=w.useState(!1),[ie,O]=w.useState(""),[le,ne]=w.useState(!1),[D,B]=w.useState(null),[W,ue]=w.useState(!1),[me,ge]=w.useState(420),[Se,Me]=w.useState(dj),[xe,oe]=w.useState(null),[Ee]=w.useState(()=>new iH),[Xe]=w.useState(()=>new IP),[Be]=w.useState(()=>new XP);w.useEffect(()=>Xe.on(V=>Be.heard(V)),[Xe,Be]);const[Je,Qe]=w.useState(""),et=w.useRef(null),Lt=w.useRef(null),cn=w.useRef(null),[jn,Xt]=w.useState(null),[$n,Pn]=w.useState(null),[ga,pe]=w.useState(null),Ce=w.useRef(C);Ce.current=C;const Ge=w.useRef(0),Ke=w.useRef(p);Ke.current=p;const ot=w.useRef(D);ot.current=D;const At=w.useMemo(()=>new VI($I(i)),[i]);w.useEffect(()=>{const V=()=>At.save();return window.addEventListener("pagehide",V),()=>window.removeEventListener("pagehide",V)},[At]);const Qt=((wi=j.find(V=>V.kind==="user"&&V.name===i))==null?void 0:wi.id)??"",de=w.useRef(Qt);de.current=Qt;const Te=Nq({chatId:C,ready:e==="ready",scroller:et,me:Qt,memory:Be,onError:kt}),{messages:Re,setMessages:Ie}=Te,He=Aq({selected:C,chats:p,transcript:Te,openChat:va,setPane:B,paneRef:ot,blocked:!!I||!!P}),at=((se=p.find(V=>V.id===C))==null?void 0:se.botId)??_??((be=s[0])==null?void 0:be.id);async function Gt(V){const fe=(h.current.get(V)??0)+1;h.current.set(V,fe);const ke=await he.botStatus(V);h.current.get(V)===fe&&f(qe=>({...qe,[V]:ke}))}w.useEffect(()=>{e==="ready"&&at&&Gt(at).catch(kt)},[e,at]);const za=((je=p.find(V=>V.id===C&&V.type==="channel"))==null?void 0:je.memberIds.filter(V=>s.some(fe=>fe.id===V)).join(","))??"";w.useEffect(()=>{if(e==="ready"&&za)for(const V of za.split(","))Gt(V).catch(kt)},[e,za]);async function Gn(V){var Le,dt;const[fe,ke,qe,De,$e]=await Promise.all([he.bots(),he.chats(),he.modelConnections(),he.sections(),he.members()]);r(V),c(fe.bots),y(ke.chats),L(qe.connections),b(De.sections),k($e.members),oe(ke.followed);const ze=ke.chats.find(lt=>lt.type!=="thread");A((ze==null?void 0:ze.id)??null),ze&&M({[ze.id]:ze.readSequence}),R(((Le=ke.chats[0])==null?void 0:Le.botId)??((dt=fe.bots[0])==null?void 0:dt.id)??null),a("ready")}w.useEffect(()=>{ef(localStorage.getItem("jarvy-theme")==="dark"?"dark":"light"),he.me().then(V=>Gn(V.username)).catch(()=>a("login"))},[]),w.useEffect(()=>{if(e!=="ready")return;let V=!0;const fe=ze=>{V&&kt(ze)},ke=async()=>{const ze=Ce.current;V&&ze&&await Te.refresh(ze)},qe=()=>void he.sections().then(ze=>{V&&b(ze.sections)}).catch(ze=>{V&&kt(ze)}),De=({chat:ze,parent:Le,followed:dt,message:lt},an)=>{const Ct=Nt=>Nt.type!=="thread"&&Nt.memberIds.includes(de.current);for(const Nt of Le?[ze,Le]:[ze])Ct(Nt)&&Ht(Nt);dt&&oe(dt),ze.type==="thread"&&Ee.emit({kind:"changed",id:ze.id}),Me(Nt=>JP(Nt,ze.id,ze.type==="dm"&&!Ct(ze))),lt&&an?(Te.heard(lt,an==="message"),Xe.emit({kind:an,message:lt})):Xe.emit({kind:"chat",chat:ze})},$e=Rq("/api/events",{ready:ze=>{JSON.parse(ze.data).resumed||(Be.clear(),Me(WP),gn().catch(fe),ke().catch(fe),qe(),Ee.emit({kind:"reconnected"}),he.bots().then(Le=>{if(V){c(Le.bots);for(const dt of Le.bots)Gt(dt.id).catch(lt=>{V&&kt(lt)})}}).catch(Le=>{V&&kt(Le)}))},sections:qe,bots:()=>{he.bots().then(ze=>{V&&c(ze.bots)}).catch(fe),gn().catch(fe)},message:ze=>De(JSON.parse(ze.data),"message"),"message.updated":ze=>De(JSON.parse(ze.data),"updated"),chat:ze=>De(JSON.parse(ze.data)),"chat.removed":ze=>{var lt;const{chatId:Le,followed:dt}=JSON.parse(ze.data);y(an=>an.filter(Ct=>Ct.id!==Le)),oe(dt),Be.removed(Le),Ce.current===Le&&A(null),((lt=ot.current)==null?void 0:lt.kind)==="thread"&&ot.current.parentId===Le&&B(null),Ee.emit({kind:"reconnected"})},bot:ze=>{var an;const{botId:Le,status:dt,bot:lt}=JSON.parse(ze.data);h.current.set(Le,(h.current.get(Le)??0)+1),f(Ct=>({...Ct,[Le]:dt})),dt.error&&((an=Ke.current.find(Ct=>Ct.id===Ce.current))==null?void 0:an.botId)===dt.botId&&Qe(WL(dt)),lt&&c(Ct=>Ct.map(Nt=>Nt.id===lt.id?lt:Nt))}},()=>{he.me().catch(ze=>{V&&ze instanceof qi&&ze.status===401&&a("login")})});return()=>{V=!1,$e(),Te.cancel(),Ge.current++}},[e]),Eq({ready:e==="ready",selected:C,messages:Re,chats:p,chatList:Ke,setChats:y,onError:kt}),Cq(e==="ready"?p.reduce((V,fe)=>V+fe.alerts,0):0),w.useEffect(()=>{if(!Je)return;const V=setTimeout(()=>Qe(""),4800);return()=>clearTimeout(V)},[Je]),w.useEffect(()=>{const V=fe=>{fe.defaultPrevented||I||P||(fe.key==="Escape"&&(U(!1),X(!1),H(!1)),(fe.ctrlKey||fe.metaKey)&&fe.key.toLowerCase()==="k"&&(fe.preventDefault(),H(window.matchMedia("(max-width: 620px)").matches),requestAnimationFrame(()=>{var ke;return(ke=document.querySelector("#jarvy-search"))==null?void 0:ke.focus()})))};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[I,P]),w.useEffect(()=>{const V=window.matchMedia("(max-width: 620px)"),fe=()=>{V.matches||H(!1)};return V.addEventListener("change",fe),()=>V.removeEventListener("change",fe)},[]);function kt(V){if(V instanceof qi&&V.status===401){a("login");return}Qe(en(V,"common.failed"))}const[gn]=w.useState(()=>Oq(async()=>{const V=++Ge.current,fe=await he.chats();return V===Ge.current&&(y(fe.chats),oe(fe.followed)),fe.chats},100));async function vo(){const[V,fe]=await Promise.all([he.modelConnections(),he.bots()]);L(V.connections),c(fe.bots)}const Ki=()=>void he.members().then(V=>k(V.members)).catch(kt);function bl(V){c(fe=>fe.map(ke=>ke.id===V.id?V:ke)),Ki()}function va(V){var ke;const fe=HI(V);fe?B({kind:"thread",id:fe,parentId:V.id,mode:"pane",summary:((ke=V.hint)==null?void 0:ke.kind)==="note"}):V.id!==Ce.current&&B(null),ue(!1),M(qe=>({...qe,[V.id]:V.readSequence})),A(V.id),V.botId&&R(V.botId),H(!1),U(!1),X(!1)}const yi=V=>B((D==null?void 0:D.kind)==="info"&&D.page===V?null:{kind:"info",page:V});function Ht(V){y(fe=>fe.some(ke=>ke.id===V.id)?fe.map(ke=>ke.id===V.id?V:ke):[V,...fe])}async function tn(V){if(!le){ne(!0);try{const fe=await he.createChat(V);Ht(fe),va(fe),requestAnimationFrame(()=>{var ke;return(ke=document.querySelector("#jarvy-composer"))==null?void 0:ke.focus()})}catch(fe){kt(fe)}finally{ne(!1)}}}async function on(){if(!le){ne(!0);try{const V=await he.createBot(eI(hi(j).map(ke=>ke.name))),fe=await he.createChat(V.id);c(ke=>[...ke,V]),Ht(fe),Ki(),va(fe)}catch(V){kt(V)}finally{ne(!1)}}}async function xi(V){try{await he.deleteChat(V.id),await gn(),Ce.current===V.id&&A(null),Qe(x("app.channelDeleted"))}catch(fe){kt(fe)}}async function Ja(V,fe){try{Ht(await he.pin(V.id,fe))}catch(ke){kt(ke)}}async function Wa(V,fe){try{Ht(await he.mute(V.id,fe))}catch(ke){kt(ke)}}async function ei(V,fe){try{await he.deleteBot(V.id,fe);const ke=new Set(p.filter(qe=>qe.type==="dm"&&qe.botId===V.id).map(qe=>qe.id));y(qe=>qe.filter(De=>!ke.has(De.id)).map(De=>De.memberIds.includes(V.id)?{...De,memberIds:De.memberIds.filter($e=>$e!==V.id)}:De)),c(qe=>qe.filter(De=>De.id!==V.id)),Ki(),Ce.current&&ke.has(Ce.current)&&A(null),I===V.id&&G(null),Qe(x("app.botDeleted",{name:V.name}))}catch(ke){kt(ke)}}async function La(V,fe,ke,qe,De){const $e=C,ze=await he.send($e,V,fe,ke,!1,qe,De),Le=Ke.current.find(lt=>lt.id===$e),dt=(Le==null?void 0:Le.type)==="channel"?[...new Set(qg(V,hi(j)).filter(lt=>!Le.memberIds.includes(lt.member.id)).map(lt=>lt.member.name))]:[];dt.length&&Qe(x("app.notInChannel",{names:dt.join(x("common.listSeparator")),count:dt.length})),Te.heard(ze,!0)}function aa(V,fe){he.addMember(V,fe.id).then(ke=>{Ht(ke),Qe(x("app.memberAdded",{name:fe.name,channel:ke.title}))}).catch(kt)}async function ti(V){try{const fe=await he.openThread(V.id);B({kind:"thread",id:fe.id,parentId:V.chatId,mode:"pane"})}catch(fe){kt(fe)}}function ya(V,fe){const ke=p.find(qe=>qe.id===V.parentId);ke&&va(ke),B(fe?{kind:"thread",id:V.id,parentId:V.parentId,mode:"pane"}:null)}function ia(V){G(null);const fe=p.find(ke=>ke.id===(V.type==="thread"?V.parentId:V.id));fe&&va(fe),V.type==="thread"&&B({kind:"thread",id:V.id,parentId:V.parentId,mode:"pane"})}async function bi(V,fe,ke){try{const qe=await he.react(V.id,fe,ke);Ie(De=>De.map($e=>$e.id===qe.id?{...$e,reactions:qe.reactions}:$e))}catch(qe){kt(qe)}}async function jl(V,fe){try{const ke=await he.fold(V.id,fe);Ie(qe=>qe.map(De=>De.id===ke.id?{...De,folded:ke.folded}:De))}catch(ke){kt(ke)}}function xa(V){uS(At,V,j)}const Cr=(V,fe)=>V?void Te.toMessage(V,fe).then(async ke=>{ke&&He.openMessage(await he.chat(ke),V,fe)}).catch(()=>Qe(x("app.sourceGone"))):Qe(x("app.sourceGone"));function ni(V){Ee.emit({kind:"chat",chat:V})}function Nr(V){V.preventDefault();const fe=qe=>ge(Math.min(Math.max(340,window.innerWidth-qe.clientX),Math.round(window.innerWidth*.6))),ke=()=>{window.removeEventListener("pointermove",fe),window.removeEventListener("pointerup",ke),document.body.style.cursor=""};window.addEventListener("pointermove",fe),window.addEventListener("pointerup",ke),document.body.style.cursor="col-resize"}async function ba(){try{await At.clear(V=>he.removeAttachment(V)),await he.logout(),a("login"),U(!1),q(null),h.current.clear(),f({}),B(null),oe(null),Me(dj),Be.clear(),r(""),A(null),y([]),c([]),L([]),Ie([])}catch(V){kt(V)}}const Er=e==="ready"&&p.some(V=>V.id===C);w.useEffect(()=>{const V=et.current;if(!V)return;let fe=0,ke=V.clientHeight;const qe=()=>{fe=V.scrollHeight-V.scrollTop-V.clientHeight},De=new ResizeObserver(()=>{V.clientHeight!==ke&&(ke=V.clientHeight,V.scrollTo({top:V.scrollHeight-V.clientHeight-fe,behavior:"instant"}))}),$e=new MutationObserver(qe);return qe(),V.addEventListener("scroll",qe,{passive:!0}),De.observe(V),$e.observe(V,{childList:!0,subtree:!0,characterData:!0}),()=>{De.disconnect(),$e.disconnect(),V.removeEventListener("scroll",qe)}},[Er]);const Ba=p.find(V=>V.id===C),Ia=(Ba==null?void 0:Ba.type)==="channel",Yn=HP(e==="ready"?((Ve=p.find(V=>V.id===C&&V.type==="dm"))==null?void 0:Ve.botId)??void 0:void 0,tH(Se));if(e==="loading")return o.jsx("div",{className:"jarvy-loading",children:x("app.connecting")});if(e==="login")return o.jsx(Tq,{onLogin:V=>void Gn(V).catch(kt)});const Ft=p.find(V=>V.id===C),wn=s.find(V=>V.id===((Ft==null?void 0:Ft.botId)??_))??s[0],Zt=!!(wn!=null&&wn.connectionId),Vt=Ia||Zt,vn=(wn==null?void 0:wn.name)??"Jarvy",nn=wn?d[wn.id]:void 0,wl=nn!=null&&nn.error?x("activity.error"):(nn==null?void 0:nn.status)==="running"?P5(nn.activity):"",Tr=(tt=[...Re].reverse().find(V=>{var fe;return((fe=V.question)==null?void 0:fe.state)==="pending"}))==null?void 0:tt.id,ji=(D==null?void 0:D.kind)==="thread"?D:null,Pa=(ji==null?void 0:ji.mode)==="full",Xi=Ia?Ba:void 0,Ar=s.find(V=>V.id===I),Mr=new Set(Object.values(d).filter(V=>V.status==="running"&&V.activity!=="asking").map(V=>V.botId)),ja=new Set(Object.values(d).filter(V=>V.activity==="asking").map(V=>V.botId));return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"ui-app","data-nav":$?"":void 0,"data-pane":D&&!Pa?"":void 0,style:{"--ui-pane":`${me}px`},children:[o.jsx(UI,{username:i,chats:p,sections:g,bots:s,members:j,followed:xe,followedOpen:W&&!Pa,working:Mr,asking:ja,selected:W?null:C,filter:ie,creating:le,createMenu:F,accountMenu:Z,onFilterChange:O,onOpenFollowed:()=>{ue(!0),B(null),H(!1)},onOpenChat:va,onOpenBot:V=>void tn(V.id),onOpenMenu:(V,fe)=>Pn({target:V,at:fe}),onEditSection:V=>N({kind:"section",section:V}),onCreate:V=>{if(V==="bot")return void on();N({kind:V}),X(!1)},onFind:He.openMessage,onOpenFound:ia,onError:kt,onToggleCreate:V=>{X(V),U(!1)},onToggleAccount:V=>{U(V),X(!1)},onSettings:()=>{U(!1),q("general")},onToggleTheme:()=>{ef(document.documentElement.classList.contains("dark")?"light":"dark"),U(!1)},onLogOut:()=>void ba()}),o.jsx(BP,{chat:Ft,inChannel:Ia,bots:s,members:j,meId:Qt,drafts:At,composeReady:Vt,botName:vn,activeBot:wn,status:nn,connections:Y,activity:wl,history:Te,divider:E[(Ft==null?void 0:Ft.id)??""]??(Ft==null?void 0:Ft.readSequence)??0,activeQuestion:Tr,pane:D,onPane:B,onToggleInfo:yi,find:He,onNav:()=>H(!0),onBot:V=>G(V),hasBotDirects:Yn.length>0,onInvite:aa,onQuote:xa,onReply:V=>void ti(V),onReact:(V,fe,ke)=>void bi(V,fe,ke),onFold:(V,fe)=>void jl(V,fe),onJump:Cr,onSettled:V=>Ie(fe=>fe.map(ke=>ke.id===V.id?V:ke)),onPreview:(V,fe)=>Xt({files:V,index:fe}),onSend:La,notice:Qe,onSaveNote:async V=>{try{Ht(await he.setNote(Ft.id,V))}catch(fe){throw kt(fe),fe}},createBot:()=>void on(),creating:le,updateBot:bl,onManageModels:()=>q("models"),error:kt,chatArea:Lt,transcript:et,composeWrap:cn,hidden:Pa||W,onOpenThread:V=>B({kind:"thread",id:V,parentId:Ft.id,mode:"pane"})}),o.jsx(cH,{pane:D,followedView:W,threadEvents:Ee,followed:xe,chats:p,sections:g,members:j,bots:s,statuses:d,meId:Qt,drafts:At,changes:Se,live:Xe,memory:Be,paneChannel:Xi,activeBot:wn,botDirects:Yn,find:He,onPane:B,onNav:()=>H(!0),onBackToChannel:ya,onAddMembers:V=>N({kind:"members",chat:V}),onOpenBot:G,onPin:V=>void Ja(V,!V.pinned),onMute:V=>void Wa(V,!V.muted),onDeleteChannel:V=>pe({kind:"chat",chat:V}),onChannelSaved:Ht,onThreadChanged:ni,onInvite:aa,onPreview:(V,fe)=>Xt({files:V,index:fe}),onNotice:Qe,onError:kt,paneWidth:me,onResize:Nr})]}),$&&o.jsx("div",{className:"ui-nav-scrim",onClick:()=>H(!1),role:"presentation"}),P&&o.jsx(wq,{connections:Y,bots:s,initialTab:P,onChanged:vo,onClose:()=>q(null)}),o.jsx(MI,{dialog:S,entryMenu:$n,confirm:ga,preview:jn,infoBot:Ar,bots:s,statuses:d,chats:p,sections:g,members:j,connections:Y,meId:Qt,onDialog:N,onEntryMenu:Pn,onConfirm:pe,onPreview:Xt,onInfoBot:G,onSettings:q,onChannelInfo:V=>{va(V),B({kind:"info",page:"main"})},onOpenChatId:V=>{A(V),H(!1)},chatSaved:Ht,openChat:va,onSectionSaved:V=>{b(fe=>fe.some(ke=>ke.id===V.id)?fe.map(ke=>ke.id===V.id?V:ke):[...fe,V]),N(null)},onSectionDeleted:V=>{N(null),b(fe=>fe.filter(ke=>ke.id!==V)),gn().catch(kt)},updateBot:bl,openAnywhere:ia,removeChannel:xi,deleteBot:ei,pinChat:Ja,muteChat:Wa}),Je&&o.jsx("div",{className:"ui-toast",role:"status",children:Je}),Dq]})}function zq(){const e=`https://${location.host}${location.pathname}${location.search}`;return o.jsxs("div",{className:"jv-insecure",role:"status",children:[o.jsx(Q7,{"aria-hidden":"true"}),o.jsx("span",{children:x("connection.insecure")}),o.jsx("a",{href:e,children:x("connection.useHttps")})]})}function Lq(){return Aj(),window.isSecureContext?o.jsx(kj,{}):o.jsxs("div",{className:"jv-insecure-shell",children:[o.jsx(zq,{}),o.jsx(kj,{})]})}x8.createRoot(document.getElementById("root")).render(o.jsx(w.StrictMode,{children:o.jsx(Lq,{})}));