memi-agent 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,210 @@
1
+ (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 s of l)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(l){if(l.ep)return;l.ep=!0;const s=n(l);fetch(l.href,s)}})();function sd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ha={exports:{}},Wl={},Va={exports:{}},Q={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var zr=Symbol.for("react.element"),id=Symbol.for("react.portal"),od=Symbol.for("react.fragment"),ad=Symbol.for("react.strict_mode"),ud=Symbol.for("react.profiler"),cd=Symbol.for("react.provider"),dd=Symbol.for("react.context"),fd=Symbol.for("react.forward_ref"),pd=Symbol.for("react.suspense"),md=Symbol.for("react.memo"),hd=Symbol.for("react.lazy"),jo=Symbol.iterator;function gd(e){return e===null||typeof e!="object"?null:(e=jo&&e[jo]||e["@@iterator"],typeof e=="function"?e:null)}var Ba={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Qa=Object.assign,Ka={};function Un(e,t,n){this.props=e,this.context=t,this.refs=Ka,this.updater=n||Ba}Un.prototype.isReactComponent={};Un.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")};Un.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ga(){}Ga.prototype=Un.prototype;function _i(e,t,n){this.props=e,this.context=t,this.refs=Ka,this.updater=n||Ba}var bi=_i.prototype=new Ga;bi.constructor=_i;Qa(bi,Un.prototype);bi.isPureReactComponent=!0;var Co=Array.isArray,Ya=Object.prototype.hasOwnProperty,Ti={current:null},Ja={key:!0,ref:!0,__self:!0,__source:!0};function qa(e,t,n){var r,l={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)Ya.call(t,r)&&!Ja.hasOwnProperty(r)&&(l[r]=t[r]);var a=arguments.length-2;if(a===1)l.children=n;else if(1<a){for(var u=Array(a),d=0;d<a;d++)u[d]=arguments[d+2];l.children=u}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)l[r]===void 0&&(l[r]=a[r]);return{$$typeof:zr,type:e,key:s,ref:o,props:l,_owner:Ti.current}}function yd(e,t){return{$$typeof:zr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ii(e){return typeof e=="object"&&e!==null&&e.$$typeof===zr}function xd(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Eo=/\/+/g;function ls(e,t){return typeof e=="object"&&e!==null&&e.key!=null?xd(""+e.key):t.toString(36)}function sl(e,t,n,r,l){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case zr:case id:o=!0}}if(o)return o=e,l=l(o),e=r===""?"."+ls(o,0):r,Co(l)?(n="",e!=null&&(n=e.replace(Eo,"$&/")+"/"),sl(l,t,n,"",function(d){return d})):l!=null&&(Ii(l)&&(l=yd(l,n+(!l.key||o&&o.key===l.key?"":(""+l.key).replace(Eo,"$&/")+"/")+e)),t.push(l)),1;if(o=0,r=r===""?".":r+":",Co(e))for(var a=0;a<e.length;a++){s=e[a];var u=r+ls(s,a);o+=sl(s,t,n,u,l)}else if(u=gd(e),typeof u=="function")for(e=u.call(e),a=0;!(s=e.next()).done;)s=s.value,u=r+ls(s,a++),o+=sl(s,t,n,u,l);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Ar(e,t,n){if(e==null)return e;var r=[],l=0;return sl(e,r,"","",function(s){return t.call(n,s,l++)}),r}function vd(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Re={current:null},il={transition:null},wd={ReactCurrentDispatcher:Re,ReactCurrentBatchConfig:il,ReactCurrentOwner:Ti};function Xa(){throw Error("act(...) is not supported in production builds of React.")}Q.Children={map:Ar,forEach:function(e,t,n){Ar(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ar(e,function(){t++}),t},toArray:function(e){return Ar(e,function(t){return t})||[]},only:function(e){if(!Ii(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Q.Component=Un;Q.Fragment=od;Q.Profiler=ud;Q.PureComponent=_i;Q.StrictMode=ad;Q.Suspense=pd;Q.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=wd;Q.act=Xa;Q.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Qa({},e.props),l=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=Ti.current),t.key!==void 0&&(l=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(u in t)Ya.call(t,u)&&!Ja.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&a!==void 0?a[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){a=Array(u);for(var d=0;d<u;d++)a[d]=arguments[d+2];r.children=a}return{$$typeof:zr,type:e.type,key:l,ref:s,props:r,_owner:o}};Q.createContext=function(e){return e={$$typeof:dd,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:cd,_context:e},e.Consumer=e};Q.createElement=qa;Q.createFactory=function(e){var t=qa.bind(null,e);return t.type=e,t};Q.createRef=function(){return{current:null}};Q.forwardRef=function(e){return{$$typeof:fd,render:e}};Q.isValidElement=Ii;Q.lazy=function(e){return{$$typeof:hd,_payload:{_status:-1,_result:e},_init:vd}};Q.memo=function(e,t){return{$$typeof:md,type:e,compare:t===void 0?null:t}};Q.startTransition=function(e){var t=il.transition;il.transition={};try{e()}finally{il.transition=t}};Q.unstable_act=Xa;Q.useCallback=function(e,t){return Re.current.useCallback(e,t)};Q.useContext=function(e){return Re.current.useContext(e)};Q.useDebugValue=function(){};Q.useDeferredValue=function(e){return Re.current.useDeferredValue(e)};Q.useEffect=function(e,t){return Re.current.useEffect(e,t)};Q.useId=function(){return Re.current.useId()};Q.useImperativeHandle=function(e,t,n){return Re.current.useImperativeHandle(e,t,n)};Q.useInsertionEffect=function(e,t){return Re.current.useInsertionEffect(e,t)};Q.useLayoutEffect=function(e,t){return Re.current.useLayoutEffect(e,t)};Q.useMemo=function(e,t){return Re.current.useMemo(e,t)};Q.useReducer=function(e,t,n){return Re.current.useReducer(e,t,n)};Q.useRef=function(e){return Re.current.useRef(e)};Q.useState=function(e){return Re.current.useState(e)};Q.useSyncExternalStore=function(e,t,n){return Re.current.useSyncExternalStore(e,t,n)};Q.useTransition=function(){return Re.current.useTransition()};Q.version="18.3.1";Va.exports=Q;var I=Va.exports;const kd=sd(I);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Sd=I,Nd=Symbol.for("react.element"),jd=Symbol.for("react.fragment"),Cd=Object.prototype.hasOwnProperty,Ed=Sd.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Pd={key:!0,ref:!0,__self:!0,__source:!0};function Za(e,t,n){var r,l={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)Cd.call(t,r)&&!Pd.hasOwnProperty(r)&&(l[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)l[r]===void 0&&(l[r]=t[r]);return{$$typeof:Nd,type:e,key:s,ref:o,props:l,_owner:Ed.current}}Wl.Fragment=jd;Wl.jsx=Za;Wl.jsxs=Za;Ha.exports=Wl;var i=Ha.exports,zs={},eu={exports:{}},Ye={},tu={exports:{}},nu={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(x,P){var T=x.length;x.push(P);e:for(;0<T;){var H=T-1>>>1,U=x[H];if(0<l(U,P))x[H]=P,x[T]=U,T=H;else break e}}function n(x){return x.length===0?null:x[0]}function r(x){if(x.length===0)return null;var P=x[0],T=x.pop();if(T!==P){x[0]=T;e:for(var H=0,U=x.length,ie=U>>>1;H<ie;){var Ae=2*(H+1)-1,rt=x[Ae],ze=Ae+1,lt=x[ze];if(0>l(rt,T))ze<U&&0>l(lt,rt)?(x[H]=lt,x[ze]=T,H=ze):(x[H]=rt,x[Ae]=T,H=Ae);else if(ze<U&&0>l(lt,T))x[H]=lt,x[ze]=T,H=ze;else break e}}return P}function l(x,P){var T=x.sortIndex-P.sortIndex;return T!==0?T:x.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var u=[],d=[],h=1,m=null,g=3,w=!1,k=!1,j=!1,R=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function f(x){for(var P=n(d);P!==null;){if(P.callback===null)r(d);else if(P.startTime<=x)r(d),P.sortIndex=P.expirationTime,t(u,P);else break;P=n(d)}}function y(x){if(j=!1,f(x),!k)if(n(u)!==null)k=!0,b(E);else{var P=n(d);P!==null&&F(y,P.startTime-x)}}function E(x,P){k=!1,j&&(j=!1,p(L),L=-1),w=!0;var T=g;try{for(f(P),m=n(u);m!==null&&(!(m.expirationTime>P)||x&&!he());){var H=m.callback;if(typeof H=="function"){m.callback=null,g=m.priorityLevel;var U=H(m.expirationTime<=P);P=e.unstable_now(),typeof U=="function"?m.callback=U:m===n(u)&&r(u),f(P)}else r(u);m=n(u)}if(m!==null)var ie=!0;else{var Ae=n(d);Ae!==null&&F(y,Ae.startTime-P),ie=!1}return ie}finally{m=null,g=T,w=!1}}var C=!1,_=null,L=-1,K=5,A=-1;function he(){return!(e.unstable_now()-A<K)}function N(){if(_!==null){var x=e.unstable_now();A=x;var P=!0;try{P=_(!0,x)}finally{P?Z():(C=!1,_=null)}}else C=!1}var Z;if(typeof c=="function")Z=function(){c(N)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,ke=Y.port2;Y.port1.onmessage=N,Z=function(){ke.postMessage(null)}}else Z=function(){R(N,0)};function b(x){_=x,C||(C=!0,Z())}function F(x,P){L=R(function(){x(e.unstable_now())},P)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(x){x.callback=null},e.unstable_continueExecution=function(){k||w||(k=!0,b(E))},e.unstable_forceFrameRate=function(x){0>x||125<x?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<x?Math.floor(1e3/x):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(x){switch(g){case 1:case 2:case 3:var P=3;break;default:P=g}var T=g;g=P;try{return x()}finally{g=T}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(x,P){switch(x){case 1:case 2:case 3:case 4:case 5:break;default:x=3}var T=g;g=x;try{return P()}finally{g=T}},e.unstable_scheduleCallback=function(x,P,T){var H=e.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0<T?H+T:H):T=H,x){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=T+U,x={id:h++,callback:P,priorityLevel:x,startTime:T,expirationTime:U,sortIndex:-1},T>H?(x.sortIndex=T,t(d,x),n(u)===null&&x===n(d)&&(j?(p(L),L=-1):j=!0,F(y,T-H))):(x.sortIndex=U,t(u,x),k||w||(k=!0,b(E))),x},e.unstable_shouldYield=he,e.unstable_wrapCallback=function(x){var P=g;return function(){var T=g;g=P;try{return x.apply(this,arguments)}finally{g=T}}}})(nu);tu.exports=nu;var _d=tu.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var bd=I,Ge=_d;function S(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var ru=new Set,hr={};function un(e,t){zn(e,t),zn(e+"Capture",t)}function zn(e,t){for(hr[e]=t,e=0;e<t.length;e++)ru.add(t[e])}var Nt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ls=Object.prototype.hasOwnProperty,Td=/^[: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]*$/,Po={},_o={};function Id(e){return Ls.call(_o,e)?!0:Ls.call(Po,e)?!1:Td.test(e)?_o[e]=!0:(Po[e]=!0,!1)}function Md(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 zd(e,t,n,r){if(t===null||typeof t>"u"||Md(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 Oe(e,t,n,r,l,s,o){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=s,this.removeEmptyString=o}var Pe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Pe[e]=new Oe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Pe[t]=new Oe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Pe[e]=new Oe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Pe[e]=new Oe(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){Pe[e]=new Oe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Pe[e]=new Oe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Pe[e]=new Oe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Pe[e]=new Oe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Pe[e]=new Oe(e,5,!1,e.toLowerCase(),null,!1,!1)});var Mi=/[\-:]([a-z])/g;function zi(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(Mi,zi);Pe[t]=new Oe(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(Mi,zi);Pe[t]=new Oe(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(Mi,zi);Pe[t]=new Oe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Pe[e]=new Oe(e,1,!1,e.toLowerCase(),null,!1,!1)});Pe.xlinkHref=new Oe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Pe[e]=new Oe(e,1,!1,e.toLowerCase(),null,!0,!0)});function Li(e,t,n,r){var l=Pe.hasOwnProperty(t)?Pe[t]:null;(l!==null?l.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(zd(t,n,l,r)&&(n=null),r||l===null?Id(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):l.mustUseProperty?e[l.propertyName]=n===null?l.type===3?!1:"":n:(t=l.attributeName,r=l.attributeNamespace,n===null?e.removeAttribute(t):(l=l.type,n=l===3||l===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Pt=bd.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Fr=Symbol.for("react.element"),hn=Symbol.for("react.portal"),gn=Symbol.for("react.fragment"),Di=Symbol.for("react.strict_mode"),Ds=Symbol.for("react.profiler"),lu=Symbol.for("react.provider"),su=Symbol.for("react.context"),Ri=Symbol.for("react.forward_ref"),Rs=Symbol.for("react.suspense"),Os=Symbol.for("react.suspense_list"),Oi=Symbol.for("react.memo"),bt=Symbol.for("react.lazy"),iu=Symbol.for("react.offscreen"),bo=Symbol.iterator;function Qn(e){return e===null||typeof e!="object"?null:(e=bo&&e[bo]||e["@@iterator"],typeof e=="function"?e:null)}var de=Object.assign,ss;function nr(e){if(ss===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ss=t&&t[1]||""}return`
34
+ `+ss+e}var is=!1;function os(e,t){if(!e||is)return"";is=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var r=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){r=d}e.call(t.prototype)}else{try{throw Error()}catch(d){r=d}e()}}catch(d){if(d&&r&&typeof d.stack=="string"){for(var l=d.stack.split(`
35
+ `),s=r.stack.split(`
36
+ `),o=l.length-1,a=s.length-1;1<=o&&0<=a&&l[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(l[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||l[o]!==s[a]){var u=`
37
+ `+l[o].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=o&&0<=a);break}}}finally{is=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?nr(e):""}function Ld(e){switch(e.tag){case 5:return nr(e.type);case 16:return nr("Lazy");case 13:return nr("Suspense");case 19:return nr("SuspenseList");case 0:case 2:case 15:return e=os(e.type,!1),e;case 11:return e=os(e.type.render,!1),e;case 1:return e=os(e.type,!0),e;default:return""}}function As(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 gn:return"Fragment";case hn:return"Portal";case Ds:return"Profiler";case Di:return"StrictMode";case Rs:return"Suspense";case Os:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case su:return(e.displayName||"Context")+".Consumer";case lu:return(e._context.displayName||"Context")+".Provider";case Ri:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Oi:return t=e.displayName||null,t!==null?t:As(e.type)||"Memo";case bt:t=e._payload,e=e._init;try{return As(e(t))}catch{}}return null}function Dd(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 As(t);case 8:return t===Di?"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 Vt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ou(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Rd(e){var t=ou(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,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ur(e){e._valueTracker||(e._valueTracker=Rd(e))}function au(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ou(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function yl(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 Fs(e,t){var n=t.checked;return de({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function To(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Vt(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 uu(e,t){t=t.checked,t!=null&&Li(e,"checked",t,!1)}function Us(e,t){uu(e,t);var n=Vt(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")?$s(e,t.type,n):t.hasOwnProperty("defaultValue")&&$s(e,t.type,Vt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Io(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 $s(e,t,n){(t!=="number"||yl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var rr=Array.isArray;function Pn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Vt(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,r&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function Ws(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(S(91));return de({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Mo(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(S(92));if(rr(n)){if(1<n.length)throw Error(S(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Vt(n)}}function cu(e,t){var n=Vt(t.value),r=Vt(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function zo(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function du(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Hs(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?du(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var $r,fu=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,l){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,l)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for($r=$r||document.createElement("div"),$r.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=$r.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function gr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ir={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},Od=["Webkit","ms","Moz","O"];Object.keys(ir).forEach(function(e){Od.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ir[t]=ir[e]})});function pu(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ir.hasOwnProperty(e)&&ir[e]?(""+t).trim():t+"px"}function mu(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=pu(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Ad=de({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 Vs(e,t){if(t){if(Ad[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(S(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(S(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(S(61))}if(t.style!=null&&typeof t.style!="object")throw Error(S(62))}}function Bs(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 Qs=null;function Ai(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ks=null,_n=null,bn=null;function Lo(e){if(e=Rr(e)){if(typeof Ks!="function")throw Error(S(280));var t=e.stateNode;t&&(t=Kl(t),Ks(e.stateNode,e.type,t))}}function hu(e){_n?bn?bn.push(e):bn=[e]:_n=e}function gu(){if(_n){var e=_n,t=bn;if(bn=_n=null,Lo(e),t)for(e=0;e<t.length;e++)Lo(t[e])}}function yu(e,t){return e(t)}function xu(){}var as=!1;function vu(e,t,n){if(as)return e(t,n);as=!0;try{return yu(e,t,n)}finally{as=!1,(_n!==null||bn!==null)&&(xu(),gu())}}function yr(e,t){var n=e.stateNode;if(n===null)return null;var r=Kl(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(S(231,t,typeof n));return n}var Gs=!1;if(Nt)try{var Kn={};Object.defineProperty(Kn,"passive",{get:function(){Gs=!0}}),window.addEventListener("test",Kn,Kn),window.removeEventListener("test",Kn,Kn)}catch{Gs=!1}function Fd(e,t,n,r,l,s,o,a,u){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(h){this.onError(h)}}var or=!1,xl=null,vl=!1,Ys=null,Ud={onError:function(e){or=!0,xl=e}};function $d(e,t,n,r,l,s,o,a,u){or=!1,xl=null,Fd.apply(Ud,arguments)}function Wd(e,t,n,r,l,s,o,a,u){if($d.apply(this,arguments),or){if(or){var d=xl;or=!1,xl=null}else throw Error(S(198));vl||(vl=!0,Ys=d)}}function cn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function wu(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Do(e){if(cn(e)!==e)throw Error(S(188))}function Hd(e){var t=e.alternate;if(!t){if(t=cn(e),t===null)throw Error(S(188));return t!==e?null:e}for(var n=e,r=t;;){var l=n.return;if(l===null)break;var s=l.alternate;if(s===null){if(r=l.return,r!==null){n=r;continue}break}if(l.child===s.child){for(s=l.child;s;){if(s===n)return Do(l),e;if(s===r)return Do(l),t;s=s.sibling}throw Error(S(188))}if(n.return!==r.return)n=l,r=s;else{for(var o=!1,a=l.child;a;){if(a===n){o=!0,n=l,r=s;break}if(a===r){o=!0,r=l,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=l;break}if(a===r){o=!0,r=s,n=l;break}a=a.sibling}if(!o)throw Error(S(189))}}if(n.alternate!==r)throw Error(S(190))}if(n.tag!==3)throw Error(S(188));return n.stateNode.current===n?e:t}function ku(e){return e=Hd(e),e!==null?Su(e):null}function Su(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Su(e);if(t!==null)return t;e=e.sibling}return null}var Nu=Ge.unstable_scheduleCallback,Ro=Ge.unstable_cancelCallback,Vd=Ge.unstable_shouldYield,Bd=Ge.unstable_requestPaint,me=Ge.unstable_now,Qd=Ge.unstable_getCurrentPriorityLevel,Fi=Ge.unstable_ImmediatePriority,ju=Ge.unstable_UserBlockingPriority,wl=Ge.unstable_NormalPriority,Kd=Ge.unstable_LowPriority,Cu=Ge.unstable_IdlePriority,Hl=null,gt=null;function Gd(e){if(gt&&typeof gt.onCommitFiberRoot=="function")try{gt.onCommitFiberRoot(Hl,e,void 0,(e.current.flags&128)===128)}catch{}}var ut=Math.clz32?Math.clz32:qd,Yd=Math.log,Jd=Math.LN2;function qd(e){return e>>>=0,e===0?32:31-(Yd(e)/Jd|0)|0}var Wr=64,Hr=4194304;function lr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function kl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~l;a!==0?r=lr(a):(s&=o,s!==0&&(r=lr(s)))}else o=n&~l,o!==0?r=lr(o):s!==0&&(r=lr(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,s=t&-t,l>=s||l===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-ut(t),l=1<<n,r|=e[n],t&=~l;return r}function Xd(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Zd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,l=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-ut(s),a=1<<o,u=l[o];u===-1?(!(a&n)||a&r)&&(l[o]=Xd(a,t)):u<=t&&(e.expiredLanes|=a),s&=~a}}function Js(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Eu(){var e=Wr;return Wr<<=1,!(Wr&4194240)&&(Wr=64),e}function us(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Lr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ut(t),e[t]=n}function ef(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var l=31-ut(n),s=1<<l;t[l]=0,r[l]=-1,e[l]=-1,n&=~s}}function Ui(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ut(n),l=1<<r;l&t|e[r]&t&&(e[r]|=t),n&=~l}}var q=0;function Pu(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var _u,$i,bu,Tu,Iu,qs=!1,Vr=[],Dt=null,Rt=null,Ot=null,xr=new Map,vr=new Map,It=[],tf="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Oo(e,t){switch(e){case"focusin":case"focusout":Dt=null;break;case"dragenter":case"dragleave":Rt=null;break;case"mouseover":case"mouseout":Ot=null;break;case"pointerover":case"pointerout":xr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":vr.delete(t.pointerId)}}function Gn(e,t,n,r,l,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[l]},t!==null&&(t=Rr(t),t!==null&&$i(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function nf(e,t,n,r,l){switch(t){case"focusin":return Dt=Gn(Dt,e,t,n,r,l),!0;case"dragenter":return Rt=Gn(Rt,e,t,n,r,l),!0;case"mouseover":return Ot=Gn(Ot,e,t,n,r,l),!0;case"pointerover":var s=l.pointerId;return xr.set(s,Gn(xr.get(s)||null,e,t,n,r,l)),!0;case"gotpointercapture":return s=l.pointerId,vr.set(s,Gn(vr.get(s)||null,e,t,n,r,l)),!0}return!1}function Mu(e){var t=Xt(e.target);if(t!==null){var n=cn(t);if(n!==null){if(t=n.tag,t===13){if(t=wu(n),t!==null){e.blockedOn=t,Iu(e.priority,function(){bu(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ol(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Xs(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Qs=r,n.target.dispatchEvent(r),Qs=null}else return t=Rr(n),t!==null&&$i(t),e.blockedOn=n,!1;t.shift()}return!0}function Ao(e,t,n){ol(e)&&n.delete(t)}function rf(){qs=!1,Dt!==null&&ol(Dt)&&(Dt=null),Rt!==null&&ol(Rt)&&(Rt=null),Ot!==null&&ol(Ot)&&(Ot=null),xr.forEach(Ao),vr.forEach(Ao)}function Yn(e,t){e.blockedOn===t&&(e.blockedOn=null,qs||(qs=!0,Ge.unstable_scheduleCallback(Ge.unstable_NormalPriority,rf)))}function wr(e){function t(l){return Yn(l,e)}if(0<Vr.length){Yn(Vr[0],e);for(var n=1;n<Vr.length;n++){var r=Vr[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Dt!==null&&Yn(Dt,e),Rt!==null&&Yn(Rt,e),Ot!==null&&Yn(Ot,e),xr.forEach(t),vr.forEach(t),n=0;n<It.length;n++)r=It[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<It.length&&(n=It[0],n.blockedOn===null);)Mu(n),n.blockedOn===null&&It.shift()}var Tn=Pt.ReactCurrentBatchConfig,Sl=!0;function lf(e,t,n,r){var l=q,s=Tn.transition;Tn.transition=null;try{q=1,Wi(e,t,n,r)}finally{q=l,Tn.transition=s}}function sf(e,t,n,r){var l=q,s=Tn.transition;Tn.transition=null;try{q=4,Wi(e,t,n,r)}finally{q=l,Tn.transition=s}}function Wi(e,t,n,r){if(Sl){var l=Xs(e,t,n,r);if(l===null)vs(e,t,r,Nl,n),Oo(e,r);else if(nf(l,e,t,n,r))r.stopPropagation();else if(Oo(e,r),t&4&&-1<tf.indexOf(e)){for(;l!==null;){var s=Rr(l);if(s!==null&&_u(s),s=Xs(e,t,n,r),s===null&&vs(e,t,r,Nl,n),s===l)break;l=s}l!==null&&r.stopPropagation()}else vs(e,t,r,null,n)}}var Nl=null;function Xs(e,t,n,r){if(Nl=null,e=Ai(r),e=Xt(e),e!==null)if(t=cn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=wu(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Nl=e,null}function zu(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Qd()){case Fi:return 1;case ju:return 4;case wl:case Kd:return 16;case Cu:return 536870912;default:return 16}default:return 16}}var zt=null,Hi=null,al=null;function Lu(){if(al)return al;var e,t=Hi,n=t.length,r,l="value"in zt?zt.value:zt.textContent,s=l.length;for(e=0;e<n&&t[e]===l[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===l[s-r];r++);return al=l.slice(e,1<r?1-r:void 0)}function ul(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Br(){return!0}function Fo(){return!1}function Je(e){function t(n,r,l,s,o){this._reactName=n,this._targetInst=l,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Br:Fo,this.isPropagationStopped=Fo,this}return de(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Br)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Br)},persist:function(){},isPersistent:Br}),t}var $n={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vi=Je($n),Dr=de({},$n,{view:0,detail:0}),of=Je(Dr),cs,ds,Jn,Vl=de({},Dr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bi,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Jn&&(Jn&&e.type==="mousemove"?(cs=e.screenX-Jn.screenX,ds=e.screenY-Jn.screenY):ds=cs=0,Jn=e),cs)},movementY:function(e){return"movementY"in e?e.movementY:ds}}),Uo=Je(Vl),af=de({},Vl,{dataTransfer:0}),uf=Je(af),cf=de({},Dr,{relatedTarget:0}),fs=Je(cf),df=de({},$n,{animationName:0,elapsedTime:0,pseudoElement:0}),ff=Je(df),pf=de({},$n,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),mf=Je(pf),hf=de({},$n,{data:0}),$o=Je(hf),gf={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yf={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},xf={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function vf(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=xf[e])?!!t[e]:!1}function Bi(){return vf}var wf=de({},Dr,{key:function(e){if(e.key){var t=gf[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ul(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?yf[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bi,charCode:function(e){return e.type==="keypress"?ul(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ul(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),kf=Je(wf),Sf=de({},Vl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Wo=Je(Sf),Nf=de({},Dr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bi}),jf=Je(Nf),Cf=de({},$n,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ef=Je(Cf),Pf=de({},Vl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),_f=Je(Pf),bf=[9,13,27,32],Qi=Nt&&"CompositionEvent"in window,ar=null;Nt&&"documentMode"in document&&(ar=document.documentMode);var Tf=Nt&&"TextEvent"in window&&!ar,Du=Nt&&(!Qi||ar&&8<ar&&11>=ar),Ho=" ",Vo=!1;function Ru(e,t){switch(e){case"keyup":return bf.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ou(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var yn=!1;function If(e,t){switch(e){case"compositionend":return Ou(t);case"keypress":return t.which!==32?null:(Vo=!0,Ho);case"textInput":return e=t.data,e===Ho&&Vo?null:e;default:return null}}function Mf(e,t){if(yn)return e==="compositionend"||!Qi&&Ru(e,t)?(e=Lu(),al=Hi=zt=null,yn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Du&&t.locale!=="ko"?null:t.data;default:return null}}var zf={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Bo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!zf[e.type]:t==="textarea"}function Au(e,t,n,r){hu(r),t=jl(t,"onChange"),0<t.length&&(n=new Vi("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ur=null,kr=null;function Lf(e){Yu(e,0)}function Bl(e){var t=wn(e);if(au(t))return e}function Df(e,t){if(e==="change")return t}var Fu=!1;if(Nt){var ps;if(Nt){var ms="oninput"in document;if(!ms){var Qo=document.createElement("div");Qo.setAttribute("oninput","return;"),ms=typeof Qo.oninput=="function"}ps=ms}else ps=!1;Fu=ps&&(!document.documentMode||9<document.documentMode)}function Ko(){ur&&(ur.detachEvent("onpropertychange",Uu),kr=ur=null)}function Uu(e){if(e.propertyName==="value"&&Bl(kr)){var t=[];Au(t,kr,e,Ai(e)),vu(Lf,t)}}function Rf(e,t,n){e==="focusin"?(Ko(),ur=t,kr=n,ur.attachEvent("onpropertychange",Uu)):e==="focusout"&&Ko()}function Of(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Bl(kr)}function Af(e,t){if(e==="click")return Bl(t)}function Ff(e,t){if(e==="input"||e==="change")return Bl(t)}function Uf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dt=typeof Object.is=="function"?Object.is:Uf;function Sr(e,t){if(dt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var l=n[r];if(!Ls.call(t,l)||!dt(e[l],t[l]))return!1}return!0}function Go(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Yo(e,t){var n=Go(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Go(n)}}function $u(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$u(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Wu(){for(var e=window,t=yl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=yl(e.document)}return t}function Ki(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 $f(e){var t=Wu(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&$u(n.ownerDocument.documentElement,n)){if(r!==null&&Ki(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,s=Math.min(r.start,l);r=r.end===void 0?s:Math.min(r.end,l),!e.extend&&s>r&&(l=r,r=s,s=l),l=Yo(n,s);var o=Yo(n,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Wf=Nt&&"documentMode"in document&&11>=document.documentMode,xn=null,Zs=null,cr=null,ei=!1;function Jo(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ei||xn==null||xn!==yl(r)||(r=xn,"selectionStart"in r&&Ki(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}),cr&&Sr(cr,r)||(cr=r,r=jl(Zs,"onSelect"),0<r.length&&(t=new Vi("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=xn)))}function Qr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var vn={animationend:Qr("Animation","AnimationEnd"),animationiteration:Qr("Animation","AnimationIteration"),animationstart:Qr("Animation","AnimationStart"),transitionend:Qr("Transition","TransitionEnd")},hs={},Hu={};Nt&&(Hu=document.createElement("div").style,"AnimationEvent"in window||(delete vn.animationend.animation,delete vn.animationiteration.animation,delete vn.animationstart.animation),"TransitionEvent"in window||delete vn.transitionend.transition);function Ql(e){if(hs[e])return hs[e];if(!vn[e])return e;var t=vn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Hu)return hs[e]=t[n];return e}var Vu=Ql("animationend"),Bu=Ql("animationiteration"),Qu=Ql("animationstart"),Ku=Ql("transitionend"),Gu=new Map,qo="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Qt(e,t){Gu.set(e,t),un(t,[e])}for(var gs=0;gs<qo.length;gs++){var ys=qo[gs],Hf=ys.toLowerCase(),Vf=ys[0].toUpperCase()+ys.slice(1);Qt(Hf,"on"+Vf)}Qt(Vu,"onAnimationEnd");Qt(Bu,"onAnimationIteration");Qt(Qu,"onAnimationStart");Qt("dblclick","onDoubleClick");Qt("focusin","onFocus");Qt("focusout","onBlur");Qt(Ku,"onTransitionEnd");zn("onMouseEnter",["mouseout","mouseover"]);zn("onMouseLeave",["mouseout","mouseover"]);zn("onPointerEnter",["pointerout","pointerover"]);zn("onPointerLeave",["pointerout","pointerover"]);un("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));un("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));un("onBeforeInput",["compositionend","keypress","textInput","paste"]);un("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));un("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));un("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var sr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Bf=new Set("cancel close invalid load scroll toggle".split(" ").concat(sr));function Xo(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Wd(r,t,void 0,e),e.currentTarget=null}function Yu(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],l=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],u=a.instance,d=a.currentTarget;if(a=a.listener,u!==s&&l.isPropagationStopped())break e;Xo(l,a,d),s=u}else for(o=0;o<r.length;o++){if(a=r[o],u=a.instance,d=a.currentTarget,a=a.listener,u!==s&&l.isPropagationStopped())break e;Xo(l,a,d),s=u}}}if(vl)throw e=Ys,vl=!1,Ys=null,e}function re(e,t){var n=t[si];n===void 0&&(n=t[si]=new Set);var r=e+"__bubble";n.has(r)||(Ju(t,e,2,!1),n.add(r))}function xs(e,t,n){var r=0;t&&(r|=4),Ju(n,e,r,t)}var Kr="_reactListening"+Math.random().toString(36).slice(2);function Nr(e){if(!e[Kr]){e[Kr]=!0,ru.forEach(function(n){n!=="selectionchange"&&(Bf.has(n)||xs(n,!1,e),xs(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Kr]||(t[Kr]=!0,xs("selectionchange",!1,t))}}function Ju(e,t,n,r){switch(zu(t)){case 1:var l=lf;break;case 4:l=sf;break;default:l=Wi}n=l.bind(null,t,n,e),l=void 0,!Gs||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),r?l!==void 0?e.addEventListener(t,n,{capture:!0,passive:l}):e.addEventListener(t,n,!0):l!==void 0?e.addEventListener(t,n,{passive:l}):e.addEventListener(t,n,!1)}function vs(e,t,n,r,l){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===l||a.nodeType===8&&a.parentNode===l)break;if(o===4)for(o=r.return;o!==null;){var u=o.tag;if((u===3||u===4)&&(u=o.stateNode.containerInfo,u===l||u.nodeType===8&&u.parentNode===l))return;o=o.return}for(;a!==null;){if(o=Xt(a),o===null)return;if(u=o.tag,u===5||u===6){r=s=o;continue e}a=a.parentNode}}r=r.return}vu(function(){var d=s,h=Ai(n),m=[];e:{var g=Gu.get(e);if(g!==void 0){var w=Vi,k=e;switch(e){case"keypress":if(ul(n)===0)break e;case"keydown":case"keyup":w=kf;break;case"focusin":k="focus",w=fs;break;case"focusout":k="blur",w=fs;break;case"beforeblur":case"afterblur":w=fs;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":w=Uo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":w=uf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":w=jf;break;case Vu:case Bu:case Qu:w=ff;break;case Ku:w=Ef;break;case"scroll":w=of;break;case"wheel":w=_f;break;case"copy":case"cut":case"paste":w=mf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":w=Wo}var j=(t&4)!==0,R=!j&&e==="scroll",p=j?g!==null?g+"Capture":null:g;j=[];for(var c=d,f;c!==null;){f=c;var y=f.stateNode;if(f.tag===5&&y!==null&&(f=y,p!==null&&(y=yr(c,p),y!=null&&j.push(jr(c,y,f)))),R)break;c=c.return}0<j.length&&(g=new w(g,k,null,n,h),m.push({event:g,listeners:j}))}}if(!(t&7)){e:{if(g=e==="mouseover"||e==="pointerover",w=e==="mouseout"||e==="pointerout",g&&n!==Qs&&(k=n.relatedTarget||n.fromElement)&&(Xt(k)||k[jt]))break e;if((w||g)&&(g=h.window===h?h:(g=h.ownerDocument)?g.defaultView||g.parentWindow:window,w?(k=n.relatedTarget||n.toElement,w=d,k=k?Xt(k):null,k!==null&&(R=cn(k),k!==R||k.tag!==5&&k.tag!==6)&&(k=null)):(w=null,k=d),w!==k)){if(j=Uo,y="onMouseLeave",p="onMouseEnter",c="mouse",(e==="pointerout"||e==="pointerover")&&(j=Wo,y="onPointerLeave",p="onPointerEnter",c="pointer"),R=w==null?g:wn(w),f=k==null?g:wn(k),g=new j(y,c+"leave",w,n,h),g.target=R,g.relatedTarget=f,y=null,Xt(h)===d&&(j=new j(p,c+"enter",k,n,h),j.target=f,j.relatedTarget=R,y=j),R=y,w&&k)t:{for(j=w,p=k,c=0,f=j;f;f=pn(f))c++;for(f=0,y=p;y;y=pn(y))f++;for(;0<c-f;)j=pn(j),c--;for(;0<f-c;)p=pn(p),f--;for(;c--;){if(j===p||p!==null&&j===p.alternate)break t;j=pn(j),p=pn(p)}j=null}else j=null;w!==null&&Zo(m,g,w,j,!1),k!==null&&R!==null&&Zo(m,R,k,j,!0)}}e:{if(g=d?wn(d):window,w=g.nodeName&&g.nodeName.toLowerCase(),w==="select"||w==="input"&&g.type==="file")var E=Df;else if(Bo(g))if(Fu)E=Ff;else{E=Of;var C=Rf}else(w=g.nodeName)&&w.toLowerCase()==="input"&&(g.type==="checkbox"||g.type==="radio")&&(E=Af);if(E&&(E=E(e,d))){Au(m,E,n,h);break e}C&&C(e,g,d),e==="focusout"&&(C=g._wrapperState)&&C.controlled&&g.type==="number"&&$s(g,"number",g.value)}switch(C=d?wn(d):window,e){case"focusin":(Bo(C)||C.contentEditable==="true")&&(xn=C,Zs=d,cr=null);break;case"focusout":cr=Zs=xn=null;break;case"mousedown":ei=!0;break;case"contextmenu":case"mouseup":case"dragend":ei=!1,Jo(m,n,h);break;case"selectionchange":if(Wf)break;case"keydown":case"keyup":Jo(m,n,h)}var _;if(Qi)e:{switch(e){case"compositionstart":var L="onCompositionStart";break e;case"compositionend":L="onCompositionEnd";break e;case"compositionupdate":L="onCompositionUpdate";break e}L=void 0}else yn?Ru(e,n)&&(L="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(L="onCompositionStart");L&&(Du&&n.locale!=="ko"&&(yn||L!=="onCompositionStart"?L==="onCompositionEnd"&&yn&&(_=Lu()):(zt=h,Hi="value"in zt?zt.value:zt.textContent,yn=!0)),C=jl(d,L),0<C.length&&(L=new $o(L,e,null,n,h),m.push({event:L,listeners:C}),_?L.data=_:(_=Ou(n),_!==null&&(L.data=_)))),(_=Tf?If(e,n):Mf(e,n))&&(d=jl(d,"onBeforeInput"),0<d.length&&(h=new $o("onBeforeInput","beforeinput",null,n,h),m.push({event:h,listeners:d}),h.data=_))}Yu(m,t)})}function jr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function jl(e,t){for(var n=t+"Capture",r=[];e!==null;){var l=e,s=l.stateNode;l.tag===5&&s!==null&&(l=s,s=yr(e,n),s!=null&&r.unshift(jr(e,s,l)),s=yr(e,t),s!=null&&r.push(jr(e,s,l))),e=e.return}return r}function pn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Zo(e,t,n,r,l){for(var s=t._reactName,o=[];n!==null&&n!==r;){var a=n,u=a.alternate,d=a.stateNode;if(u!==null&&u===r)break;a.tag===5&&d!==null&&(a=d,l?(u=yr(n,s),u!=null&&o.unshift(jr(n,u,a))):l||(u=yr(n,s),u!=null&&o.push(jr(n,u,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Qf=/\r\n?/g,Kf=/\u0000|\uFFFD/g;function ea(e){return(typeof e=="string"?e:""+e).replace(Qf,`
38
+ `).replace(Kf,"")}function Gr(e,t,n){if(t=ea(t),ea(e)!==t&&n)throw Error(S(425))}function Cl(){}var ti=null,ni=null;function ri(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var li=typeof setTimeout=="function"?setTimeout:void 0,Gf=typeof clearTimeout=="function"?clearTimeout:void 0,ta=typeof Promise=="function"?Promise:void 0,Yf=typeof queueMicrotask=="function"?queueMicrotask:typeof ta<"u"?function(e){return ta.resolve(null).then(e).catch(Jf)}:li;function Jf(e){setTimeout(function(){throw e})}function ws(e,t){var n=t,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(r===0){e.removeChild(l),wr(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=l}while(n);wr(t)}function At(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function na(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Wn=Math.random().toString(36).slice(2),ht="__reactFiber$"+Wn,Cr="__reactProps$"+Wn,jt="__reactContainer$"+Wn,si="__reactEvents$"+Wn,qf="__reactListeners$"+Wn,Xf="__reactHandles$"+Wn;function Xt(e){var t=e[ht];if(t)return t;for(var n=e.parentNode;n;){if(t=n[jt]||n[ht]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=na(e);e!==null;){if(n=e[ht])return n;e=na(e)}return t}e=n,n=e.parentNode}return null}function Rr(e){return e=e[ht]||e[jt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function wn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(S(33))}function Kl(e){return e[Cr]||null}var ii=[],kn=-1;function Kt(e){return{current:e}}function le(e){0>kn||(e.current=ii[kn],ii[kn]=null,kn--)}function te(e,t){kn++,ii[kn]=e.current,e.current=t}var Bt={},Me=Kt(Bt),We=Kt(!1),rn=Bt;function Ln(e,t){var n=e.type.contextTypes;if(!n)return Bt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},s;for(s in n)l[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function He(e){return e=e.childContextTypes,e!=null}function El(){le(We),le(Me)}function ra(e,t,n){if(Me.current!==Bt)throw Error(S(168));te(Me,t),te(We,n)}function qu(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(S(108,Dd(e)||"Unknown",l));return de({},n,r)}function Pl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Bt,rn=Me.current,te(Me,e),te(We,We.current),!0}function la(e,t,n){var r=e.stateNode;if(!r)throw Error(S(169));n?(e=qu(e,t,rn),r.__reactInternalMemoizedMergedChildContext=e,le(We),le(Me),te(Me,e)):le(We),te(We,n)}var vt=null,Gl=!1,ks=!1;function Xu(e){vt===null?vt=[e]:vt.push(e)}function Zf(e){Gl=!0,Xu(e)}function Gt(){if(!ks&&vt!==null){ks=!0;var e=0,t=q;try{var n=vt;for(q=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}vt=null,Gl=!1}catch(l){throw vt!==null&&(vt=vt.slice(e+1)),Nu(Fi,Gt),l}finally{q=t,ks=!1}}return null}var Sn=[],Nn=0,_l=null,bl=0,qe=[],Xe=0,ln=null,wt=1,kt="";function Jt(e,t){Sn[Nn++]=bl,Sn[Nn++]=_l,_l=e,bl=t}function Zu(e,t,n){qe[Xe++]=wt,qe[Xe++]=kt,qe[Xe++]=ln,ln=e;var r=wt;e=kt;var l=32-ut(r)-1;r&=~(1<<l),n+=1;var s=32-ut(t)+l;if(30<s){var o=l-l%5;s=(r&(1<<o)-1).toString(32),r>>=o,l-=o,wt=1<<32-ut(t)+l|n<<l|r,kt=s+e}else wt=1<<s|n<<l|r,kt=e}function Gi(e){e.return!==null&&(Jt(e,1),Zu(e,1,0))}function Yi(e){for(;e===_l;)_l=Sn[--Nn],Sn[Nn]=null,bl=Sn[--Nn],Sn[Nn]=null;for(;e===ln;)ln=qe[--Xe],qe[Xe]=null,kt=qe[--Xe],qe[Xe]=null,wt=qe[--Xe],qe[Xe]=null}var Ke=null,Qe=null,oe=!1,at=null;function ec(e,t){var n=Ze(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function sa(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ke=e,Qe=At(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ke=e,Qe=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ln!==null?{id:wt,overflow:kt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ze(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ke=e,Qe=null,!0):!1;default:return!1}}function oi(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ai(e){if(oe){var t=Qe;if(t){var n=t;if(!sa(e,t)){if(oi(e))throw Error(S(418));t=At(n.nextSibling);var r=Ke;t&&sa(e,t)?ec(r,n):(e.flags=e.flags&-4097|2,oe=!1,Ke=e)}}else{if(oi(e))throw Error(S(418));e.flags=e.flags&-4097|2,oe=!1,Ke=e}}}function ia(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ke=e}function Yr(e){if(e!==Ke)return!1;if(!oe)return ia(e),oe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ri(e.type,e.memoizedProps)),t&&(t=Qe)){if(oi(e))throw tc(),Error(S(418));for(;t;)ec(e,t),t=At(t.nextSibling)}if(ia(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(S(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Qe=At(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Qe=null}}else Qe=Ke?At(e.stateNode.nextSibling):null;return!0}function tc(){for(var e=Qe;e;)e=At(e.nextSibling)}function Dn(){Qe=Ke=null,oe=!1}function Ji(e){at===null?at=[e]:at.push(e)}var ep=Pt.ReactCurrentBatchConfig;function qn(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(S(309));var r=n.stateNode}if(!r)throw Error(S(147,e));var l=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var a=l.refs;o===null?delete a[s]:a[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(S(284));if(!n._owner)throw Error(S(290,e))}return e}function Jr(e,t){throw e=Object.prototype.toString.call(t),Error(S(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function oa(e){var t=e._init;return t(e._payload)}function nc(e){function t(p,c){if(e){var f=p.deletions;f===null?(p.deletions=[c],p.flags|=16):f.push(c)}}function n(p,c){if(!e)return null;for(;c!==null;)t(p,c),c=c.sibling;return null}function r(p,c){for(p=new Map;c!==null;)c.key!==null?p.set(c.key,c):p.set(c.index,c),c=c.sibling;return p}function l(p,c){return p=Wt(p,c),p.index=0,p.sibling=null,p}function s(p,c,f){return p.index=f,e?(f=p.alternate,f!==null?(f=f.index,f<c?(p.flags|=2,c):f):(p.flags|=2,c)):(p.flags|=1048576,c)}function o(p){return e&&p.alternate===null&&(p.flags|=2),p}function a(p,c,f,y){return c===null||c.tag!==6?(c=_s(f,p.mode,y),c.return=p,c):(c=l(c,f),c.return=p,c)}function u(p,c,f,y){var E=f.type;return E===gn?h(p,c,f.props.children,y,f.key):c!==null&&(c.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===bt&&oa(E)===c.type)?(y=l(c,f.props),y.ref=qn(p,c,f),y.return=p,y):(y=gl(f.type,f.key,f.props,null,p.mode,y),y.ref=qn(p,c,f),y.return=p,y)}function d(p,c,f,y){return c===null||c.tag!==4||c.stateNode.containerInfo!==f.containerInfo||c.stateNode.implementation!==f.implementation?(c=bs(f,p.mode,y),c.return=p,c):(c=l(c,f.children||[]),c.return=p,c)}function h(p,c,f,y,E){return c===null||c.tag!==7?(c=nn(f,p.mode,y,E),c.return=p,c):(c=l(c,f),c.return=p,c)}function m(p,c,f){if(typeof c=="string"&&c!==""||typeof c=="number")return c=_s(""+c,p.mode,f),c.return=p,c;if(typeof c=="object"&&c!==null){switch(c.$$typeof){case Fr:return f=gl(c.type,c.key,c.props,null,p.mode,f),f.ref=qn(p,null,c),f.return=p,f;case hn:return c=bs(c,p.mode,f),c.return=p,c;case bt:var y=c._init;return m(p,y(c._payload),f)}if(rr(c)||Qn(c))return c=nn(c,p.mode,f,null),c.return=p,c;Jr(p,c)}return null}function g(p,c,f,y){var E=c!==null?c.key:null;if(typeof f=="string"&&f!==""||typeof f=="number")return E!==null?null:a(p,c,""+f,y);if(typeof f=="object"&&f!==null){switch(f.$$typeof){case Fr:return f.key===E?u(p,c,f,y):null;case hn:return f.key===E?d(p,c,f,y):null;case bt:return E=f._init,g(p,c,E(f._payload),y)}if(rr(f)||Qn(f))return E!==null?null:h(p,c,f,y,null);Jr(p,f)}return null}function w(p,c,f,y,E){if(typeof y=="string"&&y!==""||typeof y=="number")return p=p.get(f)||null,a(c,p,""+y,E);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Fr:return p=p.get(y.key===null?f:y.key)||null,u(c,p,y,E);case hn:return p=p.get(y.key===null?f:y.key)||null,d(c,p,y,E);case bt:var C=y._init;return w(p,c,f,C(y._payload),E)}if(rr(y)||Qn(y))return p=p.get(f)||null,h(c,p,y,E,null);Jr(c,y)}return null}function k(p,c,f,y){for(var E=null,C=null,_=c,L=c=0,K=null;_!==null&&L<f.length;L++){_.index>L?(K=_,_=null):K=_.sibling;var A=g(p,_,f[L],y);if(A===null){_===null&&(_=K);break}e&&_&&A.alternate===null&&t(p,_),c=s(A,c,L),C===null?E=A:C.sibling=A,C=A,_=K}if(L===f.length)return n(p,_),oe&&Jt(p,L),E;if(_===null){for(;L<f.length;L++)_=m(p,f[L],y),_!==null&&(c=s(_,c,L),C===null?E=_:C.sibling=_,C=_);return oe&&Jt(p,L),E}for(_=r(p,_);L<f.length;L++)K=w(_,p,L,f[L],y),K!==null&&(e&&K.alternate!==null&&_.delete(K.key===null?L:K.key),c=s(K,c,L),C===null?E=K:C.sibling=K,C=K);return e&&_.forEach(function(he){return t(p,he)}),oe&&Jt(p,L),E}function j(p,c,f,y){var E=Qn(f);if(typeof E!="function")throw Error(S(150));if(f=E.call(f),f==null)throw Error(S(151));for(var C=E=null,_=c,L=c=0,K=null,A=f.next();_!==null&&!A.done;L++,A=f.next()){_.index>L?(K=_,_=null):K=_.sibling;var he=g(p,_,A.value,y);if(he===null){_===null&&(_=K);break}e&&_&&he.alternate===null&&t(p,_),c=s(he,c,L),C===null?E=he:C.sibling=he,C=he,_=K}if(A.done)return n(p,_),oe&&Jt(p,L),E;if(_===null){for(;!A.done;L++,A=f.next())A=m(p,A.value,y),A!==null&&(c=s(A,c,L),C===null?E=A:C.sibling=A,C=A);return oe&&Jt(p,L),E}for(_=r(p,_);!A.done;L++,A=f.next())A=w(_,p,L,A.value,y),A!==null&&(e&&A.alternate!==null&&_.delete(A.key===null?L:A.key),c=s(A,c,L),C===null?E=A:C.sibling=A,C=A);return e&&_.forEach(function(N){return t(p,N)}),oe&&Jt(p,L),E}function R(p,c,f,y){if(typeof f=="object"&&f!==null&&f.type===gn&&f.key===null&&(f=f.props.children),typeof f=="object"&&f!==null){switch(f.$$typeof){case Fr:e:{for(var E=f.key,C=c;C!==null;){if(C.key===E){if(E=f.type,E===gn){if(C.tag===7){n(p,C.sibling),c=l(C,f.props.children),c.return=p,p=c;break e}}else if(C.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===bt&&oa(E)===C.type){n(p,C.sibling),c=l(C,f.props),c.ref=qn(p,C,f),c.return=p,p=c;break e}n(p,C);break}else t(p,C);C=C.sibling}f.type===gn?(c=nn(f.props.children,p.mode,y,f.key),c.return=p,p=c):(y=gl(f.type,f.key,f.props,null,p.mode,y),y.ref=qn(p,c,f),y.return=p,p=y)}return o(p);case hn:e:{for(C=f.key;c!==null;){if(c.key===C)if(c.tag===4&&c.stateNode.containerInfo===f.containerInfo&&c.stateNode.implementation===f.implementation){n(p,c.sibling),c=l(c,f.children||[]),c.return=p,p=c;break e}else{n(p,c);break}else t(p,c);c=c.sibling}c=bs(f,p.mode,y),c.return=p,p=c}return o(p);case bt:return C=f._init,R(p,c,C(f._payload),y)}if(rr(f))return k(p,c,f,y);if(Qn(f))return j(p,c,f,y);Jr(p,f)}return typeof f=="string"&&f!==""||typeof f=="number"?(f=""+f,c!==null&&c.tag===6?(n(p,c.sibling),c=l(c,f),c.return=p,p=c):(n(p,c),c=_s(f,p.mode,y),c.return=p,p=c),o(p)):n(p,c)}return R}var Rn=nc(!0),rc=nc(!1),Tl=Kt(null),Il=null,jn=null,qi=null;function Xi(){qi=jn=Il=null}function Zi(e){var t=Tl.current;le(Tl),e._currentValue=t}function ui(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 In(e,t){Il=e,qi=jn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&($e=!0),e.firstContext=null)}function tt(e){var t=e._currentValue;if(qi!==e)if(e={context:e,memoizedValue:t,next:null},jn===null){if(Il===null)throw Error(S(308));jn=e,Il.dependencies={lanes:0,firstContext:e}}else jn=jn.next=e;return t}var Zt=null;function eo(e){Zt===null?Zt=[e]:Zt.push(e)}function lc(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,eo(t)):(n.next=l.next,l.next=n),t.interleaved=n,Ct(e,r)}function Ct(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 Tt=!1;function to(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function sc(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 St(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ft(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,G&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Ct(e,n)}return l=r.interleaved,l===null?(t.next=t,eo(r)):(t.next=l.next,l.next=t),r.interleaved=t,Ct(e,n)}function cl(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,Ui(e,n)}}function aa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?l=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?l=s=t:s=s.next=t}else l=s=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:s,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 Ml(e,t,n,r){var l=e.updateQueue;Tt=!1;var s=l.firstBaseUpdate,o=l.lastBaseUpdate,a=l.shared.pending;if(a!==null){l.shared.pending=null;var u=a,d=u.next;u.next=null,o===null?s=d:o.next=d,o=u;var h=e.alternate;h!==null&&(h=h.updateQueue,a=h.lastBaseUpdate,a!==o&&(a===null?h.firstBaseUpdate=d:a.next=d,h.lastBaseUpdate=u))}if(s!==null){var m=l.baseState;o=0,h=d=u=null,a=s;do{var g=a.lane,w=a.eventTime;if((r&g)===g){h!==null&&(h=h.next={eventTime:w,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var k=e,j=a;switch(g=t,w=n,j.tag){case 1:if(k=j.payload,typeof k=="function"){m=k.call(w,m,g);break e}m=k;break e;case 3:k.flags=k.flags&-65537|128;case 0:if(k=j.payload,g=typeof k=="function"?k.call(w,m,g):k,g==null)break e;m=de({},m,g);break e;case 2:Tt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,g=l.effects,g===null?l.effects=[a]:g.push(a))}else w={eventTime:w,lane:g,tag:a.tag,payload:a.payload,callback:a.callback,next:null},h===null?(d=h=w,u=m):h=h.next=w,o|=g;if(a=a.next,a===null){if(a=l.shared.pending,a===null)break;g=a,a=g.next,g.next=null,l.lastBaseUpdate=g,l.shared.pending=null}}while(!0);if(h===null&&(u=m),l.baseState=u,l.firstBaseUpdate=d,l.lastBaseUpdate=h,t=l.shared.interleaved,t!==null){l=t;do o|=l.lane,l=l.next;while(l!==t)}else s===null&&(l.shared.lanes=0);on|=o,e.lanes=o,e.memoizedState=m}}function ua(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],l=r.callback;if(l!==null){if(r.callback=null,r=n,typeof l!="function")throw Error(S(191,l));l.call(r)}}}var Or={},yt=Kt(Or),Er=Kt(Or),Pr=Kt(Or);function en(e){if(e===Or)throw Error(S(174));return e}function no(e,t){switch(te(Pr,t),te(Er,e),te(yt,Or),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Hs(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Hs(t,e)}le(yt),te(yt,t)}function On(){le(yt),le(Er),le(Pr)}function ic(e){en(Pr.current);var t=en(yt.current),n=Hs(t,e.type);t!==n&&(te(Er,e),te(yt,n))}function ro(e){Er.current===e&&(le(yt),le(Er))}var ue=Kt(0);function zl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ss=[];function lo(){for(var e=0;e<Ss.length;e++)Ss[e]._workInProgressVersionPrimary=null;Ss.length=0}var dl=Pt.ReactCurrentDispatcher,Ns=Pt.ReactCurrentBatchConfig,sn=0,ce=null,ve=null,Ne=null,Ll=!1,dr=!1,_r=0,tp=0;function be(){throw Error(S(321))}function so(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!dt(e[n],t[n]))return!1;return!0}function io(e,t,n,r,l,s){if(sn=s,ce=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,dl.current=e===null||e.memoizedState===null?sp:ip,e=n(r,l),dr){s=0;do{if(dr=!1,_r=0,25<=s)throw Error(S(301));s+=1,Ne=ve=null,t.updateQueue=null,dl.current=op,e=n(r,l)}while(dr)}if(dl.current=Dl,t=ve!==null&&ve.next!==null,sn=0,Ne=ve=ce=null,Ll=!1,t)throw Error(S(300));return e}function oo(){var e=_r!==0;return _r=0,e}function mt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ne===null?ce.memoizedState=Ne=e:Ne=Ne.next=e,Ne}function nt(){if(ve===null){var e=ce.alternate;e=e!==null?e.memoizedState:null}else e=ve.next;var t=Ne===null?ce.memoizedState:Ne.next;if(t!==null)Ne=t,ve=e;else{if(e===null)throw Error(S(310));ve=e,e={memoizedState:ve.memoizedState,baseState:ve.baseState,baseQueue:ve.baseQueue,queue:ve.queue,next:null},Ne===null?ce.memoizedState=Ne=e:Ne=Ne.next=e}return Ne}function br(e,t){return typeof t=="function"?t(e):t}function js(e){var t=nt(),n=t.queue;if(n===null)throw Error(S(311));n.lastRenderedReducer=e;var r=ve,l=r.baseQueue,s=n.pending;if(s!==null){if(l!==null){var o=l.next;l.next=s.next,s.next=o}r.baseQueue=l=s,n.pending=null}if(l!==null){s=l.next,r=r.baseState;var a=o=null,u=null,d=s;do{var h=d.lane;if((sn&h)===h)u!==null&&(u=u.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var m={lane:h,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};u===null?(a=u=m,o=r):u=u.next=m,ce.lanes|=h,on|=h}d=d.next}while(d!==null&&d!==s);u===null?o=r:u.next=a,dt(r,t.memoizedState)||($e=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){l=e;do s=l.lane,ce.lanes|=s,on|=s,l=l.next;while(l!==e)}else l===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Cs(e){var t=nt(),n=t.queue;if(n===null)throw Error(S(311));n.lastRenderedReducer=e;var r=n.dispatch,l=n.pending,s=t.memoizedState;if(l!==null){n.pending=null;var o=l=l.next;do s=e(s,o.action),o=o.next;while(o!==l);dt(s,t.memoizedState)||($e=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function oc(){}function ac(e,t){var n=ce,r=nt(),l=t(),s=!dt(r.memoizedState,l);if(s&&(r.memoizedState=l,$e=!0),r=r.queue,ao(dc.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||Ne!==null&&Ne.memoizedState.tag&1){if(n.flags|=2048,Tr(9,cc.bind(null,n,r,l,t),void 0,null),je===null)throw Error(S(349));sn&30||uc(n,t,l)}return l}function uc(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ce.updateQueue,t===null?(t={lastEffect:null,stores:null},ce.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function cc(e,t,n,r){t.value=n,t.getSnapshot=r,fc(t)&&pc(e)}function dc(e,t,n){return n(function(){fc(t)&&pc(e)})}function fc(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!dt(e,n)}catch{return!0}}function pc(e){var t=Ct(e,1);t!==null&&ct(t,e,1,-1)}function ca(e){var t=mt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:br,lastRenderedState:e},t.queue=e,e=e.dispatch=lp.bind(null,ce,e),[t.memoizedState,e]}function Tr(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ce.updateQueue,t===null?(t={lastEffect:null,stores:null},ce.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function mc(){return nt().memoizedState}function fl(e,t,n,r){var l=mt();ce.flags|=e,l.memoizedState=Tr(1|t,n,void 0,r===void 0?null:r)}function Yl(e,t,n,r){var l=nt();r=r===void 0?null:r;var s=void 0;if(ve!==null){var o=ve.memoizedState;if(s=o.destroy,r!==null&&so(r,o.deps)){l.memoizedState=Tr(t,n,s,r);return}}ce.flags|=e,l.memoizedState=Tr(1|t,n,s,r)}function da(e,t){return fl(8390656,8,e,t)}function ao(e,t){return Yl(2048,8,e,t)}function hc(e,t){return Yl(4,2,e,t)}function gc(e,t){return Yl(4,4,e,t)}function yc(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function xc(e,t,n){return n=n!=null?n.concat([e]):null,Yl(4,4,yc.bind(null,t,e),n)}function uo(){}function vc(e,t){var n=nt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&so(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function wc(e,t){var n=nt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&so(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function kc(e,t,n){return sn&21?(dt(n,t)||(n=Eu(),ce.lanes|=n,on|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,$e=!0),e.memoizedState=n)}function np(e,t){var n=q;q=n!==0&&4>n?n:4,e(!0);var r=Ns.transition;Ns.transition={};try{e(!1),t()}finally{q=n,Ns.transition=r}}function Sc(){return nt().memoizedState}function rp(e,t,n){var r=$t(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Nc(e))jc(t,n);else if(n=lc(e,t,n,r),n!==null){var l=De();ct(n,e,r,l),Cc(n,t,r)}}function lp(e,t,n){var r=$t(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Nc(e))jc(t,l);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(l.hasEagerState=!0,l.eagerState=a,dt(a,o)){var u=t.interleaved;u===null?(l.next=l,eo(t)):(l.next=u.next,u.next=l),t.interleaved=l;return}}catch{}finally{}n=lc(e,t,l,r),n!==null&&(l=De(),ct(n,e,r,l),Cc(n,t,r))}}function Nc(e){var t=e.alternate;return e===ce||t!==null&&t===ce}function jc(e,t){dr=Ll=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Cc(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ui(e,n)}}var Dl={readContext:tt,useCallback:be,useContext:be,useEffect:be,useImperativeHandle:be,useInsertionEffect:be,useLayoutEffect:be,useMemo:be,useReducer:be,useRef:be,useState:be,useDebugValue:be,useDeferredValue:be,useTransition:be,useMutableSource:be,useSyncExternalStore:be,useId:be,unstable_isNewReconciler:!1},sp={readContext:tt,useCallback:function(e,t){return mt().memoizedState=[e,t===void 0?null:t],e},useContext:tt,useEffect:da,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,fl(4194308,4,yc.bind(null,t,e),n)},useLayoutEffect:function(e,t){return fl(4194308,4,e,t)},useInsertionEffect:function(e,t){return fl(4,2,e,t)},useMemo:function(e,t){var n=mt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=mt();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=rp.bind(null,ce,e),[r.memoizedState,e]},useRef:function(e){var t=mt();return e={current:e},t.memoizedState=e},useState:ca,useDebugValue:uo,useDeferredValue:function(e){return mt().memoizedState=e},useTransition:function(){var e=ca(!1),t=e[0];return e=np.bind(null,e[1]),mt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ce,l=mt();if(oe){if(n===void 0)throw Error(S(407));n=n()}else{if(n=t(),je===null)throw Error(S(349));sn&30||uc(r,t,n)}l.memoizedState=n;var s={value:n,getSnapshot:t};return l.queue=s,da(dc.bind(null,r,s,e),[e]),r.flags|=2048,Tr(9,cc.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=mt(),t=je.identifierPrefix;if(oe){var n=kt,r=wt;n=(r&~(1<<32-ut(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=_r++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=tp++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ip={readContext:tt,useCallback:vc,useContext:tt,useEffect:ao,useImperativeHandle:xc,useInsertionEffect:hc,useLayoutEffect:gc,useMemo:wc,useReducer:js,useRef:mc,useState:function(){return js(br)},useDebugValue:uo,useDeferredValue:function(e){var t=nt();return kc(t,ve.memoizedState,e)},useTransition:function(){var e=js(br)[0],t=nt().memoizedState;return[e,t]},useMutableSource:oc,useSyncExternalStore:ac,useId:Sc,unstable_isNewReconciler:!1},op={readContext:tt,useCallback:vc,useContext:tt,useEffect:ao,useImperativeHandle:xc,useInsertionEffect:hc,useLayoutEffect:gc,useMemo:wc,useReducer:Cs,useRef:mc,useState:function(){return Cs(br)},useDebugValue:uo,useDeferredValue:function(e){var t=nt();return ve===null?t.memoizedState=e:kc(t,ve.memoizedState,e)},useTransition:function(){var e=Cs(br)[0],t=nt().memoizedState;return[e,t]},useMutableSource:oc,useSyncExternalStore:ac,useId:Sc,unstable_isNewReconciler:!1};function it(e,t){if(e&&e.defaultProps){t=de({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function ci(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:de({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Jl={isMounted:function(e){return(e=e._reactInternals)?cn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=De(),l=$t(e),s=St(r,l);s.payload=t,n!=null&&(s.callback=n),t=Ft(e,s,l),t!==null&&(ct(t,e,l,r),cl(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=De(),l=$t(e),s=St(r,l);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Ft(e,s,l),t!==null&&(ct(t,e,l,r),cl(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=De(),r=$t(e),l=St(n,r);l.tag=2,t!=null&&(l.callback=t),t=Ft(e,l,r),t!==null&&(ct(t,e,r,n),cl(t,e,r))}};function fa(e,t,n,r,l,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!Sr(n,r)||!Sr(l,s):!0}function Ec(e,t,n){var r=!1,l=Bt,s=t.contextType;return typeof s=="object"&&s!==null?s=tt(s):(l=He(t)?rn:Me.current,r=t.contextTypes,s=(r=r!=null)?Ln(e,l):Bt),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Jl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=l,e.__reactInternalMemoizedMaskedChildContext=s),t}function pa(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Jl.enqueueReplaceState(t,t.state,null)}function di(e,t,n,r){var l=e.stateNode;l.props=n,l.state=e.memoizedState,l.refs={},to(e);var s=t.contextType;typeof s=="object"&&s!==null?l.context=tt(s):(s=He(t)?rn:Me.current,l.context=Ln(e,s)),l.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(ci(e,t,s,n),l.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof l.getSnapshotBeforeUpdate=="function"||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(t=l.state,typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount(),t!==l.state&&Jl.enqueueReplaceState(l,l.state,null),Ml(e,n,l,r),l.state=e.memoizedState),typeof l.componentDidMount=="function"&&(e.flags|=4194308)}function An(e,t){try{var n="",r=t;do n+=Ld(r),r=r.return;while(r);var l=n}catch(s){l=`
39
+ Error generating stack: `+s.message+`
40
+ `+s.stack}return{value:e,source:t,stack:l,digest:null}}function Es(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function fi(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var ap=typeof WeakMap=="function"?WeakMap:Map;function Pc(e,t,n){n=St(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ol||(Ol=!0,Si=r),fi(e,t)},n}function _c(e,t,n){n=St(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){fi(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){fi(e,t),typeof r!="function"&&(Ut===null?Ut=new Set([this]):Ut.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function ma(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ap;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=Sp.bind(null,e,t,n),t.then(e,e))}function ha(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function ga(e,t,n,r,l){return e.mode&1?(e.flags|=65536,e.lanes=l,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=St(-1,1),t.tag=2,Ft(n,t,1))),n.lanes|=1),e)}var up=Pt.ReactCurrentOwner,$e=!1;function Le(e,t,n,r){t.child=e===null?rc(t,null,n,r):Rn(t,e.child,n,r)}function ya(e,t,n,r,l){n=n.render;var s=t.ref;return In(t,l),r=io(e,t,n,r,s,l),n=oo(),e!==null&&!$e?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Et(e,t,l)):(oe&&n&&Gi(t),t.flags|=1,Le(e,t,r,l),t.child)}function xa(e,t,n,r,l){if(e===null){var s=n.type;return typeof s=="function"&&!xo(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,bc(e,t,s,r,l)):(e=gl(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&l)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:Sr,n(o,r)&&e.ref===t.ref)return Et(e,t,l)}return t.flags|=1,e=Wt(s,r),e.ref=t.ref,e.return=t,t.child=e}function bc(e,t,n,r,l){if(e!==null){var s=e.memoizedProps;if(Sr(s,r)&&e.ref===t.ref)if($e=!1,t.pendingProps=r=s,(e.lanes&l)!==0)e.flags&131072&&($e=!0);else return t.lanes=e.lanes,Et(e,t,l)}return pi(e,t,n,r,l)}function Tc(e,t,n){var r=t.pendingProps,l=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},te(En,Be),Be|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,te(En,Be),Be|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,te(En,Be),Be|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,te(En,Be),Be|=r;return Le(e,t,l,n),t.child}function Ic(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function pi(e,t,n,r,l){var s=He(n)?rn:Me.current;return s=Ln(t,s),In(t,l),n=io(e,t,n,r,s,l),r=oo(),e!==null&&!$e?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Et(e,t,l)):(oe&&r&&Gi(t),t.flags|=1,Le(e,t,n,l),t.child)}function va(e,t,n,r,l){if(He(n)){var s=!0;Pl(t)}else s=!1;if(In(t,l),t.stateNode===null)pl(e,t),Ec(t,n,r),di(t,n,r,l),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var u=o.context,d=n.contextType;typeof d=="object"&&d!==null?d=tt(d):(d=He(n)?rn:Me.current,d=Ln(t,d));var h=n.getDerivedStateFromProps,m=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function";m||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||u!==d)&&pa(t,o,r,d),Tt=!1;var g=t.memoizedState;o.state=g,Ml(t,r,o,l),u=t.memoizedState,a!==r||g!==u||We.current||Tt?(typeof h=="function"&&(ci(t,n,h,r),u=t.memoizedState),(a=Tt||fa(t,n,a,r,g,u,d))?(m||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),o.props=r,o.state=u,o.context=d,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,sc(e,t),a=t.memoizedProps,d=t.type===t.elementType?a:it(t.type,a),o.props=d,m=t.pendingProps,g=o.context,u=n.contextType,typeof u=="object"&&u!==null?u=tt(u):(u=He(n)?rn:Me.current,u=Ln(t,u));var w=n.getDerivedStateFromProps;(h=typeof w=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==m||g!==u)&&pa(t,o,r,u),Tt=!1,g=t.memoizedState,o.state=g,Ml(t,r,o,l);var k=t.memoizedState;a!==m||g!==k||We.current||Tt?(typeof w=="function"&&(ci(t,n,w,r),k=t.memoizedState),(d=Tt||fa(t,n,d,r,g,k,u)||!1)?(h||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,k,u),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,k,u)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=k),o.props=r,o.state=k,o.context=u,r=d):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),r=!1)}return mi(e,t,n,r,s,l)}function mi(e,t,n,r,l,s){Ic(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return l&&la(t,n,!1),Et(e,t,s);r=t.stateNode,up.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Rn(t,e.child,null,s),t.child=Rn(t,null,a,s)):Le(e,t,a,s),t.memoizedState=r.state,l&&la(t,n,!0),t.child}function Mc(e){var t=e.stateNode;t.pendingContext?ra(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ra(e,t.context,!1),no(e,t.containerInfo)}function wa(e,t,n,r,l){return Dn(),Ji(l),t.flags|=256,Le(e,t,n,r),t.child}var hi={dehydrated:null,treeContext:null,retryLane:0};function gi(e){return{baseLanes:e,cachePool:null,transitions:null}}function zc(e,t,n){var r=t.pendingProps,l=ue.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(l&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),te(ue,l&1),e===null)return ai(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=Zl(o,r,0,null),e=nn(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=gi(n),t.memoizedState=hi,e):co(t,o));if(l=e.memoizedState,l!==null&&(a=l.dehydrated,a!==null))return cp(e,t,o,r,a,l,n);if(s){s=r.fallback,o=t.mode,l=e.child,a=l.sibling;var u={mode:"hidden",children:r.children};return!(o&1)&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=Wt(l,u),r.subtreeFlags=l.subtreeFlags&14680064),a!==null?s=Wt(a,s):(s=nn(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?gi(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=hi,r}return s=e.child,e=s.sibling,r=Wt(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function co(e,t){return t=Zl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function qr(e,t,n,r){return r!==null&&Ji(r),Rn(t,e.child,null,n),e=co(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function cp(e,t,n,r,l,s,o){if(n)return t.flags&256?(t.flags&=-257,r=Es(Error(S(422))),qr(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,l=t.mode,r=Zl({mode:"visible",children:r.children},l,0,null),s=nn(s,l,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&Rn(t,e.child,null,o),t.child.memoizedState=gi(o),t.memoizedState=hi,s);if(!(t.mode&1))return qr(e,t,o,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(S(419)),r=Es(s,r,void 0),qr(e,t,o,r)}if(a=(o&e.childLanes)!==0,$e||a){if(r=je,r!==null){switch(o&-o){case 4:l=2;break;case 16:l=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=l&(r.suspendedLanes|o)?0:l,l!==0&&l!==s.retryLane&&(s.retryLane=l,Ct(e,l),ct(r,e,l,-1))}return yo(),r=Es(Error(S(421))),qr(e,t,o,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=Np.bind(null,e),l._reactRetry=t,null):(e=s.treeContext,Qe=At(l.nextSibling),Ke=t,oe=!0,at=null,e!==null&&(qe[Xe++]=wt,qe[Xe++]=kt,qe[Xe++]=ln,wt=e.id,kt=e.overflow,ln=t),t=co(t,r.children),t.flags|=4096,t)}function ka(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ui(e.return,t,n)}function Ps(e,t,n,r,l){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=l)}function Lc(e,t,n){var r=t.pendingProps,l=r.revealOrder,s=r.tail;if(Le(e,t,r.children,n),r=ue.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ka(e,n,t);else if(e.tag===19)ka(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(te(ue,r),!(t.mode&1))t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&zl(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),Ps(t,!1,l,n,s);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&zl(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}Ps(t,!0,n,null,s);break;case"together":Ps(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function pl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Et(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),on|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(S(153));if(t.child!==null){for(e=t.child,n=Wt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Wt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function dp(e,t,n){switch(t.tag){case 3:Mc(t),Dn();break;case 5:ic(t);break;case 1:He(t.type)&&Pl(t);break;case 4:no(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;te(Tl,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(te(ue,ue.current&1),t.flags|=128,null):n&t.child.childLanes?zc(e,t,n):(te(ue,ue.current&1),e=Et(e,t,n),e!==null?e.sibling:null);te(ue,ue.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Lc(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),te(ue,ue.current),r)break;return null;case 22:case 23:return t.lanes=0,Tc(e,t,n)}return Et(e,t,n)}var Dc,yi,Rc,Oc;Dc=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};yi=function(){};Rc=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,en(yt.current);var s=null;switch(n){case"input":l=Fs(e,l),r=Fs(e,r),s=[];break;case"select":l=de({},l,{value:void 0}),r=de({},r,{value:void 0}),s=[];break;case"textarea":l=Ws(e,l),r=Ws(e,r),s=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Cl)}Vs(n,r);var o;n=null;for(d in l)if(!r.hasOwnProperty(d)&&l.hasOwnProperty(d)&&l[d]!=null)if(d==="style"){var a=l[d];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(hr.hasOwnProperty(d)?s||(s=[]):(s=s||[]).push(d,null));for(d in r){var u=r[d];if(a=l!=null?l[d]:void 0,r.hasOwnProperty(d)&&u!==a&&(u!=null||a!=null))if(d==="style")if(a){for(o in a)!a.hasOwnProperty(o)||u&&u.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in u)u.hasOwnProperty(o)&&a[o]!==u[o]&&(n||(n={}),n[o]=u[o])}else n||(s||(s=[]),s.push(d,n)),n=u;else d==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,a=a?a.__html:void 0,u!=null&&a!==u&&(s=s||[]).push(d,u)):d==="children"?typeof u!="string"&&typeof u!="number"||(s=s||[]).push(d,""+u):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(hr.hasOwnProperty(d)?(u!=null&&d==="onScroll"&&re("scroll",e),s||a===u||(s=[])):(s=s||[]).push(d,u))}n&&(s=s||[]).push("style",n);var d=s;(t.updateQueue=d)&&(t.flags|=4)}};Oc=function(e,t,n,r){n!==r&&(t.flags|=4)};function Xn(e,t){if(!oe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Te(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function fp(e,t,n){var r=t.pendingProps;switch(Yi(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Te(t),null;case 1:return He(t.type)&&El(),Te(t),null;case 3:return r=t.stateNode,On(),le(We),le(Me),lo(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Yr(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,at!==null&&(Ci(at),at=null))),yi(e,t),Te(t),null;case 5:ro(t);var l=en(Pr.current);if(n=t.type,e!==null&&t.stateNode!=null)Rc(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(S(166));return Te(t),null}if(e=en(yt.current),Yr(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[ht]=t,r[Cr]=s,e=(t.mode&1)!==0,n){case"dialog":re("cancel",r),re("close",r);break;case"iframe":case"object":case"embed":re("load",r);break;case"video":case"audio":for(l=0;l<sr.length;l++)re(sr[l],r);break;case"source":re("error",r);break;case"img":case"image":case"link":re("error",r),re("load",r);break;case"details":re("toggle",r);break;case"input":To(r,s),re("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},re("invalid",r);break;case"textarea":Mo(r,s),re("invalid",r)}Vs(n,s),l=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&Gr(r.textContent,a,e),l=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Gr(r.textContent,a,e),l=["children",""+a]):hr.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&re("scroll",r)}switch(n){case"input":Ur(r),Io(r,s,!0);break;case"textarea":Ur(r),zo(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Cl)}r=l,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=l.nodeType===9?l:l.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=du(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[ht]=t,e[Cr]=r,Dc(e,t,!1,!1),t.stateNode=e;e:{switch(o=Bs(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;l<sr.length;l++)re(sr[l],e);l=r;break;case"source":re("error",e),l=r;break;case"img":case"image":case"link":re("error",e),re("load",e),l=r;break;case"details":re("toggle",e),l=r;break;case"input":To(e,r),l=Fs(e,r),re("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=de({},r,{value:void 0}),re("invalid",e);break;case"textarea":Mo(e,r),l=Ws(e,r),re("invalid",e);break;default:l=r}Vs(n,l),a=l;for(s in a)if(a.hasOwnProperty(s)){var u=a[s];s==="style"?mu(e,u):s==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&fu(e,u)):s==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&gr(e,u):typeof u=="number"&&gr(e,""+u):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(hr.hasOwnProperty(s)?u!=null&&s==="onScroll"&&re("scroll",e):u!=null&&Li(e,s,u,o))}switch(n){case"input":Ur(e),Io(e,r,!1);break;case"textarea":Ur(e),zo(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Vt(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Pn(e,!!r.multiple,s,!1):r.defaultValue!=null&&Pn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=Cl)}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 Te(t),null;case 6:if(e&&t.stateNode!=null)Oc(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(S(166));if(n=en(Pr.current),en(yt.current),Yr(t)){if(r=t.stateNode,n=t.memoizedProps,r[ht]=t,(s=r.nodeValue!==n)&&(e=Ke,e!==null))switch(e.tag){case 3:Gr(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Gr(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ht]=t,t.stateNode=r}return Te(t),null;case 13:if(le(ue),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(oe&&Qe!==null&&t.mode&1&&!(t.flags&128))tc(),Dn(),t.flags|=98560,s=!1;else if(s=Yr(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(S(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(S(317));s[ht]=t}else Dn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Te(t),s=!1}else at!==null&&(Ci(at),at=null),s=!0;if(!s)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||ue.current&1?we===0&&(we=3):yo())),t.updateQueue!==null&&(t.flags|=4),Te(t),null);case 4:return On(),yi(e,t),e===null&&Nr(t.stateNode.containerInfo),Te(t),null;case 10:return Zi(t.type._context),Te(t),null;case 17:return He(t.type)&&El(),Te(t),null;case 19:if(le(ue),s=t.memoizedState,s===null)return Te(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)Xn(s,!1);else{if(we!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=zl(e),o!==null){for(t.flags|=128,Xn(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return te(ue,ue.current&1|2),t.child}e=e.sibling}s.tail!==null&&me()>Fn&&(t.flags|=128,r=!0,Xn(s,!1),t.lanes=4194304)}else{if(!r)if(e=zl(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Xn(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!oe)return Te(t),null}else 2*me()-s.renderingStartTime>Fn&&n!==1073741824&&(t.flags|=128,r=!0,Xn(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=me(),t.sibling=null,n=ue.current,te(ue,r?n&1|2:n&1),t):(Te(t),null);case 22:case 23:return go(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Be&1073741824&&(Te(t),t.subtreeFlags&6&&(t.flags|=8192)):Te(t),null;case 24:return null;case 25:return null}throw Error(S(156,t.tag))}function pp(e,t){switch(Yi(t),t.tag){case 1:return He(t.type)&&El(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return On(),le(We),le(Me),lo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ro(t),null;case 13:if(le(ue),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(S(340));Dn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(ue),null;case 4:return On(),null;case 10:return Zi(t.type._context),null;case 22:case 23:return go(),null;case 24:return null;default:return null}}var Xr=!1,Ie=!1,mp=typeof WeakSet=="function"?WeakSet:Set,z=null;function Cn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){fe(e,t,r)}else n.current=null}function xi(e,t,n){try{n()}catch(r){fe(e,t,r)}}var Sa=!1;function hp(e,t){if(ti=Sl,e=Wu(),Ki(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,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,u=-1,d=0,h=0,m=e,g=null;t:for(;;){for(var w;m!==n||l!==0&&m.nodeType!==3||(a=o+l),m!==s||r!==0&&m.nodeType!==3||(u=o+r),m.nodeType===3&&(o+=m.nodeValue.length),(w=m.firstChild)!==null;)g=m,m=w;for(;;){if(m===e)break t;if(g===n&&++d===l&&(a=o),g===s&&++h===r&&(u=o),(w=m.nextSibling)!==null)break;m=g,g=m.parentNode}m=w}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(ni={focusedElem:e,selectionRange:n},Sl=!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 j=k.memoizedProps,R=k.memoizedState,p=t.stateNode,c=p.getSnapshotBeforeUpdate(t.elementType===t.type?j:it(t.type,j),R);p.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var f=t.stateNode.containerInfo;f.nodeType===1?f.textContent="":f.nodeType===9&&f.documentElement&&f.removeChild(f.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(S(163))}}catch(y){fe(t,t.return,y)}if(e=t.sibling,e!==null){e.return=t.return,z=e;break}z=t.return}return k=Sa,Sa=!1,k}function fr(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 s=l.destroy;l.destroy=void 0,s!==void 0&&xi(t,n,s)}l=l.next}while(l!==r)}}function ql(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 vi(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 Ac(e){var t=e.alternate;t!==null&&(e.alternate=null,Ac(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ht],delete t[Cr],delete t[si],delete t[qf],delete t[Xf])),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 Fc(e){return e.tag===5||e.tag===3||e.tag===4}function Na(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Fc(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 wi(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=Cl));else if(r!==4&&(e=e.child,e!==null))for(wi(e,t,n),e=e.sibling;e!==null;)wi(e,t,n),e=e.sibling}function ki(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(ki(e,t,n),e=e.sibling;e!==null;)ki(e,t,n),e=e.sibling}var Ce=null,ot=!1;function _t(e,t,n){for(n=n.child;n!==null;)Uc(e,t,n),n=n.sibling}function Uc(e,t,n){if(gt&&typeof gt.onCommitFiberUnmount=="function")try{gt.onCommitFiberUnmount(Hl,n)}catch{}switch(n.tag){case 5:Ie||Cn(n,t);case 6:var r=Ce,l=ot;Ce=null,_t(e,t,n),Ce=r,ot=l,Ce!==null&&(ot?(e=Ce,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ce.removeChild(n.stateNode));break;case 18:Ce!==null&&(ot?(e=Ce,n=n.stateNode,e.nodeType===8?ws(e.parentNode,n):e.nodeType===1&&ws(e,n),wr(e)):ws(Ce,n.stateNode));break;case 4:r=Ce,l=ot,Ce=n.stateNode.containerInfo,ot=!0,_t(e,t,n),Ce=r,ot=l;break;case 0:case 11:case 14:case 15:if(!Ie&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var s=l,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&xi(n,t,o),l=l.next}while(l!==r)}_t(e,t,n);break;case 1:if(!Ie&&(Cn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){fe(n,t,a)}_t(e,t,n);break;case 21:_t(e,t,n);break;case 22:n.mode&1?(Ie=(r=Ie)||n.memoizedState!==null,_t(e,t,n),Ie=r):_t(e,t,n);break;default:_t(e,t,n)}}function ja(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new mp),t.forEach(function(r){var l=jp.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function st(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var l=n[r];try{var s=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:Ce=a.stateNode,ot=!1;break e;case 3:Ce=a.stateNode.containerInfo,ot=!0;break e;case 4:Ce=a.stateNode.containerInfo,ot=!0;break e}a=a.return}if(Ce===null)throw Error(S(160));Uc(s,o,l),Ce=null,ot=!1;var u=l.alternate;u!==null&&(u.return=null),l.return=null}catch(d){fe(l,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)$c(t,e),t=t.sibling}function $c(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(st(t,e),pt(e),r&4){try{fr(3,e,e.return),ql(3,e)}catch(j){fe(e,e.return,j)}try{fr(5,e,e.return)}catch(j){fe(e,e.return,j)}}break;case 1:st(t,e),pt(e),r&512&&n!==null&&Cn(n,n.return);break;case 5:if(st(t,e),pt(e),r&512&&n!==null&&Cn(n,n.return),e.flags&32){var l=e.stateNode;try{gr(l,"")}catch(j){fe(e,e.return,j)}}if(r&4&&(l=e.stateNode,l!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,a=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&uu(l,s),Bs(a,o);var d=Bs(a,s);for(o=0;o<u.length;o+=2){var h=u[o],m=u[o+1];h==="style"?mu(l,m):h==="dangerouslySetInnerHTML"?fu(l,m):h==="children"?gr(l,m):Li(l,h,m,d)}switch(a){case"input":Us(l,s);break;case"textarea":cu(l,s);break;case"select":var g=l._wrapperState.wasMultiple;l._wrapperState.wasMultiple=!!s.multiple;var w=s.value;w!=null?Pn(l,!!s.multiple,w,!1):g!==!!s.multiple&&(s.defaultValue!=null?Pn(l,!!s.multiple,s.defaultValue,!0):Pn(l,!!s.multiple,s.multiple?[]:"",!1))}l[Cr]=s}catch(j){fe(e,e.return,j)}}break;case 6:if(st(t,e),pt(e),r&4){if(e.stateNode===null)throw Error(S(162));l=e.stateNode,s=e.memoizedProps;try{l.nodeValue=s}catch(j){fe(e,e.return,j)}}break;case 3:if(st(t,e),pt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{wr(t.containerInfo)}catch(j){fe(e,e.return,j)}break;case 4:st(t,e),pt(e);break;case 13:st(t,e),pt(e),l=e.child,l.flags&8192&&(s=l.memoizedState!==null,l.stateNode.isHidden=s,!s||l.alternate!==null&&l.alternate.memoizedState!==null||(mo=me())),r&4&&ja(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?(Ie=(d=Ie)||h,st(t,e),Ie=d):st(t,e),pt(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!h&&e.mode&1)for(z=e,h=e.child;h!==null;){for(m=z=h;z!==null;){switch(g=z,w=g.child,g.tag){case 0:case 11:case 14:case 15:fr(4,g,g.return);break;case 1:Cn(g,g.return);var k=g.stateNode;if(typeof k.componentWillUnmount=="function"){r=g,n=g.return;try{t=r,k.props=t.memoizedProps,k.state=t.memoizedState,k.componentWillUnmount()}catch(j){fe(r,n,j)}}break;case 5:Cn(g,g.return);break;case 22:if(g.memoizedState!==null){Ea(m);continue}}w!==null?(w.return=g,z=w):Ea(m)}h=h.sibling}e:for(h=null,m=e;;){if(m.tag===5){if(h===null){h=m;try{l=m.stateNode,d?(s=l.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=m.stateNode,u=m.memoizedProps.style,o=u!=null&&u.hasOwnProperty("display")?u.display:null,a.style.display=pu("display",o))}catch(j){fe(e,e.return,j)}}}else if(m.tag===6){if(h===null)try{m.stateNode.nodeValue=d?"":m.memoizedProps}catch(j){fe(e,e.return,j)}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===e)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===e)break e;for(;m.sibling===null;){if(m.return===null||m.return===e)break e;h===m&&(h=null),m=m.return}h===m&&(h=null),m.sibling.return=m.return,m=m.sibling}}break;case 19:st(t,e),pt(e),r&4&&ja(e);break;case 21:break;default:st(t,e),pt(e)}}function pt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Fc(n)){var r=n;break e}n=n.return}throw Error(S(160))}switch(r.tag){case 5:var l=r.stateNode;r.flags&32&&(gr(l,""),r.flags&=-33);var s=Na(e);ki(e,s,l);break;case 3:case 4:var o=r.stateNode.containerInfo,a=Na(e);wi(e,a,o);break;default:throw Error(S(161))}}catch(u){fe(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function gp(e,t,n){z=e,Wc(e)}function Wc(e,t,n){for(var r=(e.mode&1)!==0;z!==null;){var l=z,s=l.child;if(l.tag===22&&r){var o=l.memoizedState!==null||Xr;if(!o){var a=l.alternate,u=a!==null&&a.memoizedState!==null||Ie;a=Xr;var d=Ie;if(Xr=o,(Ie=u)&&!d)for(z=l;z!==null;)o=z,u=o.child,o.tag===22&&o.memoizedState!==null?Pa(l):u!==null?(u.return=o,z=u):Pa(l);for(;s!==null;)z=s,Wc(s),s=s.sibling;z=l,Xr=a,Ie=d}Ca(e)}else l.subtreeFlags&8772&&s!==null?(s.return=l,z=s):Ca(e)}}function Ca(e){for(;z!==null;){var t=z;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ie||ql(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ie)if(n===null)r.componentDidMount();else{var l=t.elementType===t.type?n.memoizedProps:it(t.type,n.memoizedProps);r.componentDidUpdate(l,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&ua(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}ua(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var h=d.memoizedState;if(h!==null){var m=h.dehydrated;m!==null&&wr(m)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(S(163))}Ie||t.flags&512&&vi(t)}catch(g){fe(t,t.return,g)}}if(t===e){z=null;break}if(n=t.sibling,n!==null){n.return=t.return,z=n;break}z=t.return}}function Ea(e){for(;z!==null;){var t=z;if(t===e){z=null;break}var n=t.sibling;if(n!==null){n.return=t.return,z=n;break}z=t.return}}function Pa(e){for(;z!==null;){var t=z;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ql(4,t)}catch(u){fe(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var l=t.return;try{r.componentDidMount()}catch(u){fe(t,l,u)}}var s=t.return;try{vi(t)}catch(u){fe(t,s,u)}break;case 5:var o=t.return;try{vi(t)}catch(u){fe(t,o,u)}}}catch(u){fe(t,t.return,u)}if(t===e){z=null;break}var a=t.sibling;if(a!==null){a.return=t.return,z=a;break}z=t.return}}var yp=Math.ceil,Rl=Pt.ReactCurrentDispatcher,fo=Pt.ReactCurrentOwner,et=Pt.ReactCurrentBatchConfig,G=0,je=null,ye=null,Ee=0,Be=0,En=Kt(0),we=0,Ir=null,on=0,Xl=0,po=0,pr=null,Ue=null,mo=0,Fn=1/0,xt=null,Ol=!1,Si=null,Ut=null,Zr=!1,Lt=null,Al=0,mr=0,Ni=null,ml=-1,hl=0;function De(){return G&6?me():ml!==-1?ml:ml=me()}function $t(e){return e.mode&1?G&2&&Ee!==0?Ee&-Ee:ep.transition!==null?(hl===0&&(hl=Eu()),hl):(e=q,e!==0||(e=window.event,e=e===void 0?16:zu(e.type)),e):1}function ct(e,t,n,r){if(50<mr)throw mr=0,Ni=null,Error(S(185));Lr(e,n,r),(!(G&2)||e!==je)&&(e===je&&(!(G&2)&&(Xl|=n),we===4&&Mt(e,Ee)),Ve(e,r),n===1&&G===0&&!(t.mode&1)&&(Fn=me()+500,Gl&&Gt()))}function Ve(e,t){var n=e.callbackNode;Zd(e,t);var r=kl(e,e===je?Ee:0);if(r===0)n!==null&&Ro(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Ro(n),t===1)e.tag===0?Zf(_a.bind(null,e)):Xu(_a.bind(null,e)),Yf(function(){!(G&6)&&Gt()}),n=null;else{switch(Pu(r)){case 1:n=Fi;break;case 4:n=ju;break;case 16:n=wl;break;case 536870912:n=Cu;break;default:n=wl}n=Jc(n,Hc.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Hc(e,t){if(ml=-1,hl=0,G&6)throw Error(S(327));var n=e.callbackNode;if(Mn()&&e.callbackNode!==n)return null;var r=kl(e,e===je?Ee:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Fl(e,r);else{t=r;var l=G;G|=2;var s=Bc();(je!==e||Ee!==t)&&(xt=null,Fn=me()+500,tn(e,t));do try{wp();break}catch(a){Vc(e,a)}while(!0);Xi(),Rl.current=s,G=l,ye!==null?t=0:(je=null,Ee=0,t=we)}if(t!==0){if(t===2&&(l=Js(e),l!==0&&(r=l,t=ji(e,l))),t===1)throw n=Ir,tn(e,0),Mt(e,r),Ve(e,me()),n;if(t===6)Mt(e,r);else{if(l=e.current.alternate,!(r&30)&&!xp(l)&&(t=Fl(e,r),t===2&&(s=Js(e),s!==0&&(r=s,t=ji(e,s))),t===1))throw n=Ir,tn(e,0),Mt(e,r),Ve(e,me()),n;switch(e.finishedWork=l,e.finishedLanes=r,t){case 0:case 1:throw Error(S(345));case 2:qt(e,Ue,xt);break;case 3:if(Mt(e,r),(r&130023424)===r&&(t=mo+500-me(),10<t)){if(kl(e,0)!==0)break;if(l=e.suspendedLanes,(l&r)!==r){De(),e.pingedLanes|=e.suspendedLanes&l;break}e.timeoutHandle=li(qt.bind(null,e,Ue,xt),t);break}qt(e,Ue,xt);break;case 4:if(Mt(e,r),(r&4194240)===r)break;for(t=e.eventTimes,l=-1;0<r;){var o=31-ut(r);s=1<<o,o=t[o],o>l&&(l=o),r&=~s}if(r=l,r=me()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*yp(r/1960))-r,10<r){e.timeoutHandle=li(qt.bind(null,e,Ue,xt),r);break}qt(e,Ue,xt);break;case 5:qt(e,Ue,xt);break;default:throw Error(S(329))}}}return Ve(e,me()),e.callbackNode===n?Hc.bind(null,e):null}function ji(e,t){var n=pr;return e.current.memoizedState.isDehydrated&&(tn(e,t).flags|=256),e=Fl(e,t),e!==2&&(t=Ue,Ue=n,t!==null&&Ci(t)),e}function Ci(e){Ue===null?Ue=e:Ue.push.apply(Ue,e)}function xp(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var l=n[r],s=l.getSnapshot;l=l.value;try{if(!dt(s(),l))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Mt(e,t){for(t&=~po,t&=~Xl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ut(t),r=1<<n;e[n]=-1,t&=~r}}function _a(e){if(G&6)throw Error(S(327));Mn();var t=kl(e,0);if(!(t&1))return Ve(e,me()),null;var n=Fl(e,t);if(e.tag!==0&&n===2){var r=Js(e);r!==0&&(t=r,n=ji(e,r))}if(n===1)throw n=Ir,tn(e,0),Mt(e,t),Ve(e,me()),n;if(n===6)throw Error(S(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,qt(e,Ue,xt),Ve(e,me()),null}function ho(e,t){var n=G;G|=1;try{return e(t)}finally{G=n,G===0&&(Fn=me()+500,Gl&&Gt())}}function an(e){Lt!==null&&Lt.tag===0&&!(G&6)&&Mn();var t=G;G|=1;var n=et.transition,r=q;try{if(et.transition=null,q=1,e)return e()}finally{q=r,et.transition=n,G=t,!(G&6)&&Gt()}}function go(){Be=En.current,le(En)}function tn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Gf(n)),ye!==null)for(n=ye.return;n!==null;){var r=n;switch(Yi(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&El();break;case 3:On(),le(We),le(Me),lo();break;case 5:ro(r);break;case 4:On();break;case 13:le(ue);break;case 19:le(ue);break;case 10:Zi(r.type._context);break;case 22:case 23:go()}n=n.return}if(je=e,ye=e=Wt(e.current,null),Ee=Be=t,we=0,Ir=null,po=Xl=on=0,Ue=pr=null,Zt!==null){for(t=0;t<Zt.length;t++)if(n=Zt[t],r=n.interleaved,r!==null){n.interleaved=null;var l=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=l,r.next=o}n.pending=r}Zt=null}return e}function Vc(e,t){do{var n=ye;try{if(Xi(),dl.current=Dl,Ll){for(var r=ce.memoizedState;r!==null;){var l=r.queue;l!==null&&(l.pending=null),r=r.next}Ll=!1}if(sn=0,Ne=ve=ce=null,dr=!1,_r=0,fo.current=null,n===null||n.return===null){we=1,Ir=t,ye=null;break}e:{var s=e,o=n.return,a=n,u=t;if(t=Ee,a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var d=u,h=a,m=h.tag;if(!(h.mode&1)&&(m===0||m===11||m===15)){var g=h.alternate;g?(h.updateQueue=g.updateQueue,h.memoizedState=g.memoizedState,h.lanes=g.lanes):(h.updateQueue=null,h.memoizedState=null)}var w=ha(o);if(w!==null){w.flags&=-257,ga(w,o,a,s,t),w.mode&1&&ma(s,d,t),t=w,u=d;var k=t.updateQueue;if(k===null){var j=new Set;j.add(u),t.updateQueue=j}else k.add(u);break e}else{if(!(t&1)){ma(s,d,t),yo();break e}u=Error(S(426))}}else if(oe&&a.mode&1){var R=ha(o);if(R!==null){!(R.flags&65536)&&(R.flags|=256),ga(R,o,a,s,t),Ji(An(u,a));break e}}s=u=An(u,a),we!==4&&(we=2),pr===null?pr=[s]:pr.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var p=Pc(s,u,t);aa(s,p);break e;case 1:a=u;var c=s.type,f=s.stateNode;if(!(s.flags&128)&&(typeof c.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Ut===null||!Ut.has(f)))){s.flags|=65536,t&=-t,s.lanes|=t;var y=_c(s,a,t);aa(s,y);break e}}s=s.return}while(s!==null)}Kc(n)}catch(E){t=E,ye===n&&n!==null&&(ye=n=n.return);continue}break}while(!0)}function Bc(){var e=Rl.current;return Rl.current=Dl,e===null?Dl:e}function yo(){(we===0||we===3||we===2)&&(we=4),je===null||!(on&268435455)&&!(Xl&268435455)||Mt(je,Ee)}function Fl(e,t){var n=G;G|=2;var r=Bc();(je!==e||Ee!==t)&&(xt=null,tn(e,t));do try{vp();break}catch(l){Vc(e,l)}while(!0);if(Xi(),G=n,Rl.current=r,ye!==null)throw Error(S(261));return je=null,Ee=0,we}function vp(){for(;ye!==null;)Qc(ye)}function wp(){for(;ye!==null&&!Vd();)Qc(ye)}function Qc(e){var t=Yc(e.alternate,e,Be);e.memoizedProps=e.pendingProps,t===null?Kc(e):ye=t,fo.current=null}function Kc(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=pp(n,t),n!==null){n.flags&=32767,ye=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{we=6,ye=null;return}}else if(n=fp(n,t,Be),n!==null){ye=n;return}if(t=t.sibling,t!==null){ye=t;return}ye=t=e}while(t!==null);we===0&&(we=5)}function qt(e,t,n){var r=q,l=et.transition;try{et.transition=null,q=1,kp(e,t,n,r)}finally{et.transition=l,q=r}return null}function kp(e,t,n,r){do Mn();while(Lt!==null);if(G&6)throw Error(S(327));n=e.finishedWork;var l=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(S(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(ef(e,s),e===je&&(ye=je=null,Ee=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Zr||(Zr=!0,Jc(wl,function(){return Mn(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=et.transition,et.transition=null;var o=q;q=1;var a=G;G|=4,fo.current=null,hp(e,n),$c(n,e),$f(ni),Sl=!!ti,ni=ti=null,e.current=n,gp(n),Bd(),G=a,q=o,et.transition=s}else e.current=n;if(Zr&&(Zr=!1,Lt=e,Al=l),s=e.pendingLanes,s===0&&(Ut=null),Gd(n.stateNode),Ve(e,me()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)l=t[n],r(l.value,{componentStack:l.stack,digest:l.digest});if(Ol)throw Ol=!1,e=Si,Si=null,e;return Al&1&&e.tag!==0&&Mn(),s=e.pendingLanes,s&1?e===Ni?mr++:(mr=0,Ni=e):mr=0,Gt(),null}function Mn(){if(Lt!==null){var e=Pu(Al),t=et.transition,n=q;try{if(et.transition=null,q=16>e?16:e,Lt===null)var r=!1;else{if(e=Lt,Lt=null,Al=0,G&6)throw Error(S(331));var l=G;for(G|=4,z=e.current;z!==null;){var s=z,o=s.child;if(z.flags&16){var a=s.deletions;if(a!==null){for(var u=0;u<a.length;u++){var d=a[u];for(z=d;z!==null;){var h=z;switch(h.tag){case 0:case 11:case 15:fr(8,h,s)}var m=h.child;if(m!==null)m.return=h,z=m;else for(;z!==null;){h=z;var g=h.sibling,w=h.return;if(Ac(h),h===d){z=null;break}if(g!==null){g.return=w,z=g;break}z=w}}}var k=s.alternate;if(k!==null){var j=k.child;if(j!==null){k.child=null;do{var R=j.sibling;j.sibling=null,j=R}while(j!==null)}}z=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,z=o;else e:for(;z!==null;){if(s=z,s.flags&2048)switch(s.tag){case 0:case 11:case 15:fr(9,s,s.return)}var p=s.sibling;if(p!==null){p.return=s.return,z=p;break e}z=s.return}}var c=e.current;for(z=c;z!==null;){o=z;var f=o.child;if(o.subtreeFlags&2064&&f!==null)f.return=o,z=f;else e:for(o=c;z!==null;){if(a=z,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:ql(9,a)}}catch(E){fe(a,a.return,E)}if(a===o){z=null;break e}var y=a.sibling;if(y!==null){y.return=a.return,z=y;break e}z=a.return}}if(G=l,Gt(),gt&&typeof gt.onPostCommitFiberRoot=="function")try{gt.onPostCommitFiberRoot(Hl,e)}catch{}r=!0}return r}finally{q=n,et.transition=t}}return!1}function ba(e,t,n){t=An(n,t),t=Pc(e,t,1),e=Ft(e,t,1),t=De(),e!==null&&(Lr(e,1,t),Ve(e,t))}function fe(e,t,n){if(e.tag===3)ba(e,e,n);else for(;t!==null;){if(t.tag===3){ba(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ut===null||!Ut.has(r))){e=An(n,e),e=_c(t,e,1),t=Ft(t,e,1),e=De(),t!==null&&(Lr(t,1,e),Ve(t,e));break}}t=t.return}}function Sp(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=De(),e.pingedLanes|=e.suspendedLanes&n,je===e&&(Ee&n)===n&&(we===4||we===3&&(Ee&130023424)===Ee&&500>me()-mo?tn(e,0):po|=n),Ve(e,t)}function Gc(e,t){t===0&&(e.mode&1?(t=Hr,Hr<<=1,!(Hr&130023424)&&(Hr=4194304)):t=1);var n=De();e=Ct(e,t),e!==null&&(Lr(e,t,n),Ve(e,n))}function Np(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Gc(e,n)}function jp(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(S(314))}r!==null&&r.delete(t),Gc(e,n)}var Yc;Yc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||We.current)$e=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return $e=!1,dp(e,t,n);$e=!!(e.flags&131072)}else $e=!1,oe&&t.flags&1048576&&Zu(t,bl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;pl(e,t),e=t.pendingProps;var l=Ln(t,Me.current);In(t,n),l=io(null,t,r,e,l,n);var s=oo();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,He(r)?(s=!0,Pl(t)):s=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,to(t),l.updater=Jl,t.stateNode=l,l._reactInternals=t,di(t,r,e,n),t=mi(null,t,r,!0,s,n)):(t.tag=0,oe&&s&&Gi(t),Le(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(pl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Ep(r),e=it(r,e),l){case 0:t=pi(null,t,r,e,n);break e;case 1:t=va(null,t,r,e,n);break e;case 11:t=ya(null,t,r,e,n);break e;case 14:t=xa(null,t,r,it(r.type,e),n);break e}throw Error(S(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:it(r,l),pi(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:it(r,l),va(e,t,r,l,n);case 3:e:{if(Mc(t),e===null)throw Error(S(387));r=t.pendingProps,s=t.memoizedState,l=s.element,sc(e,t),Ml(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){l=An(Error(S(423)),t),t=wa(e,t,r,n,l);break e}else if(r!==l){l=An(Error(S(424)),t),t=wa(e,t,r,n,l);break e}else for(Qe=At(t.stateNode.containerInfo.firstChild),Ke=t,oe=!0,at=null,n=rc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Dn(),r===l){t=Et(e,t,n);break e}Le(e,t,r,n)}t=t.child}return t;case 5:return ic(t),e===null&&ai(t),r=t.type,l=t.pendingProps,s=e!==null?e.memoizedProps:null,o=l.children,ri(r,l)?o=null:s!==null&&ri(r,s)&&(t.flags|=32),Ic(e,t),Le(e,t,o,n),t.child;case 6:return e===null&&ai(t),null;case 13:return zc(e,t,n);case 4:return no(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Rn(t,null,r,n):Le(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:it(r,l),ya(e,t,r,l,n);case 7:return Le(e,t,t.pendingProps,n),t.child;case 8:return Le(e,t,t.pendingProps.children,n),t.child;case 12:return Le(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,s=t.memoizedProps,o=l.value,te(Tl,r._currentValue),r._currentValue=o,s!==null)if(dt(s.value,o)){if(s.children===l.children&&!We.current){t=Et(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(s.tag===1){u=St(-1,n&-n),u.tag=2;var d=s.updateQueue;if(d!==null){d=d.shared;var h=d.pending;h===null?u.next=u:(u.next=h.next,h.next=u),d.pending=u}}s.lanes|=n,u=s.alternate,u!==null&&(u.lanes|=n),ui(s.return,n,t),a.lanes|=n;break}u=u.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(S(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),ui(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Le(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,In(t,n),l=tt(l),r=r(l),t.flags|=1,Le(e,t,r,n),t.child;case 14:return r=t.type,l=it(r,t.pendingProps),l=it(r.type,l),xa(e,t,r,l,n);case 15:return bc(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:it(r,l),pl(e,t),t.tag=1,He(r)?(e=!0,Pl(t)):e=!1,In(t,n),Ec(t,r,l),di(t,r,l,n),mi(null,t,r,!0,e,n);case 19:return Lc(e,t,n);case 22:return Tc(e,t,n)}throw Error(S(156,t.tag))};function Jc(e,t){return Nu(e,t)}function Cp(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 Ze(e,t,n,r){return new Cp(e,t,n,r)}function xo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ep(e){if(typeof e=="function")return xo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ri)return 11;if(e===Oi)return 14}return 2}function Wt(e,t){var n=e.alternate;return n===null?(n=Ze(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 gl(e,t,n,r,l,s){var o=2;if(r=e,typeof e=="function")xo(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case gn:return nn(n.children,l,s,t);case Di:o=8,l|=8;break;case Ds:return e=Ze(12,n,t,l|2),e.elementType=Ds,e.lanes=s,e;case Rs:return e=Ze(13,n,t,l),e.elementType=Rs,e.lanes=s,e;case Os:return e=Ze(19,n,t,l),e.elementType=Os,e.lanes=s,e;case iu:return Zl(n,l,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case lu:o=10;break e;case su:o=9;break e;case Ri:o=11;break e;case Oi:o=14;break e;case bt:o=16,r=null;break e}throw Error(S(130,e==null?e:typeof e,""))}return t=Ze(o,n,t,l),t.elementType=e,t.type=r,t.lanes=s,t}function nn(e,t,n,r){return e=Ze(7,e,r,t),e.lanes=n,e}function Zl(e,t,n,r){return e=Ze(22,e,r,t),e.elementType=iu,e.lanes=n,e.stateNode={isHidden:!1},e}function _s(e,t,n){return e=Ze(6,e,null,t),e.lanes=n,e}function bs(e,t,n){return t=Ze(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Pp(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=us(0),this.expirationTimes=us(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=us(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function vo(e,t,n,r,l,s,o,a,u){return e=new Pp(e,t,n,a,u),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Ze(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},to(s),e}function _p(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:hn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function qc(e){if(!e)return Bt;e=e._reactInternals;e:{if(cn(e)!==e||e.tag!==1)throw Error(S(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(He(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(S(171))}if(e.tag===1){var n=e.type;if(He(n))return qu(e,n,t)}return t}function Xc(e,t,n,r,l,s,o,a,u){return e=vo(n,r,!0,e,l,s,o,a,u),e.context=qc(null),n=e.current,r=De(),l=$t(n),s=St(r,l),s.callback=t??null,Ft(n,s,l),e.current.lanes=l,Lr(e,l,r),Ve(e,r),e}function es(e,t,n,r){var l=t.current,s=De(),o=$t(l);return n=qc(n),t.context===null?t.context=n:t.pendingContext=n,t=St(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Ft(l,t,o),e!==null&&(ct(e,l,o,s),cl(e,l,o)),o}function Ul(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Ta(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function wo(e,t){Ta(e,t),(e=e.alternate)&&Ta(e,t)}function bp(){return null}var Zc=typeof reportError=="function"?reportError:function(e){console.error(e)};function ko(e){this._internalRoot=e}ts.prototype.render=ko.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(S(409));es(e,t,null,null)};ts.prototype.unmount=ko.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;an(function(){es(null,e,null,null)}),t[jt]=null}};function ts(e){this._internalRoot=e}ts.prototype.unstable_scheduleHydration=function(e){if(e){var t=Tu();e={blockedOn:null,target:e,priority:t};for(var n=0;n<It.length&&t!==0&&t<It[n].priority;n++);It.splice(n,0,e),n===0&&Mu(e)}};function So(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ns(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ia(){}function Tp(e,t,n,r,l){if(l){if(typeof r=="function"){var s=r;r=function(){var d=Ul(o);s.call(d)}}var o=Xc(t,r,e,0,null,!1,!1,"",Ia);return e._reactRootContainer=o,e[jt]=o.current,Nr(e.nodeType===8?e.parentNode:e),an(),o}for(;l=e.lastChild;)e.removeChild(l);if(typeof r=="function"){var a=r;r=function(){var d=Ul(u);a.call(d)}}var u=vo(e,0,!1,null,null,!1,!1,"",Ia);return e._reactRootContainer=u,e[jt]=u.current,Nr(e.nodeType===8?e.parentNode:e),an(function(){es(t,u,n,r)}),u}function rs(e,t,n,r,l){var s=n._reactRootContainer;if(s){var o=s;if(typeof l=="function"){var a=l;l=function(){var u=Ul(o);a.call(u)}}es(t,o,e,l)}else o=Tp(n,t,e,l,r);return Ul(o)}_u=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=lr(t.pendingLanes);n!==0&&(Ui(t,n|1),Ve(t,me()),!(G&6)&&(Fn=me()+500,Gt()))}break;case 13:an(function(){var r=Ct(e,1);if(r!==null){var l=De();ct(r,e,1,l)}}),wo(e,1)}};$i=function(e){if(e.tag===13){var t=Ct(e,134217728);if(t!==null){var n=De();ct(t,e,134217728,n)}wo(e,134217728)}};bu=function(e){if(e.tag===13){var t=$t(e),n=Ct(e,t);if(n!==null){var r=De();ct(n,e,t,r)}wo(e,t)}};Tu=function(){return q};Iu=function(e,t){var n=q;try{return q=e,t()}finally{q=n}};Ks=function(e,t,n){switch(t){case"input":if(Us(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var l=Kl(r);if(!l)throw Error(S(90));au(r),Us(r,l)}}}break;case"textarea":cu(e,n);break;case"select":t=n.value,t!=null&&Pn(e,!!n.multiple,t,!1)}};yu=ho;xu=an;var Ip={usingClientEntryPoint:!1,Events:[Rr,wn,Kl,hu,gu,ho]},Zn={findFiberByHostInstance:Xt,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Mp={bundleType:Zn.bundleType,version:Zn.version,rendererPackageName:Zn.rendererPackageName,rendererConfig:Zn.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Pt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ku(e),e===null?null:e.stateNode},findFiberByHostInstance:Zn.findFiberByHostInstance||bp,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var el=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!el.isDisabled&&el.supportsFiber)try{Hl=el.inject(Mp),gt=el}catch{}}Ye.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ip;Ye.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!So(t))throw Error(S(200));return _p(e,t,null,n)};Ye.createRoot=function(e,t){if(!So(e))throw Error(S(299));var n=!1,r="",l=Zc;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=vo(e,1,!1,null,null,n,!1,r,l),e[jt]=t.current,Nr(e.nodeType===8?e.parentNode:e),new ko(t)};Ye.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(S(188)):(e=Object.keys(e).join(","),Error(S(268,e)));return e=ku(t),e=e===null?null:e.stateNode,e};Ye.flushSync=function(e){return an(e)};Ye.hydrate=function(e,t,n){if(!ns(t))throw Error(S(200));return rs(null,e,t,!0,n)};Ye.hydrateRoot=function(e,t,n){if(!So(e))throw Error(S(405));var r=n!=null&&n.hydratedSources||null,l=!1,s="",o=Zc;if(n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Xc(t,null,e,1,n??null,l,!1,s,o),e[jt]=t.current,Nr(e),r)for(e=0;e<r.length;e++)n=r[e],l=n._getVersion,l=l(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,l]:t.mutableSourceEagerHydrationData.push(n,l);return new ts(t)};Ye.render=function(e,t,n){if(!ns(t))throw Error(S(200));return rs(null,e,t,!1,n)};Ye.unmountComponentAtNode=function(e){if(!ns(e))throw Error(S(40));return e._reactRootContainer?(an(function(){rs(null,null,e,!1,function(){e._reactRootContainer=null,e[jt]=null})}),!0):!1};Ye.unstable_batchedUpdates=ho;Ye.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ns(n))throw Error(S(200));if(e==null||e._reactInternals===void 0)throw Error(S(38));return rs(e,t,n,!1,r)};Ye.version="18.3.1-next-f1338f8080-20240426";function ed(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ed)}catch(e){console.error(e)}}ed(),eu.exports=Ye;var zp=eu.exports,Ma=zp;zs.createRoot=Ma.createRoot,zs.hydrateRoot=Ma.hydrateRoot;/**
41
+ * @license lucide-react v1.16.0 - ISC
42
+ *
43
+ * This source code is licensed under the ISC license.
44
+ * See the LICENSE file in the root directory of this source tree.
45
+ */const td=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
46
+ * @license lucide-react v1.16.0 - ISC
47
+ *
48
+ * This source code is licensed under the ISC license.
49
+ * See the LICENSE file in the root directory of this source tree.
50
+ */const Lp=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
51
+ * @license lucide-react v1.16.0 - ISC
52
+ *
53
+ * This source code is licensed under the ISC license.
54
+ * See the LICENSE file in the root directory of this source tree.
55
+ */const Dp=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
56
+ * @license lucide-react v1.16.0 - ISC
57
+ *
58
+ * This source code is licensed under the ISC license.
59
+ * See the LICENSE file in the root directory of this source tree.
60
+ */const za=e=>{const t=Dp(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
61
+ * @license lucide-react v1.16.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */var Ts={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
66
+ * @license lucide-react v1.16.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */const Rp=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Op=I.createContext({}),Ap=()=>I.useContext(Op),Fp=I.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:l="",children:s,iconNode:o,...a},u)=>{const{size:d=24,strokeWidth:h=2,absoluteStrokeWidth:m=!1,color:g="currentColor",className:w=""}=Ap()??{},k=r??m?Number(n??h)*24/Number(t??d):n??h;return I.createElement("svg",{ref:u,...Ts,width:t??d??Ts.width,height:t??d??Ts.height,stroke:e??g,strokeWidth:k,className:td("lucide",w,l),...!s&&!Rp(a)&&{"aria-hidden":"true"},...a},[...o.map(([j,R])=>I.createElement(j,R)),...Array.isArray(s)?s:[s]])});/**
71
+ * @license lucide-react v1.16.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */const se=(e,t)=>{const n=I.forwardRef(({className:r,...l},s)=>I.createElement(Fp,{ref:s,iconNode:t,className:td(`lucide-${Lp(za(e))}`,`lucide-${e}`,r),...l}));return n.displayName=za(e),n};/**
76
+ * @license lucide-react v1.16.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const Up=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]],La=se("brain-circuit",Up);/**
81
+ * @license lucide-react v1.16.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */const $p=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Da=se("check",$p);/**
86
+ * @license lucide-react v1.16.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const Wp=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Is=se("copy",Wp);/**
91
+ * @license lucide-react v1.16.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const Hp=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],Vp=se("cpu",Hp);/**
96
+ * @license lucide-react v1.16.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const Bp=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Qp=se("credit-card",Bp);/**
101
+ * @license lucide-react v1.16.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const Kp=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Gp=se("database",Kp);/**
106
+ * @license lucide-react v1.16.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const Yp=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Jp=se("ellipsis",Yp);/**
111
+ * @license lucide-react v1.16.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const qp=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Ra=se("image",qp);/**
116
+ * @license lucide-react v1.16.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const Xp=[["path",{d:"m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16",key:"9kzy35"}],["path",{d:"M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2",key:"1t0f0t"}],["circle",{cx:"13",cy:"7",r:"1",fill:"currentColor",key:"1obus6"}],["rect",{x:"8",y:"2",width:"14",height:"14",rx:"2",key:"1gvhby"}]],Zp=se("images",Xp);/**
121
+ * @license lucide-react v1.16.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const em=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],tm=se("keyboard",em);/**
126
+ * @license lucide-react v1.16.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const nm=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],rm=se("link-2",nm);/**
131
+ * @license lucide-react v1.16.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const lm=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],$l=se("message-circle",lm);/**
136
+ * @license lucide-react v1.16.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const sm=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],im=se("message-square",sm);/**
141
+ * @license lucide-react v1.16.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const om=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],am=se("moon",om);/**
146
+ * @license lucide-react v1.16.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const um=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],nd=se("plus",um);/**
151
+ * @license lucide-react v1.16.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const cm=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],rd=se("puzzle",cm);/**
156
+ * @license lucide-react v1.16.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const dm=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],fm=se("refresh-cw",dm);/**
161
+ * @license lucide-react v1.16.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const pm=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Oa=se("search",pm);/**
166
+ * @license lucide-react v1.16.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const mm=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],hm=se("send",mm);/**
171
+ * @license lucide-react v1.16.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const gm=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],ym=se("server",gm);/**
176
+ * @license lucide-react v1.16.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const xm=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],vm=se("settings",xm);/**
181
+ * @license lucide-react v1.16.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const wm=[["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715",key:"xlf6rm"}],["path",{d:"M16 12a4 4 0 0 0-4-4",key:"6vsxu"}],["path",{d:"m19 5-1.256 1.256",key:"1yg6a6"}],["path",{d:"M20 12h2",key:"1q8mjw"}]],km=se("sun-moon",wm);/**
186
+ * @license lucide-react v1.16.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const Sm=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Nm=se("sun",Sm);/**
191
+ * @license lucide-react v1.16.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const jm=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Mr=se("trash-2",jm);/**
196
+ * @license lucide-react v1.16.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const Cm=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ht=se("x",Cm),No="memi-usage";function ld(){try{const e=localStorage.getItem(No);if(e)return JSON.parse(e)}catch{}return{llmCalls:0,imageGenerations:0,visionReviews:0,daily:{}}}function Em(e){try{localStorage.setItem(No,JSON.stringify(e))}catch{}}function tl(e){const t=ld(),n=new Date().toISOString().slice(0,10);e==="llm"?t.llmCalls=(t.llmCalls||0)+1:e==="image"?t.imageGenerations=(t.imageGenerations||0)+1:e==="vision"&&(t.visionReviews=(t.visionReviews||0)+1),t.daily||(t.daily={}),t.daily[n]||(t.daily[n]={llmCalls:0,imageGenerations:0,visionReviews:0}),e==="llm"?t.daily[n].llmCalls++:e==="image"?t.daily[n].imageGenerations++:e==="vision"&&t.daily[n].visionReviews++,Em(t)}function Aa(){return ld()}function Pm(){try{localStorage.removeItem(No)}catch{}}const _m=["1:1","16:9","9:16","4:3"],bm=["None","Realistic","Anime","3D","Cyberpunk","Oil Painting","Watercolor","Pixel Art","Cinematic","Sketch"];function Tm(){var e;return((e=crypto.randomUUID)==null?void 0:e.call(crypto))||Date.now().toString(36)+Math.random().toString(36).slice(2)}function Im(e,t){try{const n=localStorage.getItem("memi-generation-history"),r=n?JSON.parse(n):[],l=t>0?t:24,s=[e,...r].slice(0,l);localStorage.setItem("memi-generation-history",JSON.stringify(s))}catch(n){console.warn("Gallery history save failed",n)}}function nl(e){return e?e.startsWith("data:")?e:e.startsWith("http")?"/api/proxy-image?url="+encodeURIComponent(e):e:""}function mn(e){for(const t of e)if(t.role==="user"&&t.content)return t.content.length>28?t.content.slice(0,28)+"…":t.content;return"新对话"}function Mm({copy:e,conversations:t,activeConvId:n,config:r,skills:l=[],onConfigChange:s,updateConv:o,createConv:a}){var lt,Hn,Yt,Vn;const[u,d]=I.useState(""),[h,m]=I.useState(!1),[g,w]=I.useState(""),[k,j]=I.useState(r.defaultAspectRatio||"1:1"),[R,p]=I.useState(r.defaultStyle||"None"),[c,f]=I.useState(null),[y,E]=I.useState(""),[C,_]=I.useState(!1),L=I.useRef(null),K=t.find(v=>v.id===n)||null,A=(K==null?void 0:K.messages)||[];I.useEffect(()=>{var v;(v=L.current)==null||v.scrollIntoView({behavior:"smooth"})},[A]),I.useEffect(()=>{function v(M){(M.ctrlKey||M.metaKey)&&M.key==="k"&&(M.preventDefault(),_(D=>!D))}return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[]);function he(){n&&(o(n,v=>({...v,messages:[],updatedAt:new Date().toISOString()})),d(""),w(""),j("1:1"),p("None"),f(null))}async function N(){var $,V,Se,pe,_e;const v=u.trim();if(!v||h)return;if(v.startsWith("/")&&(_(!1),T(v))){d("");return}if(r.agentMode==="agent"){d(""),m(!0),w("");let W=n;W||(W=a(v));const O={role:"user",content:v};o(W,ge=>({...ge,messages:[...ge.messages,O],title:ge.messages.length===0?mn([O]):ge.title,updatedAt:new Date().toISOString()}));const ae=[...(($=t.find(ge=>ge.id===W))==null?void 0:$.messages)||[],O];try{tl("llm");const Fe=await(await fetch("/api/agent/chat",{method:"POST",headers:{"Content-Type":"application/json","ngrok-skip-browser-warning":"1"},body:JSON.stringify({api1:r.api1,api2:r.api2,messages:ae.map(ne=>({role:ne.role,content:ne.content})),maxTokens:r.maxTokens,skills:l})})).json();if(!Fe.success)throw new Error(Fe.error||"请求失败");if(Fe.toolCalls&&Fe.toolCalls.length>0)for(const ne of Fe.toolCalls){const ft=ne.tool==="create_skill"?"🆕":ne.tool==="import_skill_from_url"?"📥":"🔧",xe=ne.tool==="create_skill"?`创建技能: ${((V=ne.args)==null?void 0:V.name)||""}`:ne.tool==="import_skill_from_url"?"从链接导入技能":ne.tool,fn={role:"assistant",type:"tool",content:`${ft} ${xe}`,toolCall:ne};o(W,Bn=>({...Bn,messages:[...Bn.messages,fn],updatedAt:new Date().toISOString()}))}if(Fe.newSkills&&Fe.newSkills.length>0)try{const ne=localStorage.getItem("memi-skills"),xe=[...ne?JSON.parse(ne):[],...Fe.newSkills.map(fn=>{var Bn;return{...fn,id:((Bn=crypto.randomUUID)==null?void 0:Bn.call(crypto))||Date.now().toString(36)+Math.random().toString(36).slice(2),builtin:!1}})];localStorage.setItem("memi-skills",JSON.stringify(xe)),window.dispatchEvent(new Event("memi-skills-changed"))}catch{}const dn={role:"assistant",type:"chat",content:Fe.response};o(W,ne=>({...ne,messages:[...ne.messages,dn],updatedAt:new Date().toISOString()}))}catch(ge){w(ge.message)}finally{m(!1)}return}let M=n;M||(M=a(v)),d(""),w("");const D={role:"user",content:v},B=((pe=(Se=t.find(W=>W.id===M))==null?void 0:Se.messages)==null?void 0:pe.length)||0;o(M,W=>({...W,messages:[...W.messages,D],title:W.messages.length===0?mn([D]):W.title,updatedAt:new Date().toISOString()}));const X=[...((_e=t.find(W=>W.id===M))==null?void 0:_e.messages)||[],D].map(W=>({role:W.role,type:W.type,content:W.type==="image"?W.finalPrompt||"image":W.content}));if(r.requireConfirmation){m(!0);try{const O=await(await fetch("/api/pipeline/chat-complete",{method:"POST",headers:{"Content-Type":"application/json","ngrok-skip-browser-warning":"1"},body:JSON.stringify({api1:r.api1,api2:r.api2,api3:r.api3,messages:X,aspectRatio:k,style:R,maxRetry:r.maxRetry,maxTokens:r.maxTokens,polishOnly:!0})})).json();if(O.type==="polish"){f({polishedPrompt:O.polishedPrompt,editablePrompt:O.polishedPrompt,targetId:M,userMessage:D,text:v,sendMsgs:X,originalMsgCount:B}),m(!1);return}}catch{m(!1)}}await ke(M,D,v,X,null,B)}async function Z(v){if(!c)return;const{targetId:M,userMessage:D,text:B,sendMsgs:ee,originalMsgCount:X}=c;f(null),await ke(M,D,B,ee,v,X)}function Y(){if(!c)return;const{targetId:v,originalMsgCount:M}=c;o(v,D=>{const B=D.messages.slice(0,M);return{...D,messages:B,updatedAt:new Date().toISOString()}}),f(null),w("")}async function ke(v,M,D,B,ee,X){m(!0),w("");try{tl("image");const $=await fetch("/api/pipeline/chat-complete",{method:"POST",headers:{"Content-Type":"application/json","ngrok-skip-browser-warning":"1"},body:JSON.stringify({api1:r.api1,api2:r.api2,api3:r.api3,messages:B,aspectRatio:k,style:R,maxRetry:r.maxRetry,maxTokens:r.maxTokens,temperature:r.temperature,skipReview:r.enableVisionReview===!1,...ee?{overridePrompt:ee}:{}})});if(!$.ok)throw new Error("HTTP "+$.status);const V=await $.json();if(!V.success)throw new Error(V.error||"请求失败");if(V.type==="image"){if(r.requireConfirmation){f({step:"image",data:V,targetId:v,userMessage:M,text:D,sendMsgs:B,overridePrompt:ee,aspectRatio:k,style:R,originalMsgCount:X});return}b(v,D,V,ee)}else{const Se={role:"assistant",type:"chat",content:V.response};o(v,pe=>({...pe,messages:[...pe.messages,Se],updatedAt:new Date().toISOString()}))}}catch($){w($.message),o(v,V=>({...V,messages:V.messages.filter(Se=>Se!==M),updatedAt:new Date().toISOString()}))}finally{m(!1)}}function b(v,M,D,B){const ee={role:"assistant",type:"image",imageUrl:D.imageUrl,finalPrompt:D.finalPrompt,score:D.score,totalTime:D.totalTime,history:D.history||[],content:D.response||"✨ "+(D.finalPrompt||M)};o(v,X=>({...X,messages:[...X.messages,ee],updatedAt:new Date().toISOString()})),Im({id:Tm(),createdAt:new Date().toISOString(),prompt:B||M,aspectRatio:k,style:R,...D},r.maxHistoryItems)}async function F(){if(!c||c.step!=="image")return;const{targetId:v,userMessage:M,text:D,sendMsgs:B,originalMsgCount:ee}=c;f(null),m(!0);try{const $=await(await fetch("/api/pipeline/chat-complete",{method:"POST",headers:{"Content-Type":"application/json","ngrok-skip-browser-warning":"1"},body:JSON.stringify({api1:r.api1,api2:r.api2,api3:r.api3,messages:B,aspectRatio:k,style:R,maxRetry:r.maxRetry,maxTokens:r.maxTokens,temperature:r.temperature,skipReview:r.enableVisionReview===!1,polishOnly:!0})})).json();if($.type==="polish"){f({polishedPrompt:$.polishedPrompt,editablePrompt:$.polishedPrompt,targetId:v,userMessage:M,text:D,sendMsgs:B,originalMsgCount:ee}),m(!1);return}}catch{m(!1)}await ke(v,null,D,B,null,ee)}function x(){if(!c||c.step!=="image")return;const{targetId:v,text:M,data:D,overridePrompt:B}=c;f(null),b(v,M,D,B)}function P(v){v.target.value==="/"&&v.key==="/"&&_(!0),v.key==="Escape"&&_(!1),v.key==="Enter"&&!v.shiftKey&&!v.nativeEvent.isComposing&&(v.preventDefault(),N())}(((lt=e.commands)==null?void 0:lt.items)||[]).map(v=>({cmd:v.cmd,desc:v.desc}));function T(v){var X,$,V,Se,pe,_e,W,O,J,ae,ge,Fe,dn;const M=v.slice(1).trim().split(/\s+/),D=(X=M[0])==null?void 0:X.toLowerCase(),B=M.slice(1).join(" "),ee=(($=e.commands)==null?void 0:$.title)==="Slash Commands"?"en":"zh";switch(D){case"help":return _(!0),!0;case"clear":return he(),!0;case"draw":return B?(H(B),!0):(w(((Se=(V=e.commands)==null?void 0:V.notFound)==null?void 0:Se.replace("{cmd}",v))||""),!0);case"chat":return B?(U(B),!0):(w(((_e=(pe=e.commands)==null?void 0:pe.notFound)==null?void 0:_e.replace("{cmd}",v))||""),!0);case"import_skill":case"import":return B?(Ae(B),!0):(w("/import_skill <GitHub URL>"),!0);case"skill":{if(M[1]==="list"){const ne=l.map(xe=>` - ${ee==="en"&&xe.nameEn||xe.name} (${xe.type})`).join(`
201
+ `),ft=((W=e.commands)==null?void 0:W.help)+`:
202
+ `+ne;return rt(ft),!0}if(M[1]==="run"&&M[2]){const ne=M.slice(2).join(" "),ft=l.find(xe=>(xe.name||"").toLowerCase()===ne.toLowerCase()||(xe.nameEn||"").toLowerCase()===ne.toLowerCase());return ft?(ie(ft),!0):(w(((J=(O=e.commands)==null?void 0:O.notFound)==null?void 0:J.replace("{cmd}",v))||`技能 "${ne}" 未找到`),!0)}return w(((ge=(ae=e.commands)==null?void 0:ae.notFound)==null?void 0:ge.replace("{cmd}",v))||""),!0}default:return w(((dn=(Fe=e.commands)==null?void 0:Fe.notFound)==null?void 0:dn.replace("{cmd}",D?`/${D}`:v))||""),!0}}function H(v){var $;const M=n||a(v);if(!M)return;const D={role:"user",content:v};o(M,V=>({...V,messages:[...V.messages,D],title:V.messages.length===0?mn([D]):V.title,updatedAt:new Date().toISOString()}));const B=(($=t.find(V=>V.id===M))==null?void 0:$.messages)||[],ee=[...B,D].map(V=>({role:V.role,type:V.type,content:V.type==="image"?V.finalPrompt||"image":V.content})),X=B.length;ke(M,D,v,ee,null,X)}function U(v){var X;const M=n||a(v);if(!M)return;m(!0),w("");const D={role:"user",content:v};o(M,$=>({...$,messages:[...$.messages,D],title:$.messages.length===0?mn([D]):$.title,updatedAt:new Date().toISOString()}));const ee=[...((X=t.find($=>$.id===M))==null?void 0:X.messages)||[],D].map($=>({role:$.role,type:$.type,content:$.type==="image"?$.finalPrompt||"image":$.content}));tl("llm"),fetch("/api/pipeline/chat",{method:"POST",headers:{"Content-Type":"application/json","ngrok-skip-browser-warning":"1"},body:JSON.stringify({api1:r.api1,messages:ee,maxTokens:r.maxTokens})}).then($=>$.json()).then($=>{if($.success){const V={role:"assistant",type:"chat",content:$.response};o(M,Se=>({...Se,messages:[...Se.messages,V],updatedAt:new Date().toISOString()}))}else w($.error||"请求失败")}).catch($=>w($.message)).finally(()=>m(!1))}function ie(v){var B,ee,X,$;const D=(((B=e.commands)==null?void 0:B.title)==="Slash Commands"?"en":"zh")==="en"&&v.nameEn||v.name;if(v.type==="llm"){const V=prompt(`Skill: ${D}
203
+ ${((ee=e.prompt)==null?void 0:ee.placeholder)||"Enter text:"}`);if(!V)return;const Se=(v.promptTemplate||"").replace(/{input}/g,V);n||a(V);const pe=n||Object.keys(t)[0];if(!pe)return;m(!0),w("");const _e={role:"user",content:`✨ ${D}: ${V}`};o(pe,W=>({...W,messages:[...W.messages,_e],title:W.messages.length===0?mn([_e]):W.title,updatedAt:new Date().toISOString()})),tl("llm"),fetch("/api/pipeline/chat",{method:"POST",headers:{"Content-Type":"application/json","ngrok-skip-browser-warning":"1"},body:JSON.stringify({api1:r.api1,messages:[{role:"user",content:Se}],maxTokens:r.maxTokens})}).then(W=>W.json()).then(W=>{if(W.success){const O={role:"assistant",type:"chat",content:W.response};o(pe,J=>({...J,messages:[...J.messages,O],updatedAt:new Date().toISOString()}))}else w(W.error||"技能执行失败")}).catch(W=>w(W.message)).finally(()=>m(!1))}else if(v.type==="image"){const V=prompt(`Skill: ${D}
204
+ ${((X=e.prompt)==null?void 0:X.placeholder)||"Describe the scene:"}`);if(!V)return;const Se=(v.promptTemplate||"").replace(/{input}/g,V);n||a(V);const pe=n||Object.keys(t)[0];if(!pe)return;const _e={role:"user",content:`🎨 ${D}: ${V}`};o(pe,ae=>({...ae,messages:[...ae.messages,_e],title:ae.messages.length===0?mn([_e]):ae.title,updatedAt:new Date().toISOString()}));const W=(($=t.find(ae=>ae.id===pe))==null?void 0:$.messages)||[],O=[...W,_e].map(ae=>({role:ae.role,type:ae.type,content:ae.type==="image"?ae.finalPrompt||"image":ae.content})),J=W.length;ke(pe,_e,Se,O,null,J)}}async function Ae(v){var M;m(!0),w("");try{const B=await(await fetch("/api/skills/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:v})})).json();if(!B.success)throw new Error(B.error);const ee=localStorage.getItem("memi-skills"),X=ee?JSON.parse(ee):[],$={...B.skill,id:((M=crypto.randomUUID)==null?void 0:M.call(crypto))||Date.now().toString(36)+Math.random().toString(36).slice(2),builtin:!1,enabled:!0};localStorage.setItem("memi-skills",JSON.stringify([...X,$])),window.dispatchEvent(new Event("memi-skills-changed")),rt(`✅ 已导入技能: **${B.skill.name}** (${B.skill.type})`)}catch(D){w("导入失败: "+D.message)}finally{m(!1)}}function rt(v){if(!n)return;const M={role:"assistant",type:"chat",content:v};o(n,D=>({...D,messages:[...D.messages,M],updatedAt:new Date().toISOString()}))}function ze(v){var D;v.target.style.display="none";const M=(D=v.target.parentElement)==null?void 0:D.querySelector(".image-fallback");M&&(M.style.display="flex")}return i.jsxs("div",{className:"h-full flex flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between h-14 px-6 border-b border-gray-100 shrink-0",children:[i.jsx("h1",{className:"text-sm font-medium text-gray-700 truncate",children:K?K.title:e.nav.chat}),i.jsx("div",{className:"flex items-center gap-2",children:i.jsx("button",{className:"rounded-lg border border-gray-200 bg-white p-2 text-gray-400 hover:text-gray-600 hover:border-gray-300 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",type:"button",onClick:he,title:e.chat.deleteChat,disabled:!K||A.length===0,children:i.jsx(Mr,{size:14,strokeWidth:1.5})})})]}),i.jsx("div",{className:"flex-1 overflow-y-auto px-4 py-6",children:i.jsxs("div",{className:"max-w-3xl mx-auto space-y-6",children:[A.length===0&&!h&&i.jsx("div",{className:"flex h-full min-h-[300px] items-center justify-center",children:i.jsxs("div",{className:"text-center max-w-sm",children:[i.jsx($l,{size:40,className:"mx-auto mb-4 text-gray-200",strokeWidth:1}),i.jsx("p",{className:"text-sm text-gray-400 mb-1",children:e.chat.placeholder}),i.jsx("p",{className:"text-xs text-gray-300",children:e.chat.hint})]})}),A.map((v,M)=>i.jsx("div",{className:"flex "+(v.role==="user"?"justify-end":"justify-start"),children:i.jsx("div",{className:"max-w-[75%] rounded-2xl px-4 py-3 text-sm leading-relaxed "+(v.role==="user"?"bg-gray-800 text-white":"bg-gray-50 text-gray-800"),children:v.type==="image"&&v.imageUrl?i.jsxs("div",{children:[v.content&&i.jsx("p",{className:"mb-2 text-sm",children:v.content}),i.jsxs("div",{className:"relative",children:[i.jsx("img",{src:nl(v.imageUrl),alt:v.finalPrompt||"image",className:"max-w-full rounded-xl cursor-pointer hover:opacity-95 transition",style:{maxHeight:"400px"},onClick:()=>E(nl(v.imageUrl)),onError:ze}),i.jsx("div",{className:"hidden image-fallback items-center justify-center h-48 bg-gray-100 rounded-xl text-gray-300 text-sm",children:i.jsx(Ra,{size:24,strokeWidth:1})})]}),i.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-gray-400",children:[v.score!=null&&i.jsx("span",{className:"bg-white/80 px-2 py-1 rounded-md font-medium text-gray-500",children:e.result.score+": "+v.score}),v.totalTime!=null&&i.jsx("span",{children:(v.totalTime/1e3).toFixed(1)+"s"})]}),v.finalPrompt&&i.jsx("p",{className:"mt-1.5 text-xs text-gray-400 italic truncate",children:v.finalPrompt})]}):v.type==="tool"?i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-lg",children:v.content}),v.toolCall&&i.jsx("span",{className:"text-xs text-gray-400 italic",children:(()=>{try{const D=typeof v.toolCall.args=="string"?JSON.parse(v.toolCall.args):v.toolCall.args;return Object.values(D||{}).join(", ").slice(0,40)}catch{return String(v.toolCall.args||"").slice(0,40)}})()})]}):i.jsx("div",{className:"whitespace-pre-wrap",children:v.content})})},M)),h&&i.jsx("div",{className:"flex justify-start",children:i.jsx("div",{className:"rounded-2xl bg-gray-50 px-4 py-3",children:i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("div",{className:"h-2 w-2 animate-bounce rounded-full bg-gray-300",style:{animationDelay:"0ms"}}),i.jsx("div",{className:"h-2 w-2 animate-bounce rounded-full bg-gray-300",style:{animationDelay:"150ms"}}),i.jsx("div",{className:"h-2 w-2 animate-bounce rounded-full bg-gray-300",style:{animationDelay:"300ms"}})]})})}),i.jsx("div",{ref:L})]})}),g&&i.jsx("div",{className:"mx-auto max-w-3xl w-full px-4 mb-2",children:i.jsx("div",{className:"rounded-lg bg-red-50 px-4 py-2.5 text-sm text-red-600 border border-red-100",children:g})}),C&&i.jsx("div",{className:"mx-auto max-w-3xl w-full px-4 mb-2",children:i.jsxs("div",{className:"rounded-xl border border-gray-100 bg-white shadow-lg p-4",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsx("h4",{className:"text-sm font-semibold text-gray-700",children:((Hn=e.commands)==null?void 0:Hn.help)||"Commands"}),i.jsx("button",{type:"button",className:"text-gray-300 hover:text-gray-500",onClick:()=>_(!1),children:i.jsx(Ht,{size:14,strokeWidth:1.5})})]}),i.jsx("p",{className:"text-xs text-gray-400 mb-3",children:((Yt=e.commands)==null?void 0:Yt.helpDesc)||""}),i.jsx("div",{className:"space-y-1.5",children:(((Vn=e.commands)==null?void 0:Vn.items)||[]).map((v,M)=>i.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[i.jsx("code",{className:"rounded-md bg-gray-50 px-2 py-1 text-xs font-mono text-gray-600 min-w-[140px]",children:v.cmd}),i.jsx("span",{className:"text-gray-500",children:v.desc})]},M))})]})}),i.jsx("div",{className:"mx-auto max-w-3xl w-full px-4 pt-2",children:i.jsxs("div",{className:"inline-flex rounded-lg border border-gray-200 overflow-hidden",children:[i.jsx("button",{type:"button",className:"px-4 py-1.5 text-xs transition-colors "+(r.agentMode!=="agent"?"theme-bg text-white font-medium":"bg-white text-gray-400 hover:text-gray-600"),onClick:()=>s==null?void 0:s({...r,agentMode:"image"}),children:"🎨 生图"}),i.jsx("button",{type:"button",className:"px-4 py-1.5 text-xs transition-colors "+(r.agentMode==="agent"?"theme-bg text-white font-medium":"bg-white text-gray-400 hover:text-gray-600"),onClick:()=>s==null?void 0:s({...r,agentMode:"agent"}),children:"🤖 Agent"})]})}),i.jsx("div",{className:"border-t border-gray-100 px-4 py-4",children:i.jsxs("div",{className:"max-w-3xl mx-auto",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx("select",{className:"text-xs text-gray-400 bg-transparent outline-none",value:k,onChange:v=>j(v.target.value),children:_m.map(v=>i.jsx("option",{value:v,children:v},v))}),i.jsx("span",{className:"text-gray-200",children:"|"}),i.jsx("select",{className:"text-xs text-gray-400 bg-transparent outline-none",value:R,onChange:v=>p(v.target.value),children:bm.map(v=>i.jsx("option",{value:v,children:v},v))}),i.jsx("span",{className:"flex-1"}),i.jsx("span",{className:"text-xs text-gray-300",children:e.chat.autoDetect})]}),i.jsxs("div",{className:"flex items-end gap-2",children:[i.jsx("div",{className:"flex-1 rounded-xl border border-gray-200 bg-white focus-within:border-gray-400 transition-colors",children:i.jsx("textarea",{className:"min-h-[44px] max-h-32 w-full resize-none rounded-xl px-4 py-3 text-sm text-gray-800 outline-none placeholder:text-gray-300",placeholder:e.chat.inputPlaceholder,value:u,onChange:v=>{const M=v.target.value;d(M),M==="/"&&_(!0),M&&!M.startsWith("/")&&_(!1)},onKeyDown:P,disabled:h,rows:1})}),i.jsx("button",{className:"flex h-11 w-11 items-center justify-center rounded-xl bg-gray-800 text-white hover:bg-gray-700 disabled:opacity-40 transition-colors",type:"button",onClick:N,disabled:!u.trim()||h,children:i.jsx(hm,{size:16,strokeWidth:1.5})})]})]})}),c&&c.step!=="image"&&i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/20 backdrop-blur-sm",children:i.jsxs("div",{className:"w-full max-w-lg mx-4 rounded-2xl border border-gray-100 bg-white p-5 shadow-xl",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsx("h3",{className:"text-sm font-semibold text-gray-700",children:e.settings.requireConfirmation}),i.jsx("button",{type:"button",onClick:Y,className:"text-gray-300 hover:text-gray-500 transition-colors",children:i.jsx(Ht,{size:16,strokeWidth:1.5})})]}),i.jsx("textarea",{className:"w-full min-h-[120px] resize-none rounded-xl border border-gray-200 px-4 py-3 text-sm text-gray-800 outline-none focus:border-gray-400 transition-colors",value:c.editablePrompt,onChange:v=>f(M=>M?{...M,editablePrompt:v.target.value}:null)}),i.jsxs("div",{className:"mt-3 flex items-center justify-end gap-2",children:[i.jsx("button",{className:"rounded-lg border border-gray-200 px-4 py-2 text-sm text-gray-500 hover:text-gray-700 hover:bg-gray-50 transition-colors",type:"button",onClick:Y,children:e.common.cancel||"Cancel"}),i.jsxs("button",{className:"flex items-center gap-1.5 rounded-lg bg-gray-800 px-4 py-2 text-sm text-white hover:bg-gray-700 transition-colors",type:"button",onClick:()=>Z(c.editablePrompt),children:[i.jsx(Da,{size:14,strokeWidth:1.5}),e.common.confirm||"Confirm"]})]})]})}),c&&c.step==="image"&&i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/20 backdrop-blur-sm",children:i.jsxs("div",{className:"w-full max-w-lg mx-4 rounded-2xl border border-gray-100 bg-white p-5 shadow-xl",children:[i.jsx("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:e.settings.requireConfirmation}),c.data.imageUrl&&i.jsxs("div",{className:"relative",children:[i.jsx("img",{src:nl(c.data.imageUrl),alt:c.data.finalPrompt||"Generated",className:"max-w-full rounded-xl cursor-pointer hover:opacity-95 transition",style:{maxHeight:"300px"},onClick:()=>E(nl(c.data.imageUrl)),onError:ze}),i.jsx("div",{className:"hidden image-fallback items-center justify-center h-48 bg-gray-100 rounded-xl text-gray-300 text-sm",children:i.jsx(Ra,{size:24,strokeWidth:1})})]}),c.data.finalPrompt&&i.jsx("p",{className:"mt-2 text-xs text-gray-400 italic truncate",children:c.data.finalPrompt}),i.jsxs("div",{className:"mt-3 flex items-center justify-end gap-2",children:[i.jsxs("button",{className:"flex items-center gap-1.5 rounded-lg border border-gray-200 px-4 py-2 text-sm text-gray-500 hover:text-gray-700 hover:bg-gray-50 transition-colors",type:"button",onClick:x,children:[i.jsx(Da,{size:14,strokeWidth:1.5}),e.common.confirm||"Accept"]}),i.jsxs("button",{className:"flex items-center gap-1.5 rounded-lg border border-gray-300 px-4 py-2 text-sm text-gray-600 hover:bg-gray-50 transition-colors",type:"button",onClick:F,disabled:h,children:[i.jsx(fm,{size:14,strokeWidth:1.5,className:h?"animate-spin":""}),"Retry"]}),i.jsx("button",{className:"rounded-lg border border-gray-200 px-4 py-2 text-sm text-gray-400 hover:text-gray-600 transition-colors",type:"button",onClick:Y,children:e.common.cancel||"Cancel"})]})]})}),y&&i.jsxs("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/60 backdrop-blur-sm cursor-zoom-out",onClick:()=>E(""),onKeyDown:v=>{v.key==="Escape"&&E("")},children:[i.jsx("img",{src:y,alt:"full size",className:"max-h-[90vh] max-w-[90vw] rounded-2xl shadow-2xl cursor-default",onClick:v=>v.stopPropagation()}),i.jsx("button",{className:"absolute top-4 right-4 rounded-full bg-white/10 p-2 text-white/70 hover:text-white hover:bg-white/20 transition-colors",type:"button",onClick:()=>E(""),children:i.jsx(Ht,{size:20,strokeWidth:1.5})})]})]})}const zm=30;function Fa(e){return e?e.startsWith("data:")?e:e.startsWith("http")?"/api/proxy-image?url="+encodeURIComponent(e):e:""}function Lm(){try{const e=localStorage.getItem("memi-generation-history");return e?JSON.parse(e):[]}catch{return[]}}function Dm({copy:e,onNavigate:t}){const[n,r]=I.useState([]),[l,s]=I.useState(""),o=I.useRef(new Map);I.useEffect(()=>{r(Lm()),o.current=new Map;function d(){r([]),o.current=new Map}return window.addEventListener("memi-history-cleared",d),()=>{window.removeEventListener("memi-history-cleared",d)}},[]);function a(d,h,m){if(!h)return;const g=o.current.get(d)||0;if(!(g>=zm))if(o.current.set(d,g+1),h.startsWith("http")){const w=h.includes("?")?"&":"?",k=h+w+"_retry="+(g+1);m.target.src=Fa(k)}else h.startsWith("data:")&&(m.target.src=h)}function u(){window.confirm(e.gallery.confirmClear||"确定要清空所有历史记录吗?")&&(localStorage.removeItem("memi-generation-history"),r([]),o.current=new Map)}return n.length===0?i.jsxs("section",{className:"rounded-md border border-gray-200 bg-gray-50 p-8 text-center",children:[i.jsx("h1",{className:"text-2xl font-semibold text-gray-950",children:e.gallery.emptyTitle}),i.jsx("p",{className:"mx-auto mt-2 max-w-xl text-sm leading-6 text-gray-600",children:e.gallery.emptyBody}),i.jsx("button",{className:"mt-5 rounded-md px-4 py-2 text-sm font-medium text-white theme-bg",type:"button",onClick:()=>t("studio"),children:e.gallery.goStudio})]}):i.jsxs("section",{className:"space-y-5",children:[i.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium theme-text",children:e.gallery.eyebrow}),i.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-gray-950",children:e.gallery.title})]}),i.jsx("button",{className:"rounded-md border border-gray-300 px-3 py-2 text-sm text-gray-700 hover:border-gray-900",type:"button",onClick:u,children:e.gallery.clear})]}),i.jsx("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:n.map(d=>{const h=Fa(d.imageUrl);return i.jsxs("article",{className:"overflow-hidden rounded-md border border-gray-200 bg-white",children:[i.jsx("div",{className:"aspect-square bg-gray-50 cursor-pointer",onClick:()=>s(h),children:i.jsx("img",{className:"h-full w-full object-cover",src:h,alt:d.finalPrompt||d.prompt,onError:m=>a(d.id,d.imageUrl,m)})}),i.jsxs("div",{className:"space-y-3 p-4",children:[i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsxs("span",{className:"text-sm font-semibold text-gray-950",children:[e.result.score," ",d.score??"N/A"]}),i.jsx("span",{className:"text-xs text-gray-500",children:new Date(d.createdAt).toLocaleString()})]}),i.jsx("p",{className:"line-clamp-3 text-sm leading-6 text-gray-600",children:d.finalPrompt||d.prompt}),i.jsx("button",{className:"inline-flex rounded-md px-3 py-2 text-sm font-medium text-white theme-bg",type:"button",onClick:()=>s(h),children:e.result.openImage})]})]},d.id)})}),l&&i.jsxs("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/60 backdrop-blur-sm cursor-zoom-out",onClick:()=>s(""),onKeyDown:d=>{d.key==="Escape"&&s("")},children:[i.jsx("img",{src:l,alt:"full size",className:"max-h-[90vh] max-w-[90vw] rounded-2xl shadow-2xl cursor-default",onClick:d=>d.stopPropagation()}),i.jsx("button",{className:"absolute top-4 right-4 rounded-full bg-white/10 p-2 text-white/70 hover:text-white hover:bg-white/20 transition-colors",type:"button",onClick:()=>s(""),children:i.jsx(Ht,{size:20,strokeWidth:1.5})})]})]})}const er={api1:{baseUrl:"https://integrate.api.nvidia.com/v1",apiKey:"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",model:"google/gemma-3n-e2b-it"},api2:{baseUrl:"https://enter.pollinations.ai",apiKey:"",model:"pollinations"},api3:{baseUrl:"https://integrate.api.nvidia.com/v1",apiKey:"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",model:"meta/llama-4-maverick-17b-128e-instruct"},maxRetry:2,requireConfirmation:!1,maxTokens:0,defaultAspectRatio:"1:1",defaultStyle:"None",temperature:.7,enableVisionReview:!0,maxHistoryItems:24,agentMode:"image"},Ei=[{id:"graphite",label:"石墨",labelEn:"Graphite",desc:"深色",descEn:"Dark",mode:"dark",color:"#374151",hover:"#1f2937"},{id:"sandstone",label:"砂岩",labelEn:"Sandstone",desc:"浅色",descEn:"Light",mode:"light",color:"#d97706",hover:"#b45309"},{id:"porcelain",label:"瓷白",labelEn:"Porcelain",desc:"浅色",descEn:"Light",mode:"light",color:"#2563eb",hover:"#1d4ed8"},{id:"midnight",label:"午夜",labelEn:"Midnight",desc:"深色",descEn:"Dark",mode:"dark",color:"#4f46e5",hover:"#3730a3"}],Rm=[{id:"small",label:"小",labelEn:"Small"},{id:"medium",label:"中",labelEn:"Medium"},{id:"large",label:"大",labelEn:"Large"}],Om=[{id:"sans",label:"无衬线",labelEn:"Sans-serif"},{id:"system",label:"系统",labelEn:"System"},{id:"serif",label:"衬线",labelEn:"Serif"}],Ua=[{id:"skill-enhance",name:"提示词增强",nameEn:"Enhance Prompt",description:"为你的提示词补充光线、构图和氛围细节",descriptionEn:"Add lighting, composition & mood details to your prompt",type:"llm",promptTemplate:"You are a professional prompt engineer for AI image generation. Enhance the following prompt with rich details about lighting, composition, color palette, mood, and camera angles. Keep it concise but vivid. Original prompt: {input}",builtin:!0},{id:"skill-summarize",name:"对话总结",nameEn:"Summarize",description:"总结当前对话的要点",descriptionEn:"Summarize the key points of the conversation",type:"llm",promptTemplate:`Summarize the key points from the following conversation concisely:
205
+ {input}`,builtin:!0},{id:"skill-translate-en",name:"译成英文",nameEn:"Translate to English",description:"将中文翻译成英文",descriptionEn:"Translate Chinese text to English",type:"llm",promptTemplate:`Translate the following Chinese text to English. Output ONLY the translation, no explanations:
206
+ {input}`,builtin:!0},{id:"skill-translate-zh",name:"译成中文",nameEn:"Translate to Chinese",description:"将英文翻译成中文",descriptionEn:"Translate English text to Chinese",type:"llm",promptTemplate:`Translate the following English text to Chinese. Output ONLY the translation, no explanations:
207
+ {input}`,builtin:!0},{id:"skill-cyberpunk",name:"赛博朋克风格",nameEn:"Cyberpunk Style",description:"为画面添加赛博朋克视觉风格",descriptionEn:"Apply a cyberpunk visual style to the scene",type:"image",promptTemplate:"{input}, cyberpunk style, neon lights, rain, futuristic city, vibrant colors, high contrast",builtin:!0},{id:"skill-watercolor",name:"水彩风格",nameEn:"Watercolor Style",description:"为画面添加水彩画风格",descriptionEn:"Apply a soft watercolor painting style",type:"image",promptTemplate:"{input}, watercolor painting, soft colors, paper texture, artistic, loose brushstrokes",builtin:!0}];function Am({config:e,copy:t,onChange:n,compact:r=!1,defaultOpen:l=!1,onlyGroups:s=null}){const[o,a]=I.useState(l);function u(h,m,g){n({...e,[h]:{...e[h],[m]:g}})}const d=s||Object.keys(t.config.labels);return i.jsxs("details",{className:"rounded-md border border-gray-200 bg-gray-50",open:o,onToggle:h=>a(h.target.open),children:[i.jsxs("summary",{className:"cursor-pointer px-4 py-3 text-sm font-medium text-gray-800",children:[t.config.title,r&&i.jsx("span",{className:"ml-2 text-xs font-normal text-gray-500",children:t.common.savedLocally})]}),i.jsx("div",{className:"grid gap-4 border-t border-gray-200 p-4 lg:grid-cols-3",children:d.map(h=>i.jsxs("section",{className:"space-y-3 rounded-md border border-gray-200 bg-white p-3",children:[i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsx("h2",{className:"text-sm font-semibold text-gray-900",children:t.config.labels[h]}),i.jsx("span",{className:"rounded-md bg-gray-100 px-2 py-1 text-xs text-gray-600",children:e[h].model||"No model"})]}),["baseUrl","apiKey","model"].map(m=>i.jsxs("label",{className:"block text-sm text-gray-600",children:[i.jsx("span",{className:"mb-1 block",children:m}),i.jsx("input",{className:"w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 outline-none transition focus:border-gray-900",value:e[h][m],type:m==="apiKey"?"password":"text",onChange:g=>u(h,m,g.target.value)})]},m))]},h))})]})}function Ms({options:e,value:t,onChange:n,className:r=""}){return i.jsx("div",{className:"inline-flex rounded-lg border border-gray-200 overflow-hidden "+r,children:e.map(l=>{const s=l.id===t;return i.jsx("button",{type:"button",className:"px-4 py-1.5 text-sm transition-colors "+(s?"theme-bg text-white font-medium":"bg-white text-gray-500 hover:text-gray-700 hover:bg-gray-50"),onClick:()=>n(l.id),children:l.label},l.id)})})}function Fm({m:e,lang:t,skills:n,onSkillsChange:r,navLabel:l}){const[s,o]=I.useState(null),[a,u]=I.useState(!1),[d,h]=I.useState(""),[m,g]=I.useState("all"),[w,k]=I.useState(null),[j,R]=I.useState(!1),[p,c]=I.useState(""),[f,y]=I.useState(!1),E=a&&w!==null;function C(){var b;return((b=crypto.randomUUID)==null?void 0:b.call(crypto))||Date.now().toString(36)+Math.random().toString(36).slice(2,8)}function _(b){b.id&&n.find(F=>F.id===b.id)?r(n.map(F=>F.id===b.id?b:F)):r([...n,{...b,id:C(),builtin:!1}]),u(!1),o(null),k(null)}function L(b){R(!1),c("");const F={name:"",nameEn:"",description:"",descriptionEn:"",type:"llm",promptTemplate:""};o(b||null),k(b?{...b}:F),u(!0)}async function K(){if(p.trim()){y(!0);try{const F=await(await fetch("/api/skills/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:p.trim()})})).json();if(!F.success)throw new Error(F.error);const x={...F.skill,builtin:!1,enabled:!0};r([...n,{...x,id:C()}]),c(""),R(!1),u(!1)}catch(b){alert("导入失败: "+b.message)}finally{y(!1)}}}function A(){u(!1),o(null),k(null)}const he=n.length,N=n.filter(b=>b.enabled!==!1).length,Z=n.filter(b=>b.enabled===!1).length,Y=n.filter(b=>{if(d){const F=d.toLowerCase(),x=(b.name||"").toLowerCase(),P=(b.nameEn||"").toLowerCase(),T=(b.description||"").toLowerCase();if(!x.includes(F)&&!P.includes(F)&&!T.includes(F))return!1}return m==="all"?!0:m==="enabled"?b.enabled!==!1:m==="disabled"?b.enabled===!1:!0});if(E){const b=!(s!=null&&s.id);return b&&j?i.jsxs("div",{className:"space-y-5 max-w-xl",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{className:"text-gray-400 hover:text-gray-600 p-1",type:"button",onClick:A,children:i.jsx(Ht,{size:16,strokeWidth:1.5})}),i.jsxs("h3",{className:"text-sm font-semibold text-gray-800",children:[e.skills.add," · ",t==="en"?"Import":"导入"]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm mb-1",children:i.jsx("span",{className:"text-gray-700 font-medium",children:"GitHub URL"})}),i.jsx("input",{className:"w-full rounded-lg border border-gray-200 px-3 py-2 text-sm text-gray-900 outline-none placeholder:text-gray-300 focus:border-gray-400",placeholder:"https://github.com/user/repo/blob/main/skill.json",value:p,onChange:F=>c(F.target.value),onKeyDown:F=>{F.key==="Enter"&&K()}}),i.jsx("p",{className:"mt-1 text-xs text-gray-400",children:t==="en"?"Supports GitHub blob/raw/gist URLs, JSON & Markdown":"支持 GitHub blob/raw/gist 链接,JSON 和 Markdown 格式"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{className:"theme-bg rounded-lg px-5 py-2 text-sm text-white font-medium disabled:opacity-50",onClick:K,disabled:f||!p.trim(),children:f?t==="en"?"Importing...":"导入中...":t==="en"?"Import":"导入"}),i.jsx("button",{className:"rounded-lg border border-gray-200 px-5 py-2 text-sm text-gray-500",onClick:()=>R(!1),children:t==="en"?"Manual Entry":"手动填写"}),i.jsx("button",{className:"rounded-lg border border-gray-200 px-5 py-2 text-sm text-gray-500",onClick:A,children:e.skills.cancel||"取消"})]})]}):i.jsxs("div",{className:"space-y-6 max-w-xl",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[i.jsx("button",{className:"text-gray-400 hover:text-gray-600 p-1",type:"button",onClick:A,children:i.jsx(Ht,{size:16,strokeWidth:1.5})}),i.jsx("h3",{className:"text-sm font-semibold text-gray-800",children:b?e.skills.add:e.skills.edit})]}),i.jsxs("div",{className:"space-y-5",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm mb-1",children:i.jsx("span",{className:"text-gray-700 font-medium",children:e.skills.name})}),i.jsx("input",{className:"w-full rounded-lg border border-gray-200 px-3 py-2 text-sm text-gray-900 outline-none placeholder:text-gray-300 focus:border-gray-400 transition-colors",placeholder:"例如:故事生成器",value:w.name,onChange:F=>k({...w,name:F.target.value})})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm mb-1",children:i.jsx("span",{className:"text-gray-700 font-medium",children:e.skills.type})}),i.jsxs("select",{className:"w-full rounded-lg border border-gray-200 px-3 py-2 text-sm text-gray-900 outline-none focus:border-gray-400",value:w.type,onChange:F=>k({...w,type:F.target.value}),children:[i.jsx("option",{value:"llm",children:e.skills.typeLlm}),i.jsx("option",{value:"image",children:e.skills.typeImage})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm mb-1",children:i.jsx("span",{className:"text-gray-700 font-medium",children:e.skills.description})}),i.jsx("input",{className:"w-full rounded-lg border border-gray-200 px-3 py-2 text-sm text-gray-900 outline-none placeholder:text-gray-300 focus:border-gray-400 transition-colors",placeholder:"描述这个技能的作用",value:w.description,onChange:F=>k({...w,description:F.target.value})})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm mb-1",children:i.jsx("span",{className:"text-gray-700 font-medium",children:e.skills.promptTemplate})}),i.jsx("textarea",{className:"w-full min-h-[120px] rounded-lg border border-gray-200 px-3 py-2.5 text-sm text-gray-900 outline-none placeholder:text-gray-300 focus:border-gray-400 transition-colors font-mono leading-relaxed",placeholder:"Translate to English: {input}",value:w.promptTemplate,onChange:F=>k({...w,promptTemplate:F.target.value})}),i.jsx("p",{className:"mt-1.5 text-xs text-gray-400",children:e.skills.promptTemplateDesc})]})]}),i.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[i.jsx("button",{className:"theme-bg rounded-lg px-6 py-2 text-sm text-white font-medium hover:opacity-90 transition-opacity",type:"button",onClick:()=>_(w),children:e.skills.save||"保存"}),i.jsx("button",{className:"rounded-lg border border-gray-200 px-6 py-2 text-sm text-gray-500 hover:text-gray-700 hover:border-gray-300 transition-colors",type:"button",onClick:A,children:e.skills.cancel||"取消"})]})]})}const ke=b=>b==="all"?`${l||e.nav.skills} (${he})`:b==="enabled"?`${t==="en"?"Enabled":"正在使用"} (${N})`:b==="disabled"?`${t==="en"?"Disabled":"未使用"} (${Z})`:b;return i.jsxs("div",{className:"space-y-5",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("div",{className:"relative flex-1",children:[i.jsx(Oa,{size:15,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-300 pointer-events-none",strokeWidth:1.5}),i.jsx("input",{className:"w-full rounded-xl border border-gray-200 bg-gray-50 pl-9 pr-4 py-2 text-sm text-gray-700 outline-none placeholder:text-gray-300 focus:border-gray-300 focus:bg-white transition-colors",placeholder:e.skills.searchPlaceholder||"搜索技能",value:d,onChange:b=>h(b.target.value)})]}),i.jsxs("button",{className:"flex items-center gap-1.5 rounded-full border border-gray-200 bg-white px-4 py-2 text-sm text-gray-700 hover:border-gray-300 hover:bg-gray-50 transition-colors",type:"button",onClick:b=>{b.stopPropagation(),L(null)},children:[i.jsx(nd,{size:15,strokeWidth:2}),i.jsx("span",{children:e.skills.add||"添加技能"})]}),i.jsxs("button",{className:"flex items-center gap-1.5 rounded-full border border-gray-200 bg-white px-4 py-2 text-sm text-gray-500 hover:border-gray-300 hover:bg-gray-50 transition-colors",type:"button",onClick:b=>{b.stopPropagation(),R(!0),c(""),o(null),k({name:"",type:"llm"}),u(!0)},children:[i.jsx(Oa,{size:14,strokeWidth:1.5}),i.jsx("span",{children:t==="en"?"Import":"导入"})]})]}),i.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:["all","enabled","disabled"].map(b=>i.jsx("button",{className:"px-3 py-1.5 text-sm rounded-lg transition-colors whitespace-nowrap "+(m===b?"bg-gray-800 text-white font-medium":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"),onClick:()=>g(b),children:ke(b)},b))}),Y.length===0?i.jsxs("div",{className:"rounded-xl border border-gray-100 bg-gray-50 p-10 text-center",children:[i.jsx(rd,{size:36,className:"mx-auto mb-3 text-gray-200",strokeWidth:1}),i.jsx("p",{className:"text-sm text-gray-400",children:d?e.skills.searchEmpty||"无匹配技能":e.skills.empty||"暂无技能"})]}):i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:Y.map(b=>{const F=t==="en"&&b.nameEn||b.name,x=t==="en"&&b.descriptionEn||b.description,P=b.type==="image"?e.skills.typeImage:e.skills.typeLlm,T=b.builtin,H=b.enabled!==!1;return i.jsxs("div",{className:"group rounded-xl border border-gray-100 bg-white p-4 hover:shadow-sm hover:border-gray-200 transition-all cursor-pointer",onClick:()=>L(b),children:[i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("div",{className:"w-8 h-8 flex items-center justify-center shrink-0 text-lg",children:"🧩"}),i.jsx("div",{className:"flex-1 min-w-0",children:i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx("span",{className:"text-sm font-semibold text-gray-800 truncate",children:F}),i.jsx("button",{type:"button",role:"switch","aria-checked":H,className:"relative inline-flex h-4 w-7 shrink-0 items-center rounded-full transition-colors "+(H?"theme-bg":"bg-gray-200"),onClick:U=>{U.stopPropagation(),r(n.map(ie=>ie.id===b.id?{...ie,enabled:!H}:ie))},children:i.jsx("span",{className:"inline-block h-3 w-3 transform rounded-full bg-white transition-transform "+(H?"translate-x-[14px]":"translate-x-[2px]")})})]})})]}),x&&i.jsx("p",{className:"mt-3 text-xs text-gray-400 leading-relaxed line-clamp-2",children:x}),i.jsxs("div",{className:"mt-3 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"rounded-md bg-gray-100 px-2 py-0.5 text-[11px] text-gray-500",children:P}),T&&i.jsx("span",{className:"rounded-md bg-gray-50 px-2 py-0.5 text-[11px] text-gray-400",children:e.skills.builtin})]}),i.jsx("button",{className:"p-1 text-gray-300 hover:text-gray-500 opacity-0 group-hover:opacity-100 transition-opacity",type:"button",onClick:U=>{U.stopPropagation(),!T&&window.confirm((e.skills.deleteConfirm||"").replace("{name}",F))&&r(n.filter(ie=>ie.id!==b.id))},title:e.skills.delete,children:i.jsx(Jp,{size:16,strokeWidth:1.5})})]})]},b.id)})})]})}function Um({m:e,lang:t}){var a;const[n,r]=I.useState(Aa),l=new Date().toISOString().slice(0,10),s=((a=n.daily)==null?void 0:a[l])||{},o=(n.llmCalls||0)+(n.imageGenerations||0)+(n.visionReviews||0);return i.jsx("div",{className:"space-y-8",children:i.jsxs("section",{children:[i.jsx("h3",{className:"text-sm font-semibold text-gray-800 mb-1",children:e.billing.title}),i.jsx("p",{className:"text-xs text-gray-400 mb-4",children:e.billing.desc}),i.jsxs("div",{className:"grid grid-cols-3 gap-4 mb-6",children:[i.jsxs("div",{className:"rounded-xl border border-gray-100 bg-gray-50 p-4 text-center",children:[i.jsx("p",{className:"text-xs text-gray-400 mb-1",children:e.billing.totalRequests}),i.jsx("p",{className:"text-2xl font-semibold text-gray-800",children:o})]}),i.jsxs("div",{className:"rounded-xl border border-gray-100 bg-gray-50 p-4 text-center",children:[i.jsx("p",{className:"text-xs text-gray-400 mb-1",children:e.billing.tokensUsed}),i.jsx("p",{className:"text-2xl font-semibold text-gray-800",children:n.llmCalls||0})]}),i.jsxs("div",{className:"rounded-xl border border-gray-100 bg-gray-50 p-4 text-center",children:[i.jsx("p",{className:"text-xs text-gray-400 mb-1",children:e.billing.imagesGenerated}),i.jsx("p",{className:"text-2xl font-semibold text-gray-800",children:n.imageGenerations||0})]})]}),i.jsxs("div",{className:"rounded-xl border border-gray-100 bg-gray-50 p-4",children:[i.jsx("p",{className:"text-xs font-medium text-gray-500 mb-3",children:t==="en"?"Today":"今日"}),i.jsxs("div",{className:"grid grid-cols-3 gap-3 text-center text-sm",children:[i.jsxs("div",{children:[i.jsxs("span",{className:"text-gray-400",children:[e.billing.totalRequests,":"]}),i.jsx("span",{className:"font-semibold text-gray-800",children:(s.llmCalls||0)+(s.imageGenerations||0)+(s.visionReviews||0)})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-gray-400",children:"LLM:"}),i.jsx("span",{className:"font-semibold text-gray-800",children:s.llmCalls||0})]}),i.jsxs("div",{children:[i.jsxs("span",{className:"text-gray-400",children:[e.billing.imagesGenerated,":"]}),i.jsx("span",{className:"font-semibold text-gray-800",children:s.imageGenerations||0})]})]})]}),i.jsxs("button",{className:"mt-4 rounded-lg border border-gray-200 px-4 py-2 text-sm text-gray-500 hover:text-gray-700 hover:border-gray-300 transition-colors",type:"button",onClick:()=>{window.confirm(t==="en"?"Reset usage stats?":"重置使用统计?")&&(Pm(),r(Aa()))},children:[i.jsx(Mr,{size:14,strokeWidth:1.5,className:"inline mr-1.5"}),t==="en"?"Reset Stats":"重置统计"]})]})})}function $m({copy:e,config:t,onConfigChange:n,language:r,onLanguageChange:l,themeStyle:s,onThemeStyleChange:o,themeMode:a,onThemeModeChange:u,fontSize:d,onFontSizeChange:h,fontFamily:m,onFontFamilyChange:g,skills:w,onSkillsChange:k,onClose:j}){const[R,p]=I.useState("general"),c=I.useRef(null),f=r==="en"?"en":"zh",y=e.modal;I.useEffect(()=>{var N;(N=c.current)==null||N.focus()},[]);function E(){return i.jsxs("div",{className:"space-y-8",children:[i.jsxs("section",{children:[i.jsx("h3",{className:"text-sm font-semibold text-gray-800 mb-1",children:y.general.theme}),i.jsx("p",{className:"text-xs text-gray-400 mb-4",children:y.general.themeDesc}),i.jsx("div",{className:"flex gap-3",children:["light","dark"].map(N=>{const Z=N==="light"?Nm:am,Y=a===N;return i.jsxs("button",{type:"button",className:"flex items-center gap-2 rounded-xl border-2 px-5 py-3 text-sm transition-all "+(Y?"theme-border bg-gray-50 text-gray-900 font-medium":"border-gray-100 bg-white text-gray-400 hover:border-gray-200"),onClick:()=>u(N),children:[i.jsx(Z,{size:18,strokeWidth:1.5}),N==="light"?y.general.light:y.general.dark]},N)})})]}),i.jsxs("section",{children:[i.jsx("h3",{className:"text-sm font-semibold text-gray-800 mb-1",children:y.general.themeStyle}),i.jsx("p",{className:"text-xs text-gray-400 mb-4",children:y.general.themeStyleDesc}),i.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:Ei.map(N=>{const Z=s===N.id,Y=f==="en"?N.labelEn:N.label,ke=f==="en"?N.descEn:N.desc;return i.jsxs("button",{type:"button",className:"rounded-xl border-2 p-4 text-left transition-all "+(Z?"theme-border bg-gray-50 shadow-sm":"border-gray-100 bg-white hover:border-gray-200"),onClick:()=>o(N.id),children:[i.jsx("div",{className:"h-10 w-full rounded-lg mb-3",style:{backgroundColor:N.color}}),i.jsx("div",{className:"text-sm font-medium text-gray-800",children:Y}),i.jsx("div",{className:"text-xs text-gray-400 mt-0.5",children:ke})]},N.id)})})]}),i.jsxs("section",{children:[i.jsx("h3",{className:"text-sm font-semibold text-gray-800 mb-1",children:y.general.fontSize}),i.jsx("p",{className:"text-xs text-gray-400 mb-4",children:y.general.fontSizeDesc}),i.jsx(Ms,{options:Rm.map(N=>({...N,label:f==="en"?N.labelEn:N.label})),value:d,onChange:h})]}),i.jsxs("section",{children:[i.jsx("h3",{className:"text-sm font-semibold text-gray-800 mb-1",children:y.general.fontFamily}),i.jsx("p",{className:"text-xs text-gray-400 mb-4",children:y.general.fontFamilyDesc}),i.jsx(Ms,{options:Om.map(N=>({...N,label:f==="en"?N.labelEn:N.label})),value:m,onChange:g})]}),i.jsxs("section",{children:[i.jsx("h3",{className:"text-sm font-semibold text-gray-800 mb-1",children:y.general.language}),i.jsx("p",{className:"text-xs text-gray-400 mb-4",children:y.general.languageDesc}),i.jsx(Ms,{options:[{id:"zh",label:"中文"},{id:"en",label:"English"}],value:r,onChange:l})]})]})}function C(){return i.jsxs("div",{className:"space-y-8",children:[i.jsxs("section",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-5",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-sm font-semibold text-gray-800",children:f==="en"?"Agent Mode":"运行模式"}),i.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:t.agentMode==="agent"?f==="en"?"AI Agent with tools (search, calculator, skills, image gen). Only API1 required.":"AI Agent:支持联网搜索、计算器、技能调用、生图等工具":f==="en"?"Image generation + vision review pipeline":"生图模式:翻译 → 生图 → 视觉审核流水线"})]}),i.jsx("button",{type:"button",role:"switch","aria-checked":t.agentMode==="agent",className:"relative inline-flex h-5 w-9 items-center rounded-full transition-colors "+(t.agentMode==="agent"?"theme-bg":"bg-gray-200"),onClick:()=>n({...t,agentMode:t.agentMode==="agent"?"image":"agent"}),children:i.jsx("span",{className:"inline-block h-3.5 w-3.5 transform rounded-full bg-white transition-transform "+(t.agentMode==="agent"?"translate-x-[18px]":"translate-x-[3px]")})})]}),i.jsx("h3",{className:"text-sm font-semibold text-gray-800 mb-3",children:y.models.api}),i.jsx(Am,{config:t,copy:e,onChange:n,onlyGroups:t.agentMode==="agent"?["api1"]:null,defaultOpen:!0})]}),i.jsxs("section",{children:[i.jsx("h3",{className:"text-sm font-semibold text-gray-800 mb-3",children:y.models.generation}),i.jsxs("div",{className:"grid gap-5",children:[i.jsxs("div",{children:[i.jsxs("label",{className:"flex items-center justify-between text-sm",children:[i.jsx("span",{className:"text-gray-700 font-medium",children:e.settings.maxRetry}),i.jsx("input",{type:"number",min:0,max:30,value:t.maxRetry,onChange:N=>n({...t,maxRetry:Math.max(0,Math.min(30,Number(N.target.value)||0))}),className:"w-20 rounded-md border border-gray-300 px-3 py-1.5 text-sm text-gray-900 text-center outline-none focus:border-gray-900"})]}),i.jsx("p",{className:"mt-1 text-xs text-gray-400",children:e.settings.maxRetryDesc})]}),i.jsxs("div",{children:[i.jsxs("label",{className:"flex items-center justify-between text-sm",children:[i.jsx("span",{className:"text-gray-700 font-medium",children:e.settings.maxTokens}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"number",min:0,max:2048,value:t.maxTokens,onChange:N=>n({...t,maxTokens:Math.max(0,Math.min(2048,Number(N.target.value)||0))}),className:"w-20 rounded-md border border-gray-300 px-3 py-1.5 text-sm text-gray-900 text-center outline-none focus:border-gray-900"}),i.jsx("span",{className:"text-xs text-gray-400 w-12",children:t.maxTokens===0?e.settings.unlimited:""})]})]}),i.jsx("p",{className:"mt-1 text-xs text-gray-400",children:e.settings.maxTokensDesc})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-sm text-gray-700 font-medium",children:e.settings.requireConfirmation}),i.jsx("p",{className:"text-xs text-gray-400",children:e.settings.requireConfirmationDesc})]}),i.jsx("button",{type:"button",role:"switch","aria-checked":t.requireConfirmation,className:"relative inline-flex h-5 w-9 items-center rounded-full transition-colors "+(t.requireConfirmation?"theme-bg":"bg-gray-200"),onClick:()=>n({...t,requireConfirmation:!t.requireConfirmation}),children:i.jsx("span",{className:"inline-block h-3.5 w-3.5 transform rounded-full bg-white transition-transform "+(t.requireConfirmation?"translate-x-[18px]":"translate-x-[3px]")})})]})]})]}),i.jsxs("section",{children:[i.jsx("h3",{className:"text-sm font-semibold text-gray-800 mb-3",children:y.models.pipeline}),i.jsxs("div",{className:"grid gap-5",children:[i.jsxs("div",{children:[i.jsxs("label",{className:"flex items-center justify-between text-sm",children:[i.jsx("span",{className:"text-gray-700 font-medium",children:e.settings.temperature}),i.jsx("input",{type:"number",min:0,max:2,step:.1,value:t.temperature,onChange:N=>n({...t,temperature:Math.min(2,Math.max(0,parseFloat(N.target.value)||.7))}),className:"w-20 rounded-md border border-gray-300 px-3 py-1.5 text-sm text-gray-900 text-center outline-none focus:border-gray-900"})]}),i.jsx("p",{className:"mt-1 text-xs text-gray-400",children:e.settings.temperatureDesc})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-sm text-gray-700 font-medium",children:e.settings.enableVisionReview}),i.jsx("p",{className:"text-xs text-gray-400",children:e.settings.enableVisionReviewDesc})]}),i.jsx("button",{type:"button",role:"switch","aria-checked":t.enableVisionReview!==!1,className:"relative inline-flex h-5 w-9 items-center rounded-full transition-colors "+(t.enableVisionReview!==!1?"theme-bg":"bg-gray-200"),onClick:()=>n({...t,enableVisionReview:!t.enableVisionReview}),children:i.jsx("span",{className:"inline-block h-3.5 w-3.5 transform rounded-full bg-white transition-transform "+(t.enableVisionReview!==!1?"translate-x-[18px]":"translate-x-[3px]")})})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("label",{className:"block text-sm",children:[i.jsx("span",{className:"text-gray-700 font-medium mb-1 block",children:e.settings.defaultAspectRatio}),i.jsx("select",{className:"w-full rounded-md border border-gray-300 px-3 py-2 text-sm text-gray-900 outline-none focus:border-gray-900",value:t.defaultAspectRatio,onChange:N=>n({...t,defaultAspectRatio:N.target.value}),children:["1:1","16:9","9:16","4:3"].map(N=>i.jsx("option",{value:N,children:N},N))})]}),i.jsxs("label",{className:"block text-sm",children:[i.jsx("span",{className:"text-gray-700 font-medium mb-1 block",children:e.settings.defaultStyle}),i.jsx("select",{className:"w-full rounded-md border border-gray-300 px-3 py-2 text-sm text-gray-900 outline-none focus:border-gray-900",value:t.defaultStyle,onChange:N=>n({...t,defaultStyle:N.target.value}),children:["None","Realistic","Anime","3D","Cyberpunk","Oil Painting","Watercolor","Pixel Art","Cinematic","Sketch"].map(N=>i.jsx("option",{value:N,children:N},N))})]})]})]})]})]})}function _(){const[N,Z]=I.useState(()=>{try{const F=localStorage.getItem("memi-generation-history");if(!F)return 0;const x=JSON.parse(F);if(!Array.isArray(x))return 0;const P=new Date,T=new Date(P.getFullYear(),P.getMonth(),P.getDate()).getTime();return x.filter(H=>{const U=new Date(H.createdAt).getTime();return U>=T&&U<T+864e5}).length}catch{return 0}}),Y=5,ke=N/Y,b=Math.min(Math.round(ke*10)/10,100);return i.jsxs("div",{className:"space-y-8",children:[i.jsxs("section",{children:[i.jsx("h3",{className:"text-sm font-semibold text-gray-800 mb-3",children:y.data.usage}),i.jsxs("div",{className:"flex items-center justify-between text-sm mb-1.5",children:[i.jsx("span",{className:"text-gray-500",children:e.settings.usageDesc.replace("{count}",N)}),i.jsxs("span",{className:"text-gray-400 text-xs",children:[b,"%"]})]}),i.jsx("div",{className:"h-2 w-full rounded-full bg-gray-100 overflow-hidden",children:i.jsx("div",{className:"h-full rounded-full theme-bg transition-all duration-500",style:{width:b+"%"}})}),i.jsxs("p",{className:"mt-1 text-xs text-gray-300",children:["1% = ",Y," ",e.settings.imagesToday]})]}),i.jsxs("section",{children:[i.jsx("h3",{className:"text-sm font-semibold text-gray-800 mb-3",children:y.data.maxHistory}),i.jsxs("label",{className:"flex items-center justify-between text-sm",children:[i.jsx("span",{className:"text-gray-500",children:e.settings.maxHistoryItems}),i.jsx("input",{type:"number",min:1,max:200,value:t.maxHistoryItems,onChange:F=>n({...t,maxHistoryItems:Math.max(1,Math.min(200,Number(F.target.value)||24))}),className:"w-20 rounded-md border border-gray-300 px-3 py-1.5 text-sm text-gray-900 text-center outline-none focus:border-gray-900"})]}),i.jsx("p",{className:"mt-1 text-xs text-gray-400",children:e.settings.maxHistoryItemsDesc})]}),i.jsx("section",{children:i.jsxs("button",{className:"flex items-center gap-2 rounded-lg border border-gray-300 px-4 py-2 text-sm text-gray-600 hover:border-gray-500 hover:text-gray-800 transition-colors",type:"button",onClick:()=>{window.confirm(e.gallery.confirmClear||"确定要清空所有历史记录吗?")&&(localStorage.removeItem("memi-generation-history"),window.dispatchEvent(new Event("memi-history-cleared")),Z(0))},children:[i.jsx(Mr,{size:14,strokeWidth:1.5}),y.data.clear]})})]})}function L(){return i.jsx("div",{className:"space-y-8",children:i.jsxs("section",{children:[i.jsx("h3",{className:"text-sm font-semibold text-gray-800 mb-1",children:y.memory.title}),i.jsx("p",{className:"text-xs text-gray-400 mb-4",children:y.memory.desc}),i.jsxs("div",{className:"rounded-lg border border-gray-100 bg-gray-50 p-8 text-center",children:[i.jsx(La,{size:36,className:"mx-auto mb-3 text-gray-200",strokeWidth:1}),i.jsx("p",{className:"text-sm text-gray-400",children:y.memory.empty})]})]})})}function K(){const N=y.shortcuts.list||[];return i.jsx("div",{className:"space-y-8",children:i.jsxs("section",{children:[i.jsx("h3",{className:"text-sm font-semibold text-gray-800 mb-1",children:y.shortcuts.title}),i.jsx("p",{className:"text-xs text-gray-400 mb-4",children:y.shortcuts.desc}),i.jsx("div",{className:"rounded-xl border border-gray-100 overflow-hidden",children:N.map((Z,Y)=>i.jsxs("div",{className:"flex items-center justify-between px-5 py-3 text-sm "+(Y<N.length-1?"border-b border-gray-50":""),children:[i.jsx("span",{className:"text-gray-600",children:Z.action}),i.jsx("kbd",{className:"rounded-md border border-gray-200 bg-gray-50 px-2.5 py-1 text-xs font-mono text-gray-500 shadow-sm",children:Z.key})]},Y))})]})})}function A({m:N,lang:Z}){var _e,W;const[Y,ke]=I.useState([]),[b,F]=I.useState(!1),[x,P]=I.useState(""),[T,H]=I.useState("webhook"),[U,ie]=I.useState(""),[Ae,rt]=I.useState(""),[ze,lt]=I.useState(""),[Hn,Yt]=I.useState(!1),[Vn,v]=I.useState(""),[M,D]=I.useState("");async function B(){try{const J=await(await fetch("/api/gateway/connections")).json();J.success&&ke(J.connections||[])}catch{}}function ee(){try{return JSON.parse(localStorage.getItem("memi-connections")||"[]")}catch{return[]}}function X(O){localStorage.setItem("memi-connections",JSON.stringify(O)),ke(O)}I.useEffect(()=>{B()},[]);async function $(){if(x.trim()){try{const J=await(await fetch("/api/gateway/connections",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:x.trim(),channel:T})})).json();if(J.success){if(X([...Y,J.connection]),T==="feishu"){P(""),F(!1),await fetch("/api/gateway/feishu/connect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({appId:Vn,appSecret:M})}),v(""),D("");return}if(T==="openclaw"){F(!1),rt(""),lt(""),Yt(!1),V();return}}}catch{const O="conn_"+Date.now().toString(36),J="memi_"+Math.random().toString(36).slice(2,16),ae={id:O,name:x.trim(),type:T,apiKey:J,webhookUrl:"http://localhost:3001/api/gateway/webhook",createdAt:new Date().toISOString()};X([...ee(),ae])}P(""),F(!1)}}async function V(){try{const J=(await fetch("/api/gateway/openclaw/start",{method:"POST"})).body.getReader(),ae=new TextDecoder;let ge="";for(;;){const{done:Fe,value:dn}=await J.read();if(Fe)break;ge+=ae.decode(dn,{stream:!0});const ne=ge.split(`
208
+ `);ge=ne.pop()||"";for(const ft of ne)if(ft.startsWith("data: "))try{const xe=JSON.parse(ft.slice(6));rt(fn=>fn+`
209
+ `+(xe.message||xe.text||"")),xe.type==="qr"&&lt(xe.text||""),(xe.type==="done"||xe.type==="error"||xe.type==="timeout")&&Yt(!0)}catch{}}}catch(O){rt(J=>J+`
210
+ 连接失败: `+O.message),Yt(!0)}}function Se(O){const J=Y.find(ge=>ge.id===O),ae=(J==null?void 0:J.name)||"";window.confirm((N.mcp.deleteConfirm||"").replace("{name}",ae))&&(fetch(`/api/gateway/connections/${O}`,{method:"DELETE"}).catch(()=>{}),X(Y.filter(ge=>ge.id!==O)))}function pe(O,J){navigator.clipboard.writeText(O).catch(()=>{}),ie(J),setTimeout(()=>ie(""),2e3)}return i.jsxs("div",{className:"space-y-5",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h3",{className:"text-sm font-semibold text-gray-800",children:N.mcp.title}),i.jsxs("button",{className:"theme-bg rounded-lg px-3 py-1.5 text-sm text-white",type:"button",onClick:()=>F(!0),children:["+ ",N.mcp.add]})]}),b&&i.jsxs("div",{className:"rounded-lg border border-gray-200 bg-gray-50 p-3 space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{className:"flex-1 rounded-md border border-gray-200 px-3 py-2 text-sm outline-none",placeholder:N.mcp.namePlaceholder||"输入连接名称",value:x,onChange:O=>P(O.target.value),onKeyDown:O=>{O.key==="Enter"&&$(),O.key==="Escape"&&F(!1)}}),i.jsxs("select",{className:"rounded-md border border-gray-200 px-3 py-2 text-sm outline-none bg-white",value:T,onChange:O=>H(O.target.value),children:[i.jsx("option",{value:"feishu",children:"飞书"}),i.jsx("option",{value:"openclaw",children:"微信 (OpenClaw)"}),i.jsx("option",{value:"webhook",children:"Webhook"}),i.jsx("option",{value:"qq",children:"QQ 桥接"})]})]}),T==="feishu"&&i.jsxs(i.Fragment,{children:[i.jsx("input",{className:"w-full rounded-md border border-gray-200 px-3 py-2 text-sm outline-none",placeholder:"App ID (cli_xxx)",value:Vn,onChange:O=>v(O.target.value)}),i.jsx("input",{className:"w-full rounded-md border border-gray-200 px-3 py-2 text-sm outline-none",placeholder:"App Secret",type:"password",value:M,onChange:O=>D(O.target.value)}),i.jsxs("p",{className:"text-xs text-gray-400",children:["登录 ",i.jsx("a",{href:"https://open.feishu.cn",target:"_blank",className:"underline",children:"open.feishu.cn"})," 创建自建应用 → 开通机器人能力 → 获取凭证"]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{className:"theme-bg rounded-md px-4 py-2 text-sm text-white",onClick:$,children:((_e=N.skills)==null?void 0:_e.save)||"保存"}),i.jsx("button",{className:"rounded-md border border-gray-200 px-4 py-2 text-sm text-gray-500",onClick:()=>{F(!1),v(""),D("")},children:((W=N.skills)==null?void 0:W.cancel)||"取消"})]})]}),(Ae||ze)&&i.jsxs("div",{className:"rounded-xl border border-green-200 bg-green-50 p-4",children:[i.jsx("p",{className:"text-sm font-medium text-green-700 mb-2",children:Hn?ze?"✅ 连接完成":"⚠️ 连接结束":"🔄 正在连接微信..."}),i.jsx("pre",{className:"text-xs text-green-600 whitespace-pre-wrap max-h-48 overflow-y-auto bg-green-100 rounded p-3",children:Ae}),ze&&i.jsxs("div",{className:"mt-3 p-3 bg-white rounded-lg border border-green-200",children:[i.jsx("p",{className:"text-xs font-medium text-green-800 mb-2",children:"📱 请在微信中扫描下面的二维码:"}),i.jsx("pre",{className:"text-xs text-green-700 whitespace-pre font-mono overflow-x-auto",children:ze})]}),Hn&&i.jsx("button",{className:"mt-3 text-xs text-green-600 underline",onClick:()=>{rt(""),lt(""),Yt(!1)},children:Z==="en"?"Dismiss":"关闭"})]}),Y.length===0?i.jsxs("div",{className:"rounded-xl border border-gray-100 bg-gray-50 p-10 text-center",children:[i.jsx(rm,{size:36,className:"mx-auto mb-3 text-gray-200",strokeWidth:1}),i.jsx("p",{className:"text-sm text-gray-400",children:N.mcp.empty})]}):i.jsxs("div",{className:"space-y-3",children:[Y.map(O=>{var J;return i.jsxs("div",{className:"rounded-xl border border-gray-100 bg-white p-4",children:[i.jsxs("div",{className:"flex items-start justify-between mb-3",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-sm font-medium text-gray-800",children:O.name}),i.jsx("span",{className:"ml-2 rounded-full bg-gray-100 px-2 py-0.5 text-xs text-gray-500",children:O.type})]}),i.jsx("button",{className:"text-gray-300 hover:text-red-400 transition-colors",onClick:()=>Se(O.id),title:((J=N.skills)==null?void 0:J.delete)||"删除",children:i.jsx(Mr,{size:14,strokeWidth:1.5})})]}),i.jsxs("div",{className:"space-y-2 text-sm",children:[O.type==="openclaw"?i.jsxs("div",{className:"rounded-md bg-green-50 border border-green-100 p-3",children:[i.jsxs("p",{className:"text-xs text-green-700 font-medium mb-2",children:["💬 ",Z==="en"?"WeChat Connection":"微信连接"]}),i.jsx("p",{className:"text-xs text-green-600 mb-1",children:"1. 终端运行(会生成微信登录二维码):"}),i.jsx("code",{className:"block text-xs text-green-700 bg-green-100 rounded px-2 py-1 mb-2 break-all",children:"npx -y @tencent-weixin/openclaw-weixin-cli@latest install"}),i.jsx("p",{className:"text-xs text-green-600 mb-1",children:"2. 微信扫终端里出现的二维码授权"}),i.jsx("p",{className:"text-xs text-green-600 mb-1",children:"3. 配置 OpenClaw 使用下面的 API 地址:"}),i.jsx("code",{className:"block text-xs text-green-700 bg-green-100 rounded px-2 py-1 break-all",children:"http://localhost:3001/api/v1"})]}):i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-gray-400 text-xs w-20",children:N.mcp.webhookUrl}),i.jsx("code",{className:"flex-1 truncate rounded bg-gray-50 px-2 py-1 text-xs text-gray-600",children:O.webhookUrl}),i.jsx("button",{className:"text-gray-300 hover:text-gray-500",onClick:()=>pe(O.webhookUrl,O.id+"_url"),children:U===O.id+"_url"?i.jsx("span",{className:"text-xs text-green-500",children:N.mcp.copied}):i.jsx(Is,{size:14,strokeWidth:1.5})})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-gray-400 text-xs w-20",children:"API Base URL"}),i.jsx("code",{className:"flex-1 truncate rounded bg-gray-50 px-2 py-1 text-xs text-gray-600",children:"http://localhost:3001/api/v1"}),i.jsx("button",{className:"text-gray-300 hover:text-gray-500",onClick:()=>pe("http://localhost:3001/api/v1",O.id+"_api"),children:U===O.id+"_api"?i.jsx("span",{className:"text-xs text-green-500",children:N.mcp.copied}):i.jsx(Is,{size:14,strokeWidth:1.5})})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-gray-400 text-xs w-20",children:N.mcp.apiKey}),i.jsx("code",{className:"flex-1 truncate rounded bg-gray-50 px-2 py-1 text-xs text-gray-600",children:O.apiKey}),i.jsx("button",{className:"text-gray-300 hover:text-gray-500",onClick:()=>pe(O.apiKey,O.id+"_key"),children:U===O.id+"_key"?i.jsx("span",{className:"text-xs text-green-500",children:N.mcp.copied}):i.jsx(Is,{size:14,strokeWidth:1.5})})]})]})]},O.id)}),i.jsx("div",{className:"rounded-xl border border-gray-100 bg-gray-50 p-4 mt-4",children:i.jsx("p",{className:"text-xs text-gray-400",children:Z==="en"?"Memi provides an OpenAI-compatible API at /api/v1. Any OpenAI-compatible client (OpenClaw, custom bot, etc.) can use this as the LLM backend.":"Memi 提供 OpenAI 兼容的 /api/v1 接口。任何兼容 OpenAI 的客户端都可将其作为 LLM 后端使用。"})})]})]})}const he=[{id:"general",icon:km,label:y.nav.general},{id:"models",icon:Vp,label:y.nav.models},{id:"memory",icon:La,label:y.nav.memory},{id:"billing",icon:Qp,label:y.nav.billing},{id:"shortcuts",icon:tm,label:y.nav.shortcuts},{id:"mcp",icon:ym,label:y.nav.mcp},{id:"skills",icon:rd,label:y.nav.skills},{id:"data",icon:Gp,label:y.nav.data}];return i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/20 backdrop-blur-sm",onClick:N=>{N.target===N.currentTarget&&j()},onKeyDown:N=>{N.key==="Escape"&&j()},tabIndex:-1,ref:c,children:i.jsxs("div",{className:"flex w-full max-w-4xl h-[80vh] mx-4 rounded-2xl bg-white shadow-xl border border-gray-100 overflow-hidden",children:[i.jsxs("nav",{className:"w-52 shrink-0 bg-gray-50 p-4 flex flex-col gap-1 border-r border-gray-100",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4 px-2",children:[i.jsx("h2",{className:"text-sm font-semibold text-gray-700",children:y.title}),i.jsx("button",{type:"button",onClick:j,className:"text-gray-300 hover:text-gray-500 transition-colors",children:i.jsx(Ht,{size:16,strokeWidth:1.5})})]}),he.map(N=>{const Z=N.icon,Y=R===N.id;return i.jsxs("button",{type:"button",className:"flex items-center gap-3 rounded-lg px-3 py-2.5 text-sm transition-colors "+(Y?"theme-bg text-white font-medium":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"),onClick:()=>p(N.id),children:[i.jsx(Z,{size:16,strokeWidth:1.5}),N.label]},N.id)})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[R==="general"&&i.jsx(E,{}),R==="models"&&i.jsx(C,{}),R==="memory"&&i.jsx(L,{}),R==="billing"&&i.jsx(Um,{m:y,lang:f}),R==="shortcuts"&&i.jsx(K,{}),R==="mcp"&&i.jsx(A,{m:y,lang:f}),R==="skills"&&i.jsx(Fm,{m:y,lang:f,skills:w,onSkillsChange:k,navLabel:y.nav.skills}),R==="data"&&i.jsx(_,{})]})]})})}const $a={zh:{appSubtitle:"AI 对话与图片创作工作台",nav:{chat:"对话",studio:"创作",gallery:"作品",settings:"设置"},common:{language:"语言",theme:"主题色",openSettings:"打开设置",resetDefaults:"恢复默认",savedLocally:"已保存到本机浏览器",cancel:"取消",confirm:"确认"},onboarding:{title:"第一次使用 memi,从这里开始",intro:"这不是一个单纯的输入框。memi 会先把你的想法翻译成英文提示词,再调用生图 API,最后让视觉模型审核质量并在失败时重试。",steps:[{title:"检查 API 配置",body:"默认使用本地 Ollama 翻译、Pollinations 生图、NVIDIA NIM 审核。你可以在设置里更换任意一段。"},{title:"写清楚画面",body:"先描述主体、场景、动作和氛围。不要担心英文,API1 会负责翻译。"},{title:"查看审核结果",body:"生成后会显示分数、最终提示词、审核历史和下载入口。"}],multiSteps:[{title:"欢迎使用 memi",body:"这是一个将文字转化为图片的 AI 工具。接下来的几步将帮助你快速上手。你随时可以跳过或关闭此引导。"},{title:"第一步:配置 API",body:"在下面对话框中填入你的 API 地址、密钥和模型名。memi 使用三段独立 API:API1 翻译、API2 生图、API3 审核。"},{title:"第二步:写清楚画面",body:"直接描述你想要的画面——主体、场景、动作、光线。不用写英文,API1 会自动翻译。如果你只想聊天,直接输入文字即可;输入「画/生成 一只猫」这类指令就会进入生图模式。"},{title:"第三步:审核与确认",body:"图片生成后系统会打分并审核质量,低分时自动重试。你可以在设置中开启「执行确认」模式:生图前会先展示润色后的提示词,确认或修改后再生成。"},{title:"准备就绪!",body:"建议先去设置页面检查 API 配置并调整生图参数,然后开始你的第一次创作。"}],start:"开始创作",settings:"去设置",skip:"跳过引导",prev:"上一步",next:"下一步",hide:"不再显示",showAgain:"重新打开新手引导"},studio:{eyebrow:"图片工作台",title:"把一句想法变成一张经过审核的图片。",body:"输入中文或英文都可以。memi 会按顺序完成翻译、生图、视觉审核,并保存成功结果到作品页。",cards:["描述画面","生成图片","审核质量"],checklistTitle:"生成前检查",checklistBody:"如果你是第一次使用,建议先确认 API1、API2、API3 都能访问。",checklist:["API1 负责把原始描述翻译成英文","API2 负责生成图片","API3 负责读取图片并给出审核分数"],loadingTitle:"正在生成",retryingTitle:"正在重试",loadingBody:"正在翻译提示词、生成图片并审核结果。本地模型或远程生图接口可能需要几分钟。"},prompt:{title:"创建图片",body:"描述主体、场景、动作、光线和你不希望出现的内容。",placeholder:"Describe the scene you want to create...",aspectRatio:"画幅比例",style:"风格",characters:"字符",generating:"生成中",generate:"生成图片",presets:["一间安静的阅读室,下午的暖光照在木桌上","极简桌灯的产品摄影,白色背景,柔和阴影","日出时的未来火车站,玻璃穹顶和干净的地面"]},config:{title:"API 配置",labels:{api1:"API1 翻译",api2:"API2 生图",api3:"API3 审核"}},result:{score:"分数",totalTime:"耗时",finalPrompt:"最终提示词",history:"审核历史",round:"轮次",download:"下载图片",copyPrompt:"复制提示词",copied:"已复制",regenerate:"重新生成",reason:"原因",openImage:"打开图片"},gallery:{eyebrow:"作品",title:"最近生成记录",emptyTitle:"还没有作品",emptyBody:"生成成功的图片会出现在这里,包含分数、提示词和时间。",goStudio:"去创作",clear:"清空历史",confirmClear:"确定要清空所有历史记录吗?"},modal:{title:"设置",nav:{general:"通用",models:"模型",memory:"记忆",billing:"账单",mcp:"连接应用",skills:"技能",shortcuts:"快捷键",data:"数据"},general:{title:"通用设置",theme:"主题",themeDesc:"切换深色/浅色模式",dark:"深色",light:"浅色",themeStyle:"主题风格",themeStyleDesc:"选择界面主色调",fontSize:"字体大小",fontSizeDesc:"调整界面文字尺寸",fontFamily:"字体",fontFamilyDesc:"选择界面字体风格",language:"语言",languageDesc:"切换界面显示语言"},models:{title:"模型配置",api:"API 接口",generation:"生成参数",pipeline:"管道控制"},data:{title:"数据管理",usage:"今日生图",maxHistory:"保留作品数",clear:"清空历史"},memory:{title:"记忆",desc:"对话历史与上下文记忆",saveLabel:"保存到记忆",empty:"暂无保存的记忆",maxMemoryItems:"最大记忆条数",autoSave:"自动保存对话"},billing:{title:"账单",desc:"API 用量与费用统计",totalRequests:"总请求数",tokensUsed:"总 Token 消耗",imagesGenerated:"生成图片数",placeholder:"详细账单数据需要后端支持"},skills:{title:"技能管理",desc:"管理和自定义技能模板",add:"添加技能",edit:"编辑技能",delete:"删除",deleteConfirm:"确定要删除技能「{name}」吗?",name:"技能名称",type:"类型",typeLlm:"文本处理",typeImage:"图片生成",description:"描述",promptTemplate:"提示词模板",promptTemplateDesc:"用 {input} 表示用户输入的位置",builtin:"内置",custom:"自定义",empty:"暂无技能,点击上方按钮添加",searchPlaceholder:"搜索技能",searchEmpty:"无匹配技能",save:"保存",cancel:"取消",run:"执行",runSuccess:"已通过技能「{name}」处理"},shortcuts:{title:"快捷键",desc:"键盘快捷键一览",list:[{key:"Enter",action:"发送消息"},{key:"Shift + Enter",action:"换行"},{key:"Ctrl + K",action:"快捷命令面板"},{key:"Escape",action:"关闭弹窗 / 取消"}]},mcp:{title:"连接应用",desc:"通过 Webhook / WebSocket 连接外部应用",add:"添加连接",name:"连接名称",namePlaceholder:"例如:我的 Telegram Bot",deleteConfirm:"确定要删除连接「{name}」吗?",empty:"暂无连接,点击添加创建你的第一个连接",webhookUrl:"Webhook URL",apiKey:"API Key",copied:"已复制",copyKey:"复制 Key",copyUrl:"复制 URL",howToUse:"使用方法",howToUseDesc:'向 Webhook URL POST JSON { message: "你的消息" },Header 携带 x-api-key。Agent 将自动回复。',wsEndpoint:"WebSocket",wsEndpointDesc:"连接 ws://localhost:3001/api/gateway/ws 进行实时对话"}},settings:{appearance:"界面偏好",apiTitle:"模型与接口",usageTitle:"今日生图",usageDesc:"已生成 {count} 张",imagesToday:"张 / 今日",maxRetry:"最大重试次数",maxRetryDesc:"图片有瑕疵时重新生成循环的最多次数",requireConfirmation:"执行确认",requireConfirmationDesc:"API1 润色后提示词,回传用户确认/修改后再执行",maxTokens:"模型 Token 限制",maxTokensDesc:"API1 模型单次输出上限,0 为不限制",unlimited:"不限制",generation:"生成设置",generationDefaults:"图片默认值",defaultAspectRatio:"默认画幅",defaultStyle:"默认风格",pipeline:"管道控制",temperature:"API1 温度",temperatureDesc:"控制 LLM 输出的随机性,0 = 精确,2 = 自由,默认 0.7",enableVisionReview:"视觉审核",enableVisionReviewDesc:"关闭后跳过 API3 质量审核,直接返回生图结果",dataManagement:"数据管理",maxHistoryItems:"保留作品数",maxHistoryItemsDesc:"画册中最多保留的历史生成记录数"},chat:{placeholder:"开始一段与 API1 的对话",inputPlaceholder:"输入消息,Enter 发送,Shift+Enter 换行...",newChat:"新对话",hint:"直接聊天或输入「画/生成/设计 一只猫」即可生图",autoDetect:"自动识别生图意图",deleteChat:"清除当前对话",confirmDelete:"确认清除此对话?",emptyTitle:"新对话",conversations:"对话列表"},commands:{title:"斜杠命令",placeholder:"输入 / 查看可用命令...",help:"可用命令",helpDesc:"在输入框中输入以下命令快速操作",notFound:"未知命令:{cmd}。输入 /help 查看可用命令",items:[{cmd:"/help",desc:"显示此帮助列表"},{cmd:"/clear",desc:"清空当前对话"},{cmd:"/draw <描述>",desc:"强制生成图片(跳过关键词检测)"},{cmd:"/chat <消息>",desc:"强制纯文本聊天"},{cmd:"/skill list",desc:"列出所有可用技能"},{cmd:"/skill run <名称>",desc:"执行指定技能"},{cmd:"/import_skill <URL>",desc:"从 GitHub 链接导入技能"}]},errors:{generationFailed:"生成失败",requestFailed:"请求失败"}},en:{appSubtitle:"AI Chat & Image Creation Workspace",nav:{chat:"Chat",studio:"Studio",gallery:"Gallery",settings:"Settings"},common:{language:"Language",theme:"Theme",openSettings:"Open Settings",resetDefaults:"Restore defaults",savedLocally:"Saved locally in this browser",cancel:"Cancel",confirm:"Confirm"},onboarding:{title:"Start here if this is your first run",intro:"Memi translates your idea, generates an image, reviews it with a vision model, and retries when the score is low.",steps:[{title:"Check API settings",body:"The default pipeline uses Ollama, Pollinations, and NVIDIA NIM. Each stage can be changed."},{title:"Write the scene",body:"Describe the subject, setting, action, and mood. API1 handles translation."},{title:"Review the result",body:"After generation, you get the score, final prompt, review history, and download link."}],multiSteps:[{title:"Welcome to memi",body:"This tool turns text into AI-generated images with quality review. The following steps will help you get started. You can skip or close this guide at any time."},{title:"Step 1: Configure APIs",body:"Fill in your API endpoints, keys, and model names below. Memi uses three separate APIs: API1 translates, API2 generates images, API3 reviews quality."},{title:"Step 2: Describe the scene",body:"Describe your desired image—subject, setting, action, lighting. No need for English; API1 will translate automatically. For normal chat just type freely; try 'draw/generate a cat' to trigger image generation."},{title:"Step 3: Review & Confirm",body:"After generation the system scores and reviews quality, auto-retrying on low scores. Enable 'Execution Confirmation' in Settings to review and edit polished prompts before generation."},{title:"All set!",body:"Visit Settings to check your API configuration and adjust generation parameters, then start creating."}],start:"Start Creating",settings:"Go to Settings",skip:"Skip guide",prev:"Back",next:"Next",hide:"Hide guide",showAgain:"Show onboarding again"},studio:{eyebrow:"Image Studio",title:"Turn one idea into a reviewed image.",body:"Write in Chinese or English. Memi translates, generates, reviews, and saves successful results to Gallery.",cards:["Describe","Generate","Review"],checklistTitle:"Before generation",checklistBody:"For first use, confirm API1, API2, and API3 are reachable.",checklist:["API1 translates the prompt","API2 creates the image","API3 reviews the image"],loadingTitle:"Generation in progress",retryingTitle:"Retrying",loadingBody:"Memi is translating the prompt, generating the image, and reviewing the result. This can take a few minutes."},prompt:{title:"Create Image",body:"Describe the subject, setting, action, lighting, and constraints.",placeholder:"Describe the scene you want to create...",aspectRatio:"Aspect Ratio",style:"Style",characters:"characters",generating:"Generating...",generate:"Generate",presets:["A quiet reading room with warm afternoon light","A product photo of a minimalist desk lamp","A futuristic train station at sunrise"]},config:{title:"API Configuration",labels:{api1:"API1 Translation",api2:"API2 Image",api3:"API3 Review"}},result:{score:"Score",totalTime:"Total Time",finalPrompt:"Final Prompt",history:"Review History",round:"Round",download:"Download",copyPrompt:"Copy Prompt",copied:"Copied",regenerate:"Regenerate",reason:"Reason",openImage:"Open Image"},gallery:{eyebrow:"Gallery",title:"Recent generations",emptyTitle:"No images yet",emptyBody:"Generated images will appear here with their score, prompt, and timing.",goStudio:"Go to Studio",clear:"Clear History",confirmClear:"Clear all history? This cannot be undone."},modal:{title:"Settings",nav:{general:"General",models:"Models",memory:"Memory",billing:"Billing",mcp:"Connected Apps",skills:"Skills",shortcuts:"Shortcuts",data:"Data"},general:{title:"General Settings",theme:"Theme",themeDesc:"Toggle dark/light mode",dark:"Dark",light:"Light",themeStyle:"Theme Style",themeStyleDesc:"Choose your accent color",fontSize:"Font Size",fontSizeDesc:"Adjust the text size",fontFamily:"Font Family",fontFamilyDesc:"Select the font style",language:"Language",languageDesc:"Switch display language"},models:{title:"Model Configuration",api:"API Endpoints",generation:"Generation Settings",pipeline:"Pipeline"},data:{title:"Data Management",usage:"Today's Usage",maxHistory:"Max History Items",clear:"Clear History"},memory:{title:"Memory",desc:"Conversation history & context memory",saveLabel:"Save to Memory",empty:"No saved memories yet",maxMemoryItems:"Max Memory Items",autoSave:"Auto-save conversations"},billing:{title:"Billing",desc:"API usage & cost statistics",totalRequests:"Total Requests",tokensUsed:"Total Tokens",imagesGenerated:"Images Generated",placeholder:"Detailed billing requires backend support"},skills:{title:"Skills",desc:"Manage and customize skill templates",add:"Add Skill",edit:"Edit Skill",delete:"Delete",deleteConfirm:'Delete skill "{name}"?',name:"Skill Name",type:"Type",typeLlm:"Text",typeImage:"Image",description:"Description",promptTemplate:"Prompt Template",promptTemplateDesc:"Use {input} as placeholder for user input",builtin:"Built-in",custom:"Custom",empty:"No skills yet. Click Add to create one.",searchPlaceholder:"Search skills",searchEmpty:"No matching skills",save:"Save",cancel:"Cancel",run:"Run",runSuccess:'Skill "{name}" executed'},shortcuts:{title:"Shortcuts",desc:"Keyboard shortcuts overview",list:[{key:"Enter",action:"Send message"},{key:"Shift + Enter",action:"New line"},{key:"Ctrl + K",action:"Command palette"},{key:"Escape",action:"Close modal / Cancel"}]},mcp:{title:"Connected Apps",desc:"Connect external apps via Webhook / WebSocket",add:"Add Connection",name:"Connection Name",namePlaceholder:"e.g. My Telegram Bot",deleteConfirm:'Delete connection "{name}"?',empty:"No connections yet. Click Add to create one.",webhookUrl:"Webhook URL",apiKey:"API Key",copied:"Copied",copyKey:"Copy Key",copyUrl:"Copy URL",howToUse:"How to Use",howToUseDesc:'POST JSON { message: "your text" } to the Webhook URL with x-api-key header. The Agent will reply automatically.',wsEndpoint:"WebSocket",wsEndpointDesc:"Connect to ws://localhost:3001/api/gateway/ws for real-time chat"}},settings:{appearance:"Appearance",apiTitle:"Models and APIs",usageTitle:"Today's Usage",usageDesc:"{count} images generated",imagesToday:"images / today",maxRetry:"Max Retry Rounds",maxRetryDesc:"Max rounds to retry when image has defects",requireConfirmation:"Execution Confirmation",requireConfirmationDesc:"Show polished prompt for user confirmation before generation",maxTokens:"Token Limit",maxTokensDesc:"Max output tokens for API1 model, 0 = unlimited",unlimited:"Unlimited",generation:"Generation Settings",generationDefaults:"Image Defaults",defaultAspectRatio:"Default Aspect Ratio",defaultStyle:"Default Style",pipeline:"Pipeline",temperature:"API1 Temperature",temperatureDesc:"Controls LLM randomness: 0 = precise, 2 = creative, default 0.7",enableVisionReview:"Vision Review",enableVisionReviewDesc:"Skip API3 quality review when disabled — returns raw generation result",dataManagement:"Data Management",maxHistoryItems:"Max History Items",maxHistoryItemsDesc:"Max number of generations kept in the gallery"},chat:{placeholder:"Start a conversation with API1",inputPlaceholder:"Type a message, Enter to send, Shift+Enter for newline...",newChat:"New Chat",hint:"Chat freely, or type 'draw/generate/create a cat' to make an image",autoDetect:"Auto-detect image intent",deleteChat:"Clear current chat",confirmDelete:"Clear this conversation?",emptyTitle:"New Chat",conversations:"Conversations"},commands:{title:"Slash Commands",placeholder:"Type / to see available commands...",help:"Available Commands",helpDesc:"Type these commands in the chat input",notFound:"Unknown command: {cmd}. Type /help for available commands",items:[{cmd:"/help",desc:"Show this help"},{cmd:"/clear",desc:"Clear current conversation"},{cmd:"/draw <prompt>",desc:"Force image generation (skip keyword detection)"},{cmd:"/chat <message>",desc:"Force text-only chat"},{cmd:"/skill list",desc:"List all available skills"},{cmd:"/skill run <name>",desc:"Execute a skill"},{cmd:"/import_skill <URL>",desc:"Import skill from GitHub URL"}]},errors:{generationFailed:"Generation failed",requestFailed:"Request failed"}}},Wm=[{id:"chat",icon:$l},{id:"gallery",icon:Zp},{id:"settings",icon:vm}];function Pi(){var e;return((e=crypto.randomUUID)==null?void 0:e.call(crypto))||Date.now().toString(36)+Math.random().toString(36).slice(2)}function rl(e,t){try{return localStorage.getItem(e)||t}catch{return t}}function Hm(){try{const e=localStorage.getItem("memi-api-config"),t=e?JSON.parse(e):er;return t.maxRetry==null&&(t.maxRetry=er.maxRetry),t.requireConfirmation==null&&(t.requireConfirmation=er.requireConfirmation),t.maxTokens==null&&(t.maxTokens=er.maxTokens),t}catch{return{...er}}}function Vm(){var t;const e=localStorage.getItem("memi-chat-history");if(!e)return[];try{const n=JSON.parse(e);return localStorage.removeItem("memi-chat-history"),!Array.isArray(n)||n.length===0?[]:[{id:Pi(),title:(t=n[0])!=null&&t.content?n[0].content.slice(0,28)+(n[0].content.length>28?"…":""):"新对话",messages:n,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}]}catch{return[]}}function Bm(){try{const e=localStorage.getItem("memi-conversations");if(e){const t=JSON.parse(e);if(Array.isArray(t)&&t.length>0)return t}}catch{}return Vm()}function Qm(e){var t;try{const n=localStorage.getItem("memi-active-conversation");if(n&&e.some(r=>r.id===n))return n}catch{}return((t=e[0])==null?void 0:t.id)||null}function tr(e){try{localStorage.setItem("memi-conversations",JSON.stringify(e))}catch(t){console.warn("Failed to persist conversations",t)}}function ll(e){try{localStorage.setItem("memi-active-conversation",e)}catch{}}function Wa(){try{const e=localStorage.getItem("memi-skills");if(e)return JSON.parse(e)}catch{}return localStorage.setItem("memi-skills",JSON.stringify(Ua)),Ua}function Km(){const[e,t]=I.useState("chat"),[n,r]=I.useState(()=>rl("memi-language","zh")),[l,s]=I.useState(()=>rl("memi-theme-style","sandstone")),[o,a]=I.useState(()=>rl("memi-theme-mode","light")),[u,d]=I.useState(Hm),[h,m]=I.useState(Bm),[g,w]=I.useState(null),[k,j]=I.useState(()=>rl("memi-onboarded","")===""),[R,p]=I.useState(0),[c,f]=I.useState(!1),[y,E]=I.useState(Wa),C=$a[n]||$a.zh,_=I.useMemo(()=>Ei.find(x=>x.id===l)||Ei[0],[l]);I.useEffect(()=>{localStorage.setItem("memi-api-config",JSON.stringify(u))},[u]),I.useEffect(()=>{localStorage.setItem("memi-language",n)},[n]),I.useEffect(()=>{localStorage.setItem("memi-theme-style",l)},[l]),I.useEffect(()=>{localStorage.setItem("memi-theme-mode",o)},[o]),I.useEffect(()=>{localStorage.setItem("memi-skills",JSON.stringify(y))},[y]),I.useEffect(()=>{function x(){E(Wa())}return window.addEventListener("memi-skills-changed",x),()=>window.removeEventListener("memi-skills-changed",x)},[]),I.useEffect(()=>{document.documentElement.style.setProperty("--theme-color",_.color),document.documentElement.style.setProperty("--theme-hover",_.hover),document.documentElement.dataset.theme=o},[_,o]),I.useEffect(()=>{if(!g&&h.length>0){const x=Qm(h);w(x),x&&ll(x)}},[h]),I.useEffect(()=>{g&&ll(g)},[g]);function L(x){d(x)}function K(x,P){m(T=>{const H=T.map(U=>U.id===x?P(U):U);return tr(H),H})}function A(){const x={id:Pi(),title:"新对话",messages:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};m(P=>{const T=[x,...P];return tr(T),T}),w(x.id)}function he(x){const P={id:Pi(),title:x.length>28?x.slice(0,28)+"…":x,messages:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};return m(T=>{const H=[P,...T];return tr(H),H}),w(P.id),ll(P.id),P.id}function N(x){w(x)}function Z(x,P){var H;P.stopPropagation();const T=h.filter(U=>U.id!==x);if(T.length===0){m([]),tr([]),w(null);return}if(m(T),tr(T),x===g){const U=((H=T[0])==null?void 0:H.id)||null;w(U),U&&ll(U)}}function Y(){j(!1),p(0);try{localStorage.setItem("memi-onboarded","1")}catch{}}function ke(){const x=C.onboarding.multiSteps;R<x.length-1&&p(P=>P+1)}function b(){R>0&&p(x=>x-1)}function F(){Y(),f(!0)}return i.jsxs("div",{className:"h-screen bg-white text-gray-900 flex overflow-hidden",children:[i.jsxs("aside",{className:"flex w-64 flex-col h-full border-r border-gray-100 bg-gray-50",children:[i.jsxs("div",{className:"flex items-center gap-2 px-4 h-14 border-b border-gray-100",children:[i.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg theme-bg",children:i.jsx($l,{size:16,className:"text-white"})}),i.jsx("span",{className:"font-semibold text-sm",children:"memi"})]}),i.jsx("div",{className:"px-3 pt-3 pb-2",children:i.jsxs("button",{className:"flex w-full items-center justify-center gap-2 rounded-lg border border-gray-200 bg-white px-3 py-2.5 text-sm text-gray-700 hover:bg-gray-50 transition-colors",type:"button",onClick:A,children:[i.jsx(nd,{size:16,strokeWidth:1.5}),i.jsx("span",{children:C.chat.newChat})]})}),i.jsxs("div",{className:"flex-1 overflow-y-auto px-3 pb-3 space-y-0.5",children:[h.length===0&&i.jsx("p",{className:"text-xs text-gray-300 text-center pt-8",children:C.chat.placeholder}),h.map(x=>i.jsxs("div",{className:"group flex items-center gap-2 rounded-lg px-3 py-2 text-sm cursor-pointer transition-colors "+(x.id===g?"bg-white text-gray-900 shadow-sm border border-gray-200":"text-gray-500 hover:bg-white hover:text-gray-700"),onClick:()=>N(x.id),children:[i.jsx(im,{size:14,strokeWidth:1.5,className:"flex-shrink-0 text-gray-300"}),i.jsx("span",{className:"truncate flex-1",children:x.title}),i.jsx("button",{className:"flex-shrink-0 opacity-0 group-hover:opacity-100 text-gray-300 hover:text-gray-500 transition-all",onClick:P=>Z(x.id,P),type:"button",title:C.chat.deleteChat,children:i.jsx(Mr,{size:12,strokeWidth:1.5})})]},x.id))]}),i.jsx("nav",{className:"flex-shrink-0 border-t border-gray-100 px-3 py-3 flex items-center justify-around",children:Wm.map(x=>{const P=x.icon,T=e===x.id||x.id==="chat"&&e==="chat";return i.jsxs("button",{className:"flex items-center gap-2 rounded-lg px-3 py-2 text-xs transition "+(T?"theme-bg text-white":"text-gray-400 hover:text-gray-600"),type:"button",onClick:()=>x.id==="settings"?f(!0):t(x.id),children:[i.jsx(P,{size:16,strokeWidth:1.5}),i.jsx("span",{children:C.nav[x.id]})]},x.id)})})]}),i.jsxs("div",{className:"flex-1 flex flex-col min-w-0 overflow-y-auto",children:[e==="chat"&&i.jsx(Mm,{copy:C,config:u,skills:y,onConfigChange:L,conversations:h,activeConvId:g,updateConv:K,createConv:he}),e==="studio"&&null,e==="gallery"&&i.jsx(Dm,{copy:C,onNavigate:t}),e==="settings"&&null]}),c&&i.jsx($m,{copy:C,config:u,onConfigChange:L,language:n,onLanguageChange:r,themeStyle:l,onThemeStyleChange:s,themeMode:o,onThemeModeChange:a,fontSize:"medium",onFontSizeChange:()=>{},fontFamily:"sans",onFontFamilyChange:()=>{},skills:y,onSkillsChange:E,onClose:()=>f(!1)}),k&&(()=>{const x=C.onboarding.multiSteps,P=x[R],T=R===0,H=R===x.length-1;return i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30 backdrop-blur-sm",children:i.jsxs("div",{className:"w-full max-w-md mx-4 rounded-2xl border border-gray-100 bg-white p-6 shadow-xl",children:[i.jsxs("div",{className:"flex items-center justify-between mb-5",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg theme-bg",children:i.jsx($l,{size:16,className:"text-white"})}),i.jsx("span",{className:"font-semibold",children:"memi"})]}),i.jsx("button",{type:"button",onClick:Y,className:"text-gray-300 hover:text-gray-500 transition-colors",children:i.jsx(Ht,{size:18,strokeWidth:1.5})})]}),i.jsx("div",{className:"flex gap-1 mb-5",children:x.map((U,ie)=>i.jsx("div",{className:`h-1 flex-1 rounded-full transition-colors ${ie<=R?"theme-bg":"bg-gray-100"}`},ie))}),i.jsxs("div",{className:"flex gap-4",children:[i.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full theme-bg text-white text-sm font-semibold",children:R+1}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("h3",{className:"text-base font-semibold text-gray-900 mb-1",children:P.title}),i.jsx("p",{className:"text-sm text-gray-500 leading-relaxed",children:P.body}),R===1&&i.jsx("div",{className:"mt-4 space-y-3 max-h-56 overflow-y-auto",children:["api1","api2","api3"].map(U=>i.jsxs("div",{className:"rounded-lg border border-gray-100 bg-gray-50 p-3",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("span",{className:"text-xs font-semibold text-gray-700",children:C.config.labels[U]}),i.jsx("span",{className:"text-xs text-gray-400",children:u[U].model||"—"})]}),["baseUrl","apiKey","model"].map(ie=>i.jsxs("label",{className:"flex items-center gap-2 text-xs text-gray-500 mb-1.5 last:mb-0",children:[i.jsx("span",{className:"w-14 shrink-0",children:ie}),i.jsx("input",{className:"flex-1 rounded-md border border-gray-200 bg-white px-2 py-1.5 text-xs text-gray-800 outline-none focus:border-gray-400 transition-colors",value:u[U][ie],type:ie==="apiKey"?"password":"text",onChange:Ae=>L({...u,[U]:{...u[U],[ie]:Ae.target.value}})})]},ie))]},U))})]})]}),i.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[i.jsx("div",{children:!T&&i.jsx("button",{className:"rounded-lg border border-gray-200 px-4 py-2 text-sm text-gray-500 hover:text-gray-700 hover:bg-gray-50 transition-colors",type:"button",onClick:b,children:C.onboarding.prev})}),i.jsx("div",{className:"flex items-center gap-2",children:H?i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"rounded-lg border border-gray-200 px-4 py-2 text-sm text-gray-500 hover:text-gray-700 hover:bg-gray-50 transition-colors",type:"button",onClick:Y,children:C.onboarding.start}),i.jsx("button",{className:"rounded-lg theme-bg text-white px-5 py-2 text-sm font-medium hover:opacity-90 transition-opacity",type:"button",onClick:F,children:C.onboarding.settings})]}):i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"rounded-lg px-4 py-2 text-sm text-gray-400 hover:text-gray-600 transition-colors",type:"button",onClick:Y,children:C.onboarding.skip}),i.jsx("button",{className:"rounded-lg theme-bg text-white px-5 py-2 text-sm font-medium hover:opacity-90 transition-opacity",type:"button",onClick:ke,children:C.onboarding.next})]})})]})]})})})()]})}zs.createRoot(document.getElementById("root")).render(i.jsx(kd.StrictMode,{children:i.jsx(Km,{})}));