From c2ce1585a5123454a13fad0d1372bb618a0a7faf Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Fri, 20 Mar 2026 00:01:02 +0100 Subject: [PATCH] auto-git: [add] dist/assets/index-CNIMqiRf.css [add] dist/assets/index-DBFjvGi0.js [change] dist/index.html [unlink] dist/assets/index--H0m17xk.js [unlink] dist/assets/index-tD1u5GzG.css --- dist/assets/index--H0m17xk.js | 73 ------------------- ...{index-tD1u5GzG.css => index-CNIMqiRf.css} | 2 +- dist/assets/index-DBFjvGi0.js | 73 +++++++++++++++++++ dist/index.html | 4 +- 4 files changed, 76 insertions(+), 76 deletions(-) delete mode 100644 dist/assets/index--H0m17xk.js rename dist/assets/{index-tD1u5GzG.css => index-CNIMqiRf.css} (80%) create mode 100644 dist/assets/index-DBFjvGi0.js diff --git a/dist/assets/index--H0m17xk.js b/dist/assets/index--H0m17xk.js deleted file mode 100644 index 937340c..0000000 --- a/dist/assets/index--H0m17xk.js +++ /dev/null @@ -1,73 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function _p(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gc={exports:{}},xo={},vc={exports:{}},b={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var nl=Symbol.for("react.element"),Lp=Symbol.for("react.portal"),Pp=Symbol.for("react.fragment"),Rp=Symbol.for("react.strict_mode"),jp=Symbol.for("react.profiler"),Tp=Symbol.for("react.provider"),$p=Symbol.for("react.context"),Mp=Symbol.for("react.forward_ref"),zp=Symbol.for("react.suspense"),Fp=Symbol.for("react.memo"),Op=Symbol.for("react.lazy"),Wa=Symbol.iterator;function Ip(e){return e===null||typeof e!="object"?null:(e=Wa&&e[Wa]||e["@@iterator"],typeof e=="function"?e:null)}var yc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},wc=Object.assign,Sc={};function cr(e,t,n){this.props=e,this.context=t,this.refs=Sc,this.updater=n||yc}cr.prototype.isReactComponent={};cr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};cr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function xc(){}xc.prototype=cr.prototype;function Es(e,t,n){this.props=e,this.context=t,this.refs=Sc,this.updater=n||yc}var Cs=Es.prototype=new xc;Cs.constructor=Es;wc(Cs,cr.prototype);Cs.isPureReactComponent=!0;var Va=Array.isArray,kc=Object.prototype.hasOwnProperty,Ns={current:null},Ec={key:!0,ref:!0,__self:!0,__source:!0};function Cc(e,t,n){var r,l={},o=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)kc.call(t,r)&&!Ec.hasOwnProperty(r)&&(l[r]=t[r]);var a=arguments.length-2;if(a===1)l.children=n;else if(1>>1,ie=M[q];if(0>>1;ql(Y,B))tel(Ue,Y)?(M[q]=Ue,M[te]=B,q=te):(M[q]=Y,M[A]=B,q=A);else if(tel(Ue,B))M[q]=Ue,M[te]=B,q=te;else break e}}return $}function l(M,$){var B=M.sortIndex-$.sortIndex;return B!==0?B:M.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var s=[],u=[],p=1,v=null,y=3,w=!1,x=!1,C=!1,_=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,f=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(M){for(var $=n(u);$!==null;){if($.callback===null)r(u);else if($.startTime<=M)r(u),$.sortIndex=$.expirationTime,t(s,$);else break;$=n(u)}}function E(M){if(C=!1,d(M),!x)if(n(s)!==null)x=!0,Le(R);else{var $=n(u);$!==null&&Ze(E,$.startTime-M)}}function R(M,$){x=!1,C&&(C=!1,h(O),O=-1),w=!0;var B=y;try{for(d($),v=n(s);v!==null&&(!(v.expirationTime>$)||M&&!Z());){var q=v.callback;if(typeof q=="function"){v.callback=null,y=v.priorityLevel;var ie=q(v.expirationTime<=$);$=e.unstable_now(),typeof ie=="function"?v.callback=ie:v===n(s)&&r(s),d($)}else r(s);v=n(s)}if(v!==null)var P=!0;else{var A=n(u);A!==null&&Ze(E,A.startTime-$),P=!1}return P}finally{v=null,y=B,w=!1}}var j=!1,T=null,O=-1,W=5,D=-1;function Z(){return!(e.unstable_now()-DM||125q?(M.sortIndex=B,t(u,M),n(s)===null&&M===n(u)&&(C?(h(O),O=-1):C=!0,Ze(E,B-q))):(M.sortIndex=ie,t(s,M),x||w||(x=!0,Le(R))),M},e.unstable_shouldYield=Z,e.unstable_wrapCallback=function(M){var $=y;return function(){var B=y;y=$;try{return M.apply(this,arguments)}finally{y=B}}}})(Rc);Pc.exports=Rc;var Yp=Pc.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Jp=m,Je=Yp;function L(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Li=Object.prototype.hasOwnProperty,Gp=/^[: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]*$/,Ka={},ba={};function Xp(e){return Li.call(ba,e)?!0:Li.call(Ka,e)?!1:Gp.test(e)?ba[e]=!0:(Ka[e]=!0,!1)}function Zp(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function qp(e,t,n,r){if(t===null||typeof t>"u"||Zp(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ae(e,t,n,r,l,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var _e={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){_e[e]=new Ae(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];_e[t]=new Ae(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){_e[e]=new Ae(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){_e[e]=new Ae(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){_e[e]=new Ae(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){_e[e]=new Ae(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){_e[e]=new Ae(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){_e[e]=new Ae(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){_e[e]=new Ae(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ls=/[\-:]([a-z])/g;function Ps(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ls,Ps);_e[t]=new Ae(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ls,Ps);_e[t]=new Ae(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ls,Ps);_e[t]=new Ae(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){_e[e]=new Ae(e,1,!1,e.toLowerCase(),null,!1,!1)});_e.xlinkHref=new Ae("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){_e[e]=new Ae(e,1,!1,e.toLowerCase(),null,!0,!0)});function Rs(e,t,n,r){var l=_e.hasOwnProperty(t)?_e[t]:null;(l!==null?l.type!==0:r||!(2a||l[i]!==o[a]){var s=` -`+l[i].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=i&&0<=a);break}}}finally{ti=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Cr(e):""}function eh(e){switch(e.tag){case 5:return Cr(e.type);case 16:return Cr("Lazy");case 13:return Cr("Suspense");case 19:return Cr("SuspenseList");case 0:case 2:case 15:return e=ni(e.type,!1),e;case 11:return e=ni(e.type.render,!1),e;case 1:return e=ni(e.type,!0),e;default:return""}}function Ti(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Un:return"Fragment";case An:return"Portal";case Pi:return"Profiler";case js:return"StrictMode";case Ri:return"Suspense";case ji:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case $c:return(e.displayName||"Context")+".Consumer";case Tc:return(e._context.displayName||"Context")+".Provider";case Ts:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $s:return t=e.displayName||null,t!==null?t:Ti(e.type)||"Memo";case Vt:t=e._payload,e=e._init;try{return Ti(e(t))}catch{}}return null}function th(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ti(t);case 8:return t===js?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ln(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function zc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function nh(e){var t=zc(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yl(e){e._valueTracker||(e._valueTracker=nh(e))}function Fc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=zc(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Jl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function $i(e,t){var n=t.checked;return fe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ja(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ln(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Oc(e,t){t=t.checked,t!=null&&Rs(e,"checked",t,!1)}function Mi(e,t){Oc(e,t);var n=ln(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?zi(e,t.type,n):t.hasOwnProperty("defaultValue")&&zi(e,t.type,ln(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ga(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function zi(e,t,n){(t!=="number"||Jl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Nr=Array.isArray;function Xn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=wl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Dr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Pr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},rh=["Webkit","ms","Moz","O"];Object.keys(Pr).forEach(function(e){rh.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Pr[t]=Pr[e]})});function Uc(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Pr.hasOwnProperty(e)&&Pr[e]?(""+t).trim():t+"px"}function Bc(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Uc(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var lh=fe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ii(e,t){if(t){if(lh[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(L(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(L(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(L(61))}if(t.style!=null&&typeof t.style!="object")throw Error(L(62))}}function Di(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ai=null;function Ms(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ui=null,Zn=null,qn=null;function qa(e){if(e=ol(e)){if(typeof Ui!="function")throw Error(L(280));var t=e.stateNode;t&&(t=_o(t),Ui(e.stateNode,e.type,t))}}function Hc(e){Zn?qn?qn.push(e):qn=[e]:Zn=e}function Wc(){if(Zn){var e=Zn,t=qn;if(qn=Zn=null,qa(e),t)for(e=0;e>>=0,e===0?32:31-(mh(e)/gh|0)|0}var Sl=64,xl=4194304;function _r(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ql(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var a=i&~l;a!==0?r=_r(a):(o&=i,o!==0&&(r=_r(o)))}else i=n&~l,i!==0?r=_r(i):o!==0&&(r=_r(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,o=t&-t,l>=o||l===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function rl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-dt(t),e[t]=n}function Sh(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=jr),au=" ",uu=!1;function cf(e,t){switch(e){case"keyup":return Yh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ff(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bn=!1;function Gh(e,t){switch(e){case"compositionend":return ff(t);case"keypress":return t.which!==32?null:(uu=!0,au);case"textInput":return e=t.data,e===au&&uu?null:e;default:return null}}function Xh(e,t){if(Bn)return e==="compositionend"||!Bs&&cf(e,t)?(e=af(),Il=Ds=Yt=null,Bn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=pu(n)}}function mf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?mf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function gf(){for(var e=window,t=Jl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Jl(e.document)}return t}function Hs(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function im(e){var t=gf(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&mf(n.ownerDocument.documentElement,n)){if(r!==null&&Hs(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,o=Math.min(r.start,l);r=r.end===void 0?o:Math.min(r.end,l),!e.extend&&o>r&&(l=r,r=o,o=l),l=hu(n,o);var i=hu(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Hn=null,Ki=null,$r=null,bi=!1;function mu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;bi||Hn==null||Hn!==Jl(r)||(r=Hn,"selectionStart"in r&&Hs(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),$r&&Vr($r,r)||($r=r,r=no(Ki,"onSelect"),0Qn||(e.current=qi[Qn],qi[Qn]=null,Qn--)}function ee(e,t){Qn++,qi[Qn]=e.current,e.current=t}var on={},Me=an(on),We=an(!1),En=on;function lr(e,t){var n=e.type.contextTypes;if(!n)return on;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in n)l[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Ve(e){return e=e.childContextTypes,e!=null}function lo(){le(We),le(Me)}function ku(e,t,n){if(Me.current!==on)throw Error(L(168));ee(Me,t),ee(We,n)}function Nf(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(L(108,th(e)||"Unknown",l));return fe({},n,r)}function oo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||on,En=Me.current,ee(Me,e),ee(We,We.current),!0}function Eu(e,t,n){var r=e.stateNode;if(!r)throw Error(L(169));n?(e=Nf(e,t,En),r.__reactInternalMemoizedMergedChildContext=e,le(We),le(Me),ee(Me,e)):le(We),ee(We,n)}var Lt=null,Lo=!1,gi=!1;function _f(e){Lt===null?Lt=[e]:Lt.push(e)}function ym(e){Lo=!0,_f(e)}function un(){if(!gi&&Lt!==null){gi=!0;var e=0,t=X;try{var n=Lt;for(X=1;e>=i,l-=i,Pt=1<<32-dt(t)+l|n<O?(W=T,T=null):W=T.sibling;var D=y(h,T,d[O],E);if(D===null){T===null&&(T=W);break}e&&T&&D.alternate===null&&t(h,T),f=o(D,f,O),j===null?R=D:j.sibling=D,j=D,T=W}if(O===d.length)return n(h,T),oe&&gn(h,O),R;if(T===null){for(;OO?(W=T,T=null):W=T.sibling;var Z=y(h,T,D.value,E);if(Z===null){T===null&&(T=W);break}e&&T&&Z.alternate===null&&t(h,T),f=o(Z,f,O),j===null?R=Z:j.sibling=Z,j=Z,T=W}if(D.done)return n(h,T),oe&&gn(h,O),R;if(T===null){for(;!D.done;O++,D=d.next())D=v(h,D.value,E),D!==null&&(f=o(D,f,O),j===null?R=D:j.sibling=D,j=D);return oe&&gn(h,O),R}for(T=r(h,T);!D.done;O++,D=d.next())D=w(T,h,O,D.value,E),D!==null&&(e&&D.alternate!==null&&T.delete(D.key===null?O:D.key),f=o(D,f,O),j===null?R=D:j.sibling=D,j=D);return e&&T.forEach(function(me){return t(h,me)}),oe&&gn(h,O),R}function _(h,f,d,E){if(typeof d=="object"&&d!==null&&d.type===Un&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case vl:e:{for(var R=d.key,j=f;j!==null;){if(j.key===R){if(R=d.type,R===Un){if(j.tag===7){n(h,j.sibling),f=l(j,d.props.children),f.return=h,h=f;break e}}else if(j.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===Vt&&_u(R)===j.type){n(h,j.sibling),f=l(j,d.props),f.ref=Sr(h,j,d),f.return=h,h=f;break e}n(h,j);break}else t(h,j);j=j.sibling}d.type===Un?(f=kn(d.props.children,h.mode,E,d.key),f.return=h,h=f):(E=Ql(d.type,d.key,d.props,null,h.mode,E),E.ref=Sr(h,f,d),E.return=h,h=E)}return i(h);case An:e:{for(j=d.key;f!==null;){if(f.key===j)if(f.tag===4&&f.stateNode.containerInfo===d.containerInfo&&f.stateNode.implementation===d.implementation){n(h,f.sibling),f=l(f,d.children||[]),f.return=h,h=f;break e}else{n(h,f);break}else t(h,f);f=f.sibling}f=Ci(d,h.mode,E),f.return=h,h=f}return i(h);case Vt:return j=d._init,_(h,f,j(d._payload),E)}if(Nr(d))return x(h,f,d,E);if(mr(d))return C(h,f,d,E);Pl(h,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,f!==null&&f.tag===6?(n(h,f.sibling),f=l(f,d),f.return=h,h=f):(n(h,f),f=Ei(d,h.mode,E),f.return=h,h=f),i(h)):n(h,f)}return _}var ir=jf(!0),Tf=jf(!1),ao=an(null),uo=null,Yn=null,Ks=null;function bs(){Ks=Yn=uo=null}function Ys(e){var t=ao.current;le(ao),e._currentValue=t}function ns(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function tr(e,t){uo=e,Ks=Yn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(He=!0),e.firstContext=null)}function lt(e){var t=e._currentValue;if(Ks!==e)if(e={context:e,memoizedValue:t,next:null},Yn===null){if(uo===null)throw Error(L(308));Yn=e,uo.dependencies={lanes:0,firstContext:e}}else Yn=Yn.next=e;return t}var wn=null;function Js(e){wn===null?wn=[e]:wn.push(e)}function $f(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Js(t)):(n.next=l.next,l.next=n),t.interleaved=n,zt(e,r)}function zt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Qt=!1;function Gs(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Mf(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function jt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function en(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,J&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,zt(e,n)}return l=r.interleaved,l===null?(t.next=t,Js(r)):(t.next=l.next,l.next=t),r.interleaved=t,zt(e,n)}function Al(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Fs(e,n)}}function Lu(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?l=o=i:o=o.next=i,n=n.next}while(n!==null);o===null?l=o=t:o=o.next=t}else l=o=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function co(e,t,n,r){var l=e.updateQueue;Qt=!1;var o=l.firstBaseUpdate,i=l.lastBaseUpdate,a=l.shared.pending;if(a!==null){l.shared.pending=null;var s=a,u=s.next;s.next=null,i===null?o=u:i.next=u,i=s;var p=e.alternate;p!==null&&(p=p.updateQueue,a=p.lastBaseUpdate,a!==i&&(a===null?p.firstBaseUpdate=u:a.next=u,p.lastBaseUpdate=s))}if(o!==null){var v=l.baseState;i=0,p=u=s=null,a=o;do{var y=a.lane,w=a.eventTime;if((r&y)===y){p!==null&&(p=p.next={eventTime:w,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var x=e,C=a;switch(y=t,w=n,C.tag){case 1:if(x=C.payload,typeof x=="function"){v=x.call(w,v,y);break e}v=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=C.payload,y=typeof x=="function"?x.call(w,v,y):x,y==null)break e;v=fe({},v,y);break e;case 2:Qt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,y=l.effects,y===null?l.effects=[a]:y.push(a))}else w={eventTime:w,lane:y,tag:a.tag,payload:a.payload,callback:a.callback,next:null},p===null?(u=p=w,s=v):p=p.next=w,i|=y;if(a=a.next,a===null){if(a=l.shared.pending,a===null)break;y=a,a=y.next,y.next=null,l.lastBaseUpdate=y,l.shared.pending=null}}while(!0);if(p===null&&(s=v),l.baseState=s,l.firstBaseUpdate=u,l.lastBaseUpdate=p,t=l.shared.interleaved,t!==null){l=t;do i|=l.lane,l=l.next;while(l!==t)}else o===null&&(l.shared.lanes=0);_n|=i,e.lanes=i,e.memoizedState=v}}function Pu(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=yi.transition;yi.transition={};try{e(!1),t()}finally{X=n,yi.transition=r}}function Gf(){return ot().memoizedState}function km(e,t,n){var r=nn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Xf(e))Zf(t,n);else if(n=$f(e,t,n,r),n!==null){var l=Ie();pt(n,e,r,l),qf(n,t,r)}}function Em(e,t,n){var r=nn(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Xf(e))Zf(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,a=o(i,n);if(l.hasEagerState=!0,l.eagerState=a,ht(a,i)){var s=t.interleaved;s===null?(l.next=l,Js(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=$f(e,t,l,r),n!==null&&(l=Ie(),pt(n,e,r,l),qf(n,t,r))}}function Xf(e){var t=e.alternate;return e===ue||t!==null&&t===ue}function Zf(e,t){Mr=po=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function qf(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Fs(e,n)}}var ho={readContext:lt,useCallback:je,useContext:je,useEffect:je,useImperativeHandle:je,useInsertionEffect:je,useLayoutEffect:je,useMemo:je,useReducer:je,useRef:je,useState:je,useDebugValue:je,useDeferredValue:je,useTransition:je,useMutableSource:je,useSyncExternalStore:je,useId:je,unstable_isNewReconciler:!1},Cm={readContext:lt,useCallback:function(e,t){return yt().memoizedState=[e,t===void 0?null:t],e},useContext:lt,useEffect:ju,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Bl(4194308,4,Qf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Bl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Bl(4,2,e,t)},useMemo:function(e,t){var n=yt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=yt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=km.bind(null,ue,e),[r.memoizedState,e]},useRef:function(e){var t=yt();return e={current:e},t.memoizedState=e},useState:Ru,useDebugValue:la,useDeferredValue:function(e){return yt().memoizedState=e},useTransition:function(){var e=Ru(!1),t=e[0];return e=xm.bind(null,e[1]),yt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ue,l=yt();if(oe){if(n===void 0)throw Error(L(407));n=n()}else{if(n=t(),ke===null)throw Error(L(349));Nn&30||If(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,ju(Af.bind(null,r,o,e),[e]),r.flags|=2048,Zr(9,Df.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=yt(),t=ke.identifierPrefix;if(oe){var n=Rt,r=Pt;n=(r&~(1<<32-dt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Gr++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[wt]=t,e[br]=r,ud(e,t,!1,!1),t.stateNode=e;e:{switch(i=Di(n,r),n){case"dialog":re("cancel",e),re("close",e),l=r;break;case"iframe":case"object":case"embed":re("load",e),l=r;break;case"video":case"audio":for(l=0;lur&&(t.flags|=128,r=!0,xr(o,!1),t.lanes=4194304)}else{if(!r)if(e=fo(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),xr(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!oe)return Te(t),null}else 2*he()-o.renderingStartTime>ur&&n!==1073741824&&(t.flags|=128,r=!0,xr(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=he(),t.sibling=null,n=ae.current,ee(ae,r?n&1|2:n&1),t):(Te(t),null);case 22:case 23:return ca(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ke&1073741824&&(Te(t),t.subtreeFlags&6&&(t.flags|=8192)):Te(t),null;case 24:return null;case 25:return null}throw Error(L(156,t.tag))}function $m(e,t){switch(Vs(t),t.tag){case 1:return Ve(t.type)&&lo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return sr(),le(We),le(Me),qs(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Zs(t),null;case 13:if(le(ae),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(L(340));or()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(ae),null;case 4:return sr(),null;case 10:return Ys(t.type._context),null;case 22:case 23:return ca(),null;case 24:return null;default:return null}}var jl=!1,$e=!1,Mm=typeof WeakSet=="function"?WeakSet:Set,F=null;function Jn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){de(e,t,r)}else n.current=null}function fs(e,t,n){try{n()}catch(r){de(e,t,r)}}var Bu=!1;function zm(e,t){if(Yi=eo,e=gf(),Hs(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,a=-1,s=-1,u=0,p=0,v=e,y=null;t:for(;;){for(var w;v!==n||l!==0&&v.nodeType!==3||(a=i+l),v!==o||r!==0&&v.nodeType!==3||(s=i+r),v.nodeType===3&&(i+=v.nodeValue.length),(w=v.firstChild)!==null;)y=v,v=w;for(;;){if(v===e)break t;if(y===n&&++u===l&&(a=i),y===o&&++p===r&&(s=i),(w=v.nextSibling)!==null)break;v=y,y=v.parentNode}v=w}n=a===-1||s===-1?null:{start:a,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ji={focusedElem:e,selectionRange:n},eo=!1,F=t;F!==null;)if(t=F,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,F=e;else for(;F!==null;){t=F;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var C=x.memoizedProps,_=x.memoizedState,h=t.stateNode,f=h.getSnapshotBeforeUpdate(t.elementType===t.type?C:ut(t.type,C),_);h.__reactInternalSnapshotBeforeUpdate=f}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(L(163))}}catch(E){de(t,t.return,E)}if(e=t.sibling,e!==null){e.return=t.return,F=e;break}F=t.return}return x=Bu,Bu=!1,x}function zr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var o=l.destroy;l.destroy=void 0,o!==void 0&&fs(t,n,o)}l=l.next}while(l!==r)}}function jo(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ds(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function dd(e){var t=e.alternate;t!==null&&(e.alternate=null,dd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[wt],delete t[br],delete t[Zi],delete t[gm],delete t[vm])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function pd(e){return e.tag===5||e.tag===3||e.tag===4}function Hu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||pd(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ps(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ro));else if(r!==4&&(e=e.child,e!==null))for(ps(e,t,n),e=e.sibling;e!==null;)ps(e,t,n),e=e.sibling}function hs(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(hs(e,t,n),e=e.sibling;e!==null;)hs(e,t,n),e=e.sibling}var Ce=null,ct=!1;function Wt(e,t,n){for(n=n.child;n!==null;)hd(e,t,n),n=n.sibling}function hd(e,t,n){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(ko,n)}catch{}switch(n.tag){case 5:$e||Jn(n,t);case 6:var r=Ce,l=ct;Ce=null,Wt(e,t,n),Ce=r,ct=l,Ce!==null&&(ct?(e=Ce,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ce.removeChild(n.stateNode));break;case 18:Ce!==null&&(ct?(e=Ce,n=n.stateNode,e.nodeType===8?mi(e.parentNode,n):e.nodeType===1&&mi(e,n),Hr(e)):mi(Ce,n.stateNode));break;case 4:r=Ce,l=ct,Ce=n.stateNode.containerInfo,ct=!0,Wt(e,t,n),Ce=r,ct=l;break;case 0:case 11:case 14:case 15:if(!$e&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&fs(n,t,i),l=l.next}while(l!==r)}Wt(e,t,n);break;case 1:if(!$e&&(Jn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){de(n,t,a)}Wt(e,t,n);break;case 21:Wt(e,t,n);break;case 22:n.mode&1?($e=(r=$e)||n.memoizedState!==null,Wt(e,t,n),$e=r):Wt(e,t,n);break;default:Wt(e,t,n)}}function Wu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Mm),t.forEach(function(r){var l=Wm.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function at(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=i),r&=~o}if(r=l,r=he()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Om(r/1960))-r,10e?16:e,Jt===null)var r=!1;else{if(e=Jt,Jt=null,vo=0,J&6)throw Error(L(331));var l=J;for(J|=4,F=e.current;F!==null;){var o=F,i=o.child;if(F.flags&16){var a=o.deletions;if(a!==null){for(var s=0;she()-aa?xn(e,0):sa|=n),Qe(e,t)}function kd(e,t){t===0&&(e.mode&1?(t=xl,xl<<=1,!(xl&130023424)&&(xl=4194304)):t=1);var n=Ie();e=zt(e,t),e!==null&&(rl(e,t,n),Qe(e,n))}function Hm(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),kd(e,n)}function Wm(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(L(314))}r!==null&&r.delete(t),kd(e,n)}var Ed;Ed=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||We.current)He=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return He=!1,jm(e,t,n);He=!!(e.flags&131072)}else He=!1,oe&&t.flags&1048576&&Lf(t,so,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Hl(e,t),e=t.pendingProps;var l=lr(t,Me.current);tr(t,n),l=ta(null,t,r,e,l,n);var o=na();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ve(r)?(o=!0,oo(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Gs(t),l.updater=Ro,t.stateNode=l,l._reactInternals=t,ls(t,r,e,n),t=ss(null,t,r,!0,o,n)):(t.tag=0,oe&&o&&Ws(t),Oe(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Hl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Qm(r),e=ut(r,e),l){case 0:t=is(null,t,r,e,n);break e;case 1:t=Du(null,t,r,e,n);break e;case 11:t=Ou(null,t,r,e,n);break e;case 14:t=Iu(null,t,r,ut(r.type,e),n);break e}throw Error(L(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ut(r,l),is(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ut(r,l),Du(e,t,r,l,n);case 3:e:{if(id(t),e===null)throw Error(L(387));r=t.pendingProps,o=t.memoizedState,l=o.element,Mf(e,t),co(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){l=ar(Error(L(423)),t),t=Au(e,t,r,n,l);break e}else if(r!==l){l=ar(Error(L(424)),t),t=Au(e,t,r,n,l);break e}else for(be=qt(t.stateNode.containerInfo.firstChild),Ye=t,oe=!0,ft=null,n=Tf(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(or(),r===l){t=Ft(e,t,n);break e}Oe(e,t,r,n)}t=t.child}return t;case 5:return zf(t),e===null&&ts(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,i=l.children,Gi(r,l)?i=null:o!==null&&Gi(r,o)&&(t.flags|=32),od(e,t),Oe(e,t,i,n),t.child;case 6:return e===null&&ts(t),null;case 13:return sd(e,t,n);case 4:return Xs(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ir(t,null,r,n):Oe(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ut(r,l),Ou(e,t,r,l,n);case 7:return Oe(e,t,t.pendingProps,n),t.child;case 8:return Oe(e,t,t.pendingProps.children,n),t.child;case 12:return Oe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,i=l.value,ee(ao,r._currentValue),r._currentValue=i,o!==null)if(ht(o.value,i)){if(o.children===l.children&&!We.current){t=Ft(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){i=o.child;for(var s=a.firstContext;s!==null;){if(s.context===r){if(o.tag===1){s=jt(-1,n&-n),s.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var p=u.pending;p===null?s.next=s:(s.next=p.next,p.next=s),u.pending=s}}o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),ns(o.return,n,t),a.lanes|=n;break}s=s.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(L(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),ns(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}Oe(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,tr(t,n),l=lt(l),r=r(l),t.flags|=1,Oe(e,t,r,n),t.child;case 14:return r=t.type,l=ut(r,t.pendingProps),l=ut(r.type,l),Iu(e,t,r,l,n);case 15:return rd(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ut(r,l),Hl(e,t),t.tag=1,Ve(r)?(e=!0,oo(t)):e=!1,tr(t,n),ed(t,r,l),ls(t,r,l,n),ss(null,t,r,!0,e,n);case 19:return ad(e,t,n);case 22:return ld(e,t,n)}throw Error(L(156,t.tag))};function Cd(e,t){return Gc(e,t)}function Vm(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nt(e,t,n,r){return new Vm(e,t,n,r)}function da(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Qm(e){if(typeof e=="function")return da(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ts)return 11;if(e===$s)return 14}return 2}function rn(e,t){var n=e.alternate;return n===null?(n=nt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ql(e,t,n,r,l,o){var i=2;if(r=e,typeof e=="function")da(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Un:return kn(n.children,l,o,t);case js:i=8,l|=8;break;case Pi:return e=nt(12,n,t,l|2),e.elementType=Pi,e.lanes=o,e;case Ri:return e=nt(13,n,t,l),e.elementType=Ri,e.lanes=o,e;case ji:return e=nt(19,n,t,l),e.elementType=ji,e.lanes=o,e;case Mc:return $o(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Tc:i=10;break e;case $c:i=9;break e;case Ts:i=11;break e;case $s:i=14;break e;case Vt:i=16,r=null;break e}throw Error(L(130,e==null?e:typeof e,""))}return t=nt(i,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function kn(e,t,n,r){return e=nt(7,e,r,t),e.lanes=n,e}function $o(e,t,n,r){return e=nt(22,e,r,t),e.elementType=Mc,e.lanes=n,e.stateNode={isHidden:!1},e}function Ei(e,t,n){return e=nt(6,e,null,t),e.lanes=n,e}function Ci(e,t,n){return t=nt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Km(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=li(0),this.expirationTimes=li(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=li(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function pa(e,t,n,r,l,o,i,a,s){return e=new Km(e,t,n,a,s),t===1?(t=1,o===!0&&(t|=8)):t=0,o=nt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Gs(o),e}function bm(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Pd)}catch(e){console.error(e)}}Pd(),Lc.exports=Ge;var Rd=Lc.exports,jd,Xu=Rd;jd=Xu.createRoot,Xu.hydrateRoot;/** - * react-router v7.8.2 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */var Zu="popstate";function Zm(e={}){function t(l,o){let{pathname:i="/",search:a="",hash:s=""}=jn(l.location.hash.substring(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),ws("",{pathname:i,search:a,hash:s},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(l,o){let i=l.document.querySelector("base"),a="";if(i&&i.getAttribute("href")){let s=l.location.href,u=s.indexOf("#");a=u===-1?s:s.slice(0,u)}return a+"#"+(typeof o=="string"?o:el(o))}function r(l,o){mt(l.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(o)})`)}return eg(t,n,r,e)}function ce(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function mt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function qm(){return Math.random().toString(36).substring(2,10)}function qu(e,t){return{usr:e.state,key:e.key,idx:t}}function ws(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?jn(t):t,state:n,key:t&&t.key||r||qm()}}function el({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function jn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function eg(e,t,n,r={}){let{window:l=document.defaultView,v5Compat:o=!1}=r,i=l.history,a="POP",s=null,u=p();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function p(){return(i.state||{idx:null}).idx}function v(){a="POP";let _=p(),h=_==null?null:_-u;u=_,s&&s({action:a,location:C.location,delta:h})}function y(_,h){a="PUSH";let f=ws(C.location,_,h);n&&n(f,_),u=p()+1;let d=qu(f,u),E=C.createHref(f);try{i.pushState(d,"",E)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;l.location.assign(E)}o&&s&&s({action:a,location:C.location,delta:1})}function w(_,h){a="REPLACE";let f=ws(C.location,_,h);n&&n(f,_),u=p();let d=qu(f,u),E=C.createHref(f);i.replaceState(d,"",E),o&&s&&s({action:a,location:C.location,delta:0})}function x(_){return tg(_)}let C={get action(){return a},get location(){return e(l,i)},listen(_){if(s)throw new Error("A history only accepts one active listener");return l.addEventListener(Zu,v),s=_,()=>{l.removeEventListener(Zu,v),s=null}},createHref(_){return t(l,_)},createURL:x,encodeLocation(_){let h=x(_);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:y,replace:w,go(_){return i.go(_)}};return C}function tg(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),ce(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:el(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function Td(e,t,n="/"){return ng(e,t,n,!1)}function ng(e,t,n,r){let l=typeof t=="string"?jn(t):t,o=Ot(l.pathname||"/",n);if(o==null)return null;let i=$d(e);rg(i);let a=null;for(let s=0;a==null&&s{let p={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(r)&&s)return;ce(p.relativePath.startsWith(r),`Absolute route path "${p.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(r.length)}let v=Tt([r,p.relativePath]),y=n.concat(p);i.children&&i.children.length>0&&(ce(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),$d(i.children,t,y,v,s)),!(i.path==null&&!i.index)&&t.push({path:v,score:cg(v,i.index),routesMeta:y})};return e.forEach((i,a)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,a);else for(let u of Md(i.path))o(i,a,!0,u)}),t}function Md(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return l?[o,""]:[o];let i=Md(r.join("/")),a=[];return a.push(...i.map(s=>s===""?o:[o,s].join("/"))),l&&a.push(...i),a.map(s=>e.startsWith("/")&&s===""?"/":s)}function rg(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:fg(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var lg=/^:[\w-]+$/,og=3,ig=2,sg=1,ag=10,ug=-2,ec=e=>e==="*";function cg(e,t){let n=e.split("/"),r=n.length;return n.some(ec)&&(r+=ug),t&&(r+=ig),n.filter(l=>!ec(l)).reduce((l,o)=>l+(lg.test(o)?og:o===""?sg:ag),r)}function fg(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function dg(e,t,n=!1){let{routesMeta:r}=e,l={},o="/",i=[];for(let a=0;a{if(p==="*"){let x=a[y]||"";i=o.slice(0,o.length-x.length).replace(/(.)\/+$/,"$1")}const w=a[y];return v&&!w?u[p]=void 0:u[p]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function pg(e,t=!1,n=!0){mt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,a,s)=>(r.push({paramName:a,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function hg(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return mt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ot(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function mg(e,t="/"){let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?jn(e):e;return{pathname:n?n.startsWith("/")?n:gg(n,t):t,search:wg(r),hash:Sg(l)}}function gg(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function Ni(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function vg(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function zd(e){let t=vg(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Fd(e,t,n,r=!1){let l;typeof e=="string"?l=jn(e):(l={...e},ce(!l.pathname||!l.pathname.includes("?"),Ni("?","pathname","search",l)),ce(!l.pathname||!l.pathname.includes("#"),Ni("#","pathname","hash",l)),ce(!l.search||!l.search.includes("#"),Ni("#","search","hash",l)));let o=e===""||l.pathname==="",i=o?"/":l.pathname,a;if(i==null)a=n;else{let v=t.length-1;if(!r&&i.startsWith("..")){let y=i.split("/");for(;y[0]==="..";)y.shift(),v-=1;l.pathname=y.join("/")}a=v>=0?t[v]:"/"}let s=mg(l,a),u=i&&i!=="/"&&i.endsWith("/"),p=(o||i===".")&&n.endsWith("/");return!s.pathname.endsWith("/")&&(u||p)&&(s.pathname+="/"),s}var Tt=e=>e.join("/").replace(/\/\/+/g,"/"),yg=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),wg=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Sg=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function xg(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var Od=["POST","PUT","PATCH","DELETE"];new Set(Od);var kg=["GET",...Od];new Set(kg);var pr=m.createContext(null);pr.displayName="DataRouter";var Io=m.createContext(null);Io.displayName="DataRouterState";m.createContext(!1);var Id=m.createContext({isTransitioning:!1});Id.displayName="ViewTransition";var Eg=m.createContext(new Map);Eg.displayName="Fetchers";var Cg=m.createContext(null);Cg.displayName="Await";var kt=m.createContext(null);kt.displayName="Navigation";var sl=m.createContext(null);sl.displayName="Location";var Dt=m.createContext({outlet:null,matches:[],isDataRoute:!1});Dt.displayName="Route";var va=m.createContext(null);va.displayName="RouteError";function Ng(e,{relative:t}={}){ce(al(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=m.useContext(kt),{hash:l,pathname:o,search:i}=ul(e,{relative:t}),a=o;return n!=="/"&&(a=o==="/"?n:Tt([n,o])),r.createHref({pathname:a,search:i,hash:l})}function al(){return m.useContext(sl)!=null}function Tn(){return ce(al(),"useLocation() may be used only in the context of a component."),m.useContext(sl).location}var Dd="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ad(e){m.useContext(kt).static||m.useLayoutEffect(e)}function _g(){let{isDataRoute:e}=m.useContext(Dt);return e?Ag():Lg()}function Lg(){ce(al(),"useNavigate() may be used only in the context of a component.");let e=m.useContext(pr),{basename:t,navigator:n}=m.useContext(kt),{matches:r}=m.useContext(Dt),{pathname:l}=Tn(),o=JSON.stringify(zd(r)),i=m.useRef(!1);return Ad(()=>{i.current=!0}),m.useCallback((s,u={})=>{if(mt(i.current,Dd),!i.current)return;if(typeof s=="number"){n.go(s);return}let p=Fd(s,JSON.parse(o),l,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Tt([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,o,l,e])}m.createContext(null);function ul(e,{relative:t}={}){let{matches:n}=m.useContext(Dt),{pathname:r}=Tn(),l=JSON.stringify(zd(n));return m.useMemo(()=>Fd(e,JSON.parse(l),r,t==="path"),[e,l,r,t])}function Pg(e,t){return Ud(e,t)}function Ud(e,t,n,r,l){var f;ce(al(),"useRoutes() may be used only in the context of a component.");let{navigator:o}=m.useContext(kt),{matches:i}=m.useContext(Dt),a=i[i.length-1],s=a?a.params:{},u=a?a.pathname:"/",p=a?a.pathnameBase:"/",v=a&&a.route;{let d=v&&v.path||"";Bd(u,!v||d.endsWith("*")||d.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${u}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. - -Please change the parent to .`)}let y=Tn(),w;if(t){let d=typeof t=="string"?jn(t):t;ce(p==="/"||((f=d.pathname)==null?void 0:f.startsWith(p)),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${d.pathname}" was given in the \`location\` prop.`),w=d}else w=y;let x=w.pathname||"/",C=x;if(p!=="/"){let d=p.replace(/^\//,"").split("/");C="/"+x.replace(/^\//,"").split("/").slice(d.length).join("/")}let _=Td(e,{pathname:C});mt(v||_!=null,`No routes matched location "${w.pathname}${w.search}${w.hash}" `),mt(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${w.pathname}${w.search}${w.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let h=Mg(_&&_.map(d=>Object.assign({},d,{params:Object.assign({},s,d.params),pathname:Tt([p,o.encodeLocation?o.encodeLocation(d.pathname).pathname:d.pathname]),pathnameBase:d.pathnameBase==="/"?p:Tt([p,o.encodeLocation?o.encodeLocation(d.pathnameBase).pathname:d.pathnameBase])})),i,n,r,l);return t&&h?m.createElement(sl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...w},navigationType:"POP"}},h):h}function Rg(){let e=Dg(),t=xg(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=m.createElement(m.Fragment,null,m.createElement("p",null,"💿 Hey developer 👋"),m.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",m.createElement("code",{style:o},"ErrorBoundary")," or"," ",m.createElement("code",{style:o},"errorElement")," prop on your route.")),m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:l},n):null,i)}var jg=m.createElement(Rg,null),Tg=class extends m.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?m.createElement(Dt.Provider,{value:this.props.routeContext},m.createElement(va.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function $g({routeContext:e,match:t,children:n}){let r=m.useContext(pr);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),m.createElement(Dt.Provider,{value:e},n)}function Mg(e,t=[],n=null,r=null,l=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,i=n==null?void 0:n.errors;if(i!=null){let u=o.findIndex(p=>p.route.id&&(i==null?void 0:i[p.route.id])!==void 0);ce(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,u+1))}let a=!1,s=-1;if(n)for(let u=0;u=0?o=o.slice(0,s+1):o=[o[0]];break}}}return o.reduceRight((u,p,v)=>{let y,w=!1,x=null,C=null;n&&(y=i&&p.route.id?i[p.route.id]:void 0,x=p.route.errorElement||jg,a&&(s<0&&v===0?(Bd("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,C=null):s===v&&(w=!0,C=p.route.hydrateFallbackElement||null)));let _=t.concat(o.slice(0,v+1)),h=()=>{let f;return y?f=x:w?f=C:p.route.Component?f=m.createElement(p.route.Component,null):p.route.element?f=p.route.element:f=u,m.createElement($g,{match:p,routeContext:{outlet:u,matches:_,isDataRoute:n!=null},children:f})};return n&&(p.route.ErrorBoundary||p.route.errorElement||v===0)?m.createElement(Tg,{location:n.location,revalidation:n.revalidation,component:x,error:y,children:h(),routeContext:{outlet:null,matches:_,isDataRoute:!0},unstable_onError:r}):h()},null)}function ya(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function zg(e){let t=m.useContext(pr);return ce(t,ya(e)),t}function Fg(e){let t=m.useContext(Io);return ce(t,ya(e)),t}function Og(e){let t=m.useContext(Dt);return ce(t,ya(e)),t}function wa(e){let t=Og(e),n=t.matches[t.matches.length-1];return ce(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Ig(){return wa("useRouteId")}function Dg(){var r;let e=m.useContext(va),t=Fg("useRouteError"),n=wa("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function Ag(){let{router:e}=zg("useNavigate"),t=wa("useNavigate"),n=m.useRef(!1);return Ad(()=>{n.current=!0}),m.useCallback(async(l,o={})=>{mt(n.current,Dd),n.current&&(typeof l=="number"?e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var tc={};function Bd(e,t,n){!t&&!tc[e]&&(tc[e]=!0,mt(!1,n))}m.memo(Ug);function Ug({routes:e,future:t,state:n,unstable_onError:r}){return Ud(e,void 0,n,r,t)}function Hd(e){ce(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function Bg({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:l,static:o=!1}){ce(!al(),"You cannot render a inside another . You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),a=m.useMemo(()=>({basename:i,navigator:l,static:o,future:{}}),[i,l,o]);typeof n=="string"&&(n=jn(n));let{pathname:s="/",search:u="",hash:p="",state:v=null,key:y="default"}=n,w=m.useMemo(()=>{let x=Ot(s,i);return x==null?null:{location:{pathname:x,search:u,hash:p,state:v,key:y},navigationType:r}},[i,s,u,p,v,y,r]);return mt(w!=null,` is not able to match the URL "${s}${u}${p}" because it does not start with the basename, so the won't render anything.`),w==null?null:m.createElement(kt.Provider,{value:a},m.createElement(sl.Provider,{children:t,value:w}))}function Hg({children:e,location:t}){return Pg(Ss(e),t)}function Ss(e,t=[]){let n=[];return m.Children.forEach(e,(r,l)=>{if(!m.isValidElement(r))return;let o=[...t,l];if(r.type===m.Fragment){n.push.apply(n,Ss(r.props.children,o));return}ce(r.type===Hd,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),ce(!r.props.index||!r.props.children,"An index route cannot have child routes.");let i={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=Ss(r.props.children,o)),n.push(i)}),n}var Kl="get",bl="application/x-www-form-urlencoded";function Do(e){return e!=null&&typeof e.tagName=="string"}function Wg(e){return Do(e)&&e.tagName.toLowerCase()==="button"}function Vg(e){return Do(e)&&e.tagName.toLowerCase()==="form"}function Qg(e){return Do(e)&&e.tagName.toLowerCase()==="input"}function Kg(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function bg(e,t){return e.button===0&&(!t||t==="_self")&&!Kg(e)}var Ml=null;function Yg(){if(Ml===null)try{new FormData(document.createElement("form"),0),Ml=!1}catch{Ml=!0}return Ml}var Jg=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function _i(e){return e!=null&&!Jg.has(e)?(mt(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${bl}"`),null):e}function Gg(e,t){let n,r,l,o,i;if(Vg(e)){let a=e.getAttribute("action");r=a?Ot(a,t):null,n=e.getAttribute("method")||Kl,l=_i(e.getAttribute("enctype"))||bl,o=new FormData(e)}else if(Wg(e)||Qg(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a `,x=`
${y}
`;return`
${w}${x}
`}),i=i.replace(/
\s*(?=
]*>[\s\S]*?<\/div>)\s*
/g,"$1"),i}function bv(e){const t=e.split(/\r?\n/);let n=null;for(let r=0;r/i,n=/<\/think(?:ing)?>/i,r=e.match(t);if(!r)return{think:null,answer:e};const l=r.index,o=r[0].length,i=e.substring(0,l).trim();let a=e.substring(l+o);const s=a.match(n);let u=null,p=i;return s?(u=a.substring(0,s.index).trim(),p+=a.substring(s.index+s[0].length)):u=a.trim(),{think:u||null,answer:p.trim()}}function Yv({content:e,streamOutput:t,sources:n}){const{think:r,answer:l}=Xd(e||""),[o,i]=Fe.useState(!1),a=!!r;return g.jsxs("div",{className:"assistant-message",children:[a&&g.jsxs("div",{className:"assistant-thoughts",children:[g.jsxs("button",{className:"think-toggle",onClick:()=>i(s=>!s),"aria-expanded":o?"true":"false","aria-controls":"think-content",children:[g.jsx("span",{className:"think-toggle-icon","aria-hidden":"true",children:o?"▾":"▸"}),"Thoughts"]}),o&&g.jsx("div",{id:"think-content",className:"think-content",dangerouslySetInnerHTML:{__html:dc(r)}})]}),g.jsx("div",{className:"msg-content",dangerouslySetInnerHTML:{__html:dc(l||e||"")}}),Array.isArray(n)&&n.length>0&&g.jsx("div",{className:"msg-sources chips",children:n.map((s,u)=>{let p=s,v=!1;try{const y=new URL(s);if(y.protocol==="file:"){v=!0;const w=y.pathname.split("/").filter(Boolean);p=decodeURIComponent(w[w.length-1]||s)}else p=(y.hostname||s).replace(/^www\./i,"")}catch{}return g.jsx("a",{className:"chip",href:s,target:"_blank",rel:"noreferrer",title:s,onClick:y=>{var w,x;if(v){y.preventDefault();try{const C=new URL(s);(x=(w=window.electronAPI)==null?void 0:w.openPath)==null||x.call(w,decodeURIComponent(C.pathname))}catch{}}},children:p},s+u)})})]})}const pc="websearch.searxUrl",hc="websearch.engines",mc="chat.libraryBySession";let Jv="http://127.0.0.1:8000";const Gv=48,Xv=24;function Zv(){var Ha;const[e,t]=m.useState([]),[n,r]=m.useState(null),[l,o]=m.useState("chats"),[i,a]=m.useState("General"),[s,u]=m.useState(null),[p,v]=m.useState(null),[y,w]=m.useState([]),[x,C]=m.useState([]),[_,h]=m.useState(null),[f,d]=m.useState(()=>{try{const c=localStorage.getItem(mc);return c?JSON.parse(c):{}}catch{return{}}}),[E,R]=m.useState(!1),[j,T]=m.useState(""),[O,W]=m.useState(""),[D,Z]=m.useState(!1),[me,it]=m.useState(""),[Et,cn]=m.useState(""),Le=m.useRef(null),Ze=m.useRef(null),M=m.useRef(null),[$,B]=m.useState(Jv),[q,ie]=m.useState("Default"),[P,A]=m.useState(!1),[Y,te]=m.useState(localStorage.getItem(pc)||"http://localhost:8888"),[Ue,Ao]=m.useState(()=>{try{const c=localStorage.getItem(hc);if(c)return JSON.parse(c)}catch{}return["duckduckgo","bing","wikipedia","github","stack_overflow"]});m.useEffect(()=>{localStorage.setItem(pc,Y||"")},[Y]),m.useEffect(()=>{try{localStorage.setItem(hc,JSON.stringify(Ue||[]))}catch{}},[Ue]);const[fn,Zd]=m.useState(!1),[At,Uo]=m.useState(!1),[ty,Bo]=m.useState(!0),[qd,$n]=m.useState([]),[cl,Ea]=m.useState({}),[ep,Ho]=m.useState(null),[Wo,fl]=m.useState("");function tp(c){const S=c.content||"";if(c.role==="assistant")try{const{answer:k}=Xd(S);return(k||S).trim()}catch{return S.trim()}return S}async function Ca(c){try{await navigator.clipboard.writeText(tp(c))}catch(S){console.error("Failed to copy message:",S)}}function dn(c,S,k,N={}){const{removeIfEmpty:z=!1}=N;t(U=>U.map(H=>{if(H.session_id!==c)return H;const I=[];for(const V of H.messages||[]){if(V.id!==S){I.push(V);continue}z&&!k||I.push({...V,content:k})}return{...H,messages:I}}))}function Ut(c){return(c==null?void 0:c.name)==="AbortError"}function Vo(c){return c instanceof Error&&c.message?c.message:String(c)}async function Na(c,S,k){if(!c)return{contextBlock:null,sources:[]};const z=await(await fetch(`${$}/libraries/${c}/context`,{method:"POST",headers:{"Content-Type":"application/json"},signal:k,body:JSON.stringify({prompt:S,top_k:5})})).json();return{contextBlock:typeof(z==null?void 0:z.context_block)=="string"&&z.context_block.trim()?z.context_block.trim():null,sources:Array.isArray(z==null?void 0:z.sources)?z.sources:[]}}function np(c,S){Ho(c),fl(S||"")}function dl(){Ho(null),fl("")}async function rp(c){var U;const S=(((U=On[c])==null?void 0:U.content)||"").trim(),N=(Wo??"").trim();if(N.length===0){dl();return}if(N===S){dl();return}const z=n;if(z){t(H=>H.map(I=>{if(I.session_id!==z)return I;const Re=(I.messages||[]).slice(0,c+1).map((ye,qe)=>qe===c?{...ye,content:N}:ye);return{...I,messages:Re}})),Ho(null),fl(""),requestAnimationFrame(()=>Xo("auto",z));try{const H=await fetch(`${$}/sessions/${z}/messages/${c}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:N})});if(!H.ok)throw new Error(`HTTP ${H.status}`)}catch(H){console.error("Failed to update message:",H),t(I=>I.map(V=>{if(V.session_id!==z)return V;const ye=(V.messages||[]).map((qe,Q)=>Q===c?{...qe,content:S}:qe);return{...V,messages:ye}}));return}await _a(c,N)}}async function _a(c,S=null){var Re,ye,qe,Q,pe,Ee;const k=n;if(At||!k||typeof c!="number")return;const N=((Re=e.find(G=>G.session_id===k))==null?void 0:Re.messages)||[];let z=c;for(let G=c;G>=0;G--)if(((ye=N[G])==null?void 0:ye.role)==="user"){z=G;break}t(G=>G.map(se=>se.session_id===k?{...se,messages:(se.messages||[]).slice(0,z+1)}:se));const U=$a(k);let H=S??(((qe=N[z])==null?void 0:qe.content)||""),I=[];const V=[];try{const G=Oa(k),se=S??(((Q=N[z])==null?void 0:Q.content)||"");if((pe=G==null?void 0:G.states)!=null&&pe.is_indexed)try{const K=await Na(G.slug,se,U.signal);K.contextBlock&&V.push(K.contextBlock),Array.isArray(K.sources)&&I.push(...K.sources)}catch(K){if(Ut(K))throw K;console.warn("local library enrichment (regenerate) failed",K)}if(fn)try{const K=N.slice(Math.max(0,z-7),z+1).map(ge=>({role:ge.role,content:ge.content||""}));K.length>0&&(K[K.length-1]={role:"user",content:se});const ne=await(await fetch(`${$}/websearch`,{method:"POST",headers:{"Content-Type":"application/json"},signal:U.signal,body:JSON.stringify({prompt:se,model:me,messages:K,history_limit:8,searx_url:Y||null,engines:Array.isArray(Ue)?Ue:null})})).json();ne&&typeof ne.context_block=="string"&&ne.context_block.trim()&&V.push(ne.context_block.trim()),Array.isArray(ne==null?void 0:ne.sources)&&I.push(...ne.sources)}catch(K){if(Ut(K))throw K;console.warn("web search enrichment (regenerate) failed",K)}if(I=[...new Set(I)],V.length>0?H=`${se} - -${V.join(` - -`)}`:H=null,P){const K=`msg-${Date.now()}-${Math.random()}`;let Nt="";t(ne=>ne.map(ge=>ge.session_id===k?{...ge,messages:[...ge.messages||[],{id:K,role:"assistant",content:"",sources:I}]}:ge));try{const ne=await fetch(`${$}/sessions/${k}/regenerate`,{method:"POST",headers:{"Content-Type":"application/json"},signal:U.signal,body:JSON.stringify({index:c,model:me,stream:!0,enriched_message:H,sources:I||[]})});if(!ne.ok)throw new Error(`HTTP ${ne.status}`);const ge=(Ee=ne.body)==null?void 0:Ee.getReader();if(!ge)throw new Error("Missing response body");const Ht=new TextDecoder;let gt=!1;for(;;){const{value:mn,done:Cp}=await ge.read();if(Cp)break;const Np=Ht.decode(mn,{stream:!0});Nt+=Np,dn(k,K,Nt),!gt&&Pe.current!==k&&(gt=!0,pn(Zo=>({...Zo,[k]:K})),$n(Zo=>[...new Set([...Zo,k])]))}Pe.current!==k?(pn(mn=>({...mn,[k]:K})),$n(mn=>[...new Set([...mn,k])])):Mn.current[k]?zn(mn=>({...mn,[k]:K})):requestAnimationFrame(()=>In(K,"smooth",k))}catch(ne){if(Ut(ne)){dn(k,K,Nt,{removeIfEmpty:!0});return}console.error(ne),dn(k,K,`Error: ${Vo(ne)}`,{removeIfEmpty:!0});return}}else{const K=await fetch(`${$}/sessions/${k}/regenerate`,{method:"POST",headers:{"Content-Type":"application/json"},signal:U.signal,body:JSON.stringify({index:c,model:me,stream:!1,enriched_message:H,sources:I||[]})});if(!K.ok)throw new Error(`HTTP ${K.status}`);const Nt=await K.json(),ne=`msg-${Date.now()}`;t(ge=>ge.map(Ht=>Ht.session_id===k?{...Ht,messages:[...Ht.messages||[],{role:"assistant",content:Nt.reply,id:ne,sources:I}]}:Ht)),Pe.current!==k?(pn(ge=>({...ge,[k]:ne})),$n(ge=>[...new Set([...ge,k])])):Mn.current[k]?zn(ge=>({...ge,[k]:ne})):requestAnimationFrame(()=>In(ne,"smooth",k))}}catch(G){Ut(G)||console.error(G)}finally{Qo(U)}}const[La,lp]=m.useState({}),Mn=m.useRef({}),[op,pn]=m.useState({}),hn=m.useRef({}),Pa=m.useRef({}),[Ra,zn]=m.useState({}),[ip,ja]=m.useState({}),Ta=(c,S,k)=>c!=null&&c.id?c.id:`${k}:${S}`;m.useEffect(()=>{var S;if(!n)return;const c=((S=e.find(k=>k.session_id===n))==null?void 0:S.messages)||[];ja(k=>{const N={};return c.forEach((z,U)=>{if(z.role!=="user")return;const H=Ta(z,U,n),V=(z.content||"").split(/\r\n|\r|\n/).length>30;N[H]=V?k[H]??!0:!1}),N})},[e,n]);function sp(c){ja(S=>({...S,[c]:!(S[c]??!0)}))}const hr=Fe.useCallback((c,S)=>{lp(k=>{const N={...k,[c]:S};return Mn.current=N,N})},[]),Fn=m.useRef(null),ap=m.useRef(!1),up=m.useRef(null),Pe=m.useRef(n);m.useEffect(()=>{Pe.current=n},[n]);const $a=Fe.useCallback(c=>{const S=new AbortController;return Fn.current={controller:S,sessionId:c},Uo(!0),S},[]),Qo=Fe.useCallback(c=>{var S;((S=Fn.current)==null?void 0:S.controller)===c&&(Fn.current=null,Uo(!1))},[]),cp=Fe.useCallback(()=>{const c=Fn.current;c&&(Fn.current=null,c.controller.abort(),Uo(!1))},[]);m.useEffect(()=>()=>{var c;(c=Fn.current)==null||c.controller.abort()},[]);const Bt=m.useRef(null),[fp,dp]=m.useState(230),[pl,Ma]=m.useState(!1),pp=Fe.useCallback(c=>{Ma(!0)},[]),Ko=Fe.useCallback(()=>{Ma(!1)},[]),bo=Fe.useCallback(c=>{if(pl){const S=Math.max(230,Math.min(500,c.clientX));dp(S)}},[pl]);Fe.useEffect(()=>(window.addEventListener("mousemove",bo),window.addEventListener("mouseup",Ko),()=>{window.removeEventListener("mousemove",bo),window.removeEventListener("mouseup",Ko)}),[bo,Ko]),Fe.useEffect(()=>{pl?document.body.classList.add("no-select"):document.body.classList.remove("no-select")},[pl]),Fe.useEffect(()=>{const c=async S=>{const k=S.target.closest(".codeblock__copy");if(!k)return;const N=k.closest(".codeblock"),z=N==null?void 0:N.querySelector("pre > code");if(z)try{await navigator.clipboard.writeText(z.textContent||""),k.classList.add("copied"),setTimeout(()=>k.classList.remove("copied"),800)}catch(U){console.error("Copy failed:",U)}};return document.addEventListener("click",c),()=>document.removeEventListener("click",c)},[]),m.useEffect(()=>{window.electronAPI.getSettings().then(S=>{B(S.ollamaApiUrl),ie(S.colorScheme||"Default"),it(S.chatModel||""),A(S.streamOutput||!1),Ea(S.scrollPositions||{}),tl(S.colorScheme||"Default")});const c=()=>{var S;l==="chats"&&((S=Ze.current)==null||S.focus())};return window.electronAPI.onWindowFocus(c),()=>{}},[l]),m.useEffect(()=>{tl(q)},[q]);const hp=c=>{!c||!$||fetch(`${$}/history?session_id=${encodeURIComponent(c)}`).then(S=>S.json()).then(S=>{t(k=>k.map(N=>N.session_id===c?{...N,messages:S.messages||[]}:N))}).catch(()=>{})};async function hl(){if($)try{const S=await(await fetch(`${$}/libraries`)).json(),k=Array.isArray(S.libraries)?S.libraries:[];if(w(k),k.length===0){h(null);return}k.some(N=>N.slug===_)||h(k[0].slug)}catch(c){console.warn("Failed to load libraries",c)}}async function Yo(){if($)try{const S=await(await fetch(`${$}/jobs`)).json();C(Array.isArray(S.jobs)?S.jobs:[])}catch(c){console.warn("Failed to load library jobs",c)}}async function za(c=null){const k=(typeof c=="string"?c:j).trim();if(!k){W("Name is required.");return}try{W("");const N=await fetch(`${$}/libraries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:k})});if(!N.ok){const U=await N.text();throw new Error(U||`HTTP ${N.status}`)}const z=await N.json();R(!1),T(""),await hl(),z!=null&&z.slug&&h(z.slug)}catch(N){console.error("Failed to create library",N),W(String((N==null?void 0:N.message)||N))}}m.useEffect(()=>{$&&(Bo(!0),fetch(`${$}/sessions`).then(c=>c.json()).then(c=>{const S=c.sessions.map(k=>({...k,messages:[]}));t(S),S.length>0?r(S[0].session_id):r(null),Bo(!1)}).catch(()=>{Bo(!1)}))},[$]),m.useEffect(()=>{$&&(hl(),Yo())},[$]),m.useEffect(()=>{try{localStorage.setItem(mc,JSON.stringify(f||{}))}catch{}},[f]),m.useEffect(()=>{if(!$)return;const c=setInterval(()=>{hl(),Yo()},3e3);return()=>clearInterval(c)},[$,l,_]),m.useEffect(()=>{hp(n)},[n]),m.useEffect(()=>{const c=new Set(y.map(S=>S.slug));d(S=>{let k=!1;const N={};for(const[z,U]of Object.entries(S||{}))c.has(U)?N[z]=U:k=!0;return k?N:S})},[y]);const Jo=c=>{o(c)},mp=c=>{Sp(c)},On=m.useMemo(()=>{var c;return((c=e.find(S=>S.session_id===n))==null?void 0:c.messages)||[]},[n,e]),ml=m.useMemo(()=>y.find(c=>c.slug===_)||null,[_,y]),Ct=n&&f[n]||null,st=m.useMemo(()=>y.find(c=>c.slug===Ct)||null,[Ct,y]),Fa=m.useMemo(()=>Ct?x.some(c=>c.slug===Ct&&(c.status==="queued"||c.status==="running")):!1,[Ct,x]),Go=m.useMemo(()=>{var c,S;return st?(c=st.files)!=null&&c.length?(S=st.states)!=null&&S.is_indexed?"":Fa?" (syncing)":" (needs sync)":" (empty)":""},[st,Fa]);function gp(c){return c&&f[c]||null}function Oa(c){const S=gp(c);return S&&y.find(k=>k.slug===S)||null}function Ia(c){return c?x.some(S=>S.slug===c&&(S.status==="queued"||S.status==="running")):!1}function Da(c,S){c&&d(k=>{const N={...k||{}};return S?N[c]=S:delete N[c],N})}function vp(c){c&&d(S=>{let k=!1;const N={};for(const[z,U]of Object.entries(S||{})){if(U===c){k=!0;continue}N[z]=U}return k?N:S})}m.useEffect(()=>{if(!D)return;const c=S=>{var k;(k=M.current)!=null&&k.contains(S.target)||Z(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[D]),m.useEffect(()=>{Z(!1)},[n,l]),m.useEffect(()=>{const c=n,S=l;return()=>{if(S==="chats"&&c){const k=typeof hn.current[c]=="number"?hn.current[c]:Le.current?Le.current.scrollTop:0;Ea(N=>{const z={...N,[c]:k};return window.electronAPI.updateSettings({scrollPositions:z}),z})}}},[n,l]),m.useEffect(()=>{const c=Le.current;if(!c)return;const S=()=>{const{scrollTop:k,scrollHeight:N,clientHeight:z}=c,U=N-k-z<=Xv;if(n){const H=Pa.current[n],I=typeof H=="number"&&kc.removeEventListener("scroll",S)},[n,hr]),m.useEffect(()=>{const c=n;c&&La[c]===!1&&zn(S=>{if(!(c in S))return S;const k={...S};return delete k[c],k})},[n,La]),m.useLayoutEffect(()=>{if(l!=="chats"||!n)return;const c=Le.current;if(!c)return;Bt.current=null;const S=()=>{if(Bt.current===n)return;const H=typeof hn.current[n]=="number"?hn.current[n]:void 0,I=typeof H=="number"?H:cl[n];if(typeof I=="number"){c.scrollTop=I,Bt.current=n;return}On.length>0&&(c.scrollTop=c.scrollHeight,Bt.current=n)};S();const k=requestAnimationFrame(S),N=()=>{Bt.current!==n&&requestAnimationFrame(S)},z=new MutationObserver(N);z.observe(c,{childList:!0,subtree:!0});const U=new ResizeObserver(N);return U.observe(c),()=>{cancelAnimationFrame(k),z.disconnect(),U.disconnect()}},[n,l,On.length,cl]),m.useEffect(()=>{if(l!=="chats"||!n||Bt.current===n)return;const c=typeof hn.current[n]=="number"?hn.current[n]:void 0;typeof(typeof c=="number"?c:cl[n])!="number"&&On.length>0&&requestAnimationFrame(()=>{const k=Le.current;k&&(k.scrollTop=k.scrollHeight,Bt.current=n)})},[On.length,n,l,cl]);const Xo=(c="smooth",S=null)=>{const k=Le.current;if(!k)return;const N=S??Pe.current;Pe.current===N&&(k.scrollTo({top:k.scrollHeight,behavior:c}),hr(N,!1))},In=(c,S="auto",k=null)=>{const N=Le.current;if(!N)return;const z=k??Pe.current;if(Pe.current!==z)return;const U=document.getElementById(c);if(U){const H=Math.max(0,U.offsetTop-Gv);N.scrollTo({top:H,behavior:S})}},yp=()=>{const c=Pe.current,S=Ra[c];S&&(In(S,"smooth",c),zn(k=>{const{[c]:N,...z}=k;return z}))};async function Aa(){var z,U,H;if(At||!Et.trim()||!me)return;let c=n,S=!1;if(c){const I=e.find(V=>V.session_id===c);S=I&&I.name==="New Chat"&&I.messages.length===0}else{const I=await Ua();await new Promise(V=>setTimeout(V,200)),c=I.session_id,S=!0}const k={role:"user",content:Et.trim(),id:`msg-${Date.now()}-${Math.random()}`};ap.current=!0,up.current=c,hr(c,!1),Pe.current===c&&(Bt.current=Pe.current),Rd.flushSync(()=>{t(I=>I.map(V=>V.session_id===c?{...V,messages:[...V.messages||[],k]}:V)),cn("")}),requestAnimationFrame(()=>Xo("auto",c));const N=$a(c);try{let I=[];try{I=[...(((z=e.find(Ee=>Ee.session_id===c))==null?void 0:z.messages)||[]).slice(-8).map(Ee=>({role:Ee.role,content:Ee.content||""})),{role:"user",content:k.content}]}catch{}let V=k.content,Re=[];const ye=[],qe=Oa(c);if((U=qe==null?void 0:qe.states)!=null&&U.is_indexed)try{const Q=await Na(qe.slug,k.content,N.signal);Q.contextBlock&&ye.push(Q.contextBlock),Array.isArray(Q.sources)&&Re.push(...Q.sources)}catch(Q){if(Ut(Q))throw Q;console.warn("local library enrichment failed",Q)}if(fn)try{const pe=await(await fetch(`${$}/websearch`,{method:"POST",headers:{"Content-Type":"application/json"},signal:N.signal,body:JSON.stringify({prompt:k.content,model:me,messages:I,history_limit:8,searx_url:Y||null,engines:Array.isArray(Ue)?Ue:null})})).json();pe&&typeof pe.context_block=="string"&&pe.context_block.trim()&&ye.push(pe.context_block.trim()),Array.isArray(pe==null?void 0:pe.sources)&&Re.push(...pe.sources)}catch(Q){if(Ut(Q))throw Q;console.warn("web search enrichment failed",Q)}if(Re=[...new Set(Re)],ye.length>0&&(V=`${k.content} - -${ye.join(` - -`)}`),P){const Q=`msg-${Date.now()}-${Math.random()}`;let pe="";const Ee={role:"assistant",content:"",id:Q,sources:Re};t(G=>G.map(se=>se.session_id===c?{...se,messages:[...se.messages||[],Ee]}:se));try{const G=await fetch(`${$}/chat`,{method:"POST",headers:{"Content-Type":"application/json"},signal:N.signal,body:JSON.stringify({session_id:c,model:me,message:k.content,enriched_message:ye.length>0?V:null,stream:!0,sources:Re||[]})});if(!G.ok)throw new Error(`HTTP ${G.status}`);const se=(H=G.body)==null?void 0:H.getReader();if(!se)throw new Error("Missing response body");const K=new TextDecoder;let Nt=!1;for(;;){const{value:ne,done:ge}=await se.read();if(ge){dn(c,Q,pe),Pe.current===c?Mn.current[c]?zn(gt=>({...gt,[c]:Q})):requestAnimationFrame(()=>In(Q,"smooth",c)):(pn(gt=>({...gt,[c]:Q})),$n(gt=>[...new Set([...gt,c])]));break}const Ht=K.decode(ne,{stream:!0});pe+=Ht,dn(c,Q,pe),Pe.current===c&&!Mn.current[c]&&Xo("auto",c),Pe.current!==c&&!Nt&&(pn(gt=>({...gt,[c]:Q})),Nt=!0)}}catch(G){if(Ut(G)){dn(c,Q,pe,{removeIfEmpty:!0});return}console.error("Failed to send message:",G),dn(c,Q,"Error: "+Vo(G),{removeIfEmpty:!0});return}}else{const Q=await fetch(`${$}/chat`,{method:"POST",headers:{"Content-Type":"application/json"},signal:N.signal,body:JSON.stringify({session_id:c,model:me,message:k.content,enriched_message:ye.length>0?V:null,stream:!1,sources:Re||[]})});if(!Q.ok)throw new Error(`HTTP ${Q.status}`);const pe=await Q.json(),Ee=`msg-${Date.now()}`,G={role:"assistant",content:pe.reply,id:Ee,sources:Re};t(se=>se.map(K=>K.session_id===c?{...K,messages:[...K.messages||[],G]}:K)),Ee&&(Pe.current===c?Mn.current[c]?zn(se=>({...se,[c]:Ee})):requestAnimationFrame(()=>In(Ee,"smooth",c)):pn(se=>({...se,[c]:Ee})))}Pe.current!==c&&$n(Q=>[...new Set([...Q,c])]),S&&fetch(`${$}/generate-title`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:c,message:k.content,model:me})}).then(Q=>Q.json()).then(Q=>{const pe=Q.title.replace(/[\s\S]*?<\/think(?:ing)?>/i,"").trim();t(Ee=>Ee.map(G=>G.session_id===c?{...G,name:pe}:G))})}catch(I){if(Ut(I)){Qo(N);return}console.error("Failed to send message:",I);const V={role:"assistant",content:"Error: "+Vo(I),id:`msg-${Date.now()}-${Math.random()}`};t(Re=>Re.map(ye=>ye.session_id===c?{...ye,messages:[...ye.messages,V]}:ye))}finally{Qo(N)}}function wp(){Zd(c=>!c)}async function Ua(){var z;const c="sess-"+Math.random().toString(36).slice(2)+Date.now().toString(36),k=await(await fetch(`${$}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:c})})).json(),N={...k,messages:[]};return t(U=>[N,...U]),r(k.session_id),(z=Ze.current)==null||z.focus(),k}function Sp(c){r(c),$n(k=>k.filter(N=>N!==c));const S=op[c];S&&requestAnimationFrame(()=>{let k=12;const N=()=>{if(!Le.current)return;let U=document.getElementById(S);if(!U){const H=e.find(I=>I.session_id===c);if(H&&Array.isArray(H.messages))for(let I=H.messages.length-1;I>=0;I--){const V=H.messages[I];if(V.role==="assistant"&&V.id){U=document.getElementById(V.id);break}}}U?(In(U.id,"smooth",c),pn(H=>{const{[c]:I,...V}=H;return V})):k-- >0&&requestAnimationFrame(N)};requestAnimationFrame(N)})}function xp(c,S){fetch(`${$}/sessions/${c}/rename`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:S})}).then(()=>{t(k=>k.map(N=>N.session_id===c?{...N,name:S}:N)),u(null)})}function kp(c,S){const k=(S||"").trim(),N=y.find(z=>z.slug===c);if(!N){v(null);return}if(!k||k===N.name){v(null);return}fetch(`${$}/libraries/${c}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:k})}).then(()=>{w(z=>z.map(U=>U.slug===c?{...U,name:k}:U)),v(null)})}function Ba(c){fetch(`${$}/sessions/${c}`,{method:"DELETE"}).then(()=>{const S=e.filter(k=>k.session_id!==c);t(S),d(k=>{const N={...k||{}};return delete N[c],N}),n===c&&r(S.length>0?S[0].session_id:null)})}m.useEffect(()=>{const c=e.filter(S=>S.name==="New Chat"&&S.session_id!==n&&S.messages.length===0);c.length>0&&c.forEach(S=>{Ba(S.session_id)})},[n,e,$]);const Ep=c=>{var k;window.getSelection().toString().length>0||document.activeElement!==Ze.current&&(c.target.closest(".msg")||(k=Ze.current)==null||k.focus())};return g.jsxs("div",{className:"app",style:{gridTemplateColumns:`${fp}px 1fr`},children:[g.jsxs("div",{className:"sidebar",children:[g.jsxs("div",{className:"sidebar-header",children:[g.jsx("div",{className:`sidebar-tab ${l==="chats"?"active":""}`,onClick:()=>Jo("chats"),children:"Chats"}),g.jsx("div",{className:`sidebar-tab ${l==="dbs"?"active":""}`,onClick:()=>Jo("dbs"),children:"DBs"}),g.jsx("div",{className:`sidebar-tab ${l==="settings"?"active":""}`,onClick:()=>Jo("settings"),children:"Settings"})]}),g.jsxs("div",{className:"sidebar-content",children:[l==="chats"&&g.jsx("div",{className:"chat-list",children:e.map(c=>g.jsx("div",{className:`chat-item ${c.session_id===n?"active":""}`,onClick:()=>mp(c.session_id),children:s===c.session_id?g.jsx("input",{type:"text",className:"rename-input",defaultValue:c.name,onBlur:()=>u(null),onKeyDown:S=>{S.key==="Enter"?xp(c.session_id,S.target.value):S.key==="Escape"&&u(null)},autoFocus:!0}):g.jsxs(g.Fragment,{children:[g.jsx("span",{children:c.name}),g.jsxs("div",{className:"chat-item-buttons",children:[qd.includes(c.session_id)&&g.jsx("div",{className:"unread-dot"}),g.jsx("button",{className:"icon-button",onClick:S=>{S.stopPropagation(),u(c.session_id)},children:g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-edit-2",children:g.jsx("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})})}),g.jsx("button",{className:"icon-button",onClick:S=>{S.stopPropagation(),Ba(c.session_id)},children:g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-x",children:[g.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),g.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]})},c.session_id))}),l==="dbs"&&g.jsx("div",{className:"db-list",children:y.length===0?g.jsx("div",{className:"empty-list-message",children:"No databases yet."}):y.map(c=>g.jsx("div",{className:`chat-item ${c.slug===_?"active":""}`,onClick:()=>h(c.slug),children:p===c.slug?g.jsx("input",{type:"text",className:"rename-input",defaultValue:c.name,onBlur:()=>v(null),onKeyDown:S=>{S.key==="Enter"?kp(c.slug,S.target.value):S.key==="Escape"&&v(null)},autoFocus:!0}):g.jsxs(g.Fragment,{children:[g.jsx("span",{children:c.name}),g.jsxs("div",{className:"chat-item-buttons",children:[Ct===c.slug&&g.jsx("div",{className:"db-active-badge",children:"Chat"}),Ia(c.slug)&&g.jsx("div",{className:"db-active-badge",children:"Syncing"}),g.jsx("button",{className:"icon-button",onClick:S=>{S.stopPropagation(),v(c.slug)},children:g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-edit-2",children:g.jsx("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})})})]})]})},c.slug))}),l==="settings"&&g.jsxs("div",{className:"settings-list",children:[g.jsx("div",{className:`settings-item ${i==="General"?"active":""}`,onClick:()=>a("General"),children:"General"}),g.jsx("div",{className:`settings-item ${i==="Interface"?"active":""}`,onClick:()=>a("Interface"),children:"Interface"}),g.jsx("div",{className:`settings-item ${i==="Websearch"?"active":""}`,onClick:()=>a("Websearch"),children:"Websearch"})]})]}),l!=="settings"&&g.jsxs("div",{className:"sidebar-footer",children:[l==="chats"&&g.jsx("button",{className:"button new-chat-button",onClick:Ua,children:"New Chat"}),l==="dbs"&&(E?g.jsxs("div",{className:"new-db-form",children:[g.jsx("input",{type:"text",className:"rename-input",value:j,onChange:c=>T(c.target.value),onKeyDown:c=>{c.key==="Enter"?za():c.key==="Escape"&&(R(!1),T(""),W(""))},placeholder:"Database name",autoFocus:!0}),O&&g.jsx("div",{className:"form-error",children:O}),g.jsxs("div",{className:"new-db-actions",children:[g.jsx("button",{className:"button new-db-button",onClick:()=>za(),children:"Create"}),g.jsx("button",{className:"button ghost",onClick:()=>{R(!1),T(""),W("")},children:"Cancel"})]})]}):g.jsx("button",{className:"button new-db-button",onClick:()=>{R(!0),W("")},children:"New Database"}))]}),g.jsx("div",{className:"resizer",onMouseDown:pp})]}),g.jsxs("div",{className:"main-content",children:[l==="chats"&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"header",children:[g.jsxs("strong",{children:["Chat - ",((Ha=e.find(c=>c.session_id===n))==null?void 0:Ha.name)||"New Chat"]}),st&&g.jsx("span",{className:"header-subtle",children:`DB: ${st.name}${Go}`})]}),g.jsx("div",{className:"chat",ref:Le,onClick:Ep,children:On.map((c,S)=>{const k=c.role==="user"&&ep===S;return g.jsx("div",{id:c.id,className:"msg "+(c.role==="user"?"user":"assistant")+(k?" editing":""),children:c.role==="assistant"?g.jsxs("div",{className:"assistant-message-wrapper",children:[g.jsx(Yv,{content:c.content,streamOutput:P,sources:c.sources}),!At&&g.jsxs("div",{className:"message-options-bar assistant-options",children:[g.jsx("button",{className:"icon-button",title:"Copy message",onClick:()=>Ca(c),children:g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),g.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}),g.jsx("button",{className:"icon-button",title:"Regenerate response",onClick:()=>_a(S),children:g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:g.jsx("path",{d:"M21.5 2v6h-6M2.5 22v-6h6M2 11.5a10 10 0 0 1 18.8-4.3M22 12.5a10 10 0 0 1-18.8 4.3"})})})]})]}):g.jsxs("div",{className:"user-message-wrapper",children:[k?g.jsxs("div",{className:"msg-content msg-content--user editing",children:[g.jsx("div",{className:"user-edit-shadow","aria-hidden":"true",children:Wo}),g.jsx(ac,{className:"edit-message-input edit-overlay",value:Wo,onChange:N=>fl(N.target.value),onBlur:dl,onKeyDown:N=>{N.key==="Escape"&&(N.preventDefault(),dl()),N.key==="Enter"&&!N.shiftKey&&(N.preventDefault(),rp(S))},autoFocus:!0,minRows:1})]}):(()=>{const N=c.content||"",z=N.split(/\r\n|\r|\n/),U=z.length>30,H=Ta(c,S,n),I=U?ip[H]??!0:!1,V=I?z.slice(0,30).join(` -`)+` -…`:N;return g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"msg-content msg-content--user",children:V}),U&&g.jsx("button",{className:"user-msg-expand",onClick:()=>sp(H),"aria-expanded":I?"false":"true",children:I?"Show entire message":"Collapse"})]})})(),!At&&!k&&g.jsxs("div",{className:"message-options-bar user-options",children:[g.jsx("button",{className:"icon-button",title:"Edit message",onClick:()=>np(S,c.content),children:g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("path",{d:"M12 20h9"}),g.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]})}),g.jsx("button",{className:"icon-button",title:"Copy message",onClick:()=>Ca(c),children:g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),g.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})]})},c.id||S)})},n),Ra[n]&&g.jsxs("button",{className:"new-msg-tip",onClick:yp,title:"Jump to the new message","aria-label":"Jump to the new message",children:["New message",g.jsx("span",{style:{marginLeft:6},children:"↓"})]}),g.jsx("div",{className:"footer",children:g.jsxs("div",{className:"footer-content-wrapper",children:[g.jsx(ac,{ref:Ze,className:"input",value:Et,onChange:c=>cn(c.target.value),onKeyDown:c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),Aa())},placeholder:"Ask any question...",maxRows:13}),g.jsxs("div",{className:"footer-tool-group",ref:M,children:[g.jsx("button",{type:"button",className:"db-picker-toggle"+(st?" active":""),onClick:()=>{n&&Z(c=>!c)},title:st?`Database: ${st.name}${Go}`:"Select database for this chat","aria-haspopup":"menu","aria-expanded":D,disabled:!n,children:g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[g.jsx("ellipse",{cx:"12",cy:"5",rx:"8",ry:"3"}),g.jsx("path",{d:"M4 5v6c0 1.7 3.6 3 8 3s8-1.3 8-3V5"}),g.jsx("path",{d:"M4 11v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6"})]})}),D&&g.jsxs("div",{className:"db-picker-menu",role:"menu",children:[g.jsxs("button",{type:"button",className:"db-picker-option"+(Ct?"":" selected"),onClick:()=>{Da(n,null),Z(!1)},children:[g.jsx("span",{children:"No database"}),!Ct&&g.jsx("span",{className:"db-picker-status",children:"Selected"})]}),y.length===0?g.jsx("div",{className:"db-picker-empty",children:"No databases yet."}):y.map(c=>{var z,U,H;const S=Ct===c.slug,k=Ia(c.slug),N=(z=c.files)!=null&&z.length?(U=c.states)!=null&&U.is_indexed?"Ready":k?"Syncing":"Needs sync":"Empty";return g.jsxs("button",{type:"button",className:"db-picker-option"+(S?" selected":""),disabled:!((H=c.files)!=null&&H.length),onClick:()=>{Da(n,c.slug),Z(!1)},children:[g.jsx("span",{children:c.name}),g.jsx("span",{className:"db-picker-status",children:S?"Selected":N})]},c.slug)})]})]}),g.jsx("button",{type:"button",className:"websearch-toggle"+(fn?" active":""),onClick:wp,title:"Toggle web search","aria-pressed":fn,children:g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[g.jsx("circle",{cx:"12",cy:"12",r:"10"}),g.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),g.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]})}),g.jsx("button",{className:"button",onClick:At?cp:Aa,title:At?"Cancel generation":"Send","aria-label":At?"Cancel generation":"Send",children:At?g.jsx("div",{className:"spinner"}):"Send"})]})})]}),l==="dbs"&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"header",children:[g.jsx("strong",{children:(ml==null?void 0:ml.name)||"Databases"}),st&&g.jsx("span",{className:"header-subtle",children:`Current chat DB: ${st.name}${Go}`})]}),g.jsx(Qv,{apiBase:$,library:ml,jobs:x,onRefresh:async()=>{await hl(),await Yo()},onDeleted:c=>{if(_===c){const S=y.find(k=>k.slug!==c);h((S==null?void 0:S.slug)||null)}vp(c)}})]}),l==="settings"&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"header",children:g.jsxs("strong",{children:[i," Settings"]})}),i==="General"&&g.jsx(Av,{onModelChange:it,streamOutput:P,onStreamOutputChange:A}),i==="Interface"&&g.jsx(Wv,{}),i==="Websearch"&&g.jsx(Kv,{searxUrl:Y,setSearxUrl:te,engines:Ue,setEngines:Ao})]})]})]})}function qv(){return m.useEffect(()=>{window.electronAPI.getSettings().then(e=>{tl(e.colorScheme||"Default")})},[]),g.jsx(Fe.StrictMode,{children:g.jsx(fv,{children:g.jsx(Hg,{children:g.jsx(Hd,{path:"/",element:g.jsx(Zv,{})})})})})}const ey=jd(document.getElementById("root"));ey.render(g.jsx(qv,{})); diff --git a/dist/assets/index-tD1u5GzG.css b/dist/assets/index-CNIMqiRf.css similarity index 80% rename from dist/assets/index-tD1u5GzG.css rename to dist/assets/index-CNIMqiRf.css index 461ffc6..bf72466 100644 --- a/dist/assets/index-tD1u5GzG.css +++ b/dist/assets/index-CNIMqiRf.css @@ -1 +1 @@ -:root{--bg: #0b1020;--panel: #141b34;--text: #e6e8ef;--muted: #9aa3b2;--accent: #6ea8fe;--border: #24304f}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--bg);color:var(--text);font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Inter,Helvetica,Arial}.no-select{-webkit-user-select:none;user-select:none;cursor:ew-resize!important}.app{display:grid;grid-template-columns:var(--sidebar-width, 230px) 1fr;grid-template-rows:1fr;height:100%}.sidebar{display:grid;grid-template-rows:auto 1fr auto;background:var(--panel);border-right:1px solid var(--border);height:100vh;overflow:hidden;position:relative}.sidebar span{font-size:14px}.resizer{width:13px;cursor:ew-resize;background:transparent;position:absolute;top:0;right:-5px;bottom:0;z-index:1}.sidebar-header{display:flex;justify-content:space-around;padding:0;background:var(--panel)}.sidebar-tab{flex-grow:1;text-align:center;padding:11px 16px;cursor:pointer;border-bottom:3px solid transparent;transition:background-color .2s ease}.sidebar-tab:hover{background-color:var(--hover-bg)}.sidebar-tab.active{background-color:var(--active-bg);border-bottom-color:var(--accent)}.sidebar-tab.active:hover{background-color:var(--active-bg)}.sidebar-content{flex-grow:1;overflow-y:auto}.db-list,.settings-list{padding:8px 0}.empty-list-message{padding:10px 16px;color:var(--muted);text-align:center}.settings-item{padding:10px 16px;cursor:pointer;border-left:3px solid transparent}.settings-item.active{background:var(--active-bg);border-left-color:var(--accent)}.settings-item.active:hover{background:var(--active-bg)}.settings-item:hover{background:var(--hover-bg)}.settings-footer-placeholder{height:40px;padding:12px 16px;border-top:1px solid var(--border);background:var(--panel)}.new-db-button{width:100%;padding:10px;background:var(--accent);border-color:var(--accent);color:var(--bg);font-weight:700}.new-db-button:hover{opacity:.9}.chat-list{overflow-y:auto;padding:8px 0}.chat-item{display:flex;justify-content:space-between;align-items:center;padding:10px 16px;cursor:pointer;border-left:3px solid transparent;overflow:hidden;white-space:nowrap}.chat-item span{flex-grow:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-item-buttons{display:flex;gap:8px;align-items:center}.unread-dot{width:8px;height:8px;background-color:red;border-radius:50%;margin-right:4px}.icon-button{background:none;border:none;color:var(--muted);cursor:pointer;font-size:16px;padding:0;display:flex;align-items:center;justify-content:center}.icon-button svg{width:16px;height:16px;stroke:var(--muted);transition:stroke .2s ease}.icon-button:hover svg{stroke:var(--accent)}.icon-button:hover{color:var(--accent)}.chat-item.active{background:var(--active-bg);border-left-color:var(--accent)}.chat-item:hover{background:var(--hover-bg)}.chat-item.active:hover{background:var(--active-bg)}.rename-input{background:var(--input-bg);border:1px solid var(--accent);color:var(--text);border-radius:10px;padding:8px 12px;outline:none;width:100%}::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--muted);border-radius:4px}::-webkit-scrollbar-thumb:hover{background:var(--accent)}.sidebar-footer{padding:12px 16px;background:var(--panel)}.new-db-form,.library-inline-form{display:grid;gap:8px}.new-db-actions{display:flex;gap:8px}.form-error{color:#ff9aa8;font-size:12px}.new-chat-button{width:100%;padding:10px;background:var(--accent);border-color:var(--accent);color:var(--bg);font-weight:700}.new-chat-button:hover{opacity:.9}.main-content{position:relative;display:grid;grid-template-rows:auto 1fr auto;height:100vh;overflow:hidden}.header{display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid var(--border);background:var(--panel)}.select,.input,.button{background:var(--input-bg);border:1px solid var(--border);color:var(--text);border-radius:10px;padding:8px 12px;outline:none}.footer-content-wrapper .button{flex-shrink:0}.select{min-width:220px}.button{cursor:pointer}.button:hover{border-color:var(--accent)}.button.ghost{background:transparent}.button.danger{border-color:#8f3d49;color:#ffb8c2}.button.danger:hover{border-color:#d86a79}.header-subtle{color:var(--muted);font-size:13px}.chat{display:grid;grid-template-columns:1fr minmax(auto,1000px) 1fr;align-content:start;gap:8px;padding:16px;overflow:auto}.chat>*{grid-column:2}.msg{padding:12px 14px;border-radius:12px;line-height:1.5;white-space:wrap;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Inter,Helvetica,Arial}textarea.input{resize:none;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Inter,Helvetica,Arial;overflow-y:auto;flex-grow:1}.msg.user{background:var(--user-msg-bg);margin-left:auto;max-width:80%;border:1px solid var(--border);margin-right:5px;margin-bottom:15px;transition:border-color .15s ease,box-shadow .15s ease}.msg.user.editing{border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 35%,transparent)}.msg.user .msg-content--user{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;position:relative}.msg.user .user-msg-expand{margin-top:8px;padding:0;background:transparent;border:none;color:var(--muted);font-weight:700;cursor:pointer;align-self:flex-start;margin-left:0;text-align:left}.msg.assistant{background:transparent;border:none;max-width:none;animation:fadeIn .3s ease-in-out;margin-bottom:30px}.user-message-wrapper{display:flex;flex-direction:column;align-items:flex-end;position:relative}.assistant-message-wrapper{display:flex;flex-direction:column;align-items:flex-start;position:relative}.message-options-bar{display:flex;gap:2px;padding:0;border-radius:8px;background-color:transparent;border:none;position:absolute;bottom:-30px}.user-options{right:-10px;bottom:-40px}.assistant-options{left:0}.message-options-bar .icon-button{padding:4px;border-radius:4px;border:none}.message-options-bar .icon-button:hover{background-color:var(--hover-bg)}.new-msg-tip{position:absolute;right:24px;bottom:84px;padding:8px 12px;border-radius:9999px;background:var(--accent);color:var(--bg);border:none;cursor:pointer;font-weight:600;box-shadow:0 6px 20px #00000059}.new-msg-tip:hover{opacity:.9}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.footer{display:flex;justify-content:center;padding:12px 16px;border-top:1px solid var(--border);background:var(--panel);align-items:flex-end}.footer-content-wrapper{display:flex;gap:8px;width:100%;max-width:1000px;align-items:flex-end}.footer-tool-group{position:relative;display:inline-flex;align-items:center}.settings-content-panel{padding:20px;overflow-y:auto;height:100%}.settings-category{margin-bottom:30px}.settings-category h2{color:var(--accent);margin-bottom:15px;font-size:1.3em}.setting-section{margin-bottom:20px;padding:15px;border-bottom:1px solid var(--border);background-color:var(--panel);border-radius:8px}.setting-section:last-child{border-bottom:none;margin-bottom:0}.setting-section h3{color:var(--text);margin-top:0;margin-bottom:10px;font-size:1.1em}.settings-content-panel .input,.settings-content-panel .select{width:100%;max-width:400px;padding:10px 12px;border-radius:8px;border:1px solid var(--border);background-color:var(--input-bg);color:var(--text);font-size:1em}.settings-content-panel .select{min-width:unset}.setting-control-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.range-input{width:min(360px,100%);accent-color:var(--accent)}.setting-value{min-width:48px;color:var(--text);font-variant-numeric:tabular-nums}.setting-description{margin:10px 0 0;color:var(--muted);line-height:1.5}.msg h1,.msg h2,.msg h3,.msg h4{margin:10px 0;color:var(--accent)}.msg blockquote{border-left:4px solid var(--accent);padding-left:15px;margin-left:0;color:var(--muted)}.msg ul{padding-left:20px}.msg li{margin-bottom:5px}.msg code{background-color:var(--input-bg);padding:2px 4px;border-radius:4px;font-family:monospace}.msg pre{background-color:var(--input-bg);padding:10px;border-radius:8px;overflow-x:auto;white-space:pre-wrap}.msg pre code{padding:0;background-color:transparent}.msg a{color:var(--text);display:inline-flex;align-items:center;gap:4px;position:relative;text-decoration:underline dotted;text-underline-offset:3px}.msg a .tooltip{visibility:hidden;width:auto;background-color:var(--panel);color:var(--text);text-align:center;border-radius:6px;padding:5px 10px;position:absolute;z-index:1;bottom:110%;left:50%;transform:translate(-50%);opacity:0;transition:opacity .3s;white-space:nowrap}.msg a:hover .tooltip{visibility:visible;opacity:1}.msg a:hover{color:var(--accent)}.msg a svg{width:14px;height:14px;stroke:var(--text);transition:stroke .2s ease}.msg a:hover svg{stroke:var(--accent)}.msg hr{border:none;border-top:1px solid var(--border);margin:20px 0}:root{--outline-w: 1px;--grid-w: 1px;--grid: var(--border)}.msg table.nice{border-collapse:separate;border-spacing:0;width:100%;margin:1rem 0;border-radius:12px;box-shadow:0 0 0 var(--outline-w) var(--border)}.msg table.nice th,.msg table.nice td{border:var(--grid-w) solid var(--grid);border-width:.5px;padding:.6rem .75rem;vertical-align:top}.msg table.nice thead tr:first-child th{border-top:0}.msg table.nice tr th:first-child,.msg table.nice tr td:first-child{border-left:0}.msg table.nice tr th:last-child,.msg table.nice tr td:last-child{border-right:0}.msg table.nice tbody tr:last-child td{border-bottom:0}.msg table.nice thead tr:first-child th{background-color:var(--panel)}.msg table.nice thead tr:first-child th:first-child{border-top-left-radius:12px;background-clip:padding-box}.msg table.nice thead tr:first-child th:last-child{border-top-right-radius:12px;background-clip:padding-box}.msg table.nice tbody tr:last-child td:first-child{border-bottom-left-radius:12px;background-clip:padding-box}.msg table.nice tbody tr:last-child td:last-child{border-bottom-right-radius:12px;background-clip:padding-box}.toggle-switch{position:relative;display:inline-block;width:50px;height:28px}.toggle-switch input{opacity:0;width:0;height:0}.slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:var(--input-bg);border:1px solid var(--border);transition:.4s;border-radius:28px}.slider:before{position:absolute;content:"";height:20px;width:20px;left:3px;bottom:3px;background-color:var(--muted);transition:.4s;border-radius:50%}input:checked+.slider{background-color:var(--accent)}input:checked+.slider:before{transform:translate(22px);background-color:var(--panel)}.spinner{border:3px solid rgba(255,255,255,.3);border-radius:50%;border-top:3px solid var(--accent);width:20px;height:20px;animation:spin 1s linear infinite;margin:0 auto}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.codeblock{border:1px solid var(--grid, #e5e7eb);border-radius:12px;overflow:hidden;margin:1rem 0}.codeblock__header{display:flex;align-items:center;justify-content:space-between;padding:.5rem .75rem;background:var(--panel);border-bottom:1px solid var(--grid);font-weight:600;font-size:.875rem}.codeblock__lang{opacity:.9}.codeblock__copy{display:inline-flex;align-items:center;gap:.25rem;border:0;background:transparent;padding:.25rem;border-radius:8px;cursor:pointer}.codeblock__copy:hover{background:#0000000f}.codeblock__copy.copied .icon-copy{transform:scale(1.05)}.codeblock__pre{margin:0;padding:.75rem;overflow:auto}.codeblock__code{display:block;white-space:pre}.assistant-message{display:block}.assistant-thoughts{margin-bottom:8px}.think-toggle{background:var(--active-bg);color:var(--muted);border:1px solid var(--border);border-radius:10px;font-size:12px;padding:4px 8px;cursor:pointer}.think-toggle:hover{color:var(--text);border-color:var(--accent)}.think-toggle-icon{display:inline-block;margin-right:6px}.think-content{margin-top:8px;padding:10px 12px;border:1px solid var(--border);border-radius:12px;background:var(--panel);color:var(--muted);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.5;overflow-x:auto;white-space:pre-wrap}.edit-message-input{display:block;width:100%;height:100%;background:transparent;border:0;padding:0;margin:0;color:inherit;font:inherit;line-height:inherit;letter-spacing:inherit;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;resize:none;overflow:hidden;outline:none}.edit-message-input:focus{border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 35%,transparent)}.user-edit-shadow{visibility:hidden;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}.edit-message-input.edit-overlay{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;background:transparent;border:0;padding:0;margin:0;color:inherit;font:inherit;line-height:inherit;letter-spacing:inherit;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;resize:none;overflow:hidden;outline:none;box-shadow:none}.websearch-toggle,.db-picker-toggle{background:transparent;border:0;padding:0;margin:0 .1rem 0 0;line-height:0;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;position:relative;top:-7.5px;color:var(--muted);box-shadow:none;outline:none;-webkit-tap-highlight-color:transparent}.websearch-toggle svg,.db-picker-toggle svg{width:20px;height:20px;pointer-events:none}.websearch-toggle.active,.db-picker-toggle.active{color:var(--accent)}.websearch-toggle:focus,.websearch-toggle:focus-visible,.db-picker-toggle:focus,.db-picker-toggle:focus-visible{outline:none;box-shadow:none}.db-picker-menu{position:absolute;right:0;bottom:calc(100% + 10px);min-width:240px;max-height:280px;overflow-y:auto;padding:6px;border-radius:12px;border:1px solid var(--border);background:var(--panel);box-shadow:0 14px 32px #00000059;z-index:20}.db-picker-option{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 10px;border:0;border-radius:10px;background:transparent;color:var(--text);cursor:pointer;text-align:left}.db-picker-option:hover:not(:disabled){background:var(--hover-bg)}.db-picker-option.selected{background:var(--active-bg)}.db-picker-option:disabled{color:var(--muted);cursor:not-allowed}.db-picker-status{flex-shrink:0;color:var(--muted);font-size:12px}.db-picker-empty{padding:10px;color:var(--muted);font-size:13px}.msg-sources{margin-top:8px;font-size:12px;color:var(--muted)}.msg-sources a{color:var(--accent);text-decoration:none;margin-right:8px}.msg-sources a:hover{text-decoration:underline}.msg-sources.chips{display:flex;flex-wrap:wrap;margin:.5rem 0}.msg-sources.chips .chip{display:inline-flex;align-items:center;padding:.25rem .6rem;border-radius:9999px;border:1px solid var(--border);text-decoration:none;font-size:.85rem;line-height:1;white-space:nowrap;margin-top:.5rem}.db-active-badge{margin-left:8px;padding:2px 8px;border-radius:999px;background:color-mix(in srgb,var(--accent) 20%,transparent);color:var(--accent);font-size:11px}.placeholder-view{height:100%;overflow:auto;padding:20px}.placeholder-view h1{margin-top:0}.library-panel{position:relative;display:flex;height:100%;min-height:0;overflow:hidden}.library-panel-scroll{flex:1;min-height:0;overflow:auto;padding:20px 20px 132px}.library-toolbar{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:18px}.library-states{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:14px}.state-pill{padding:6px 10px;border-radius:999px;border:1px solid var(--border);color:var(--muted);font-size:13px}.state-pill.ready{color:var(--text);border-color:color-mix(in srgb,var(--accent) 45%,var(--border))}.library-inline-form{margin-bottom:14px;padding:12px 14px;border-radius:12px;border:1px solid var(--border);background:color-mix(in srgb,var(--panel) 88%,black)}.danger-zone{border-color:#8f3d49}.library-toast-stack{position:absolute;right:20px;bottom:20px;left:20px;z-index:2;display:flex;flex-direction:column;align-items:flex-end;gap:10px;pointer-events:none}.library-toast{width:min(100%,560px);padding:12px 14px;border-radius:14px;border:1px solid var(--border);background:color-mix(in srgb,var(--panel) 88%,black);box-shadow:0 16px 36px #00000047;line-height:1.45;animation:libraryToastIn .18s ease-out}.library-toast.success{border-color:color-mix(in srgb,#69c4a1 60%,var(--border))}.library-toast.warning{border-color:color-mix(in srgb,#e18282 60%,var(--border))}@keyframes libraryToastIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.library-files h2{margin:18px 0 12px;font-size:16px}.library-file-list{display:grid;gap:10px}.library-file-row{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;padding:12px 14px;border-radius:12px;border:1px solid var(--border);background:color-mix(in srgb,var(--panel) 88%,black)}.library-file-meta{min-width:0;flex:1}.library-file-name{font-weight:600;margin-bottom:4px}.library-file-mode{display:inline-flex;align-items:center;margin-top:4px;padding:4px 8px;border-radius:999px;border:1px solid var(--border);color:var(--muted);font-size:11px;letter-spacing:.02em;text-transform:uppercase}.library-file-mode.enabled{color:var(--text);border-color:color-mix(in srgb,var(--accent) 45%,var(--border));background:color-mix(in srgb,var(--accent) 12%,transparent)}.library-file-path,.muted-copy{color:var(--muted);font-size:13px;word-break:break-word}.library-file-actions{display:flex;gap:8px;flex-shrink:0}.library-file-sync{margin-top:10px}.library-file-sync-row{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:baseline;margin-bottom:8px}.library-file-sync-label{font-size:12px;font-weight:700;letter-spacing:.02em;text-transform:uppercase}.library-file-sync-label.ready{color:#69c4a1}.library-file-sync-label.syncing,.library-file-sync-label.pending{color:var(--accent)}.library-file-sync-label.failed{color:#e18282}.library-file-sync-detail{color:var(--muted);font-size:12px;line-height:1.35}.library-file-progress{position:relative;width:100%;height:8px;overflow:hidden;border-radius:999px;background:color-mix(in srgb,var(--panel) 50%,black);border:1px solid color-mix(in srgb,var(--border) 80%,transparent)}.library-file-progress-bar{height:100%;width:0;border-radius:inherit;background:linear-gradient(90deg,color-mix(in srgb,var(--accent) 76%,white),var(--accent));transition:width .18s ease}.library-file-progress.ready .library-file-progress-bar{background:linear-gradient(90deg,#5cb48e,#7be1b5)}.library-file-progress.failed .library-file-progress-bar{background:linear-gradient(90deg,#c35d5d,#e18282)}@media (max-width: 760px){.library-panel-scroll{padding-bottom:168px}.library-toast-stack{right:12px;bottom:12px;left:12px}.library-file-row{flex-direction:column}.library-file-actions{width:100%;justify-content:flex-end}} +:root{--bg: #0b1020;--panel: #141b34;--text: #e6e8ef;--muted: #9aa3b2;--accent: #6ea8fe;--border: #24304f}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--bg);color:var(--text);font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Inter,Helvetica,Arial}.no-select{-webkit-user-select:none;user-select:none;cursor:ew-resize!important}.app{display:grid;grid-template-columns:var(--sidebar-width, 230px) 1fr;grid-template-rows:1fr;height:100%}.sidebar{display:grid;grid-template-rows:auto 1fr auto;background:var(--panel);border-right:1px solid var(--border);height:100vh;overflow:hidden;position:relative}.sidebar span{font-size:14px}.resizer{width:13px;cursor:ew-resize;background:transparent;position:absolute;top:0;right:-5px;bottom:0;z-index:1}.sidebar-header{display:flex;justify-content:space-around;padding:0;background:var(--panel)}.sidebar-tab{flex-grow:1;text-align:center;padding:11px 16px;cursor:pointer;border-bottom:3px solid transparent;transition:background-color .2s ease}.sidebar-tab:hover{background-color:var(--hover-bg)}.sidebar-tab.active{background-color:var(--active-bg);border-bottom-color:var(--accent)}.sidebar-tab.active:hover{background-color:var(--active-bg)}.sidebar-content{flex-grow:1;overflow-y:auto}.db-list,.settings-list{padding:8px 0}.empty-list-message{padding:10px 16px;color:var(--muted);text-align:center}.settings-item{padding:10px 16px;cursor:pointer;border-left:3px solid transparent}.settings-item.active{background:var(--active-bg);border-left-color:var(--accent)}.settings-item.active:hover{background:var(--active-bg)}.settings-item:hover{background:var(--hover-bg)}.settings-footer-placeholder{height:40px;padding:12px 16px;border-top:1px solid var(--border);background:var(--panel)}.new-db-button{width:100%;padding:10px;background:var(--accent);border-color:var(--accent);color:var(--bg);font-weight:700}.new-db-button:hover{opacity:.9}.chat-list{overflow-y:auto;padding:8px 0}.chat-item{display:flex;justify-content:space-between;align-items:center;padding:10px 16px;cursor:pointer;border-left:3px solid transparent;overflow:hidden;white-space:nowrap}.chat-item span{flex-grow:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-item-buttons{display:flex;gap:8px;align-items:center}.unread-dot{width:8px;height:8px;background-color:red;border-radius:50%;margin-right:4px}.icon-button{background:none;border:none;color:var(--muted);cursor:pointer;font-size:16px;padding:0;display:flex;align-items:center;justify-content:center}.icon-button svg{width:16px;height:16px;stroke:var(--muted);transition:stroke .2s ease}.icon-button:hover svg{stroke:var(--accent)}.icon-button:hover{color:var(--accent)}.chat-item.active{background:var(--active-bg);border-left-color:var(--accent)}.chat-item:hover{background:var(--hover-bg)}.chat-item.active:hover{background:var(--active-bg)}.rename-input{background:var(--input-bg);border:1px solid var(--accent);color:var(--text);border-radius:10px;padding:8px 12px;outline:none;width:100%}::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--muted);border-radius:4px}::-webkit-scrollbar-thumb:hover{background:var(--accent)}.sidebar-footer{padding:12px 16px;background:var(--panel)}.new-db-form,.library-inline-form{display:grid;gap:8px}.new-db-actions{display:flex;gap:8px}.form-error{color:#ff9aa8;font-size:12px}.new-chat-button{width:100%;padding:10px;background:var(--accent);border-color:var(--accent);color:var(--bg);font-weight:700}.new-chat-button:hover{opacity:.9}.main-content{position:relative;display:grid;grid-template-rows:auto 1fr auto;height:100vh;overflow:hidden}.header{display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid var(--border);background:var(--panel)}.select,.input,.button{background:var(--input-bg);border:1px solid var(--border);color:var(--text);border-radius:10px;padding:8px 12px;outline:none}.footer-content-wrapper .button{flex-shrink:0}.select{min-width:220px}.button{cursor:pointer}.button:hover{border-color:var(--accent)}.button.ghost{background:transparent}.button.danger{border-color:#8f3d49;color:#ffb8c2}.button.danger:hover{border-color:#d86a79}.header-subtle{color:var(--muted);font-size:13px}.chat{display:grid;grid-template-columns:1fr minmax(auto,1000px) 1fr;align-content:start;gap:8px;padding:16px;overflow:auto}.chat>*{grid-column:2}.msg{padding:12px 14px;border-radius:12px;line-height:1.5;white-space:wrap;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Inter,Helvetica,Arial}textarea.input{resize:none;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Inter,Helvetica,Arial;overflow-y:auto;flex-grow:1}.msg.user{background:var(--user-msg-bg);margin-left:auto;max-width:80%;border:1px solid var(--border);margin-right:5px;margin-bottom:15px;transition:border-color .15s ease,box-shadow .15s ease}.msg.user.editing{border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 35%,transparent)}.msg.user .msg-content--user{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;position:relative}.msg.user .user-msg-expand{margin-top:8px;padding:0;background:transparent;border:none;color:var(--muted);font-weight:700;cursor:pointer;align-self:flex-start;margin-left:0;text-align:left}.msg.assistant{background:transparent;border:none;max-width:none;animation:fadeIn .3s ease-in-out;margin-bottom:30px}.user-message-wrapper{display:flex;flex-direction:column;align-items:flex-end;position:relative}.assistant-message-wrapper{display:flex;flex-direction:column;align-items:flex-start;position:relative}.message-options-bar{display:flex;gap:2px;padding:0;border-radius:8px;background-color:transparent;border:none;position:absolute;bottom:-30px}.user-options{right:-10px;bottom:-40px}.assistant-options{left:0}.message-options-bar .icon-button{padding:4px;border-radius:4px;border:none}.message-options-bar .icon-button:hover{background-color:var(--hover-bg)}.new-msg-tip{position:absolute;right:24px;bottom:84px;padding:8px 12px;border-radius:9999px;background:var(--accent);color:var(--bg);border:none;cursor:pointer;font-weight:600;box-shadow:0 6px 20px #00000059}.new-msg-tip:hover{opacity:.9}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.footer{display:flex;justify-content:center;padding:12px 16px;border-top:1px solid var(--border);background:var(--panel);align-items:flex-end}.footer-content-wrapper{display:flex;gap:8px;width:100%;max-width:1000px;align-items:flex-end}.footer-tool-group{position:relative;display:inline-flex;align-items:center}.settings-content-panel{padding:20px;overflow-y:auto;height:100%}.settings-category{margin-bottom:30px}.settings-category h2{color:var(--accent);margin-bottom:15px;font-size:1.3em}.setting-section{margin-bottom:20px;padding:15px;border-bottom:1px solid var(--border);background-color:var(--panel);border-radius:8px}.setting-section:last-child{border-bottom:none;margin-bottom:0}.setting-section h3{color:var(--text);margin-top:0;margin-bottom:10px;font-size:1.1em}.settings-content-panel .input,.settings-content-panel .select{width:100%;max-width:400px;padding:10px 12px;border-radius:8px;border:1px solid var(--border);background-color:var(--input-bg);color:var(--text);font-size:1em}.settings-content-panel .select{min-width:unset}.setting-control-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.range-input{width:min(360px,100%);accent-color:var(--accent)}.setting-value{min-width:48px;color:var(--text);font-variant-numeric:tabular-nums}.setting-description{margin:10px 0 0;color:var(--muted);line-height:1.5}.msg h1,.msg h2,.msg h3,.msg h4{margin:10px 0;color:var(--accent)}.msg blockquote{border-left:4px solid var(--accent);padding-left:15px;margin-left:0;color:var(--muted)}.msg ul{padding-left:20px}.msg li{margin-bottom:5px}.msg code{background-color:var(--input-bg);padding:2px 4px;border-radius:4px;font-family:monospace}.msg pre{background-color:var(--input-bg);padding:10px;border-radius:8px;overflow-x:auto;white-space:pre-wrap}.msg pre code{padding:0;background-color:transparent}.msg a{color:var(--text);display:inline-flex;align-items:center;gap:4px;position:relative;text-decoration:underline dotted;text-underline-offset:3px}.msg a .tooltip{visibility:hidden;width:auto;background-color:var(--panel);color:var(--text);text-align:center;border-radius:6px;padding:5px 10px;position:absolute;z-index:1;bottom:110%;left:50%;transform:translate(-50%);opacity:0;transition:opacity .3s;white-space:nowrap}.msg a:hover .tooltip{visibility:visible;opacity:1}.msg a:hover{color:var(--accent)}.msg a svg{width:14px;height:14px;stroke:var(--text);transition:stroke .2s ease}.msg a:hover svg{stroke:var(--accent)}.msg hr{border:none;border-top:1px solid var(--border);margin:20px 0}:root{--outline-w: 1px;--grid-w: 1px;--grid: var(--border)}.msg table.nice{border-collapse:separate;border-spacing:0;width:100%;margin:1rem 0;border-radius:12px;box-shadow:0 0 0 var(--outline-w) var(--border)}.msg table.nice th,.msg table.nice td{border:var(--grid-w) solid var(--grid);border-width:.5px;padding:.6rem .75rem;vertical-align:top}.msg table.nice thead tr:first-child th{border-top:0}.msg table.nice tr th:first-child,.msg table.nice tr td:first-child{border-left:0}.msg table.nice tr th:last-child,.msg table.nice tr td:last-child{border-right:0}.msg table.nice tbody tr:last-child td{border-bottom:0}.msg table.nice thead tr:first-child th{background-color:var(--panel)}.msg table.nice thead tr:first-child th:first-child{border-top-left-radius:12px;background-clip:padding-box}.msg table.nice thead tr:first-child th:last-child{border-top-right-radius:12px;background-clip:padding-box}.msg table.nice tbody tr:last-child td:first-child{border-bottom-left-radius:12px;background-clip:padding-box}.msg table.nice tbody tr:last-child td:last-child{border-bottom-right-radius:12px;background-clip:padding-box}.toggle-switch{position:relative;display:inline-block;width:50px;height:28px}.toggle-switch input{opacity:0;width:0;height:0}.slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:var(--input-bg);border:1px solid var(--border);transition:.4s;border-radius:28px}.slider:before{position:absolute;content:"";height:20px;width:20px;left:3px;bottom:3px;background-color:var(--muted);transition:.4s;border-radius:50%}input:checked+.slider{background-color:var(--accent)}input:checked+.slider:before{transform:translate(22px);background-color:var(--panel)}.spinner{border:3px solid rgba(255,255,255,.3);border-radius:50%;border-top:3px solid var(--accent);width:20px;height:20px;animation:spin 1s linear infinite;margin:0 auto}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.codeblock{border:1px solid var(--grid, #e5e7eb);border-radius:12px;overflow:hidden;margin:1rem 0}.codeblock__header{display:flex;align-items:center;justify-content:space-between;padding:.5rem .75rem;background:var(--panel);border-bottom:1px solid var(--grid);font-weight:600;font-size:.875rem}.codeblock__lang{opacity:.9}.codeblock__copy{display:inline-flex;align-items:center;gap:.25rem;border:0;background:transparent;padding:.25rem;border-radius:8px;cursor:pointer}.codeblock__copy:hover{background:#0000000f}.codeblock__copy.copied .icon-copy{transform:scale(1.05)}.codeblock__pre{margin:0;padding:.75rem;overflow:auto}.codeblock__code{display:block;white-space:pre}.assistant-message{display:block}.assistant-thoughts{margin-bottom:8px}.think-toggle{background:var(--active-bg);color:var(--muted);border:1px solid var(--border);border-radius:10px;font-size:12px;padding:4px 8px;cursor:pointer}.think-toggle:hover{color:var(--text);border-color:var(--accent)}.think-toggle-icon{display:inline-block;margin-right:6px}.think-content{margin-top:8px;padding:10px 12px;border:1px solid var(--border);border-radius:12px;background:var(--panel);color:var(--muted);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.5;overflow-x:auto;white-space:pre-wrap}.edit-message-input{display:block;width:100%;height:100%;background:transparent;border:0;padding:0;margin:0;color:inherit;font:inherit;line-height:inherit;letter-spacing:inherit;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;resize:none;overflow:hidden;outline:none}.edit-message-input:focus{border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 35%,transparent)}.user-edit-shadow{visibility:hidden;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}.edit-message-input.edit-overlay{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;background:transparent;border:0;padding:0;margin:0;color:inherit;font:inherit;line-height:inherit;letter-spacing:inherit;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;resize:none;overflow:hidden;outline:none;box-shadow:none}.websearch-toggle,.db-picker-toggle{background:transparent;border:0;padding:0;margin:0 .1rem 0 0;line-height:0;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;position:relative;top:-7.5px;color:var(--muted);box-shadow:none;outline:none;-webkit-tap-highlight-color:transparent}.websearch-toggle svg,.db-picker-toggle svg{width:20px;height:20px;pointer-events:none}.websearch-toggle.active,.db-picker-toggle.active{color:var(--accent)}.websearch-toggle:focus,.websearch-toggle:focus-visible,.db-picker-toggle:focus,.db-picker-toggle:focus-visible{outline:none;box-shadow:none}.db-picker-menu{position:absolute;right:0;bottom:calc(100% + 10px);min-width:240px;max-height:280px;overflow-y:auto;padding:6px;border-radius:12px;border:1px solid var(--border);background:var(--panel);box-shadow:0 14px 32px #00000059;z-index:20}.db-picker-option{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 10px;border:0;border-radius:10px;background:transparent;color:var(--text);cursor:pointer;text-align:left}.db-picker-option:hover:not(:disabled){background:var(--hover-bg)}.db-picker-option.selected{background:var(--active-bg)}.db-picker-option:disabled{color:var(--muted);cursor:not-allowed}.db-picker-status{flex-shrink:0;color:var(--muted);font-size:12px}.db-picker-empty{padding:10px;color:var(--muted);font-size:13px}.msg-sources{margin-top:8px;font-size:12px;color:var(--muted)}.msg-sources a{color:var(--accent);text-decoration:none;margin-right:8px}.msg-sources a:hover{text-decoration:underline}.msg-sources.chips{display:flex;flex-wrap:wrap;margin:.5rem 0}.msg-sources.chips .chip{display:inline-flex;align-items:center;padding:.25rem .6rem;border-radius:9999px;border:1px solid var(--border);text-decoration:none;font-size:.85rem;line-height:1;white-space:nowrap;margin-top:.5rem}.db-active-badge{margin-left:8px;padding:2px 8px;border-radius:999px;background:color-mix(in srgb,var(--accent) 20%,transparent);color:var(--accent);font-size:11px}.placeholder-view{height:100%;overflow:auto;padding:20px}.placeholder-view h1{margin-top:0}.library-panel{position:relative;display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}.library-panel-scroll{flex:1;min-height:0;overflow:auto;padding:20px}.library-inline-form{margin-bottom:14px;padding:12px 14px;border-radius:12px;border:1px solid var(--border);background:color-mix(in srgb,var(--panel) 88%,black)}.danger-zone{border-color:#8f3d49}.library-toast-stack{position:absolute;right:20px;bottom:92px;left:20px;z-index:2;display:flex;flex-direction:column;align-items:flex-end;gap:10px;pointer-events:none}.library-toast{width:min(100%,560px);padding:12px 14px;border-radius:14px;border:1px solid var(--border);background:color-mix(in srgb,var(--panel) 88%,black);box-shadow:0 16px 36px #00000047;line-height:1.45;animation:libraryToastIn .18s ease-out}.library-toast.success{border-color:color-mix(in srgb,#69c4a1 60%,var(--border))}.library-toast.warning{border-color:color-mix(in srgb,#e18282 60%,var(--border))}@keyframes libraryToastIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.library-footer-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px;padding:14px 20px 20px;border-top:1px solid var(--border);background:color-mix(in srgb,var(--panel) 94%,black)}.library-files h2{margin:0 0 12px;font-size:16px}.library-file-list{display:grid;gap:10px}.library-file-row{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;padding:12px 14px;border-radius:12px;border:1px solid var(--border);background:color-mix(in srgb,var(--panel) 88%,black)}.library-file-meta{min-width:0;flex:1}.library-file-name{font-weight:600;margin-bottom:4px}.library-file-mode{display:inline-flex;align-items:center;margin-top:4px;padding:4px 8px;border-radius:999px;border:1px solid var(--border);color:var(--muted);font-size:11px;letter-spacing:.02em;text-transform:uppercase}.library-file-mode.enabled{color:var(--text);border-color:color-mix(in srgb,var(--accent) 45%,var(--border));background:color-mix(in srgb,var(--accent) 12%,transparent)}.library-file-path,.muted-copy{color:var(--muted);font-size:13px;word-break:break-word}.library-file-actions{display:flex;gap:8px;flex-shrink:0}.library-file-sync{margin-top:10px}.library-file-sync-row{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:baseline;margin-bottom:8px}.library-file-sync-label{font-size:12px;font-weight:700;letter-spacing:.02em;text-transform:uppercase}.library-file-sync-label.ready{color:#69c4a1}.library-file-sync-label.syncing,.library-file-sync-label.pending{color:var(--accent)}.library-file-sync-label.failed{color:#e18282}.library-file-sync-detail{color:var(--muted);font-size:12px;line-height:1.35}.library-file-progress{position:relative;width:100%;height:8px;overflow:hidden;border-radius:999px;background:color-mix(in srgb,var(--panel) 50%,black);border:1px solid color-mix(in srgb,var(--border) 80%,transparent)}.library-file-progress-bar{height:100%;width:0;border-radius:inherit;background:linear-gradient(90deg,color-mix(in srgb,var(--accent) 76%,white),var(--accent));transition:width .18s ease}.library-file-progress.ready .library-file-progress-bar{background:linear-gradient(90deg,#5cb48e,#7be1b5)}.library-file-progress.failed .library-file-progress-bar{background:linear-gradient(90deg,#c35d5d,#e18282)}@media (max-width: 760px){.library-toast-stack{right:12px;bottom:124px;left:12px}.library-footer-actions{padding:12px}.library-file-row{flex-direction:column}.library-file-actions{width:100%;justify-content:flex-end}} diff --git a/dist/assets/index-DBFjvGi0.js b/dist/assets/index-DBFjvGi0.js new file mode 100644 index 0000000..ed2035d --- /dev/null +++ b/dist/assets/index-DBFjvGi0.js @@ -0,0 +1,73 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function _p(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mc={exports:{}},xo={},gc={exports:{}},K={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var tl=Symbol.for("react.element"),Lp=Symbol.for("react.portal"),Pp=Symbol.for("react.fragment"),Rp=Symbol.for("react.strict_mode"),jp=Symbol.for("react.profiler"),Tp=Symbol.for("react.provider"),$p=Symbol.for("react.context"),Mp=Symbol.for("react.forward_ref"),zp=Symbol.for("react.suspense"),Fp=Symbol.for("react.memo"),Op=Symbol.for("react.lazy"),Ha=Symbol.iterator;function Ip(e){return e===null||typeof e!="object"?null:(e=Ha&&e[Ha]||e["@@iterator"],typeof e=="function"?e:null)}var vc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},yc=Object.assign,wc={};function ur(e,t,n){this.props=e,this.context=t,this.refs=wc,this.updater=n||vc}ur.prototype.isReactComponent={};ur.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ur.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Sc(){}Sc.prototype=ur.prototype;function ks(e,t,n){this.props=e,this.context=t,this.refs=wc,this.updater=n||vc}var Es=ks.prototype=new Sc;Es.constructor=ks;yc(Es,ur.prototype);Es.isPureReactComponent=!0;var Wa=Array.isArray,xc=Object.prototype.hasOwnProperty,Cs={current:null},kc={key:!0,ref:!0,__self:!0,__source:!0};function Ec(e,t,n){var r,l={},o=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)xc.call(t,r)&&!kc.hasOwnProperty(r)&&(l[r]=t[r]);var a=arguments.length-2;if(a===1)l.children=n;else if(1>>1,se=x[H];if(0>>1;Hl(kt,F))Etl(Je,kt)?(x[H]=Je,x[Et]=F,H=Et):(x[H]=kt,x[Be]=F,H=Be);else if(Etl(Je,F))x[H]=Je,x[Et]=F,H=Et;else break e}}return _}function l(x,_){var F=x.sortIndex-_.sortIndex;return F!==0?F:x.id-_.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var s=[],u=[],p=1,g=null,y=3,w=!1,k=!1,N=!1,P=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,f=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(x){for(var _=n(u);_!==null;){if(_.callback===null)r(u);else if(_.startTime<=x)r(u),_.sortIndex=_.expirationTime,t(s,_);else break;_=n(u)}}function C(x){if(N=!1,d(x),!k)if(n(s)!==null)k=!0,Ee(j);else{var _=n(u);_!==null&&Ye(C,_.startTime-x)}}function j(x,_){k=!1,N&&(N=!1,h(O),O=-1),w=!0;var F=y;try{for(d(_),g=n(s);g!==null&&(!(g.expirationTime>_)||x&&!G());){var H=g.callback;if(typeof H=="function"){g.callback=null,y=g.priorityLevel;var se=H(g.expirationTime<=_);_=e.unstable_now(),typeof se=="function"?g.callback=se:g===n(s)&&r(s),d(_)}else r(s);g=n(s)}if(g!==null)var lt=!0;else{var Be=n(u);Be!==null&&Ye(C,Be.startTime-_),lt=!1}return lt}finally{g=null,y=F,w=!1}}var T=!1,$=null,O=-1,B=5,D=-1;function G(){return!(e.unstable_now()-Dx||125H?(x.sortIndex=F,t(u,x),n(s)===null&&x===n(u)&&(N?(h(O),O=-1):N=!0,Ye(C,F-H))):(x.sortIndex=se,t(s,x),k||w||(k=!0,Ee(j))),x},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(x){var _=y;return function(){var F=y;y=_;try{return x.apply(this,arguments)}finally{y=F}}}})(Pc);Lc.exports=Pc;var Yp=Lc.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Jp=m,Qe=Yp;function R(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_i=Object.prototype.hasOwnProperty,Gp=/^[: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]*$/,Qa={},Ka={};function Xp(e){return _i.call(Ka,e)?!0:_i.call(Qa,e)?!1:Gp.test(e)?Ka[e]=!0:(Qa[e]=!0,!1)}function Zp(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function qp(e,t,n,r){if(t===null||typeof t>"u"||Zp(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Fe(e,t,n,r,l,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var ke={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ke[e]=new Fe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ke[t]=new Fe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ke[e]=new Fe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ke[e]=new Fe(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ke[e]=new Fe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ke[e]=new Fe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ke[e]=new Fe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ke[e]=new Fe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ke[e]=new Fe(e,5,!1,e.toLowerCase(),null,!1,!1)});var _s=/[\-:]([a-z])/g;function Ls(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(_s,Ls);ke[t]=new Fe(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(_s,Ls);ke[t]=new Fe(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(_s,Ls);ke[t]=new Fe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ke[e]=new Fe(e,1,!1,e.toLowerCase(),null,!1,!1)});ke.xlinkHref=new Fe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ke[e]=new Fe(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ps(e,t,n,r){var l=ke.hasOwnProperty(t)?ke[t]:null;(l!==null?l.type!==0:r||!(2a||l[i]!==o[a]){var s=` +`+l[i].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=i&&0<=a);break}}}finally{ei=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Er(e):""}function eh(e){switch(e.tag){case 5:return Er(e.type);case 16:return Er("Lazy");case 13:return Er("Suspense");case 19:return Er("SuspenseList");case 0:case 2:case 15:return e=ti(e.type,!1),e;case 11:return e=ti(e.type.render,!1),e;case 1:return e=ti(e.type,!0),e;default:return""}}function ji(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case An:return"Fragment";case Dn:return"Portal";case Li:return"Profiler";case Rs:return"StrictMode";case Pi:return"Suspense";case Ri:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Tc:return(e.displayName||"Context")+".Consumer";case jc:return(e._context.displayName||"Context")+".Provider";case js:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ts:return t=e.displayName||null,t!==null?t:ji(e.type)||"Memo";case Vt:t=e._payload,e=e._init;try{return ji(e(t))}catch{}}return null}function th(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ji(t);case 8:return t===Rs?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ln(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Mc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function nh(e){var t=Mc(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yl(e){e._valueTracker||(e._valueTracker=nh(e))}function zc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Mc(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Jl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ti(e,t){var n=t.checked;return ie({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ya(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ln(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Fc(e,t){t=t.checked,t!=null&&Ps(e,"checked",t,!1)}function $i(e,t){Fc(e,t);var n=ln(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Mi(e,t.type,n):t.hasOwnProperty("defaultValue")&&Mi(e,t.type,ln(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ja(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Mi(e,t,n){(t!=="number"||Jl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Cr=Array.isArray;function Gn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=wl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ir(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Lr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},rh=["Webkit","ms","Moz","O"];Object.keys(Lr).forEach(function(e){rh.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Lr[t]=Lr[e]})});function Ac(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Lr.hasOwnProperty(e)&&Lr[e]?(""+t).trim():t+"px"}function Uc(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Ac(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var lh=ie({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Oi(e,t){if(t){if(lh[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(R(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(R(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(R(61))}if(t.style!=null&&typeof t.style!="object")throw Error(R(62))}}function Ii(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Di=null;function $s(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ai=null,Xn=null,Zn=null;function Za(e){if(e=ll(e)){if(typeof Ai!="function")throw Error(R(280));var t=e.stateNode;t&&(t=_o(t),Ai(e.stateNode,e.type,t))}}function Bc(e){Xn?Zn?Zn.push(e):Zn=[e]:Xn=e}function Hc(){if(Xn){var e=Xn,t=Zn;if(Zn=Xn=null,Za(e),t)for(e=0;e>>=0,e===0?32:31-(mh(e)/gh|0)|0}var Sl=64,xl=4194304;function Nr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ql(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var a=i&~l;a!==0?r=Nr(a):(o&=i,o!==0&&(r=Nr(o)))}else i=n&~l,i!==0?r=Nr(i):o!==0&&(r=Nr(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,o=t&-t,l>=o||l===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function nl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ct(t),e[t]=n}function Sh(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Rr),su=" ",au=!1;function uf(e,t){switch(e){case"keyup":return Yh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Un=!1;function Gh(e,t){switch(e){case"compositionend":return cf(t);case"keypress":return t.which!==32?null:(au=!0,su);case"textInput":return e=t.data,e===su&&au?null:e;default:return null}}function Xh(e,t){if(Un)return e==="compositionend"||!Us&&uf(e,t)?(e=sf(),Il=Is=Yt=null,Un=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=du(n)}}function hf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function mf(){for(var e=window,t=Jl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Jl(e.document)}return t}function Bs(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function im(e){var t=mf(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&hf(n.ownerDocument.documentElement,n)){if(r!==null&&Bs(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,o=Math.min(r.start,l);r=r.end===void 0?o:Math.min(r.end,l),!e.extend&&o>r&&(l=r,r=o,o=l),l=pu(n,o);var i=pu(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Bn=null,Qi=null,Tr=null,Ki=!1;function hu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ki||Bn==null||Bn!==Jl(r)||(r=Bn,"selectionStart"in r&&Bs(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Tr&&Wr(Tr,r)||(Tr=r,r=no(Qi,"onSelect"),0Vn||(e.current=Zi[Vn],Zi[Vn]=null,Vn--)}function X(e,t){Vn++,Zi[Vn]=e.current,e.current=t}var on={},Re=an(on),De=an(!1),kn=on;function rr(e,t){var n=e.type.contextTypes;if(!n)return on;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in n)l[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Ae(e){return e=e.childContextTypes,e!=null}function lo(){ee(De),ee(Re)}function xu(e,t,n){if(Re.current!==on)throw Error(R(168));X(Re,t),X(De,n)}function Cf(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(R(108,th(e)||"Unknown",l));return ie({},n,r)}function oo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||on,kn=Re.current,X(Re,e),X(De,De.current),!0}function ku(e,t,n){var r=e.stateNode;if(!r)throw Error(R(169));n?(e=Cf(e,t,kn),r.__reactInternalMemoizedMergedChildContext=e,ee(De),ee(Re),X(Re,e)):ee(De),X(De,n)}var Lt=null,Lo=!1,mi=!1;function Nf(e){Lt===null?Lt=[e]:Lt.push(e)}function ym(e){Lo=!0,Nf(e)}function un(){if(!mi&&Lt!==null){mi=!0;var e=0,t=J;try{var n=Lt;for(J=1;e>=i,l-=i,Pt=1<<32-ct(t)+l|n<O?(B=$,$=null):B=$.sibling;var D=y(h,$,d[O],C);if(D===null){$===null&&($=B);break}e&&$&&D.alternate===null&&t(h,$),f=o(D,f,O),T===null?j=D:T.sibling=D,T=D,$=B}if(O===d.length)return n(h,$),te&&mn(h,O),j;if($===null){for(;OO?(B=$,$=null):B=$.sibling;var G=y(h,$,D.value,C);if(G===null){$===null&&($=B);break}e&&$&&G.alternate===null&&t(h,$),f=o(G,f,O),T===null?j=G:T.sibling=G,T=G,$=B}if(D.done)return n(h,$),te&&mn(h,O),j;if($===null){for(;!D.done;O++,D=d.next())D=g(h,D.value,C),D!==null&&(f=o(D,f,O),T===null?j=D:T.sibling=D,T=D);return te&&mn(h,O),j}for($=r(h,$);!D.done;O++,D=d.next())D=w($,h,O,D.value,C),D!==null&&(e&&D.alternate!==null&&$.delete(D.key===null?O:D.key),f=o(D,f,O),T===null?j=D:T.sibling=D,T=D);return e&&$.forEach(function(ge){return t(h,ge)}),te&&mn(h,O),j}function P(h,f,d,C){if(typeof d=="object"&&d!==null&&d.type===An&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case vl:e:{for(var j=d.key,T=f;T!==null;){if(T.key===j){if(j=d.type,j===An){if(T.tag===7){n(h,T.sibling),f=l(T,d.props.children),f.return=h,h=f;break e}}else if(T.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Vt&&Nu(j)===T.type){n(h,T.sibling),f=l(T,d.props),f.ref=wr(h,T,d),f.return=h,h=f;break e}n(h,T);break}else t(h,T);T=T.sibling}d.type===An?(f=xn(d.props.children,h.mode,C,d.key),f.return=h,h=f):(C=Ql(d.type,d.key,d.props,null,h.mode,C),C.ref=wr(h,f,d),C.return=h,h=C)}return i(h);case Dn:e:{for(T=d.key;f!==null;){if(f.key===T)if(f.tag===4&&f.stateNode.containerInfo===d.containerInfo&&f.stateNode.implementation===d.implementation){n(h,f.sibling),f=l(f,d.children||[]),f.return=h,h=f;break e}else{n(h,f);break}else t(h,f);f=f.sibling}f=Ei(d,h.mode,C),f.return=h,h=f}return i(h);case Vt:return T=d._init,P(h,f,T(d._payload),C)}if(Cr(d))return k(h,f,d,C);if(hr(d))return N(h,f,d,C);Pl(h,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,f!==null&&f.tag===6?(n(h,f.sibling),f=l(f,d),f.return=h,h=f):(n(h,f),f=ki(d,h.mode,C),f.return=h,h=f),i(h)):n(h,f)}return P}var or=Rf(!0),jf=Rf(!1),ao=an(null),uo=null,bn=null,Qs=null;function Ks(){Qs=bn=uo=null}function bs(e){var t=ao.current;ee(ao),e._currentValue=t}function ts(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function er(e,t){uo=e,Qs=bn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ie=!0),e.firstContext=null)}function tt(e){var t=e._currentValue;if(Qs!==e)if(e={context:e,memoizedValue:t,next:null},bn===null){if(uo===null)throw Error(R(308));bn=e,uo.dependencies={lanes:0,firstContext:e}}else bn=bn.next=e;return t}var yn=null;function Ys(e){yn===null?yn=[e]:yn.push(e)}function Tf(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Ys(t)):(n.next=l.next,l.next=n),t.interleaved=n,zt(e,r)}function zt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Qt=!1;function Js(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $f(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function jt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function en(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,b&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,zt(e,n)}return l=r.interleaved,l===null?(t.next=t,Ys(r)):(t.next=l.next,l.next=t),r.interleaved=t,zt(e,n)}function Al(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,zs(e,n)}}function _u(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?l=o=i:o=o.next=i,n=n.next}while(n!==null);o===null?l=o=t:o=o.next=t}else l=o=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function co(e,t,n,r){var l=e.updateQueue;Qt=!1;var o=l.firstBaseUpdate,i=l.lastBaseUpdate,a=l.shared.pending;if(a!==null){l.shared.pending=null;var s=a,u=s.next;s.next=null,i===null?o=u:i.next=u,i=s;var p=e.alternate;p!==null&&(p=p.updateQueue,a=p.lastBaseUpdate,a!==i&&(a===null?p.firstBaseUpdate=u:a.next=u,p.lastBaseUpdate=s))}if(o!==null){var g=l.baseState;i=0,p=u=s=null,a=o;do{var y=a.lane,w=a.eventTime;if((r&y)===y){p!==null&&(p=p.next={eventTime:w,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var k=e,N=a;switch(y=t,w=n,N.tag){case 1:if(k=N.payload,typeof k=="function"){g=k.call(w,g,y);break e}g=k;break e;case 3:k.flags=k.flags&-65537|128;case 0:if(k=N.payload,y=typeof k=="function"?k.call(w,g,y):k,y==null)break e;g=ie({},g,y);break e;case 2:Qt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,y=l.effects,y===null?l.effects=[a]:y.push(a))}else w={eventTime:w,lane:y,tag:a.tag,payload:a.payload,callback:a.callback,next:null},p===null?(u=p=w,s=g):p=p.next=w,i|=y;if(a=a.next,a===null){if(a=l.shared.pending,a===null)break;y=a,a=y.next,y.next=null,l.lastBaseUpdate=y,l.shared.pending=null}}while(!0);if(p===null&&(s=g),l.baseState=s,l.firstBaseUpdate=u,l.lastBaseUpdate=p,t=l.shared.interleaved,t!==null){l=t;do i|=l.lane,l=l.next;while(l!==t)}else o===null&&(l.shared.lanes=0);Nn|=i,e.lanes=i,e.memoizedState=g}}function Lu(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=vi.transition;vi.transition={};try{e(!1),t()}finally{J=n,vi.transition=r}}function Jf(){return nt().memoizedState}function km(e,t,n){var r=nn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Gf(e))Xf(t,n);else if(n=Tf(e,t,n,r),n!==null){var l=Me();ft(n,e,r,l),Zf(n,t,r)}}function Em(e,t,n){var r=nn(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Gf(e))Xf(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,a=o(i,n);if(l.hasEagerState=!0,l.eagerState=a,dt(a,i)){var s=t.interleaved;s===null?(l.next=l,Ys(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=Tf(e,t,l,r),n!==null&&(l=Me(),ft(n,e,r,l),Zf(n,t,r))}}function Gf(e){var t=e.alternate;return e===le||t!==null&&t===le}function Xf(e,t){$r=po=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Zf(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,zs(e,n)}}var ho={readContext:tt,useCallback:_e,useContext:_e,useEffect:_e,useImperativeHandle:_e,useInsertionEffect:_e,useLayoutEffect:_e,useMemo:_e,useReducer:_e,useRef:_e,useState:_e,useDebugValue:_e,useDeferredValue:_e,useTransition:_e,useMutableSource:_e,useSyncExternalStore:_e,useId:_e,unstable_isNewReconciler:!1},Cm={readContext:tt,useCallback:function(e,t){return gt().memoizedState=[e,t===void 0?null:t],e},useContext:tt,useEffect:Ru,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Bl(4194308,4,Vf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Bl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Bl(4,2,e,t)},useMemo:function(e,t){var n=gt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=gt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=km.bind(null,le,e),[r.memoizedState,e]},useRef:function(e){var t=gt();return e={current:e},t.memoizedState=e},useState:Pu,useDebugValue:ra,useDeferredValue:function(e){return gt().memoizedState=e},useTransition:function(){var e=Pu(!1),t=e[0];return e=xm.bind(null,e[1]),gt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=le,l=gt();if(te){if(n===void 0)throw Error(R(407));n=n()}else{if(n=t(),ye===null)throw Error(R(349));Cn&30||Of(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,Ru(Df.bind(null,r,o,e),[e]),r.flags|=2048,Xr(9,If.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=gt(),t=ye.identifierPrefix;if(te){var n=Rt,r=Pt;n=(r&~(1<<32-ct(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Jr++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[vt]=t,e[Kr]=r,ad(e,t,!1,!1),t.stateNode=e;e:{switch(i=Ii(n,r),n){case"dialog":q("cancel",e),q("close",e),l=r;break;case"iframe":case"object":case"embed":q("load",e),l=r;break;case"video":case"audio":for(l=0;l<_r.length;l++)q(_r[l],e);l=r;break;case"source":q("error",e),l=r;break;case"img":case"image":case"link":q("error",e),q("load",e),l=r;break;case"details":q("toggle",e),l=r;break;case"input":Ya(e,r),l=Ti(e,r),q("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=ie({},r,{value:void 0}),q("invalid",e);break;case"textarea":Ga(e,r),l=zi(e,r),q("invalid",e);break;default:l=r}Oi(n,l),a=l;for(o in a)if(a.hasOwnProperty(o)){var s=a[o];o==="style"?Uc(e,s):o==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,s!=null&&Dc(e,s)):o==="children"?typeof s=="string"?(n!=="textarea"||s!=="")&&Ir(e,s):typeof s=="number"&&Ir(e,""+s):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Or.hasOwnProperty(o)?s!=null&&o==="onScroll"&&q("scroll",e):s!=null&&Ps(e,o,s,i))}switch(n){case"input":yl(e),Ja(e,r,!1);break;case"textarea":yl(e),Xa(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ln(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Gn(e,!!r.multiple,o,!1):r.defaultValue!=null&&Gn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=ro)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Le(t),null;case 6:if(e&&t.stateNode!=null)cd(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(R(166));if(n=wn(Yr.current),wn(wt.current),Ll(t)){if(r=t.stateNode,n=t.memoizedProps,r[vt]=t,(o=r.nodeValue!==n)&&(e=Ve,e!==null))switch(e.tag){case 3:_l(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&_l(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[vt]=t,t.stateNode=r}return Le(t),null;case 13:if(ee(re),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(te&&We!==null&&t.mode&1&&!(t.flags&128))Pf(),lr(),t.flags|=98560,o=!1;else if(o=Ll(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(R(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(R(317));o[vt]=t}else lr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Le(t),o=!1}else ut!==null&&(vs(ut),ut=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||re.current&1?me===0&&(me=3):ca())),t.updateQueue!==null&&(t.flags|=4),Le(t),null);case 4:return ir(),us(e,t),e===null&&Vr(t.stateNode.containerInfo),Le(t),null;case 10:return bs(t.type._context),Le(t),null;case 17:return Ae(t.type)&&lo(),Le(t),null;case 19:if(ee(re),o=t.memoizedState,o===null)return Le(t),null;if(r=(t.flags&128)!==0,i=o.rendering,i===null)if(r)Sr(o,!1);else{if(me!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=fo(e),i!==null){for(t.flags|=128,Sr(o,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,i=o.alternate,i===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,o.type=i.type,e=i.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return X(re,re.current&1|2),t.child}e=e.sibling}o.tail!==null&&ce()>ar&&(t.flags|=128,r=!0,Sr(o,!1),t.lanes=4194304)}else{if(!r)if(e=fo(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Sr(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!te)return Le(t),null}else 2*ce()-o.renderingStartTime>ar&&n!==1073741824&&(t.flags|=128,r=!0,Sr(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=ce(),t.sibling=null,n=re.current,X(re,r?n&1|2:n&1),t):(Le(t),null);case 22:case 23:return ua(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?He&1073741824&&(Le(t),t.subtreeFlags&6&&(t.flags|=8192)):Le(t),null;case 24:return null;case 25:return null}throw Error(R(156,t.tag))}function $m(e,t){switch(Ws(t),t.tag){case 1:return Ae(t.type)&&lo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ir(),ee(De),ee(Re),Zs(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Xs(t),null;case 13:if(ee(re),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(R(340));lr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ee(re),null;case 4:return ir(),null;case 10:return bs(t.type._context),null;case 22:case 23:return ua(),null;case 24:return null;default:return null}}var jl=!1,Pe=!1,Mm=typeof WeakSet=="function"?WeakSet:Set,z=null;function Yn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ae(e,t,r)}else n.current=null}function cs(e,t,n){try{n()}catch(r){ae(e,t,r)}}var Uu=!1;function zm(e,t){if(bi=eo,e=mf(),Bs(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,a=-1,s=-1,u=0,p=0,g=e,y=null;t:for(;;){for(var w;g!==n||l!==0&&g.nodeType!==3||(a=i+l),g!==o||r!==0&&g.nodeType!==3||(s=i+r),g.nodeType===3&&(i+=g.nodeValue.length),(w=g.firstChild)!==null;)y=g,g=w;for(;;){if(g===e)break t;if(y===n&&++u===l&&(a=i),y===o&&++p===r&&(s=i),(w=g.nextSibling)!==null)break;g=y,y=g.parentNode}g=w}n=a===-1||s===-1?null:{start:a,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Yi={focusedElem:e,selectionRange:n},eo=!1,z=t;z!==null;)if(t=z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,z=e;else for(;z!==null;){t=z;try{var k=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(k!==null){var N=k.memoizedProps,P=k.memoizedState,h=t.stateNode,f=h.getSnapshotBeforeUpdate(t.elementType===t.type?N:st(t.type,N),P);h.__reactInternalSnapshotBeforeUpdate=f}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(R(163))}}catch(C){ae(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,z=e;break}z=t.return}return k=Uu,Uu=!1,k}function Mr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var o=l.destroy;l.destroy=void 0,o!==void 0&&cs(t,n,o)}l=l.next}while(l!==r)}}function jo(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function fs(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function fd(e){var t=e.alternate;t!==null&&(e.alternate=null,fd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[vt],delete t[Kr],delete t[Xi],delete t[gm],delete t[vm])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function dd(e){return e.tag===5||e.tag===3||e.tag===4}function Bu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dd(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ds(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ro));else if(r!==4&&(e=e.child,e!==null))for(ds(e,t,n),e=e.sibling;e!==null;)ds(e,t,n),e=e.sibling}function ps(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ps(e,t,n),e=e.sibling;e!==null;)ps(e,t,n),e=e.sibling}var Se=null,at=!1;function Wt(e,t,n){for(n=n.child;n!==null;)pd(e,t,n),n=n.sibling}function pd(e,t,n){if(yt&&typeof yt.onCommitFiberUnmount=="function")try{yt.onCommitFiberUnmount(ko,n)}catch{}switch(n.tag){case 5:Pe||Yn(n,t);case 6:var r=Se,l=at;Se=null,Wt(e,t,n),Se=r,at=l,Se!==null&&(at?(e=Se,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Se.removeChild(n.stateNode));break;case 18:Se!==null&&(at?(e=Se,n=n.stateNode,e.nodeType===8?hi(e.parentNode,n):e.nodeType===1&&hi(e,n),Br(e)):hi(Se,n.stateNode));break;case 4:r=Se,l=at,Se=n.stateNode.containerInfo,at=!0,Wt(e,t,n),Se=r,at=l;break;case 0:case 11:case 14:case 15:if(!Pe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&cs(n,t,i),l=l.next}while(l!==r)}Wt(e,t,n);break;case 1:if(!Pe&&(Yn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ae(n,t,a)}Wt(e,t,n);break;case 21:Wt(e,t,n);break;case 22:n.mode&1?(Pe=(r=Pe)||n.memoizedState!==null,Wt(e,t,n),Pe=r):Wt(e,t,n);break;default:Wt(e,t,n)}}function Hu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Mm),t.forEach(function(r){var l=Wm.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function it(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=i),r&=~o}if(r=l,r=ce()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Om(r/1960))-r,10e?16:e,Jt===null)var r=!1;else{if(e=Jt,Jt=null,vo=0,b&6)throw Error(R(331));var l=b;for(b|=4,z=e.current;z!==null;){var o=z,i=o.child;if(z.flags&16){var a=o.deletions;if(a!==null){for(var s=0;sce()-sa?Sn(e,0):ia|=n),Ue(e,t)}function xd(e,t){t===0&&(e.mode&1?(t=xl,xl<<=1,!(xl&130023424)&&(xl=4194304)):t=1);var n=Me();e=zt(e,t),e!==null&&(nl(e,t,n),Ue(e,n))}function Hm(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),xd(e,n)}function Wm(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(R(314))}r!==null&&r.delete(t),xd(e,n)}var kd;kd=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||De.current)Ie=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ie=!1,jm(e,t,n);Ie=!!(e.flags&131072)}else Ie=!1,te&&t.flags&1048576&&_f(t,so,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Hl(e,t),e=t.pendingProps;var l=rr(t,Re.current);er(t,n),l=ea(null,t,r,e,l,n);var o=ta();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ae(r)?(o=!0,oo(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Js(t),l.updater=Ro,t.stateNode=l,l._reactInternals=t,rs(t,r,e,n),t=is(null,t,r,!0,o,n)):(t.tag=0,te&&o&&Hs(t),$e(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Hl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Qm(r),e=st(r,e),l){case 0:t=os(null,t,r,e,n);break e;case 1:t=Iu(null,t,r,e,n);break e;case 11:t=Fu(null,t,r,e,n);break e;case 14:t=Ou(null,t,r,st(r.type,e),n);break e}throw Error(R(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:st(r,l),os(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:st(r,l),Iu(e,t,r,l,n);case 3:e:{if(od(t),e===null)throw Error(R(387));r=t.pendingProps,o=t.memoizedState,l=o.element,$f(e,t),co(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){l=sr(Error(R(423)),t),t=Du(e,t,r,n,l);break e}else if(r!==l){l=sr(Error(R(424)),t),t=Du(e,t,r,n,l);break e}else for(We=qt(t.stateNode.containerInfo.firstChild),Ve=t,te=!0,ut=null,n=jf(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(lr(),r===l){t=Ft(e,t,n);break e}$e(e,t,r,n)}t=t.child}return t;case 5:return Mf(t),e===null&&es(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,i=l.children,Ji(r,l)?i=null:o!==null&&Ji(r,o)&&(t.flags|=32),ld(e,t),$e(e,t,i,n),t.child;case 6:return e===null&&es(t),null;case 13:return id(e,t,n);case 4:return Gs(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=or(t,null,r,n):$e(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:st(r,l),Fu(e,t,r,l,n);case 7:return $e(e,t,t.pendingProps,n),t.child;case 8:return $e(e,t,t.pendingProps.children,n),t.child;case 12:return $e(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,i=l.value,X(ao,r._currentValue),r._currentValue=i,o!==null)if(dt(o.value,i)){if(o.children===l.children&&!De.current){t=Ft(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){i=o.child;for(var s=a.firstContext;s!==null;){if(s.context===r){if(o.tag===1){s=jt(-1,n&-n),s.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var p=u.pending;p===null?s.next=s:(s.next=p.next,p.next=s),u.pending=s}}o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),ts(o.return,n,t),a.lanes|=n;break}s=s.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(R(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),ts(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}$e(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,er(t,n),l=tt(l),r=r(l),t.flags|=1,$e(e,t,r,n),t.child;case 14:return r=t.type,l=st(r,t.pendingProps),l=st(r.type,l),Ou(e,t,r,l,n);case 15:return nd(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:st(r,l),Hl(e,t),t.tag=1,Ae(r)?(e=!0,oo(t)):e=!1,er(t,n),qf(t,r,l),rs(t,r,l,n),is(null,t,r,!0,e,n);case 19:return sd(e,t,n);case 22:return rd(e,t,n)}throw Error(R(156,t.tag))};function Ed(e,t){return Jc(e,t)}function Vm(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qe(e,t,n,r){return new Vm(e,t,n,r)}function fa(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Qm(e){if(typeof e=="function")return fa(e)?1:0;if(e!=null){if(e=e.$$typeof,e===js)return 11;if(e===Ts)return 14}return 2}function rn(e,t){var n=e.alternate;return n===null?(n=qe(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ql(e,t,n,r,l,o){var i=2;if(r=e,typeof e=="function")fa(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case An:return xn(n.children,l,o,t);case Rs:i=8,l|=8;break;case Li:return e=qe(12,n,t,l|2),e.elementType=Li,e.lanes=o,e;case Pi:return e=qe(13,n,t,l),e.elementType=Pi,e.lanes=o,e;case Ri:return e=qe(19,n,t,l),e.elementType=Ri,e.lanes=o,e;case $c:return $o(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case jc:i=10;break e;case Tc:i=9;break e;case js:i=11;break e;case Ts:i=14;break e;case Vt:i=16,r=null;break e}throw Error(R(130,e==null?e:typeof e,""))}return t=qe(i,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function xn(e,t,n,r){return e=qe(7,e,r,t),e.lanes=n,e}function $o(e,t,n,r){return e=qe(22,e,r,t),e.elementType=$c,e.lanes=n,e.stateNode={isHidden:!1},e}function ki(e,t,n){return e=qe(6,e,null,t),e.lanes=n,e}function Ei(e,t,n){return t=qe(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Km(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ri(0),this.expirationTimes=ri(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ri(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function da(e,t,n,r,l,o,i,a,s){return e=new Km(e,t,n,a,s),t===1?(t=1,o===!0&&(t|=8)):t=0,o=qe(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Js(o),e}function bm(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ld)}catch(e){console.error(e)}}Ld(),_c.exports=Ke;var Pd=_c.exports,Rd,Gu=Pd;Rd=Gu.createRoot,Gu.hydrateRoot;/** + * react-router v7.8.2 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */var Xu="popstate";function Zm(e={}){function t(l,o){let{pathname:i="/",search:a="",hash:s=""}=Rn(l.location.hash.substring(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),ys("",{pathname:i,search:a,hash:s},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(l,o){let i=l.document.querySelector("base"),a="";if(i&&i.getAttribute("href")){let s=l.location.href,u=s.indexOf("#");a=u===-1?s:s.slice(0,u)}return a+"#"+(typeof o=="string"?o:qr(o))}function r(l,o){pt(l.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(o)})`)}return eg(t,n,r,e)}function oe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function pt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function qm(){return Math.random().toString(36).substring(2,10)}function Zu(e,t){return{usr:e.state,key:e.key,idx:t}}function ys(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Rn(t):t,state:n,key:t&&t.key||r||qm()}}function qr({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Rn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function eg(e,t,n,r={}){let{window:l=document.defaultView,v5Compat:o=!1}=r,i=l.history,a="POP",s=null,u=p();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function p(){return(i.state||{idx:null}).idx}function g(){a="POP";let P=p(),h=P==null?null:P-u;u=P,s&&s({action:a,location:N.location,delta:h})}function y(P,h){a="PUSH";let f=ys(N.location,P,h);n&&n(f,P),u=p()+1;let d=Zu(f,u),C=N.createHref(f);try{i.pushState(d,"",C)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;l.location.assign(C)}o&&s&&s({action:a,location:N.location,delta:1})}function w(P,h){a="REPLACE";let f=ys(N.location,P,h);n&&n(f,P),u=p();let d=Zu(f,u),C=N.createHref(f);i.replaceState(d,"",C),o&&s&&s({action:a,location:N.location,delta:0})}function k(P){return tg(P)}let N={get action(){return a},get location(){return e(l,i)},listen(P){if(s)throw new Error("A history only accepts one active listener");return l.addEventListener(Xu,g),s=P,()=>{l.removeEventListener(Xu,g),s=null}},createHref(P){return t(l,P)},createURL:k,encodeLocation(P){let h=k(P);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:y,replace:w,go(P){return i.go(P)}};return N}function tg(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),oe(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:qr(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function jd(e,t,n="/"){return ng(e,t,n,!1)}function ng(e,t,n,r){let l=typeof t=="string"?Rn(t):t,o=Ot(l.pathname||"/",n);if(o==null)return null;let i=Td(e);rg(i);let a=null;for(let s=0;a==null&&s{let p={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(r)&&s)return;oe(p.relativePath.startsWith(r),`Absolute route path "${p.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(r.length)}let g=Tt([r,p.relativePath]),y=n.concat(p);i.children&&i.children.length>0&&(oe(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),Td(i.children,t,y,g,s)),!(i.path==null&&!i.index)&&t.push({path:g,score:cg(g,i.index),routesMeta:y})};return e.forEach((i,a)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,a);else for(let u of $d(i.path))o(i,a,!0,u)}),t}function $d(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return l?[o,""]:[o];let i=$d(r.join("/")),a=[];return a.push(...i.map(s=>s===""?o:[o,s].join("/"))),l&&a.push(...i),a.map(s=>e.startsWith("/")&&s===""?"/":s)}function rg(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:fg(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var lg=/^:[\w-]+$/,og=3,ig=2,sg=1,ag=10,ug=-2,qu=e=>e==="*";function cg(e,t){let n=e.split("/"),r=n.length;return n.some(qu)&&(r+=ug),t&&(r+=ig),n.filter(l=>!qu(l)).reduce((l,o)=>l+(lg.test(o)?og:o===""?sg:ag),r)}function fg(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function dg(e,t,n=!1){let{routesMeta:r}=e,l={},o="/",i=[];for(let a=0;a{if(p==="*"){let k=a[y]||"";i=o.slice(0,o.length-k.length).replace(/(.)\/+$/,"$1")}const w=a[y];return g&&!w?u[p]=void 0:u[p]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function pg(e,t=!1,n=!0){pt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,a,s)=>(r.push({paramName:a,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function hg(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return pt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ot(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function mg(e,t="/"){let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?Rn(e):e;return{pathname:n?n.startsWith("/")?n:gg(n,t):t,search:wg(r),hash:Sg(l)}}function gg(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function Ci(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function vg(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Md(e){let t=vg(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function zd(e,t,n,r=!1){let l;typeof e=="string"?l=Rn(e):(l={...e},oe(!l.pathname||!l.pathname.includes("?"),Ci("?","pathname","search",l)),oe(!l.pathname||!l.pathname.includes("#"),Ci("#","pathname","hash",l)),oe(!l.search||!l.search.includes("#"),Ci("#","search","hash",l)));let o=e===""||l.pathname==="",i=o?"/":l.pathname,a;if(i==null)a=n;else{let g=t.length-1;if(!r&&i.startsWith("..")){let y=i.split("/");for(;y[0]==="..";)y.shift(),g-=1;l.pathname=y.join("/")}a=g>=0?t[g]:"/"}let s=mg(l,a),u=i&&i!=="/"&&i.endsWith("/"),p=(o||i===".")&&n.endsWith("/");return!s.pathname.endsWith("/")&&(u||p)&&(s.pathname+="/"),s}var Tt=e=>e.join("/").replace(/\/\/+/g,"/"),yg=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),wg=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Sg=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function xg(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var Fd=["POST","PUT","PATCH","DELETE"];new Set(Fd);var kg=["GET",...Fd];new Set(kg);var dr=m.createContext(null);dr.displayName="DataRouter";var Io=m.createContext(null);Io.displayName="DataRouterState";m.createContext(!1);var Od=m.createContext({isTransitioning:!1});Od.displayName="ViewTransition";var Eg=m.createContext(new Map);Eg.displayName="Fetchers";var Cg=m.createContext(null);Cg.displayName="Await";var St=m.createContext(null);St.displayName="Navigation";var il=m.createContext(null);il.displayName="Location";var Dt=m.createContext({outlet:null,matches:[],isDataRoute:!1});Dt.displayName="Route";var ga=m.createContext(null);ga.displayName="RouteError";function Ng(e,{relative:t}={}){oe(sl(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=m.useContext(St),{hash:l,pathname:o,search:i}=al(e,{relative:t}),a=o;return n!=="/"&&(a=o==="/"?n:Tt([n,o])),r.createHref({pathname:a,search:i,hash:l})}function sl(){return m.useContext(il)!=null}function jn(){return oe(sl(),"useLocation() may be used only in the context of a component."),m.useContext(il).location}var Id="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Dd(e){m.useContext(St).static||m.useLayoutEffect(e)}function _g(){let{isDataRoute:e}=m.useContext(Dt);return e?Ag():Lg()}function Lg(){oe(sl(),"useNavigate() may be used only in the context of a component.");let e=m.useContext(dr),{basename:t,navigator:n}=m.useContext(St),{matches:r}=m.useContext(Dt),{pathname:l}=jn(),o=JSON.stringify(Md(r)),i=m.useRef(!1);return Dd(()=>{i.current=!0}),m.useCallback((s,u={})=>{if(pt(i.current,Id),!i.current)return;if(typeof s=="number"){n.go(s);return}let p=zd(s,JSON.parse(o),l,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Tt([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,o,l,e])}m.createContext(null);function al(e,{relative:t}={}){let{matches:n}=m.useContext(Dt),{pathname:r}=jn(),l=JSON.stringify(Md(n));return m.useMemo(()=>zd(e,JSON.parse(l),r,t==="path"),[e,l,r,t])}function Pg(e,t){return Ad(e,t)}function Ad(e,t,n,r,l){var f;oe(sl(),"useRoutes() may be used only in the context of a component.");let{navigator:o}=m.useContext(St),{matches:i}=m.useContext(Dt),a=i[i.length-1],s=a?a.params:{},u=a?a.pathname:"/",p=a?a.pathnameBase:"/",g=a&&a.route;{let d=g&&g.path||"";Ud(u,!g||d.endsWith("*")||d.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${u}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. + +Please change the parent to .`)}let y=jn(),w;if(t){let d=typeof t=="string"?Rn(t):t;oe(p==="/"||((f=d.pathname)==null?void 0:f.startsWith(p)),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${d.pathname}" was given in the \`location\` prop.`),w=d}else w=y;let k=w.pathname||"/",N=k;if(p!=="/"){let d=p.replace(/^\//,"").split("/");N="/"+k.replace(/^\//,"").split("/").slice(d.length).join("/")}let P=jd(e,{pathname:N});pt(g||P!=null,`No routes matched location "${w.pathname}${w.search}${w.hash}" `),pt(P==null||P[P.length-1].route.element!==void 0||P[P.length-1].route.Component!==void 0||P[P.length-1].route.lazy!==void 0,`Matched leaf route at location "${w.pathname}${w.search}${w.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let h=Mg(P&&P.map(d=>Object.assign({},d,{params:Object.assign({},s,d.params),pathname:Tt([p,o.encodeLocation?o.encodeLocation(d.pathname).pathname:d.pathname]),pathnameBase:d.pathnameBase==="/"?p:Tt([p,o.encodeLocation?o.encodeLocation(d.pathnameBase).pathname:d.pathnameBase])})),i,n,r,l);return t&&h?m.createElement(il.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...w},navigationType:"POP"}},h):h}function Rg(){let e=Dg(),t=xg(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=m.createElement(m.Fragment,null,m.createElement("p",null,"💿 Hey developer 👋"),m.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",m.createElement("code",{style:o},"ErrorBoundary")," or"," ",m.createElement("code",{style:o},"errorElement")," prop on your route.")),m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:l},n):null,i)}var jg=m.createElement(Rg,null),Tg=class extends m.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?m.createElement(Dt.Provider,{value:this.props.routeContext},m.createElement(ga.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function $g({routeContext:e,match:t,children:n}){let r=m.useContext(dr);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),m.createElement(Dt.Provider,{value:e},n)}function Mg(e,t=[],n=null,r=null,l=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,i=n==null?void 0:n.errors;if(i!=null){let u=o.findIndex(p=>p.route.id&&(i==null?void 0:i[p.route.id])!==void 0);oe(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,u+1))}let a=!1,s=-1;if(n)for(let u=0;u=0?o=o.slice(0,s+1):o=[o[0]];break}}}return o.reduceRight((u,p,g)=>{let y,w=!1,k=null,N=null;n&&(y=i&&p.route.id?i[p.route.id]:void 0,k=p.route.errorElement||jg,a&&(s<0&&g===0?(Ud("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,N=null):s===g&&(w=!0,N=p.route.hydrateFallbackElement||null)));let P=t.concat(o.slice(0,g+1)),h=()=>{let f;return y?f=k:w?f=N:p.route.Component?f=m.createElement(p.route.Component,null):p.route.element?f=p.route.element:f=u,m.createElement($g,{match:p,routeContext:{outlet:u,matches:P,isDataRoute:n!=null},children:f})};return n&&(p.route.ErrorBoundary||p.route.errorElement||g===0)?m.createElement(Tg,{location:n.location,revalidation:n.revalidation,component:k,error:y,children:h(),routeContext:{outlet:null,matches:P,isDataRoute:!0},unstable_onError:r}):h()},null)}function va(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function zg(e){let t=m.useContext(dr);return oe(t,va(e)),t}function Fg(e){let t=m.useContext(Io);return oe(t,va(e)),t}function Og(e){let t=m.useContext(Dt);return oe(t,va(e)),t}function ya(e){let t=Og(e),n=t.matches[t.matches.length-1];return oe(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Ig(){return ya("useRouteId")}function Dg(){var r;let e=m.useContext(ga),t=Fg("useRouteError"),n=ya("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function Ag(){let{router:e}=zg("useNavigate"),t=ya("useNavigate"),n=m.useRef(!1);return Dd(()=>{n.current=!0}),m.useCallback(async(l,o={})=>{pt(n.current,Id),n.current&&(typeof l=="number"?e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var ec={};function Ud(e,t,n){!t&&!ec[e]&&(ec[e]=!0,pt(!1,n))}m.memo(Ug);function Ug({routes:e,future:t,state:n,unstable_onError:r}){return Ad(e,void 0,n,r,t)}function Bd(e){oe(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function Bg({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:l,static:o=!1}){oe(!sl(),"You cannot render a inside another . You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),a=m.useMemo(()=>({basename:i,navigator:l,static:o,future:{}}),[i,l,o]);typeof n=="string"&&(n=Rn(n));let{pathname:s="/",search:u="",hash:p="",state:g=null,key:y="default"}=n,w=m.useMemo(()=>{let k=Ot(s,i);return k==null?null:{location:{pathname:k,search:u,hash:p,state:g,key:y},navigationType:r}},[i,s,u,p,g,y,r]);return pt(w!=null,` is not able to match the URL "${s}${u}${p}" because it does not start with the basename, so the won't render anything.`),w==null?null:m.createElement(St.Provider,{value:a},m.createElement(il.Provider,{children:t,value:w}))}function Hg({children:e,location:t}){return Pg(ws(e),t)}function ws(e,t=[]){let n=[];return m.Children.forEach(e,(r,l)=>{if(!m.isValidElement(r))return;let o=[...t,l];if(r.type===m.Fragment){n.push.apply(n,ws(r.props.children,o));return}oe(r.type===Bd,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),oe(!r.props.index||!r.props.children,"An index route cannot have child routes.");let i={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=ws(r.props.children,o)),n.push(i)}),n}var Kl="get",bl="application/x-www-form-urlencoded";function Do(e){return e!=null&&typeof e.tagName=="string"}function Wg(e){return Do(e)&&e.tagName.toLowerCase()==="button"}function Vg(e){return Do(e)&&e.tagName.toLowerCase()==="form"}function Qg(e){return Do(e)&&e.tagName.toLowerCase()==="input"}function Kg(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function bg(e,t){return e.button===0&&(!t||t==="_self")&&!Kg(e)}var Ml=null;function Yg(){if(Ml===null)try{new FormData(document.createElement("form"),0),Ml=!1}catch{Ml=!0}return Ml}var Jg=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ni(e){return e!=null&&!Jg.has(e)?(pt(!1,`"${e}" is not a valid \`encType\` for \`\`/\`\` and will default to "${bl}"`),null):e}function Gg(e,t){let n,r,l,o,i;if(Vg(e)){let a=e.getAttribute("action");r=a?Ot(a,t):null,n=e.getAttribute("method")||Kl,l=Ni(e.getAttribute("enctype"))||bl,o=new FormData(e)}else if(Wg(e)||Qg(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a
`,k=`
${y}
`;return`
${w}${k}
`}),i=i.replace(/
\s*(?=
]*>[\s\S]*?<\/div>)\s*
/g,"$1"),i}function bv(e){const t=e.split(/\r?\n/);let n=null;for(let r=0;r/i,n=/<\/think(?:ing)?>/i,r=e.match(t);if(!r)return{think:null,answer:e};const l=r.index,o=r[0].length,i=e.substring(0,l).trim();let a=e.substring(l+o);const s=a.match(n);let u=null,p=i;return s?(u=a.substring(0,s.index).trim(),p+=a.substring(s.index+s[0].length)):u=a.trim(),{think:u||null,answer:p.trim()}}function Yv({content:e,streamOutput:t,sources:n}){const{think:r,answer:l}=Gd(e||""),[o,i]=Te.useState(!1),a=!!r;return v.jsxs("div",{className:"assistant-message",children:[a&&v.jsxs("div",{className:"assistant-thoughts",children:[v.jsxs("button",{className:"think-toggle",onClick:()=>i(s=>!s),"aria-expanded":o?"true":"false","aria-controls":"think-content",children:[v.jsx("span",{className:"think-toggle-icon","aria-hidden":"true",children:o?"▾":"▸"}),"Thoughts"]}),o&&v.jsx("div",{id:"think-content",className:"think-content",dangerouslySetInnerHTML:{__html:fc(r)}})]}),v.jsx("div",{className:"msg-content",dangerouslySetInnerHTML:{__html:fc(l||e||"")}}),Array.isArray(n)&&n.length>0&&v.jsx("div",{className:"msg-sources chips",children:n.map((s,u)=>{let p=s,g=!1;try{const y=new URL(s);if(y.protocol==="file:"){g=!0;const w=y.pathname.split("/").filter(Boolean);p=decodeURIComponent(w[w.length-1]||s)}else p=(y.hostname||s).replace(/^www\./i,"")}catch{}return v.jsx("a",{className:"chip",href:s,target:"_blank",rel:"noreferrer",title:s,onClick:y=>{var w,k;if(g){y.preventDefault();try{const N=new URL(s);(k=(w=window.electronAPI)==null?void 0:w.openPath)==null||k.call(w,decodeURIComponent(N.pathname))}catch{}}},children:p},s+u)})})]})}const dc="websearch.searxUrl",pc="websearch.engines",hc="chat.libraryBySession";let Jv="http://127.0.0.1:8000";const Gv=48,Xv=24;function Zv(){var Ba;const[e,t]=m.useState([]),[n,r]=m.useState(null),[l,o]=m.useState("chats"),[i,a]=m.useState("General"),[s,u]=m.useState(null),[p,g]=m.useState(null),[y,w]=m.useState([]),[k,N]=m.useState([]),[P,h]=m.useState(null),[f,d]=m.useState(()=>{try{const c=localStorage.getItem(hc);return c?JSON.parse(c):{}}catch{return{}}}),[C,j]=m.useState(!1),[T,$]=m.useState(""),[O,B]=m.useState(""),[D,G]=m.useState(!1),[ge,rt]=m.useState(""),[xt,cn]=m.useState(""),Ee=m.useRef(null),Ye=m.useRef(null),x=m.useRef(null),[_,F]=m.useState(Jv),[H,se]=m.useState("Default"),[lt,Be]=m.useState(!1),[kt,Et]=m.useState(localStorage.getItem(dc)||"http://localhost:8888"),[Je,Xd]=m.useState(()=>{try{const c=localStorage.getItem(pc);if(c)return JSON.parse(c)}catch{}return["duckduckgo","bing","wikipedia","github","stack_overflow"]});m.useEffect(()=>{localStorage.setItem(dc,kt||"")},[kt]),m.useEffect(()=>{try{localStorage.setItem(pc,JSON.stringify(Je||[]))}catch{}},[Je]);const[ul,Zd]=m.useState(!1),[At,Ao]=m.useState(!1),[ty,Uo]=m.useState(!0),[qd,Tn]=m.useState([]),[cl,ka]=m.useState({}),[ep,Bo]=m.useState(null),[Ho,fl]=m.useState("");function tp(c){const S=c.content||"";if(c.role==="assistant")try{const{answer:E}=Gd(S);return(E||S).trim()}catch{return S.trim()}return S}async function Ea(c){try{await navigator.clipboard.writeText(tp(c))}catch(S){console.error("Failed to copy message:",S)}}function fn(c,S,E,L={}){const{removeIfEmpty:M=!1}=L;t(A=>A.map(U=>{if(U.session_id!==c)return U;const I=[];for(const W of U.messages||[]){if(W.id!==S){I.push(W);continue}M&&!E||I.push({...W,content:E})}return{...U,messages:I}}))}function Ut(c){return(c==null?void 0:c.name)==="AbortError"}function Wo(c){return c instanceof Error&&c.message?c.message:String(c)}async function Ca(c,S,E){if(!c)return{contextBlock:null,sources:[]};const M=await(await fetch(`${_}/libraries/${c}/context`,{method:"POST",headers:{"Content-Type":"application/json"},signal:E,body:JSON.stringify({prompt:S,top_k:5})})).json();return{contextBlock:typeof(M==null?void 0:M.context_block)=="string"&&M.context_block.trim()?M.context_block.trim():null,sources:Array.isArray(M==null?void 0:M.sources)?M.sources:[]}}function np(c,S){Bo(c),fl(S||"")}function dl(){Bo(null),fl("")}async function rp(c){var A;const S=(((A=Fn[c])==null?void 0:A.content)||"").trim(),L=(Ho??"").trim();if(L.length===0){dl();return}if(L===S){dl();return}const M=n;if(M){t(U=>U.map(I=>{if(I.session_id!==M)return I;const Ne=(I.messages||[]).slice(0,c+1).map((pe,Ge)=>Ge===c?{...pe,content:L}:pe);return{...I,messages:Ne}})),Bo(null),fl(""),requestAnimationFrame(()=>Go("auto",M));try{const U=await fetch(`${_}/sessions/${M}/messages/${c}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:L})});if(!U.ok)throw new Error(`HTTP ${U.status}`)}catch(U){console.error("Failed to update message:",U),t(I=>I.map(W=>{if(W.session_id!==M)return W;const pe=(W.messages||[]).map((Ge,V)=>V===c?{...Ge,content:S}:Ge);return{...W,messages:pe}}));return}await Na(c,L)}}async function Na(c,S=null){var Ne,pe,Ge,V,ue,we;const E=n;if(At||!E||typeof c!="number")return;const L=((Ne=e.find(Y=>Y.session_id===E))==null?void 0:Ne.messages)||[];let M=c;for(let Y=c;Y>=0;Y--)if(((pe=L[Y])==null?void 0:pe.role)==="user"){M=Y;break}t(Y=>Y.map(ne=>ne.session_id===E?{...ne,messages:(ne.messages||[]).slice(0,M+1)}:ne));const A=Ta(E);let U=S??(((Ge=L[M])==null?void 0:Ge.content)||""),I=[];const W=[];try{const Y=Fa(E),ne=S??(((V=L[M])==null?void 0:V.content)||"");if((ue=Y==null?void 0:Y.states)!=null&&ue.is_indexed)try{const Q=await Ca(Y.slug,ne,A.signal);Q.contextBlock&&W.push(Q.contextBlock),Array.isArray(Q.sources)&&I.push(...Q.sources)}catch(Q){if(Ut(Q))throw Q;console.warn("local library enrichment (regenerate) failed",Q)}if(ul)try{const Q=L.slice(Math.max(0,M-7),M+1).map(fe=>({role:fe.role,content:fe.content||""}));Q.length>0&&(Q[Q.length-1]={role:"user",content:ne});const Z=await(await fetch(`${_}/websearch`,{method:"POST",headers:{"Content-Type":"application/json"},signal:A.signal,body:JSON.stringify({prompt:ne,model:ge,messages:Q,history_limit:8,searx_url:kt||null,engines:Array.isArray(Je)?Je:null})})).json();Z&&typeof Z.context_block=="string"&&Z.context_block.trim()&&W.push(Z.context_block.trim()),Array.isArray(Z==null?void 0:Z.sources)&&I.push(...Z.sources)}catch(Q){if(Ut(Q))throw Q;console.warn("web search enrichment (regenerate) failed",Q)}if(I=[...new Set(I)],W.length>0?U=`${ne} + +${W.join(` + +`)}`:U=null,lt){const Q=`msg-${Date.now()}-${Math.random()}`;let Nt="";t(Z=>Z.map(fe=>fe.session_id===E?{...fe,messages:[...fe.messages||[],{id:Q,role:"assistant",content:"",sources:I}]}:fe));try{const Z=await fetch(`${_}/sessions/${E}/regenerate`,{method:"POST",headers:{"Content-Type":"application/json"},signal:A.signal,body:JSON.stringify({index:c,model:ge,stream:!0,enriched_message:U,sources:I||[]})});if(!Z.ok)throw new Error(`HTTP ${Z.status}`);const fe=(we=Z.body)==null?void 0:we.getReader();if(!fe)throw new Error("Missing response body");const Ht=new TextDecoder;let ht=!1;for(;;){const{value:hn,done:Cp}=await fe.read();if(Cp)break;const Np=Ht.decode(hn,{stream:!0});Nt+=Np,fn(E,Q,Nt),!ht&&Ce.current!==E&&(ht=!0,dn(Xo=>({...Xo,[E]:Q})),Tn(Xo=>[...new Set([...Xo,E])]))}Ce.current!==E?(dn(hn=>({...hn,[E]:Q})),Tn(hn=>[...new Set([...hn,E])])):$n.current[E]?Mn(hn=>({...hn,[E]:Q})):requestAnimationFrame(()=>On(Q,"smooth",E))}catch(Z){if(Ut(Z)){fn(E,Q,Nt,{removeIfEmpty:!0});return}console.error(Z),fn(E,Q,`Error: ${Wo(Z)}`,{removeIfEmpty:!0});return}}else{const Q=await fetch(`${_}/sessions/${E}/regenerate`,{method:"POST",headers:{"Content-Type":"application/json"},signal:A.signal,body:JSON.stringify({index:c,model:ge,stream:!1,enriched_message:U,sources:I||[]})});if(!Q.ok)throw new Error(`HTTP ${Q.status}`);const Nt=await Q.json(),Z=`msg-${Date.now()}`;t(fe=>fe.map(Ht=>Ht.session_id===E?{...Ht,messages:[...Ht.messages||[],{role:"assistant",content:Nt.reply,id:Z,sources:I}]}:Ht)),Ce.current!==E?(dn(fe=>({...fe,[E]:Z})),Tn(fe=>[...new Set([...fe,E])])):$n.current[E]?Mn(fe=>({...fe,[E]:Z})):requestAnimationFrame(()=>On(Z,"smooth",E))}}catch(Y){Ut(Y)||console.error(Y)}finally{Vo(A)}}const[_a,lp]=m.useState({}),$n=m.useRef({}),[op,dn]=m.useState({}),pn=m.useRef({}),La=m.useRef({}),[Pa,Mn]=m.useState({}),[ip,Ra]=m.useState({}),ja=(c,S,E)=>c!=null&&c.id?c.id:`${E}:${S}`;m.useEffect(()=>{var S;if(!n)return;const c=((S=e.find(E=>E.session_id===n))==null?void 0:S.messages)||[];Ra(E=>{const L={};return c.forEach((M,A)=>{if(M.role!=="user")return;const U=ja(M,A,n),W=(M.content||"").split(/\r\n|\r|\n/).length>30;L[U]=W?E[U]??!0:!1}),L})},[e,n]);function sp(c){Ra(S=>({...S,[c]:!(S[c]??!0)}))}const pr=Te.useCallback((c,S)=>{lp(E=>{const L={...E,[c]:S};return $n.current=L,L})},[]),zn=m.useRef(null),ap=m.useRef(!1),up=m.useRef(null),Ce=m.useRef(n);m.useEffect(()=>{Ce.current=n},[n]);const Ta=Te.useCallback(c=>{const S=new AbortController;return zn.current={controller:S,sessionId:c},Ao(!0),S},[]),Vo=Te.useCallback(c=>{var S;((S=zn.current)==null?void 0:S.controller)===c&&(zn.current=null,Ao(!1))},[]),cp=Te.useCallback(()=>{const c=zn.current;c&&(zn.current=null,c.controller.abort(),Ao(!1))},[]);m.useEffect(()=>()=>{var c;(c=zn.current)==null||c.controller.abort()},[]);const Bt=m.useRef(null),[fp,dp]=m.useState(230),[pl,$a]=m.useState(!1),pp=Te.useCallback(c=>{$a(!0)},[]),Qo=Te.useCallback(()=>{$a(!1)},[]),Ko=Te.useCallback(c=>{if(pl){const S=Math.max(230,Math.min(500,c.clientX));dp(S)}},[pl]);Te.useEffect(()=>(window.addEventListener("mousemove",Ko),window.addEventListener("mouseup",Qo),()=>{window.removeEventListener("mousemove",Ko),window.removeEventListener("mouseup",Qo)}),[Ko,Qo]),Te.useEffect(()=>{pl?document.body.classList.add("no-select"):document.body.classList.remove("no-select")},[pl]),Te.useEffect(()=>{const c=async S=>{const E=S.target.closest(".codeblock__copy");if(!E)return;const L=E.closest(".codeblock"),M=L==null?void 0:L.querySelector("pre > code");if(M)try{await navigator.clipboard.writeText(M.textContent||""),E.classList.add("copied"),setTimeout(()=>E.classList.remove("copied"),800)}catch(A){console.error("Copy failed:",A)}};return document.addEventListener("click",c),()=>document.removeEventListener("click",c)},[]),m.useEffect(()=>{window.electronAPI.getSettings().then(S=>{F(S.ollamaApiUrl),se(S.colorScheme||"Default"),rt(S.chatModel||""),Be(S.streamOutput||!1),ka(S.scrollPositions||{}),el(S.colorScheme||"Default")});const c=()=>{var S;l==="chats"&&((S=Ye.current)==null||S.focus())};return window.electronAPI.onWindowFocus(c),()=>{}},[l]),m.useEffect(()=>{el(H)},[H]);const hp=c=>{!c||!_||fetch(`${_}/history?session_id=${encodeURIComponent(c)}`).then(S=>S.json()).then(S=>{t(E=>E.map(L=>L.session_id===c?{...L,messages:S.messages||[]}:L))}).catch(()=>{})};async function hl(){if(_)try{const S=await(await fetch(`${_}/libraries`)).json(),E=Array.isArray(S.libraries)?S.libraries:[];if(w(E),E.length===0){h(null);return}E.some(L=>L.slug===P)||h(E[0].slug)}catch(c){console.warn("Failed to load libraries",c)}}async function bo(){if(_)try{const S=await(await fetch(`${_}/jobs`)).json();N(Array.isArray(S.jobs)?S.jobs:[])}catch(c){console.warn("Failed to load library jobs",c)}}async function Ma(c=null){const E=(typeof c=="string"?c:T).trim();if(!E){B("Name is required.");return}try{B("");const L=await fetch(`${_}/libraries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:E})});if(!L.ok){const A=await L.text();throw new Error(A||`HTTP ${L.status}`)}const M=await L.json();j(!1),$(""),await hl(),M!=null&&M.slug&&h(M.slug)}catch(L){console.error("Failed to create library",L),B(String((L==null?void 0:L.message)||L))}}m.useEffect(()=>{_&&(Uo(!0),fetch(`${_}/sessions`).then(c=>c.json()).then(c=>{const S=c.sessions.map(E=>({...E,messages:[]}));t(S),S.length>0?r(S[0].session_id):r(null),Uo(!1)}).catch(()=>{Uo(!1)}))},[_]),m.useEffect(()=>{_&&(hl(),bo())},[_]),m.useEffect(()=>{try{localStorage.setItem(hc,JSON.stringify(f||{}))}catch{}},[f]),m.useEffect(()=>{if(!_)return;const c=setInterval(()=>{hl(),bo()},3e3);return()=>clearInterval(c)},[_,l,P]),m.useEffect(()=>{hp(n)},[n]),m.useEffect(()=>{const c=new Set(y.map(S=>S.slug));d(S=>{let E=!1;const L={};for(const[M,A]of Object.entries(S||{}))c.has(A)?L[M]=A:E=!0;return E?L:S})},[y]);const Yo=c=>{o(c)},mp=c=>{Sp(c)},Fn=m.useMemo(()=>{var c;return((c=e.find(S=>S.session_id===n))==null?void 0:c.messages)||[]},[n,e]),ml=m.useMemo(()=>y.find(c=>c.slug===P)||null,[P,y]),Ct=n&&f[n]||null,ot=m.useMemo(()=>y.find(c=>c.slug===Ct)||null,[Ct,y]),za=m.useMemo(()=>Ct?k.some(c=>c.slug===Ct&&(c.status==="queued"||c.status==="running")):!1,[Ct,k]),Jo=m.useMemo(()=>{var c,S;return ot?(c=ot.files)!=null&&c.length?(S=ot.states)!=null&&S.is_indexed?"":za?" (syncing)":" (needs sync)":" (empty)":""},[ot,za]);function gp(c){return c&&f[c]||null}function Fa(c){const S=gp(c);return S&&y.find(E=>E.slug===S)||null}function Oa(c){return c?k.some(S=>S.slug===c&&(S.status==="queued"||S.status==="running")):!1}function Ia(c,S){c&&d(E=>{const L={...E||{}};return S?L[c]=S:delete L[c],L})}function vp(c){c&&d(S=>{let E=!1;const L={};for(const[M,A]of Object.entries(S||{})){if(A===c){E=!0;continue}L[M]=A}return E?L:S})}m.useEffect(()=>{if(!D)return;const c=S=>{var E;(E=x.current)!=null&&E.contains(S.target)||G(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[D]),m.useEffect(()=>{G(!1)},[n,l]),m.useEffect(()=>{const c=n,S=l;return()=>{if(S==="chats"&&c){const E=typeof pn.current[c]=="number"?pn.current[c]:Ee.current?Ee.current.scrollTop:0;ka(L=>{const M={...L,[c]:E};return window.electronAPI.updateSettings({scrollPositions:M}),M})}}},[n,l]),m.useEffect(()=>{const c=Ee.current;if(!c)return;const S=()=>{const{scrollTop:E,scrollHeight:L,clientHeight:M}=c,A=L-E-M<=Xv;if(n){const U=La.current[n],I=typeof U=="number"&&Ec.removeEventListener("scroll",S)},[n,pr]),m.useEffect(()=>{const c=n;c&&_a[c]===!1&&Mn(S=>{if(!(c in S))return S;const E={...S};return delete E[c],E})},[n,_a]),m.useLayoutEffect(()=>{if(l!=="chats"||!n)return;const c=Ee.current;if(!c)return;Bt.current=null;const S=()=>{if(Bt.current===n)return;const U=typeof pn.current[n]=="number"?pn.current[n]:void 0,I=typeof U=="number"?U:cl[n];if(typeof I=="number"){c.scrollTop=I,Bt.current=n;return}Fn.length>0&&(c.scrollTop=c.scrollHeight,Bt.current=n)};S();const E=requestAnimationFrame(S),L=()=>{Bt.current!==n&&requestAnimationFrame(S)},M=new MutationObserver(L);M.observe(c,{childList:!0,subtree:!0});const A=new ResizeObserver(L);return A.observe(c),()=>{cancelAnimationFrame(E),M.disconnect(),A.disconnect()}},[n,l,Fn.length,cl]),m.useEffect(()=>{if(l!=="chats"||!n||Bt.current===n)return;const c=typeof pn.current[n]=="number"?pn.current[n]:void 0;typeof(typeof c=="number"?c:cl[n])!="number"&&Fn.length>0&&requestAnimationFrame(()=>{const E=Ee.current;E&&(E.scrollTop=E.scrollHeight,Bt.current=n)})},[Fn.length,n,l,cl]);const Go=(c="smooth",S=null)=>{const E=Ee.current;if(!E)return;const L=S??Ce.current;Ce.current===L&&(E.scrollTo({top:E.scrollHeight,behavior:c}),pr(L,!1))},On=(c,S="auto",E=null)=>{const L=Ee.current;if(!L)return;const M=E??Ce.current;if(Ce.current!==M)return;const A=document.getElementById(c);if(A){const U=Math.max(0,A.offsetTop-Gv);L.scrollTo({top:U,behavior:S})}},yp=()=>{const c=Ce.current,S=Pa[c];S&&(On(S,"smooth",c),Mn(E=>{const{[c]:L,...M}=E;return M}))};async function Da(){var M,A,U;if(At||!xt.trim()||!ge)return;let c=n,S=!1;if(c){const I=e.find(W=>W.session_id===c);S=I&&I.name==="New Chat"&&I.messages.length===0}else{const I=await Aa();await new Promise(W=>setTimeout(W,200)),c=I.session_id,S=!0}const E={role:"user",content:xt.trim(),id:`msg-${Date.now()}-${Math.random()}`};ap.current=!0,up.current=c,pr(c,!1),Ce.current===c&&(Bt.current=Ce.current),Pd.flushSync(()=>{t(I=>I.map(W=>W.session_id===c?{...W,messages:[...W.messages||[],E]}:W)),cn("")}),requestAnimationFrame(()=>Go("auto",c));const L=Ta(c);try{let I=[];try{I=[...(((M=e.find(we=>we.session_id===c))==null?void 0:M.messages)||[]).slice(-8).map(we=>({role:we.role,content:we.content||""})),{role:"user",content:E.content}]}catch{}let W=E.content,Ne=[];const pe=[],Ge=Fa(c);if((A=Ge==null?void 0:Ge.states)!=null&&A.is_indexed)try{const V=await Ca(Ge.slug,E.content,L.signal);V.contextBlock&&pe.push(V.contextBlock),Array.isArray(V.sources)&&Ne.push(...V.sources)}catch(V){if(Ut(V))throw V;console.warn("local library enrichment failed",V)}if(ul)try{const ue=await(await fetch(`${_}/websearch`,{method:"POST",headers:{"Content-Type":"application/json"},signal:L.signal,body:JSON.stringify({prompt:E.content,model:ge,messages:I,history_limit:8,searx_url:kt||null,engines:Array.isArray(Je)?Je:null})})).json();ue&&typeof ue.context_block=="string"&&ue.context_block.trim()&&pe.push(ue.context_block.trim()),Array.isArray(ue==null?void 0:ue.sources)&&Ne.push(...ue.sources)}catch(V){if(Ut(V))throw V;console.warn("web search enrichment failed",V)}if(Ne=[...new Set(Ne)],pe.length>0&&(W=`${E.content} + +${pe.join(` + +`)}`),lt){const V=`msg-${Date.now()}-${Math.random()}`;let ue="";const we={role:"assistant",content:"",id:V,sources:Ne};t(Y=>Y.map(ne=>ne.session_id===c?{...ne,messages:[...ne.messages||[],we]}:ne));try{const Y=await fetch(`${_}/chat`,{method:"POST",headers:{"Content-Type":"application/json"},signal:L.signal,body:JSON.stringify({session_id:c,model:ge,message:E.content,enriched_message:pe.length>0?W:null,stream:!0,sources:Ne||[]})});if(!Y.ok)throw new Error(`HTTP ${Y.status}`);const ne=(U=Y.body)==null?void 0:U.getReader();if(!ne)throw new Error("Missing response body");const Q=new TextDecoder;let Nt=!1;for(;;){const{value:Z,done:fe}=await ne.read();if(fe){fn(c,V,ue),Ce.current===c?$n.current[c]?Mn(ht=>({...ht,[c]:V})):requestAnimationFrame(()=>On(V,"smooth",c)):(dn(ht=>({...ht,[c]:V})),Tn(ht=>[...new Set([...ht,c])]));break}const Ht=Q.decode(Z,{stream:!0});ue+=Ht,fn(c,V,ue),Ce.current===c&&!$n.current[c]&&Go("auto",c),Ce.current!==c&&!Nt&&(dn(ht=>({...ht,[c]:V})),Nt=!0)}}catch(Y){if(Ut(Y)){fn(c,V,ue,{removeIfEmpty:!0});return}console.error("Failed to send message:",Y),fn(c,V,"Error: "+Wo(Y),{removeIfEmpty:!0});return}}else{const V=await fetch(`${_}/chat`,{method:"POST",headers:{"Content-Type":"application/json"},signal:L.signal,body:JSON.stringify({session_id:c,model:ge,message:E.content,enriched_message:pe.length>0?W:null,stream:!1,sources:Ne||[]})});if(!V.ok)throw new Error(`HTTP ${V.status}`);const ue=await V.json(),we=`msg-${Date.now()}`,Y={role:"assistant",content:ue.reply,id:we,sources:Ne};t(ne=>ne.map(Q=>Q.session_id===c?{...Q,messages:[...Q.messages||[],Y]}:Q)),we&&(Ce.current===c?$n.current[c]?Mn(ne=>({...ne,[c]:we})):requestAnimationFrame(()=>On(we,"smooth",c)):dn(ne=>({...ne,[c]:we})))}Ce.current!==c&&Tn(V=>[...new Set([...V,c])]),S&&fetch(`${_}/generate-title`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:c,message:E.content,model:ge})}).then(V=>V.json()).then(V=>{const ue=V.title.replace(/[\s\S]*?<\/think(?:ing)?>/i,"").trim();t(we=>we.map(Y=>Y.session_id===c?{...Y,name:ue}:Y))})}catch(I){if(Ut(I)){Vo(L);return}console.error("Failed to send message:",I);const W={role:"assistant",content:"Error: "+Wo(I),id:`msg-${Date.now()}-${Math.random()}`};t(Ne=>Ne.map(pe=>pe.session_id===c?{...pe,messages:[...pe.messages,W]}:pe))}finally{Vo(L)}}function wp(){Zd(c=>!c)}async function Aa(){var M;const c="sess-"+Math.random().toString(36).slice(2)+Date.now().toString(36),E=await(await fetch(`${_}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:c})})).json(),L={...E,messages:[]};return t(A=>[L,...A]),r(E.session_id),(M=Ye.current)==null||M.focus(),E}function Sp(c){r(c),Tn(E=>E.filter(L=>L!==c));const S=op[c];S&&requestAnimationFrame(()=>{let E=12;const L=()=>{if(!Ee.current)return;let A=document.getElementById(S);if(!A){const U=e.find(I=>I.session_id===c);if(U&&Array.isArray(U.messages))for(let I=U.messages.length-1;I>=0;I--){const W=U.messages[I];if(W.role==="assistant"&&W.id){A=document.getElementById(W.id);break}}}A?(On(A.id,"smooth",c),dn(U=>{const{[c]:I,...W}=U;return W})):E-- >0&&requestAnimationFrame(L)};requestAnimationFrame(L)})}function xp(c,S){fetch(`${_}/sessions/${c}/rename`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:S})}).then(()=>{t(E=>E.map(L=>L.session_id===c?{...L,name:S}:L)),u(null)})}function kp(c,S){const E=(S||"").trim(),L=y.find(M=>M.slug===c);if(!L){g(null);return}if(!E||E===L.name){g(null);return}fetch(`${_}/libraries/${c}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:E})}).then(()=>{w(M=>M.map(A=>A.slug===c?{...A,name:E}:A)),g(null)})}function Ua(c){fetch(`${_}/sessions/${c}`,{method:"DELETE"}).then(()=>{const S=e.filter(E=>E.session_id!==c);t(S),d(E=>{const L={...E||{}};return delete L[c],L}),n===c&&r(S.length>0?S[0].session_id:null)})}m.useEffect(()=>{const c=e.filter(S=>S.name==="New Chat"&&S.session_id!==n&&S.messages.length===0);c.length>0&&c.forEach(S=>{Ua(S.session_id)})},[n,e,_]);const Ep=c=>{var E;window.getSelection().toString().length>0||document.activeElement!==Ye.current&&(c.target.closest(".msg")||(E=Ye.current)==null||E.focus())};return v.jsxs("div",{className:"app",style:{gridTemplateColumns:`${fp}px 1fr`},children:[v.jsxs("div",{className:"sidebar",children:[v.jsxs("div",{className:"sidebar-header",children:[v.jsx("div",{className:`sidebar-tab ${l==="chats"?"active":""}`,onClick:()=>Yo("chats"),children:"Chats"}),v.jsx("div",{className:`sidebar-tab ${l==="dbs"?"active":""}`,onClick:()=>Yo("dbs"),children:"DBs"}),v.jsx("div",{className:`sidebar-tab ${l==="settings"?"active":""}`,onClick:()=>Yo("settings"),children:"Settings"})]}),v.jsxs("div",{className:"sidebar-content",children:[l==="chats"&&v.jsx("div",{className:"chat-list",children:e.map(c=>v.jsx("div",{className:`chat-item ${c.session_id===n?"active":""}`,onClick:()=>mp(c.session_id),children:s===c.session_id?v.jsx("input",{type:"text",className:"rename-input",defaultValue:c.name,onBlur:()=>u(null),onKeyDown:S=>{S.key==="Enter"?xp(c.session_id,S.target.value):S.key==="Escape"&&u(null)},autoFocus:!0}):v.jsxs(v.Fragment,{children:[v.jsx("span",{children:c.name}),v.jsxs("div",{className:"chat-item-buttons",children:[qd.includes(c.session_id)&&v.jsx("div",{className:"unread-dot"}),v.jsx("button",{className:"icon-button",onClick:S=>{S.stopPropagation(),u(c.session_id)},children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-edit-2",children:v.jsx("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})})}),v.jsx("button",{className:"icon-button",onClick:S=>{S.stopPropagation(),Ua(c.session_id)},children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-x",children:[v.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),v.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]})},c.session_id))}),l==="dbs"&&v.jsx("div",{className:"db-list",children:y.length===0?v.jsx("div",{className:"empty-list-message",children:"No databases yet."}):y.map(c=>v.jsx("div",{className:`chat-item ${c.slug===P?"active":""}`,onClick:()=>h(c.slug),children:p===c.slug?v.jsx("input",{type:"text",className:"rename-input",defaultValue:c.name,onBlur:()=>g(null),onKeyDown:S=>{S.key==="Enter"?kp(c.slug,S.target.value):S.key==="Escape"&&g(null)},autoFocus:!0}):v.jsxs(v.Fragment,{children:[v.jsx("span",{children:c.name}),v.jsxs("div",{className:"chat-item-buttons",children:[Ct===c.slug&&v.jsx("div",{className:"db-active-badge",children:"Chat"}),Oa(c.slug)&&v.jsx("div",{className:"db-active-badge",children:"Syncing"}),v.jsx("button",{className:"icon-button",onClick:S=>{S.stopPropagation(),g(c.slug)},children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-edit-2",children:v.jsx("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})})})]})]})},c.slug))}),l==="settings"&&v.jsxs("div",{className:"settings-list",children:[v.jsx("div",{className:`settings-item ${i==="General"?"active":""}`,onClick:()=>a("General"),children:"General"}),v.jsx("div",{className:`settings-item ${i==="Interface"?"active":""}`,onClick:()=>a("Interface"),children:"Interface"}),v.jsx("div",{className:`settings-item ${i==="Websearch"?"active":""}`,onClick:()=>a("Websearch"),children:"Websearch"})]})]}),l!=="settings"&&v.jsxs("div",{className:"sidebar-footer",children:[l==="chats"&&v.jsx("button",{className:"button new-chat-button",onClick:Aa,children:"New Chat"}),l==="dbs"&&(C?v.jsxs("div",{className:"new-db-form",children:[v.jsx("input",{type:"text",className:"rename-input",value:T,onChange:c=>$(c.target.value),onKeyDown:c=>{c.key==="Enter"?Ma():c.key==="Escape"&&(j(!1),$(""),B(""))},placeholder:"Database name",autoFocus:!0}),O&&v.jsx("div",{className:"form-error",children:O}),v.jsxs("div",{className:"new-db-actions",children:[v.jsx("button",{className:"button new-db-button",onClick:()=>Ma(),children:"Create"}),v.jsx("button",{className:"button ghost",onClick:()=>{j(!1),$(""),B("")},children:"Cancel"})]})]}):v.jsx("button",{className:"button new-db-button",onClick:()=>{j(!0),B("")},children:"New Database"}))]}),v.jsx("div",{className:"resizer",onMouseDown:pp})]}),v.jsxs("div",{className:"main-content",children:[l==="chats"&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"header",children:[v.jsxs("strong",{children:["Chat - ",((Ba=e.find(c=>c.session_id===n))==null?void 0:Ba.name)||"New Chat"]}),ot&&v.jsx("span",{className:"header-subtle",children:`DB: ${ot.name}${Jo}`})]}),v.jsx("div",{className:"chat",ref:Ee,onClick:Ep,children:Fn.map((c,S)=>{const E=c.role==="user"&&ep===S;return v.jsx("div",{id:c.id,className:"msg "+(c.role==="user"?"user":"assistant")+(E?" editing":""),children:c.role==="assistant"?v.jsxs("div",{className:"assistant-message-wrapper",children:[v.jsx(Yv,{content:c.content,streamOutput:lt,sources:c.sources}),!At&&v.jsxs("div",{className:"message-options-bar assistant-options",children:[v.jsx("button",{className:"icon-button",title:"Copy message",onClick:()=>Ea(c),children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[v.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),v.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}),v.jsx("button",{className:"icon-button",title:"Regenerate response",onClick:()=>Na(S),children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:v.jsx("path",{d:"M21.5 2v6h-6M2.5 22v-6h6M2 11.5a10 10 0 0 1 18.8-4.3M22 12.5a10 10 0 0 1-18.8 4.3"})})})]})]}):v.jsxs("div",{className:"user-message-wrapper",children:[E?v.jsxs("div",{className:"msg-content msg-content--user editing",children:[v.jsx("div",{className:"user-edit-shadow","aria-hidden":"true",children:Ho}),v.jsx(sc,{className:"edit-message-input edit-overlay",value:Ho,onChange:L=>fl(L.target.value),onBlur:dl,onKeyDown:L=>{L.key==="Escape"&&(L.preventDefault(),dl()),L.key==="Enter"&&!L.shiftKey&&(L.preventDefault(),rp(S))},autoFocus:!0,minRows:1})]}):(()=>{const L=c.content||"",M=L.split(/\r\n|\r|\n/),A=M.length>30,U=ja(c,S,n),I=A?ip[U]??!0:!1,W=I?M.slice(0,30).join(` +`)+` +…`:L;return v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"msg-content msg-content--user",children:W}),A&&v.jsx("button",{className:"user-msg-expand",onClick:()=>sp(U),"aria-expanded":I?"false":"true",children:I?"Show entire message":"Collapse"})]})})(),!At&&!E&&v.jsxs("div",{className:"message-options-bar user-options",children:[v.jsx("button",{className:"icon-button",title:"Edit message",onClick:()=>np(S,c.content),children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[v.jsx("path",{d:"M12 20h9"}),v.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]})}),v.jsx("button",{className:"icon-button",title:"Copy message",onClick:()=>Ea(c),children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[v.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),v.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})]})},c.id||S)})},n),Pa[n]&&v.jsxs("button",{className:"new-msg-tip",onClick:yp,title:"Jump to the new message","aria-label":"Jump to the new message",children:["New message",v.jsx("span",{style:{marginLeft:6},children:"↓"})]}),v.jsx("div",{className:"footer",children:v.jsxs("div",{className:"footer-content-wrapper",children:[v.jsx(sc,{ref:Ye,className:"input",value:xt,onChange:c=>cn(c.target.value),onKeyDown:c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),Da())},placeholder:"Ask any question...",maxRows:13}),v.jsxs("div",{className:"footer-tool-group",ref:x,children:[v.jsx("button",{type:"button",className:"db-picker-toggle"+(ot?" active":""),onClick:()=>{n&&G(c=>!c)},title:ot?`Database: ${ot.name}${Jo}`:"Select database for this chat","aria-haspopup":"menu","aria-expanded":D,disabled:!n,children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[v.jsx("ellipse",{cx:"12",cy:"5",rx:"8",ry:"3"}),v.jsx("path",{d:"M4 5v6c0 1.7 3.6 3 8 3s8-1.3 8-3V5"}),v.jsx("path",{d:"M4 11v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6"})]})}),D&&v.jsxs("div",{className:"db-picker-menu",role:"menu",children:[v.jsxs("button",{type:"button",className:"db-picker-option"+(Ct?"":" selected"),onClick:()=>{Ia(n,null),G(!1)},children:[v.jsx("span",{children:"No database"}),!Ct&&v.jsx("span",{className:"db-picker-status",children:"Selected"})]}),y.length===0?v.jsx("div",{className:"db-picker-empty",children:"No databases yet."}):y.map(c=>{var M,A,U;const S=Ct===c.slug,E=Oa(c.slug),L=(M=c.files)!=null&&M.length?(A=c.states)!=null&&A.is_indexed?"Ready":E?"Syncing":"Needs sync":"Empty";return v.jsxs("button",{type:"button",className:"db-picker-option"+(S?" selected":""),disabled:!((U=c.files)!=null&&U.length),onClick:()=>{Ia(n,c.slug),G(!1)},children:[v.jsx("span",{children:c.name}),v.jsx("span",{className:"db-picker-status",children:S?"Selected":L})]},c.slug)})]})]}),v.jsx("button",{type:"button",className:"websearch-toggle"+(ul?" active":""),onClick:wp,title:"Toggle web search","aria-pressed":ul,children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[v.jsx("circle",{cx:"12",cy:"12",r:"10"}),v.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),v.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]})}),v.jsx("button",{className:"button",onClick:At?cp:Da,title:At?"Cancel generation":"Send","aria-label":At?"Cancel generation":"Send",children:At?v.jsx("div",{className:"spinner"}):"Send"})]})})]}),l==="dbs"&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"header",children:[v.jsx("strong",{children:(ml==null?void 0:ml.name)||"Databases"}),ot&&v.jsx("span",{className:"header-subtle",children:`Current chat DB: ${ot.name}${Jo}`})]}),v.jsx(Qv,{apiBase:_,library:ml,jobs:k,onRefresh:async()=>{await hl(),await bo()},onDeleted:c=>{if(P===c){const S=y.find(E=>E.slug!==c);h((S==null?void 0:S.slug)||null)}vp(c)}})]}),l==="settings"&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"header",children:v.jsxs("strong",{children:[i," Settings"]})}),i==="General"&&v.jsx(Av,{onModelChange:rt,streamOutput:lt,onStreamOutputChange:Be}),i==="Interface"&&v.jsx(Wv,{}),i==="Websearch"&&v.jsx(Kv,{searxUrl:kt,setSearxUrl:Et,engines:Je,setEngines:Xd})]})]})]})}function qv(){return m.useEffect(()=>{window.electronAPI.getSettings().then(e=>{el(e.colorScheme||"Default")})},[]),v.jsx(Te.StrictMode,{children:v.jsx(fv,{children:v.jsx(Hg,{children:v.jsx(Bd,{path:"/",element:v.jsx(Zv,{})})})})})}const ey=Rd(document.getElementById("root"));ey.render(v.jsx(qv,{})); diff --git a/dist/index.html b/dist/index.html index 579a8e8..324532e 100644 --- a/dist/index.html +++ b/dist/index.html @@ -5,8 +5,8 @@ LLM Desktop - - + +