Files
soul-yongping/soul-admin/dist/assets/index-V947pMyG.js

496 lines
618 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

function cv(s,a){for(var l=0;l<a.length;l++){const o=a[l];if(typeof o!="string"&&!Array.isArray(o)){for(const c in o)if(c!=="default"&&!(c in s)){const d=Object.getOwnPropertyDescriptor(o,c);d&&Object.defineProperty(s,c,d.get?d:{enumerable:!0,get:()=>o[c]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&o(h)}).observe(document,{childList:!0,subtree:!0});function l(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function o(c){if(c.ep)return;c.ep=!0;const d=l(c);fetch(c.href,d)}})();function Nx(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var hd={exports:{}},al={},fd={exports:{}},Ye={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var um;function dv(){if(um)return Ye;um=1;var s=Symbol.for("react.element"),a=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.iterator;function C(M){return M===null||typeof M!="object"?null:(M=v&&M[v]||M["@@iterator"],typeof M=="function"?M:null)}var P={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,S={};function b(M,O,F){this.props=M,this.context=O,this.refs=S,this.updater=F||P}b.prototype.isReactComponent={},b.prototype.setState=function(M,O){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,O,"setState")},b.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function N(){}N.prototype=b.prototype;function E(M,O,F){this.props=M,this.context=O,this.refs=S,this.updater=F||P}var j=E.prototype=new N;j.constructor=E,T(j,b.prototype),j.isPureReactComponent=!0;var R=Array.isArray,B=Object.prototype.hasOwnProperty,U={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function L(M,O,F){var X,H={},ue=null,K=null;if(O!=null)for(X in O.ref!==void 0&&(K=O.ref),O.key!==void 0&&(ue=""+O.key),O)B.call(O,X)&&!k.hasOwnProperty(X)&&(H[X]=O[X]);var ye=arguments.length-2;if(ye===1)H.children=F;else if(1<ye){for(var ge=Array(ye),D=0;D<ye;D++)ge[D]=arguments[D+2];H.children=ge}if(M&&M.defaultProps)for(X in ye=M.defaultProps,ye)H[X]===void 0&&(H[X]=ye[X]);return{$$typeof:s,type:M,key:ue,ref:K,props:H,_owner:U.current}}function _(M,O){return{$$typeof:s,type:M.type,key:O,ref:M.ref,props:M.props,_owner:M._owner}}function se(M){return typeof M=="object"&&M!==null&&M.$$typeof===s}function le(M){var O={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(F){return O[F]})}var ie=/\/+/g;function ee(M,O){return typeof M=="object"&&M!==null&&M.key!=null?le(""+M.key):O.toString(36)}function G(M,O,F,X,H){var ue=typeof M;(ue==="undefined"||ue==="boolean")&&(M=null);var K=!1;if(M===null)K=!0;else switch(ue){case"string":case"number":K=!0;break;case"object":switch(M.$$typeof){case s:case a:K=!0}}if(K)return K=M,H=H(K),M=X===""?"."+ee(K,0):X,R(H)?(F="",M!=null&&(F=M.replace(ie,"$&/")+"/"),G(H,O,F,"",function(D){return D})):H!=null&&(se(H)&&(H=_(H,F+(!H.key||K&&K.key===H.key?"":(""+H.key).replace(ie,"$&/")+"/")+M)),O.push(H)),1;if(K=0,X=X===""?".":X+":",R(M))for(var ye=0;ye<M.length;ye++){ue=M[ye];var ge=X+ee(ue,ye);K+=G(ue,O,F,ge,H)}else if(ge=C(M),typeof ge=="function")for(M=ge.call(M),ye=0;!(ue=M.next()).done;)ue=ue.value,ge=X+ee(ue,ye++),K+=G(ue,O,F,ge,H);else if(ue==="object")throw O=String(M),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.");return K}function Q(M,O,F){if(M==null)return M;var X=[],H=0;return G(M,X,"","",function(ue){return O.call(F,ue,H++)}),X}function ce(M){if(M._status===-1){var O=M._result;O=O(),O.then(function(F){(M._status===0||M._status===-1)&&(M._status=1,M._result=F)},function(F){(M._status===0||M._status===-1)&&(M._status=2,M._result=F)}),M._status===-1&&(M._status=0,M._result=O)}if(M._status===1)return M._result.default;throw M._result}var re={current:null},A={transition:null},ne={ReactCurrentDispatcher:re,ReactCurrentBatchConfig:A,ReactCurrentOwner:U};function W(){throw Error("act(...) is not supported in production builds of React.")}return Ye.Children={map:Q,forEach:function(M,O,F){Q(M,function(){O.apply(this,arguments)},F)},count:function(M){var O=0;return Q(M,function(){O++}),O},toArray:function(M){return Q(M,function(O){return O})||[]},only:function(M){if(!se(M))throw Error("React.Children.only expected to receive a single React element child.");return M}},Ye.Component=b,Ye.Fragment=l,Ye.Profiler=c,Ye.PureComponent=E,Ye.StrictMode=o,Ye.Suspense=p,Ye.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ne,Ye.act=W,Ye.cloneElement=function(M,O,F){if(M==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+M+".");var X=T({},M.props),H=M.key,ue=M.ref,K=M._owner;if(O!=null){if(O.ref!==void 0&&(ue=O.ref,K=U.current),O.key!==void 0&&(H=""+O.key),M.type&&M.type.defaultProps)var ye=M.type.defaultProps;for(ge in O)B.call(O,ge)&&!k.hasOwnProperty(ge)&&(X[ge]=O[ge]===void 0&&ye!==void 0?ye[ge]:O[ge])}var ge=arguments.length-2;if(ge===1)X.children=F;else if(1<ge){ye=Array(ge);for(var D=0;D<ge;D++)ye[D]=arguments[D+2];X.children=ye}return{$$typeof:s,type:M.type,key:H,ref:ue,props:X,_owner:K}},Ye.createContext=function(M){return M={$$typeof:h,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},M.Provider={$$typeof:d,_context:M},M.Consumer=M},Ye.createElement=L,Ye.createFactory=function(M){var O=L.bind(null,M);return O.type=M,O},Ye.createRef=function(){return{current:null}},Ye.forwardRef=function(M){return{$$typeof:m,render:M}},Ye.isValidElement=se,Ye.lazy=function(M){return{$$typeof:g,_payload:{_status:-1,_result:M},_init:ce}},Ye.memo=function(M,O){return{$$typeof:y,type:M,compare:O===void 0?null:O}},Ye.startTransition=function(M){var O=A.transition;A.transition={};try{M()}finally{A.transition=O}},Ye.unstable_act=W,Ye.useCallback=function(M,O){return re.current.useCallback(M,O)},Ye.useContext=function(M){return re.current.useContext(M)},Ye.useDebugValue=function(){},Ye.useDeferredValue=function(M){return re.current.useDeferredValue(M)},Ye.useEffect=function(M,O){return re.current.useEffect(M,O)},Ye.useId=function(){return re.current.useId()},Ye.useImperativeHandle=function(M,O,F){return re.current.useImperativeHandle(M,O,F)},Ye.useInsertionEffect=function(M,O){return re.current.useInsertionEffect(M,O)},Ye.useLayoutEffect=function(M,O){return re.current.useLayoutEffect(M,O)},Ye.useMemo=function(M,O){return re.current.useMemo(M,O)},Ye.useReducer=function(M,O,F){return re.current.useReducer(M,O,F)},Ye.useRef=function(M){return re.current.useRef(M)},Ye.useState=function(M){return re.current.useState(M)},Ye.useSyncExternalStore=function(M,O,F){return re.current.useSyncExternalStore(M,O,F)},Ye.useTransition=function(){return re.current.useTransition()},Ye.version="18.3.1",Ye}var hm;function au(){return hm||(hm=1,fd.exports=dv()),fd.exports}/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var fm;function uv(){if(fm)return al;fm=1;var s=au(),a=Symbol.for("react.element"),l=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,c=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function h(m,p,y){var g,v={},C=null,P=null;y!==void 0&&(C=""+y),p.key!==void 0&&(C=""+p.key),p.ref!==void 0&&(P=p.ref);for(g in p)o.call(p,g)&&!d.hasOwnProperty(g)&&(v[g]=p[g]);if(m&&m.defaultProps)for(g in p=m.defaultProps,p)v[g]===void 0&&(v[g]=p[g]);return{$$typeof:a,type:m,key:C,ref:P,props:v,_owner:c.current}}return al.Fragment=l,al.jsx=h,al.jsxs=h,al}var mm;function hv(){return mm||(mm=1,hd.exports=uv()),hd.exports}var e=hv(),f=au();const Us=Nx(f),uo=cv({__proto__:null,default:Us},[f]);var Di={},md={exports:{}},lr={},xd={exports:{}},pd={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var xm;function fv(){return xm||(xm=1,(function(s){function a(A,ne){var W=A.length;A.push(ne);e:for(;0<W;){var M=W-1>>>1,O=A[M];if(0<c(O,ne))A[M]=ne,A[W]=O,W=M;else break e}}function l(A){return A.length===0?null:A[0]}function o(A){if(A.length===0)return null;var ne=A[0],W=A.pop();if(W!==ne){A[0]=W;e:for(var M=0,O=A.length,F=O>>>1;M<F;){var X=2*(M+1)-1,H=A[X],ue=X+1,K=A[ue];if(0>c(H,W))ue<O&&0>c(K,H)?(A[M]=K,A[ue]=W,M=ue):(A[M]=H,A[X]=W,M=X);else if(ue<O&&0>c(K,W))A[M]=K,A[ue]=W,M=ue;else break e}}return ne}function c(A,ne){var W=A.sortIndex-ne.sortIndex;return W!==0?W:A.id-ne.id}if(typeof performance=="object"&&typeof performance.now=="function"){var d=performance;s.unstable_now=function(){return d.now()}}else{var h=Date,m=h.now();s.unstable_now=function(){return h.now()-m}}var p=[],y=[],g=1,v=null,C=3,P=!1,T=!1,S=!1,b=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function j(A){for(var ne=l(y);ne!==null;){if(ne.callback===null)o(y);else if(ne.startTime<=A)o(y),ne.sortIndex=ne.expirationTime,a(p,ne);else break;ne=l(y)}}function R(A){if(S=!1,j(A),!T)if(l(p)!==null)T=!0,ce(B);else{var ne=l(y);ne!==null&&re(R,ne.startTime-A)}}function B(A,ne){T=!1,S&&(S=!1,N(L),L=-1),P=!0;var W=C;try{for(j(ne),v=l(p);v!==null&&(!(v.expirationTime>ne)||A&&!le());){var M=v.callback;if(typeof M=="function"){v.callback=null,C=v.priorityLevel;var O=M(v.expirationTime<=ne);ne=s.unstable_now(),typeof O=="function"?v.callback=O:v===l(p)&&o(p),j(ne)}else o(p);v=l(p)}if(v!==null)var F=!0;else{var X=l(y);X!==null&&re(R,X.startTime-ne),F=!1}return F}finally{v=null,C=W,P=!1}}var U=!1,k=null,L=-1,_=5,se=-1;function le(){return!(s.unstable_now()-se<_)}function ie(){if(k!==null){var A=s.unstable_now();se=A;var ne=!0;try{ne=k(!0,A)}finally{ne?ee():(U=!1,k=null)}}else U=!1}var ee;if(typeof E=="function")ee=function(){E(ie)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,Q=G.port2;G.port1.onmessage=ie,ee=function(){Q.postMessage(null)}}else ee=function(){b(ie,0)};function ce(A){k=A,U||(U=!0,ee())}function re(A,ne){L=b(function(){A(s.unstable_now())},ne)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(A){A.callback=null},s.unstable_continueExecution=function(){T||P||(T=!0,ce(B))},s.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<A?Math.floor(1e3/A):5},s.unstable_getCurrentPriorityLevel=function(){return C},s.unstable_getFirstCallbackNode=function(){return l(p)},s.unstable_next=function(A){switch(C){case 1:case 2:case 3:var ne=3;break;default:ne=C}var W=C;C=ne;try{return A()}finally{C=W}},s.unstable_pauseExecution=function(){},s.unstable_requestPaint=function(){},s.unstable_runWithPriority=function(A,ne){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var W=C;C=A;try{return ne()}finally{C=W}},s.unstable_scheduleCallback=function(A,ne,W){var M=s.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?M+W:M):W=M,A){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=W+O,A={id:g++,callback:ne,priorityLevel:A,startTime:W,expirationTime:O,sortIndex:-1},W>M?(A.sortIndex=W,a(y,A),l(p)===null&&A===l(y)&&(S?(N(L),L=-1):S=!0,re(R,W-M))):(A.sortIndex=O,a(p,A),T||P||(T=!0,ce(B))),A},s.unstable_shouldYield=le,s.unstable_wrapCallback=function(A){var ne=C;return function(){var W=C;C=ne;try{return A.apply(this,arguments)}finally{C=W}}}})(pd)),pd}var pm;function mv(){return pm||(pm=1,xd.exports=fv()),xd.exports}/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var gm;function xv(){if(gm)return lr;gm=1;var s=au(),a=mv();function l(t){for(var r="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)r+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,c={};function d(t,r){h(t,r),h(t+"Capture",r)}function h(t,r){for(c[t]=r,t=0;t<r.length;t++)o.add(r[t])}var m=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,y=/^[: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]*$/,g={},v={};function C(t){return p.call(v,t)?!0:p.call(g,t)?!1:y.test(t)?v[t]=!0:(g[t]=!0,!1)}function P(t,r,n,i){if(n!==null&&n.type===0)return!1;switch(typeof r){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function T(t,r,n,i){if(r===null||typeof r>"u"||P(t,r,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!r;case 4:return r===!1;case 5:return isNaN(r);case 6:return isNaN(r)||1>r}return!1}function S(t,r,n,i,u,x,w){this.acceptsBooleans=r===2||r===3||r===4,this.attributeName=i,this.attributeNamespace=u,this.mustUseProperty=n,this.propertyName=t,this.type=r,this.sanitizeURL=x,this.removeEmptyString=w}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){b[t]=new S(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var r=t[0];b[r]=new S(r,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){b[t]=new S(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){b[t]=new S(t,2,!1,t,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(t){b[t]=new S(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){b[t]=new S(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){b[t]=new S(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){b[t]=new S(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){b[t]=new S(t,5,!1,t.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function E(t){return t[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(t){var r=t.replace(N,E);b[r]=new S(r,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var r=t.replace(N,E);b[r]=new S(r,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var r=t.replace(N,E);b[r]=new S(r,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){b[t]=new S(t,1,!1,t.toLowerCase(),null,!1,!1)}),b.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){b[t]=new S(t,1,!1,t.toLowerCase(),null,!0,!0)});function j(t,r,n,i){var u=b.hasOwnProperty(r)?b[r]:null;(u!==null?u.type!==0:i||!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(T(r,n,u,i)&&(n=null),i||u===null?C(r)&&(n===null?t.removeAttribute(r):t.setAttribute(r,""+n)):u.mustUseProperty?t[u.propertyName]=n===null?u.type===3?!1:"":n:(r=u.attributeName,i=u.attributeNamespace,n===null?t.removeAttribute(r):(u=u.type,n=u===3||u===4&&n===!0?"":""+n,i?t.setAttributeNS(i,r,n):t.setAttribute(r,n))))}var R=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,B=Symbol.for("react.element"),U=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),se=Symbol.for("react.provider"),le=Symbol.for("react.context"),ie=Symbol.for("react.forward_ref"),ee=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),ce=Symbol.for("react.lazy"),re=Symbol.for("react.offscreen"),A=Symbol.iterator;function ne(t){return t===null||typeof t!="object"?null:(t=A&&t[A]||t["@@iterator"],typeof t=="function"?t:null)}var W=Object.assign,M;function O(t){if(M===void 0)try{throw Error()}catch(n){var r=n.stack.trim().match(/\n( *(at )?)/);M=r&&r[1]||""}return`
`+M+t}var F=!1;function X(t,r){if(!t||F)return"";F=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(r)if(r=function(){throw Error()},Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(r,[])}catch(J){var i=J}Reflect.construct(t,[],r)}else{try{r.call()}catch(J){i=J}t.call(r.prototype)}else{try{throw Error()}catch(J){i=J}t()}}catch(J){if(J&&i&&typeof J.stack=="string"){for(var u=J.stack.split(`
`),x=i.stack.split(`
`),w=u.length-1,I=x.length-1;1<=w&&0<=I&&u[w]!==x[I];)I--;for(;1<=w&&0<=I;w--,I--)if(u[w]!==x[I]){if(w!==1||I!==1)do if(w--,I--,0>I||u[w]!==x[I]){var $=`
`+u[w].replace(" at new "," at ");return t.displayName&&$.includes("<anonymous>")&&($=$.replace("<anonymous>",t.displayName)),$}while(1<=w&&0<=I);break}}}finally{F=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?O(t):""}function H(t){switch(t.tag){case 5:return O(t.type);case 16:return O("Lazy");case 13:return O("Suspense");case 19:return O("SuspenseList");case 0:case 2:case 15:return t=X(t.type,!1),t;case 11:return t=X(t.type.render,!1),t;case 1:return t=X(t.type,!0),t;default:return""}}function ue(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case k:return"Fragment";case U:return"Portal";case _:return"Profiler";case L:return"StrictMode";case ee:return"Suspense";case G:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case le:return(t.displayName||"Context")+".Consumer";case se:return(t._context.displayName||"Context")+".Provider";case ie:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Q:return r=t.displayName||null,r!==null?r:ue(t.type)||"Memo";case ce:r=t._payload,t=t._init;try{return ue(t(r))}catch{}}return null}function K(t){var r=t.type;switch(t.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=r.render,t=t.displayName||t.name||"",r.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ue(r);case 8:return r===L?"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 r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function ye(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ge(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function D(t){var r=ge(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,r),i=""+t[r];if(!t.hasOwnProperty(r)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var u=n.get,x=n.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return u.call(this)},set:function(w){i=""+w,x.call(this,w)}}),Object.defineProperty(t,r,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(w){i=""+w},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function fe(t){t._valueTracker||(t._valueTracker=D(t))}function Se(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var n=r.getValue(),i="";return t&&(i=ge(t)?t.checked?"true":"false":t.value),t=i,t!==n?(r.setValue(t),!0):!1}function ze(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function We(t,r){var n=r.checked;return W({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function qe(t,r){var n=r.defaultValue==null?"":r.defaultValue,i=r.checked!=null?r.checked:r.defaultChecked;n=ye(r.value!=null?r.value:n),t._wrapperState={initialChecked:i,initialValue:n,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function Ze(t,r){r=r.checked,r!=null&&j(t,"checked",r,!1)}function st(t,r){Ze(t,r);var n=ye(r.value),i=r.type;if(n!=null)i==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(i==="submit"||i==="reset"){t.removeAttribute("value");return}r.hasOwnProperty("value")?nt(t,r.type,n):r.hasOwnProperty("defaultValue")&&nt(t,r.type,ye(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(t.defaultChecked=!!r.defaultChecked)}function ft(t,r,n){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var i=r.type;if(!(i!=="submit"&&i!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+t._wrapperState.initialValue,n||r===t.value||(t.value=r),t.defaultValue=r}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function nt(t,r,n){(r!=="number"||ze(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Vt=Array.isArray;function Fr(t,r,n,i){if(t=t.options,r){r={};for(var u=0;u<n.length;u++)r["$"+n[u]]=!0;for(n=0;n<t.length;n++)u=r.hasOwnProperty("$"+t[n].value),t[n].selected!==u&&(t[n].selected=u),u&&i&&(t[n].defaultSelected=!0)}else{for(n=""+ye(n),r=null,u=0;u<t.length;u++){if(t[u].value===n){t[u].selected=!0,i&&(t[u].defaultSelected=!0);return}r!==null||t[u].disabled||(r=t[u])}r!==null&&(r.selected=!0)}}function Xr(t,r){if(r.dangerouslySetInnerHTML!=null)throw Error(l(91));return W({},r,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function xs(t,r){var n=r.value;if(n==null){if(n=r.children,r=r.defaultValue,n!=null){if(r!=null)throw Error(l(92));if(Vt(n)){if(1<n.length)throw Error(l(93));n=n[0]}r=n}r==null&&(r=""),n=r}t._wrapperState={initialValue:ye(n)}}function ps(t,r){var n=ye(r.value),i=ye(r.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),r.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),i!=null&&(t.defaultValue=""+i)}function $t(t){var r=t.textContent;r===t._wrapperState.initialValue&&r!==""&&r!==null&&(t.value=r)}function gs(t){switch(t){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 oe(t,r){return t==null||t==="http://www.w3.org/1999/xhtml"?gs(r):t==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Qe,Tt=(function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(r,n,i,u){MSApp.execUnsafeLocalFunction(function(){return t(r,n,i,u)})}:t})(function(t,r){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=r;else{for(Qe=Qe||document.createElement("div"),Qe.innerHTML="<svg>"+r.valueOf().toString()+"</svg>",r=Qe.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;r.firstChild;)t.appendChild(r.firstChild)}});function dr(t,r){if(r){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=r;return}}t.textContent=r}var zr={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},Ro=["Webkit","ms","Moz","O"];Object.keys(zr).forEach(function(t){Ro.forEach(function(r){r=r+t.charAt(0).toUpperCase()+t.substring(1),zr[r]=zr[t]})});function Nl(t,r,n){return r==null||typeof r=="boolean"||r===""?"":n||typeof r!="number"||r===0||zr.hasOwnProperty(t)&&zr[t]?(""+r).trim():r+"px"}function ga(t,r){t=t.style;for(var n in r)if(r.hasOwnProperty(n)){var i=n.indexOf("--")===0,u=Nl(n,r[n],i);n==="float"&&(n="cssFloat"),i?t.setProperty(n,u):t[n]=u}}var Io=W({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 ya(t,r){if(r){if(Io[t]&&(r.children!=null||r.dangerouslySetInnerHTML!=null))throw Error(l(137,t));if(r.dangerouslySetInnerHTML!=null){if(r.children!=null)throw Error(l(60));if(typeof r.dangerouslySetInnerHTML!="object"||!("__html"in r.dangerouslySetInnerHTML))throw Error(l(61))}if(r.style!=null&&typeof r.style!="object")throw Error(l(62))}}function va(t,r){if(t.indexOf("-")===-1)return typeof r.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ja=null;function ba(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Na=null,ys=null,vs=null;function wl(t){if(t=Wa(t)){if(typeof Na!="function")throw Error(l(280));var r=t.stateNode;r&&(r=ql(r),Na(t.stateNode,t.type,r))}}function Sl(t){ys?vs?vs.push(t):vs=[t]:ys=t}function Cl(){if(ys){var t=ys,r=vs;if(vs=ys=null,wl(t),r)for(t=0;t<r.length;t++)wl(r[t])}}function kl(t,r){return t(r)}function El(){}var wa=!1;function Sa(t,r,n){if(wa)return t(r,n);wa=!0;try{return kl(t,r,n)}finally{wa=!1,(ys!==null||vs!==null)&&(El(),Cl())}}function Jr(t,r){var n=t.stateNode;if(n===null)return null;var i=ql(n);if(i===null)return null;n=i[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(l(231,r,typeof n));return n}var kn=!1;if(m)try{var js={};Object.defineProperty(js,"passive",{get:function(){kn=!0}}),window.addEventListener("test",js,js),window.removeEventListener("test",js,js)}catch{kn=!1}function Pl(t,r,n,i,u,x,w,I,$){var J=Array.prototype.slice.call(arguments,3);try{r.apply(n,J)}catch(me){this.onError(me)}}var bs=!1,z=null,ae=!1,be=null,Ee={onError:function(t){bs=!0,z=t}};function mt(t,r,n,i,u,x,w,I,$){bs=!1,z=null,Pl.apply(Ee,arguments)}function gr(t,r,n,i,u,x,w,I,$){if(mt.apply(this,arguments),bs){if(bs){var J=z;bs=!1,z=null}else throw Error(l(198));ae||(ae=!0,be=J)}}function at(t){var r=t,n=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(n=r.return),t=r.return;while(t)}return r.tag===3?n:null}function Cr(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function Tl(t){if(at(t)!==t)throw Error(l(188))}function sn(t){var r=t.alternate;if(!r){if(r=at(t),r===null)throw Error(l(188));return r!==t?null:t}for(var n=t,i=r;;){var u=n.return;if(u===null)break;var x=u.alternate;if(x===null){if(i=u.return,i!==null){n=i;continue}break}if(u.child===x.child){for(x=u.child;x;){if(x===n)return Tl(u),t;if(x===i)return Tl(u),r;x=x.sibling}throw Error(l(188))}if(n.return!==i.return)n=u,i=x;else{for(var w=!1,I=u.child;I;){if(I===n){w=!0,n=u,i=x;break}if(I===i){w=!0,i=u,n=x;break}I=I.sibling}if(!w){for(I=x.child;I;){if(I===n){w=!0,n=x,i=u;break}if(I===i){w=!0,i=x,n=u;break}I=I.sibling}if(!w)throw Error(l(189))}}if(n.alternate!==i)throw Error(l(190))}if(n.tag!==3)throw Error(l(188));return n.stateNode.current===n?t:r}function En(t){return t=sn(t),t!==null?Rt(t):null}function Rt(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var r=Rt(t);if(r!==null)return r;t=t.sibling}return null}var Ca=a.unstable_scheduleCallback,Fu=a.unstable_cancelCallback,j0=a.unstable_shouldYield,b0=a.unstable_requestPaint,jt=a.unstable_now,N0=a.unstable_getCurrentPriorityLevel,_o=a.unstable_ImmediatePriority,zu=a.unstable_UserBlockingPriority,Rl=a.unstable_NormalPriority,w0=a.unstable_LowPriority,$u=a.unstable_IdlePriority,Il=null,$r=null;function S0(t){if($r&&typeof $r.onCommitFiberRoot=="function")try{$r.onCommitFiberRoot(Il,t,void 0,(t.current.flags&128)===128)}catch{}}var kr=Math.clz32?Math.clz32:E0,C0=Math.log,k0=Math.LN2;function E0(t){return t>>>=0,t===0?32:31-(C0(t)/k0|0)|0}var _l=64,Ml=4194304;function ka(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Al(t,r){var n=t.pendingLanes;if(n===0)return 0;var i=0,u=t.suspendedLanes,x=t.pingedLanes,w=n&268435455;if(w!==0){var I=w&~u;I!==0?i=ka(I):(x&=w,x!==0&&(i=ka(x)))}else w=n&~u,w!==0?i=ka(w):x!==0&&(i=ka(x));if(i===0)return 0;if(r!==0&&r!==i&&(r&u)===0&&(u=i&-i,x=r&-r,u>=x||u===16&&(x&4194240)!==0))return r;if((i&4)!==0&&(i|=n&16),r=t.entangledLanes,r!==0)for(t=t.entanglements,r&=i;0<r;)n=31-kr(r),u=1<<n,i|=t[n],r&=~u;return i}function P0(t,r){switch(t){case 1:case 2:case 4:return r+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 r+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 T0(t,r){for(var n=t.suspendedLanes,i=t.pingedLanes,u=t.expirationTimes,x=t.pendingLanes;0<x;){var w=31-kr(x),I=1<<w,$=u[w];$===-1?((I&n)===0||(I&i)!==0)&&(u[w]=P0(I,r)):$<=r&&(t.expiredLanes|=I),x&=~I}}function Mo(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Bu(){var t=_l;return _l<<=1,(_l&4194240)===0&&(_l=64),t}function Ao(t){for(var r=[],n=0;31>n;n++)r.push(t);return r}function Ea(t,r,n){t.pendingLanes|=r,r!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,r=31-kr(r),t[r]=n}function R0(t,r){var n=t.pendingLanes&~r;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=r,t.mutableReadLanes&=r,t.entangledLanes&=r,r=t.entanglements;var i=t.eventTimes;for(t=t.expirationTimes;0<n;){var u=31-kr(n),x=1<<u;r[u]=0,i[u]=-1,t[u]=-1,n&=~x}}function Do(t,r){var n=t.entangledLanes|=r;for(t=t.entanglements;n;){var i=31-kr(n),u=1<<i;u&r|t[i]&r&&(t[i]|=r),n&=~u}}var rt=0;function Uu(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var Vu,Lo,Wu,Hu,Ku,Oo=!1,Dl=[],Ns=null,ws=null,Ss=null,Pa=new Map,Ta=new Map,Cs=[],I0="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 Yu(t,r){switch(t){case"focusin":case"focusout":Ns=null;break;case"dragenter":case"dragleave":ws=null;break;case"mouseover":case"mouseout":Ss=null;break;case"pointerover":case"pointerout":Pa.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ta.delete(r.pointerId)}}function Ra(t,r,n,i,u,x){return t===null||t.nativeEvent!==x?(t={blockedOn:r,domEventName:n,eventSystemFlags:i,nativeEvent:x,targetContainers:[u]},r!==null&&(r=Wa(r),r!==null&&Lo(r)),t):(t.eventSystemFlags|=i,r=t.targetContainers,u!==null&&r.indexOf(u)===-1&&r.push(u),t)}function _0(t,r,n,i,u){switch(r){case"focusin":return Ns=Ra(Ns,t,r,n,i,u),!0;case"dragenter":return ws=Ra(ws,t,r,n,i,u),!0;case"mouseover":return Ss=Ra(Ss,t,r,n,i,u),!0;case"pointerover":var x=u.pointerId;return Pa.set(x,Ra(Pa.get(x)||null,t,r,n,i,u)),!0;case"gotpointercapture":return x=u.pointerId,Ta.set(x,Ra(Ta.get(x)||null,t,r,n,i,u)),!0}return!1}function Gu(t){var r=nn(t.target);if(r!==null){var n=at(r);if(n!==null){if(r=n.tag,r===13){if(r=Cr(n),r!==null){t.blockedOn=r,Ku(t.priority,function(){Wu(n)});return}}else if(r===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Ll(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var n=zo(t.domEventName,t.eventSystemFlags,r[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var i=new n.constructor(n.type,n);ja=i,n.target.dispatchEvent(i),ja=null}else return r=Wa(n),r!==null&&Lo(r),t.blockedOn=n,!1;r.shift()}return!0}function Qu(t,r,n){Ll(t)&&n.delete(r)}function M0(){Oo=!1,Ns!==null&&Ll(Ns)&&(Ns=null),ws!==null&&Ll(ws)&&(ws=null),Ss!==null&&Ll(Ss)&&(Ss=null),Pa.forEach(Qu),Ta.forEach(Qu)}function Ia(t,r){t.blockedOn===r&&(t.blockedOn=null,Oo||(Oo=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,M0)))}function _a(t){function r(u){return Ia(u,t)}if(0<Dl.length){Ia(Dl[0],t);for(var n=1;n<Dl.length;n++){var i=Dl[n];i.blockedOn===t&&(i.blockedOn=null)}}for(Ns!==null&&Ia(Ns,t),ws!==null&&Ia(ws,t),Ss!==null&&Ia(Ss,t),Pa.forEach(r),Ta.forEach(r),n=0;n<Cs.length;n++)i=Cs[n],i.blockedOn===t&&(i.blockedOn=null);for(;0<Cs.length&&(n=Cs[0],n.blockedOn===null);)Gu(n),n.blockedOn===null&&Cs.shift()}var Pn=R.ReactCurrentBatchConfig,Ol=!0;function A0(t,r,n,i){var u=rt,x=Pn.transition;Pn.transition=null;try{rt=1,Fo(t,r,n,i)}finally{rt=u,Pn.transition=x}}function D0(t,r,n,i){var u=rt,x=Pn.transition;Pn.transition=null;try{rt=4,Fo(t,r,n,i)}finally{rt=u,Pn.transition=x}}function Fo(t,r,n,i){if(Ol){var u=zo(t,r,n,i);if(u===null)rc(t,r,i,Fl,n),Yu(t,i);else if(_0(u,t,r,n,i))i.stopPropagation();else if(Yu(t,i),r&4&&-1<I0.indexOf(t)){for(;u!==null;){var x=Wa(u);if(x!==null&&Vu(x),x=zo(t,r,n,i),x===null&&rc(t,r,i,Fl,n),x===u)break;u=x}u!==null&&i.stopPropagation()}else rc(t,r,i,null,n)}}var Fl=null;function zo(t,r,n,i){if(Fl=null,t=ba(i),t=nn(t),t!==null)if(r=at(t),r===null)t=null;else if(n=r.tag,n===13){if(t=Cr(r),t!==null)return t;t=null}else if(n===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null);return Fl=t,null}function qu(t){switch(t){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(N0()){case _o:return 1;case zu:return 4;case Rl:case w0:return 16;case $u:return 536870912;default:return 16}default:return 16}}var ks=null,$o=null,zl=null;function Xu(){if(zl)return zl;var t,r=$o,n=r.length,i,u="value"in ks?ks.value:ks.textContent,x=u.length;for(t=0;t<n&&r[t]===u[t];t++);var w=n-t;for(i=1;i<=w&&r[n-i]===u[x-i];i++);return zl=u.slice(t,1<i?1-i:void 0)}function $l(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function Bl(){return!0}function Ju(){return!1}function ur(t){function r(n,i,u,x,w){this._reactName=n,this._targetInst=u,this.type=i,this.nativeEvent=x,this.target=w,this.currentTarget=null;for(var I in t)t.hasOwnProperty(I)&&(n=t[I],this[I]=n?n(x):x[I]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Bl:Ju,this.isPropagationStopped=Ju,this}return W(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Bl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Bl)},persist:function(){},isPersistent:Bl}),r}var Tn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bo=ur(Tn),Ma=W({},Tn,{view:0,detail:0}),L0=ur(Ma),Uo,Vo,Aa,Ul=W({},Ma,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ho,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Aa&&(Aa&&t.type==="mousemove"?(Uo=t.screenX-Aa.screenX,Vo=t.screenY-Aa.screenY):Vo=Uo=0,Aa=t),Uo)},movementY:function(t){return"movementY"in t?t.movementY:Vo}}),Zu=ur(Ul),O0=W({},Ul,{dataTransfer:0}),F0=ur(O0),z0=W({},Ma,{relatedTarget:0}),Wo=ur(z0),$0=W({},Tn,{animationName:0,elapsedTime:0,pseudoElement:0}),B0=ur($0),U0=W({},Tn,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),V0=ur(U0),W0=W({},Tn,{data:0}),eh=ur(W0),H0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},K0={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"},Y0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function G0(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=Y0[t])?!!r[t]:!1}function Ho(){return G0}var Q0=W({},Ma,{key:function(t){if(t.key){var r=H0[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=$l(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?K0[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ho,charCode:function(t){return t.type==="keypress"?$l(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?$l(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),q0=ur(Q0),X0=W({},Ul,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),th=ur(X0),J0=W({},Ma,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ho}),Z0=ur(J0),ey=W({},Tn,{propertyName:0,elapsedTime:0,pseudoElement:0}),ty=ur(ey),ry=W({},Ul,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),sy=ur(ry),ny=[9,13,27,32],Ko=m&&"CompositionEvent"in window,Da=null;m&&"documentMode"in document&&(Da=document.documentMode);var ay=m&&"TextEvent"in window&&!Da,rh=m&&(!Ko||Da&&8<Da&&11>=Da),sh=" ",nh=!1;function ah(t,r){switch(t){case"keyup":return ny.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Rn=!1;function ly(t,r){switch(t){case"compositionend":return lh(r);case"keypress":return r.which!==32?null:(nh=!0,sh);case"textInput":return t=r.data,t===sh&&nh?null:t;default:return null}}function iy(t,r){if(Rn)return t==="compositionend"||!Ko&&ah(t,r)?(t=Xu(),zl=$o=ks=null,Rn=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return rh&&r.locale!=="ko"?null:r.data;default:return null}}var oy={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 ih(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!oy[t.type]:r==="textarea"}function oh(t,r,n,i){Sl(i),r=Yl(r,"onChange"),0<r.length&&(n=new Bo("onChange","change",null,n,i),t.push({event:n,listeners:r}))}var La=null,Oa=null;function cy(t){kh(t,0)}function Vl(t){var r=Dn(t);if(Se(r))return t}function dy(t,r){if(t==="change")return r}var ch=!1;if(m){var Yo;if(m){var Go="oninput"in document;if(!Go){var dh=document.createElement("div");dh.setAttribute("oninput","return;"),Go=typeof dh.oninput=="function"}Yo=Go}else Yo=!1;ch=Yo&&(!document.documentMode||9<document.documentMode)}function uh(){La&&(La.detachEvent("onpropertychange",hh),Oa=La=null)}function hh(t){if(t.propertyName==="value"&&Vl(Oa)){var r=[];oh(r,Oa,t,ba(t)),Sa(cy,r)}}function uy(t,r,n){t==="focusin"?(uh(),La=r,Oa=n,La.attachEvent("onpropertychange",hh)):t==="focusout"&&uh()}function hy(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Vl(Oa)}function fy(t,r){if(t==="click")return Vl(r)}function my(t,r){if(t==="input"||t==="change")return Vl(r)}function xy(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var Er=typeof Object.is=="function"?Object.is:xy;function Fa(t,r){if(Er(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var n=Object.keys(t),i=Object.keys(r);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var u=n[i];if(!p.call(r,u)||!Er(t[u],r[u]))return!1}return!0}function fh(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function mh(t,r){var n=fh(t);t=0;for(var i;n;){if(n.nodeType===3){if(i=t+n.textContent.length,t<=r&&i>=r)return{node:n,offset:r-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=fh(n)}}function xh(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?xh(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function ph(){for(var t=window,r=ze();r instanceof t.HTMLIFrameElement;){try{var n=typeof r.contentWindow.location.href=="string"}catch{n=!1}if(n)t=r.contentWindow;else break;r=ze(t.document)}return r}function Qo(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}function py(t){var r=ph(),n=t.focusedElem,i=t.selectionRange;if(r!==n&&n&&n.ownerDocument&&xh(n.ownerDocument.documentElement,n)){if(i!==null&&Qo(n)){if(r=i.start,t=i.end,t===void 0&&(t=r),"selectionStart"in n)n.selectionStart=r,n.selectionEnd=Math.min(t,n.value.length);else if(t=(r=n.ownerDocument||document)&&r.defaultView||window,t.getSelection){t=t.getSelection();var u=n.textContent.length,x=Math.min(i.start,u);i=i.end===void 0?x:Math.min(i.end,u),!t.extend&&x>i&&(u=i,i=x,x=u),u=mh(n,x);var w=mh(n,i);u&&w&&(t.rangeCount!==1||t.anchorNode!==u.node||t.anchorOffset!==u.offset||t.focusNode!==w.node||t.focusOffset!==w.offset)&&(r=r.createRange(),r.setStart(u.node,u.offset),t.removeAllRanges(),x>i?(t.addRange(r),t.extend(w.node,w.offset)):(r.setEnd(w.node,w.offset),t.addRange(r)))}}for(r=[],t=n;t=t.parentNode;)t.nodeType===1&&r.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<r.length;n++)t=r[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var gy=m&&"documentMode"in document&&11>=document.documentMode,In=null,qo=null,za=null,Xo=!1;function gh(t,r,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Xo||In==null||In!==ze(i)||(i=In,"selectionStart"in i&&Qo(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),za&&Fa(za,i)||(za=i,i=Yl(qo,"onSelect"),0<i.length&&(r=new Bo("onSelect","select",null,r,n),t.push({event:r,listeners:i}),r.target=In)))}function Wl(t,r){var n={};return n[t.toLowerCase()]=r.toLowerCase(),n["Webkit"+t]="webkit"+r,n["Moz"+t]="moz"+r,n}var _n={animationend:Wl("Animation","AnimationEnd"),animationiteration:Wl("Animation","AnimationIteration"),animationstart:Wl("Animation","AnimationStart"),transitionend:Wl("Transition","TransitionEnd")},Jo={},yh={};m&&(yh=document.createElement("div").style,"AnimationEvent"in window||(delete _n.animationend.animation,delete _n.animationiteration.animation,delete _n.animationstart.animation),"TransitionEvent"in window||delete _n.transitionend.transition);function Hl(t){if(Jo[t])return Jo[t];if(!_n[t])return t;var r=_n[t],n;for(n in r)if(r.hasOwnProperty(n)&&n in yh)return Jo[t]=r[n];return t}var vh=Hl("animationend"),jh=Hl("animationiteration"),bh=Hl("animationstart"),Nh=Hl("transitionend"),wh=new Map,Sh="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 Es(t,r){wh.set(t,r),d(r,[t])}for(var Zo=0;Zo<Sh.length;Zo++){var ec=Sh[Zo],yy=ec.toLowerCase(),vy=ec[0].toUpperCase()+ec.slice(1);Es(yy,"on"+vy)}Es(vh,"onAnimationEnd"),Es(jh,"onAnimationIteration"),Es(bh,"onAnimationStart"),Es("dblclick","onDoubleClick"),Es("focusin","onFocus"),Es("focusout","onBlur"),Es(Nh,"onTransitionEnd"),h("onMouseEnter",["mouseout","mouseover"]),h("onMouseLeave",["mouseout","mouseover"]),h("onPointerEnter",["pointerout","pointerover"]),h("onPointerLeave",["pointerout","pointerover"]),d("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),d("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),d("onBeforeInput",["compositionend","keypress","textInput","paste"]),d("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),d("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),d("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $a="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(" "),jy=new Set("cancel close invalid load scroll toggle".split(" ").concat($a));function Ch(t,r,n){var i=t.type||"unknown-event";t.currentTarget=n,gr(i,r,void 0,t),t.currentTarget=null}function kh(t,r){r=(r&4)!==0;for(var n=0;n<t.length;n++){var i=t[n],u=i.event;i=i.listeners;e:{var x=void 0;if(r)for(var w=i.length-1;0<=w;w--){var I=i[w],$=I.instance,J=I.currentTarget;if(I=I.listener,$!==x&&u.isPropagationStopped())break e;Ch(u,I,J),x=$}else for(w=0;w<i.length;w++){if(I=i[w],$=I.instance,J=I.currentTarget,I=I.listener,$!==x&&u.isPropagationStopped())break e;Ch(u,I,J),x=$}}}if(ae)throw t=be,ae=!1,be=null,t}function ot(t,r){var n=r[oc];n===void 0&&(n=r[oc]=new Set);var i=t+"__bubble";n.has(i)||(Eh(r,t,2,!1),n.add(i))}function tc(t,r,n){var i=0;r&&(i|=4),Eh(n,t,i,r)}var Kl="_reactListening"+Math.random().toString(36).slice(2);function Ba(t){if(!t[Kl]){t[Kl]=!0,o.forEach(function(n){n!=="selectionchange"&&(jy.has(n)||tc(n,!1,t),tc(n,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[Kl]||(r[Kl]=!0,tc("selectionchange",!1,r))}}function Eh(t,r,n,i){switch(qu(r)){case 1:var u=A0;break;case 4:u=D0;break;default:u=Fo}n=u.bind(null,r,n,t),u=void 0,!kn||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(u=!0),i?u!==void 0?t.addEventListener(r,n,{capture:!0,passive:u}):t.addEventListener(r,n,!0):u!==void 0?t.addEventListener(r,n,{passive:u}):t.addEventListener(r,n,!1)}function rc(t,r,n,i,u){var x=i;if((r&1)===0&&(r&2)===0&&i!==null)e:for(;;){if(i===null)return;var w=i.tag;if(w===3||w===4){var I=i.stateNode.containerInfo;if(I===u||I.nodeType===8&&I.parentNode===u)break;if(w===4)for(w=i.return;w!==null;){var $=w.tag;if(($===3||$===4)&&($=w.stateNode.containerInfo,$===u||$.nodeType===8&&$.parentNode===u))return;w=w.return}for(;I!==null;){if(w=nn(I),w===null)return;if($=w.tag,$===5||$===6){i=x=w;continue e}I=I.parentNode}}i=i.return}Sa(function(){var J=x,me=ba(n),xe=[];e:{var he=wh.get(t);if(he!==void 0){var Ce=Bo,Te=t;switch(t){case"keypress":if($l(n)===0)break e;case"keydown":case"keyup":Ce=q0;break;case"focusin":Te="focus",Ce=Wo;break;case"focusout":Te="blur",Ce=Wo;break;case"beforeblur":case"afterblur":Ce=Wo;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":Ce=Zu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ce=F0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ce=Z0;break;case vh:case jh:case bh:Ce=B0;break;case Nh:Ce=ty;break;case"scroll":Ce=L0;break;case"wheel":Ce=sy;break;case"copy":case"cut":case"paste":Ce=V0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ce=th}var _e=(r&4)!==0,bt=!_e&&t==="scroll",Y=_e?he!==null?he+"Capture":null:he;_e=[];for(var V=J,q;V!==null;){q=V;var ve=q.stateNode;if(q.tag===5&&ve!==null&&(q=ve,Y!==null&&(ve=Jr(V,Y),ve!=null&&_e.push(Ua(V,ve,q)))),bt)break;V=V.return}0<_e.length&&(he=new Ce(he,Te,null,n,me),xe.push({event:he,listeners:_e}))}}if((r&7)===0){e:{if(he=t==="mouseover"||t==="pointerover",Ce=t==="mouseout"||t==="pointerout",he&&n!==ja&&(Te=n.relatedTarget||n.fromElement)&&(nn(Te)||Te[Zr]))break e;if((Ce||he)&&(he=me.window===me?me:(he=me.ownerDocument)?he.defaultView||he.parentWindow:window,Ce?(Te=n.relatedTarget||n.toElement,Ce=J,Te=Te?nn(Te):null,Te!==null&&(bt=at(Te),Te!==bt||Te.tag!==5&&Te.tag!==6)&&(Te=null)):(Ce=null,Te=J),Ce!==Te)){if(_e=Zu,ve="onMouseLeave",Y="onMouseEnter",V="mouse",(t==="pointerout"||t==="pointerover")&&(_e=th,ve="onPointerLeave",Y="onPointerEnter",V="pointer"),bt=Ce==null?he:Dn(Ce),q=Te==null?he:Dn(Te),he=new _e(ve,V+"leave",Ce,n,me),he.target=bt,he.relatedTarget=q,ve=null,nn(me)===J&&(_e=new _e(Y,V+"enter",Te,n,me),_e.target=q,_e.relatedTarget=bt,ve=_e),bt=ve,Ce&&Te)t:{for(_e=Ce,Y=Te,V=0,q=_e;q;q=Mn(q))V++;for(q=0,ve=Y;ve;ve=Mn(ve))q++;for(;0<V-q;)_e=Mn(_e),V--;for(;0<q-V;)Y=Mn(Y),q--;for(;V--;){if(_e===Y||Y!==null&&_e===Y.alternate)break t;_e=Mn(_e),Y=Mn(Y)}_e=null}else _e=null;Ce!==null&&Ph(xe,he,Ce,_e,!1),Te!==null&&bt!==null&&Ph(xe,bt,Te,_e,!0)}}e:{if(he=J?Dn(J):window,Ce=he.nodeName&&he.nodeName.toLowerCase(),Ce==="select"||Ce==="input"&&he.type==="file")var Me=dy;else if(ih(he))if(ch)Me=my;else{Me=hy;var Ae=uy}else(Ce=he.nodeName)&&Ce.toLowerCase()==="input"&&(he.type==="checkbox"||he.type==="radio")&&(Me=fy);if(Me&&(Me=Me(t,J))){oh(xe,Me,n,me);break e}Ae&&Ae(t,he,J),t==="focusout"&&(Ae=he._wrapperState)&&Ae.controlled&&he.type==="number"&&nt(he,"number",he.value)}switch(Ae=J?Dn(J):window,t){case"focusin":(ih(Ae)||Ae.contentEditable==="true")&&(In=Ae,qo=J,za=null);break;case"focusout":za=qo=In=null;break;case"mousedown":Xo=!0;break;case"contextmenu":case"mouseup":case"dragend":Xo=!1,gh(xe,n,me);break;case"selectionchange":if(gy)break;case"keydown":case"keyup":gh(xe,n,me)}var De;if(Ko)e:{switch(t){case"compositionstart":var Le="onCompositionStart";break e;case"compositionend":Le="onCompositionEnd";break e;case"compositionupdate":Le="onCompositionUpdate";break e}Le=void 0}else Rn?ah(t,n)&&(Le="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(Le="onCompositionStart");Le&&(rh&&n.locale!=="ko"&&(Rn||Le!=="onCompositionStart"?Le==="onCompositionEnd"&&Rn&&(De=Xu()):(ks=me,$o="value"in ks?ks.value:ks.textContent,Rn=!0)),Ae=Yl(J,Le),0<Ae.length&&(Le=new eh(Le,t,null,n,me),xe.push({event:Le,listeners:Ae}),De?Le.data=De:(De=lh(n),De!==null&&(Le.data=De)))),(De=ay?ly(t,n):iy(t,n))&&(J=Yl(J,"onBeforeInput"),0<J.length&&(me=new eh("onBeforeInput","beforeinput",null,n,me),xe.push({event:me,listeners:J}),me.data=De))}kh(xe,r)})}function Ua(t,r,n){return{instance:t,listener:r,currentTarget:n}}function Yl(t,r){for(var n=r+"Capture",i=[];t!==null;){var u=t,x=u.stateNode;u.tag===5&&x!==null&&(u=x,x=Jr(t,n),x!=null&&i.unshift(Ua(t,x,u)),x=Jr(t,r),x!=null&&i.push(Ua(t,x,u))),t=t.return}return i}function Mn(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Ph(t,r,n,i,u){for(var x=r._reactName,w=[];n!==null&&n!==i;){var I=n,$=I.alternate,J=I.stateNode;if($!==null&&$===i)break;I.tag===5&&J!==null&&(I=J,u?($=Jr(n,x),$!=null&&w.unshift(Ua(n,$,I))):u||($=Jr(n,x),$!=null&&w.push(Ua(n,$,I)))),n=n.return}w.length!==0&&t.push({event:r,listeners:w})}var by=/\r\n?/g,Ny=/\u0000|\uFFFD/g;function Th(t){return(typeof t=="string"?t:""+t).replace(by,`
`).replace(Ny,"")}function Gl(t,r,n){if(r=Th(r),Th(t)!==r&&n)throw Error(l(425))}function Ql(){}var sc=null,nc=null;function ac(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var lc=typeof setTimeout=="function"?setTimeout:void 0,wy=typeof clearTimeout=="function"?clearTimeout:void 0,Rh=typeof Promise=="function"?Promise:void 0,Sy=typeof queueMicrotask=="function"?queueMicrotask:typeof Rh<"u"?function(t){return Rh.resolve(null).then(t).catch(Cy)}:lc;function Cy(t){setTimeout(function(){throw t})}function ic(t,r){var n=r,i=0;do{var u=n.nextSibling;if(t.removeChild(n),u&&u.nodeType===8)if(n=u.data,n==="/$"){if(i===0){t.removeChild(u),_a(r);return}i--}else n!=="$"&&n!=="$?"&&n!=="$!"||i++;n=u}while(n);_a(r)}function Ps(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?")break;if(r==="/$")return null}}return t}function Ih(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(r===0)return t;r--}else n==="/$"&&r++}t=t.previousSibling}return null}var An=Math.random().toString(36).slice(2),Br="__reactFiber$"+An,Va="__reactProps$"+An,Zr="__reactContainer$"+An,oc="__reactEvents$"+An,ky="__reactListeners$"+An,Ey="__reactHandles$"+An;function nn(t){var r=t[Br];if(r)return r;for(var n=t.parentNode;n;){if(r=n[Zr]||n[Br]){if(n=r.alternate,r.child!==null||n!==null&&n.child!==null)for(t=Ih(t);t!==null;){if(n=t[Br])return n;t=Ih(t)}return r}t=n,n=t.parentNode}return null}function Wa(t){return t=t[Br]||t[Zr],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Dn(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(l(33))}function ql(t){return t[Va]||null}var cc=[],Ln=-1;function Ts(t){return{current:t}}function ct(t){0>Ln||(t.current=cc[Ln],cc[Ln]=null,Ln--)}function lt(t,r){Ln++,cc[Ln]=t.current,t.current=r}var Rs={},Wt=Ts(Rs),tr=Ts(!1),an=Rs;function On(t,r){var n=t.type.contextTypes;if(!n)return Rs;var i=t.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===r)return i.__reactInternalMemoizedMaskedChildContext;var u={},x;for(x in n)u[x]=r[x];return i&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=r,t.__reactInternalMemoizedMaskedChildContext=u),u}function rr(t){return t=t.childContextTypes,t!=null}function Xl(){ct(tr),ct(Wt)}function _h(t,r,n){if(Wt.current!==Rs)throw Error(l(168));lt(Wt,r),lt(tr,n)}function Mh(t,r,n){var i=t.stateNode;if(r=r.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var u in i)if(!(u in r))throw Error(l(108,K(t)||"Unknown",u));return W({},n,i)}function Jl(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Rs,an=Wt.current,lt(Wt,t),lt(tr,tr.current),!0}function Ah(t,r,n){var i=t.stateNode;if(!i)throw Error(l(169));n?(t=Mh(t,r,an),i.__reactInternalMemoizedMergedChildContext=t,ct(tr),ct(Wt),lt(Wt,t)):ct(tr),lt(tr,n)}var es=null,Zl=!1,dc=!1;function Dh(t){es===null?es=[t]:es.push(t)}function Py(t){Zl=!0,Dh(t)}function Is(){if(!dc&&es!==null){dc=!0;var t=0,r=rt;try{var n=es;for(rt=1;t<n.length;t++){var i=n[t];do i=i(!0);while(i!==null)}es=null,Zl=!1}catch(u){throw es!==null&&(es=es.slice(t+1)),Ca(_o,Is),u}finally{rt=r,dc=!1}}return null}var Fn=[],zn=0,ei=null,ti=0,yr=[],vr=0,ln=null,ts=1,rs="";function on(t,r){Fn[zn++]=ti,Fn[zn++]=ei,ei=t,ti=r}function Lh(t,r,n){yr[vr++]=ts,yr[vr++]=rs,yr[vr++]=ln,ln=t;var i=ts;t=rs;var u=32-kr(i)-1;i&=~(1<<u),n+=1;var x=32-kr(r)+u;if(30<x){var w=u-u%5;x=(i&(1<<w)-1).toString(32),i>>=w,u-=w,ts=1<<32-kr(r)+u|n<<u|i,rs=x+t}else ts=1<<x|n<<u|i,rs=t}function uc(t){t.return!==null&&(on(t,1),Lh(t,1,0))}function hc(t){for(;t===ei;)ei=Fn[--zn],Fn[zn]=null,ti=Fn[--zn],Fn[zn]=null;for(;t===ln;)ln=yr[--vr],yr[vr]=null,rs=yr[--vr],yr[vr]=null,ts=yr[--vr],yr[vr]=null}var hr=null,fr=null,ut=!1,Pr=null;function Oh(t,r){var n=wr(5,null,null,0);n.elementType="DELETED",n.stateNode=r,n.return=t,r=t.deletions,r===null?(t.deletions=[n],t.flags|=16):r.push(n)}function Fh(t,r){switch(t.tag){case 5:var n=t.type;return r=r.nodeType!==1||n.toLowerCase()!==r.nodeName.toLowerCase()?null:r,r!==null?(t.stateNode=r,hr=t,fr=Ps(r.firstChild),!0):!1;case 6:return r=t.pendingProps===""||r.nodeType!==3?null:r,r!==null?(t.stateNode=r,hr=t,fr=null,!0):!1;case 13:return r=r.nodeType!==8?null:r,r!==null?(n=ln!==null?{id:ts,overflow:rs}:null,t.memoizedState={dehydrated:r,treeContext:n,retryLane:1073741824},n=wr(18,null,null,0),n.stateNode=r,n.return=t,t.child=n,hr=t,fr=null,!0):!1;default:return!1}}function fc(t){return(t.mode&1)!==0&&(t.flags&128)===0}function mc(t){if(ut){var r=fr;if(r){var n=r;if(!Fh(t,r)){if(fc(t))throw Error(l(418));r=Ps(n.nextSibling);var i=hr;r&&Fh(t,r)?Oh(i,n):(t.flags=t.flags&-4097|2,ut=!1,hr=t)}}else{if(fc(t))throw Error(l(418));t.flags=t.flags&-4097|2,ut=!1,hr=t}}}function zh(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;hr=t}function ri(t){if(t!==hr)return!1;if(!ut)return zh(t),ut=!0,!1;var r;if((r=t.tag!==3)&&!(r=t.tag!==5)&&(r=t.type,r=r!=="head"&&r!=="body"&&!ac(t.type,t.memoizedProps)),r&&(r=fr)){if(fc(t))throw $h(),Error(l(418));for(;r;)Oh(t,r),r=Ps(r.nextSibling)}if(zh(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));e:{for(t=t.nextSibling,r=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(r===0){fr=Ps(t.nextSibling);break e}r--}else n!=="$"&&n!=="$!"&&n!=="$?"||r++}t=t.nextSibling}fr=null}}else fr=hr?Ps(t.stateNode.nextSibling):null;return!0}function $h(){for(var t=fr;t;)t=Ps(t.nextSibling)}function $n(){fr=hr=null,ut=!1}function xc(t){Pr===null?Pr=[t]:Pr.push(t)}var Ty=R.ReactCurrentBatchConfig;function Ha(t,r,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(l(309));var i=n.stateNode}if(!i)throw Error(l(147,t));var u=i,x=""+t;return r!==null&&r.ref!==null&&typeof r.ref=="function"&&r.ref._stringRef===x?r.ref:(r=function(w){var I=u.refs;w===null?delete I[x]:I[x]=w},r._stringRef=x,r)}if(typeof t!="string")throw Error(l(284));if(!n._owner)throw Error(l(290,t))}return t}function si(t,r){throw t=Object.prototype.toString.call(r),Error(l(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t))}function Bh(t){var r=t._init;return r(t._payload)}function Uh(t){function r(Y,V){if(t){var q=Y.deletions;q===null?(Y.deletions=[V],Y.flags|=16):q.push(V)}}function n(Y,V){if(!t)return null;for(;V!==null;)r(Y,V),V=V.sibling;return null}function i(Y,V){for(Y=new Map;V!==null;)V.key!==null?Y.set(V.key,V):Y.set(V.index,V),V=V.sibling;return Y}function u(Y,V){return Y=zs(Y,V),Y.index=0,Y.sibling=null,Y}function x(Y,V,q){return Y.index=q,t?(q=Y.alternate,q!==null?(q=q.index,q<V?(Y.flags|=2,V):q):(Y.flags|=2,V)):(Y.flags|=1048576,V)}function w(Y){return t&&Y.alternate===null&&(Y.flags|=2),Y}function I(Y,V,q,ve){return V===null||V.tag!==6?(V=ld(q,Y.mode,ve),V.return=Y,V):(V=u(V,q),V.return=Y,V)}function $(Y,V,q,ve){var Me=q.type;return Me===k?me(Y,V,q.props.children,ve,q.key):V!==null&&(V.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===ce&&Bh(Me)===V.type)?(ve=u(V,q.props),ve.ref=Ha(Y,V,q),ve.return=Y,ve):(ve=Ei(q.type,q.key,q.props,null,Y.mode,ve),ve.ref=Ha(Y,V,q),ve.return=Y,ve)}function J(Y,V,q,ve){return V===null||V.tag!==4||V.stateNode.containerInfo!==q.containerInfo||V.stateNode.implementation!==q.implementation?(V=id(q,Y.mode,ve),V.return=Y,V):(V=u(V,q.children||[]),V.return=Y,V)}function me(Y,V,q,ve,Me){return V===null||V.tag!==7?(V=pn(q,Y.mode,ve,Me),V.return=Y,V):(V=u(V,q),V.return=Y,V)}function xe(Y,V,q){if(typeof V=="string"&&V!==""||typeof V=="number")return V=ld(""+V,Y.mode,q),V.return=Y,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case B:return q=Ei(V.type,V.key,V.props,null,Y.mode,q),q.ref=Ha(Y,null,V),q.return=Y,q;case U:return V=id(V,Y.mode,q),V.return=Y,V;case ce:var ve=V._init;return xe(Y,ve(V._payload),q)}if(Vt(V)||ne(V))return V=pn(V,Y.mode,q,null),V.return=Y,V;si(Y,V)}return null}function he(Y,V,q,ve){var Me=V!==null?V.key:null;if(typeof q=="string"&&q!==""||typeof q=="number")return Me!==null?null:I(Y,V,""+q,ve);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case B:return q.key===Me?$(Y,V,q,ve):null;case U:return q.key===Me?J(Y,V,q,ve):null;case ce:return Me=q._init,he(Y,V,Me(q._payload),ve)}if(Vt(q)||ne(q))return Me!==null?null:me(Y,V,q,ve,null);si(Y,q)}return null}function Ce(Y,V,q,ve,Me){if(typeof ve=="string"&&ve!==""||typeof ve=="number")return Y=Y.get(q)||null,I(V,Y,""+ve,Me);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case B:return Y=Y.get(ve.key===null?q:ve.key)||null,$(V,Y,ve,Me);case U:return Y=Y.get(ve.key===null?q:ve.key)||null,J(V,Y,ve,Me);case ce:var Ae=ve._init;return Ce(Y,V,q,Ae(ve._payload),Me)}if(Vt(ve)||ne(ve))return Y=Y.get(q)||null,me(V,Y,ve,Me,null);si(V,ve)}return null}function Te(Y,V,q,ve){for(var Me=null,Ae=null,De=V,Le=V=0,Ot=null;De!==null&&Le<q.length;Le++){De.index>Le?(Ot=De,De=null):Ot=De.sibling;var Je=he(Y,De,q[Le],ve);if(Je===null){De===null&&(De=Ot);break}t&&De&&Je.alternate===null&&r(Y,De),V=x(Je,V,Le),Ae===null?Me=Je:Ae.sibling=Je,Ae=Je,De=Ot}if(Le===q.length)return n(Y,De),ut&&on(Y,Le),Me;if(De===null){for(;Le<q.length;Le++)De=xe(Y,q[Le],ve),De!==null&&(V=x(De,V,Le),Ae===null?Me=De:Ae.sibling=De,Ae=De);return ut&&on(Y,Le),Me}for(De=i(Y,De);Le<q.length;Le++)Ot=Ce(De,Y,Le,q[Le],ve),Ot!==null&&(t&&Ot.alternate!==null&&De.delete(Ot.key===null?Le:Ot.key),V=x(Ot,V,Le),Ae===null?Me=Ot:Ae.sibling=Ot,Ae=Ot);return t&&De.forEach(function($s){return r(Y,$s)}),ut&&on(Y,Le),Me}function _e(Y,V,q,ve){var Me=ne(q);if(typeof Me!="function")throw Error(l(150));if(q=Me.call(q),q==null)throw Error(l(151));for(var Ae=Me=null,De=V,Le=V=0,Ot=null,Je=q.next();De!==null&&!Je.done;Le++,Je=q.next()){De.index>Le?(Ot=De,De=null):Ot=De.sibling;var $s=he(Y,De,Je.value,ve);if($s===null){De===null&&(De=Ot);break}t&&De&&$s.alternate===null&&r(Y,De),V=x($s,V,Le),Ae===null?Me=$s:Ae.sibling=$s,Ae=$s,De=Ot}if(Je.done)return n(Y,De),ut&&on(Y,Le),Me;if(De===null){for(;!Je.done;Le++,Je=q.next())Je=xe(Y,Je.value,ve),Je!==null&&(V=x(Je,V,Le),Ae===null?Me=Je:Ae.sibling=Je,Ae=Je);return ut&&on(Y,Le),Me}for(De=i(Y,De);!Je.done;Le++,Je=q.next())Je=Ce(De,Y,Le,Je.value,ve),Je!==null&&(t&&Je.alternate!==null&&De.delete(Je.key===null?Le:Je.key),V=x(Je,V,Le),Ae===null?Me=Je:Ae.sibling=Je,Ae=Je);return t&&De.forEach(function(ov){return r(Y,ov)}),ut&&on(Y,Le),Me}function bt(Y,V,q,ve){if(typeof q=="object"&&q!==null&&q.type===k&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case B:e:{for(var Me=q.key,Ae=V;Ae!==null;){if(Ae.key===Me){if(Me=q.type,Me===k){if(Ae.tag===7){n(Y,Ae.sibling),V=u(Ae,q.props.children),V.return=Y,Y=V;break e}}else if(Ae.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===ce&&Bh(Me)===Ae.type){n(Y,Ae.sibling),V=u(Ae,q.props),V.ref=Ha(Y,Ae,q),V.return=Y,Y=V;break e}n(Y,Ae);break}else r(Y,Ae);Ae=Ae.sibling}q.type===k?(V=pn(q.props.children,Y.mode,ve,q.key),V.return=Y,Y=V):(ve=Ei(q.type,q.key,q.props,null,Y.mode,ve),ve.ref=Ha(Y,V,q),ve.return=Y,Y=ve)}return w(Y);case U:e:{for(Ae=q.key;V!==null;){if(V.key===Ae)if(V.tag===4&&V.stateNode.containerInfo===q.containerInfo&&V.stateNode.implementation===q.implementation){n(Y,V.sibling),V=u(V,q.children||[]),V.return=Y,Y=V;break e}else{n(Y,V);break}else r(Y,V);V=V.sibling}V=id(q,Y.mode,ve),V.return=Y,Y=V}return w(Y);case ce:return Ae=q._init,bt(Y,V,Ae(q._payload),ve)}if(Vt(q))return Te(Y,V,q,ve);if(ne(q))return _e(Y,V,q,ve);si(Y,q)}return typeof q=="string"&&q!==""||typeof q=="number"?(q=""+q,V!==null&&V.tag===6?(n(Y,V.sibling),V=u(V,q),V.return=Y,Y=V):(n(Y,V),V=ld(q,Y.mode,ve),V.return=Y,Y=V),w(Y)):n(Y,V)}return bt}var Bn=Uh(!0),Vh=Uh(!1),ni=Ts(null),ai=null,Un=null,pc=null;function gc(){pc=Un=ai=null}function yc(t){var r=ni.current;ct(ni),t._currentValue=r}function vc(t,r,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,i!==null&&(i.childLanes|=r)):i!==null&&(i.childLanes&r)!==r&&(i.childLanes|=r),t===n)break;t=t.return}}function Vn(t,r){ai=t,pc=Un=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&r)!==0&&(sr=!0),t.firstContext=null)}function jr(t){var r=t._currentValue;if(pc!==t)if(t={context:t,memoizedValue:r,next:null},Un===null){if(ai===null)throw Error(l(308));Un=t,ai.dependencies={lanes:0,firstContext:t}}else Un=Un.next=t;return r}var cn=null;function jc(t){cn===null?cn=[t]:cn.push(t)}function Wh(t,r,n,i){var u=r.interleaved;return u===null?(n.next=n,jc(r)):(n.next=u.next,u.next=n),r.interleaved=n,ss(t,i)}function ss(t,r){t.lanes|=r;var n=t.alternate;for(n!==null&&(n.lanes|=r),n=t,t=t.return;t!==null;)t.childLanes|=r,n=t.alternate,n!==null&&(n.childLanes|=r),n=t,t=t.return;return n.tag===3?n.stateNode:null}var _s=!1;function bc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Hh(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function ns(t,r){return{eventTime:t,lane:r,tag:0,payload:null,callback:null,next:null}}function Ms(t,r,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(Xe&2)!==0){var u=i.pending;return u===null?r.next=r:(r.next=u.next,u.next=r),i.pending=r,ss(t,n)}return u=i.interleaved,u===null?(r.next=r,jc(i)):(r.next=u.next,u.next=r),i.interleaved=r,ss(t,n)}function li(t,r,n){if(r=r.updateQueue,r!==null&&(r=r.shared,(n&4194240)!==0)){var i=r.lanes;i&=t.pendingLanes,n|=i,r.lanes=n,Do(t,n)}}function Kh(t,r){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var u=null,x=null;if(n=n.firstBaseUpdate,n!==null){do{var w={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};x===null?u=x=w:x=x.next=w,n=n.next}while(n!==null);x===null?u=x=r:x=x.next=r}else u=x=r;n={baseState:i.baseState,firstBaseUpdate:u,lastBaseUpdate:x,shared:i.shared,effects:i.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=r:t.next=r,n.lastBaseUpdate=r}function ii(t,r,n,i){var u=t.updateQueue;_s=!1;var x=u.firstBaseUpdate,w=u.lastBaseUpdate,I=u.shared.pending;if(I!==null){u.shared.pending=null;var $=I,J=$.next;$.next=null,w===null?x=J:w.next=J,w=$;var me=t.alternate;me!==null&&(me=me.updateQueue,I=me.lastBaseUpdate,I!==w&&(I===null?me.firstBaseUpdate=J:I.next=J,me.lastBaseUpdate=$))}if(x!==null){var xe=u.baseState;w=0,me=J=$=null,I=x;do{var he=I.lane,Ce=I.eventTime;if((i&he)===he){me!==null&&(me=me.next={eventTime:Ce,lane:0,tag:I.tag,payload:I.payload,callback:I.callback,next:null});e:{var Te=t,_e=I;switch(he=r,Ce=n,_e.tag){case 1:if(Te=_e.payload,typeof Te=="function"){xe=Te.call(Ce,xe,he);break e}xe=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=_e.payload,he=typeof Te=="function"?Te.call(Ce,xe,he):Te,he==null)break e;xe=W({},xe,he);break e;case 2:_s=!0}}I.callback!==null&&I.lane!==0&&(t.flags|=64,he=u.effects,he===null?u.effects=[I]:he.push(I))}else Ce={eventTime:Ce,lane:he,tag:I.tag,payload:I.payload,callback:I.callback,next:null},me===null?(J=me=Ce,$=xe):me=me.next=Ce,w|=he;if(I=I.next,I===null){if(I=u.shared.pending,I===null)break;he=I,I=he.next,he.next=null,u.lastBaseUpdate=he,u.shared.pending=null}}while(!0);if(me===null&&($=xe),u.baseState=$,u.firstBaseUpdate=J,u.lastBaseUpdate=me,r=u.shared.interleaved,r!==null){u=r;do w|=u.lane,u=u.next;while(u!==r)}else x===null&&(u.shared.lanes=0);hn|=w,t.lanes=w,t.memoizedState=xe}}function Yh(t,r,n){if(t=r.effects,r.effects=null,t!==null)for(r=0;r<t.length;r++){var i=t[r],u=i.callback;if(u!==null){if(i.callback=null,i=n,typeof u!="function")throw Error(l(191,u));u.call(i)}}}var Ka={},Ur=Ts(Ka),Ya=Ts(Ka),Ga=Ts(Ka);function dn(t){if(t===Ka)throw Error(l(174));return t}function Nc(t,r){switch(lt(Ga,r),lt(Ya,t),lt(Ur,Ka),t=r.nodeType,t){case 9:case 11:r=(r=r.documentElement)?r.namespaceURI:oe(null,"");break;default:t=t===8?r.parentNode:r,r=t.namespaceURI||null,t=t.tagName,r=oe(r,t)}ct(Ur),lt(Ur,r)}function Wn(){ct(Ur),ct(Ya),ct(Ga)}function Gh(t){dn(Ga.current);var r=dn(Ur.current),n=oe(r,t.type);r!==n&&(lt(Ya,t),lt(Ur,n))}function wc(t){Ya.current===t&&(ct(Ur),ct(Ya))}var xt=Ts(0);function oi(t){for(var r=t;r!==null;){if(r.tag===13){var n=r.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Sc=[];function Cc(){for(var t=0;t<Sc.length;t++)Sc[t]._workInProgressVersionPrimary=null;Sc.length=0}var ci=R.ReactCurrentDispatcher,kc=R.ReactCurrentBatchConfig,un=0,pt=null,It=null,Dt=null,di=!1,Qa=!1,qa=0,Ry=0;function Ht(){throw Error(l(321))}function Ec(t,r){if(r===null)return!1;for(var n=0;n<r.length&&n<t.length;n++)if(!Er(t[n],r[n]))return!1;return!0}function Pc(t,r,n,i,u,x){if(un=x,pt=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,ci.current=t===null||t.memoizedState===null?Ay:Dy,t=n(i,u),Qa){x=0;do{if(Qa=!1,qa=0,25<=x)throw Error(l(301));x+=1,Dt=It=null,r.updateQueue=null,ci.current=Ly,t=n(i,u)}while(Qa)}if(ci.current=fi,r=It!==null&&It.next!==null,un=0,Dt=It=pt=null,di=!1,r)throw Error(l(300));return t}function Tc(){var t=qa!==0;return qa=0,t}function Vr(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dt===null?pt.memoizedState=Dt=t:Dt=Dt.next=t,Dt}function br(){if(It===null){var t=pt.alternate;t=t!==null?t.memoizedState:null}else t=It.next;var r=Dt===null?pt.memoizedState:Dt.next;if(r!==null)Dt=r,It=t;else{if(t===null)throw Error(l(310));It=t,t={memoizedState:It.memoizedState,baseState:It.baseState,baseQueue:It.baseQueue,queue:It.queue,next:null},Dt===null?pt.memoizedState=Dt=t:Dt=Dt.next=t}return Dt}function Xa(t,r){return typeof r=="function"?r(t):r}function Rc(t){var r=br(),n=r.queue;if(n===null)throw Error(l(311));n.lastRenderedReducer=t;var i=It,u=i.baseQueue,x=n.pending;if(x!==null){if(u!==null){var w=u.next;u.next=x.next,x.next=w}i.baseQueue=u=x,n.pending=null}if(u!==null){x=u.next,i=i.baseState;var I=w=null,$=null,J=x;do{var me=J.lane;if((un&me)===me)$!==null&&($=$.next={lane:0,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),i=J.hasEagerState?J.eagerState:t(i,J.action);else{var xe={lane:me,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null};$===null?(I=$=xe,w=i):$=$.next=xe,pt.lanes|=me,hn|=me}J=J.next}while(J!==null&&J!==x);$===null?w=i:$.next=I,Er(i,r.memoizedState)||(sr=!0),r.memoizedState=i,r.baseState=w,r.baseQueue=$,n.lastRenderedState=i}if(t=n.interleaved,t!==null){u=t;do x=u.lane,pt.lanes|=x,hn|=x,u=u.next;while(u!==t)}else u===null&&(n.lanes=0);return[r.memoizedState,n.dispatch]}function Ic(t){var r=br(),n=r.queue;if(n===null)throw Error(l(311));n.lastRenderedReducer=t;var i=n.dispatch,u=n.pending,x=r.memoizedState;if(u!==null){n.pending=null;var w=u=u.next;do x=t(x,w.action),w=w.next;while(w!==u);Er(x,r.memoizedState)||(sr=!0),r.memoizedState=x,r.baseQueue===null&&(r.baseState=x),n.lastRenderedState=x}return[x,i]}function Qh(){}function qh(t,r){var n=pt,i=br(),u=r(),x=!Er(i.memoizedState,u);if(x&&(i.memoizedState=u,sr=!0),i=i.queue,_c(Zh.bind(null,n,i,t),[t]),i.getSnapshot!==r||x||Dt!==null&&Dt.memoizedState.tag&1){if(n.flags|=2048,Ja(9,Jh.bind(null,n,i,u,r),void 0,null),Lt===null)throw Error(l(349));(un&30)!==0||Xh(n,r,u)}return u}function Xh(t,r,n){t.flags|=16384,t={getSnapshot:r,value:n},r=pt.updateQueue,r===null?(r={lastEffect:null,stores:null},pt.updateQueue=r,r.stores=[t]):(n=r.stores,n===null?r.stores=[t]:n.push(t))}function Jh(t,r,n,i){r.value=n,r.getSnapshot=i,ef(r)&&tf(t)}function Zh(t,r,n){return n(function(){ef(r)&&tf(t)})}function ef(t){var r=t.getSnapshot;t=t.value;try{var n=r();return!Er(t,n)}catch{return!0}}function tf(t){var r=ss(t,1);r!==null&&_r(r,t,1,-1)}function rf(t){var r=Vr();return typeof t=="function"&&(t=t()),r.memoizedState=r.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Xa,lastRenderedState:t},r.queue=t,t=t.dispatch=My.bind(null,pt,t),[r.memoizedState,t]}function Ja(t,r,n,i){return t={tag:t,create:r,destroy:n,deps:i,next:null},r=pt.updateQueue,r===null?(r={lastEffect:null,stores:null},pt.updateQueue=r,r.lastEffect=t.next=t):(n=r.lastEffect,n===null?r.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,r.lastEffect=t)),t}function sf(){return br().memoizedState}function ui(t,r,n,i){var u=Vr();pt.flags|=t,u.memoizedState=Ja(1|r,n,void 0,i===void 0?null:i)}function hi(t,r,n,i){var u=br();i=i===void 0?null:i;var x=void 0;if(It!==null){var w=It.memoizedState;if(x=w.destroy,i!==null&&Ec(i,w.deps)){u.memoizedState=Ja(r,n,x,i);return}}pt.flags|=t,u.memoizedState=Ja(1|r,n,x,i)}function nf(t,r){return ui(8390656,8,t,r)}function _c(t,r){return hi(2048,8,t,r)}function af(t,r){return hi(4,2,t,r)}function lf(t,r){return hi(4,4,t,r)}function of(t,r){if(typeof r=="function")return t=t(),r(t),function(){r(null)};if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function cf(t,r,n){return n=n!=null?n.concat([t]):null,hi(4,4,of.bind(null,r,t),n)}function Mc(){}function df(t,r){var n=br();r=r===void 0?null:r;var i=n.memoizedState;return i!==null&&r!==null&&Ec(r,i[1])?i[0]:(n.memoizedState=[t,r],t)}function uf(t,r){var n=br();r=r===void 0?null:r;var i=n.memoizedState;return i!==null&&r!==null&&Ec(r,i[1])?i[0]:(t=t(),n.memoizedState=[t,r],t)}function hf(t,r,n){return(un&21)===0?(t.baseState&&(t.baseState=!1,sr=!0),t.memoizedState=n):(Er(n,r)||(n=Bu(),pt.lanes|=n,hn|=n,t.baseState=!0),r)}function Iy(t,r){var n=rt;rt=n!==0&&4>n?n:4,t(!0);var i=kc.transition;kc.transition={};try{t(!1),r()}finally{rt=n,kc.transition=i}}function ff(){return br().memoizedState}function _y(t,r,n){var i=Os(t);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},mf(t))xf(r,n);else if(n=Wh(t,r,n,i),n!==null){var u=Jt();_r(n,t,i,u),pf(n,r,i)}}function My(t,r,n){var i=Os(t),u={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(mf(t))xf(r,u);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=r.lastRenderedReducer,x!==null))try{var w=r.lastRenderedState,I=x(w,n);if(u.hasEagerState=!0,u.eagerState=I,Er(I,w)){var $=r.interleaved;$===null?(u.next=u,jc(r)):(u.next=$.next,$.next=u),r.interleaved=u;return}}catch{}finally{}n=Wh(t,r,u,i),n!==null&&(u=Jt(),_r(n,t,i,u),pf(n,r,i))}}function mf(t){var r=t.alternate;return t===pt||r!==null&&r===pt}function xf(t,r){Qa=di=!0;var n=t.pending;n===null?r.next=r:(r.next=n.next,n.next=r),t.pending=r}function pf(t,r,n){if((n&4194240)!==0){var i=r.lanes;i&=t.pendingLanes,n|=i,r.lanes=n,Do(t,n)}}var fi={readContext:jr,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useInsertionEffect:Ht,useLayoutEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useMutableSource:Ht,useSyncExternalStore:Ht,useId:Ht,unstable_isNewReconciler:!1},Ay={readContext:jr,useCallback:function(t,r){return Vr().memoizedState=[t,r===void 0?null:r],t},useContext:jr,useEffect:nf,useImperativeHandle:function(t,r,n){return n=n!=null?n.concat([t]):null,ui(4194308,4,of.bind(null,r,t),n)},useLayoutEffect:function(t,r){return ui(4194308,4,t,r)},useInsertionEffect:function(t,r){return ui(4,2,t,r)},useMemo:function(t,r){var n=Vr();return r=r===void 0?null:r,t=t(),n.memoizedState=[t,r],t},useReducer:function(t,r,n){var i=Vr();return r=n!==void 0?n(r):r,i.memoizedState=i.baseState=r,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},i.queue=t,t=t.dispatch=_y.bind(null,pt,t),[i.memoizedState,t]},useRef:function(t){var r=Vr();return t={current:t},r.memoizedState=t},useState:rf,useDebugValue:Mc,useDeferredValue:function(t){return Vr().memoizedState=t},useTransition:function(){var t=rf(!1),r=t[0];return t=Iy.bind(null,t[1]),Vr().memoizedState=t,[r,t]},useMutableSource:function(){},useSyncExternalStore:function(t,r,n){var i=pt,u=Vr();if(ut){if(n===void 0)throw Error(l(407));n=n()}else{if(n=r(),Lt===null)throw Error(l(349));(un&30)!==0||Xh(i,r,n)}u.memoizedState=n;var x={value:n,getSnapshot:r};return u.queue=x,nf(Zh.bind(null,i,x,t),[t]),i.flags|=2048,Ja(9,Jh.bind(null,i,x,n,r),void 0,null),n},useId:function(){var t=Vr(),r=Lt.identifierPrefix;if(ut){var n=rs,i=ts;n=(i&~(1<<32-kr(i)-1)).toString(32)+n,r=":"+r+"R"+n,n=qa++,0<n&&(r+="H"+n.toString(32)),r+=":"}else n=Ry++,r=":"+r+"r"+n.toString(32)+":";return t.memoizedState=r},unstable_isNewReconciler:!1},Dy={readContext:jr,useCallback:df,useContext:jr,useEffect:_c,useImperativeHandle:cf,useInsertionEffect:af,useLayoutEffect:lf,useMemo:uf,useReducer:Rc,useRef:sf,useState:function(){return Rc(Xa)},useDebugValue:Mc,useDeferredValue:function(t){var r=br();return hf(r,It.memoizedState,t)},useTransition:function(){var t=Rc(Xa)[0],r=br().memoizedState;return[t,r]},useMutableSource:Qh,useSyncExternalStore:qh,useId:ff,unstable_isNewReconciler:!1},Ly={readContext:jr,useCallback:df,useContext:jr,useEffect:_c,useImperativeHandle:cf,useInsertionEffect:af,useLayoutEffect:lf,useMemo:uf,useReducer:Ic,useRef:sf,useState:function(){return Ic(Xa)},useDebugValue:Mc,useDeferredValue:function(t){var r=br();return It===null?r.memoizedState=t:hf(r,It.memoizedState,t)},useTransition:function(){var t=Ic(Xa)[0],r=br().memoizedState;return[t,r]},useMutableSource:Qh,useSyncExternalStore:qh,useId:ff,unstable_isNewReconciler:!1};function Tr(t,r){if(t&&t.defaultProps){r=W({},r),t=t.defaultProps;for(var n in t)r[n]===void 0&&(r[n]=t[n]);return r}return r}function Ac(t,r,n,i){r=t.memoizedState,n=n(i,r),n=n==null?r:W({},r,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var mi={isMounted:function(t){return(t=t._reactInternals)?at(t)===t:!1},enqueueSetState:function(t,r,n){t=t._reactInternals;var i=Jt(),u=Os(t),x=ns(i,u);x.payload=r,n!=null&&(x.callback=n),r=Ms(t,x,u),r!==null&&(_r(r,t,u,i),li(r,t,u))},enqueueReplaceState:function(t,r,n){t=t._reactInternals;var i=Jt(),u=Os(t),x=ns(i,u);x.tag=1,x.payload=r,n!=null&&(x.callback=n),r=Ms(t,x,u),r!==null&&(_r(r,t,u,i),li(r,t,u))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var n=Jt(),i=Os(t),u=ns(n,i);u.tag=2,r!=null&&(u.callback=r),r=Ms(t,u,i),r!==null&&(_r(r,t,i,n),li(r,t,i))}};function gf(t,r,n,i,u,x,w){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,x,w):r.prototype&&r.prototype.isPureReactComponent?!Fa(n,i)||!Fa(u,x):!0}function yf(t,r,n){var i=!1,u=Rs,x=r.contextType;return typeof x=="object"&&x!==null?x=jr(x):(u=rr(r)?an:Wt.current,i=r.contextTypes,x=(i=i!=null)?On(t,u):Rs),r=new r(n,x),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=mi,t.stateNode=r,r._reactInternals=t,i&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=u,t.__reactInternalMemoizedMaskedChildContext=x),r}function vf(t,r,n,i){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(n,i),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(n,i),r.state!==t&&mi.enqueueReplaceState(r,r.state,null)}function Dc(t,r,n,i){var u=t.stateNode;u.props=n,u.state=t.memoizedState,u.refs={},bc(t);var x=r.contextType;typeof x=="object"&&x!==null?u.context=jr(x):(x=rr(r)?an:Wt.current,u.context=On(t,x)),u.state=t.memoizedState,x=r.getDerivedStateFromProps,typeof x=="function"&&(Ac(t,r,x,n),u.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(r=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),r!==u.state&&mi.enqueueReplaceState(u,u.state,null),ii(t,n,u,i),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308)}function Hn(t,r){try{var n="",i=r;do n+=H(i),i=i.return;while(i);var u=n}catch(x){u=`
Error generating stack: `+x.message+`
`+x.stack}return{value:t,source:r,stack:u,digest:null}}function Lc(t,r,n){return{value:t,source:null,stack:n??null,digest:r??null}}function Oc(t,r){try{console.error(r.value)}catch(n){setTimeout(function(){throw n})}}var Oy=typeof WeakMap=="function"?WeakMap:Map;function jf(t,r,n){n=ns(-1,n),n.tag=3,n.payload={element:null};var i=r.value;return n.callback=function(){bi||(bi=!0,Jc=i),Oc(t,r)},n}function bf(t,r,n){n=ns(-1,n),n.tag=3;var i=t.type.getDerivedStateFromError;if(typeof i=="function"){var u=r.value;n.payload=function(){return i(u)},n.callback=function(){Oc(t,r)}}var x=t.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(n.callback=function(){Oc(t,r),typeof i!="function"&&(Ds===null?Ds=new Set([this]):Ds.add(this));var w=r.stack;this.componentDidCatch(r.value,{componentStack:w!==null?w:""})}),n}function Nf(t,r,n){var i=t.pingCache;if(i===null){i=t.pingCache=new Oy;var u=new Set;i.set(r,u)}else u=i.get(r),u===void 0&&(u=new Set,i.set(r,u));u.has(n)||(u.add(n),t=Xy.bind(null,t,r,n),r.then(t,t))}function wf(t){do{var r;if((r=t.tag===13)&&(r=t.memoizedState,r=r!==null?r.dehydrated!==null:!0),r)return t;t=t.return}while(t!==null);return null}function Sf(t,r,n,i,u){return(t.mode&1)===0?(t===r?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(r=ns(-1,1),r.tag=2,Ms(n,r,1))),n.lanes|=1),t):(t.flags|=65536,t.lanes=u,t)}var Fy=R.ReactCurrentOwner,sr=!1;function Xt(t,r,n,i){r.child=t===null?Vh(r,null,n,i):Bn(r,t.child,n,i)}function Cf(t,r,n,i,u){n=n.render;var x=r.ref;return Vn(r,u),i=Pc(t,r,n,i,x,u),n=Tc(),t!==null&&!sr?(r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~u,as(t,r,u)):(ut&&n&&uc(r),r.flags|=1,Xt(t,r,i,u),r.child)}function kf(t,r,n,i,u){if(t===null){var x=n.type;return typeof x=="function"&&!ad(x)&&x.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(r.tag=15,r.type=x,Ef(t,r,x,i,u)):(t=Ei(n.type,null,i,r,r.mode,u),t.ref=r.ref,t.return=r,r.child=t)}if(x=t.child,(t.lanes&u)===0){var w=x.memoizedProps;if(n=n.compare,n=n!==null?n:Fa,n(w,i)&&t.ref===r.ref)return as(t,r,u)}return r.flags|=1,t=zs(x,i),t.ref=r.ref,t.return=r,r.child=t}function Ef(t,r,n,i,u){if(t!==null){var x=t.memoizedProps;if(Fa(x,i)&&t.ref===r.ref)if(sr=!1,r.pendingProps=i=x,(t.lanes&u)!==0)(t.flags&131072)!==0&&(sr=!0);else return r.lanes=t.lanes,as(t,r,u)}return Fc(t,r,n,i,u)}function Pf(t,r,n){var i=r.pendingProps,u=i.children,x=t!==null?t.memoizedState:null;if(i.mode==="hidden")if((r.mode&1)===0)r.memoizedState={baseLanes:0,cachePool:null,transitions:null},lt(Yn,mr),mr|=n;else{if((n&1073741824)===0)return t=x!==null?x.baseLanes|n:n,r.lanes=r.childLanes=1073741824,r.memoizedState={baseLanes:t,cachePool:null,transitions:null},r.updateQueue=null,lt(Yn,mr),mr|=t,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=x!==null?x.baseLanes:n,lt(Yn,mr),mr|=i}else x!==null?(i=x.baseLanes|n,r.memoizedState=null):i=n,lt(Yn,mr),mr|=i;return Xt(t,r,u,n),r.child}function Tf(t,r){var n=r.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(r.flags|=512,r.flags|=2097152)}function Fc(t,r,n,i,u){var x=rr(n)?an:Wt.current;return x=On(r,x),Vn(r,u),n=Pc(t,r,n,i,x,u),i=Tc(),t!==null&&!sr?(r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~u,as(t,r,u)):(ut&&i&&uc(r),r.flags|=1,Xt(t,r,n,u),r.child)}function Rf(t,r,n,i,u){if(rr(n)){var x=!0;Jl(r)}else x=!1;if(Vn(r,u),r.stateNode===null)pi(t,r),yf(r,n,i),Dc(r,n,i,u),i=!0;else if(t===null){var w=r.stateNode,I=r.memoizedProps;w.props=I;var $=w.context,J=n.contextType;typeof J=="object"&&J!==null?J=jr(J):(J=rr(n)?an:Wt.current,J=On(r,J));var me=n.getDerivedStateFromProps,xe=typeof me=="function"||typeof w.getSnapshotBeforeUpdate=="function";xe||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(I!==i||$!==J)&&vf(r,w,i,J),_s=!1;var he=r.memoizedState;w.state=he,ii(r,i,w,u),$=r.memoizedState,I!==i||he!==$||tr.current||_s?(typeof me=="function"&&(Ac(r,n,me,i),$=r.memoizedState),(I=_s||gf(r,n,I,i,he,$,J))?(xe||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(r.flags|=4194308)):(typeof w.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=i,r.memoizedState=$),w.props=i,w.state=$,w.context=J,i=I):(typeof w.componentDidMount=="function"&&(r.flags|=4194308),i=!1)}else{w=r.stateNode,Hh(t,r),I=r.memoizedProps,J=r.type===r.elementType?I:Tr(r.type,I),w.props=J,xe=r.pendingProps,he=w.context,$=n.contextType,typeof $=="object"&&$!==null?$=jr($):($=rr(n)?an:Wt.current,$=On(r,$));var Ce=n.getDerivedStateFromProps;(me=typeof Ce=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(I!==xe||he!==$)&&vf(r,w,i,$),_s=!1,he=r.memoizedState,w.state=he,ii(r,i,w,u);var Te=r.memoizedState;I!==xe||he!==Te||tr.current||_s?(typeof Ce=="function"&&(Ac(r,n,Ce,i),Te=r.memoizedState),(J=_s||gf(r,n,J,i,he,Te,$)||!1)?(me||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(i,Te,$),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(i,Te,$)),typeof w.componentDidUpdate=="function"&&(r.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof w.componentDidUpdate!="function"||I===t.memoizedProps&&he===t.memoizedState||(r.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||I===t.memoizedProps&&he===t.memoizedState||(r.flags|=1024),r.memoizedProps=i,r.memoizedState=Te),w.props=i,w.state=Te,w.context=$,i=J):(typeof w.componentDidUpdate!="function"||I===t.memoizedProps&&he===t.memoizedState||(r.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||I===t.memoizedProps&&he===t.memoizedState||(r.flags|=1024),i=!1)}return zc(t,r,n,i,x,u)}function zc(t,r,n,i,u,x){Tf(t,r);var w=(r.flags&128)!==0;if(!i&&!w)return u&&Ah(r,n,!1),as(t,r,x);i=r.stateNode,Fy.current=r;var I=w&&typeof n.getDerivedStateFromError!="function"?null:i.render();return r.flags|=1,t!==null&&w?(r.child=Bn(r,t.child,null,x),r.child=Bn(r,null,I,x)):Xt(t,r,I,x),r.memoizedState=i.state,u&&Ah(r,n,!0),r.child}function If(t){var r=t.stateNode;r.pendingContext?_h(t,r.pendingContext,r.pendingContext!==r.context):r.context&&_h(t,r.context,!1),Nc(t,r.containerInfo)}function _f(t,r,n,i,u){return $n(),xc(u),r.flags|=256,Xt(t,r,n,i),r.child}var $c={dehydrated:null,treeContext:null,retryLane:0};function Bc(t){return{baseLanes:t,cachePool:null,transitions:null}}function Mf(t,r,n){var i=r.pendingProps,u=xt.current,x=!1,w=(r.flags&128)!==0,I;if((I=w)||(I=t!==null&&t.memoizedState===null?!1:(u&2)!==0),I?(x=!0,r.flags&=-129):(t===null||t.memoizedState!==null)&&(u|=1),lt(xt,u&1),t===null)return mc(r),t=r.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?((r.mode&1)===0?r.lanes=1:t.data==="$!"?r.lanes=8:r.lanes=1073741824,null):(w=i.children,t=i.fallback,x?(i=r.mode,x=r.child,w={mode:"hidden",children:w},(i&1)===0&&x!==null?(x.childLanes=0,x.pendingProps=w):x=Pi(w,i,0,null),t=pn(t,i,n,null),x.return=r,t.return=r,x.sibling=t,r.child=x,r.child.memoizedState=Bc(n),r.memoizedState=$c,t):Uc(r,w));if(u=t.memoizedState,u!==null&&(I=u.dehydrated,I!==null))return zy(t,r,w,i,I,u,n);if(x){x=i.fallback,w=r.mode,u=t.child,I=u.sibling;var $={mode:"hidden",children:i.children};return(w&1)===0&&r.child!==u?(i=r.child,i.childLanes=0,i.pendingProps=$,r.deletions=null):(i=zs(u,$),i.subtreeFlags=u.subtreeFlags&14680064),I!==null?x=zs(I,x):(x=pn(x,w,n,null),x.flags|=2),x.return=r,i.return=r,i.sibling=x,r.child=i,i=x,x=r.child,w=t.child.memoizedState,w=w===null?Bc(n):{baseLanes:w.baseLanes|n,cachePool:null,transitions:w.transitions},x.memoizedState=w,x.childLanes=t.childLanes&~n,r.memoizedState=$c,i}return x=t.child,t=x.sibling,i=zs(x,{mode:"visible",children:i.children}),(r.mode&1)===0&&(i.lanes=n),i.return=r,i.sibling=null,t!==null&&(n=r.deletions,n===null?(r.deletions=[t],r.flags|=16):n.push(t)),r.child=i,r.memoizedState=null,i}function Uc(t,r){return r=Pi({mode:"visible",children:r},t.mode,0,null),r.return=t,t.child=r}function xi(t,r,n,i){return i!==null&&xc(i),Bn(r,t.child,null,n),t=Uc(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function zy(t,r,n,i,u,x,w){if(n)return r.flags&256?(r.flags&=-257,i=Lc(Error(l(422))),xi(t,r,w,i)):r.memoizedState!==null?(r.child=t.child,r.flags|=128,null):(x=i.fallback,u=r.mode,i=Pi({mode:"visible",children:i.children},u,0,null),x=pn(x,u,w,null),x.flags|=2,i.return=r,x.return=r,i.sibling=x,r.child=i,(r.mode&1)!==0&&Bn(r,t.child,null,w),r.child.memoizedState=Bc(w),r.memoizedState=$c,x);if((r.mode&1)===0)return xi(t,r,w,null);if(u.data==="$!"){if(i=u.nextSibling&&u.nextSibling.dataset,i)var I=i.dgst;return i=I,x=Error(l(419)),i=Lc(x,i,void 0),xi(t,r,w,i)}if(I=(w&t.childLanes)!==0,sr||I){if(i=Lt,i!==null){switch(w&-w){case 4:u=2;break;case 16:u=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:u=32;break;case 536870912:u=268435456;break;default:u=0}u=(u&(i.suspendedLanes|w))!==0?0:u,u!==0&&u!==x.retryLane&&(x.retryLane=u,ss(t,u),_r(i,t,u,-1))}return nd(),i=Lc(Error(l(421))),xi(t,r,w,i)}return u.data==="$?"?(r.flags|=128,r.child=t.child,r=Jy.bind(null,t),u._reactRetry=r,null):(t=x.treeContext,fr=Ps(u.nextSibling),hr=r,ut=!0,Pr=null,t!==null&&(yr[vr++]=ts,yr[vr++]=rs,yr[vr++]=ln,ts=t.id,rs=t.overflow,ln=r),r=Uc(r,i.children),r.flags|=4096,r)}function Af(t,r,n){t.lanes|=r;var i=t.alternate;i!==null&&(i.lanes|=r),vc(t.return,r,n)}function Vc(t,r,n,i,u){var x=t.memoizedState;x===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:u}:(x.isBackwards=r,x.rendering=null,x.renderingStartTime=0,x.last=i,x.tail=n,x.tailMode=u)}function Df(t,r,n){var i=r.pendingProps,u=i.revealOrder,x=i.tail;if(Xt(t,r,i.children,n),i=xt.current,(i&2)!==0)i=i&1|2,r.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Af(t,n,r);else if(t.tag===19)Af(t,n,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}i&=1}if(lt(xt,i),(r.mode&1)===0)r.memoizedState=null;else switch(u){case"forwards":for(n=r.child,u=null;n!==null;)t=n.alternate,t!==null&&oi(t)===null&&(u=n),n=n.sibling;n=u,n===null?(u=r.child,r.child=null):(u=n.sibling,n.sibling=null),Vc(r,!1,u,n,x);break;case"backwards":for(n=null,u=r.child,r.child=null;u!==null;){if(t=u.alternate,t!==null&&oi(t)===null){r.child=u;break}t=u.sibling,u.sibling=n,n=u,u=t}Vc(r,!0,n,null,x);break;case"together":Vc(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function pi(t,r){(r.mode&1)===0&&t!==null&&(t.alternate=null,r.alternate=null,r.flags|=2)}function as(t,r,n){if(t!==null&&(r.dependencies=t.dependencies),hn|=r.lanes,(n&r.childLanes)===0)return null;if(t!==null&&r.child!==t.child)throw Error(l(153));if(r.child!==null){for(t=r.child,n=zs(t,t.pendingProps),r.child=n,n.return=r;t.sibling!==null;)t=t.sibling,n=n.sibling=zs(t,t.pendingProps),n.return=r;n.sibling=null}return r.child}function $y(t,r,n){switch(r.tag){case 3:If(r),$n();break;case 5:Gh(r);break;case 1:rr(r.type)&&Jl(r);break;case 4:Nc(r,r.stateNode.containerInfo);break;case 10:var i=r.type._context,u=r.memoizedProps.value;lt(ni,i._currentValue),i._currentValue=u;break;case 13:if(i=r.memoizedState,i!==null)return i.dehydrated!==null?(lt(xt,xt.current&1),r.flags|=128,null):(n&r.child.childLanes)!==0?Mf(t,r,n):(lt(xt,xt.current&1),t=as(t,r,n),t!==null?t.sibling:null);lt(xt,xt.current&1);break;case 19:if(i=(n&r.childLanes)!==0,(t.flags&128)!==0){if(i)return Df(t,r,n);r.flags|=128}if(u=r.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),lt(xt,xt.current),i)break;return null;case 22:case 23:return r.lanes=0,Pf(t,r,n)}return as(t,r,n)}var Lf,Wc,Of,Ff;Lf=function(t,r){for(var n=r.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===r)break;for(;n.sibling===null;){if(n.return===null||n.return===r)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Wc=function(){},Of=function(t,r,n,i){var u=t.memoizedProps;if(u!==i){t=r.stateNode,dn(Ur.current);var x=null;switch(n){case"input":u=We(t,u),i=We(t,i),x=[];break;case"select":u=W({},u,{value:void 0}),i=W({},i,{value:void 0}),x=[];break;case"textarea":u=Xr(t,u),i=Xr(t,i),x=[];break;default:typeof u.onClick!="function"&&typeof i.onClick=="function"&&(t.onclick=Ql)}ya(n,i);var w;n=null;for(J in u)if(!i.hasOwnProperty(J)&&u.hasOwnProperty(J)&&u[J]!=null)if(J==="style"){var I=u[J];for(w in I)I.hasOwnProperty(w)&&(n||(n={}),n[w]="")}else J!=="dangerouslySetInnerHTML"&&J!=="children"&&J!=="suppressContentEditableWarning"&&J!=="suppressHydrationWarning"&&J!=="autoFocus"&&(c.hasOwnProperty(J)?x||(x=[]):(x=x||[]).push(J,null));for(J in i){var $=i[J];if(I=u!=null?u[J]:void 0,i.hasOwnProperty(J)&&$!==I&&($!=null||I!=null))if(J==="style")if(I){for(w in I)!I.hasOwnProperty(w)||$&&$.hasOwnProperty(w)||(n||(n={}),n[w]="");for(w in $)$.hasOwnProperty(w)&&I[w]!==$[w]&&(n||(n={}),n[w]=$[w])}else n||(x||(x=[]),x.push(J,n)),n=$;else J==="dangerouslySetInnerHTML"?($=$?$.__html:void 0,I=I?I.__html:void 0,$!=null&&I!==$&&(x=x||[]).push(J,$)):J==="children"?typeof $!="string"&&typeof $!="number"||(x=x||[]).push(J,""+$):J!=="suppressContentEditableWarning"&&J!=="suppressHydrationWarning"&&(c.hasOwnProperty(J)?($!=null&&J==="onScroll"&&ot("scroll",t),x||I===$||(x=[])):(x=x||[]).push(J,$))}n&&(x=x||[]).push("style",n);var J=x;(r.updateQueue=J)&&(r.flags|=4)}},Ff=function(t,r,n,i){n!==i&&(r.flags|=4)};function Za(t,r){if(!ut)switch(t.tailMode){case"hidden":r=t.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function Kt(t){var r=t.alternate!==null&&t.alternate.child===t.child,n=0,i=0;if(r)for(var u=t.child;u!==null;)n|=u.lanes|u.childLanes,i|=u.subtreeFlags&14680064,i|=u.flags&14680064,u.return=t,u=u.sibling;else for(u=t.child;u!==null;)n|=u.lanes|u.childLanes,i|=u.subtreeFlags,i|=u.flags,u.return=t,u=u.sibling;return t.subtreeFlags|=i,t.childLanes=n,r}function By(t,r,n){var i=r.pendingProps;switch(hc(r),r.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Kt(r),null;case 1:return rr(r.type)&&Xl(),Kt(r),null;case 3:return i=r.stateNode,Wn(),ct(tr),ct(Wt),Cc(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(t===null||t.child===null)&&(ri(r)?r.flags|=4:t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Pr!==null&&(td(Pr),Pr=null))),Wc(t,r),Kt(r),null;case 5:wc(r);var u=dn(Ga.current);if(n=r.type,t!==null&&r.stateNode!=null)Of(t,r,n,i,u),t.ref!==r.ref&&(r.flags|=512,r.flags|=2097152);else{if(!i){if(r.stateNode===null)throw Error(l(166));return Kt(r),null}if(t=dn(Ur.current),ri(r)){i=r.stateNode,n=r.type;var x=r.memoizedProps;switch(i[Br]=r,i[Va]=x,t=(r.mode&1)!==0,n){case"dialog":ot("cancel",i),ot("close",i);break;case"iframe":case"object":case"embed":ot("load",i);break;case"video":case"audio":for(u=0;u<$a.length;u++)ot($a[u],i);break;case"source":ot("error",i);break;case"img":case"image":case"link":ot("error",i),ot("load",i);break;case"details":ot("toggle",i);break;case"input":qe(i,x),ot("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!x.multiple},ot("invalid",i);break;case"textarea":xs(i,x),ot("invalid",i)}ya(n,x),u=null;for(var w in x)if(x.hasOwnProperty(w)){var I=x[w];w==="children"?typeof I=="string"?i.textContent!==I&&(x.suppressHydrationWarning!==!0&&Gl(i.textContent,I,t),u=["children",I]):typeof I=="number"&&i.textContent!==""+I&&(x.suppressHydrationWarning!==!0&&Gl(i.textContent,I,t),u=["children",""+I]):c.hasOwnProperty(w)&&I!=null&&w==="onScroll"&&ot("scroll",i)}switch(n){case"input":fe(i),ft(i,x,!0);break;case"textarea":fe(i),$t(i);break;case"select":case"option":break;default:typeof x.onClick=="function"&&(i.onclick=Ql)}i=u,r.updateQueue=i,i!==null&&(r.flags|=4)}else{w=u.nodeType===9?u:u.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=gs(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=w.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof i.is=="string"?t=w.createElement(n,{is:i.is}):(t=w.createElement(n),n==="select"&&(w=t,i.multiple?w.multiple=!0:i.size&&(w.size=i.size))):t=w.createElementNS(t,n),t[Br]=r,t[Va]=i,Lf(t,r,!1,!1),r.stateNode=t;e:{switch(w=va(n,i),n){case"dialog":ot("cancel",t),ot("close",t),u=i;break;case"iframe":case"object":case"embed":ot("load",t),u=i;break;case"video":case"audio":for(u=0;u<$a.length;u++)ot($a[u],t);u=i;break;case"source":ot("error",t),u=i;break;case"img":case"image":case"link":ot("error",t),ot("load",t),u=i;break;case"details":ot("toggle",t),u=i;break;case"input":qe(t,i),u=We(t,i),ot("invalid",t);break;case"option":u=i;break;case"select":t._wrapperState={wasMultiple:!!i.multiple},u=W({},i,{value:void 0}),ot("invalid",t);break;case"textarea":xs(t,i),u=Xr(t,i),ot("invalid",t);break;default:u=i}ya(n,u),I=u;for(x in I)if(I.hasOwnProperty(x)){var $=I[x];x==="style"?ga(t,$):x==="dangerouslySetInnerHTML"?($=$?$.__html:void 0,$!=null&&Tt(t,$)):x==="children"?typeof $=="string"?(n!=="textarea"||$!=="")&&dr(t,$):typeof $=="number"&&dr(t,""+$):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(c.hasOwnProperty(x)?$!=null&&x==="onScroll"&&ot("scroll",t):$!=null&&j(t,x,$,w))}switch(n){case"input":fe(t),ft(t,i,!1);break;case"textarea":fe(t),$t(t);break;case"option":i.value!=null&&t.setAttribute("value",""+ye(i.value));break;case"select":t.multiple=!!i.multiple,x=i.value,x!=null?Fr(t,!!i.multiple,x,!1):i.defaultValue!=null&&Fr(t,!!i.multiple,i.defaultValue,!0);break;default:typeof u.onClick=="function"&&(t.onclick=Ql)}switch(n){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(r.flags|=4)}r.ref!==null&&(r.flags|=512,r.flags|=2097152)}return Kt(r),null;case 6:if(t&&r.stateNode!=null)Ff(t,r,t.memoizedProps,i);else{if(typeof i!="string"&&r.stateNode===null)throw Error(l(166));if(n=dn(Ga.current),dn(Ur.current),ri(r)){if(i=r.stateNode,n=r.memoizedProps,i[Br]=r,(x=i.nodeValue!==n)&&(t=hr,t!==null))switch(t.tag){case 3:Gl(i.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Gl(i.nodeValue,n,(t.mode&1)!==0)}x&&(r.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[Br]=r,r.stateNode=i}return Kt(r),null;case 13:if(ct(xt),i=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(ut&&fr!==null&&(r.mode&1)!==0&&(r.flags&128)===0)$h(),$n(),r.flags|=98560,x=!1;else if(x=ri(r),i!==null&&i.dehydrated!==null){if(t===null){if(!x)throw Error(l(318));if(x=r.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(l(317));x[Br]=r}else $n(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Kt(r),x=!1}else Pr!==null&&(td(Pr),Pr=null),x=!0;if(!x)return r.flags&65536?r:null}return(r.flags&128)!==0?(r.lanes=n,r):(i=i!==null,i!==(t!==null&&t.memoizedState!==null)&&i&&(r.child.flags|=8192,(r.mode&1)!==0&&(t===null||(xt.current&1)!==0?_t===0&&(_t=3):nd())),r.updateQueue!==null&&(r.flags|=4),Kt(r),null);case 4:return Wn(),Wc(t,r),t===null&&Ba(r.stateNode.containerInfo),Kt(r),null;case 10:return yc(r.type._context),Kt(r),null;case 17:return rr(r.type)&&Xl(),Kt(r),null;case 19:if(ct(xt),x=r.memoizedState,x===null)return Kt(r),null;if(i=(r.flags&128)!==0,w=x.rendering,w===null)if(i)Za(x,!1);else{if(_t!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(w=oi(t),w!==null){for(r.flags|=128,Za(x,!1),i=w.updateQueue,i!==null&&(r.updateQueue=i,r.flags|=4),r.subtreeFlags=0,i=n,n=r.child;n!==null;)x=n,t=i,x.flags&=14680066,w=x.alternate,w===null?(x.childLanes=0,x.lanes=t,x.child=null,x.subtreeFlags=0,x.memoizedProps=null,x.memoizedState=null,x.updateQueue=null,x.dependencies=null,x.stateNode=null):(x.childLanes=w.childLanes,x.lanes=w.lanes,x.child=w.child,x.subtreeFlags=0,x.deletions=null,x.memoizedProps=w.memoizedProps,x.memoizedState=w.memoizedState,x.updateQueue=w.updateQueue,x.type=w.type,t=w.dependencies,x.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return lt(xt,xt.current&1|2),r.child}t=t.sibling}x.tail!==null&&jt()>Gn&&(r.flags|=128,i=!0,Za(x,!1),r.lanes=4194304)}else{if(!i)if(t=oi(w),t!==null){if(r.flags|=128,i=!0,n=t.updateQueue,n!==null&&(r.updateQueue=n,r.flags|=4),Za(x,!0),x.tail===null&&x.tailMode==="hidden"&&!w.alternate&&!ut)return Kt(r),null}else 2*jt()-x.renderingStartTime>Gn&&n!==1073741824&&(r.flags|=128,i=!0,Za(x,!1),r.lanes=4194304);x.isBackwards?(w.sibling=r.child,r.child=w):(n=x.last,n!==null?n.sibling=w:r.child=w,x.last=w)}return x.tail!==null?(r=x.tail,x.rendering=r,x.tail=r.sibling,x.renderingStartTime=jt(),r.sibling=null,n=xt.current,lt(xt,i?n&1|2:n&1),r):(Kt(r),null);case 22:case 23:return sd(),i=r.memoizedState!==null,t!==null&&t.memoizedState!==null!==i&&(r.flags|=8192),i&&(r.mode&1)!==0?(mr&1073741824)!==0&&(Kt(r),r.subtreeFlags&6&&(r.flags|=8192)):Kt(r),null;case 24:return null;case 25:return null}throw Error(l(156,r.tag))}function Uy(t,r){switch(hc(r),r.tag){case 1:return rr(r.type)&&Xl(),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return Wn(),ct(tr),ct(Wt),Cc(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 5:return wc(r),null;case 13:if(ct(xt),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(l(340));$n()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return ct(xt),null;case 4:return Wn(),null;case 10:return yc(r.type._context),null;case 22:case 23:return sd(),null;case 24:return null;default:return null}}var gi=!1,Yt=!1,Vy=typeof WeakSet=="function"?WeakSet:Set,Pe=null;function Kn(t,r){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){gt(t,r,i)}else n.current=null}function Hc(t,r,n){try{n()}catch(i){gt(t,r,i)}}var zf=!1;function Wy(t,r){if(sc=Ol,t=ph(),Qo(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var u=i.anchorOffset,x=i.focusNode;i=i.focusOffset;try{n.nodeType,x.nodeType}catch{n=null;break e}var w=0,I=-1,$=-1,J=0,me=0,xe=t,he=null;t:for(;;){for(var Ce;xe!==n||u!==0&&xe.nodeType!==3||(I=w+u),xe!==x||i!==0&&xe.nodeType!==3||($=w+i),xe.nodeType===3&&(w+=xe.nodeValue.length),(Ce=xe.firstChild)!==null;)he=xe,xe=Ce;for(;;){if(xe===t)break t;if(he===n&&++J===u&&(I=w),he===x&&++me===i&&($=w),(Ce=xe.nextSibling)!==null)break;xe=he,he=xe.parentNode}xe=Ce}n=I===-1||$===-1?null:{start:I,end:$}}else n=null}n=n||{start:0,end:0}}else n=null;for(nc={focusedElem:t,selectionRange:n},Ol=!1,Pe=r;Pe!==null;)if(r=Pe,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Pe=t;else for(;Pe!==null;){r=Pe;try{var Te=r.alternate;if((r.flags&1024)!==0)switch(r.tag){case 0:case 11:case 15:break;case 1:if(Te!==null){var _e=Te.memoizedProps,bt=Te.memoizedState,Y=r.stateNode,V=Y.getSnapshotBeforeUpdate(r.elementType===r.type?_e:Tr(r.type,_e),bt);Y.__reactInternalSnapshotBeforeUpdate=V}break;case 3:var q=r.stateNode.containerInfo;q.nodeType===1?q.textContent="":q.nodeType===9&&q.documentElement&&q.removeChild(q.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(ve){gt(r,r.return,ve)}if(t=r.sibling,t!==null){t.return=r.return,Pe=t;break}Pe=r.return}return Te=zf,zf=!1,Te}function el(t,r,n){var i=r.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var u=i=i.next;do{if((u.tag&t)===t){var x=u.destroy;u.destroy=void 0,x!==void 0&&Hc(r,n,x)}u=u.next}while(u!==i)}}function yi(t,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var n=r=r.next;do{if((n.tag&t)===t){var i=n.create;n.destroy=i()}n=n.next}while(n!==r)}}function Kc(t){var r=t.ref;if(r!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof r=="function"?r(t):r.current=t}}function $f(t){var r=t.alternate;r!==null&&(t.alternate=null,$f(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&(delete r[Br],delete r[Va],delete r[oc],delete r[ky],delete r[Ey])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Bf(t){return t.tag===5||t.tag===3||t.tag===4}function Uf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Bf(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Yc(t,r,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,r?n.nodeType===8?n.parentNode.insertBefore(t,r):n.insertBefore(t,r):(n.nodeType===8?(r=n.parentNode,r.insertBefore(t,n)):(r=n,r.appendChild(t)),n=n._reactRootContainer,n!=null||r.onclick!==null||(r.onclick=Ql));else if(i!==4&&(t=t.child,t!==null))for(Yc(t,r,n),t=t.sibling;t!==null;)Yc(t,r,n),t=t.sibling}function Gc(t,r,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,r?n.insertBefore(t,r):n.appendChild(t);else if(i!==4&&(t=t.child,t!==null))for(Gc(t,r,n),t=t.sibling;t!==null;)Gc(t,r,n),t=t.sibling}var Bt=null,Rr=!1;function As(t,r,n){for(n=n.child;n!==null;)Vf(t,r,n),n=n.sibling}function Vf(t,r,n){if($r&&typeof $r.onCommitFiberUnmount=="function")try{$r.onCommitFiberUnmount(Il,n)}catch{}switch(n.tag){case 5:Yt||Kn(n,r);case 6:var i=Bt,u=Rr;Bt=null,As(t,r,n),Bt=i,Rr=u,Bt!==null&&(Rr?(t=Bt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Bt.removeChild(n.stateNode));break;case 18:Bt!==null&&(Rr?(t=Bt,n=n.stateNode,t.nodeType===8?ic(t.parentNode,n):t.nodeType===1&&ic(t,n),_a(t)):ic(Bt,n.stateNode));break;case 4:i=Bt,u=Rr,Bt=n.stateNode.containerInfo,Rr=!0,As(t,r,n),Bt=i,Rr=u;break;case 0:case 11:case 14:case 15:if(!Yt&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){u=i=i.next;do{var x=u,w=x.destroy;x=x.tag,w!==void 0&&((x&2)!==0||(x&4)!==0)&&Hc(n,r,w),u=u.next}while(u!==i)}As(t,r,n);break;case 1:if(!Yt&&(Kn(n,r),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(I){gt(n,r,I)}As(t,r,n);break;case 21:As(t,r,n);break;case 22:n.mode&1?(Yt=(i=Yt)||n.memoizedState!==null,As(t,r,n),Yt=i):As(t,r,n);break;default:As(t,r,n)}}function Wf(t){var r=t.updateQueue;if(r!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new Vy),r.forEach(function(i){var u=Zy.bind(null,t,i);n.has(i)||(n.add(i),i.then(u,u))})}}function Ir(t,r){var n=r.deletions;if(n!==null)for(var i=0;i<n.length;i++){var u=n[i];try{var x=t,w=r,I=w;e:for(;I!==null;){switch(I.tag){case 5:Bt=I.stateNode,Rr=!1;break e;case 3:Bt=I.stateNode.containerInfo,Rr=!0;break e;case 4:Bt=I.stateNode.containerInfo,Rr=!0;break e}I=I.return}if(Bt===null)throw Error(l(160));Vf(x,w,u),Bt=null,Rr=!1;var $=u.alternate;$!==null&&($.return=null),u.return=null}catch(J){gt(u,r,J)}}if(r.subtreeFlags&12854)for(r=r.child;r!==null;)Hf(r,t),r=r.sibling}function Hf(t,r){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Ir(r,t),Wr(t),i&4){try{el(3,t,t.return),yi(3,t)}catch(_e){gt(t,t.return,_e)}try{el(5,t,t.return)}catch(_e){gt(t,t.return,_e)}}break;case 1:Ir(r,t),Wr(t),i&512&&n!==null&&Kn(n,n.return);break;case 5:if(Ir(r,t),Wr(t),i&512&&n!==null&&Kn(n,n.return),t.flags&32){var u=t.stateNode;try{dr(u,"")}catch(_e){gt(t,t.return,_e)}}if(i&4&&(u=t.stateNode,u!=null)){var x=t.memoizedProps,w=n!==null?n.memoizedProps:x,I=t.type,$=t.updateQueue;if(t.updateQueue=null,$!==null)try{I==="input"&&x.type==="radio"&&x.name!=null&&Ze(u,x),va(I,w);var J=va(I,x);for(w=0;w<$.length;w+=2){var me=$[w],xe=$[w+1];me==="style"?ga(u,xe):me==="dangerouslySetInnerHTML"?Tt(u,xe):me==="children"?dr(u,xe):j(u,me,xe,J)}switch(I){case"input":st(u,x);break;case"textarea":ps(u,x);break;case"select":var he=u._wrapperState.wasMultiple;u._wrapperState.wasMultiple=!!x.multiple;var Ce=x.value;Ce!=null?Fr(u,!!x.multiple,Ce,!1):he!==!!x.multiple&&(x.defaultValue!=null?Fr(u,!!x.multiple,x.defaultValue,!0):Fr(u,!!x.multiple,x.multiple?[]:"",!1))}u[Va]=x}catch(_e){gt(t,t.return,_e)}}break;case 6:if(Ir(r,t),Wr(t),i&4){if(t.stateNode===null)throw Error(l(162));u=t.stateNode,x=t.memoizedProps;try{u.nodeValue=x}catch(_e){gt(t,t.return,_e)}}break;case 3:if(Ir(r,t),Wr(t),i&4&&n!==null&&n.memoizedState.isDehydrated)try{_a(r.containerInfo)}catch(_e){gt(t,t.return,_e)}break;case 4:Ir(r,t),Wr(t);break;case 13:Ir(r,t),Wr(t),u=t.child,u.flags&8192&&(x=u.memoizedState!==null,u.stateNode.isHidden=x,!x||u.alternate!==null&&u.alternate.memoizedState!==null||(Xc=jt())),i&4&&Wf(t);break;case 22:if(me=n!==null&&n.memoizedState!==null,t.mode&1?(Yt=(J=Yt)||me,Ir(r,t),Yt=J):Ir(r,t),Wr(t),i&8192){if(J=t.memoizedState!==null,(t.stateNode.isHidden=J)&&!me&&(t.mode&1)!==0)for(Pe=t,me=t.child;me!==null;){for(xe=Pe=me;Pe!==null;){switch(he=Pe,Ce=he.child,he.tag){case 0:case 11:case 14:case 15:el(4,he,he.return);break;case 1:Kn(he,he.return);var Te=he.stateNode;if(typeof Te.componentWillUnmount=="function"){i=he,n=he.return;try{r=i,Te.props=r.memoizedProps,Te.state=r.memoizedState,Te.componentWillUnmount()}catch(_e){gt(i,n,_e)}}break;case 5:Kn(he,he.return);break;case 22:if(he.memoizedState!==null){Gf(xe);continue}}Ce!==null?(Ce.return=he,Pe=Ce):Gf(xe)}me=me.sibling}e:for(me=null,xe=t;;){if(xe.tag===5){if(me===null){me=xe;try{u=xe.stateNode,J?(x=u.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none"):(I=xe.stateNode,$=xe.memoizedProps.style,w=$!=null&&$.hasOwnProperty("display")?$.display:null,I.style.display=Nl("display",w))}catch(_e){gt(t,t.return,_e)}}}else if(xe.tag===6){if(me===null)try{xe.stateNode.nodeValue=J?"":xe.memoizedProps}catch(_e){gt(t,t.return,_e)}}else if((xe.tag!==22&&xe.tag!==23||xe.memoizedState===null||xe===t)&&xe.child!==null){xe.child.return=xe,xe=xe.child;continue}if(xe===t)break e;for(;xe.sibling===null;){if(xe.return===null||xe.return===t)break e;me===xe&&(me=null),xe=xe.return}me===xe&&(me=null),xe.sibling.return=xe.return,xe=xe.sibling}}break;case 19:Ir(r,t),Wr(t),i&4&&Wf(t);break;case 21:break;default:Ir(r,t),Wr(t)}}function Wr(t){var r=t.flags;if(r&2){try{e:{for(var n=t.return;n!==null;){if(Bf(n)){var i=n;break e}n=n.return}throw Error(l(160))}switch(i.tag){case 5:var u=i.stateNode;i.flags&32&&(dr(u,""),i.flags&=-33);var x=Uf(t);Gc(t,x,u);break;case 3:case 4:var w=i.stateNode.containerInfo,I=Uf(t);Yc(t,I,w);break;default:throw Error(l(161))}}catch($){gt(t,t.return,$)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function Hy(t,r,n){Pe=t,Kf(t)}function Kf(t,r,n){for(var i=(t.mode&1)!==0;Pe!==null;){var u=Pe,x=u.child;if(u.tag===22&&i){var w=u.memoizedState!==null||gi;if(!w){var I=u.alternate,$=I!==null&&I.memoizedState!==null||Yt;I=gi;var J=Yt;if(gi=w,(Yt=$)&&!J)for(Pe=u;Pe!==null;)w=Pe,$=w.child,w.tag===22&&w.memoizedState!==null?Qf(u):$!==null?($.return=w,Pe=$):Qf(u);for(;x!==null;)Pe=x,Kf(x),x=x.sibling;Pe=u,gi=I,Yt=J}Yf(t)}else(u.subtreeFlags&8772)!==0&&x!==null?(x.return=u,Pe=x):Yf(t)}}function Yf(t){for(;Pe!==null;){var r=Pe;if((r.flags&8772)!==0){var n=r.alternate;try{if((r.flags&8772)!==0)switch(r.tag){case 0:case 11:case 15:Yt||yi(5,r);break;case 1:var i=r.stateNode;if(r.flags&4&&!Yt)if(n===null)i.componentDidMount();else{var u=r.elementType===r.type?n.memoizedProps:Tr(r.type,n.memoizedProps);i.componentDidUpdate(u,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var x=r.updateQueue;x!==null&&Yh(r,x,i);break;case 3:var w=r.updateQueue;if(w!==null){if(n=null,r.child!==null)switch(r.child.tag){case 5:n=r.child.stateNode;break;case 1:n=r.child.stateNode}Yh(r,w,n)}break;case 5:var I=r.stateNode;if(n===null&&r.flags&4){n=I;var $=r.memoizedProps;switch(r.type){case"button":case"input":case"select":case"textarea":$.autoFocus&&n.focus();break;case"img":$.src&&(n.src=$.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(r.memoizedState===null){var J=r.alternate;if(J!==null){var me=J.memoizedState;if(me!==null){var xe=me.dehydrated;xe!==null&&_a(xe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(l(163))}Yt||r.flags&512&&Kc(r)}catch(he){gt(r,r.return,he)}}if(r===t){Pe=null;break}if(n=r.sibling,n!==null){n.return=r.return,Pe=n;break}Pe=r.return}}function Gf(t){for(;Pe!==null;){var r=Pe;if(r===t){Pe=null;break}var n=r.sibling;if(n!==null){n.return=r.return,Pe=n;break}Pe=r.return}}function Qf(t){for(;Pe!==null;){var r=Pe;try{switch(r.tag){case 0:case 11:case 15:var n=r.return;try{yi(4,r)}catch($){gt(r,n,$)}break;case 1:var i=r.stateNode;if(typeof i.componentDidMount=="function"){var u=r.return;try{i.componentDidMount()}catch($){gt(r,u,$)}}var x=r.return;try{Kc(r)}catch($){gt(r,x,$)}break;case 5:var w=r.return;try{Kc(r)}catch($){gt(r,w,$)}}}catch($){gt(r,r.return,$)}if(r===t){Pe=null;break}var I=r.sibling;if(I!==null){I.return=r.return,Pe=I;break}Pe=r.return}}var Ky=Math.ceil,vi=R.ReactCurrentDispatcher,Qc=R.ReactCurrentOwner,Nr=R.ReactCurrentBatchConfig,Xe=0,Lt=null,Pt=null,Ut=0,mr=0,Yn=Ts(0),_t=0,tl=null,hn=0,ji=0,qc=0,rl=null,nr=null,Xc=0,Gn=1/0,ls=null,bi=!1,Jc=null,Ds=null,Ni=!1,Ls=null,wi=0,sl=0,Zc=null,Si=-1,Ci=0;function Jt(){return(Xe&6)!==0?jt():Si!==-1?Si:Si=jt()}function Os(t){return(t.mode&1)===0?1:(Xe&2)!==0&&Ut!==0?Ut&-Ut:Ty.transition!==null?(Ci===0&&(Ci=Bu()),Ci):(t=rt,t!==0||(t=window.event,t=t===void 0?16:qu(t.type)),t)}function _r(t,r,n,i){if(50<sl)throw sl=0,Zc=null,Error(l(185));Ea(t,n,i),((Xe&2)===0||t!==Lt)&&(t===Lt&&((Xe&2)===0&&(ji|=n),_t===4&&Fs(t,Ut)),ar(t,i),n===1&&Xe===0&&(r.mode&1)===0&&(Gn=jt()+500,Zl&&Is()))}function ar(t,r){var n=t.callbackNode;T0(t,r);var i=Al(t,t===Lt?Ut:0);if(i===0)n!==null&&Fu(n),t.callbackNode=null,t.callbackPriority=0;else if(r=i&-i,t.callbackPriority!==r){if(n!=null&&Fu(n),r===1)t.tag===0?Py(Xf.bind(null,t)):Dh(Xf.bind(null,t)),Sy(function(){(Xe&6)===0&&Is()}),n=null;else{switch(Uu(i)){case 1:n=_o;break;case 4:n=zu;break;case 16:n=Rl;break;case 536870912:n=$u;break;default:n=Rl}n=am(n,qf.bind(null,t))}t.callbackPriority=r,t.callbackNode=n}}function qf(t,r){if(Si=-1,Ci=0,(Xe&6)!==0)throw Error(l(327));var n=t.callbackNode;if(Qn()&&t.callbackNode!==n)return null;var i=Al(t,t===Lt?Ut:0);if(i===0)return null;if((i&30)!==0||(i&t.expiredLanes)!==0||r)r=ki(t,i);else{r=i;var u=Xe;Xe|=2;var x=Zf();(Lt!==t||Ut!==r)&&(ls=null,Gn=jt()+500,mn(t,r));do try{Qy();break}catch(I){Jf(t,I)}while(!0);gc(),vi.current=x,Xe=u,Pt!==null?r=0:(Lt=null,Ut=0,r=_t)}if(r!==0){if(r===2&&(u=Mo(t),u!==0&&(i=u,r=ed(t,u))),r===1)throw n=tl,mn(t,0),Fs(t,i),ar(t,jt()),n;if(r===6)Fs(t,i);else{if(u=t.current.alternate,(i&30)===0&&!Yy(u)&&(r=ki(t,i),r===2&&(x=Mo(t),x!==0&&(i=x,r=ed(t,x))),r===1))throw n=tl,mn(t,0),Fs(t,i),ar(t,jt()),n;switch(t.finishedWork=u,t.finishedLanes=i,r){case 0:case 1:throw Error(l(345));case 2:xn(t,nr,ls);break;case 3:if(Fs(t,i),(i&130023424)===i&&(r=Xc+500-jt(),10<r)){if(Al(t,0)!==0)break;if(u=t.suspendedLanes,(u&i)!==i){Jt(),t.pingedLanes|=t.suspendedLanes&u;break}t.timeoutHandle=lc(xn.bind(null,t,nr,ls),r);break}xn(t,nr,ls);break;case 4:if(Fs(t,i),(i&4194240)===i)break;for(r=t.eventTimes,u=-1;0<i;){var w=31-kr(i);x=1<<w,w=r[w],w>u&&(u=w),i&=~x}if(i=u,i=jt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Ky(i/1960))-i,10<i){t.timeoutHandle=lc(xn.bind(null,t,nr,ls),i);break}xn(t,nr,ls);break;case 5:xn(t,nr,ls);break;default:throw Error(l(329))}}}return ar(t,jt()),t.callbackNode===n?qf.bind(null,t):null}function ed(t,r){var n=rl;return t.current.memoizedState.isDehydrated&&(mn(t,r).flags|=256),t=ki(t,r),t!==2&&(r=nr,nr=n,r!==null&&td(r)),t}function td(t){nr===null?nr=t:nr.push.apply(nr,t)}function Yy(t){for(var r=t;;){if(r.flags&16384){var n=r.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var i=0;i<n.length;i++){var u=n[i],x=u.getSnapshot;u=u.value;try{if(!Er(x(),u))return!1}catch{return!1}}}if(n=r.child,r.subtreeFlags&16384&&n!==null)n.return=r,r=n;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Fs(t,r){for(r&=~qc,r&=~ji,t.suspendedLanes|=r,t.pingedLanes&=~r,t=t.expirationTimes;0<r;){var n=31-kr(r),i=1<<n;t[n]=-1,r&=~i}}function Xf(t){if((Xe&6)!==0)throw Error(l(327));Qn();var r=Al(t,0);if((r&1)===0)return ar(t,jt()),null;var n=ki(t,r);if(t.tag!==0&&n===2){var i=Mo(t);i!==0&&(r=i,n=ed(t,i))}if(n===1)throw n=tl,mn(t,0),Fs(t,r),ar(t,jt()),n;if(n===6)throw Error(l(345));return t.finishedWork=t.current.alternate,t.finishedLanes=r,xn(t,nr,ls),ar(t,jt()),null}function rd(t,r){var n=Xe;Xe|=1;try{return t(r)}finally{Xe=n,Xe===0&&(Gn=jt()+500,Zl&&Is())}}function fn(t){Ls!==null&&Ls.tag===0&&(Xe&6)===0&&Qn();var r=Xe;Xe|=1;var n=Nr.transition,i=rt;try{if(Nr.transition=null,rt=1,t)return t()}finally{rt=i,Nr.transition=n,Xe=r,(Xe&6)===0&&Is()}}function sd(){mr=Yn.current,ct(Yn)}function mn(t,r){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,wy(n)),Pt!==null)for(n=Pt.return;n!==null;){var i=n;switch(hc(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&Xl();break;case 3:Wn(),ct(tr),ct(Wt),Cc();break;case 5:wc(i);break;case 4:Wn();break;case 13:ct(xt);break;case 19:ct(xt);break;case 10:yc(i.type._context);break;case 22:case 23:sd()}n=n.return}if(Lt=t,Pt=t=zs(t.current,null),Ut=mr=r,_t=0,tl=null,qc=ji=hn=0,nr=rl=null,cn!==null){for(r=0;r<cn.length;r++)if(n=cn[r],i=n.interleaved,i!==null){n.interleaved=null;var u=i.next,x=n.pending;if(x!==null){var w=x.next;x.next=u,i.next=w}n.pending=i}cn=null}return t}function Jf(t,r){do{var n=Pt;try{if(gc(),ci.current=fi,di){for(var i=pt.memoizedState;i!==null;){var u=i.queue;u!==null&&(u.pending=null),i=i.next}di=!1}if(un=0,Dt=It=pt=null,Qa=!1,qa=0,Qc.current=null,n===null||n.return===null){_t=1,tl=r,Pt=null;break}e:{var x=t,w=n.return,I=n,$=r;if(r=Ut,I.flags|=32768,$!==null&&typeof $=="object"&&typeof $.then=="function"){var J=$,me=I,xe=me.tag;if((me.mode&1)===0&&(xe===0||xe===11||xe===15)){var he=me.alternate;he?(me.updateQueue=he.updateQueue,me.memoizedState=he.memoizedState,me.lanes=he.lanes):(me.updateQueue=null,me.memoizedState=null)}var Ce=wf(w);if(Ce!==null){Ce.flags&=-257,Sf(Ce,w,I,x,r),Ce.mode&1&&Nf(x,J,r),r=Ce,$=J;var Te=r.updateQueue;if(Te===null){var _e=new Set;_e.add($),r.updateQueue=_e}else Te.add($);break e}else{if((r&1)===0){Nf(x,J,r),nd();break e}$=Error(l(426))}}else if(ut&&I.mode&1){var bt=wf(w);if(bt!==null){(bt.flags&65536)===0&&(bt.flags|=256),Sf(bt,w,I,x,r),xc(Hn($,I));break e}}x=$=Hn($,I),_t!==4&&(_t=2),rl===null?rl=[x]:rl.push(x),x=w;do{switch(x.tag){case 3:x.flags|=65536,r&=-r,x.lanes|=r;var Y=jf(x,$,r);Kh(x,Y);break e;case 1:I=$;var V=x.type,q=x.stateNode;if((x.flags&128)===0&&(typeof V.getDerivedStateFromError=="function"||q!==null&&typeof q.componentDidCatch=="function"&&(Ds===null||!Ds.has(q)))){x.flags|=65536,r&=-r,x.lanes|=r;var ve=bf(x,I,r);Kh(x,ve);break e}}x=x.return}while(x!==null)}tm(n)}catch(Me){r=Me,Pt===n&&n!==null&&(Pt=n=n.return);continue}break}while(!0)}function Zf(){var t=vi.current;return vi.current=fi,t===null?fi:t}function nd(){(_t===0||_t===3||_t===2)&&(_t=4),Lt===null||(hn&268435455)===0&&(ji&268435455)===0||Fs(Lt,Ut)}function ki(t,r){var n=Xe;Xe|=2;var i=Zf();(Lt!==t||Ut!==r)&&(ls=null,mn(t,r));do try{Gy();break}catch(u){Jf(t,u)}while(!0);if(gc(),Xe=n,vi.current=i,Pt!==null)throw Error(l(261));return Lt=null,Ut=0,_t}function Gy(){for(;Pt!==null;)em(Pt)}function Qy(){for(;Pt!==null&&!j0();)em(Pt)}function em(t){var r=nm(t.alternate,t,mr);t.memoizedProps=t.pendingProps,r===null?tm(t):Pt=r,Qc.current=null}function tm(t){var r=t;do{var n=r.alternate;if(t=r.return,(r.flags&32768)===0){if(n=By(n,r,mr),n!==null){Pt=n;return}}else{if(n=Uy(n,r),n!==null){n.flags&=32767,Pt=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{_t=6,Pt=null;return}}if(r=r.sibling,r!==null){Pt=r;return}Pt=r=t}while(r!==null);_t===0&&(_t=5)}function xn(t,r,n){var i=rt,u=Nr.transition;try{Nr.transition=null,rt=1,qy(t,r,n,i)}finally{Nr.transition=u,rt=i}return null}function qy(t,r,n,i){do Qn();while(Ls!==null);if((Xe&6)!==0)throw Error(l(327));n=t.finishedWork;var u=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(l(177));t.callbackNode=null,t.callbackPriority=0;var x=n.lanes|n.childLanes;if(R0(t,x),t===Lt&&(Pt=Lt=null,Ut=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||Ni||(Ni=!0,am(Rl,function(){return Qn(),null})),x=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||x){x=Nr.transition,Nr.transition=null;var w=rt;rt=1;var I=Xe;Xe|=4,Qc.current=null,Wy(t,n),Hf(n,t),py(nc),Ol=!!sc,nc=sc=null,t.current=n,Hy(n),b0(),Xe=I,rt=w,Nr.transition=x}else t.current=n;if(Ni&&(Ni=!1,Ls=t,wi=u),x=t.pendingLanes,x===0&&(Ds=null),S0(n.stateNode),ar(t,jt()),r!==null)for(i=t.onRecoverableError,n=0;n<r.length;n++)u=r[n],i(u.value,{componentStack:u.stack,digest:u.digest});if(bi)throw bi=!1,t=Jc,Jc=null,t;return(wi&1)!==0&&t.tag!==0&&Qn(),x=t.pendingLanes,(x&1)!==0?t===Zc?sl++:(sl=0,Zc=t):sl=0,Is(),null}function Qn(){if(Ls!==null){var t=Uu(wi),r=Nr.transition,n=rt;try{if(Nr.transition=null,rt=16>t?16:t,Ls===null)var i=!1;else{if(t=Ls,Ls=null,wi=0,(Xe&6)!==0)throw Error(l(331));var u=Xe;for(Xe|=4,Pe=t.current;Pe!==null;){var x=Pe,w=x.child;if((Pe.flags&16)!==0){var I=x.deletions;if(I!==null){for(var $=0;$<I.length;$++){var J=I[$];for(Pe=J;Pe!==null;){var me=Pe;switch(me.tag){case 0:case 11:case 15:el(8,me,x)}var xe=me.child;if(xe!==null)xe.return=me,Pe=xe;else for(;Pe!==null;){me=Pe;var he=me.sibling,Ce=me.return;if($f(me),me===J){Pe=null;break}if(he!==null){he.return=Ce,Pe=he;break}Pe=Ce}}}var Te=x.alternate;if(Te!==null){var _e=Te.child;if(_e!==null){Te.child=null;do{var bt=_e.sibling;_e.sibling=null,_e=bt}while(_e!==null)}}Pe=x}}if((x.subtreeFlags&2064)!==0&&w!==null)w.return=x,Pe=w;else e:for(;Pe!==null;){if(x=Pe,(x.flags&2048)!==0)switch(x.tag){case 0:case 11:case 15:el(9,x,x.return)}var Y=x.sibling;if(Y!==null){Y.return=x.return,Pe=Y;break e}Pe=x.return}}var V=t.current;for(Pe=V;Pe!==null;){w=Pe;var q=w.child;if((w.subtreeFlags&2064)!==0&&q!==null)q.return=w,Pe=q;else e:for(w=V;Pe!==null;){if(I=Pe,(I.flags&2048)!==0)try{switch(I.tag){case 0:case 11:case 15:yi(9,I)}}catch(Me){gt(I,I.return,Me)}if(I===w){Pe=null;break e}var ve=I.sibling;if(ve!==null){ve.return=I.return,Pe=ve;break e}Pe=I.return}}if(Xe=u,Is(),$r&&typeof $r.onPostCommitFiberRoot=="function")try{$r.onPostCommitFiberRoot(Il,t)}catch{}i=!0}return i}finally{rt=n,Nr.transition=r}}return!1}function rm(t,r,n){r=Hn(n,r),r=jf(t,r,1),t=Ms(t,r,1),r=Jt(),t!==null&&(Ea(t,1,r),ar(t,r))}function gt(t,r,n){if(t.tag===3)rm(t,t,n);else for(;r!==null;){if(r.tag===3){rm(r,t,n);break}else if(r.tag===1){var i=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Ds===null||!Ds.has(i))){t=Hn(n,t),t=bf(r,t,1),r=Ms(r,t,1),t=Jt(),r!==null&&(Ea(r,1,t),ar(r,t));break}}r=r.return}}function Xy(t,r,n){var i=t.pingCache;i!==null&&i.delete(r),r=Jt(),t.pingedLanes|=t.suspendedLanes&n,Lt===t&&(Ut&n)===n&&(_t===4||_t===3&&(Ut&130023424)===Ut&&500>jt()-Xc?mn(t,0):qc|=n),ar(t,r)}function sm(t,r){r===0&&((t.mode&1)===0?r=1:(r=Ml,Ml<<=1,(Ml&130023424)===0&&(Ml=4194304)));var n=Jt();t=ss(t,r),t!==null&&(Ea(t,r,n),ar(t,n))}function Jy(t){var r=t.memoizedState,n=0;r!==null&&(n=r.retryLane),sm(t,n)}function Zy(t,r){var n=0;switch(t.tag){case 13:var i=t.stateNode,u=t.memoizedState;u!==null&&(n=u.retryLane);break;case 19:i=t.stateNode;break;default:throw Error(l(314))}i!==null&&i.delete(r),sm(t,n)}var nm;nm=function(t,r,n){if(t!==null)if(t.memoizedProps!==r.pendingProps||tr.current)sr=!0;else{if((t.lanes&n)===0&&(r.flags&128)===0)return sr=!1,$y(t,r,n);sr=(t.flags&131072)!==0}else sr=!1,ut&&(r.flags&1048576)!==0&&Lh(r,ti,r.index);switch(r.lanes=0,r.tag){case 2:var i=r.type;pi(t,r),t=r.pendingProps;var u=On(r,Wt.current);Vn(r,n),u=Pc(null,r,i,t,u,n);var x=Tc();return r.flags|=1,typeof u=="object"&&u!==null&&typeof u.render=="function"&&u.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,rr(i)?(x=!0,Jl(r)):x=!1,r.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,bc(r),u.updater=mi,r.stateNode=u,u._reactInternals=r,Dc(r,i,t,n),r=zc(null,r,i,!0,x,n)):(r.tag=0,ut&&x&&uc(r),Xt(null,r,u,n),r=r.child),r;case 16:i=r.elementType;e:{switch(pi(t,r),t=r.pendingProps,u=i._init,i=u(i._payload),r.type=i,u=r.tag=tv(i),t=Tr(i,t),u){case 0:r=Fc(null,r,i,t,n);break e;case 1:r=Rf(null,r,i,t,n);break e;case 11:r=Cf(null,r,i,t,n);break e;case 14:r=kf(null,r,i,Tr(i.type,t),n);break e}throw Error(l(306,i,""))}return r;case 0:return i=r.type,u=r.pendingProps,u=r.elementType===i?u:Tr(i,u),Fc(t,r,i,u,n);case 1:return i=r.type,u=r.pendingProps,u=r.elementType===i?u:Tr(i,u),Rf(t,r,i,u,n);case 3:e:{if(If(r),t===null)throw Error(l(387));i=r.pendingProps,x=r.memoizedState,u=x.element,Hh(t,r),ii(r,i,null,n);var w=r.memoizedState;if(i=w.element,x.isDehydrated)if(x={element:i,isDehydrated:!1,cache:w.cache,pendingSuspenseBoundaries:w.pendingSuspenseBoundaries,transitions:w.transitions},r.updateQueue.baseState=x,r.memoizedState=x,r.flags&256){u=Hn(Error(l(423)),r),r=_f(t,r,i,n,u);break e}else if(i!==u){u=Hn(Error(l(424)),r),r=_f(t,r,i,n,u);break e}else for(fr=Ps(r.stateNode.containerInfo.firstChild),hr=r,ut=!0,Pr=null,n=Vh(r,null,i,n),r.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if($n(),i===u){r=as(t,r,n);break e}Xt(t,r,i,n)}r=r.child}return r;case 5:return Gh(r),t===null&&mc(r),i=r.type,u=r.pendingProps,x=t!==null?t.memoizedProps:null,w=u.children,ac(i,u)?w=null:x!==null&&ac(i,x)&&(r.flags|=32),Tf(t,r),Xt(t,r,w,n),r.child;case 6:return t===null&&mc(r),null;case 13:return Mf(t,r,n);case 4:return Nc(r,r.stateNode.containerInfo),i=r.pendingProps,t===null?r.child=Bn(r,null,i,n):Xt(t,r,i,n),r.child;case 11:return i=r.type,u=r.pendingProps,u=r.elementType===i?u:Tr(i,u),Cf(t,r,i,u,n);case 7:return Xt(t,r,r.pendingProps,n),r.child;case 8:return Xt(t,r,r.pendingProps.children,n),r.child;case 12:return Xt(t,r,r.pendingProps.children,n),r.child;case 10:e:{if(i=r.type._context,u=r.pendingProps,x=r.memoizedProps,w=u.value,lt(ni,i._currentValue),i._currentValue=w,x!==null)if(Er(x.value,w)){if(x.children===u.children&&!tr.current){r=as(t,r,n);break e}}else for(x=r.child,x!==null&&(x.return=r);x!==null;){var I=x.dependencies;if(I!==null){w=x.child;for(var $=I.firstContext;$!==null;){if($.context===i){if(x.tag===1){$=ns(-1,n&-n),$.tag=2;var J=x.updateQueue;if(J!==null){J=J.shared;var me=J.pending;me===null?$.next=$:($.next=me.next,me.next=$),J.pending=$}}x.lanes|=n,$=x.alternate,$!==null&&($.lanes|=n),vc(x.return,n,r),I.lanes|=n;break}$=$.next}}else if(x.tag===10)w=x.type===r.type?null:x.child;else if(x.tag===18){if(w=x.return,w===null)throw Error(l(341));w.lanes|=n,I=w.alternate,I!==null&&(I.lanes|=n),vc(w,n,r),w=x.sibling}else w=x.child;if(w!==null)w.return=x;else for(w=x;w!==null;){if(w===r){w=null;break}if(x=w.sibling,x!==null){x.return=w.return,w=x;break}w=w.return}x=w}Xt(t,r,u.children,n),r=r.child}return r;case 9:return u=r.type,i=r.pendingProps.children,Vn(r,n),u=jr(u),i=i(u),r.flags|=1,Xt(t,r,i,n),r.child;case 14:return i=r.type,u=Tr(i,r.pendingProps),u=Tr(i.type,u),kf(t,r,i,u,n);case 15:return Ef(t,r,r.type,r.pendingProps,n);case 17:return i=r.type,u=r.pendingProps,u=r.elementType===i?u:Tr(i,u),pi(t,r),r.tag=1,rr(i)?(t=!0,Jl(r)):t=!1,Vn(r,n),yf(r,i,u),Dc(r,i,u,n),zc(null,r,i,!0,t,n);case 19:return Df(t,r,n);case 22:return Pf(t,r,n)}throw Error(l(156,r.tag))};function am(t,r){return Ca(t,r)}function ev(t,r,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wr(t,r,n,i){return new ev(t,r,n,i)}function ad(t){return t=t.prototype,!(!t||!t.isReactComponent)}function tv(t){if(typeof t=="function")return ad(t)?1:0;if(t!=null){if(t=t.$$typeof,t===ie)return 11;if(t===Q)return 14}return 2}function zs(t,r){var n=t.alternate;return n===null?(n=wr(t.tag,r,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=r,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,r=t.dependencies,n.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Ei(t,r,n,i,u,x){var w=2;if(i=t,typeof t=="function")ad(t)&&(w=1);else if(typeof t=="string")w=5;else e:switch(t){case k:return pn(n.children,u,x,r);case L:w=8,u|=8;break;case _:return t=wr(12,n,r,u|2),t.elementType=_,t.lanes=x,t;case ee:return t=wr(13,n,r,u),t.elementType=ee,t.lanes=x,t;case G:return t=wr(19,n,r,u),t.elementType=G,t.lanes=x,t;case re:return Pi(n,u,x,r);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case se:w=10;break e;case le:w=9;break e;case ie:w=11;break e;case Q:w=14;break e;case ce:w=16,i=null;break e}throw Error(l(130,t==null?t:typeof t,""))}return r=wr(w,n,r,u),r.elementType=t,r.type=i,r.lanes=x,r}function pn(t,r,n,i){return t=wr(7,t,i,r),t.lanes=n,t}function Pi(t,r,n,i){return t=wr(22,t,i,r),t.elementType=re,t.lanes=n,t.stateNode={isHidden:!1},t}function ld(t,r,n){return t=wr(6,t,null,r),t.lanes=n,t}function id(t,r,n){return r=wr(4,t.children!==null?t.children:[],t.key,r),r.lanes=n,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}function rv(t,r,n,i,u){this.tag=r,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ao(0),this.expirationTimes=Ao(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ao(0),this.identifierPrefix=i,this.onRecoverableError=u,this.mutableSourceEagerHydrationData=null}function od(t,r,n,i,u,x,w,I,$){return t=new rv(t,r,n,I,$),r===1?(r=1,x===!0&&(r|=8)):r=0,x=wr(3,null,null,r),t.current=x,x.stateNode=t,x.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},bc(x),t}function sv(t,r,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:U,key:i==null?null:""+i,children:t,containerInfo:r,implementation:n}}function lm(t){if(!t)return Rs;t=t._reactInternals;e:{if(at(t)!==t||t.tag!==1)throw Error(l(170));var r=t;do{switch(r.tag){case 3:r=r.stateNode.context;break e;case 1:if(rr(r.type)){r=r.stateNode.__reactInternalMemoizedMergedChildContext;break e}}r=r.return}while(r!==null);throw Error(l(171))}if(t.tag===1){var n=t.type;if(rr(n))return Mh(t,n,r)}return r}function im(t,r,n,i,u,x,w,I,$){return t=od(n,i,!0,t,u,x,w,I,$),t.context=lm(null),n=t.current,i=Jt(),u=Os(n),x=ns(i,u),x.callback=r??null,Ms(n,x,u),t.current.lanes=u,Ea(t,u,i),ar(t,i),t}function Ti(t,r,n,i){var u=r.current,x=Jt(),w=Os(u);return n=lm(n),r.context===null?r.context=n:r.pendingContext=n,r=ns(x,w),r.payload={element:t},i=i===void 0?null:i,i!==null&&(r.callback=i),t=Ms(u,r,w),t!==null&&(_r(t,u,w,x),li(t,u,w)),w}function Ri(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function om(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<r?n:r}}function cd(t,r){om(t,r),(t=t.alternate)&&om(t,r)}function nv(){return null}var cm=typeof reportError=="function"?reportError:function(t){console.error(t)};function dd(t){this._internalRoot=t}Ii.prototype.render=dd.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(l(409));Ti(t,r,null,null)},Ii.prototype.unmount=dd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;fn(function(){Ti(null,t,null,null)}),r[Zr]=null}};function Ii(t){this._internalRoot=t}Ii.prototype.unstable_scheduleHydration=function(t){if(t){var r=Hu();t={blockedOn:null,target:t,priority:r};for(var n=0;n<Cs.length&&r!==0&&r<Cs[n].priority;n++);Cs.splice(n,0,t),n===0&&Gu(t)}};function ud(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function _i(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function dm(){}function av(t,r,n,i,u){if(u){if(typeof i=="function"){var x=i;i=function(){var J=Ri(w);x.call(J)}}var w=im(r,i,t,0,null,!1,!1,"",dm);return t._reactRootContainer=w,t[Zr]=w.current,Ba(t.nodeType===8?t.parentNode:t),fn(),w}for(;u=t.lastChild;)t.removeChild(u);if(typeof i=="function"){var I=i;i=function(){var J=Ri($);I.call(J)}}var $=od(t,0,!1,null,null,!1,!1,"",dm);return t._reactRootContainer=$,t[Zr]=$.current,Ba(t.nodeType===8?t.parentNode:t),fn(function(){Ti(r,$,n,i)}),$}function Mi(t,r,n,i,u){var x=n._reactRootContainer;if(x){var w=x;if(typeof u=="function"){var I=u;u=function(){var $=Ri(w);I.call($)}}Ti(r,w,t,u)}else w=av(n,r,t,u,i);return Ri(w)}Vu=function(t){switch(t.tag){case 3:var r=t.stateNode;if(r.current.memoizedState.isDehydrated){var n=ka(r.pendingLanes);n!==0&&(Do(r,n|1),ar(r,jt()),(Xe&6)===0&&(Gn=jt()+500,Is()))}break;case 13:fn(function(){var i=ss(t,1);if(i!==null){var u=Jt();_r(i,t,1,u)}}),cd(t,1)}},Lo=function(t){if(t.tag===13){var r=ss(t,134217728);if(r!==null){var n=Jt();_r(r,t,134217728,n)}cd(t,134217728)}},Wu=function(t){if(t.tag===13){var r=Os(t),n=ss(t,r);if(n!==null){var i=Jt();_r(n,t,r,i)}cd(t,r)}},Hu=function(){return rt},Ku=function(t,r){var n=rt;try{return rt=t,r()}finally{rt=n}},Na=function(t,r,n){switch(r){case"input":if(st(t,n),r=n.name,n.type==="radio"&&r!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+r)+'][type="radio"]'),r=0;r<n.length;r++){var i=n[r];if(i!==t&&i.form===t.form){var u=ql(i);if(!u)throw Error(l(90));Se(i),st(i,u)}}}break;case"textarea":ps(t,n);break;case"select":r=n.value,r!=null&&Fr(t,!!n.multiple,r,!1)}},kl=rd,El=fn;var lv={usingClientEntryPoint:!1,Events:[Wa,Dn,ql,Sl,Cl,rd]},nl={findFiberByHostInstance:nn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},iv={bundleType:nl.bundleType,version:nl.version,rendererPackageName:nl.rendererPackageName,rendererConfig:nl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:R.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=En(t),t===null?null:t.stateNode},findFiberByHostInstance:nl.findFiberByHostInstance||nv,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 Ai=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ai.isDisabled&&Ai.supportsFiber)try{Il=Ai.inject(iv),$r=Ai}catch{}}return lr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lv,lr.createPortal=function(t,r){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ud(r))throw Error(l(200));return sv(t,r,null,n)},lr.createRoot=function(t,r){if(!ud(t))throw Error(l(299));var n=!1,i="",u=cm;return r!=null&&(r.unstable_strictMode===!0&&(n=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(u=r.onRecoverableError)),r=od(t,1,!1,null,null,n,!1,i,u),t[Zr]=r.current,Ba(t.nodeType===8?t.parentNode:t),new dd(r)},lr.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(l(188)):(t=Object.keys(t).join(","),Error(l(268,t)));return t=En(r),t=t===null?null:t.stateNode,t},lr.flushSync=function(t){return fn(t)},lr.hydrate=function(t,r,n){if(!_i(r))throw Error(l(200));return Mi(null,t,r,!0,n)},lr.hydrateRoot=function(t,r,n){if(!ud(t))throw Error(l(405));var i=n!=null&&n.hydratedSources||null,u=!1,x="",w=cm;if(n!=null&&(n.unstable_strictMode===!0&&(u=!0),n.identifierPrefix!==void 0&&(x=n.identifierPrefix),n.onRecoverableError!==void 0&&(w=n.onRecoverableError)),r=im(r,null,t,1,n??null,u,!1,x,w),t[Zr]=r.current,Ba(t),i)for(t=0;t<i.length;t++)n=i[t],u=n._getVersion,u=u(n._source),r.mutableSourceEagerHydrationData==null?r.mutableSourceEagerHydrationData=[n,u]:r.mutableSourceEagerHydrationData.push(n,u);return new Ii(r)},lr.render=function(t,r,n){if(!_i(r))throw Error(l(200));return Mi(null,t,r,!1,n)},lr.unmountComponentAtNode=function(t){if(!_i(t))throw Error(l(40));return t._reactRootContainer?(fn(function(){Mi(null,null,t,!1,function(){t._reactRootContainer=null,t[Zr]=null})}),!0):!1},lr.unstable_batchedUpdates=rd,lr.unstable_renderSubtreeIntoContainer=function(t,r,n,i){if(!_i(n))throw Error(l(200));if(t==null||t._reactInternals===void 0)throw Error(l(38));return Mi(t,r,n,!1,i)},lr.version="18.3.1-next-f1338f8080-20240426",lr}var ym;function wx(){if(ym)return md.exports;ym=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(a){console.error(a)}}return s(),md.exports=xv(),md.exports}var vm;function pv(){if(vm)return Di;vm=1;var s=wx();return Di.createRoot=s.createRoot,Di.hydrateRoot=s.hydrateRoot,Di}var gv=pv(),gl=wx();const yv=Nx(gl);/**
* @remix-run/router v1.23.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function hl(){return hl=Object.assign?Object.assign.bind():function(s){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&(s[o]=l[o])}return s},hl.apply(this,arguments)}var Hs;(function(s){s.Pop="POP",s.Push="PUSH",s.Replace="REPLACE"})(Hs||(Hs={}));const jm="popstate";function vv(s){s===void 0&&(s={});function a(o,c){let{pathname:d,search:h,hash:m}=o.location;return Dd("",{pathname:d,search:h,hash:m},c.state&&c.state.usr||null,c.state&&c.state.key||"default")}function l(o,c){return typeof c=="string"?c:Qi(c)}return bv(a,l,null,s)}function kt(s,a){if(s===!1||s===null||typeof s>"u")throw new Error(a)}function lu(s,a){if(!s){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function jv(){return Math.random().toString(36).substr(2,8)}function bm(s,a){return{usr:s.state,key:s.key,idx:a}}function Dd(s,a,l,o){return l===void 0&&(l=null),hl({pathname:typeof s=="string"?s:s.pathname,search:"",hash:""},typeof a=="string"?oa(a):a,{state:l,key:a&&a.key||o||jv()})}function Qi(s){let{pathname:a="/",search:l="",hash:o=""}=s;return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),o&&o!=="#"&&(a+=o.charAt(0)==="#"?o:"#"+o),a}function oa(s){let a={};if(s){let l=s.indexOf("#");l>=0&&(a.hash=s.substr(l),s=s.substr(0,l));let o=s.indexOf("?");o>=0&&(a.search=s.substr(o),s=s.substr(0,o)),s&&(a.pathname=s)}return a}function bv(s,a,l,o){o===void 0&&(o={});let{window:c=document.defaultView,v5Compat:d=!1}=o,h=c.history,m=Hs.Pop,p=null,y=g();y==null&&(y=0,h.replaceState(hl({},h.state,{idx:y}),""));function g(){return(h.state||{idx:null}).idx}function v(){m=Hs.Pop;let b=g(),N=b==null?null:b-y;y=b,p&&p({action:m,location:S.location,delta:N})}function C(b,N){m=Hs.Push;let E=Dd(S.location,b,N);y=g()+1;let j=bm(E,y),R=S.createHref(E);try{h.pushState(j,"",R)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;c.location.assign(R)}d&&p&&p({action:m,location:S.location,delta:1})}function P(b,N){m=Hs.Replace;let E=Dd(S.location,b,N);y=g();let j=bm(E,y),R=S.createHref(E);h.replaceState(j,"",R),d&&p&&p({action:m,location:S.location,delta:0})}function T(b){let N=c.location.origin!=="null"?c.location.origin:c.location.href,E=typeof b=="string"?b:Qi(b);return E=E.replace(/ $/,"%20"),kt(N,"No window.location.(origin|href) available to create URL for href: "+E),new URL(E,N)}let S={get action(){return m},get location(){return s(c,h)},listen(b){if(p)throw new Error("A history only accepts one active listener");return c.addEventListener(jm,v),p=b,()=>{c.removeEventListener(jm,v),p=null}},createHref(b){return a(c,b)},createURL:T,encodeLocation(b){let N=T(b);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:C,replace:P,go(b){return h.go(b)}};return S}var Nm;(function(s){s.data="data",s.deferred="deferred",s.redirect="redirect",s.error="error"})(Nm||(Nm={}));function Nv(s,a,l){return l===void 0&&(l="/"),wv(s,a,l)}function wv(s,a,l,o){let c=typeof a=="string"?oa(a):a,d=iu(c.pathname||"/",l);if(d==null)return null;let h=Sx(s);Sv(h);let m=null;for(let p=0;m==null&&p<h.length;++p){let y=Lv(d);m=Mv(h[p],y)}return m}function Sx(s,a,l,o){a===void 0&&(a=[]),l===void 0&&(l=[]),o===void 0&&(o="");let c=(d,h,m)=>{let p={relativePath:m===void 0?d.path||"":m,caseSensitive:d.caseSensitive===!0,childrenIndex:h,route:d};p.relativePath.startsWith("/")&&(kt(p.relativePath.startsWith(o),'Absolute route path "'+p.relativePath+'" nested under path '+('"'+o+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),p.relativePath=p.relativePath.slice(o.length));let y=Ks([o,p.relativePath]),g=l.concat(p);d.children&&d.children.length>0&&(kt(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+y+'".')),Sx(d.children,a,g,y)),!(d.path==null&&!d.index)&&a.push({path:y,score:Iv(y,d.index),routesMeta:g})};return s.forEach((d,h)=>{var m;if(d.path===""||!((m=d.path)!=null&&m.includes("?")))c(d,h);else for(let p of Cx(d.path))c(d,h,p)}),a}function Cx(s){let a=s.split("/");if(a.length===0)return[];let[l,...o]=a,c=l.endsWith("?"),d=l.replace(/\?$/,"");if(o.length===0)return c?[d,""]:[d];let h=Cx(o.join("/")),m=[];return m.push(...h.map(p=>p===""?d:[d,p].join("/"))),c&&m.push(...h),m.map(p=>s.startsWith("/")&&p===""?"/":p)}function Sv(s){s.sort((a,l)=>a.score!==l.score?l.score-a.score:_v(a.routesMeta.map(o=>o.childrenIndex),l.routesMeta.map(o=>o.childrenIndex)))}const Cv=/^:[\w-]+$/,kv=3,Ev=2,Pv=1,Tv=10,Rv=-2,wm=s=>s==="*";function Iv(s,a){let l=s.split("/"),o=l.length;return l.some(wm)&&(o+=Rv),a&&(o+=Ev),l.filter(c=>!wm(c)).reduce((c,d)=>c+(Cv.test(d)?kv:d===""?Pv:Tv),o)}function _v(s,a){return s.length===a.length&&s.slice(0,-1).every((o,c)=>o===a[c])?s[s.length-1]-a[a.length-1]:0}function Mv(s,a,l){let{routesMeta:o}=s,c={},d="/",h=[];for(let m=0;m<o.length;++m){let p=o[m],y=m===o.length-1,g=d==="/"?a:a.slice(d.length)||"/",v=Av({path:p.relativePath,caseSensitive:p.caseSensitive,end:y},g),C=p.route;if(!v)return null;Object.assign(c,v.params),h.push({params:c,pathname:Ks([d,v.pathname]),pathnameBase:Bv(Ks([d,v.pathnameBase])),route:C}),v.pathnameBase!=="/"&&(d=Ks([d,v.pathnameBase]))}return h}function Av(s,a){typeof s=="string"&&(s={path:s,caseSensitive:!1,end:!0});let[l,o]=Dv(s.path,s.caseSensitive,s.end),c=a.match(l);if(!c)return null;let d=c[0],h=d.replace(/(.)\/+$/,"$1"),m=c.slice(1);return{params:o.reduce((y,g,v)=>{let{paramName:C,isOptional:P}=g;if(C==="*"){let S=m[v]||"";h=d.slice(0,d.length-S.length).replace(/(.)\/+$/,"$1")}const T=m[v];return P&&!T?y[C]=void 0:y[C]=(T||"").replace(/%2F/g,"/"),y},{}),pathname:d,pathnameBase:h,pattern:s}}function Dv(s,a,l){a===void 0&&(a=!1),l===void 0&&(l=!0),lu(s==="*"||!s.endsWith("*")||s.endsWith("/*"),'Route path "'+s+'" will be treated as if it were '+('"'+s.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+s.replace(/\*$/,"/*")+'".'));let o=[],c="^"+s.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,m,p)=>(o.push({paramName:m,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)"));return s.endsWith("*")?(o.push({paramName:"*"}),c+=s==="*"||s==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":s!==""&&s!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),o]}function Lv(s){try{return s.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return lu(!1,'The URL path "'+s+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+a+").")),s}}function iu(s,a){if(a==="/")return s;if(!s.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,o=s.charAt(l);return o&&o!=="/"?null:s.slice(l)||"/"}const Ov=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Fv=s=>Ov.test(s);function zv(s,a){a===void 0&&(a="/");let{pathname:l,search:o="",hash:c=""}=typeof s=="string"?oa(s):s,d;if(l)if(Fv(l))d=l;else{if(l.includes("//")){let h=l;l=l.replace(/\/\/+/g,"/"),lu(!1,"Pathnames cannot have embedded double slashes - normalizing "+(h+" -> "+l))}l.startsWith("/")?d=Sm(l.substring(1),"/"):d=Sm(l,a)}else d=a;return{pathname:d,search:Uv(o),hash:Vv(c)}}function Sm(s,a){let l=a.replace(/\/+$/,"").split("/");return s.split("/").forEach(c=>{c===".."?l.length>1&&l.pop():c!=="."&&l.push(c)}),l.length>1?l.join("/"):"/"}function gd(s,a,l,o){return"Cannot include a '"+s+"' character in a manually specified "+("`to."+a+"` field ["+JSON.stringify(o)+"]. Please separate it out to the ")+("`to."+l+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function $v(s){return s.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function ou(s,a){let l=$v(s);return a?l.map((o,c)=>c===l.length-1?o.pathname:o.pathnameBase):l.map(o=>o.pathnameBase)}function cu(s,a,l,o){o===void 0&&(o=!1);let c;typeof s=="string"?c=oa(s):(c=hl({},s),kt(!c.pathname||!c.pathname.includes("?"),gd("?","pathname","search",c)),kt(!c.pathname||!c.pathname.includes("#"),gd("#","pathname","hash",c)),kt(!c.search||!c.search.includes("#"),gd("#","search","hash",c)));let d=s===""||c.pathname==="",h=d?"/":c.pathname,m;if(h==null)m=l;else{let v=a.length-1;if(!o&&h.startsWith("..")){let C=h.split("/");for(;C[0]==="..";)C.shift(),v-=1;c.pathname=C.join("/")}m=v>=0?a[v]:"/"}let p=zv(c,m),y=h&&h!=="/"&&h.endsWith("/"),g=(d||h===".")&&l.endsWith("/");return!p.pathname.endsWith("/")&&(y||g)&&(p.pathname+="/"),p}const Ks=s=>s.join("/").replace(/\/\/+/g,"/"),Bv=s=>s.replace(/\/+$/,"").replace(/^\/*/,"/"),Uv=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,Vv=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s;function Wv(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}const kx=["post","put","patch","delete"];new Set(kx);const Hv=["get",...kx];new Set(Hv);/**
* React Router v6.30.3
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function fl(){return fl=Object.assign?Object.assign.bind():function(s){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&(s[o]=l[o])}return s},fl.apply(this,arguments)}const du=f.createContext(null),Kv=f.createContext(null),Js=f.createContext(null),ho=f.createContext(null),ms=f.createContext({outlet:null,matches:[],isDataRoute:!1}),Ex=f.createContext(null);function Yv(s,a){let{relative:l}=a===void 0?{}:a;ca()||kt(!1);let{basename:o,navigator:c}=f.useContext(Js),{hash:d,pathname:h,search:m}=Tx(s,{relative:l}),p=h;return o!=="/"&&(p=h==="/"?o:Ks([o,h])),c.createHref({pathname:p,search:m,hash:d})}function ca(){return f.useContext(ho)!=null}function Zs(){return ca()||kt(!1),f.useContext(ho).location}function Px(s){f.useContext(Js).static||f.useLayoutEffect(s)}function da(){let{isDataRoute:s}=f.useContext(ms);return s?oj():Gv()}function Gv(){ca()||kt(!1);let s=f.useContext(du),{basename:a,future:l,navigator:o}=f.useContext(Js),{matches:c}=f.useContext(ms),{pathname:d}=Zs(),h=JSON.stringify(ou(c,l.v7_relativeSplatPath)),m=f.useRef(!1);return Px(()=>{m.current=!0}),f.useCallback(function(y,g){if(g===void 0&&(g={}),!m.current)return;if(typeof y=="number"){o.go(y);return}let v=cu(y,JSON.parse(h),d,g.relative==="path");s==null&&a!=="/"&&(v.pathname=v.pathname==="/"?a:Ks([a,v.pathname])),(g.replace?o.replace:o.push)(v,g.state,g)},[a,o,h,d,s])}const Qv=f.createContext(null);function qv(s){let a=f.useContext(ms).outlet;return a&&f.createElement(Qv.Provider,{value:s},a)}function Tx(s,a){let{relative:l}=a===void 0?{}:a,{future:o}=f.useContext(Js),{matches:c}=f.useContext(ms),{pathname:d}=Zs(),h=JSON.stringify(ou(c,o.v7_relativeSplatPath));return f.useMemo(()=>cu(s,JSON.parse(h),d,l==="path"),[s,h,d,l])}function Xv(s,a){return Jv(s,a)}function Jv(s,a,l,o){ca()||kt(!1);let{navigator:c}=f.useContext(Js),{matches:d}=f.useContext(ms),h=d[d.length-1],m=h?h.params:{};h&&h.pathname;let p=h?h.pathnameBase:"/";h&&h.route;let y=Zs(),g;if(a){var v;let b=typeof a=="string"?oa(a):a;p==="/"||(v=b.pathname)!=null&&v.startsWith(p)||kt(!1),g=b}else g=y;let C=g.pathname||"/",P=C;if(p!=="/"){let b=p.replace(/^\//,"").split("/");P="/"+C.replace(/^\//,"").split("/").slice(b.length).join("/")}let T=Nv(s,{pathname:P}),S=sj(T&&T.map(b=>Object.assign({},b,{params:Object.assign({},m,b.params),pathname:Ks([p,c.encodeLocation?c.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?p:Ks([p,c.encodeLocation?c.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),d,l,o);return a&&S?f.createElement(ho.Provider,{value:{location:fl({pathname:"/",search:"",hash:"",state:null,key:"default"},g),navigationType:Hs.Pop}},S):S}function Zv(){let s=ij(),a=Wv(s)?s.status+" "+s.statusText:s instanceof Error?s.message:JSON.stringify(s),l=s instanceof Error?s.stack:null,c={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},a),l?f.createElement("pre",{style:c},l):null,null)}const ej=f.createElement(Zv,null);class tj extends f.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,l){return l.location!==a.location||l.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:l.error,location:l.location,revalidation:a.revalidation||l.revalidation}}componentDidCatch(a,l){console.error("React Router caught the following error during render",a,l)}render(){return this.state.error!==void 0?f.createElement(ms.Provider,{value:this.props.routeContext},f.createElement(Ex.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function rj(s){let{routeContext:a,match:l,children:o}=s,c=f.useContext(du);return c&&c.static&&c.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=l.route.id),f.createElement(ms.Provider,{value:a},o)}function sj(s,a,l,o){var c;if(a===void 0&&(a=[]),l===void 0&&(l=null),o===void 0&&(o=null),s==null){var d;if(!l)return null;if(l.errors)s=l.matches;else if((d=o)!=null&&d.v7_partialHydration&&a.length===0&&!l.initialized&&l.matches.length>0)s=l.matches;else return null}let h=s,m=(c=l)==null?void 0:c.errors;if(m!=null){let g=h.findIndex(v=>v.route.id&&(m==null?void 0:m[v.route.id])!==void 0);g>=0||kt(!1),h=h.slice(0,Math.min(h.length,g+1))}let p=!1,y=-1;if(l&&o&&o.v7_partialHydration)for(let g=0;g<h.length;g++){let v=h[g];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(y=g),v.route.id){let{loaderData:C,errors:P}=l,T=v.route.loader&&C[v.route.id]===void 0&&(!P||P[v.route.id]===void 0);if(v.route.lazy||T){p=!0,y>=0?h=h.slice(0,y+1):h=[h[0]];break}}}return h.reduceRight((g,v,C)=>{let P,T=!1,S=null,b=null;l&&(P=m&&v.route.id?m[v.route.id]:void 0,S=v.route.errorElement||ej,p&&(y<0&&C===0?(cj("route-fallback"),T=!0,b=null):y===C&&(T=!0,b=v.route.hydrateFallbackElement||null)));let N=a.concat(h.slice(0,C+1)),E=()=>{let j;return P?j=S:T?j=b:v.route.Component?j=f.createElement(v.route.Component,null):v.route.element?j=v.route.element:j=g,f.createElement(rj,{match:v,routeContext:{outlet:g,matches:N,isDataRoute:l!=null},children:j})};return l&&(v.route.ErrorBoundary||v.route.errorElement||C===0)?f.createElement(tj,{location:l.location,revalidation:l.revalidation,component:S,error:P,children:E(),routeContext:{outlet:null,matches:N,isDataRoute:!0}}):E()},null)}var Rx=(function(s){return s.UseBlocker="useBlocker",s.UseRevalidator="useRevalidator",s.UseNavigateStable="useNavigate",s})(Rx||{}),Ix=(function(s){return s.UseBlocker="useBlocker",s.UseLoaderData="useLoaderData",s.UseActionData="useActionData",s.UseRouteError="useRouteError",s.UseNavigation="useNavigation",s.UseRouteLoaderData="useRouteLoaderData",s.UseMatches="useMatches",s.UseRevalidator="useRevalidator",s.UseNavigateStable="useNavigate",s.UseRouteId="useRouteId",s})(Ix||{});function nj(s){let a=f.useContext(du);return a||kt(!1),a}function aj(s){let a=f.useContext(Kv);return a||kt(!1),a}function lj(s){let a=f.useContext(ms);return a||kt(!1),a}function _x(s){let a=lj(),l=a.matches[a.matches.length-1];return l.route.id||kt(!1),l.route.id}function ij(){var s;let a=f.useContext(Ex),l=aj(),o=_x();return a!==void 0?a:(s=l.errors)==null?void 0:s[o]}function oj(){let{router:s}=nj(Rx.UseNavigateStable),a=_x(Ix.UseNavigateStable),l=f.useRef(!1);return Px(()=>{l.current=!0}),f.useCallback(function(c,d){d===void 0&&(d={}),l.current&&(typeof c=="number"?s.navigate(c):s.navigate(c,fl({fromRouteId:a},d)))},[s,a])}const Cm={};function cj(s,a,l){Cm[s]||(Cm[s]=!0)}function dj(s,a){s==null||s.v7_startTransition,s==null||s.v7_relativeSplatPath}function yd(s){let{to:a,replace:l,state:o,relative:c}=s;ca()||kt(!1);let{future:d,static:h}=f.useContext(Js),{matches:m}=f.useContext(ms),{pathname:p}=Zs(),y=da(),g=cu(a,ou(m,d.v7_relativeSplatPath),p,c==="path"),v=JSON.stringify(g);return f.useEffect(()=>y(JSON.parse(v),{replace:l,state:o,relative:c}),[y,v,c,l,o]),null}function uj(s){return qv(s.context)}function dt(s){kt(!1)}function hj(s){let{basename:a="/",children:l=null,location:o,navigationType:c=Hs.Pop,navigator:d,static:h=!1,future:m}=s;ca()&&kt(!1);let p=a.replace(/^\/*/,"/"),y=f.useMemo(()=>({basename:p,navigator:d,static:h,future:fl({v7_relativeSplatPath:!1},m)}),[p,m,d,h]);typeof o=="string"&&(o=oa(o));let{pathname:g="/",search:v="",hash:C="",state:P=null,key:T="default"}=o,S=f.useMemo(()=>{let b=iu(g,p);return b==null?null:{location:{pathname:b,search:v,hash:C,state:P,key:T},navigationType:c}},[p,g,v,C,P,T,c]);return S==null?null:f.createElement(Js.Provider,{value:y},f.createElement(ho.Provider,{children:l,value:S}))}function fj(s){let{children:a,location:l}=s;return Xv(Ld(a),l)}new Promise(()=>{});function Ld(s,a){a===void 0&&(a=[]);let l=[];return f.Children.forEach(s,(o,c)=>{if(!f.isValidElement(o))return;let d=[...a,c];if(o.type===f.Fragment){l.push.apply(l,Ld(o.props.children,d));return}o.type!==dt&&kt(!1),!o.props.index||!o.props.children||kt(!1);let h={id:o.props.id||d.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,loader:o.props.loader,action:o.props.action,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(h.children=Ld(o.props.children,d)),l.push(h)}),l}/**
* React Router DOM v6.30.3
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function Od(){return Od=Object.assign?Object.assign.bind():function(s){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&(s[o]=l[o])}return s},Od.apply(this,arguments)}function mj(s,a){if(s==null)return{};var l={},o=Object.keys(s),c,d;for(d=0;d<o.length;d++)c=o[d],!(a.indexOf(c)>=0)&&(l[c]=s[c]);return l}function xj(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}function pj(s,a){return s.button===0&&(!a||a==="_self")&&!xj(s)}function Fd(s){return s===void 0&&(s=""),new URLSearchParams(typeof s=="string"||Array.isArray(s)||s instanceof URLSearchParams?s:Object.keys(s).reduce((a,l)=>{let o=s[l];return a.concat(Array.isArray(o)?o.map(c=>[l,c]):[[l,o]])},[]))}function gj(s,a){let l=Fd(s);return a&&a.forEach((o,c)=>{l.has(c)||a.getAll(c).forEach(d=>{l.append(c,d)})}),l}const yj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],vj="6";try{window.__reactRouterVersion=vj}catch{}const jj="startTransition",km=uo[jj];function bj(s){let{basename:a,children:l,future:o,window:c}=s,d=f.useRef();d.current==null&&(d.current=vv({window:c,v5Compat:!0}));let h=d.current,[m,p]=f.useState({action:h.action,location:h.location}),{v7_startTransition:y}=o||{},g=f.useCallback(v=>{y&&km?km(()=>p(v)):p(v)},[p,y]);return f.useLayoutEffect(()=>h.listen(g),[h,g]),f.useEffect(()=>dj(o),[o]),f.createElement(hj,{basename:a,children:l,location:m.location,navigationType:m.action,navigator:h,future:o})}const Nj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",wj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Hi=f.forwardRef(function(a,l){let{onClick:o,relative:c,reloadDocument:d,replace:h,state:m,target:p,to:y,preventScrollReset:g,viewTransition:v}=a,C=mj(a,yj),{basename:P}=f.useContext(Js),T,S=!1;if(typeof y=="string"&&wj.test(y)&&(T=y,Nj))try{let j=new URL(window.location.href),R=y.startsWith("//")?new URL(j.protocol+y):new URL(y),B=iu(R.pathname,P);R.origin===j.origin&&B!=null?y=B+R.search+R.hash:S=!0}catch{}let b=Yv(y,{relative:c}),N=Sj(y,{replace:h,state:m,target:p,preventScrollReset:g,relative:c,viewTransition:v});function E(j){o&&o(j),j.defaultPrevented||N(j)}return f.createElement("a",Od({},C,{href:T||b,onClick:S||d?o:E,ref:l,target:p}))});var Em;(function(s){s.UseScrollRestoration="useScrollRestoration",s.UseSubmit="useSubmit",s.UseSubmitFetcher="useSubmitFetcher",s.UseFetcher="useFetcher",s.useViewTransitionState="useViewTransitionState"})(Em||(Em={}));var Pm;(function(s){s.UseFetcher="useFetcher",s.UseFetchers="useFetchers",s.UseScrollRestoration="useScrollRestoration"})(Pm||(Pm={}));function Sj(s,a){let{target:l,replace:o,state:c,preventScrollReset:d,relative:h,viewTransition:m}=a===void 0?{}:a,p=da(),y=Zs(),g=Tx(s,{relative:h});return f.useCallback(v=>{if(pj(v,l)){v.preventDefault();let C=o!==void 0?o:Qi(y)===Qi(g);p(s,{replace:C,state:c,preventScrollReset:d,relative:h,viewTransition:m})}},[y,p,g,o,c,l,s,d,h,m])}function Cj(s){let a=f.useRef(Fd(s)),l=f.useRef(!1),o=Zs(),c=f.useMemo(()=>gj(o.search,l.current?null:a.current),[o.search]),d=da(),h=f.useCallback((m,p)=>{const y=Fd(typeof m=="function"?m(c):m);l.current=!0,d("?"+y,p)},[d,c]);return[c,h]}/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const kj=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ej=s=>s.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,l,o)=>o?o.toUpperCase():l.toLowerCase()),Tm=s=>{const a=Ej(s);return a.charAt(0).toUpperCase()+a.slice(1)},Mx=(...s)=>s.filter((a,l,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===l).join(" ").trim(),Pj=s=>{for(const a in s)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var Tj={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"};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Rj=f.forwardRef(({color:s="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:d,iconNode:h,...m},p)=>f.createElement("svg",{ref:p,...Tj,width:a,height:a,stroke:s,strokeWidth:o?Number(l)*24/Number(a):l,className:Mx("lucide",c),...!d&&!Pj(m)&&{"aria-hidden":"true"},...m},[...h.map(([y,g])=>f.createElement(y,g)),...Array.isArray(d)?d:[d]]));/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ke=(s,a)=>{const l=f.forwardRef(({className:o,...c},d)=>f.createElement(Rj,{ref:d,iconNode:a,className:Mx(`lucide-${kj(Tm(s))}`,`lucide-${s}`,o),...c}));return l.displayName=Tm(s),l};/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ij=[["path",{d:"M11.767 19.089c4.924.868 6.14-6.025 1.216-6.894m-1.216 6.894L5.86 18.047m5.908 1.042-.347 1.97m1.563-8.864c4.924.869 6.14-6.025 1.215-6.893m-1.215 6.893-3.94-.694m5.155-6.2L8.29 4.26m5.908 1.042.348-1.97M7.48 20.364l3.126-17.727",key:"yr8idg"}]],Rm=ke("bitcoin",Ij);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const _j=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],us=ke("book-open",_j);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Mj=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],qi=ke("calendar",Mj);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Aj=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],Dj=ke("chart-column",Aj);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Lj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],fo=ke("check",Lj);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Oj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ml=ke("chevron-down",Oj);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Fj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Vs=ke("chevron-right",Fj);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const zj=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ax=ke("chevron-up",zj);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const $j=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Bj=ke("circle-alert",$j);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Uj=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Im=ke("circle-check-big",Uj);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Vj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Wj=ke("circle-check",Vj);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Hj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Dx=ke("circle-question-mark",Hj);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Kj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],vd=ke("circle-user",Kj);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Yj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Lx=ke("circle-x",Yj);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Gj=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ox=ke("clock",Gj);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Qj=[["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"}]],Fx=ke("copy",Qj);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qj=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],zd=ke("credit-card",qj);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Xj=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],mo=ke("crown",Xj);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Jj=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],Xi=ke("dollar-sign",Jj);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Zj=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],eb=ke("download",Zj);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const tb=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Ji=ke("external-link",tb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const rb=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ds=ke("eye",rb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const sb=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],nb=ke("file-text",sb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ab=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],lb=ke("funnel",ab);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ib=[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]],ob=ke("gift",ib);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const cb=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],db=ke("git-merge",cb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ub=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],$d=ke("globe",ub);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const hb=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],zx=ke("graduation-cap",hb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const fb=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],is=ke("grip-vertical",fb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const mb=[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]],xb=ke("handshake",mb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const pb=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],_m=ke("history",pb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gb=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],yb=ke("house",gb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const vb=[["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"}]],$x=ke("image",vb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const jb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Li=ke("info",jb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const bb=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],Mm=ke("key",bb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Nb=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],wb=ke("layout-dashboard",Nb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Sb=[["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"}]],Ys=ke("link-2",Sb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Cb=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],Am=ke("link",Cb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const kb=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Eb=ke("list",kb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Pb=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Tb=ke("lock",Pb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Rb=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Ib=ke("log-out",Rb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const _b=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],Mb=ke("map-pin",_b);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ab=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Db=ke("menu",Ab);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Lb=[["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"}]],Ob=ke("message-circle",Lb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Fb=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],zb=ke("palette",Fb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const $b=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],yt=ke("pen-line",$b);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Bb=[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]],Ub=ke("percent",Bb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Vb=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],Wb=ke("phone",Vb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Hb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],At=ke("plus",Hb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Kb=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],Dm=ke("qr-code",Kb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Yb=[["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"}]],$e=ke("refresh-cw",Yb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Gb=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],zt=ke("save",Gb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Qb=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],yn=ke("search",Qb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qb=[["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"}]],dl=ke("settings",qb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Xb=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],jd=ke("settings-2",Xb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Jb=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],uu=ke("shield-check",Jb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Zb=[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]],Bd=ke("shopping-bag",Zb);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const eN=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Ud=ke("smartphone",eN);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const tN=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],rN=ke("tag",tN);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const sN=[["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"}]],Gt=ke("trash-2",sN);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const nN=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],ul=ke("trending-up",nN);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const aN=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],Bx=ke("undo-2",aN);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const lN=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Zi=ke("upload",lN);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const iN=[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],oN=ke("user-check",iN);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const cN=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],Vd=ke("user-plus",cN);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const dN=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],ra=ke("user",dN);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const uN=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Qt=ke("users",uN);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const hN=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],aa=ke("wallet",hN);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const fN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Sr=ke("x",fN);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const mN=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],eo=ke("zap",mN),hu="admin_token";function fu(){try{return localStorage.getItem(hu)}catch{return null}}function xN(s){try{localStorage.setItem(hu,s)}catch{}}function pN(){try{localStorage.removeItem(hu)}catch{}}const gN="https://soulapi.quwanzhi.com",yN=()=>{const s="https://soulapi.quwanzhi.com";return s.length>0?s.replace(/\/$/,""):gN};function la(s){const a=yN(),l=s.startsWith("/")?s:`/${s}`;return a?`${a}${l}`:l}async function xo(s,a={}){const{data:l,...o}=a,c=la(s),d=new Headers(o.headers),h=fu();h&&d.set("Authorization",`Bearer ${h}`),l!=null&&!d.has("Content-Type")&&d.set("Content-Type","application/json");const m=l!=null?JSON.stringify(l):o.body,p=await fetch(c,{...o,headers:d,body:m,credentials:"include"}),g=(p.headers.get("Content-Type")||"").includes("application/json")?await p.json():p;if(!p.ok){const v=new Error((g==null?void 0:g.error)||`HTTP ${p.status}`);throw v.status=p.status,v.data=g,v}return g}function Fe(s,a){return xo(s,{...a,method:"GET"})}function Et(s,a,l){return xo(s,{...l,method:"POST",data:a})}function Nt(s,a,l){return xo(s,{...l,method:"PUT",data:a})}function vn(s,a){return xo(s,{...a,method:"DELETE"})}const vN=[{icon:wb,label:"数据概览",href:"/dashboard"},{icon:us,label:"内容管理",href:"/content"},{icon:Qt,label:"用户管理",href:"/users"}],Lm=[{icon:db,label:"找伙伴",href:"/find-partner"},{icon:mo,label:"VIP 角色",href:"/vip-roles"},{icon:zx,label:"导师管理",href:"/mentors"},{icon:aa,label:"推广中心",href:"/distribution"},{icon:zd,label:"推广设置",href:"/referral-settings"}];function jN(){const s=Zs(),a=da(),[l,o]=f.useState(!1),[c,d]=f.useState(!1),[h,m]=f.useState(!1);f.useEffect(()=>{o(!0)},[]),f.useEffect(()=>{Lm.some(g=>s.pathname===g.href)&&m(!0)},[s.pathname]),f.useEffect(()=>{if(!l)return;d(!1);let y=!1;return Fe("/api/admin").then(g=>{y||(g&&g.success!==!1?d(!0):a("/login",{replace:!0}))}).catch(()=>{y||a("/login",{replace:!0})}),()=>{y=!0}},[l,a]);const p=async()=>{pN();try{await Et("/api/admin/logout",{})}catch{}a("/login",{replace:!0})};return!l||!c?e.jsxs("div",{className:"flex min-h-screen bg-[#0a1628]",children:[e.jsx("div",{className:"w-64 bg-[#0f2137] border-r border-gray-700/50"}),e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx("div",{className:"text-[#38bdac]",children:"加载中..."})})]}):e.jsxs("div",{className:"flex min-h-screen bg-[#0a1628]",children:[e.jsxs("div",{className:"w-64 bg-[#0f2137] flex flex-col border-r border-gray-700/50 shadow-xl",children:[e.jsxs("div",{className:"p-6 border-b border-gray-700/50",children:[e.jsx("h1",{className:"text-xl font-bold text-[#38bdac]",children:"管理后台"}),e.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Soul创业派对"})]}),e.jsxs("nav",{className:"flex-1 p-4 space-y-1 overflow-y-auto",children:[vN.map(y=>{const g=s.pathname===y.href;return e.jsxs(Hi,{to:y.href,className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${g?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[e.jsx(y.icon,{className:"w-5 h-5 shrink-0"}),e.jsx("span",{className:"text-sm",children:y.label})]},y.href)}),e.jsx("button",{type:"button",onClick:()=>m(!h),className:"w-full flex items-center justify-between gap-3 px-4 py-3 text-gray-400 hover:bg-gray-700/50 hover:text-white rounded-lg transition-colors",children:e.jsxs("span",{className:"flex items-center gap-3",children:[h?e.jsx(Ax,{className:"w-5 h-5"}):e.jsx(ml,{className:"w-5 h-5"}),e.jsx("span",{className:"text-sm",children:"更多"})]})}),h&&e.jsx("div",{className:"space-y-1 pl-4",children:Lm.map(y=>{const g=s.pathname===y.href;return e.jsxs(Hi,{to:y.href,className:`flex items-center gap-3 px-4 py-2 rounded-lg transition-colors ${g?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[e.jsx(y.icon,{className:"w-5 h-5 shrink-0"}),e.jsx("span",{className:"text-sm",children:y.label})]},y.href)})}),e.jsx("div",{className:"pt-4 mt-4 border-t border-gray-700/50",children:e.jsxs(Hi,{to:"/settings",className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${s.pathname==="/settings"?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[e.jsx(dl,{className:"w-5 h-5 shrink-0"}),e.jsx("span",{className:"text-sm",children:"系统设置"})]})})]}),e.jsx("div",{className:"p-4 border-t border-gray-700/50 space-y-1",children:e.jsxs("button",{type:"button",onClick:p,className:"w-full flex items-center gap-3 px-4 py-3 text-gray-400 hover:text-white rounded-lg hover:bg-gray-700/50 transition-colors",children:[e.jsx(Ib,{className:"w-5 h-5"}),e.jsx("span",{className:"text-sm",children:"退出登录"})]})})]}),e.jsx("div",{className:"flex-1 overflow-auto bg-[#0a1628] min-w-0",children:e.jsx("div",{className:"w-full min-w-[1024px] min-h-full",children:e.jsx(uj,{})})})]})}function Om(s,a){if(typeof s=="function")return s(a);s!=null&&(s.current=a)}function mu(...s){return a=>{let l=!1;const o=s.map(c=>{const d=Om(c,a);return!l&&typeof d=="function"&&(l=!0),d});if(l)return()=>{for(let c=0;c<o.length;c++){const d=o[c];typeof d=="function"?d():Om(s[c],null)}}}}function et(...s){return f.useCallback(mu(...s),s)}var bN=Symbol.for("react.lazy"),to=uo[" use ".trim().toString()];function NN(s){return typeof s=="object"&&s!==null&&"then"in s}function Ux(s){return s!=null&&typeof s=="object"&&"$$typeof"in s&&s.$$typeof===bN&&"_payload"in s&&NN(s._payload)}function Vx(s){const a=wN(s),l=f.forwardRef((o,c)=>{let{children:d,...h}=o;Ux(d)&&typeof to=="function"&&(d=to(d._payload));const m=f.Children.toArray(d),p=m.find(CN);if(p){const y=p.props.children,g=m.map(v=>v===p?f.Children.count(y)>1?f.Children.only(null):f.isValidElement(y)?y.props.children:null:v);return e.jsx(a,{...h,ref:c,children:f.isValidElement(y)?f.cloneElement(y,void 0,g):null})}return e.jsx(a,{...h,ref:c,children:d})});return l.displayName=`${s}.Slot`,l}var Wx=Vx("Slot");function wN(s){const a=f.forwardRef((l,o)=>{let{children:c,...d}=l;if(Ux(c)&&typeof to=="function"&&(c=to(c._payload)),f.isValidElement(c)){const h=EN(c),m=kN(d,c.props);return c.type!==f.Fragment&&(m.ref=o?mu(o,h):h),f.cloneElement(c,m)}return f.Children.count(c)>1?f.Children.only(null):null});return a.displayName=`${s}.SlotClone`,a}var SN=Symbol("radix.slottable");function CN(s){return f.isValidElement(s)&&typeof s.type=="function"&&"__radixId"in s.type&&s.type.__radixId===SN}function kN(s,a){const l={...a};for(const o in a){const c=s[o],d=a[o];/^on[A-Z]/.test(o)?c&&d?l[o]=(...m)=>{const p=d(...m);return c(...m),p}:c&&(l[o]=c):o==="style"?l[o]={...c,...d}:o==="className"&&(l[o]=[c,d].filter(Boolean).join(" "))}return{...s,...l}}function EN(s){var o,c;let a=(o=Object.getOwnPropertyDescriptor(s.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?s.ref:(a=(c=Object.getOwnPropertyDescriptor(s,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?s.props.ref:s.props.ref||s.ref)}function Hx(s){var a,l,o="";if(typeof s=="string"||typeof s=="number")o+=s;else if(typeof s=="object")if(Array.isArray(s)){var c=s.length;for(a=0;a<c;a++)s[a]&&(l=Hx(s[a]))&&(o&&(o+=" "),o+=l)}else for(l in s)s[l]&&(o&&(o+=" "),o+=l);return o}function Kx(){for(var s,a,l=0,o="",c=arguments.length;l<c;l++)(s=arguments[l])&&(a=Hx(s))&&(o&&(o+=" "),o+=a);return o}const Fm=s=>typeof s=="boolean"?`${s}`:s===0?"0":s,zm=Kx,Yx=(s,a)=>l=>{var o;if((a==null?void 0:a.variants)==null)return zm(s,l==null?void 0:l.class,l==null?void 0:l.className);const{variants:c,defaultVariants:d}=a,h=Object.keys(c).map(y=>{const g=l==null?void 0:l[y],v=d==null?void 0:d[y];if(g===null)return null;const C=Fm(g)||Fm(v);return c[y][C]}),m=l&&Object.entries(l).reduce((y,g)=>{let[v,C]=g;return C===void 0||(y[v]=C),y},{}),p=a==null||(o=a.compoundVariants)===null||o===void 0?void 0:o.reduce((y,g)=>{let{class:v,className:C,...P}=g;return Object.entries(P).every(T=>{let[S,b]=T;return Array.isArray(b)?b.includes({...d,...m}[S]):{...d,...m}[S]===b})?[...y,v,C]:y},[]);return zm(s,h,p,l==null?void 0:l.class,l==null?void 0:l.className)},PN=(s,a)=>{const l=new Array(s.length+a.length);for(let o=0;o<s.length;o++)l[o]=s[o];for(let o=0;o<a.length;o++)l[s.length+o]=a[o];return l},TN=(s,a)=>({classGroupId:s,validator:a}),Gx=(s=new Map,a=null,l)=>({nextPart:s,validators:a,classGroupId:l}),ro="-",$m=[],RN="arbitrary..",IN=s=>{const a=MN(s),{conflictingClassGroups:l,conflictingClassGroupModifiers:o}=s;return{getClassGroupId:h=>{if(h.startsWith("[")&&h.endsWith("]"))return _N(h);const m=h.split(ro),p=m[0]===""&&m.length>1?1:0;return Qx(m,p,a)},getConflictingClassGroupIds:(h,m)=>{if(m){const p=o[h],y=l[h];return p?y?PN(y,p):p:y||$m}return l[h]||$m}}},Qx=(s,a,l)=>{if(s.length-a===0)return l.classGroupId;const c=s[a],d=l.nextPart.get(c);if(d){const y=Qx(s,a+1,d);if(y)return y}const h=l.validators;if(h===null)return;const m=a===0?s.join(ro):s.slice(a).join(ro),p=h.length;for(let y=0;y<p;y++){const g=h[y];if(g.validator(m))return g.classGroupId}},_N=s=>s.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=s.slice(1,-1),l=a.indexOf(":"),o=a.slice(0,l);return o?RN+o:void 0})(),MN=s=>{const{theme:a,classGroups:l}=s;return AN(l,a)},AN=(s,a)=>{const l=Gx();for(const o in s){const c=s[o];xu(c,l,o,a)}return l},xu=(s,a,l,o)=>{const c=s.length;for(let d=0;d<c;d++){const h=s[d];DN(h,a,l,o)}},DN=(s,a,l,o)=>{if(typeof s=="string"){LN(s,a,l);return}if(typeof s=="function"){ON(s,a,l,o);return}FN(s,a,l,o)},LN=(s,a,l)=>{const o=s===""?a:qx(a,s);o.classGroupId=l},ON=(s,a,l,o)=>{if(zN(s)){xu(s(o),a,l,o);return}a.validators===null&&(a.validators=[]),a.validators.push(TN(l,s))},FN=(s,a,l,o)=>{const c=Object.entries(s),d=c.length;for(let h=0;h<d;h++){const[m,p]=c[h];xu(p,qx(a,m),l,o)}},qx=(s,a)=>{let l=s;const o=a.split(ro),c=o.length;for(let d=0;d<c;d++){const h=o[d];let m=l.nextPart.get(h);m||(m=Gx(),l.nextPart.set(h,m)),l=m}return l},zN=s=>"isThemeGetter"in s&&s.isThemeGetter===!0,$N=s=>{if(s<1)return{get:()=>{},set:()=>{}};let a=0,l=Object.create(null),o=Object.create(null);const c=(d,h)=>{l[d]=h,a++,a>s&&(a=0,o=l,l=Object.create(null))};return{get(d){let h=l[d];if(h!==void 0)return h;if((h=o[d])!==void 0)return c(d,h),h},set(d,h){d in l?l[d]=h:c(d,h)}}},Wd="!",Bm=":",BN=[],Um=(s,a,l,o,c)=>({modifiers:s,hasImportantModifier:a,baseClassName:l,maybePostfixModifierPosition:o,isExternal:c}),UN=s=>{const{prefix:a,experimentalParseClassName:l}=s;let o=c=>{const d=[];let h=0,m=0,p=0,y;const g=c.length;for(let S=0;S<g;S++){const b=c[S];if(h===0&&m===0){if(b===Bm){d.push(c.slice(p,S)),p=S+1;continue}if(b==="/"){y=S;continue}}b==="["?h++:b==="]"?h--:b==="("?m++:b===")"&&m--}const v=d.length===0?c:c.slice(p);let C=v,P=!1;v.endsWith(Wd)?(C=v.slice(0,-1),P=!0):v.startsWith(Wd)&&(C=v.slice(1),P=!0);const T=y&&y>p?y-p:void 0;return Um(d,P,C,T)};if(a){const c=a+Bm,d=o;o=h=>h.startsWith(c)?d(h.slice(c.length)):Um(BN,!1,h,void 0,!0)}if(l){const c=o;o=d=>l({className:d,parseClassName:c})}return o},VN=s=>{const a=new Map;return s.orderSensitiveModifiers.forEach((l,o)=>{a.set(l,1e6+o)}),l=>{const o=[];let c=[];for(let d=0;d<l.length;d++){const h=l[d],m=h[0]==="[",p=a.has(h);m||p?(c.length>0&&(c.sort(),o.push(...c),c=[]),o.push(h)):c.push(h)}return c.length>0&&(c.sort(),o.push(...c)),o}},WN=s=>({cache:$N(s.cacheSize),parseClassName:UN(s),sortModifiers:VN(s),...IN(s)}),HN=/\s+/,KN=(s,a)=>{const{parseClassName:l,getClassGroupId:o,getConflictingClassGroupIds:c,sortModifiers:d}=a,h=[],m=s.trim().split(HN);let p="";for(let y=m.length-1;y>=0;y-=1){const g=m[y],{isExternal:v,modifiers:C,hasImportantModifier:P,baseClassName:T,maybePostfixModifierPosition:S}=l(g);if(v){p=g+(p.length>0?" "+p:p);continue}let b=!!S,N=o(b?T.substring(0,S):T);if(!N){if(!b){p=g+(p.length>0?" "+p:p);continue}if(N=o(T),!N){p=g+(p.length>0?" "+p:p);continue}b=!1}const E=C.length===0?"":C.length===1?C[0]:d(C).join(":"),j=P?E+Wd:E,R=j+N;if(h.indexOf(R)>-1)continue;h.push(R);const B=c(N,b);for(let U=0;U<B.length;++U){const k=B[U];h.push(j+k)}p=g+(p.length>0?" "+p:p)}return p},YN=(...s)=>{let a=0,l,o,c="";for(;a<s.length;)(l=s[a++])&&(o=Xx(l))&&(c&&(c+=" "),c+=o);return c},Xx=s=>{if(typeof s=="string")return s;let a,l="";for(let o=0;o<s.length;o++)s[o]&&(a=Xx(s[o]))&&(l&&(l+=" "),l+=a);return l},GN=(s,...a)=>{let l,o,c,d;const h=p=>{const y=a.reduce((g,v)=>v(g),s());return l=WN(y),o=l.cache.get,c=l.cache.set,d=m,m(p)},m=p=>{const y=o(p);if(y)return y;const g=KN(p,l);return c(p,g),g};return d=h,(...p)=>d(YN(...p))},QN=[],Mt=s=>{const a=l=>l[s]||QN;return a.isThemeGetter=!0,a},Jx=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Zx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,qN=/^\d+\/\d+$/,XN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,JN=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ZN=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ew=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qn=s=>qN.test(s),He=s=>!!s&&!Number.isNaN(Number(s)),Bs=s=>!!s&&Number.isInteger(Number(s)),bd=s=>s.endsWith("%")&&He(s.slice(0,-1)),os=s=>XN.test(s),rw=()=>!0,sw=s=>JN.test(s)&&!ZN.test(s),ep=()=>!1,nw=s=>ew.test(s),aw=s=>tw.test(s),lw=s=>!Re(s)&&!Ie(s),iw=s=>ua(s,sp,ep),Re=s=>Jx.test(s),gn=s=>ua(s,np,sw),Nd=s=>ua(s,hw,He),Vm=s=>ua(s,tp,ep),ow=s=>ua(s,rp,aw),Oi=s=>ua(s,ap,nw),Ie=s=>Zx.test(s),ll=s=>ha(s,np),cw=s=>ha(s,fw),Wm=s=>ha(s,tp),dw=s=>ha(s,sp),uw=s=>ha(s,rp),Fi=s=>ha(s,ap,!0),ua=(s,a,l)=>{const o=Jx.exec(s);return o?o[1]?a(o[1]):l(o[2]):!1},ha=(s,a,l=!1)=>{const o=Zx.exec(s);return o?o[1]?a(o[1]):l:!1},tp=s=>s==="position"||s==="percentage",rp=s=>s==="image"||s==="url",sp=s=>s==="length"||s==="size"||s==="bg-size",np=s=>s==="length",hw=s=>s==="number",fw=s=>s==="family-name",ap=s=>s==="shadow",mw=()=>{const s=Mt("color"),a=Mt("font"),l=Mt("text"),o=Mt("font-weight"),c=Mt("tracking"),d=Mt("leading"),h=Mt("breakpoint"),m=Mt("container"),p=Mt("spacing"),y=Mt("radius"),g=Mt("shadow"),v=Mt("inset-shadow"),C=Mt("text-shadow"),P=Mt("drop-shadow"),T=Mt("blur"),S=Mt("perspective"),b=Mt("aspect"),N=Mt("ease"),E=Mt("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],B=()=>[...R(),Ie,Re],U=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],L=()=>[Ie,Re,p],_=()=>[qn,"full","auto",...L()],se=()=>[Bs,"none","subgrid",Ie,Re],le=()=>["auto",{span:["full",Bs,Ie,Re]},Bs,Ie,Re],ie=()=>[Bs,"auto",Ie,Re],ee=()=>["auto","min","max","fr",Ie,Re],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],ce=()=>["auto",...L()],re=()=>[qn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],A=()=>[s,Ie,Re],ne=()=>[...R(),Wm,Vm,{position:[Ie,Re]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",dw,iw,{size:[Ie,Re]}],O=()=>[bd,ll,gn],F=()=>["","none","full",y,Ie,Re],X=()=>["",He,ll,gn],H=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>[He,bd,Wm,Vm],ye=()=>["","none",T,Ie,Re],ge=()=>["none",He,Ie,Re],D=()=>["none",He,Ie,Re],fe=()=>[He,Ie,Re],Se=()=>[qn,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[os],breakpoint:[os],color:[rw],container:[os],"drop-shadow":[os],ease:["in","out","in-out"],font:[lw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[os],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[os],shadow:[os],spacing:["px",He],text:[os],"text-shadow":[os],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",qn,Re,Ie,b]}],container:["container"],columns:[{columns:[He,Re,Ie,m]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:B()}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:_()}],"inset-x":[{"inset-x":_()}],"inset-y":[{"inset-y":_()}],start:[{start:_()}],end:[{end:_()}],top:[{top:_()}],right:[{right:_()}],bottom:[{bottom:_()}],left:[{left:_()}],visibility:["visible","invisible","collapse"],z:[{z:[Bs,"auto",Ie,Re]}],basis:[{basis:[qn,"full","auto",m,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[He,qn,"auto","initial","none",Re]}],grow:[{grow:["",He,Ie,Re]}],shrink:[{shrink:["",He,Ie,Re]}],order:[{order:[Bs,"first","last","none",Ie,Re]}],"grid-cols":[{"grid-cols":se()}],"col-start-end":[{col:le()}],"col-start":[{"col-start":ie()}],"col-end":[{"col-end":ie()}],"grid-rows":[{"grid-rows":se()}],"row-start-end":[{row:le()}],"row-start":[{"row-start":ie()}],"row-end":[{"row-end":ie()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:ce()}],mx:[{mx:ce()}],my:[{my:ce()}],ms:[{ms:ce()}],me:[{me:ce()}],mt:[{mt:ce()}],mr:[{mr:ce()}],mb:[{mb:ce()}],ml:[{ml:ce()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:re()}],w:[{w:[m,"screen",...re()]}],"min-w":[{"min-w":[m,"screen","none",...re()]}],"max-w":[{"max-w":[m,"screen","none","prose",{screen:[h]},...re()]}],h:[{h:["screen","lh",...re()]}],"min-h":[{"min-h":["screen","lh","none",...re()]}],"max-h":[{"max-h":["screen","lh",...re()]}],"font-size":[{text:["base",l,ll,gn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Ie,Nd]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",bd,Re]}],"font-family":[{font:[cw,Re,a]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[c,Ie,Re]}],"line-clamp":[{"line-clamp":[He,"none",Ie,Nd]}],leading:[{leading:[d,...L()]}],"list-image":[{"list-image":["none",Ie,Re]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ie,Re]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:[He,"from-font","auto",Ie,gn]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[He,"auto",Ie,Re]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ie,Re]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ie,Re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Bs,Ie,Re],radial:["",Ie,Re],conic:[Bs,Ie,Re]},uw,ow]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...H(),"hidden","none"]}],"divide-style":[{divide:[...H(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...H(),"none","hidden"]}],"outline-offset":[{"outline-offset":[He,Ie,Re]}],"outline-w":[{outline:["",He,ll,gn]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",g,Fi,Oi]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",v,Fi,Oi]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[He,gn]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",C,Fi,Oi]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[He,Ie,Re]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[He]}],"mask-image-linear-from-pos":[{"mask-linear-from":K()}],"mask-image-linear-to-pos":[{"mask-linear-to":K()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":K()}],"mask-image-t-to-pos":[{"mask-t-to":K()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":K()}],"mask-image-r-to-pos":[{"mask-r-to":K()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":K()}],"mask-image-b-to-pos":[{"mask-b-to":K()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":K()}],"mask-image-l-to-pos":[{"mask-l-to":K()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":K()}],"mask-image-x-to-pos":[{"mask-x-to":K()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":K()}],"mask-image-y-to-pos":[{"mask-y-to":K()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[Ie,Re]}],"mask-image-radial-from-pos":[{"mask-radial-from":K()}],"mask-image-radial-to-pos":[{"mask-radial-to":K()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[He]}],"mask-image-conic-from-pos":[{"mask-conic-from":K()}],"mask-image-conic-to-pos":[{"mask-conic-to":K()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ie,Re]}],filter:[{filter:["","none",Ie,Re]}],blur:[{blur:ye()}],brightness:[{brightness:[He,Ie,Re]}],contrast:[{contrast:[He,Ie,Re]}],"drop-shadow":[{"drop-shadow":["","none",P,Fi,Oi]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",He,Ie,Re]}],"hue-rotate":[{"hue-rotate":[He,Ie,Re]}],invert:[{invert:["",He,Ie,Re]}],saturate:[{saturate:[He,Ie,Re]}],sepia:[{sepia:["",He,Ie,Re]}],"backdrop-filter":[{"backdrop-filter":["","none",Ie,Re]}],"backdrop-blur":[{"backdrop-blur":ye()}],"backdrop-brightness":[{"backdrop-brightness":[He,Ie,Re]}],"backdrop-contrast":[{"backdrop-contrast":[He,Ie,Re]}],"backdrop-grayscale":[{"backdrop-grayscale":["",He,Ie,Re]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[He,Ie,Re]}],"backdrop-invert":[{"backdrop-invert":["",He,Ie,Re]}],"backdrop-opacity":[{"backdrop-opacity":[He,Ie,Re]}],"backdrop-saturate":[{"backdrop-saturate":[He,Ie,Re]}],"backdrop-sepia":[{"backdrop-sepia":["",He,Ie,Re]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ie,Re]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[He,"initial",Ie,Re]}],ease:[{ease:["linear","initial",N,Ie,Re]}],delay:[{delay:[He,Ie,Re]}],animate:[{animate:["none",E,Ie,Re]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ie,Re]}],"perspective-origin":[{"perspective-origin":B()}],rotate:[{rotate:ge()}],"rotate-x":[{"rotate-x":ge()}],"rotate-y":[{"rotate-y":ge()}],"rotate-z":[{"rotate-z":ge()}],scale:[{scale:D()}],"scale-x":[{"scale-x":D()}],"scale-y":[{"scale-y":D()}],"scale-z":[{"scale-z":D()}],"scale-3d":["scale-3d"],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[Ie,Re,"","none","gpu","cpu"]}],"transform-origin":[{origin:B()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Se()}],"translate-x":[{"translate-x":Se()}],"translate-y":[{"translate-y":Se()}],"translate-z":[{"translate-z":Se()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ie,Re]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ie,Re]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[He,ll,gn,Nd]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},xw=GN(mw);function tt(...s){return xw(Kx(s))}const pw=Yx("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Z({className:s,variant:a,size:l,asChild:o=!1,...c}){const d=o?Wx:"button";return e.jsx(d,{"data-slot":"button",className:tt(pw({variant:a,size:l,className:s})),...c})}function de({className:s,type:a,...l}){return e.jsx("input",{type:a,"data-slot":"input",className:tt("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs outline-none placeholder:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 md:text-sm focus-visible:ring-2 focus-visible:ring-ring",s),...l})}function gw(){const s=da(),[a,l]=f.useState(""),[o,c]=f.useState(""),[d,h]=f.useState(""),[m,p]=f.useState(!1),y=async()=>{h(""),p(!0);try{const g=await Et("/api/admin",{username:a.trim(),password:o});if((g==null?void 0:g.success)!==!1&&(g!=null&&g.token)){xN(g.token),s("/dashboard",{replace:!0});return}h(g.error||"用户名或密码错误")}catch(g){const v=g;h(v.status===401?"用户名或密码错误":(v==null?void 0:v.message)||"网络错误,请重试")}finally{p(!1)}};return e.jsxs("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-4",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[e.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 bg-[#38bdac]/5 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute bottom-1/4 right-1/4 w-96 h-96 bg-blue-500/5 rounded-full blur-3xl"})]}),e.jsxs("div",{className:"w-full max-w-md relative z-10",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"w-16 h-16 bg-[#38bdac]/20 rounded-2xl flex items-center justify-center mx-auto mb-4 border border-[#38bdac]/30",children:e.jsx(uu,{className:"w-8 h-8 text-[#38bdac]"})}),e.jsx("h1",{className:"text-2xl font-bold text-white mb-2",children:"管理后台"}),e.jsx("p",{className:"text-gray-400",children:"一场SOUL的创业实验场"})]}),e.jsxs("div",{className:"bg-[#0f2137] rounded-2xl p-8 shadow-xl border border-gray-700/50 backdrop-blur-xl",children:[e.jsx("h2",{className:"text-xl font-semibold text-white mb-6 text-center",children:"管理员登录"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"用户名"}),e.jsxs("div",{className:"relative",children:[e.jsx(ra,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),e.jsx(de,{type:"text",value:a,onChange:g=>l(g.target.value),placeholder:"请输入用户名",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"密码"}),e.jsxs("div",{className:"relative",children:[e.jsx(Tb,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),e.jsx(de,{type:"password",value:o,onChange:g=>c(g.target.value),placeholder:"请输入密码",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]",onKeyDown:g=>g.key==="Enter"&&y()})]})]}),d&&e.jsx("div",{className:"bg-red-500/10 text-red-400 text-sm p-3 rounded-lg border border-red-500/20",children:d}),e.jsx(Z,{onClick:y,disabled:m,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white py-5 disabled:opacity-50",children:m?"登录中...":"登录"})]})]}),e.jsx("p",{className:"text-center text-gray-500 text-xs mt-6",children:"Soul创业实验场 · 后台管理系统"})]})]})}const Ne=f.forwardRef(({className:s,...a},l)=>e.jsx("div",{ref:l,className:tt("rounded-xl border bg-card text-card-foreground shadow",s),...a}));Ne.displayName="Card";const Ue=f.forwardRef(({className:s,...a},l)=>e.jsx("div",{ref:l,className:tt("flex flex-col space-y-1.5 p-6",s),...a}));Ue.displayName="CardHeader";const Ve=f.forwardRef(({className:s,...a},l)=>e.jsx("h3",{ref:l,className:tt("font-semibold leading-none tracking-tight",s),...a}));Ve.displayName="CardTitle";const ht=f.forwardRef(({className:s,...a},l)=>e.jsx("p",{ref:l,className:tt("text-sm text-muted-foreground",s),...a}));ht.displayName="CardDescription";const we=f.forwardRef(({className:s,...a},l)=>e.jsx("div",{ref:l,className:tt("p-6 pt-0",s),...a}));we.displayName="CardContent";const yw=f.forwardRef(({className:s,...a},l)=>e.jsx("div",{ref:l,className:tt("flex items-center p-6 pt-0",s),...a}));yw.displayName="CardFooter";function vw(){const s=da(),[a,l]=f.useState(!0),[o,c]=f.useState([]),[d,h]=f.useState([]),[m,p]=f.useState(0),[y,g]=f.useState(0),[v,C]=f.useState(0),[P,T]=f.useState(0),[S,b]=f.useState(null);async function N(){var B;l(!0),b(null);try{const U=await Fe("/api/admin/dashboard/overview");if(U!=null&&U.success){p(U.totalUsers??0),g(U.paidOrderCount??0),C(U.totalRevenue??0),T(U.conversionRate??0),h(U.recentOrders??[]),c(U.newUsers??[]);return}}catch(U){console.error("数据概览接口失败,尝试降级拉取",U)}try{const[U,k]=await Promise.all([Fe("/api/db/users?page=1&pageSize=10"),Fe("/api/orders?page=1&pageSize=20&status=paid")]),L=typeof(U==null?void 0:U.total)=="number"?U.total:((B=U==null?void 0:U.users)==null?void 0:B.length)??0,_=(k==null?void 0:k.orders)??[],se=typeof(k==null?void 0:k.total)=="number"?k.total:_.length,le=_.filter(Q=>Q.status==="paid"||Q.status==="completed"||Q.status==="success"),ie=le.reduce((Q,ce)=>Q+Number(ce.amount||0),0),ee=new Set(le.map(Q=>Q.userId).filter(Boolean)),G=L>0&&ee.size>0?ee.size/L*100:0;p(L),g(se),C(ie),T(G),h(_.slice(0,5)),c((U==null?void 0:U.users)??[])}catch(U){console.error("降级拉取失败",U);const k=U;(k==null?void 0:k.status)===401?b("登录已过期,请重新登录"):b("加载失败,请检查网络或联系管理员")}finally{l(!1)}}if(f.useEffect(()=>{N();const B=setInterval(N,3e4);return()=>clearInterval(B)},[]),a)return e.jsxs("div",{className:"p-8 w-full",children:[e.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-24",children:[e.jsx($e,{className:"w-12 h-12 text-[#38bdac] animate-spin mb-4"}),e.jsx("span",{className:"text-gray-400",children:"加载中..."})]})]});const E=m,j=B=>{const U=B.productType||"",k=B.description||"";if(k){if(U==="section"&&k.includes("章节")){if(k.includes("-")){const L=k.split("-");if(L.length>=3)return{title:`${L[1]}章 第${L[2]}`,subtitle:"《一场Soul的创业实验》"}}return{title:k,subtitle:"章节购买"}}return U==="fullbook"||k.includes("全书")?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:U==="match"||k.includes("伙伴")?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:k,subtitle:U==="section"?"单章":U==="fullbook"?"全书":"其他"}}return U==="section"?{title:`章节 ${B.productId||""}`,subtitle:"单章购买"}:U==="fullbook"?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:U==="match"?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:"未知商品",subtitle:U||"其他"}},R=[{title:"总用户数",value:E,icon:Qt,color:"text-blue-400",bg:"bg-blue-500/20",link:"/users"},{title:"总收入",value:`¥${(v??0).toFixed(2)}`,icon:ul,color:"text-[#38bdac]",bg:"bg-[#38bdac]/20",link:"/orders"},{title:"订单数",value:y,icon:Bd,color:"text-purple-400",bg:"bg-purple-500/20",link:"/orders"},{title:"转化率",value:`${typeof P=="number"?P.toFixed(1):0}%`,icon:us,color:"text-orange-400",bg:"bg-orange-500/20",link:"/distribution"}];return e.jsxs("div",{className:"p-8 w-full",children:[e.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),S&&e.jsxs("div",{className:"mb-6 px-4 py-3 rounded-lg bg-amber-500/20 border border-amber-500/50 text-amber-200 text-sm flex items-center justify-between",children:[e.jsx("span",{children:S}),e.jsx("button",{type:"button",onClick:()=>N(),className:"text-amber-400 hover:text-amber-300 underline",children:"重试"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:R.map((B,U)=>e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl cursor-pointer hover:border-[#38bdac]/50 transition-colors group",onClick:()=>B.link&&s(B.link),children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(Ve,{className:"text-sm font-medium text-gray-400",children:B.title}),e.jsx("div",{className:`p-2 rounded-lg ${B.bg}`,children:e.jsx(B.icon,{className:`w-4 h-4 ${B.color}`})})]}),e.jsx(we,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-2xl font-bold text-white",children:B.value}),e.jsx(Vs,{className:"w-5 h-5 text-gray-600 group-hover:text-[#38bdac] transition-colors"})]})})]},U))}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between",children:[e.jsx(Ve,{className:"text-white",children:"最近订单"}),e.jsxs("button",{type:"button",onClick:()=>N(),className:"text-xs text-gray-400 hover:text-[#38bdac] flex items-center gap-1",title:"刷新",children:[e.jsx($e,{className:"w-3.5 h-3.5"}),"刷新(每 30 秒自动更新)"]})]}),e.jsx(we,{children:e.jsxs("div",{className:"space-y-3",children:[d.slice(0,5).map(B=>{var se;const U=B.referrerId?o.find(le=>le.id===B.referrerId):void 0,k=B.referralCode||(U==null?void 0:U.referralCode)||(U==null?void 0:U.nickname)||(B.referrerId?String(B.referrerId).slice(0,8):""),L=j(B),_=B.userNickname||((se=o.find(le=>le.id===B.userId))==null?void 0:se.nickname)||"匿名用户";return e.jsxs("div",{className:"flex items-start justify-between p-4 bg-[#0a1628] rounded-lg border border-gray-700/30 hover:border-[#38bdac]/30 transition-colors",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[B.userAvatar?e.jsx("img",{src:B.userAvatar,alt:_,className:"w-9 h-9 rounded-full object-cover flex-shrink-0 mt-0.5",onError:le=>{le.currentTarget.style.display="none";const ie=le.currentTarget.nextElementSibling;ie&&ie.classList.remove("hidden")}}):null,e.jsx("div",{className:`w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 mt-0.5 ${B.userAvatar?"hidden":""}`,children:_.charAt(0)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-sm text-gray-300",children:_}),e.jsx("span",{className:"text-gray-600",children:"·"}),e.jsx("span",{className:"text-sm font-medium text-white truncate",children:L.title})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500",children:[e.jsx("span",{className:"px-1.5 py-0.5 bg-gray-700/50 rounded",children:L.subtitle}),e.jsx("span",{children:new Date(B.createdAt||0).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})})]}),k&&e.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:["推荐: ",k]})]})]}),e.jsxs("div",{className:"text-right ml-4 flex-shrink-0",children:[e.jsxs("p",{className:"text-sm font-bold text-[#38bdac]",children:["+¥",Number(B.amount).toFixed(2)]}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:B.paymentMethod||"微信"})]})]},B.id)}),d.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Bd,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-500",children:"暂无订单数据"})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white",children:"新注册用户"})}),e.jsx(we,{children:e.jsxs("div",{className:"space-y-3",children:[o.slice(0,5).map(B=>{var U;return e.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg border border-gray-700/30",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac]",children:((U=B.nickname)==null?void 0:U.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-white",children:B.nickname||"匿名用户"}),e.jsx("p",{className:"text-xs text-gray-500",children:B.phone||"-"})]})]}),e.jsx("p",{className:"text-xs text-gray-400",children:B.createdAt?new Date(B.createdAt).toLocaleDateString():"-"})]},B.id)}),o.length===0&&e.jsx("p",{className:"text-gray-500 text-center py-8",children:"暂无用户数据"})]})})]})]})]})}const ir=f.forwardRef(({className:s,...a},l)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:l,className:tt("w-full caption-bottom text-sm",s),...a})}));ir.displayName="Table";const or=f.forwardRef(({className:s,...a},l)=>e.jsx("thead",{ref:l,className:tt("[&_tr]:border-b",s),...a}));or.displayName="TableHeader";const cr=f.forwardRef(({className:s,...a},l)=>e.jsx("tbody",{ref:l,className:tt("[&_tr:last-child]:border-0",s),...a}));cr.displayName="TableBody";const Ge=f.forwardRef(({className:s,...a},l)=>e.jsx("tr",{ref:l,className:tt("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",s),...a}));Ge.displayName="TableRow";const je=f.forwardRef(({className:s,...a},l)=>e.jsx("th",{ref:l,className:tt("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));je.displayName="TableHead";const pe=f.forwardRef(({className:s,...a},l)=>e.jsx("td",{ref:l,className:tt("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));pe.displayName="TableCell";const jw=Yx("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 transition-colors",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-white",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Oe({className:s,variant:a,asChild:l=!1,...o}){const c=l?Wx:"span";return e.jsx(c,{className:tt(jw({variant:a}),s),...o})}function Be(s,a,{checkForDefaultPrevented:l=!0}={}){return function(c){if(s==null||s(c),l===!1||!c.defaultPrevented)return a==null?void 0:a(c)}}function bw(s,a){const l=f.createContext(a),o=d=>{const{children:h,...m}=d,p=f.useMemo(()=>m,Object.values(m));return e.jsx(l.Provider,{value:p,children:h})};o.displayName=s+"Provider";function c(d){const h=f.useContext(l);if(h)return h;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[o,c]}function en(s,a=[]){let l=[];function o(d,h){const m=f.createContext(h),p=l.length;l=[...l,h];const y=v=>{var N;const{scope:C,children:P,...T}=v,S=((N=C==null?void 0:C[s])==null?void 0:N[p])||m,b=f.useMemo(()=>T,Object.values(T));return e.jsx(S.Provider,{value:b,children:P})};y.displayName=d+"Provider";function g(v,C){var S;const P=((S=C==null?void 0:C[s])==null?void 0:S[p])||m,T=f.useContext(P);if(T)return T;if(h!==void 0)return h;throw new Error(`\`${v}\` must be used within \`${d}\``)}return[y,g]}const c=()=>{const d=l.map(h=>f.createContext(h));return function(m){const p=(m==null?void 0:m[s])||d;return f.useMemo(()=>({[`__scope${s}`]:{...m,[s]:p}}),[m,p])}};return c.scopeName=s,[o,Nw(c,...a)]}function Nw(...s){const a=s[0];if(s.length===1)return a;const l=()=>{const o=s.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(d){const h=o.reduce((m,{useScope:p,scopeName:y})=>{const v=p(d)[`__scope${y}`];return{...m,...v}},{});return f.useMemo(()=>({[`__scope${a.scopeName}`]:h}),[h])}};return l.scopeName=a.scopeName,l}var qt=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},ww=uo[" useId ".trim().toString()]||(()=>{}),Sw=0;function Gs(s){const[a,l]=f.useState(ww());return qt(()=>{l(o=>o??String(Sw++))},[s]),a?`radix-${a}`:""}var Cw=uo[" useInsertionEffect ".trim().toString()]||qt;function bn({prop:s,defaultProp:a,onChange:l=()=>{},caller:o}){const[c,d,h]=kw({defaultProp:a,onChange:l}),m=s!==void 0,p=m?s:c;{const g=f.useRef(s!==void 0);f.useEffect(()=>{const v=g.current;v!==m&&console.warn(`${o} is changing from ${v?"controlled":"uncontrolled"} to ${m?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=m},[m,o])}const y=f.useCallback(g=>{var v;if(m){const C=Ew(g)?g(s):g;C!==s&&((v=h.current)==null||v.call(h,C))}else d(g)},[m,s,d,h]);return[p,y]}function kw({defaultProp:s,onChange:a}){const[l,o]=f.useState(s),c=f.useRef(l),d=f.useRef(a);return Cw(()=>{d.current=a},[a]),f.useEffect(()=>{var h;c.current!==l&&((h=d.current)==null||h.call(d,l),c.current=l)},[l,c]),[l,o,d]}function Ew(s){return typeof s=="function"}function xl(s){const a=Pw(s),l=f.forwardRef((o,c)=>{const{children:d,...h}=o,m=f.Children.toArray(d),p=m.find(Rw);if(p){const y=p.props.children,g=m.map(v=>v===p?f.Children.count(y)>1?f.Children.only(null):f.isValidElement(y)?y.props.children:null:v);return e.jsx(a,{...h,ref:c,children:f.isValidElement(y)?f.cloneElement(y,void 0,g):null})}return e.jsx(a,{...h,ref:c,children:d})});return l.displayName=`${s}.Slot`,l}function Pw(s){const a=f.forwardRef((l,o)=>{const{children:c,...d}=l;if(f.isValidElement(c)){const h=_w(c),m=Iw(d,c.props);return c.type!==f.Fragment&&(m.ref=o?mu(o,h):h),f.cloneElement(c,m)}return f.Children.count(c)>1?f.Children.only(null):null});return a.displayName=`${s}.SlotClone`,a}var Tw=Symbol("radix.slottable");function Rw(s){return f.isValidElement(s)&&typeof s.type=="function"&&"__radixId"in s.type&&s.type.__radixId===Tw}function Iw(s,a){const l={...a};for(const o in a){const c=s[o],d=a[o];/^on[A-Z]/.test(o)?c&&d?l[o]=(...m)=>{const p=d(...m);return c(...m),p}:c&&(l[o]=c):o==="style"?l[o]={...c,...d}:o==="className"&&(l[o]=[c,d].filter(Boolean).join(" "))}return{...s,...l}}function _w(s){var o,c;let a=(o=Object.getOwnPropertyDescriptor(s.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?s.ref:(a=(c=Object.getOwnPropertyDescriptor(s,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?s.props.ref:s.props.ref||s.ref)}var Mw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ke=Mw.reduce((s,a)=>{const l=xl(`Primitive.${a}`),o=f.forwardRef((c,d)=>{const{asChild:h,...m}=c,p=h?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...m,ref:d})});return o.displayName=`Primitive.${a}`,{...s,[a]:o}},{});function Aw(s,a){s&&gl.flushSync(()=>s.dispatchEvent(a))}function Qs(s){const a=f.useRef(s);return f.useEffect(()=>{a.current=s}),f.useMemo(()=>(...l)=>{var o;return(o=a.current)==null?void 0:o.call(a,...l)},[])}function Dw(s,a=globalThis==null?void 0:globalThis.document){const l=Qs(s);f.useEffect(()=>{const o=c=>{c.key==="Escape"&&l(c)};return a.addEventListener("keydown",o,{capture:!0}),()=>a.removeEventListener("keydown",o,{capture:!0})},[l,a])}var Lw="DismissableLayer",Hd="dismissableLayer.update",Ow="dismissableLayer.pointerDownOutside",Fw="dismissableLayer.focusOutside",Hm,lp=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),pu=f.forwardRef((s,a)=>{const{disableOutsidePointerEvents:l=!1,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,onDismiss:m,...p}=s,y=f.useContext(lp),[g,v]=f.useState(null),C=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,P]=f.useState({}),T=et(a,k=>v(k)),S=Array.from(y.layers),[b]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),N=S.indexOf(b),E=g?S.indexOf(g):-1,j=y.layersWithOutsidePointerEventsDisabled.size>0,R=E>=N,B=Bw(k=>{const L=k.target,_=[...y.branches].some(se=>se.contains(L));!R||_||(c==null||c(k),h==null||h(k),k.defaultPrevented||m==null||m())},C),U=Uw(k=>{const L=k.target;[...y.branches].some(se=>se.contains(L))||(d==null||d(k),h==null||h(k),k.defaultPrevented||m==null||m())},C);return Dw(k=>{E===y.layers.size-1&&(o==null||o(k),!k.defaultPrevented&&m&&(k.preventDefault(),m()))},C),f.useEffect(()=>{if(g)return l&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(Hm=C.body.style.pointerEvents,C.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(g)),y.layers.add(g),Km(),()=>{l&&y.layersWithOutsidePointerEventsDisabled.size===1&&(C.body.style.pointerEvents=Hm)}},[g,C,l,y]),f.useEffect(()=>()=>{g&&(y.layers.delete(g),y.layersWithOutsidePointerEventsDisabled.delete(g),Km())},[g,y]),f.useEffect(()=>{const k=()=>P({});return document.addEventListener(Hd,k),()=>document.removeEventListener(Hd,k)},[]),e.jsx(Ke.div,{...p,ref:T,style:{pointerEvents:j?R?"auto":"none":void 0,...s.style},onFocusCapture:Be(s.onFocusCapture,U.onFocusCapture),onBlurCapture:Be(s.onBlurCapture,U.onBlurCapture),onPointerDownCapture:Be(s.onPointerDownCapture,B.onPointerDownCapture)})});pu.displayName=Lw;var zw="DismissableLayerBranch",$w=f.forwardRef((s,a)=>{const l=f.useContext(lp),o=f.useRef(null),c=et(a,o);return f.useEffect(()=>{const d=o.current;if(d)return l.branches.add(d),()=>{l.branches.delete(d)}},[l.branches]),e.jsx(Ke.div,{...s,ref:c})});$w.displayName=zw;function Bw(s,a=globalThis==null?void 0:globalThis.document){const l=Qs(s),o=f.useRef(!1),c=f.useRef(()=>{});return f.useEffect(()=>{const d=m=>{if(m.target&&!o.current){let p=function(){ip(Ow,l,y,{discrete:!0})};const y={originalEvent:m};m.pointerType==="touch"?(a.removeEventListener("click",c.current),c.current=p,a.addEventListener("click",c.current,{once:!0})):p()}else a.removeEventListener("click",c.current);o.current=!1},h=window.setTimeout(()=>{a.addEventListener("pointerdown",d)},0);return()=>{window.clearTimeout(h),a.removeEventListener("pointerdown",d),a.removeEventListener("click",c.current)}},[a,l]),{onPointerDownCapture:()=>o.current=!0}}function Uw(s,a=globalThis==null?void 0:globalThis.document){const l=Qs(s),o=f.useRef(!1);return f.useEffect(()=>{const c=d=>{d.target&&!o.current&&ip(Fw,l,{originalEvent:d},{discrete:!1})};return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,l]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Km(){const s=new CustomEvent(Hd);document.dispatchEvent(s)}function ip(s,a,l,{discrete:o}){const c=l.originalEvent.target,d=new CustomEvent(s,{bubbles:!1,cancelable:!0,detail:l});a&&c.addEventListener(s,a,{once:!0}),o?Aw(c,d):c.dispatchEvent(d)}var wd="focusScope.autoFocusOnMount",Sd="focusScope.autoFocusOnUnmount",Ym={bubbles:!1,cancelable:!0},Vw="FocusScope",gu=f.forwardRef((s,a)=>{const{loop:l=!1,trapped:o=!1,onMountAutoFocus:c,onUnmountAutoFocus:d,...h}=s,[m,p]=f.useState(null),y=Qs(c),g=Qs(d),v=f.useRef(null),C=et(a,S=>p(S)),P=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(o){let S=function(j){if(P.paused||!m)return;const R=j.target;m.contains(R)?v.current=R:Ws(v.current,{select:!0})},b=function(j){if(P.paused||!m)return;const R=j.relatedTarget;R!==null&&(m.contains(R)||Ws(v.current,{select:!0}))},N=function(j){if(document.activeElement===document.body)for(const B of j)B.removedNodes.length>0&&Ws(m)};document.addEventListener("focusin",S),document.addEventListener("focusout",b);const E=new MutationObserver(N);return m&&E.observe(m,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",b),E.disconnect()}}},[o,m,P.paused]),f.useEffect(()=>{if(m){Qm.add(P);const S=document.activeElement;if(!m.contains(S)){const N=new CustomEvent(wd,Ym);m.addEventListener(wd,y),m.dispatchEvent(N),N.defaultPrevented||(Ww(Qw(op(m)),{select:!0}),document.activeElement===S&&Ws(m))}return()=>{m.removeEventListener(wd,y),setTimeout(()=>{const N=new CustomEvent(Sd,Ym);m.addEventListener(Sd,g),m.dispatchEvent(N),N.defaultPrevented||Ws(S??document.body,{select:!0}),m.removeEventListener(Sd,g),Qm.remove(P)},0)}}},[m,y,g,P]);const T=f.useCallback(S=>{if(!l&&!o||P.paused)return;const b=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,N=document.activeElement;if(b&&N){const E=S.currentTarget,[j,R]=Hw(E);j&&R?!S.shiftKey&&N===R?(S.preventDefault(),l&&Ws(j,{select:!0})):S.shiftKey&&N===j&&(S.preventDefault(),l&&Ws(R,{select:!0})):N===E&&S.preventDefault()}},[l,o,P.paused]);return e.jsx(Ke.div,{tabIndex:-1,...h,ref:C,onKeyDown:T})});gu.displayName=Vw;function Ww(s,{select:a=!1}={}){const l=document.activeElement;for(const o of s)if(Ws(o,{select:a}),document.activeElement!==l)return}function Hw(s){const a=op(s),l=Gm(a,s),o=Gm(a.reverse(),s);return[l,o]}function op(s){const a=[],l=document.createTreeWalker(s,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const c=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||c?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;l.nextNode();)a.push(l.currentNode);return a}function Gm(s,a){for(const l of s)if(!Kw(l,{upTo:a}))return l}function Kw(s,{upTo:a}){if(getComputedStyle(s).visibility==="hidden")return!0;for(;s;){if(a!==void 0&&s===a)return!1;if(getComputedStyle(s).display==="none")return!0;s=s.parentElement}return!1}function Yw(s){return s instanceof HTMLInputElement&&"select"in s}function Ws(s,{select:a=!1}={}){if(s&&s.focus){const l=document.activeElement;s.focus({preventScroll:!0}),s!==l&&Yw(s)&&a&&s.select()}}var Qm=Gw();function Gw(){let s=[];return{add(a){const l=s[0];a!==l&&(l==null||l.pause()),s=qm(s,a),s.unshift(a)},remove(a){var l;s=qm(s,a),(l=s[0])==null||l.resume()}}}function qm(s,a){const l=[...s],o=l.indexOf(a);return o!==-1&&l.splice(o,1),l}function Qw(s){return s.filter(a=>a.tagName!=="A")}var qw="Portal",yu=f.forwardRef((s,a)=>{var m;const{container:l,...o}=s,[c,d]=f.useState(!1);qt(()=>d(!0),[]);const h=l||c&&((m=globalThis==null?void 0:globalThis.document)==null?void 0:m.body);return h?yv.createPortal(e.jsx(Ke.div,{...o,ref:a}),h):null});yu.displayName=qw;function Xw(s,a){return f.useReducer((l,o)=>a[l][o]??l,s)}var yl=s=>{const{present:a,children:l}=s,o=Jw(a),c=typeof l=="function"?l({present:o.isPresent}):f.Children.only(l),d=et(o.ref,Zw(c));return typeof l=="function"||o.isPresent?f.cloneElement(c,{ref:d}):null};yl.displayName="Presence";function Jw(s){const[a,l]=f.useState(),o=f.useRef(null),c=f.useRef(s),d=f.useRef("none"),h=s?"mounted":"unmounted",[m,p]=Xw(h,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const y=zi(o.current);d.current=m==="mounted"?y:"none"},[m]),qt(()=>{const y=o.current,g=c.current;if(g!==s){const C=d.current,P=zi(y);s?p("MOUNT"):P==="none"||(y==null?void 0:y.display)==="none"?p("UNMOUNT"):p(g&&C!==P?"ANIMATION_OUT":"UNMOUNT"),c.current=s}},[s,p]),qt(()=>{if(a){let y;const g=a.ownerDocument.defaultView??window,v=P=>{const S=zi(o.current).includes(CSS.escape(P.animationName));if(P.target===a&&S&&(p("ANIMATION_END"),!c.current)){const b=a.style.animationFillMode;a.style.animationFillMode="forwards",y=g.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=b)})}},C=P=>{P.target===a&&(d.current=zi(o.current))};return a.addEventListener("animationstart",C),a.addEventListener("animationcancel",v),a.addEventListener("animationend",v),()=>{g.clearTimeout(y),a.removeEventListener("animationstart",C),a.removeEventListener("animationcancel",v),a.removeEventListener("animationend",v)}}else p("ANIMATION_END")},[a,p]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:f.useCallback(y=>{o.current=y?getComputedStyle(y):null,l(y)},[])}}function zi(s){return(s==null?void 0:s.animationName)||"none"}function Zw(s){var o,c;let a=(o=Object.getOwnPropertyDescriptor(s.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?s.ref:(a=(c=Object.getOwnPropertyDescriptor(s,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?s.props.ref:s.props.ref||s.ref)}var Cd=0;function cp(){f.useEffect(()=>{const s=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",s[0]??Xm()),document.body.insertAdjacentElement("beforeend",s[1]??Xm()),Cd++,()=>{Cd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),Cd--}},[])}function Xm(){const s=document.createElement("span");return s.setAttribute("data-radix-focus-guard",""),s.tabIndex=0,s.style.outline="none",s.style.opacity="0",s.style.position="fixed",s.style.pointerEvents="none",s}var Kr=function(){return Kr=Object.assign||function(a){for(var l,o=1,c=arguments.length;o<c;o++){l=arguments[o];for(var d in l)Object.prototype.hasOwnProperty.call(l,d)&&(a[d]=l[d])}return a},Kr.apply(this,arguments)};function dp(s,a){var l={};for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&a.indexOf(o)<0&&(l[o]=s[o]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,o=Object.getOwnPropertySymbols(s);c<o.length;c++)a.indexOf(o[c])<0&&Object.prototype.propertyIsEnumerable.call(s,o[c])&&(l[o[c]]=s[o[c]]);return l}function e1(s,a,l){if(l||arguments.length===2)for(var o=0,c=a.length,d;o<c;o++)(d||!(o in a))&&(d||(d=Array.prototype.slice.call(a,0,o)),d[o]=a[o]);return s.concat(d||Array.prototype.slice.call(a))}var Ki="right-scroll-bar-position",Yi="width-before-scroll-bar",t1="with-scroll-bars-hidden",r1="--removed-body-scroll-bar-size";function kd(s,a){return typeof s=="function"?s(a):s&&(s.current=a),s}function s1(s,a){var l=f.useState(function(){return{value:s,callback:a,facade:{get current(){return l.value},set current(o){var c=l.value;c!==o&&(l.value=o,l.callback(o,c))}}}})[0];return l.callback=a,l.facade}var n1=typeof window<"u"?f.useLayoutEffect:f.useEffect,Jm=new WeakMap;function a1(s,a){var l=s1(null,function(o){return s.forEach(function(c){return kd(c,o)})});return n1(function(){var o=Jm.get(l);if(o){var c=new Set(o),d=new Set(s),h=l.current;c.forEach(function(m){d.has(m)||kd(m,null)}),d.forEach(function(m){c.has(m)||kd(m,h)})}Jm.set(l,s)},[s]),l}function l1(s){return s}function i1(s,a){a===void 0&&(a=l1);var l=[],o=!1,c={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return l.length?l[l.length-1]:s},useMedium:function(d){var h=a(d,o);return l.push(h),function(){l=l.filter(function(m){return m!==h})}},assignSyncMedium:function(d){for(o=!0;l.length;){var h=l;l=[],h.forEach(d)}l={push:function(m){return d(m)},filter:function(){return l}}},assignMedium:function(d){o=!0;var h=[];if(l.length){var m=l;l=[],m.forEach(d),h=l}var p=function(){var g=h;h=[],g.forEach(d)},y=function(){return Promise.resolve().then(p)};y(),l={push:function(g){h.push(g),y()},filter:function(g){return h=h.filter(g),l}}}};return c}function o1(s){s===void 0&&(s={});var a=i1(null);return a.options=Kr({async:!0,ssr:!1},s),a}var up=function(s){var a=s.sideCar,l=dp(s,["sideCar"]);if(!a)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=a.read();if(!o)throw new Error("Sidecar medium not found");return f.createElement(o,Kr({},l))};up.isSideCarExport=!0;function c1(s,a){return s.useMedium(a),up}var hp=o1(),Ed=function(){},po=f.forwardRef(function(s,a){var l=f.useRef(null),o=f.useState({onScrollCapture:Ed,onWheelCapture:Ed,onTouchMoveCapture:Ed}),c=o[0],d=o[1],h=s.forwardProps,m=s.children,p=s.className,y=s.removeScrollBar,g=s.enabled,v=s.shards,C=s.sideCar,P=s.noRelative,T=s.noIsolation,S=s.inert,b=s.allowPinchZoom,N=s.as,E=N===void 0?"div":N,j=s.gapMode,R=dp(s,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),B=C,U=a1([l,a]),k=Kr(Kr({},R),c);return f.createElement(f.Fragment,null,g&&f.createElement(B,{sideCar:hp,removeScrollBar:y,shards:v,noRelative:P,noIsolation:T,inert:S,setCallbacks:d,allowPinchZoom:!!b,lockRef:l,gapMode:j}),h?f.cloneElement(f.Children.only(m),Kr(Kr({},k),{ref:U})):f.createElement(E,Kr({},k,{className:p,ref:U}),m))});po.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};po.classNames={fullWidth:Yi,zeroRight:Ki};var d1=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function u1(){if(!document)return null;var s=document.createElement("style");s.type="text/css";var a=d1();return a&&s.setAttribute("nonce",a),s}function h1(s,a){s.styleSheet?s.styleSheet.cssText=a:s.appendChild(document.createTextNode(a))}function f1(s){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(s)}var m1=function(){var s=0,a=null;return{add:function(l){s==0&&(a=u1())&&(h1(a,l),f1(a)),s++},remove:function(){s--,!s&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},x1=function(){var s=m1();return function(a,l){f.useEffect(function(){return s.add(a),function(){s.remove()}},[a&&l])}},fp=function(){var s=x1(),a=function(l){var o=l.styles,c=l.dynamic;return s(o,c),null};return a},p1={left:0,top:0,right:0,gap:0},Pd=function(s){return parseInt(s||"",10)||0},g1=function(s){var a=window.getComputedStyle(document.body),l=a[s==="padding"?"paddingLeft":"marginLeft"],o=a[s==="padding"?"paddingTop":"marginTop"],c=a[s==="padding"?"paddingRight":"marginRight"];return[Pd(l),Pd(o),Pd(c)]},y1=function(s){if(s===void 0&&(s="margin"),typeof window>"u")return p1;var a=g1(s),l=document.documentElement.clientWidth,o=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,o-l+a[2]-a[0])}},v1=fp(),sa="data-scroll-locked",j1=function(s,a,l,o){var c=s.left,d=s.top,h=s.right,m=s.gap;return l===void 0&&(l="margin"),`
.`.concat(t1,` {
overflow: hidden `).concat(o,`;
padding-right: `).concat(m,"px ").concat(o,`;
}
body[`).concat(sa,`] {
overflow: hidden `).concat(o,`;
overscroll-behavior: contain;
`).concat([a&&"position: relative ".concat(o,";"),l==="margin"&&`
padding-left: `.concat(c,`px;
padding-top: `).concat(d,`px;
padding-right: `).concat(h,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(m,"px ").concat(o,`;
`),l==="padding"&&"padding-right: ".concat(m,"px ").concat(o,";")].filter(Boolean).join(""),`
}
.`).concat(Ki,` {
right: `).concat(m,"px ").concat(o,`;
}
.`).concat(Yi,` {
margin-right: `).concat(m,"px ").concat(o,`;
}
.`).concat(Ki," .").concat(Ki,` {
right: 0 `).concat(o,`;
}
.`).concat(Yi," .").concat(Yi,` {
margin-right: 0 `).concat(o,`;
}
body[`).concat(sa,`] {
`).concat(r1,": ").concat(m,`px;
}
`)},Zm=function(){var s=parseInt(document.body.getAttribute(sa)||"0",10);return isFinite(s)?s:0},b1=function(){f.useEffect(function(){return document.body.setAttribute(sa,(Zm()+1).toString()),function(){var s=Zm()-1;s<=0?document.body.removeAttribute(sa):document.body.setAttribute(sa,s.toString())}},[])},N1=function(s){var a=s.noRelative,l=s.noImportant,o=s.gapMode,c=o===void 0?"margin":o;b1();var d=f.useMemo(function(){return y1(c)},[c]);return f.createElement(v1,{styles:j1(d,!a,c,l?"":"!important")})},Kd=!1;if(typeof window<"u")try{var $i=Object.defineProperty({},"passive",{get:function(){return Kd=!0,!0}});window.addEventListener("test",$i,$i),window.removeEventListener("test",$i,$i)}catch{Kd=!1}var Xn=Kd?{passive:!1}:!1,w1=function(s){return s.tagName==="TEXTAREA"},mp=function(s,a){if(!(s instanceof Element))return!1;var l=window.getComputedStyle(s);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!w1(s)&&l[a]==="visible")},S1=function(s){return mp(s,"overflowY")},C1=function(s){return mp(s,"overflowX")},ex=function(s,a){var l=a.ownerDocument,o=a;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var c=xp(s,o);if(c){var d=pp(s,o),h=d[1],m=d[2];if(h>m)return!0}o=o.parentNode}while(o&&o!==l.body);return!1},k1=function(s){var a=s.scrollTop,l=s.scrollHeight,o=s.clientHeight;return[a,l,o]},E1=function(s){var a=s.scrollLeft,l=s.scrollWidth,o=s.clientWidth;return[a,l,o]},xp=function(s,a){return s==="v"?S1(a):C1(a)},pp=function(s,a){return s==="v"?k1(a):E1(a)},P1=function(s,a){return s==="h"&&a==="rtl"?-1:1},T1=function(s,a,l,o,c){var d=P1(s,window.getComputedStyle(a).direction),h=d*o,m=l.target,p=a.contains(m),y=!1,g=h>0,v=0,C=0;do{if(!m)break;var P=pp(s,m),T=P[0],S=P[1],b=P[2],N=S-b-d*T;(T||N)&&xp(s,m)&&(v+=N,C+=T);var E=m.parentNode;m=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!p&&m!==document.body||p&&(a.contains(m)||a===m));return(g&&Math.abs(v)<1||!g&&Math.abs(C)<1)&&(y=!0),y},Bi=function(s){return"changedTouches"in s?[s.changedTouches[0].clientX,s.changedTouches[0].clientY]:[0,0]},tx=function(s){return[s.deltaX,s.deltaY]},rx=function(s){return s&&"current"in s?s.current:s},R1=function(s,a){return s[0]===a[0]&&s[1]===a[1]},I1=function(s){return`
.block-interactivity-`.concat(s,` {pointer-events: none;}
.allow-interactivity-`).concat(s,` {pointer-events: all;}
`)},_1=0,Jn=[];function M1(s){var a=f.useRef([]),l=f.useRef([0,0]),o=f.useRef(),c=f.useState(_1++)[0],d=f.useState(fp)[0],h=f.useRef(s);f.useEffect(function(){h.current=s},[s]),f.useEffect(function(){if(s.inert){document.body.classList.add("block-interactivity-".concat(c));var S=e1([s.lockRef.current],(s.shards||[]).map(rx),!0).filter(Boolean);return S.forEach(function(b){return b.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(c))})}}},[s.inert,s.lockRef.current,s.shards]);var m=f.useCallback(function(S,b){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!h.current.allowPinchZoom;var N=Bi(S),E=l.current,j="deltaX"in S?S.deltaX:E[0]-N[0],R="deltaY"in S?S.deltaY:E[1]-N[1],B,U=S.target,k=Math.abs(j)>Math.abs(R)?"h":"v";if("touches"in S&&k==="h"&&U.type==="range")return!1;var L=window.getSelection(),_=L&&L.anchorNode,se=_?_===U||_.contains(U):!1;if(se)return!1;var le=ex(k,U);if(!le)return!0;if(le?B=k:(B=k==="v"?"h":"v",le=ex(k,U)),!le)return!1;if(!o.current&&"changedTouches"in S&&(j||R)&&(o.current=B),!B)return!0;var ie=o.current||B;return T1(ie,b,S,ie==="h"?j:R)},[]),p=f.useCallback(function(S){var b=S;if(!(!Jn.length||Jn[Jn.length-1]!==d)){var N="deltaY"in b?tx(b):Bi(b),E=a.current.filter(function(B){return B.name===b.type&&(B.target===b.target||b.target===B.shadowParent)&&R1(B.delta,N)})[0];if(E&&E.should){b.cancelable&&b.preventDefault();return}if(!E){var j=(h.current.shards||[]).map(rx).filter(Boolean).filter(function(B){return B.contains(b.target)}),R=j.length>0?m(b,j[0]):!h.current.noIsolation;R&&b.cancelable&&b.preventDefault()}}},[]),y=f.useCallback(function(S,b,N,E){var j={name:S,delta:b,target:N,should:E,shadowParent:A1(N)};a.current.push(j),setTimeout(function(){a.current=a.current.filter(function(R){return R!==j})},1)},[]),g=f.useCallback(function(S){l.current=Bi(S),o.current=void 0},[]),v=f.useCallback(function(S){y(S.type,tx(S),S.target,m(S,s.lockRef.current))},[]),C=f.useCallback(function(S){y(S.type,Bi(S),S.target,m(S,s.lockRef.current))},[]);f.useEffect(function(){return Jn.push(d),s.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:C}),document.addEventListener("wheel",p,Xn),document.addEventListener("touchmove",p,Xn),document.addEventListener("touchstart",g,Xn),function(){Jn=Jn.filter(function(S){return S!==d}),document.removeEventListener("wheel",p,Xn),document.removeEventListener("touchmove",p,Xn),document.removeEventListener("touchstart",g,Xn)}},[]);var P=s.removeScrollBar,T=s.inert;return f.createElement(f.Fragment,null,T?f.createElement(d,{styles:I1(c)}):null,P?f.createElement(N1,{noRelative:s.noRelative,gapMode:s.gapMode}):null)}function A1(s){for(var a=null;s!==null;)s instanceof ShadowRoot&&(a=s.host,s=s.host),s=s.parentNode;return a}const D1=c1(hp,M1);var vu=f.forwardRef(function(s,a){return f.createElement(po,Kr({},s,{ref:a,sideCar:D1}))});vu.classNames=po.classNames;var L1=function(s){if(typeof document>"u")return null;var a=Array.isArray(s)?s[0]:s;return a.ownerDocument.body},Zn=new WeakMap,Ui=new WeakMap,Vi={},Td=0,gp=function(s){return s&&(s.host||gp(s.parentNode))},O1=function(s,a){return a.map(function(l){if(s.contains(l))return l;var o=gp(l);return o&&s.contains(o)?o:(console.error("aria-hidden",l,"in not contained inside",s,". Doing nothing"),null)}).filter(function(l){return!!l})},F1=function(s,a,l,o){var c=O1(a,Array.isArray(s)?s:[s]);Vi[l]||(Vi[l]=new WeakMap);var d=Vi[l],h=[],m=new Set,p=new Set(c),y=function(v){!v||m.has(v)||(m.add(v),y(v.parentNode))};c.forEach(y);var g=function(v){!v||p.has(v)||Array.prototype.forEach.call(v.children,function(C){if(m.has(C))g(C);else try{var P=C.getAttribute(o),T=P!==null&&P!=="false",S=(Zn.get(C)||0)+1,b=(d.get(C)||0)+1;Zn.set(C,S),d.set(C,b),h.push(C),S===1&&T&&Ui.set(C,!0),b===1&&C.setAttribute(l,"true"),T||C.setAttribute(o,"true")}catch(N){console.error("aria-hidden: cannot operate on ",C,N)}})};return g(a),m.clear(),Td++,function(){h.forEach(function(v){var C=Zn.get(v)-1,P=d.get(v)-1;Zn.set(v,C),d.set(v,P),C||(Ui.has(v)||v.removeAttribute(o),Ui.delete(v)),P||v.removeAttribute(l)}),Td--,Td||(Zn=new WeakMap,Zn=new WeakMap,Ui=new WeakMap,Vi={})}},yp=function(s,a,l){l===void 0&&(l="data-aria-hidden");var o=Array.from(Array.isArray(s)?s:[s]),c=L1(s);return c?(o.push.apply(o,Array.from(c.querySelectorAll("[aria-live], script"))),F1(o,c,l,"aria-hidden")):function(){return null}},go="Dialog",[vp]=en(go),[z1,Or]=vp(go),jp=s=>{const{__scopeDialog:a,children:l,open:o,defaultOpen:c,onOpenChange:d,modal:h=!0}=s,m=f.useRef(null),p=f.useRef(null),[y,g]=bn({prop:o,defaultProp:c??!1,onChange:d,caller:go});return e.jsx(z1,{scope:a,triggerRef:m,contentRef:p,contentId:Gs(),titleId:Gs(),descriptionId:Gs(),open:y,onOpenChange:g,onOpenToggle:f.useCallback(()=>g(v=>!v),[g]),modal:h,children:l})};jp.displayName=go;var bp="DialogTrigger",$1=f.forwardRef((s,a)=>{const{__scopeDialog:l,...o}=s,c=Or(bp,l),d=et(a,c.triggerRef);return e.jsx(Ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":Nu(c.open),...o,ref:d,onClick:Be(s.onClick,c.onOpenToggle)})});$1.displayName=bp;var ju="DialogPortal",[B1,Np]=vp(ju,{forceMount:void 0}),wp=s=>{const{__scopeDialog:a,forceMount:l,children:o,container:c}=s,d=Or(ju,a);return e.jsx(B1,{scope:a,forceMount:l,children:f.Children.map(o,h=>e.jsx(yl,{present:l||d.open,children:e.jsx(yu,{asChild:!0,container:c,children:h})}))})};wp.displayName=ju;var so="DialogOverlay",Sp=f.forwardRef((s,a)=>{const l=Np(so,s.__scopeDialog),{forceMount:o=l.forceMount,...c}=s,d=Or(so,s.__scopeDialog);return d.modal?e.jsx(yl,{present:o||d.open,children:e.jsx(V1,{...c,ref:a})}):null});Sp.displayName=so;var U1=xl("DialogOverlay.RemoveScroll"),V1=f.forwardRef((s,a)=>{const{__scopeDialog:l,...o}=s,c=Or(so,l);return e.jsx(vu,{as:U1,allowPinchZoom:!0,shards:[c.contentRef],children:e.jsx(Ke.div,{"data-state":Nu(c.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})}),Nn="DialogContent",Cp=f.forwardRef((s,a)=>{const l=Np(Nn,s.__scopeDialog),{forceMount:o=l.forceMount,...c}=s,d=Or(Nn,s.__scopeDialog);return e.jsx(yl,{present:o||d.open,children:d.modal?e.jsx(W1,{...c,ref:a}):e.jsx(H1,{...c,ref:a})})});Cp.displayName=Nn;var W1=f.forwardRef((s,a)=>{const l=Or(Nn,s.__scopeDialog),o=f.useRef(null),c=et(a,l.contentRef,o);return f.useEffect(()=>{const d=o.current;if(d)return yp(d)},[]),e.jsx(kp,{...s,ref:c,trapFocus:l.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Be(s.onCloseAutoFocus,d=>{var h;d.preventDefault(),(h=l.triggerRef.current)==null||h.focus()}),onPointerDownOutside:Be(s.onPointerDownOutside,d=>{const h=d.detail.originalEvent,m=h.button===0&&h.ctrlKey===!0;(h.button===2||m)&&d.preventDefault()}),onFocusOutside:Be(s.onFocusOutside,d=>d.preventDefault())})}),H1=f.forwardRef((s,a)=>{const l=Or(Nn,s.__scopeDialog),o=f.useRef(!1),c=f.useRef(!1);return e.jsx(kp,{...s,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var h,m;(h=s.onCloseAutoFocus)==null||h.call(s,d),d.defaultPrevented||(o.current||(m=l.triggerRef.current)==null||m.focus(),d.preventDefault()),o.current=!1,c.current=!1},onInteractOutside:d=>{var p,y;(p=s.onInteractOutside)==null||p.call(s,d),d.defaultPrevented||(o.current=!0,d.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const h=d.target;((y=l.triggerRef.current)==null?void 0:y.contains(h))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&c.current&&d.preventDefault()}})}),kp=f.forwardRef((s,a)=>{const{__scopeDialog:l,trapFocus:o,onOpenAutoFocus:c,onCloseAutoFocus:d,...h}=s,m=Or(Nn,l),p=f.useRef(null),y=et(a,p);return cp(),e.jsxs(e.Fragment,{children:[e.jsx(gu,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:c,onUnmountAutoFocus:d,children:e.jsx(pu,{role:"dialog",id:m.contentId,"aria-describedby":m.descriptionId,"aria-labelledby":m.titleId,"data-state":Nu(m.open),...h,ref:y,onDismiss:()=>m.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(K1,{titleId:m.titleId}),e.jsx(G1,{contentRef:p,descriptionId:m.descriptionId})]})]})}),bu="DialogTitle",Ep=f.forwardRef((s,a)=>{const{__scopeDialog:l,...o}=s,c=Or(bu,l);return e.jsx(Ke.h2,{id:c.titleId,...o,ref:a})});Ep.displayName=bu;var Pp="DialogDescription",Tp=f.forwardRef((s,a)=>{const{__scopeDialog:l,...o}=s,c=Or(Pp,l);return e.jsx(Ke.p,{id:c.descriptionId,...o,ref:a})});Tp.displayName=Pp;var Rp="DialogClose",Ip=f.forwardRef((s,a)=>{const{__scopeDialog:l,...o}=s,c=Or(Rp,l);return e.jsx(Ke.button,{type:"button",...o,ref:a,onClick:Be(s.onClick,()=>c.onOpenChange(!1))})});Ip.displayName=Rp;function Nu(s){return s?"open":"closed"}var _p="DialogTitleWarning",[U4,Mp]=bw(_p,{contentName:Nn,titleName:bu,docsSlug:"dialog"}),K1=({titleId:s})=>{const a=Mp(_p),l=`\`${a.contentName}\` requires a \`${a.titleName}\` for the component to be accessible for screen reader users.
If you want to hide the \`${a.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;return f.useEffect(()=>{s&&(document.getElementById(s)||console.error(l))},[l,s]),null},Y1="DialogDescriptionWarning",G1=({contentRef:s,descriptionId:a})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Mp(Y1).contentName}}.`;return f.useEffect(()=>{var d;const c=(d=s.current)==null?void 0:d.getAttribute("aria-describedby");a&&c&&(document.getElementById(a)||console.warn(o))},[o,s,a]),null},Q1=jp,q1=wp,X1=Sp,J1=Cp,Z1=Ep,e2=Tp,t2=Ip;function wt(s){return e.jsx(Q1,{"data-slot":"dialog",...s})}function r2(s){return e.jsx(q1,{...s})}const Ap=f.forwardRef(({className:s,...a},l)=>e.jsx(X1,{ref:l,className:tt("fixed inset-0 z-50 bg-black/50",s),...a}));Ap.displayName="DialogOverlay";const vt=f.forwardRef(({className:s,children:a,showCloseButton:l=!0,...o},c)=>e.jsxs(r2,{children:[e.jsx(Ap,{}),e.jsxs(J1,{ref:c,"aria-describedby":void 0,className:tt("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border bg-background p-6 shadow-lg sm:max-w-lg",s),...o,children:[a,l&&e.jsxs(t2,{className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[e.jsx(Sr,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));vt.displayName="DialogContent";function St({className:s,...a}){return e.jsx("div",{className:tt("flex flex-col gap-2 text-center sm:text-left",s),...a})}function Ft({className:s,...a}){return e.jsx("div",{className:tt("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",s),...a})}function Ct(s){return e.jsx(Z1,{className:"text-lg font-semibold leading-none",...s})}function s2(s){return e.jsx(e2,{className:"text-sm text-muted-foreground",...s})}function wu(s,a){const[l,o]=f.useState(s);return f.useEffect(()=>{const c=setTimeout(()=>o(s),a);return()=>clearTimeout(c)},[s,a]),l}function Ar({page:s,totalPages:a,total:l,pageSize:o,onPageChange:c,onPageSizeChange:d,pageSizeOptions:h=[10,20,50,100]}){return a<=1&&!d?null:e.jsxs("div",{className:"flex items-center justify-between gap-4 py-4 px-5 border-t border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[e.jsxs("span",{children:["共 ",l," 条"]}),d&&e.jsx("select",{value:o,onChange:m=>d(Number(m.target.value)),className:"bg-[#0f2137] border border-gray-600 rounded px-2 py-1 text-gray-300 text-sm",children:h.map(m=>e.jsxs("option",{value:m,children:[m," 条/页"]},m))})]}),a>1&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>c(1),disabled:s<=1,className:"px-2 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"首页"}),e.jsx("button",{type:"button",onClick:()=>c(s-1),disabled:s<=1,className:"px-3 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"上一页"}),e.jsxs("span",{className:"px-3 py-1 text-gray-400 text-sm",children:[s," / ",a]}),e.jsx("button",{type:"button",onClick:()=>c(s+1),disabled:s>=a,className:"px-3 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"下一页"}),e.jsx("button",{type:"button",onClick:()=>c(a),disabled:s>=a,className:"px-2 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"末页"})]})]})}function n2(){const[s,a]=f.useState([]),[l,o]=f.useState([]),[c,d]=f.useState(0),[h,m]=f.useState(0),[p,y]=f.useState(0),[g,v]=f.useState(1),[C,P]=f.useState(10),[T,S]=f.useState(""),b=wu(T,300),[N,E]=f.useState("all"),[j,R]=f.useState(!0),[B,U]=f.useState(null),[k,L]=f.useState(null),[_,se]=f.useState(""),[le,ie]=f.useState(!1);async function ee(){R(!0),U(null);try{const W=N==="all"?"":N==="completed"?"completed":N,M=new URLSearchParams({page:String(g),pageSize:String(C),...W&&{status:W},...b&&{search:b}}),[O,F]=await Promise.all([Fe(`/api/orders?${M}`),Fe("/api/db/users?page=1&pageSize=500")]);O!=null&&O.success&&(a(O.orders||[]),d(O.total??0),m(O.totalRevenue??0),y(O.todayRevenue??0)),F!=null&&F.success&&F.users&&o(F.users)}catch(W){console.error("加载订单失败",W),U("加载订单失败,请检查网络后重试")}finally{R(!1)}}f.useEffect(()=>{v(1)},[b,N]),f.useEffect(()=>{ee()},[g,C,b,N]);const G=W=>{var M;return W.userNickname||((M=l.find(O=>O.id===W.userId))==null?void 0:M.nickname)||"匿名用户"},Q=W=>{var M;return((M=l.find(O=>O.id===W))==null?void 0:M.phone)||"-"},ce=W=>{const M=W.productType||W.type||"",O=W.description||"";if(O){if(M==="section"&&O.includes("章节")){if(O.includes("-")){const F=O.split("-");if(F.length>=3)return{name:`${F[1]}章 第${F[2]}`,type:"《一场Soul的创业实验》"}}return{name:O,type:"章节购买"}}return M==="fullbook"||O.includes("全书")?{name:"《一场Soul的创业实验》",type:"全书购买"}:M==="vip"||O.includes("VIP")?{name:"VIP年度会员",type:"VIP"}:M==="match"||O.includes("伙伴")?{name:"找伙伴匹配",type:"功能服务"}:{name:O,type:"其他"}}return M==="section"?{name:`章节 ${W.productId||W.sectionId||""}`,type:"单章"}:M==="fullbook"?{name:"《一场Soul的创业实验》",type:"全书"}:M==="vip"?{name:"VIP年度会员",type:"VIP"}:M==="match"?{name:"找伙伴匹配",type:"功能"}:{name:"未知商品",type:M||"其他"}},re=Math.ceil(c/C)||1;async function A(){var W;if(!(!(k!=null&&k.orderSn)&&!(k!=null&&k.id))){ie(!0),U(null);try{const M=await Nt("/api/admin/orders/refund",{orderSn:k.orderSn||k.id,reason:_||void 0});M!=null&&M.success?(L(null),se(""),ee()):U((M==null?void 0:M.error)||"退款失败")}catch(M){const O=M;U(((W=O==null?void 0:O.data)==null?void 0:W.error)||"退款失败,请检查网络后重试")}finally{ie(!1)}}}function ne(){if(s.length===0){alert("暂无数据可导出");return}const W=["订单号","用户","手机号","商品","金额","支付方式","状态","退款原因","分销佣金","下单时间"],M=s.map(ue=>{const K=ce(ue);return[ue.orderSn||ue.id||"",G(ue),Q(ue.userId),K.name,Number(ue.amount||0).toFixed(2),ue.paymentMethod==="wechat"?"微信支付":ue.paymentMethod==="alipay"?"支付宝":ue.paymentMethod||"微信支付",ue.status==="refunded"?"已退款":ue.status==="paid"||ue.status==="completed"?"已完成":ue.status==="pending"||ue.status==="created"?"待支付":"已失败",ue.status==="refunded"&&ue.refundReason?ue.refundReason:"-",ue.referrerEarnings?Number(ue.referrerEarnings).toFixed(2):"-",ue.createdAt?new Date(ue.createdAt).toLocaleString("zh-CN"):""].join(",")}),O="\uFEFF"+[W.join(","),...M].join(`
`),F=new Blob([O],{type:"text/csv;charset=utf-8"}),X=URL.createObjectURL(F),H=document.createElement("a");H.href=X,H.download=`订单列表_${new Date().toISOString().slice(0,10)}.csv`,H.click(),URL.revokeObjectURL(X)}return e.jsxs("div",{className:"p-8 w-full",children:[B&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:B}),e.jsx("button",{type:"button",onClick:()=>U(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"订单管理"}),e.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",s.length," 笔订单"]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(Z,{variant:"outline",onClick:ee,disabled:j,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${j?"animate-spin":""}`}),"刷新"]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{className:"text-gray-400",children:"总收入:"}),e.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",h.toFixed(2)]}),e.jsx("span",{className:"text-gray-600",children:"|"}),e.jsx("span",{className:"text-gray-400",children:"今日:"}),e.jsxs("span",{className:"text-[#FFD700] font-bold",children:["¥",p.toFixed(2)]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[e.jsxs("div",{className:"relative flex-1 max-w-md",children:[e.jsx(yn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),e.jsx(de,{type:"text",placeholder:"搜索订单号/用户/章节...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500",value:T,onChange:W=>S(W.target.value)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(lb,{className:"w-4 h-4 text-gray-400"}),e.jsxs("select",{value:N,onChange:W=>E(W.target.value),className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"pending",children:"待支付"}),e.jsx("option",{value:"created",children:"已创建"}),e.jsx("option",{value:"failed",children:"已失败"}),e.jsx("option",{value:"refunded",children:"已退款"})]})]}),e.jsxs(Z,{variant:"outline",onClick:ne,disabled:s.length===0,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(eb,{className:"w-4 h-4 mr-2"}),"导出 CSV"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:j?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs("div",{children:[e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"订单号"}),e.jsx(je,{className:"text-gray-400",children:"用户"}),e.jsx(je,{className:"text-gray-400",children:"商品"}),e.jsx(je,{className:"text-gray-400",children:"金额"}),e.jsx(je,{className:"text-gray-400",children:"支付方式"}),e.jsx(je,{className:"text-gray-400",children:"状态"}),e.jsx(je,{className:"text-gray-400",children:"退款原因"}),e.jsx(je,{className:"text-gray-400",children:"分销佣金"}),e.jsx(je,{className:"text-gray-400",children:"下单时间"}),e.jsx(je,{className:"text-gray-400",children:"操作"})]})}),e.jsxs(cr,{children:[s.map(W=>{const M=ce(W);return e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsxs(pe,{className:"font-mono text-xs text-gray-400",children:[(W.orderSn||W.id||"").slice(0,12),"..."]}),e.jsx(pe,{children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:G(W)}),e.jsx("p",{className:"text-gray-500 text-xs",children:Q(W.userId)})]})}),e.jsx(pe,{children:e.jsxs("div",{children:[e.jsxs("p",{className:"text-white text-sm flex items-center gap-2",children:[M.name,(W.productType||W.type)==="vip"&&e.jsx(Oe,{className:"bg-amber-500/20 text-amber-400 hover:bg-amber-500/20 border-0 text-xs",children:"VIP"})]}),e.jsx("p",{className:"text-gray-500 text-xs",children:M.type})]})}),e.jsxs(pe,{className:"text-[#38bdac] font-bold",children:["¥",Number(W.amount||0).toFixed(2)]}),e.jsx(pe,{className:"text-gray-300",children:W.paymentMethod==="wechat"?"微信支付":W.paymentMethod==="alipay"?"支付宝":W.paymentMethod||"微信支付"}),e.jsx(pe,{children:W.status==="refunded"?e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 hover:bg-gray-500/20 border-0",children:"已退款"}):W.status==="paid"||W.status==="completed"?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"}):W.status==="pending"||W.status==="created"?e.jsx(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:"待支付"}):e.jsx(Oe,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已失败"})}),e.jsx(pe,{className:"text-gray-400 text-sm max-w-[120px] truncate",title:W.refundReason,children:W.status==="refunded"&&W.refundReason?W.refundReason:"-"}),e.jsx(pe,{className:"text-[#FFD700]",children:W.referrerEarnings?`¥${Number(W.referrerEarnings).toFixed(2)}`:"-"}),e.jsx(pe,{className:"text-gray-400 text-sm",children:new Date(W.createdAt).toLocaleString("zh-CN")}),e.jsx(pe,{children:(W.status==="paid"||W.status==="completed")&&e.jsxs(Z,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{L(W),se("")},children:[e.jsx(Bx,{className:"w-3 h-3 mr-1"}),"退款"]})})]},W.id)}),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:10,className:"text-center py-12 text-gray-500",children:"暂无订单数据"})})]})]}),e.jsx(Ar,{page:g,totalPages:re,total:c,pageSize:C,onPageChange:v,onPageSizeChange:W=>{P(W),v(1)}})]})})}),e.jsx(wt,{open:!!k,onOpenChange:W=>!W&&L(null),children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(St,{children:e.jsx(Ct,{className:"text-white",children:"订单退款"})}),k&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",k.orderSn||k.id]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",Number(k.amount||0).toFixed(2)]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-400 block mb-2",children:"退款原因(选填)"}),e.jsx("div",{className:"form-input",children:e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:_,onChange:W=>se(W.target.value)})})]}),e.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>L(null),disabled:le,children:"取消"}),e.jsx(Z,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:A,disabled:le,children:le?"退款中...":"确认退款"})]})]})})]})}var a2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],l2=a2.reduce((s,a)=>{const l=Vx(`Primitive.${a}`),o=f.forwardRef((c,d)=>{const{asChild:h,...m}=c,p=h?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...m,ref:d})});return o.displayName=`Primitive.${a}`,{...s,[a]:o}},{}),i2="Label",Dp=f.forwardRef((s,a)=>e.jsx(l2.label,{...s,ref:a,onMouseDown:l=>{var c;l.target.closest("button, input, select, textarea")||((c=s.onMouseDown)==null||c.call(s,l),!l.defaultPrevented&&l.detail>1&&l.preventDefault())}}));Dp.displayName=i2;var Lp=Dp;const te=f.forwardRef(({className:s,...a},l)=>e.jsx(Lp,{ref:l,className:tt("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",s),...a}));te.displayName=Lp.displayName;function Su(s){const a=f.useRef({value:s,previous:s});return f.useMemo(()=>(a.current.value!==s&&(a.current.previous=a.current.value,a.current.value=s),a.current.previous),[s])}function Cu(s){const[a,l]=f.useState(void 0);return qt(()=>{if(s){l({width:s.offsetWidth,height:s.offsetHeight});const o=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const d=c[0];let h,m;if("borderBoxSize"in d){const p=d.borderBoxSize,y=Array.isArray(p)?p[0]:p;h=y.inlineSize,m=y.blockSize}else h=s.offsetWidth,m=s.offsetHeight;l({width:h,height:m})});return o.observe(s,{box:"border-box"}),()=>o.unobserve(s)}else l(void 0)},[s]),a}var yo="Switch",[o2]=en(yo),[c2,d2]=o2(yo),Op=f.forwardRef((s,a)=>{const{__scopeSwitch:l,name:o,checked:c,defaultChecked:d,required:h,disabled:m,value:p="on",onCheckedChange:y,form:g,...v}=s,[C,P]=f.useState(null),T=et(a,j=>P(j)),S=f.useRef(!1),b=C?g||!!C.closest("form"):!0,[N,E]=bn({prop:c,defaultProp:d??!1,onChange:y,caller:yo});return e.jsxs(c2,{scope:l,checked:N,disabled:m,children:[e.jsx(Ke.button,{type:"button",role:"switch","aria-checked":N,"aria-required":h,"data-state":Bp(N),"data-disabled":m?"":void 0,disabled:m,value:p,...v,ref:T,onClick:Be(s.onClick,j=>{E(R=>!R),b&&(S.current=j.isPropagationStopped(),S.current||j.stopPropagation())})}),b&&e.jsx($p,{control:C,bubbles:!S.current,name:o,value:p,checked:N,required:h,disabled:m,form:g,style:{transform:"translateX(-100%)"}})]})});Op.displayName=yo;var Fp="SwitchThumb",zp=f.forwardRef((s,a)=>{const{__scopeSwitch:l,...o}=s,c=d2(Fp,l);return e.jsx(Ke.span,{"data-state":Bp(c.checked),"data-disabled":c.disabled?"":void 0,...o,ref:a})});zp.displayName=Fp;var u2="SwitchBubbleInput",$p=f.forwardRef(({__scopeSwitch:s,control:a,checked:l,bubbles:o=!0,...c},d)=>{const h=f.useRef(null),m=et(h,d),p=Su(l),y=Cu(a);return f.useEffect(()=>{const g=h.current;if(!g)return;const v=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(v,"checked").set;if(p!==l&&P){const T=new Event("click",{bubbles:o});P.call(g,l),g.dispatchEvent(T)}},[p,l,o]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:l,...c,tabIndex:-1,ref:m,style:{...c.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});$p.displayName=u2;function Bp(s){return s?"checked":"unchecked"}var Up=Op,h2=zp;const it=f.forwardRef(({className:s,...a},l)=>e.jsx(Up,{className:tt("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#38bdac] focus-visible:ring-offset-2 focus-visible:ring-offset-[#0a1628] disabled:cursor-not-allowed disabled:opacity-50 data-[state=unchecked]:bg-gray-600 data-[state=checked]:bg-[#38bdac]",s),...a,ref:l,children:e.jsx(h2,{className:tt("pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));it.displayName=Up.displayName;function ku(s){const a=s+"CollectionProvider",[l,o]=en(a),[c,d]=l(a,{collectionRef:{current:null},itemMap:new Map}),h=S=>{const{scope:b,children:N}=S,E=Us.useRef(null),j=Us.useRef(new Map).current;return e.jsx(c,{scope:b,itemMap:j,collectionRef:E,children:N})};h.displayName=a;const m=s+"CollectionSlot",p=xl(m),y=Us.forwardRef((S,b)=>{const{scope:N,children:E}=S,j=d(m,N),R=et(b,j.collectionRef);return e.jsx(p,{ref:R,children:E})});y.displayName=m;const g=s+"CollectionItemSlot",v="data-radix-collection-item",C=xl(g),P=Us.forwardRef((S,b)=>{const{scope:N,children:E,...j}=S,R=Us.useRef(null),B=et(b,R),U=d(g,N);return Us.useEffect(()=>(U.itemMap.set(R,{ref:R,...j}),()=>void U.itemMap.delete(R))),e.jsx(C,{[v]:"",ref:B,children:E})});P.displayName=g;function T(S){const b=d(s+"CollectionConsumer",S);return Us.useCallback(()=>{const E=b.collectionRef.current;if(!E)return[];const j=Array.from(E.querySelectorAll(`[${v}]`));return Array.from(b.itemMap.values()).sort((U,k)=>j.indexOf(U.ref.current)-j.indexOf(k.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:h,Slot:y,ItemSlot:P},T,o]}var f2=f.createContext(void 0);function vo(s){const a=f.useContext(f2);return s||a||"ltr"}var Rd="rovingFocusGroup.onEntryFocus",m2={bubbles:!1,cancelable:!0},vl="RovingFocusGroup",[Yd,Vp,x2]=ku(vl),[p2,Wp]=en(vl,[x2]),[g2,y2]=p2(vl),Hp=f.forwardRef((s,a)=>e.jsx(Yd.Provider,{scope:s.__scopeRovingFocusGroup,children:e.jsx(Yd.Slot,{scope:s.__scopeRovingFocusGroup,children:e.jsx(v2,{...s,ref:a})})}));Hp.displayName=vl;var v2=f.forwardRef((s,a)=>{const{__scopeRovingFocusGroup:l,orientation:o,loop:c=!1,dir:d,currentTabStopId:h,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:p,onEntryFocus:y,preventScrollOnEntryFocus:g=!1,...v}=s,C=f.useRef(null),P=et(a,C),T=vo(d),[S,b]=bn({prop:h,defaultProp:m??null,onChange:p,caller:vl}),[N,E]=f.useState(!1),j=Qs(y),R=Vp(l),B=f.useRef(!1),[U,k]=f.useState(0);return f.useEffect(()=>{const L=C.current;if(L)return L.addEventListener(Rd,j),()=>L.removeEventListener(Rd,j)},[j]),e.jsx(g2,{scope:l,orientation:o,dir:T,loop:c,currentTabStopId:S,onItemFocus:f.useCallback(L=>b(L),[b]),onItemShiftTab:f.useCallback(()=>E(!0),[]),onFocusableItemAdd:f.useCallback(()=>k(L=>L+1),[]),onFocusableItemRemove:f.useCallback(()=>k(L=>L-1),[]),children:e.jsx(Ke.div,{tabIndex:N||U===0?-1:0,"data-orientation":o,...v,ref:P,style:{outline:"none",...s.style},onMouseDown:Be(s.onMouseDown,()=>{B.current=!0}),onFocus:Be(s.onFocus,L=>{const _=!B.current;if(L.target===L.currentTarget&&_&&!N){const se=new CustomEvent(Rd,m2);if(L.currentTarget.dispatchEvent(se),!se.defaultPrevented){const le=R().filter(ce=>ce.focusable),ie=le.find(ce=>ce.active),ee=le.find(ce=>ce.id===S),Q=[ie,ee,...le].filter(Boolean).map(ce=>ce.ref.current);Gp(Q,g)}}B.current=!1}),onBlur:Be(s.onBlur,()=>E(!1))})})}),Kp="RovingFocusGroupItem",Yp=f.forwardRef((s,a)=>{const{__scopeRovingFocusGroup:l,focusable:o=!0,active:c=!1,tabStopId:d,children:h,...m}=s,p=Gs(),y=d||p,g=y2(Kp,l),v=g.currentTabStopId===y,C=Vp(l),{onFocusableItemAdd:P,onFocusableItemRemove:T,currentTabStopId:S}=g;return f.useEffect(()=>{if(o)return P(),()=>T()},[o,P,T]),e.jsx(Yd.ItemSlot,{scope:l,id:y,focusable:o,active:c,children:e.jsx(Ke.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...m,ref:a,onMouseDown:Be(s.onMouseDown,b=>{o?g.onItemFocus(y):b.preventDefault()}),onFocus:Be(s.onFocus,()=>g.onItemFocus(y)),onKeyDown:Be(s.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){g.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const N=N2(b,g.orientation,g.dir);if(N!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let j=C().filter(R=>R.focusable).map(R=>R.ref.current);if(N==="last")j.reverse();else if(N==="prev"||N==="next"){N==="prev"&&j.reverse();const R=j.indexOf(b.currentTarget);j=g.loop?w2(j,R+1):j.slice(R+1)}setTimeout(()=>Gp(j))}}),children:typeof h=="function"?h({isCurrentTabStop:v,hasTabStop:S!=null}):h})})});Yp.displayName=Kp;var j2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function b2(s,a){return a!=="rtl"?s:s==="ArrowLeft"?"ArrowRight":s==="ArrowRight"?"ArrowLeft":s}function N2(s,a,l){const o=b2(s.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return j2[o]}function Gp(s,a=!1){const l=document.activeElement;for(const o of s)if(o===l||(o.focus({preventScroll:a}),document.activeElement!==l))return}function w2(s,a){return s.map((l,o)=>s[(a+o)%s.length])}var S2=Hp,C2=Yp,jo="Tabs",[k2]=en(jo,[Wp]),Qp=Wp(),[E2,Eu]=k2(jo),qp=f.forwardRef((s,a)=>{const{__scopeTabs:l,value:o,onValueChange:c,defaultValue:d,orientation:h="horizontal",dir:m,activationMode:p="automatic",...y}=s,g=vo(m),[v,C]=bn({prop:o,onChange:c,defaultProp:d??"",caller:jo});return e.jsx(E2,{scope:l,baseId:Gs(),value:v,onValueChange:C,orientation:h,dir:g,activationMode:p,children:e.jsx(Ke.div,{dir:g,"data-orientation":h,...y,ref:a})})});qp.displayName=jo;var Xp="TabsList",Jp=f.forwardRef((s,a)=>{const{__scopeTabs:l,loop:o=!0,...c}=s,d=Eu(Xp,l),h=Qp(l);return e.jsx(S2,{asChild:!0,...h,orientation:d.orientation,dir:d.dir,loop:o,children:e.jsx(Ke.div,{role:"tablist","aria-orientation":d.orientation,...c,ref:a})})});Jp.displayName=Xp;var Zp="TabsTrigger",eg=f.forwardRef((s,a)=>{const{__scopeTabs:l,value:o,disabled:c=!1,...d}=s,h=Eu(Zp,l),m=Qp(l),p=sg(h.baseId,o),y=ng(h.baseId,o),g=o===h.value;return e.jsx(C2,{asChild:!0,...m,focusable:!c,active:g,children:e.jsx(Ke.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":y,"data-state":g?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:p,...d,ref:a,onMouseDown:Be(s.onMouseDown,v=>{!c&&v.button===0&&v.ctrlKey===!1?h.onValueChange(o):v.preventDefault()}),onKeyDown:Be(s.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&h.onValueChange(o)}),onFocus:Be(s.onFocus,()=>{const v=h.activationMode!=="manual";!g&&!c&&v&&h.onValueChange(o)})})})});eg.displayName=Zp;var tg="TabsContent",rg=f.forwardRef((s,a)=>{const{__scopeTabs:l,value:o,forceMount:c,children:d,...h}=s,m=Eu(tg,l),p=sg(m.baseId,o),y=ng(m.baseId,o),g=o===m.value,v=f.useRef(g);return f.useEffect(()=>{const C=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(C)},[]),e.jsx(yl,{present:c||g,children:({present:C})=>e.jsx(Ke.div,{"data-state":g?"active":"inactive","data-orientation":m.orientation,role:"tabpanel","aria-labelledby":p,hidden:!C,id:y,tabIndex:0,...h,ref:a,style:{...s.style,animationDuration:v.current?"0s":void 0},children:C&&d})})});rg.displayName=tg;function sg(s,a){return`${s}-trigger-${a}`}function ng(s,a){return`${s}-content-${a}`}var P2=qp,ag=Jp,lg=eg,ig=rg;const bo=P2,jl=f.forwardRef(({className:s,...a},l)=>e.jsx(ag,{ref:l,className:tt("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",s),...a}));jl.displayName=ag.displayName;const Zt=f.forwardRef(({className:s,...a},l)=>e.jsx(lg,{ref:l,className:tt("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",s),...a}));Zt.displayName=lg.displayName;const er=f.forwardRef(({className:s,...a},l)=>e.jsx(ig,{ref:l,className:tt("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));er.displayName=ig.displayName;function T2({open:s,onClose:a,userId:l,onUserUpdated:o}){var ce;const[c,d]=f.useState(null),[h,m]=f.useState([]),[p,y]=f.useState([]),[g,v]=f.useState(!1),[C,P]=f.useState(!1),[T,S]=f.useState(!1),[b,N]=f.useState("info"),[E,j]=f.useState(""),[R,B]=f.useState(""),[U,k]=f.useState([]),[L,_]=f.useState("");f.useEffect(()=>{s&&l&&se()},[s,l]);async function se(){if(l){v(!0);try{const re=await Fe(`/api/db/users?id=${encodeURIComponent(l)}`);if(re!=null&&re.success&&re.user){const A=re.user;d(A),j(A.phone||""),B(A.nickname||""),k(typeof A.tags=="string"?JSON.parse(A.tags||"[]"):[])}try{const A=await Fe(`/api/user/track?userId=${encodeURIComponent(l)}&limit=50`);A!=null&&A.success&&A.tracks&&m(A.tracks)}catch{m([])}try{const A=await Fe(`/api/db/users/referrals?userId=${encodeURIComponent(l)}`);A!=null&&A.success&&A.referrals&&y(A.referrals)}catch{y([])}}catch(re){console.error("Load user detail error:",re)}finally{v(!1)}}}async function le(){if(!(c!=null&&c.phone)){alert("用户未绑定手机号,无法同步");return}P(!0);try{const re=await Et("/api/ckb/sync",{action:"full_sync",phone:c.phone,userId:c.id});re!=null&&re.success?(alert("同步成功"),se()):alert("同步失败: "+(re==null?void 0:re.error))}catch(re){console.error("Sync CKB error:",re),alert("同步失败")}finally{P(!1)}}async function ie(){if(c){S(!0);try{const re={id:c.id,phone:E||void 0,nickname:R||void 0,tags:JSON.stringify(U)},A=await Nt("/api/db/users",re);A!=null&&A.success?(alert("保存成功"),se(),o==null||o()):alert("保存失败: "+(A==null?void 0:A.error))}catch(re){console.error("Save user error:",re),alert("保存失败")}finally{S(!1)}}}const ee=()=>{L&&!U.includes(L)&&(k([...U,L]),_(""))},G=re=>{k(U.filter(A=>A!==re))},Q=re=>{const ne={view_chapter:us,purchase:Bd,match:Qt,login:ra,register:ra,share:Ys,bind_phone:Wb,bind_wechat:Ob}[re]||_m;return e.jsx(ne,{className:"w-4 h-4"})};return s?e.jsx(wt,{open:s,onOpenChange:()=>a(),children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] overflow-hidden",children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(ra,{className:"w-5 h-5 text-[#38bdac]"}),"用户详情",(c==null?void 0:c.phone)&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 ml-2",children:"已绑定手机"})]})}),g?e.jsxs("div",{className:"flex items-center justify-center py-20",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):c?e.jsxs("div",{className:"flex flex-col h-[70vh]",children:[e.jsxs("div",{className:"flex items-center gap-4 p-4 bg-[#0a1628] rounded-lg mb-4",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-2xl text-[#38bdac]",children:c.avatar?e.jsx("img",{src:c.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((ce=c.nickname)==null?void 0:ce.charAt(0))||"?"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-lg font-bold text-white",children:c.nickname}),c.isAdmin&&e.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 border-0",children:"管理员"}),c.hasFullBook&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0",children:"全书已购"})]}),e.jsxs("p",{className:"text-gray-400 text-sm mt-1",children:[c.phone?`📱 ${c.phone}`:"未绑定手机",c.wechatId&&` · 💬 ${c.wechatId}`]}),e.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:["ID: ",c.id," · 推广码: ",c.referralCode??"-"]})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("p",{className:"text-[#38bdac] font-bold",children:["¥",(c.earnings||0).toFixed(2)]}),e.jsx("p",{className:"text-gray-500 text-xs",children:"累计收益"})]})]}),e.jsxs(bo,{value:b,onValueChange:N,className:"flex-1 flex flex-col overflow-hidden",children:[e.jsxs(jl,{className:"bg-[#0a1628] border border-gray-700/50 p-1 mb-4",children:[e.jsx(Zt,{value:"info",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"基础信息"}),e.jsx(Zt,{value:"tags",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"标签体系"}),e.jsx(Zt,{value:"tracks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"行为轨迹"}),e.jsx(Zt,{value:"relations",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"关系链路"})]}),e.jsxs(er,{value:"info",className:"flex-1 overflow-auto space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"手机号"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入手机号",value:E,onChange:re=>j(re.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"昵称"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入昵称",value:R,onChange:re=>B(re.target.value)})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"推荐人数"}),e.jsx("p",{className:"text-2xl font-bold text-white",children:c.referralCount??0})]}),e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"待提现"}),e.jsxs("p",{className:"text-2xl font-bold text-yellow-400",children:["¥",(c.pendingEarnings??0).toFixed(2)]})]}),e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"创建时间"}),e.jsx("p",{className:"text-sm text-white",children:c.createdAt?new Date(c.createdAt).toLocaleDateString():"-"})]})]}),e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ys,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"存客宝同步"})]}),e.jsx(Z,{size:"sm",onClick:le,disabled:C||!c.phone,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:C?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-1 animate-spin"})," 同步中..."]}):e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-1"})," 同步数据"]})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"同步状态:"}),c.ckbSyncedAt?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 ml-1",children:"已同步"}):e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0 ml-1",children:"未同步"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"最后同步:"}),e.jsx("span",{className:"text-gray-300 ml-1",children:c.ckbSyncedAt?new Date(c.ckbSyncedAt).toLocaleString():"-"})]})]})]})]}),e.jsx(er,{value:"tags",className:"flex-1 overflow-auto space-y-4",children:e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(rN,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"系统标签"})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-3",children:[U.map((re,A)=>e.jsxs(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0 pr-1",children:[re,e.jsx("button",{type:"button",onClick:()=>G(re),className:"ml-1 hover:text-red-400",children:e.jsx(Sr,{className:"w-3 h-3"})})]},A)),U.length===0&&e.jsx("span",{className:"text-gray-500 text-sm",children:"暂无标签"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(de,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"添加新标签",value:L,onChange:re=>_(re.target.value),onKeyDown:re=>re.key==="Enter"&&ee()}),e.jsx(Z,{onClick:ee,className:"bg-[#38bdac] hover:bg-[#2da396]",children:"添加"})]})]})}),e.jsx(er,{value:"tracks",className:"flex-1 overflow-auto",children:e.jsx("div",{className:"space-y-2",children:h.length>0?h.map(re=>e.jsxs("div",{className:"flex items-start gap-3 p-3 bg-[#0a1628] rounded-lg",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-[#38bdac]",children:Q(re.action)}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-white font-medium",children:re.actionLabel}),re.chapterTitle&&e.jsxs("span",{className:"text-gray-400 text-sm",children:["- ",re.chapterTitle]})]}),e.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:[e.jsx(Ox,{className:"w-3 h-3 inline mr-1"}),re.timeAgo," · ",new Date(re.createdAt).toLocaleString()]})]})]},re.id)):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(_m,{className:"w-10 h-10 text-[#38bdac]/40 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-400",children:"暂无行为轨迹"})]})})}),e.jsx(er,{value:"relations",className:"flex-1 overflow-auto space-y-4",children:e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ys,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"推荐的用户"})]}),e.jsxs(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:["共 ",p.length," 人"]})]}),e.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto",children:p.length>0?p.map((re,A)=>{var W;const ne=re;return e.jsxs("div",{className:"flex items-center justify-between p-2 bg-[#162840] rounded",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-6 h-6 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-xs text-[#38bdac]",children:((W=ne.nickname)==null?void 0:W.charAt(0))||"?"}),e.jsx("span",{className:"text-white text-sm",children:ne.nickname})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[ne.status==="vip"&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"已购"}),e.jsx("span",{className:"text-gray-500 text-xs",children:ne.createdAt?new Date(ne.createdAt).toLocaleDateString():""})]})]},ne.id||A)}):e.jsx("p",{className:"text-gray-500 text-sm text-center py-4",children:"暂无推荐用户"})})]})})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-4 border-t border-gray-700 mt-4",children:[e.jsxs(Z,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Sr,{className:"w-4 h-4 mr-2"}),"关闭"]}),e.jsxs(Z,{onClick:ie,disabled:T,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),T?"保存中...":"保存修改"]})]})]}):e.jsx("div",{className:"text-center py-12 text-gray-500",children:"用户不存在"})]})}):null}const Id={isVip:!1,vipExpireDate:"",vipSort:"",vipRole:"",vipRoleCustom:"",vipName:"",vipProject:"",vipContact:"",vipBio:""};function R2({open:s,onClose:a,userId:l,userNickname:o="",onSaved:c}){const[d,h]=f.useState(Id),[m,p]=f.useState([]),[y,g]=f.useState(!1),[v,C]=f.useState(!1);f.useEffect(()=>{if(!s){h(Id);return}let T=!1;return g(!0),Promise.all([Fe("/api/db/vip-roles"),l?Fe(`/api/db/users?id=${encodeURIComponent(l)}`):Promise.resolve(null)]).then(([S,b])=>{if(T)return;const N=S!=null&&S.success&&S.data?S.data:[];p(N);const E=b&&b.user?b.user:null;if(E){const j=String(E.vipRole??""),R=N.some(B=>B.name===j);h({isVip:!!(E.isVip??!1),vipExpireDate:E.vipExpireDate?String(E.vipExpireDate).slice(0,10):"",vipSort:typeof E.vipSort=="number"?E.vipSort:"",vipRole:R?j:j?"__custom__":"",vipRoleCustom:R?"":j,vipName:String(E.vipName??""),vipProject:String(E.vipProject??""),vipContact:String(E.vipContact??""),vipBio:String(E.vipBio??"")})}else h(Id)}).catch(S=>{T||console.error("Load error:",S)}).finally(()=>{T||g(!1)}),()=>{T=!0}},[s,l]);async function P(){if(l){if(d.isVip&&!d.vipExpireDate.trim()){alert("开启 VIP 时请填写有效到期日");return}if(d.isVip&&d.vipExpireDate.trim()){const T=new Date(d.vipExpireDate);if(isNaN(T.getTime())){alert("到期日格式无效,请使用 YYYY-MM-DD");return}}C(!0);try{const T=d.vipRole==="__custom__"?d.vipRoleCustom.trim():d.vipRole,S={id:l,isVip:d.isVip,vipExpireDate:d.isVip?d.vipExpireDate:void 0,vipSort:d.vipSort===""?void 0:d.vipSort,vipRole:T||void 0,vipName:d.vipName||void 0,vipProject:d.vipProject||void 0,vipContact:d.vipContact||void 0,vipBio:d.vipBio||void 0},b=await Nt("/api/db/users",S);b!=null&&b.success?(alert("VIP 设置已保存"),c==null||c(),a()):alert("保存失败: "+(b==null?void 0:b.error))}catch(T){console.error("Save VIP error:",T),alert("保存失败")}finally{C(!1)}}}return s?e.jsx(wt,{open:s,onOpenChange:()=>a(),children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(mo,{className:"w-5 h-5 text-amber-400"}),"设置 VIP - ",o||l]})}),y?e.jsx("div",{className:"py-8 text-center text-gray-400",children:"加载中..."}):e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(te,{className:"text-gray-300",children:"VIP 会员"}),e.jsx(it,{checked:d.isVip,onCheckedChange:T=>h(S=>({...S,isVip:T}))})]}),d.isVip&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300",children:["到期日 (YYYY-MM-DD) ",e.jsx("span",{className:"text-amber-400",children:"*"})]}),e.jsx(de,{type:"date",className:"bg-[#0a1628] border-gray-700 text-white",value:d.vipExpireDate,onChange:T=>h(S=>({...S,vipExpireDate:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"排序"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"数字越小越靠前,留空按时间",value:d.vipSort===""?"":d.vipSort,onChange:T=>{const S=T.target.value;h(b=>({...b,vipSort:S===""?"":parseInt(S,10)||0}))}})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"角色"}),e.jsxs("select",{className:"w-full bg-[#0a1628] border border-gray-700 text-white rounded-md px-3 py-2",value:d.vipRole,onChange:T=>h(S=>({...S,vipRole:T.target.value})),children:[e.jsx("option",{value:"",children:"请选择或下方手动填写"}),m.map(T=>e.jsx("option",{value:T.name,children:T.name},T.id)),e.jsx("option",{value:"__custom__",children:"其他(手动填写)"})]}),d.vipRole==="__custom__"&&e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white mt-1",placeholder:"输入自定义角色",value:d.vipRoleCustom,onChange:T=>h(S=>({...S,vipRoleCustom:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"VIP 展示名"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"创业老板排行展示名",value:d.vipName,onChange:T=>h(S=>({...S,vipName:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"项目/公司"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"项目名称",value:d.vipProject,onChange:T=>h(S=>({...S,vipProject:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"联系方式"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"微信号或手机",value:d.vipContact,onChange:T=>h(S=>({...S,vipContact:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"一句话简介"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"简要描述业务",value:d.vipBio,onChange:T=>h(S=>({...S,vipBio:T.target.value}))})]})]}),e.jsxs(Ft,{children:[e.jsxs(Z,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Sr,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(Z,{onClick:P,disabled:v||y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),v?"保存中...":"保存"]})]})]})}):null}function I2(){var Xr,xs,ps,$t,gs;const[s,a]=f.useState([]),[l,o]=f.useState(0),[c,d]=f.useState(1),[h,m]=f.useState(10),[p,y]=f.useState(""),g=wu(p,300),[v,C]=f.useState("all"),[P,T]=f.useState(!0),[S,b]=f.useState(null),[N,E]=f.useState(!1),[j,R]=f.useState(!1),[B,U]=f.useState(null),[k,L]=f.useState(""),[_,se]=f.useState(""),[le,ie]=f.useState(!1),[ee,G]=f.useState(!1),[Q,ce]=f.useState({referrals:[],stats:{}}),[re,A]=f.useState(!1),[ne,W]=f.useState(null),[M,O]=f.useState(!1),[F,X]=f.useState(null),[H,ue]=f.useState(!1),[K,ye]=f.useState(null),[ge,D]=f.useState({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1});async function fe(){T(!0),b(null);try{const oe=new URLSearchParams({page:String(c),pageSize:String(h),search:g,...v==="vip"&&{vip:"true"}}),Qe=await Fe(`/api/db/users?${oe}`);Qe!=null&&Qe.success?(a(Qe.users||[]),o(Qe.total??0)):b((Qe==null?void 0:Qe.error)||"加载失败")}catch(oe){console.error("Load users error:",oe),b("网络错误,请检查连接")}finally{T(!1)}}f.useEffect(()=>{d(1)},[g,v]),f.useEffect(()=>{fe()},[c,h,g,v]);const Se=Math.ceil(l/h)||1;async function ze(oe){if(confirm("确定要删除这个用户吗?"))try{const Qe=await vn(`/api/db/users?id=${encodeURIComponent(oe)}`);Qe!=null&&Qe.success?fe():alert("删除失败: "+((Qe==null?void 0:Qe.error)||"未知错误"))}catch(Qe){console.error("Delete user error:",Qe),alert("删除失败")}}const We=oe=>{U(oe),D({phone:oe.phone||"",nickname:oe.nickname||"",password:"",isAdmin:!!(oe.isAdmin??!1),hasFullBook:!!(oe.hasFullBook??!1)}),E(!0)},qe=()=>{U(null),D({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),E(!0)};async function Ze(){if(!ge.phone||!ge.nickname){alert("请填写手机号和昵称");return}ie(!0);try{if(B){const oe=await Nt("/api/db/users",{id:B.id,nickname:ge.nickname,isAdmin:ge.isAdmin,hasFullBook:ge.hasFullBook,...ge.password&&{password:ge.password}});if(!(oe!=null&&oe.success)){alert("更新失败: "+((oe==null?void 0:oe.error)||"未知错误"));return}}else{const oe=await Et("/api/db/users",{phone:ge.phone,nickname:ge.nickname,password:ge.password,isAdmin:ge.isAdmin});if(!(oe!=null&&oe.success)){alert("创建失败: "+((oe==null?void 0:oe.error)||"未知错误"));return}}E(!1),fe()}catch(oe){console.error("Save user error:",oe),alert("保存失败")}finally{ie(!1)}}const st=oe=>{U(oe),L(""),se(""),R(!0)};async function ft(oe){W(oe),G(!0),A(!0);try{const Qe=await Fe(`/api/db/users/referrals?userId=${encodeURIComponent(oe.id)}`);Qe!=null&&Qe.success?ce({referrals:Qe.referrals||[],stats:Qe.stats||{}}):ce({referrals:[],stats:{}})}catch(Qe){console.error("Load referrals error:",Qe),ce({referrals:[],stats:{}})}finally{A(!1)}}const nt=oe=>{X(oe.id),O(!0)},Vt=oe=>{ye(oe),ue(!0)};async function Fr(){if(!k){alert("请输入新密码");return}if(k!==_){alert("两次输入的密码不一致");return}if(k.length<6){alert("密码长度不能少于6位");return}ie(!0);try{const oe=await Nt("/api/db/users",{id:B==null?void 0:B.id,password:k});oe!=null&&oe.success?(alert("密码修改成功"),R(!1)):alert("密码修改失败: "+((oe==null?void 0:oe.error)||"未知错误"))}catch(oe){console.error("Change password error:",oe),alert("密码修改失败")}finally{ie(!1)}}return e.jsxs("div",{className:"p-8 w-full",children:[S&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:S}),e.jsx("button",{type:"button",onClick:()=>b(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"用户管理"}),e.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",l," 位注册用户",v==="vip"&&",当前筛选 VIP"]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(Z,{variant:"outline",onClick:fe,disabled:P,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${P?"animate-spin":""}`}),"刷新"]}),e.jsxs("select",{value:v,onChange:oe=>{C(oe.target.value),d(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"all",children:"全部用户"}),e.jsx("option",{value:"vip",children:"VIP会员"})]}),e.jsxs("div",{className:"relative",children:[e.jsx(yn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),e.jsx(de,{type:"text",placeholder:"搜索用户...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500 w-64",value:p,onChange:oe=>y(oe.target.value)})]}),e.jsxs(Z,{onClick:qe,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Vd,{className:"w-4 h-4 mr-2"}),"添加用户"]})]})]}),e.jsx(wt,{open:N,onOpenChange:E,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[B?e.jsx(yt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Vd,{className:"w-5 h-5 text-[#38bdac]"}),B?"编辑用户":"添加用户"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"手机号"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入手机号",value:ge.phone,onChange:oe=>D({...ge,phone:oe.target.value}),disabled:!!B})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"昵称"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入昵称",value:ge.nickname,onChange:oe=>D({...ge,nickname:oe.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:B?"新密码 (留空则不修改)":"密码"}),e.jsx(de,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:B?"留空则不修改":"请输入密码",value:ge.password,onChange:oe=>D({...ge,password:oe.target.value})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(te,{className:"text-gray-300",children:"管理员权限"}),e.jsx(it,{checked:ge.isAdmin,onCheckedChange:oe=>D({...ge,isAdmin:oe})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(te,{className:"text-gray-300",children:"已购全书"}),e.jsx(it,{checked:ge.hasFullBook,onCheckedChange:oe=>D({...ge,hasFullBook:oe})})]})]}),e.jsxs(Ft,{children:[e.jsxs(Z,{variant:"outline",onClick:()=>E(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Sr,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(Z,{onClick:Ze,disabled:le,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),le?"保存中...":"保存"]})]})]})}),e.jsx(wt,{open:j,onOpenChange:R,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(Mm,{className:"w-5 h-5 text-[#38bdac]"}),"修改密码"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["用户:",B==null?void 0:B.nickname]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["手机号:",B==null?void 0:B.phone]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"新密码"}),e.jsx(de,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入新密码 (至少6位)",value:k,onChange:oe=>L(oe.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"确认密码"}),e.jsx(de,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请再次输入新密码",value:_,onChange:oe=>se(oe.target.value)})]})]}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",onClick:()=>R(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(Z,{onClick:Fr,disabled:le,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:le?"保存中...":"确认修改"})]})]})}),e.jsx(T2,{open:M,onClose:()=>O(!1),userId:F,onUserUpdated:fe}),e.jsx(R2,{open:H,onClose:()=>{ue(!1),ye(null)},userId:(K==null?void 0:K.id)??null,userNickname:K==null?void 0:K.nickname,onSaved:fe}),e.jsx(wt,{open:ee,onOpenChange:G,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[80vh] overflow-auto",children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"}),"绑定关系详情 - ",ne==null?void 0:ne.nickname]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-[#38bdac]",children:((Xr=Q.stats)==null?void 0:Xr.total)||0}),e.jsx("div",{className:"text-xs text-gray-400",children:"绑定总数"})]}),e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-green-400",children:((xs=Q.stats)==null?void 0:xs.purchased)||0}),e.jsx("div",{className:"text-xs text-gray-400",children:"已付费"})]}),e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-yellow-400",children:["¥",(((ps=Q.stats)==null?void 0:ps.earnings)||0).toFixed(2)]}),e.jsx("div",{className:"text-xs text-gray-400",children:"累计收益"})]}),e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-orange-400",children:["¥",((($t=Q.stats)==null?void 0:$t.pendingEarnings)||0).toFixed(2)]}),e.jsx("div",{className:"text-xs text-gray-400",children:"待提现"})]})]}),re?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx($e,{className:"w-5 h-5 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):(((gs=Q.referrals)==null?void 0:gs.length)??0)>0?e.jsx("div",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:(Q.referrals??[]).map((oe,Qe)=>{var dr;const Tt=oe;return e.jsxs("div",{className:"flex items-center justify-between bg-[#0a1628] rounded-lg p-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm text-[#38bdac]",children:((dr=Tt.nickname)==null?void 0:dr.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white text-sm",children:Tt.nickname}),e.jsx("div",{className:"text-xs text-gray-500",children:Tt.phone||(Tt.hasOpenId?"微信用户":"未绑定")})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[Tt.status==="vip"&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"全书已购"}),Tt.status==="paid"&&e.jsxs(Oe,{className:"bg-blue-500/20 text-blue-400 border-0 text-xs",children:["已付费",Tt.purchasedSections,"章"]}),Tt.status==="free"&&e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0 text-xs",children:"未付费"}),e.jsx("span",{className:"text-xs text-gray-500",children:Tt.createdAt?new Date(Tt.createdAt).toLocaleDateString():""})]})]},Tt.id||Qe)})}):e.jsx("div",{className:"text-center py-8 text-gray-500",children:"暂无绑定用户"})]}),e.jsx(Ft,{children:e.jsx(Z,{variant:"outline",onClick:()=>G(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"关闭"})})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:P?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs("div",{children:[e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"用户信息"}),e.jsx(je,{className:"text-gray-400",children:"绑定信息"}),e.jsx(je,{className:"text-gray-400",children:"购买状态"}),e.jsx(je,{className:"text-gray-400",children:"分销收益"}),e.jsx(je,{className:"text-gray-400",children:"推广码"}),e.jsx(je,{className:"text-gray-400",children:"注册时间"}),e.jsx(je,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(cr,{children:[s.map(oe=>{var Qe,Tt,dr;return e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac]",children:oe.avatar?e.jsx("img",{src:oe.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((Qe=oe.nickname)==null?void 0:Qe.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"font-medium text-white",children:oe.nickname}),oe.isAdmin&&e.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 hover:bg-purple-500/20 border-0 text-xs",children:"管理员"}),oe.openId&&!((Tt=oe.id)!=null&&Tt.startsWith("user_"))&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0 text-xs",children:"微信"})]}),e.jsx("p",{className:"text-xs text-gray-500 font-mono",children:oe.openId?oe.openId.slice(0,12)+"...":(dr=oe.id)==null?void 0:dr.slice(0,12)})]})]})}),e.jsx(pe,{children:e.jsxs("div",{className:"space-y-1",children:[oe.phone&&e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsx("span",{className:"text-gray-500",children:"📱"}),e.jsx("span",{className:"text-gray-300",children:oe.phone})]}),oe.wechatId&&e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsx("span",{className:"text-gray-500",children:"💬"}),e.jsx("span",{className:"text-gray-300",children:oe.wechatId})]}),oe.openId&&e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsx("span",{className:"text-gray-500",children:"🔗"}),e.jsxs("span",{className:"text-gray-500 truncate max-w-[100px]",title:oe.openId,children:[oe.openId.slice(0,12),"..."]})]}),!oe.phone&&!oe.wechatId&&!oe.openId&&e.jsx("span",{className:"text-gray-600 text-xs",children:"未绑定"})]})}),e.jsx(pe,{children:oe.hasFullBook?e.jsx(Oe,{className:"bg-amber-500/20 text-amber-400 hover:bg-amber-500/20 border-0",children:"VIP"}):e.jsx(Oe,{variant:"outline",className:"text-gray-500 border-gray-600",children:"未购买"})}),e.jsx(pe,{children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"text-white font-medium",children:["¥",parseFloat(String(oe.earnings||0)).toFixed(2)]}),parseFloat(String(oe.pendingEarnings||0))>0&&e.jsxs("div",{className:"text-xs text-yellow-400",children:["待提现: ¥",parseFloat(String(oe.pendingEarnings||0)).toFixed(2)]}),e.jsxs("div",{className:"text-xs text-[#38bdac] cursor-pointer hover:underline flex items-center gap-1",onClick:()=>ft(oe),onKeyDown:zr=>zr.key==="Enter"&&ft(oe),role:"button",tabIndex:0,children:[e.jsx(Qt,{className:"w-3 h-3"}),"绑定",oe.referralCount||0,"人"]})]})}),e.jsx(pe,{children:e.jsx("code",{className:"text-[#38bdac] text-xs bg-[#38bdac]/10 px-2 py-0.5 rounded",children:oe.referralCode||"-"})}),e.jsx(pe,{className:"text-gray-400",children:oe.createdAt?new Date(oe.createdAt).toLocaleDateString():"-"}),e.jsx(pe,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>Vt(oe),className:"text-gray-400 hover:text-amber-400 hover:bg-amber-400/10",title:"设置 VIP",children:e.jsx(mo,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>nt(oe),className:"text-gray-400 hover:text-blue-400 hover:bg-blue-400/10",title:"查看详情",children:e.jsx(ds,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>We(oe),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",title:"编辑",children:e.jsx(yt,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>st(oe),className:"text-gray-400 hover:text-yellow-400 hover:bg-yellow-400/10",title:"修改密码",children:e.jsx(Mm,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>ze(oe.id),title:"删除",children:e.jsx(Gt,{className:"w-4 h-4"})})]})})]},oe.id)}),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无用户数据"})})]})]}),e.jsx(Ar,{page:c,totalPages:Se,total:l,pageSize:h,onPageChange:d,onPageSizeChange:oe=>{m(oe),d(1)}})]})})})]})}function _2(){var ge;const[s,a]=f.useState("overview"),[l,o]=f.useState([]),[c,d]=f.useState(null),[h,m]=f.useState([]),[p,y]=f.useState([]),[g,v]=f.useState([]),[C,P]=f.useState(!0),[T,S]=f.useState(null),[b,N]=f.useState(""),[E,j]=f.useState("all"),[R,B]=f.useState(1),[U,k]=f.useState(10),[L,_]=f.useState(0),[se,le]=f.useState(new Set),[ie,ee]=f.useState(null),[G,Q]=f.useState(""),[ce,re]=f.useState(!1);f.useEffect(()=>{A()},[]),f.useEffect(()=>{B(1)},[s,E]),f.useEffect(()=>{ne(s)},[s]),f.useEffect(()=>{["orders","bindings","withdrawals"].includes(s)&&ne(s,!0)},[R,U,E,b]);async function A(){S(null);try{const D=await Fe("/api/admin/distribution/overview");D!=null&&D.success&&D.overview&&d(D.overview)}catch(D){console.error("[Admin] 概览接口异常:",D),S("加载概览失败")}try{const D=await Fe("/api/db/users");v((D==null?void 0:D.users)||[])}catch(D){console.error("[Admin] 用户数据加载失败:",D)}}async function ne(D,fe=!1){var Se;if(!(!fe&&se.has(D))){P(!0);try{const ze=g;switch(D){case"overview":break;case"orders":{try{const We=new URLSearchParams({page:String(R),pageSize:String(U),...E!=="all"&&{status:E},...b&&{search:b}}),qe=await Fe(`/api/orders?${We}`);if(qe!=null&&qe.success&&qe.orders){const Ze=qe.orders.map(st=>{const ft=ze.find(Vt=>Vt.id===st.userId),nt=st.referrerId?ze.find(Vt=>Vt.id===st.referrerId):null;return{...st,amount:parseFloat(String(st.amount))||0,userNickname:(ft==null?void 0:ft.nickname)||st.userNickname||"未知用户",userPhone:(ft==null?void 0:ft.phone)||st.userPhone||"-",referrerNickname:(nt==null?void 0:nt.nickname)||null,referrerCode:(nt==null?void 0:nt.referralCode)??null,type:st.productType||st.type}});o(Ze),_(qe.total??Ze.length)}else o([]),_(0)}catch(We){console.error(We),S("加载订单失败"),o([])}break}case"bindings":{try{const We=new URLSearchParams({page:String(R),pageSize:String(U),...E!=="all"&&{status:E}}),qe=await Fe(`/api/db/distribution?${We}`);m((qe==null?void 0:qe.bindings)||[]),_((qe==null?void 0:qe.total)??((Se=qe==null?void 0:qe.bindings)==null?void 0:Se.length)??0)}catch(We){console.error(We),S("加载绑定数据失败"),m([])}break}case"withdrawals":{try{const We=E==="completed"?"success":E==="rejected"?"failed":E,qe=new URLSearchParams({...We&&We!=="all"&&{status:We},page:String(R),pageSize:String(U)}),Ze=await Fe(`/api/admin/withdrawals?${qe}`);if(Ze!=null&&Ze.success&&Ze.withdrawals){const st=Ze.withdrawals.map(ft=>({...ft,account:ft.account??"未绑定微信号",status:ft.status==="success"?"completed":ft.status==="failed"?"rejected":ft.status}));y(st),_((Ze==null?void 0:Ze.total)??st.length)}else Ze!=null&&Ze.success||S(`获取提现记录失败: ${(Ze==null?void 0:Ze.error)||"未知错误"}`),y([])}catch(We){console.error(We),S("加载提现数据失败"),y([])}break}}le(We=>new Set(We).add(D))}catch(ze){console.error(ze)}finally{P(!1)}}}async function W(){S(null),le(D=>{const fe=new Set(D);return fe.delete(s),fe}),s==="overview"&&A(),await ne(s,!0)}async function M(D){if(confirm("确认审核通过并打款?"))try{const fe=await Nt("/api/admin/withdrawals",{id:D,action:"approve"});if(!(fe!=null&&fe.success)){const Se=(fe==null?void 0:fe.message)||(fe==null?void 0:fe.error)||"操作失败";alert(Se);return}await W()}catch(fe){console.error(fe),alert("操作失败")}}async function O(D){const fe=prompt("请输入拒绝原因:");if(fe)try{const Se=await Nt("/api/admin/withdrawals",{id:D,action:"reject",errorMessage:fe});if(!(Se!=null&&Se.success)){alert((Se==null?void 0:Se.error)||"操作失败");return}await W()}catch(Se){console.error(Se),alert("操作失败")}}async function F(){var D;if(!(!(ie!=null&&ie.orderSn)&&!(ie!=null&&ie.id))){re(!0),S(null);try{const fe=await Nt("/api/admin/orders/refund",{orderSn:ie.orderSn||ie.id,reason:G||void 0});fe!=null&&fe.success?(ee(null),Q(""),await ne("orders",!0)):S((fe==null?void 0:fe.error)||"退款失败")}catch(fe){const Se=fe;S(((D=Se==null?void 0:Se.data)==null?void 0:D.error)||"退款失败,请检查网络后重试")}finally{re(!1)}}}function X(D){const fe={active:"bg-green-500/20 text-green-400",converted:"bg-blue-500/20 text-blue-400",expired:"bg-gray-500/20 text-gray-400",cancelled:"bg-red-500/20 text-red-400",pending:"bg-orange-500/20 text-orange-400",pending_confirm:"bg-orange-500/20 text-orange-400",processing:"bg-blue-500/20 text-blue-400",completed:"bg-green-500/20 text-green-400",rejected:"bg-red-500/20 text-red-400"},Se={active:"有效",converted:"已转化",expired:"已过期",cancelled:"已取消",pending:"待审核",pending_confirm:"待用户确认",processing:"处理中",completed:"已完成",rejected:"已拒绝"};return e.jsx(Oe,{className:`${fe[D]||"bg-gray-500/20 text-gray-400"} border-0`,children:Se[D]||D})}const H=Math.ceil(L/U)||1,ue=l,K=h.filter(D=>{var Se,ze,We,qe;if(!b)return!0;const fe=b.toLowerCase();return((Se=D.refereeNickname)==null?void 0:Se.toLowerCase().includes(fe))||((ze=D.refereePhone)==null?void 0:ze.includes(fe))||((We=D.referrerName)==null?void 0:We.toLowerCase().includes(fe))||((qe=D.referrerCode)==null?void 0:qe.toLowerCase().includes(fe))}),ye=p.filter(D=>{var Se;if(!b)return!0;const fe=b.toLowerCase();return((Se=D.userName)==null?void 0:Se.toLowerCase().includes(fe))||D.account&&D.account.toLowerCase().includes(fe)});return e.jsxs("div",{className:"p-8 w-full",children:[T&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:T}),e.jsx("button",{type:"button",onClick:()=>S(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex items-center justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-white",children:"推广中心"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理:订单、分销绑定、提现审核"})]}),e.jsxs(Z,{onClick:W,disabled:C,variant:"outline",className:"border-gray-700 text-gray-300 hover:bg-gray-800",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${C?"animate-spin":""}`}),"刷新数据"]})]}),e.jsx("div",{className:"flex gap-2 mb-6 border-b border-gray-700 pb-4",children:[{key:"overview",label:"数据概览",icon:ul},{key:"orders",label:"订单管理",icon:Xi},{key:"bindings",label:"绑定管理",icon:Ys},{key:"withdrawals",label:"提现审核",icon:aa}].map(D=>e.jsxs("button",{type:"button",onClick:()=>{a(D.key),j("all"),N("")},className:`flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${s===D.key?"bg-[#38bdac] text-white":"text-gray-400 hover:text-white hover:bg-gray-800"}`,children:[e.jsx(D.icon,{className:"w-4 h-4"}),D.label]},D.key))}),C?e.jsxs("div",{className:"flex items-center justify-center py-20",children:[e.jsx($e,{className:"w-8 h-8 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[s==="overview"&&c&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日点击"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayClicks}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"总点击次数(实时)"})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:e.jsx(ds,{className:"w-6 h-6 text-blue-400"})})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日独立用户"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayUniqueVisitors??0}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"去重访客数(实时)"})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-cyan-500/20 flex items-center justify-center",children:e.jsx(Qt,{className:"w-6 h-6 text-cyan-400"})})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日总文章点击率"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:(c.todayClickRate??0).toFixed(2)}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"人均点击(总点击/独立用户)"})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-amber-500/20 flex items-center justify-center",children:e.jsx(ul,{className:"w-6 h-6 text-amber-400"})})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日绑定"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayBindings})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-green-500/20 flex items-center justify-center",children:e.jsx(Ys,{className:"w-6 h-6 text-green-400"})})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日转化"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayConversions})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-purple-500/20 flex items-center justify-center",children:e.jsx(Im,{className:"w-6 h-6 text-purple-400"})})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日佣金"}),e.jsxs("p",{className:"text-2xl font-bold text-[#38bdac] mt-1",children:["¥",c.todayEarnings.toFixed(2)]})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#38bdac]/20 flex items-center justify-center",children:e.jsx(Xi,{className:"w-6 h-6 text-[#38bdac]"})})]})})})]}),(((ge=c.todayClicksByPage)==null?void 0:ge.length)??0)>0&&e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(ds,{className:"w-5 h-5 text-[#38bdac]"}),"每篇文章今日点击(按来源页/文章统计)"]}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"实际用户与实际文章的点击均计入;今日总点击与上表一致"})]}),e.jsx(we,{children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-700 text-left text-gray-400",children:[e.jsx("th",{className:"pb-3 pr-4",children:"来源页/文章"}),e.jsx("th",{className:"pb-3 pr-4 text-right",children:"今日点击"}),e.jsx("th",{className:"pb-3 text-right",children:"占比"})]})}),e.jsx("tbody",{children:[...c.todayClicksByPage??[]].sort((D,fe)=>fe.clicks-D.clicks).map((D,fe)=>e.jsxs("tr",{className:"border-b border-gray-700/50",children:[e.jsx("td",{className:"py-2 pr-4 text-white font-mono",children:D.page||"(未区分)"}),e.jsx("td",{className:"py-2 pr-4 text-right text-white",children:D.clicks}),e.jsxs("td",{className:"py-2 text-right text-gray-400",children:[c.todayClicks>0?(D.clicks/c.todayClicks*100).toFixed(1):0,"%"]})]},fe))})]})})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(Ne,{className:"bg-orange-500/10 border-orange-500/30",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-orange-500/20 flex items-center justify-center",children:e.jsx(Ox,{className:"w-6 h-6 text-orange-400"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-orange-300 font-medium",children:"即将过期绑定"}),e.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.expiringBindings," 个"]}),e.jsx("p",{className:"text-orange-300/60 text-sm",children:"7天内到期需关注转化"})]})]})})}),e.jsx(Ne,{className:"bg-blue-500/10 border-blue-500/30",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:e.jsx(aa,{className:"w-6 h-6 text-blue-400"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-blue-300 font-medium",children:"待审核提现"}),e.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.pendingWithdrawals," 笔"]}),e.jsxs("p",{className:"text-blue-300/60 text-sm",children:["共 ¥",c.pendingWithdrawAmount.toFixed(2)]})]}),e.jsx(Z,{onClick:()=>a("withdrawals"),variant:"outline",className:"border-blue-500/50 text-blue-400 hover:bg-blue-500/20",children:"去审核"})]})})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ue,{children:e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(qi,{className:"w-5 h-5 text-[#38bdac]"}),"本月统计"]})}),e.jsx(we,{children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"点击量"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.monthClicks})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"绑定数"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.monthBindings})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"转化数"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.monthConversions})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"佣金"}),e.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.monthEarnings.toFixed(2)]})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ue,{children:e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(ul,{className:"w-5 h-5 text-[#38bdac]"}),"累计统计"]})}),e.jsxs(we,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总点击"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.totalClicks.toLocaleString()})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总绑定"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.totalBindings.toLocaleString()})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总转化"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.totalConversions})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总佣金"}),e.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.totalEarnings.toFixed(2)]})]})]}),e.jsxs("div",{className:"mt-4 p-4 bg-[#38bdac]/10 rounded-lg flex items-center justify-between",children:[e.jsx("span",{className:"text-gray-300",children:"点击转化率"}),e.jsxs("span",{className:"text-[#38bdac] font-bold text-xl",children:[c.conversionRate,"%"]})]})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ue,{children:e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"}),"推广统计"]})}),e.jsx(we,{children:e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-white",children:c.totalDistributors}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"推广用户数"})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-green-400",children:c.activeDistributors}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"有收益用户"})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-[#38bdac]",children:"90%"}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"佣金比例"})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-orange-400",children:"30天"}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"绑定有效期"})]})]})})]})]}),s==="orders"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(yn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(de,{value:b,onChange:D=>N(D.target.value),placeholder:"搜索订单号、用户名、手机号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:E,onChange:D=>j(D.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"pending",children:"待支付"}),e.jsx("option",{value:"failed",children:"已失败"}),e.jsx("option",{value:"refunded",children:"已退款"})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-0",children:[l.length===0?e.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无订单数据"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"订单号"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"商品"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"支付方式"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"退款原因"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"推荐人/邀请码"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"分销佣金"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"下单时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:ue.map(D=>{var fe,Se;return e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsxs("td",{className:"p-4 font-mono text-xs text-gray-400",children:[(fe=D.id)==null?void 0:fe.slice(0,12),"..."]}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:D.userNickname}),e.jsx("p",{className:"text-gray-500 text-xs",children:D.userPhone})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:(()=>{const ze=D.productType||D.type;return ze==="fullbook"?`${D.bookName||"《底层逻辑》"} - 全本`:ze==="match"?"匹配次数购买":`${D.bookName||"《底层逻辑》"} - ${D.sectionTitle||D.chapterTitle||`章节${D.productId||D.sectionId||""}`}`})()}),e.jsx("p",{className:"text-gray-500 text-xs",children:(()=>{const ze=D.productType||D.type;return ze==="fullbook"?"全书解锁":ze==="match"?"功能权益":D.chapterTitle||"单章购买"})()})]})}),e.jsxs("td",{className:"p-4 text-[#38bdac] font-bold",children:["¥",typeof D.amount=="number"?D.amount.toFixed(2):parseFloat(String(D.amount||"0")).toFixed(2)]}),e.jsx("td",{className:"p-4 text-gray-300",children:D.paymentMethod==="wechat"?"微信支付":D.paymentMethod==="alipay"?"支付宝":D.paymentMethod||"微信支付"}),e.jsx("td",{className:"p-4",children:D.status==="refunded"?e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0",children:"已退款"}):D.status==="completed"||D.status==="paid"?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0",children:"已完成"}):D.status==="pending"||D.status==="created"?e.jsx(Oe,{className:"bg-yellow-500/20 text-yellow-400 border-0",children:"待支付"}):e.jsx(Oe,{className:"bg-red-500/20 text-red-400 border-0",children:"已失败"})}),e.jsx("td",{className:"p-4 text-gray-400 text-sm max-w-[120px]",title:D.refundReason,children:D.status==="refunded"&&D.refundReason?D.refundReason:"-"}),e.jsx("td",{className:"p-4 text-gray-300 text-sm",children:D.referrerId||D.referralCode?e.jsxs("span",{title:D.referralCode||D.referrerCode||D.referrerId||"",children:[D.referrerNickname||D.referralCode||D.referrerCode||((Se=D.referrerId)==null?void 0:Se.slice(0,8)),(D.referralCode||D.referrerCode)&&` (${D.referralCode||D.referrerCode})`]}):"-"}),e.jsx("td",{className:"p-4 text-[#FFD700]",children:D.referrerEarnings?`¥${(typeof D.referrerEarnings=="number"?D.referrerEarnings:parseFloat(String(D.referrerEarnings))).toFixed(2)}`:"-"}),e.jsx("td",{className:"p-4 text-gray-400 text-sm",children:D.createdAt?new Date(D.createdAt).toLocaleString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:(D.status==="paid"||D.status==="completed")&&e.jsxs(Z,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{ee(D),Q("")},children:[e.jsx(Bx,{className:"w-3 h-3 mr-1"}),"退款"]})})]},D.id)})})]})}),s==="orders"&&e.jsx(Ar,{page:R,totalPages:H,total:L,pageSize:U,onPageChange:B,onPageSizeChange:D=>{k(D),B(1)}})]})})]}),s==="bindings"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(yn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(de,{value:b,onChange:D=>N(D.target.value),placeholder:"搜索用户昵称、手机号、推广码...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:E,onChange:D=>j(D.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"active",children:"有效"}),e.jsx("option",{value:"converted",children:"已转化"}),e.jsx("option",{value:"expired",children:"已过期"})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-0",children:[K.length===0?e.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无绑定数据"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"访客"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"分销商"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"绑定时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"到期时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"佣金"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:K.map(D=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-medium",children:D.refereeNickname||"匿名用户"}),e.jsx("p",{className:"text-gray-500 text-xs",children:D.refereePhone})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white",children:D.referrerName||"-"}),e.jsx("p",{className:"text-gray-500 text-xs font-mono",children:D.referrerCode})]})}),e.jsx("td",{className:"p-4 text-gray-400",children:D.boundAt?new Date(D.boundAt).toLocaleDateString("zh-CN"):"-"}),e.jsx("td",{className:"p-4 text-gray-400",children:D.expiresAt?new Date(D.expiresAt).toLocaleDateString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:X(D.status)}),e.jsx("td",{className:"p-4",children:D.commission?e.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",D.commission.toFixed(2)]}):e.jsx("span",{className:"text-gray-500",children:"-"})})]},D.id))})]})}),s==="bindings"&&e.jsx(Ar,{page:R,totalPages:H,total:L,pageSize:U,onPageChange:B,onPageSizeChange:D=>{k(D),B(1)}})]})})]}),s==="withdrawals"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(yn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(de,{value:b,onChange:D=>N(D.target.value),placeholder:"搜索用户名称、账号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:E,onChange:D=>j(D.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"pending",children:"待审核"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"rejected",children:"已拒绝"})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-0",children:[ye.length===0?e.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无提现记录"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"申请人"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"收款方式"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"收款账号"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:ye.map(D=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[D.userAvatar?e.jsx("img",{src:D.userAvatar,alt:"",className:"w-8 h-8 rounded-full object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-600 flex items-center justify-center text-white text-sm font-medium",children:(D.userName||D.name||"?").slice(0,1)}),e.jsx("p",{className:"text-white font-medium",children:D.userName||D.name})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",D.amount.toFixed(2)]})}),e.jsx("td",{className:"p-4",children:e.jsx(Oe,{className:D.method==="wechat"?"bg-green-500/20 text-green-400 border-0":"bg-blue-500/20 text-blue-400 border-0",children:D.method==="wechat"?"微信":"支付宝"})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-mono text-xs",children:D.account}),e.jsx("p",{className:"text-gray-500 text-xs",children:D.name})]})}),e.jsx("td",{className:"p-4 text-gray-400",children:D.createdAt?new Date(D.createdAt).toLocaleString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:X(D.status)}),e.jsx("td",{className:"p-4 text-right",children:D.status==="pending"&&e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsxs(Z,{size:"sm",onClick:()=>M(D.id),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Im,{className:"w-4 h-4 mr-1"}),"通过"]}),e.jsxs(Z,{size:"sm",variant:"outline",onClick:()=>O(D.id),className:"border-red-500/50 text-red-400 hover:bg-red-500/20",children:[e.jsx(Lx,{className:"w-4 h-4 mr-1"}),"拒绝"]})]})})]},D.id))})]})}),s==="withdrawals"&&e.jsx(Ar,{page:R,totalPages:H,total:L,pageSize:U,onPageChange:B,onPageSizeChange:D=>{k(D),B(1)}})]})})]})]}),e.jsx(wt,{open:!!ie,onOpenChange:D=>!D&&ee(null),children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(St,{children:e.jsx(Ct,{className:"text-white",children:"订单退款"})}),ie&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",ie.orderSn||ie.id]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",typeof ie.amount=="number"?ie.amount.toFixed(2):parseFloat(String(ie.amount||"0")).toFixed(2)]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-400 block mb-2",children:"退款原因(选填)"}),e.jsx("div",{className:"form-input",children:e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:G,onChange:D=>Q(D.target.value)})})]}),e.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>ee(null),disabled:ce,children:"取消"}),e.jsx(Z,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:F,disabled:ce,children:ce?"退款中...":"确认退款"})]})]})})]})}function M2(){const[s,a]=f.useState([]),[l,o]=f.useState({total:0,pendingCount:0,pendingAmount:0,successCount:0,successAmount:0,failedCount:0}),[c,d]=f.useState(!0),[h,m]=f.useState(null),[p,y]=f.useState("all"),[g,v]=f.useState(1),[C,P]=f.useState(10),[T,S]=f.useState(0),[b,N]=f.useState(null);async function E(){var k,L,_,se,le,ie,ee;d(!0),m(null);try{const G=new URLSearchParams({status:p,page:String(g),pageSize:String(C)}),Q=await Fe(`/api/admin/withdrawals?${G}`);if(Q!=null&&Q.success){const ce=Q.withdrawals||[];a(ce),S(Q.total??((k=Q.stats)==null?void 0:k.total)??ce.length),o({total:((L=Q.stats)==null?void 0:L.total)??Q.total??ce.length,pendingCount:((_=Q.stats)==null?void 0:_.pendingCount)??0,pendingAmount:((se=Q.stats)==null?void 0:se.pendingAmount)??0,successCount:((le=Q.stats)==null?void 0:le.successCount)??0,successAmount:((ie=Q.stats)==null?void 0:ie.successAmount)??0,failedCount:((ee=Q.stats)==null?void 0:ee.failedCount)??0})}else m("加载提现记录失败")}catch(G){console.error("Load withdrawals error:",G),m("加载失败,请检查网络后重试")}finally{d(!1)}}f.useEffect(()=>{v(1)},[p]),f.useEffect(()=>{E()},[p,g,C]);const j=Math.ceil(T/C)||1;async function R(k){const L=s.find(_=>_.id===k);if(L!=null&&L.userCommissionInfo&&L.userCommissionInfo.availableAfterThis<0){if(!confirm(`⚠️ 风险警告:该用户审核后余额为负数(¥${L.userCommissionInfo.availableAfterThis.toFixed(2)}),可能存在超额提现。
确认已核实用户账户并完成打款?`))return}else if(!confirm("确认已完成打款?批准后将更新用户提现记录。"))return;N(k);try{const _=await Nt("/api/admin/withdrawals",{id:k,action:"approve"});_!=null&&_.success?E():alert("操作失败: "+((_==null?void 0:_.error)??""))}catch{alert("操作失败")}finally{N(null)}}async function B(k){const L=prompt("请输入拒绝原因(将返还用户余额):");if(L){N(k);try{const _=await Nt("/api/admin/withdrawals",{id:k,action:"reject",errorMessage:L});_!=null&&_.success?E():alert("操作失败: "+((_==null?void 0:_.error)??""))}catch{alert("操作失败")}finally{N(null)}}}function U(k){switch(k){case"pending":return e.jsx(Oe,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待处理"});case"pending_confirm":return e.jsx(Oe,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待用户确认"});case"processing":return e.jsx(Oe,{className:"bg-blue-500/20 text-blue-400 hover:bg-blue-500/20 border-0",children:"已审批等待打款"});case"success":case"completed":return e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"});case"failed":case"rejected":return e.jsx(Oe,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已拒绝"});default:return e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0",children:k})}}return e.jsxs("div",{className:"p-8 w-full",children:[h&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:h}),e.jsx("button",{type:"button",onClick:()=>m(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-start mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-white",children:"分账提现管理"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"管理用户分销收益的提现申请"})]}),e.jsxs(Z,{variant:"outline",onClick:E,disabled:c,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${c?"animate-spin":""}`}),"刷新"]})]}),e.jsx(Ne,{className:"bg-gradient-to-r from-[#38bdac]/10 to-[#0f2137] border-[#38bdac]/30 mb-6",children:e.jsx(we,{className:"p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Xi,{className:"w-5 h-5 text-[#38bdac] mt-0.5"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-medium mb-2",children:"自动分账规则"}),e.jsxs("div",{className:"text-sm text-gray-400 space-y-1",children:[e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"分销比例"}),":推广者获得订单金额的"," ",e.jsx("span",{className:"text-white font-medium",children:"90%"})]}),e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"结算方式"}),":用户付款后,分销收益自动计入推广者账户"]}),e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"提现方式"}),":用户在小程序端点击提现,系统自动转账到微信零钱"]}),e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"审批流程"}),":待处理的提现需管理员手动确认打款后批准"]})]})]})]})})}),e.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-6",children:[e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-[#38bdac]",children:l.total}),e.jsx("div",{className:"text-sm text-gray-400",children:"总申请"})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-orange-400",children:l.pendingCount}),e.jsx("div",{className:"text-sm text-gray-400",children:"待处理"}),e.jsxs("div",{className:"text-xs text-orange-400 mt-1",children:["¥",l.pendingAmount.toFixed(2)]})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-green-400",children:l.successCount}),e.jsx("div",{className:"text-sm text-gray-400",children:"已完成"}),e.jsxs("div",{className:"text-xs text-green-400 mt-1",children:["¥",l.successAmount.toFixed(2)]})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-red-400",children:l.failedCount}),e.jsx("div",{className:"text-sm text-gray-400",children:"已拒绝"})]})})]}),e.jsx("div",{className:"flex gap-2 mb-4",children:["all","pending","success","failed"].map(k=>e.jsx(Z,{variant:p===k?"default":"outline",size:"sm",onClick:()=>y(k),className:p===k?"bg-[#38bdac] hover:bg-[#2da396] text-white":"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:k==="all"?"全部":k==="pending"?"待处理":k==="success"?"已完成":"已拒绝"},k))}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:c?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):s.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(aa,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-500",children:"暂无提现记录"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"提现金额"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"用户佣金信息"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"处理时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"确认收款"}),e.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:s.map(k=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4 text-gray-400",children:new Date(k.createdAt??"").toLocaleString()}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[k.userAvatar?e.jsx("img",{src:k.userAvatar,alt:k.userName??"",className:"w-8 h-8 rounded-full object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm text-[#38bdac]",children:(k.userName??"?").charAt(0)}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-white",children:k.userName??"未知"}),e.jsx("p",{className:"text-xs text-gray-500",children:k.userPhone??k.referralCode??(k.userId??"").slice(0,10)})]})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("span",{className:"font-bold text-orange-400",children:["¥",Number(k.amount).toFixed(2)]})}),e.jsx("td",{className:"p-4",children:k.userCommissionInfo?e.jsxs("div",{className:"text-xs space-y-1",children:[e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-gray-500",children:"累计佣金:"}),e.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",k.userCommissionInfo.totalCommission.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-gray-500",children:"已提现:"}),e.jsxs("span",{className:"text-gray-400",children:["¥",k.userCommissionInfo.withdrawnEarnings.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-gray-500",children:"待审核:"}),e.jsxs("span",{className:"text-orange-400",children:["¥",k.userCommissionInfo.pendingWithdrawals.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between gap-4 pt-1 border-t border-gray-700/30",children:[e.jsx("span",{className:"text-gray-500",children:"审核后余额:"}),e.jsxs("span",{className:k.userCommissionInfo.availableAfterThis>=0?"text-green-400 font-medium":"text-red-400 font-medium",children:["¥",k.userCommissionInfo.availableAfterThis.toFixed(2)]})]})]}):e.jsx("span",{className:"text-gray-500 text-xs",children:"暂无数据"})}),e.jsxs("td",{className:"p-4",children:[U(k.status),k.errorMessage&&e.jsx("p",{className:"text-xs text-red-400 mt-1",children:k.errorMessage})]}),e.jsx("td",{className:"p-4 text-gray-400",children:k.processedAt?new Date(k.processedAt).toLocaleString():"-"}),e.jsx("td",{className:"p-4 text-gray-400",children:k.userConfirmedAt?e.jsxs("span",{className:"text-green-400",title:k.userConfirmedAt,children:["已确认 ",new Date(k.userConfirmedAt).toLocaleString()]}):"-"}),e.jsxs("td",{className:"p-4 text-right",children:[(k.status==="pending"||k.status==="pending_confirm")&&e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsxs(Z,{size:"sm",onClick:()=>R(k.id),disabled:b===k.id,className:"bg-green-600 hover:bg-green-700 text-white",children:[e.jsx(fo,{className:"w-4 h-4 mr-1"}),"批准"]}),e.jsxs(Z,{size:"sm",variant:"outline",onClick:()=>B(k.id),disabled:b===k.id,className:"border-red-500/50 text-red-400 hover:bg-red-500/10 bg-transparent",children:[e.jsx(Sr,{className:"w-4 h-4 mr-1"}),"拒绝"]})]}),(k.status==="success"||k.status==="completed")&&k.transactionId&&e.jsx("span",{className:"text-xs text-gray-500 font-mono",children:k.transactionId})]})]},k.id))})]})}),e.jsx(Ar,{page:g,totalPages:j,total:T,pageSize:C,onPageChange:v,onPageSizeChange:k=>{P(k),v(1)}})]})})})]})}const jn=f.forwardRef(({className:s,...a},l)=>e.jsx("textarea",{className:tt("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),ref:l,...a}));jn.displayName="Textarea";function no(s,[a,l]){return Math.min(l,Math.max(a,s))}const A2=["top","right","bottom","left"],qs=Math.min,xr=Math.max,ao=Math.round,Wi=Math.floor,Gr=s=>({x:s,y:s}),D2={left:"right",right:"left",bottom:"top",top:"bottom"},L2={start:"end",end:"start"};function Gd(s,a,l){return xr(s,qs(a,l))}function hs(s,a){return typeof s=="function"?s(a):s}function fs(s){return s.split("-")[0]}function fa(s){return s.split("-")[1]}function Pu(s){return s==="x"?"y":"x"}function Tu(s){return s==="y"?"height":"width"}const O2=new Set(["top","bottom"]);function Yr(s){return O2.has(fs(s))?"y":"x"}function Ru(s){return Pu(Yr(s))}function F2(s,a,l){l===void 0&&(l=!1);const o=fa(s),c=Ru(s),d=Tu(c);let h=c==="x"?o===(l?"end":"start")?"right":"left":o==="start"?"bottom":"top";return a.reference[d]>a.floating[d]&&(h=lo(h)),[h,lo(h)]}function z2(s){const a=lo(s);return[Qd(s),a,Qd(a)]}function Qd(s){return s.replace(/start|end/g,a=>L2[a])}const sx=["left","right"],nx=["right","left"],$2=["top","bottom"],B2=["bottom","top"];function U2(s,a,l){switch(s){case"top":case"bottom":return l?a?nx:sx:a?sx:nx;case"left":case"right":return a?$2:B2;default:return[]}}function V2(s,a,l,o){const c=fa(s);let d=U2(fs(s),l==="start",o);return c&&(d=d.map(h=>h+"-"+c),a&&(d=d.concat(d.map(Qd)))),d}function lo(s){return s.replace(/left|right|bottom|top/g,a=>D2[a])}function W2(s){return{top:0,right:0,bottom:0,left:0,...s}}function og(s){return typeof s!="number"?W2(s):{top:s,right:s,bottom:s,left:s}}function io(s){const{x:a,y:l,width:o,height:c}=s;return{width:o,height:c,top:l,left:a,right:a+o,bottom:l+c,x:a,y:l}}function ax(s,a,l){let{reference:o,floating:c}=s;const d=Yr(a),h=Ru(a),m=Tu(h),p=fs(a),y=d==="y",g=o.x+o.width/2-c.width/2,v=o.y+o.height/2-c.height/2,C=o[m]/2-c[m]/2;let P;switch(p){case"top":P={x:g,y:o.y-c.height};break;case"bottom":P={x:g,y:o.y+o.height};break;case"right":P={x:o.x+o.width,y:v};break;case"left":P={x:o.x-c.width,y:v};break;default:P={x:o.x,y:o.y}}switch(fa(a)){case"start":P[h]-=C*(l&&y?-1:1);break;case"end":P[h]+=C*(l&&y?-1:1);break}return P}async function H2(s,a){var l;a===void 0&&(a={});const{x:o,y:c,platform:d,rects:h,elements:m,strategy:p}=s,{boundary:y="clippingAncestors",rootBoundary:g="viewport",elementContext:v="floating",altBoundary:C=!1,padding:P=0}=hs(a,s),T=og(P),b=m[C?v==="floating"?"reference":"floating":v],N=io(await d.getClippingRect({element:(l=await(d.isElement==null?void 0:d.isElement(b)))==null||l?b:b.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(m.floating)),boundary:y,rootBoundary:g,strategy:p})),E=v==="floating"?{x:o,y:c,width:h.floating.width,height:h.floating.height}:h.reference,j=await(d.getOffsetParent==null?void 0:d.getOffsetParent(m.floating)),R=await(d.isElement==null?void 0:d.isElement(j))?await(d.getScale==null?void 0:d.getScale(j))||{x:1,y:1}:{x:1,y:1},B=io(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:m,rect:E,offsetParent:j,strategy:p}):E);return{top:(N.top-B.top+T.top)/R.y,bottom:(B.bottom-N.bottom+T.bottom)/R.y,left:(N.left-B.left+T.left)/R.x,right:(B.right-N.right+T.right)/R.x}}const K2=async(s,a,l)=>{const{placement:o="bottom",strategy:c="absolute",middleware:d=[],platform:h}=l,m=d.filter(Boolean),p=await(h.isRTL==null?void 0:h.isRTL(a));let y=await h.getElementRects({reference:s,floating:a,strategy:c}),{x:g,y:v}=ax(y,o,p),C=o,P={},T=0;for(let b=0;b<m.length;b++){var S;const{name:N,fn:E}=m[b],{x:j,y:R,data:B,reset:U}=await E({x:g,y:v,initialPlacement:o,placement:C,strategy:c,middlewareData:P,rects:y,platform:{...h,detectOverflow:(S=h.detectOverflow)!=null?S:H2},elements:{reference:s,floating:a}});g=j??g,v=R??v,P={...P,[N]:{...P[N],...B}},U&&T<=50&&(T++,typeof U=="object"&&(U.placement&&(C=U.placement),U.rects&&(y=U.rects===!0?await h.getElementRects({reference:s,floating:a,strategy:c}):U.rects),{x:g,y:v}=ax(y,C,p)),b=-1)}return{x:g,y:v,placement:C,strategy:c,middlewareData:P}},Y2=s=>({name:"arrow",options:s,async fn(a){const{x:l,y:o,placement:c,rects:d,platform:h,elements:m,middlewareData:p}=a,{element:y,padding:g=0}=hs(s,a)||{};if(y==null)return{};const v=og(g),C={x:l,y:o},P=Ru(c),T=Tu(P),S=await h.getDimensions(y),b=P==="y",N=b?"top":"left",E=b?"bottom":"right",j=b?"clientHeight":"clientWidth",R=d.reference[T]+d.reference[P]-C[P]-d.floating[T],B=C[P]-d.reference[P],U=await(h.getOffsetParent==null?void 0:h.getOffsetParent(y));let k=U?U[j]:0;(!k||!await(h.isElement==null?void 0:h.isElement(U)))&&(k=m.floating[j]||d.floating[T]);const L=R/2-B/2,_=k/2-S[T]/2-1,se=qs(v[N],_),le=qs(v[E],_),ie=se,ee=k-S[T]-le,G=k/2-S[T]/2+L,Q=Gd(ie,G,ee),ce=!p.arrow&&fa(c)!=null&&G!==Q&&d.reference[T]/2-(G<ie?se:le)-S[T]/2<0,re=ce?G<ie?G-ie:G-ee:0;return{[P]:C[P]+re,data:{[P]:Q,centerOffset:G-Q-re,...ce&&{alignmentOffset:re}},reset:ce}}}),G2=function(s){return s===void 0&&(s={}),{name:"flip",options:s,async fn(a){var l,o;const{placement:c,middlewareData:d,rects:h,initialPlacement:m,platform:p,elements:y}=a,{mainAxis:g=!0,crossAxis:v=!0,fallbackPlacements:C,fallbackStrategy:P="bestFit",fallbackAxisSideDirection:T="none",flipAlignment:S=!0,...b}=hs(s,a);if((l=d.arrow)!=null&&l.alignmentOffset)return{};const N=fs(c),E=Yr(m),j=fs(m)===m,R=await(p.isRTL==null?void 0:p.isRTL(y.floating)),B=C||(j||!S?[lo(m)]:z2(m)),U=T!=="none";!C&&U&&B.push(...V2(m,S,T,R));const k=[m,...B],L=await p.detectOverflow(a,b),_=[];let se=((o=d.flip)==null?void 0:o.overflows)||[];if(g&&_.push(L[N]),v){const G=F2(c,h,R);_.push(L[G[0]],L[G[1]])}if(se=[...se,{placement:c,overflows:_}],!_.every(G=>G<=0)){var le,ie;const G=(((le=d.flip)==null?void 0:le.index)||0)+1,Q=k[G];if(Q&&(!(v==="alignment"?E!==Yr(Q):!1)||se.every(A=>Yr(A.placement)===E?A.overflows[0]>0:!0)))return{data:{index:G,overflows:se},reset:{placement:Q}};let ce=(ie=se.filter(re=>re.overflows[0]<=0).sort((re,A)=>re.overflows[1]-A.overflows[1])[0])==null?void 0:ie.placement;if(!ce)switch(P){case"bestFit":{var ee;const re=(ee=se.filter(A=>{if(U){const ne=Yr(A.placement);return ne===E||ne==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(ne=>ne>0).reduce((ne,W)=>ne+W,0)]).sort((A,ne)=>A[1]-ne[1])[0])==null?void 0:ee[0];re&&(ce=re);break}case"initialPlacement":ce=m;break}if(c!==ce)return{reset:{placement:ce}}}return{}}}};function lx(s,a){return{top:s.top-a.height,right:s.right-a.width,bottom:s.bottom-a.height,left:s.left-a.width}}function ix(s){return A2.some(a=>s[a]>=0)}const Q2=function(s){return s===void 0&&(s={}),{name:"hide",options:s,async fn(a){const{rects:l,platform:o}=a,{strategy:c="referenceHidden",...d}=hs(s,a);switch(c){case"referenceHidden":{const h=await o.detectOverflow(a,{...d,elementContext:"reference"}),m=lx(h,l.reference);return{data:{referenceHiddenOffsets:m,referenceHidden:ix(m)}}}case"escaped":{const h=await o.detectOverflow(a,{...d,altBoundary:!0}),m=lx(h,l.floating);return{data:{escapedOffsets:m,escaped:ix(m)}}}default:return{}}}}},cg=new Set(["left","top"]);async function q2(s,a){const{placement:l,platform:o,elements:c}=s,d=await(o.isRTL==null?void 0:o.isRTL(c.floating)),h=fs(l),m=fa(l),p=Yr(l)==="y",y=cg.has(h)?-1:1,g=d&&p?-1:1,v=hs(a,s);let{mainAxis:C,crossAxis:P,alignmentAxis:T}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return m&&typeof T=="number"&&(P=m==="end"?T*-1:T),p?{x:P*g,y:C*y}:{x:C*y,y:P*g}}const X2=function(s){return s===void 0&&(s=0),{name:"offset",options:s,async fn(a){var l,o;const{x:c,y:d,placement:h,middlewareData:m}=a,p=await q2(a,s);return h===((l=m.offset)==null?void 0:l.placement)&&(o=m.arrow)!=null&&o.alignmentOffset?{}:{x:c+p.x,y:d+p.y,data:{...p,placement:h}}}}},J2=function(s){return s===void 0&&(s={}),{name:"shift",options:s,async fn(a){const{x:l,y:o,placement:c,platform:d}=a,{mainAxis:h=!0,crossAxis:m=!1,limiter:p={fn:N=>{let{x:E,y:j}=N;return{x:E,y:j}}},...y}=hs(s,a),g={x:l,y:o},v=await d.detectOverflow(a,y),C=Yr(fs(c)),P=Pu(C);let T=g[P],S=g[C];if(h){const N=P==="y"?"top":"left",E=P==="y"?"bottom":"right",j=T+v[N],R=T-v[E];T=Gd(j,T,R)}if(m){const N=C==="y"?"top":"left",E=C==="y"?"bottom":"right",j=S+v[N],R=S-v[E];S=Gd(j,S,R)}const b=p.fn({...a,[P]:T,[C]:S});return{...b,data:{x:b.x-l,y:b.y-o,enabled:{[P]:h,[C]:m}}}}}},Z2=function(s){return s===void 0&&(s={}),{options:s,fn(a){const{x:l,y:o,placement:c,rects:d,middlewareData:h}=a,{offset:m=0,mainAxis:p=!0,crossAxis:y=!0}=hs(s,a),g={x:l,y:o},v=Yr(c),C=Pu(v);let P=g[C],T=g[v];const S=hs(m,a),b=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(p){const j=C==="y"?"height":"width",R=d.reference[C]-d.floating[j]+b.mainAxis,B=d.reference[C]+d.reference[j]-b.mainAxis;P<R?P=R:P>B&&(P=B)}if(y){var N,E;const j=C==="y"?"width":"height",R=cg.has(fs(c)),B=d.reference[v]-d.floating[j]+(R&&((N=h.offset)==null?void 0:N[v])||0)+(R?0:b.crossAxis),U=d.reference[v]+d.reference[j]+(R?0:((E=h.offset)==null?void 0:E[v])||0)-(R?b.crossAxis:0);T<B?T=B:T>U&&(T=U)}return{[C]:P,[v]:T}}}},eS=function(s){return s===void 0&&(s={}),{name:"size",options:s,async fn(a){var l,o;const{placement:c,rects:d,platform:h,elements:m}=a,{apply:p=()=>{},...y}=hs(s,a),g=await h.detectOverflow(a,y),v=fs(c),C=fa(c),P=Yr(c)==="y",{width:T,height:S}=d.floating;let b,N;v==="top"||v==="bottom"?(b=v,N=C===(await(h.isRTL==null?void 0:h.isRTL(m.floating))?"start":"end")?"left":"right"):(N=v,b=C==="end"?"top":"bottom");const E=S-g.top-g.bottom,j=T-g.left-g.right,R=qs(S-g[b],E),B=qs(T-g[N],j),U=!a.middlewareData.shift;let k=R,L=B;if((l=a.middlewareData.shift)!=null&&l.enabled.x&&(L=j),(o=a.middlewareData.shift)!=null&&o.enabled.y&&(k=E),U&&!C){const se=xr(g.left,0),le=xr(g.right,0),ie=xr(g.top,0),ee=xr(g.bottom,0);P?L=T-2*(se!==0||le!==0?se+le:xr(g.left,g.right)):k=S-2*(ie!==0||ee!==0?ie+ee:xr(g.top,g.bottom))}await p({...a,availableWidth:L,availableHeight:k});const _=await h.getDimensions(m.floating);return T!==_.width||S!==_.height?{reset:{rects:!0}}:{}}}};function No(){return typeof window<"u"}function ma(s){return dg(s)?(s.nodeName||"").toLowerCase():"#document"}function pr(s){var a;return(s==null||(a=s.ownerDocument)==null?void 0:a.defaultView)||window}function qr(s){var a;return(a=(dg(s)?s.ownerDocument:s.document)||window.document)==null?void 0:a.documentElement}function dg(s){return No()?s instanceof Node||s instanceof pr(s).Node:!1}function Dr(s){return No()?s instanceof Element||s instanceof pr(s).Element:!1}function Qr(s){return No()?s instanceof HTMLElement||s instanceof pr(s).HTMLElement:!1}function ox(s){return!No()||typeof ShadowRoot>"u"?!1:s instanceof ShadowRoot||s instanceof pr(s).ShadowRoot}const tS=new Set(["inline","contents"]);function bl(s){const{overflow:a,overflowX:l,overflowY:o,display:c}=Lr(s);return/auto|scroll|overlay|hidden|clip/.test(a+o+l)&&!tS.has(c)}const rS=new Set(["table","td","th"]);function sS(s){return rS.has(ma(s))}const nS=[":popover-open",":modal"];function wo(s){return nS.some(a=>{try{return s.matches(a)}catch{return!1}})}const aS=["transform","translate","scale","rotate","perspective"],lS=["transform","translate","scale","rotate","perspective","filter"],iS=["paint","layout","strict","content"];function Iu(s){const a=_u(),l=Dr(s)?Lr(s):s;return aS.some(o=>l[o]?l[o]!=="none":!1)||(l.containerType?l.containerType!=="normal":!1)||!a&&(l.backdropFilter?l.backdropFilter!=="none":!1)||!a&&(l.filter?l.filter!=="none":!1)||lS.some(o=>(l.willChange||"").includes(o))||iS.some(o=>(l.contain||"").includes(o))}function oS(s){let a=Xs(s);for(;Qr(a)&&!ia(a);){if(Iu(a))return a;if(wo(a))return null;a=Xs(a)}return null}function _u(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const cS=new Set(["html","body","#document"]);function ia(s){return cS.has(ma(s))}function Lr(s){return pr(s).getComputedStyle(s)}function So(s){return Dr(s)?{scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}:{scrollLeft:s.scrollX,scrollTop:s.scrollY}}function Xs(s){if(ma(s)==="html")return s;const a=s.assignedSlot||s.parentNode||ox(s)&&s.host||qr(s);return ox(a)?a.host:a}function ug(s){const a=Xs(s);return ia(a)?s.ownerDocument?s.ownerDocument.body:s.body:Qr(a)&&bl(a)?a:ug(a)}function pl(s,a,l){var o;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=ug(s),d=c===((o=s.ownerDocument)==null?void 0:o.body),h=pr(c);if(d){const m=qd(h);return a.concat(h,h.visualViewport||[],bl(c)?c:[],m&&l?pl(m):[])}return a.concat(c,pl(c,[],l))}function qd(s){return s.parent&&Object.getPrototypeOf(s.parent)?s.frameElement:null}function hg(s){const a=Lr(s);let l=parseFloat(a.width)||0,o=parseFloat(a.height)||0;const c=Qr(s),d=c?s.offsetWidth:l,h=c?s.offsetHeight:o,m=ao(l)!==d||ao(o)!==h;return m&&(l=d,o=h),{width:l,height:o,$:m}}function Mu(s){return Dr(s)?s:s.contextElement}function na(s){const a=Mu(s);if(!Qr(a))return Gr(1);const l=a.getBoundingClientRect(),{width:o,height:c,$:d}=hg(a);let h=(d?ao(l.width):l.width)/o,m=(d?ao(l.height):l.height)/c;return(!h||!Number.isFinite(h))&&(h=1),(!m||!Number.isFinite(m))&&(m=1),{x:h,y:m}}const dS=Gr(0);function fg(s){const a=pr(s);return!_u()||!a.visualViewport?dS:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function uS(s,a,l){return a===void 0&&(a=!1),!l||a&&l!==pr(s)?!1:a}function wn(s,a,l,o){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=s.getBoundingClientRect(),d=Mu(s);let h=Gr(1);a&&(o?Dr(o)&&(h=na(o)):h=na(s));const m=uS(d,l,o)?fg(d):Gr(0);let p=(c.left+m.x)/h.x,y=(c.top+m.y)/h.y,g=c.width/h.x,v=c.height/h.y;if(d){const C=pr(d),P=o&&Dr(o)?pr(o):o;let T=C,S=qd(T);for(;S&&o&&P!==T;){const b=na(S),N=S.getBoundingClientRect(),E=Lr(S),j=N.left+(S.clientLeft+parseFloat(E.paddingLeft))*b.x,R=N.top+(S.clientTop+parseFloat(E.paddingTop))*b.y;p*=b.x,y*=b.y,g*=b.x,v*=b.y,p+=j,y+=R,T=pr(S),S=qd(T)}}return io({width:g,height:v,x:p,y})}function Co(s,a){const l=So(s).scrollLeft;return a?a.left+l:wn(qr(s)).left+l}function mg(s,a){const l=s.getBoundingClientRect(),o=l.left+a.scrollLeft-Co(s,l),c=l.top+a.scrollTop;return{x:o,y:c}}function hS(s){let{elements:a,rect:l,offsetParent:o,strategy:c}=s;const d=c==="fixed",h=qr(o),m=a?wo(a.floating):!1;if(o===h||m&&d)return l;let p={scrollLeft:0,scrollTop:0},y=Gr(1);const g=Gr(0),v=Qr(o);if((v||!v&&!d)&&((ma(o)!=="body"||bl(h))&&(p=So(o)),Qr(o))){const P=wn(o);y=na(o),g.x=P.x+o.clientLeft,g.y=P.y+o.clientTop}const C=h&&!v&&!d?mg(h,p):Gr(0);return{width:l.width*y.x,height:l.height*y.y,x:l.x*y.x-p.scrollLeft*y.x+g.x+C.x,y:l.y*y.y-p.scrollTop*y.y+g.y+C.y}}function fS(s){return Array.from(s.getClientRects())}function mS(s){const a=qr(s),l=So(s),o=s.ownerDocument.body,c=xr(a.scrollWidth,a.clientWidth,o.scrollWidth,o.clientWidth),d=xr(a.scrollHeight,a.clientHeight,o.scrollHeight,o.clientHeight);let h=-l.scrollLeft+Co(s);const m=-l.scrollTop;return Lr(o).direction==="rtl"&&(h+=xr(a.clientWidth,o.clientWidth)-c),{width:c,height:d,x:h,y:m}}const cx=25;function xS(s,a){const l=pr(s),o=qr(s),c=l.visualViewport;let d=o.clientWidth,h=o.clientHeight,m=0,p=0;if(c){d=c.width,h=c.height;const g=_u();(!g||g&&a==="fixed")&&(m=c.offsetLeft,p=c.offsetTop)}const y=Co(o);if(y<=0){const g=o.ownerDocument,v=g.body,C=getComputedStyle(v),P=g.compatMode==="CSS1Compat"&&parseFloat(C.marginLeft)+parseFloat(C.marginRight)||0,T=Math.abs(o.clientWidth-v.clientWidth-P);T<=cx&&(d-=T)}else y<=cx&&(d+=y);return{width:d,height:h,x:m,y:p}}const pS=new Set(["absolute","fixed"]);function gS(s,a){const l=wn(s,!0,a==="fixed"),o=l.top+s.clientTop,c=l.left+s.clientLeft,d=Qr(s)?na(s):Gr(1),h=s.clientWidth*d.x,m=s.clientHeight*d.y,p=c*d.x,y=o*d.y;return{width:h,height:m,x:p,y}}function dx(s,a,l){let o;if(a==="viewport")o=xS(s,l);else if(a==="document")o=mS(qr(s));else if(Dr(a))o=gS(a,l);else{const c=fg(s);o={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return io(o)}function xg(s,a){const l=Xs(s);return l===a||!Dr(l)||ia(l)?!1:Lr(l).position==="fixed"||xg(l,a)}function yS(s,a){const l=a.get(s);if(l)return l;let o=pl(s,[],!1).filter(m=>Dr(m)&&ma(m)!=="body"),c=null;const d=Lr(s).position==="fixed";let h=d?Xs(s):s;for(;Dr(h)&&!ia(h);){const m=Lr(h),p=Iu(h);!p&&m.position==="fixed"&&(c=null),(d?!p&&!c:!p&&m.position==="static"&&!!c&&pS.has(c.position)||bl(h)&&!p&&xg(s,h))?o=o.filter(g=>g!==h):c=m,h=Xs(h)}return a.set(s,o),o}function vS(s){let{element:a,boundary:l,rootBoundary:o,strategy:c}=s;const h=[...l==="clippingAncestors"?wo(a)?[]:yS(a,this._c):[].concat(l),o],m=h[0],p=h.reduce((y,g)=>{const v=dx(a,g,c);return y.top=xr(v.top,y.top),y.right=qs(v.right,y.right),y.bottom=qs(v.bottom,y.bottom),y.left=xr(v.left,y.left),y},dx(a,m,c));return{width:p.right-p.left,height:p.bottom-p.top,x:p.left,y:p.top}}function jS(s){const{width:a,height:l}=hg(s);return{width:a,height:l}}function bS(s,a,l){const o=Qr(a),c=qr(a),d=l==="fixed",h=wn(s,!0,d,a);let m={scrollLeft:0,scrollTop:0};const p=Gr(0);function y(){p.x=Co(c)}if(o||!o&&!d)if((ma(a)!=="body"||bl(c))&&(m=So(a)),o){const P=wn(a,!0,d,a);p.x=P.x+a.clientLeft,p.y=P.y+a.clientTop}else c&&y();d&&!o&&c&&y();const g=c&&!o&&!d?mg(c,m):Gr(0),v=h.left+m.scrollLeft-p.x-g.x,C=h.top+m.scrollTop-p.y-g.y;return{x:v,y:C,width:h.width,height:h.height}}function _d(s){return Lr(s).position==="static"}function ux(s,a){if(!Qr(s)||Lr(s).position==="fixed")return null;if(a)return a(s);let l=s.offsetParent;return qr(s)===l&&(l=l.ownerDocument.body),l}function pg(s,a){const l=pr(s);if(wo(s))return l;if(!Qr(s)){let c=Xs(s);for(;c&&!ia(c);){if(Dr(c)&&!_d(c))return c;c=Xs(c)}return l}let o=ux(s,a);for(;o&&sS(o)&&_d(o);)o=ux(o,a);return o&&ia(o)&&_d(o)&&!Iu(o)?l:o||oS(s)||l}const NS=async function(s){const a=this.getOffsetParent||pg,l=this.getDimensions,o=await l(s.floating);return{reference:bS(s.reference,await a(s.floating),s.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function wS(s){return Lr(s).direction==="rtl"}const SS={convertOffsetParentRelativeRectToViewportRelativeRect:hS,getDocumentElement:qr,getClippingRect:vS,getOffsetParent:pg,getElementRects:NS,getClientRects:fS,getDimensions:jS,getScale:na,isElement:Dr,isRTL:wS};function gg(s,a){return s.x===a.x&&s.y===a.y&&s.width===a.width&&s.height===a.height}function CS(s,a){let l=null,o;const c=qr(s);function d(){var m;clearTimeout(o),(m=l)==null||m.disconnect(),l=null}function h(m,p){m===void 0&&(m=!1),p===void 0&&(p=1),d();const y=s.getBoundingClientRect(),{left:g,top:v,width:C,height:P}=y;if(m||a(),!C||!P)return;const T=Wi(v),S=Wi(c.clientWidth-(g+C)),b=Wi(c.clientHeight-(v+P)),N=Wi(g),j={rootMargin:-T+"px "+-S+"px "+-b+"px "+-N+"px",threshold:xr(0,qs(1,p))||1};let R=!0;function B(U){const k=U[0].intersectionRatio;if(k!==p){if(!R)return h();k?h(!1,k):o=setTimeout(()=>{h(!1,1e-7)},1e3)}k===1&&!gg(y,s.getBoundingClientRect())&&h(),R=!1}try{l=new IntersectionObserver(B,{...j,root:c.ownerDocument})}catch{l=new IntersectionObserver(B,j)}l.observe(s)}return h(!0),d}function kS(s,a,l,o){o===void 0&&(o={});const{ancestorScroll:c=!0,ancestorResize:d=!0,elementResize:h=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:p=!1}=o,y=Mu(s),g=c||d?[...y?pl(y):[],...pl(a)]:[];g.forEach(N=>{c&&N.addEventListener("scroll",l,{passive:!0}),d&&N.addEventListener("resize",l)});const v=y&&m?CS(y,l):null;let C=-1,P=null;h&&(P=new ResizeObserver(N=>{let[E]=N;E&&E.target===y&&P&&(P.unobserve(a),cancelAnimationFrame(C),C=requestAnimationFrame(()=>{var j;(j=P)==null||j.observe(a)})),l()}),y&&!p&&P.observe(y),P.observe(a));let T,S=p?wn(s):null;p&&b();function b(){const N=wn(s);S&&!gg(S,N)&&l(),S=N,T=requestAnimationFrame(b)}return l(),()=>{var N;g.forEach(E=>{c&&E.removeEventListener("scroll",l),d&&E.removeEventListener("resize",l)}),v==null||v(),(N=P)==null||N.disconnect(),P=null,p&&cancelAnimationFrame(T)}}const ES=X2,PS=J2,TS=G2,RS=eS,IS=Q2,hx=Y2,_S=Z2,MS=(s,a,l)=>{const o=new Map,c={platform:SS,...l},d={...c.platform,_c:o};return K2(s,a,{...c,platform:d})};var AS=typeof document<"u",DS=function(){},Gi=AS?f.useLayoutEffect:DS;function oo(s,a){if(s===a)return!0;if(typeof s!=typeof a)return!1;if(typeof s=="function"&&s.toString()===a.toString())return!0;let l,o,c;if(s&&a&&typeof s=="object"){if(Array.isArray(s)){if(l=s.length,l!==a.length)return!1;for(o=l;o--!==0;)if(!oo(s[o],a[o]))return!1;return!0}if(c=Object.keys(s),l=c.length,l!==Object.keys(a).length)return!1;for(o=l;o--!==0;)if(!{}.hasOwnProperty.call(a,c[o]))return!1;for(o=l;o--!==0;){const d=c[o];if(!(d==="_owner"&&s.$$typeof)&&!oo(s[d],a[d]))return!1}return!0}return s!==s&&a!==a}function yg(s){return typeof window>"u"?1:(s.ownerDocument.defaultView||window).devicePixelRatio||1}function fx(s,a){const l=yg(s);return Math.round(a*l)/l}function Md(s){const a=f.useRef(s);return Gi(()=>{a.current=s}),a}function LS(s){s===void 0&&(s={});const{placement:a="bottom",strategy:l="absolute",middleware:o=[],platform:c,elements:{reference:d,floating:h}={},transform:m=!0,whileElementsMounted:p,open:y}=s,[g,v]=f.useState({x:0,y:0,strategy:l,placement:a,middlewareData:{},isPositioned:!1}),[C,P]=f.useState(o);oo(C,o)||P(o);const[T,S]=f.useState(null),[b,N]=f.useState(null),E=f.useCallback(A=>{A!==U.current&&(U.current=A,S(A))},[]),j=f.useCallback(A=>{A!==k.current&&(k.current=A,N(A))},[]),R=d||T,B=h||b,U=f.useRef(null),k=f.useRef(null),L=f.useRef(g),_=p!=null,se=Md(p),le=Md(c),ie=Md(y),ee=f.useCallback(()=>{if(!U.current||!k.current)return;const A={placement:a,strategy:l,middleware:C};le.current&&(A.platform=le.current),MS(U.current,k.current,A).then(ne=>{const W={...ne,isPositioned:ie.current!==!1};G.current&&!oo(L.current,W)&&(L.current=W,gl.flushSync(()=>{v(W)}))})},[C,a,l,le,ie]);Gi(()=>{y===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,v(A=>({...A,isPositioned:!1})))},[y]);const G=f.useRef(!1);Gi(()=>(G.current=!0,()=>{G.current=!1}),[]),Gi(()=>{if(R&&(U.current=R),B&&(k.current=B),R&&B){if(se.current)return se.current(R,B,ee);ee()}},[R,B,ee,se,_]);const Q=f.useMemo(()=>({reference:U,floating:k,setReference:E,setFloating:j}),[E,j]),ce=f.useMemo(()=>({reference:R,floating:B}),[R,B]),re=f.useMemo(()=>{const A={position:l,left:0,top:0};if(!ce.floating)return A;const ne=fx(ce.floating,g.x),W=fx(ce.floating,g.y);return m?{...A,transform:"translate("+ne+"px, "+W+"px)",...yg(ce.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:ne,top:W}},[l,m,ce.floating,g.x,g.y]);return f.useMemo(()=>({...g,update:ee,refs:Q,elements:ce,floatingStyles:re}),[g,ee,Q,ce,re])}const OS=s=>{function a(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:s,fn(l){const{element:o,padding:c}=typeof s=="function"?s(l):s;return o&&a(o)?o.current!=null?hx({element:o.current,padding:c}).fn(l):{}:o?hx({element:o,padding:c}).fn(l):{}}}},FS=(s,a)=>({...ES(s),options:[s,a]}),zS=(s,a)=>({...PS(s),options:[s,a]}),$S=(s,a)=>({..._S(s),options:[s,a]}),BS=(s,a)=>({...TS(s),options:[s,a]}),US=(s,a)=>({...RS(s),options:[s,a]}),VS=(s,a)=>({...IS(s),options:[s,a]}),WS=(s,a)=>({...OS(s),options:[s,a]});var HS="Arrow",vg=f.forwardRef((s,a)=>{const{children:l,width:o=10,height:c=5,...d}=s;return e.jsx(Ke.svg,{...d,ref:a,width:o,height:c,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:s.asChild?l:e.jsx("polygon",{points:"0,0 30,0 15,10"})})});vg.displayName=HS;var KS=vg,Au="Popper",[jg,bg]=en(Au),[YS,Ng]=jg(Au),wg=s=>{const{__scopePopper:a,children:l}=s,[o,c]=f.useState(null);return e.jsx(YS,{scope:a,anchor:o,onAnchorChange:c,children:l})};wg.displayName=Au;var Sg="PopperAnchor",Cg=f.forwardRef((s,a)=>{const{__scopePopper:l,virtualRef:o,...c}=s,d=Ng(Sg,l),h=f.useRef(null),m=et(a,h),p=f.useRef(null);return f.useEffect(()=>{const y=p.current;p.current=(o==null?void 0:o.current)||h.current,y!==p.current&&d.onAnchorChange(p.current)}),o?null:e.jsx(Ke.div,{...c,ref:m})});Cg.displayName=Sg;var Du="PopperContent",[GS,QS]=jg(Du),kg=f.forwardRef((s,a)=>{var K,ye,ge,D,fe,Se;const{__scopePopper:l,side:o="bottom",sideOffset:c=0,align:d="center",alignOffset:h=0,arrowPadding:m=0,avoidCollisions:p=!0,collisionBoundary:y=[],collisionPadding:g=0,sticky:v="partial",hideWhenDetached:C=!1,updatePositionStrategy:P="optimized",onPlaced:T,...S}=s,b=Ng(Du,l),[N,E]=f.useState(null),j=et(a,ze=>E(ze)),[R,B]=f.useState(null),U=Cu(R),k=(U==null?void 0:U.width)??0,L=(U==null?void 0:U.height)??0,_=o+(d!=="center"?"-"+d:""),se=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},le=Array.isArray(y)?y:[y],ie=le.length>0,ee={padding:se,boundary:le.filter(XS),altBoundary:ie},{refs:G,floatingStyles:Q,placement:ce,isPositioned:re,middlewareData:A}=LS({strategy:"fixed",placement:_,whileElementsMounted:(...ze)=>kS(...ze,{animationFrame:P==="always"}),elements:{reference:b.anchor},middleware:[FS({mainAxis:c+L,alignmentAxis:h}),p&&zS({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?$S():void 0,...ee}),p&&BS({...ee}),US({...ee,apply:({elements:ze,rects:We,availableWidth:qe,availableHeight:Ze})=>{const{width:st,height:ft}=We.reference,nt=ze.floating.style;nt.setProperty("--radix-popper-available-width",`${qe}px`),nt.setProperty("--radix-popper-available-height",`${Ze}px`),nt.setProperty("--radix-popper-anchor-width",`${st}px`),nt.setProperty("--radix-popper-anchor-height",`${ft}px`)}}),R&&WS({element:R,padding:m}),JS({arrowWidth:k,arrowHeight:L}),C&&VS({strategy:"referenceHidden",...ee})]}),[ne,W]=Tg(ce),M=Qs(T);qt(()=>{re&&(M==null||M())},[re,M]);const O=(K=A.arrow)==null?void 0:K.x,F=(ye=A.arrow)==null?void 0:ye.y,X=((ge=A.arrow)==null?void 0:ge.centerOffset)!==0,[H,ue]=f.useState();return qt(()=>{N&&ue(window.getComputedStyle(N).zIndex)},[N]),e.jsx("div",{ref:G.setFloating,"data-radix-popper-content-wrapper":"",style:{...Q,transform:re?Q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[(D=A.transformOrigin)==null?void 0:D.x,(fe=A.transformOrigin)==null?void 0:fe.y].join(" "),...((Se=A.hide)==null?void 0:Se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:s.dir,children:e.jsx(GS,{scope:l,placedSide:ne,onArrowChange:B,arrowX:O,arrowY:F,shouldHideArrow:X,children:e.jsx(Ke.div,{"data-side":ne,"data-align":W,...S,ref:j,style:{...S.style,animation:re?void 0:"none"}})})})});kg.displayName=Du;var Eg="PopperArrow",qS={top:"bottom",right:"left",bottom:"top",left:"right"},Pg=f.forwardRef(function(a,l){const{__scopePopper:o,...c}=a,d=QS(Eg,o),h=qS[d.placedSide];return e.jsx("span",{ref:d.onArrowChange,style:{position:"absolute",left:d.arrowX,top:d.arrowY,[h]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[d.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[d.placedSide],visibility:d.shouldHideArrow?"hidden":void 0},children:e.jsx(KS,{...c,ref:l,style:{...c.style,display:"block"}})})});Pg.displayName=Eg;function XS(s){return s!==null}var JS=s=>({name:"transformOrigin",options:s,fn(a){var b,N,E;const{placement:l,rects:o,middlewareData:c}=a,h=((b=c.arrow)==null?void 0:b.centerOffset)!==0,m=h?0:s.arrowWidth,p=h?0:s.arrowHeight,[y,g]=Tg(l),v={start:"0%",center:"50%",end:"100%"}[g],C=(((N=c.arrow)==null?void 0:N.x)??0)+m/2,P=(((E=c.arrow)==null?void 0:E.y)??0)+p/2;let T="",S="";return y==="bottom"?(T=h?v:`${C}px`,S=`${-p}px`):y==="top"?(T=h?v:`${C}px`,S=`${o.floating.height+p}px`):y==="right"?(T=`${-p}px`,S=h?v:`${P}px`):y==="left"&&(T=`${o.floating.width+p}px`,S=h?v:`${P}px`),{data:{x:T,y:S}}}});function Tg(s){const[a,l="center"]=s.split("-");return[a,l]}var ZS=wg,eC=Cg,tC=kg,rC=Pg,Rg=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),sC="VisuallyHidden",nC=f.forwardRef((s,a)=>e.jsx(Ke.span,{...s,ref:a,style:{...Rg,...s.style}}));nC.displayName=sC;var aC=[" ","Enter","ArrowUp","ArrowDown"],lC=[" ","Enter"],Sn="Select",[ko,Eo,iC]=ku(Sn),[xa]=en(Sn,[iC,bg]),Po=bg(),[oC,tn]=xa(Sn),[cC,dC]=xa(Sn),Ig=s=>{const{__scopeSelect:a,children:l,open:o,defaultOpen:c,onOpenChange:d,value:h,defaultValue:m,onValueChange:p,dir:y,name:g,autoComplete:v,disabled:C,required:P,form:T}=s,S=Po(a),[b,N]=f.useState(null),[E,j]=f.useState(null),[R,B]=f.useState(!1),U=vo(y),[k,L]=bn({prop:o,defaultProp:c??!1,onChange:d,caller:Sn}),[_,se]=bn({prop:h,defaultProp:m,onChange:p,caller:Sn}),le=f.useRef(null),ie=b?T||!!b.closest("form"):!0,[ee,G]=f.useState(new Set),Q=Array.from(ee).map(ce=>ce.props.value).join(";");return e.jsx(ZS,{...S,children:e.jsxs(oC,{required:P,scope:a,trigger:b,onTriggerChange:N,valueNode:E,onValueNodeChange:j,valueNodeHasChildren:R,onValueNodeHasChildrenChange:B,contentId:Gs(),value:_,onValueChange:se,open:k,onOpenChange:L,dir:U,triggerPointerDownPosRef:le,disabled:C,children:[e.jsx(ko.Provider,{scope:a,children:e.jsx(cC,{scope:s.__scopeSelect,onNativeOptionAdd:f.useCallback(ce=>{G(re=>new Set(re).add(ce))},[]),onNativeOptionRemove:f.useCallback(ce=>{G(re=>{const A=new Set(re);return A.delete(ce),A})},[]),children:l})}),ie?e.jsxs(Zg,{"aria-hidden":!0,required:P,tabIndex:-1,name:g,autoComplete:v,value:_,onChange:ce=>se(ce.target.value),disabled:C,form:T,children:[_===void 0?e.jsx("option",{value:""}):null,Array.from(ee)]},Q):null]})})};Ig.displayName=Sn;var _g="SelectTrigger",Mg=f.forwardRef((s,a)=>{const{__scopeSelect:l,disabled:o=!1,...c}=s,d=Po(l),h=tn(_g,l),m=h.disabled||o,p=et(a,h.onTriggerChange),y=Eo(l),g=f.useRef("touch"),[v,C,P]=t0(S=>{const b=y().filter(j=>!j.disabled),N=b.find(j=>j.value===h.value),E=r0(b,S,N);E!==void 0&&h.onValueChange(E.value)}),T=S=>{m||(h.onOpenChange(!0),P()),S&&(h.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return e.jsx(eC,{asChild:!0,...d,children:e.jsx(Ke.button,{type:"button",role:"combobox","aria-controls":h.contentId,"aria-expanded":h.open,"aria-required":h.required,"aria-autocomplete":"none",dir:h.dir,"data-state":h.open?"open":"closed",disabled:m,"data-disabled":m?"":void 0,"data-placeholder":e0(h.value)?"":void 0,...c,ref:p,onClick:Be(c.onClick,S=>{S.currentTarget.focus(),g.current!=="mouse"&&T(S)}),onPointerDown:Be(c.onPointerDown,S=>{g.current=S.pointerType;const b=S.target;b.hasPointerCapture(S.pointerId)&&b.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(T(S),S.preventDefault())}),onKeyDown:Be(c.onKeyDown,S=>{const b=v.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&C(S.key),!(b&&S.key===" ")&&aC.includes(S.key)&&(T(),S.preventDefault())})})})});Mg.displayName=_g;var Ag="SelectValue",Dg=f.forwardRef((s,a)=>{const{__scopeSelect:l,className:o,style:c,children:d,placeholder:h="",...m}=s,p=tn(Ag,l),{onValueNodeHasChildrenChange:y}=p,g=d!==void 0,v=et(a,p.onValueNodeChange);return qt(()=>{y(g)},[y,g]),e.jsx(Ke.span,{...m,ref:v,style:{pointerEvents:"none"},children:e0(p.value)?e.jsx(e.Fragment,{children:h}):d})});Dg.displayName=Ag;var uC="SelectIcon",Lg=f.forwardRef((s,a)=>{const{__scopeSelect:l,children:o,...c}=s;return e.jsx(Ke.span,{"aria-hidden":!0,...c,ref:a,children:o||"▼"})});Lg.displayName=uC;var hC="SelectPortal",Og=s=>e.jsx(yu,{asChild:!0,...s});Og.displayName=hC;var Cn="SelectContent",Fg=f.forwardRef((s,a)=>{const l=tn(Cn,s.__scopeSelect),[o,c]=f.useState();if(qt(()=>{c(new DocumentFragment)},[]),!l.open){const d=o;return d?gl.createPortal(e.jsx(zg,{scope:s.__scopeSelect,children:e.jsx(ko.Slot,{scope:s.__scopeSelect,children:e.jsx("div",{children:s.children})})}),d):null}return e.jsx($g,{...s,ref:a})});Fg.displayName=Cn;var Mr=10,[zg,rn]=xa(Cn),fC="SelectContentImpl",mC=xl("SelectContent.RemoveScroll"),$g=f.forwardRef((s,a)=>{const{__scopeSelect:l,position:o="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:d,onPointerDownOutside:h,side:m,sideOffset:p,align:y,alignOffset:g,arrowPadding:v,collisionBoundary:C,collisionPadding:P,sticky:T,hideWhenDetached:S,avoidCollisions:b,...N}=s,E=tn(Cn,l),[j,R]=f.useState(null),[B,U]=f.useState(null),k=et(a,K=>R(K)),[L,_]=f.useState(null),[se,le]=f.useState(null),ie=Eo(l),[ee,G]=f.useState(!1),Q=f.useRef(!1);f.useEffect(()=>{if(j)return yp(j)},[j]),cp();const ce=f.useCallback(K=>{const[ye,...ge]=ie().map(Se=>Se.ref.current),[D]=ge.slice(-1),fe=document.activeElement;for(const Se of K)if(Se===fe||(Se==null||Se.scrollIntoView({block:"nearest"}),Se===ye&&B&&(B.scrollTop=0),Se===D&&B&&(B.scrollTop=B.scrollHeight),Se==null||Se.focus(),document.activeElement!==fe))return},[ie,B]),re=f.useCallback(()=>ce([L,j]),[ce,L,j]);f.useEffect(()=>{ee&&re()},[ee,re]);const{onOpenChange:A,triggerPointerDownPosRef:ne}=E;f.useEffect(()=>{if(j){let K={x:0,y:0};const ye=D=>{var fe,Se;K={x:Math.abs(Math.round(D.pageX)-(((fe=ne.current)==null?void 0:fe.x)??0)),y:Math.abs(Math.round(D.pageY)-(((Se=ne.current)==null?void 0:Se.y)??0))}},ge=D=>{K.x<=10&&K.y<=10?D.preventDefault():j.contains(D.target)||A(!1),document.removeEventListener("pointermove",ye),ne.current=null};return ne.current!==null&&(document.addEventListener("pointermove",ye),document.addEventListener("pointerup",ge,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ye),document.removeEventListener("pointerup",ge,{capture:!0})}}},[j,A,ne]),f.useEffect(()=>{const K=()=>A(!1);return window.addEventListener("blur",K),window.addEventListener("resize",K),()=>{window.removeEventListener("blur",K),window.removeEventListener("resize",K)}},[A]);const[W,M]=t0(K=>{const ye=ie().filter(fe=>!fe.disabled),ge=ye.find(fe=>fe.ref.current===document.activeElement),D=r0(ye,K,ge);D&&setTimeout(()=>D.ref.current.focus())}),O=f.useCallback((K,ye,ge)=>{const D=!Q.current&&!ge;(E.value!==void 0&&E.value===ye||D)&&(_(K),D&&(Q.current=!0))},[E.value]),F=f.useCallback(()=>j==null?void 0:j.focus(),[j]),X=f.useCallback((K,ye,ge)=>{const D=!Q.current&&!ge;(E.value!==void 0&&E.value===ye||D)&&le(K)},[E.value]),H=o==="popper"?Xd:Bg,ue=H===Xd?{side:m,sideOffset:p,align:y,alignOffset:g,arrowPadding:v,collisionBoundary:C,collisionPadding:P,sticky:T,hideWhenDetached:S,avoidCollisions:b}:{};return e.jsx(zg,{scope:l,content:j,viewport:B,onViewportChange:U,itemRefCallback:O,selectedItem:L,onItemLeave:F,itemTextRefCallback:X,focusSelectedItem:re,selectedItemText:se,position:o,isPositioned:ee,searchRef:W,children:e.jsx(vu,{as:mC,allowPinchZoom:!0,children:e.jsx(gu,{asChild:!0,trapped:E.open,onMountAutoFocus:K=>{K.preventDefault()},onUnmountAutoFocus:Be(c,K=>{var ye;(ye=E.trigger)==null||ye.focus({preventScroll:!0}),K.preventDefault()}),children:e.jsx(pu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:K=>K.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:e.jsx(H,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:K=>K.preventDefault(),...N,...ue,onPlaced:()=>G(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:Be(N.onKeyDown,K=>{const ye=K.ctrlKey||K.altKey||K.metaKey;if(K.key==="Tab"&&K.preventDefault(),!ye&&K.key.length===1&&M(K.key),["ArrowUp","ArrowDown","Home","End"].includes(K.key)){let D=ie().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);if(["ArrowUp","End"].includes(K.key)&&(D=D.slice().reverse()),["ArrowUp","ArrowDown"].includes(K.key)){const fe=K.target,Se=D.indexOf(fe);D=D.slice(Se+1)}setTimeout(()=>ce(D)),K.preventDefault()}})})})})})})});$g.displayName=fC;var xC="SelectItemAlignedPosition",Bg=f.forwardRef((s,a)=>{const{__scopeSelect:l,onPlaced:o,...c}=s,d=tn(Cn,l),h=rn(Cn,l),[m,p]=f.useState(null),[y,g]=f.useState(null),v=et(a,k=>g(k)),C=Eo(l),P=f.useRef(!1),T=f.useRef(!0),{viewport:S,selectedItem:b,selectedItemText:N,focusSelectedItem:E}=h,j=f.useCallback(()=>{if(d.trigger&&d.valueNode&&m&&y&&S&&b&&N){const k=d.trigger.getBoundingClientRect(),L=y.getBoundingClientRect(),_=d.valueNode.getBoundingClientRect(),se=N.getBoundingClientRect();if(d.dir!=="rtl"){const fe=se.left-L.left,Se=_.left-fe,ze=k.left-Se,We=k.width+ze,qe=Math.max(We,L.width),Ze=window.innerWidth-Mr,st=no(Se,[Mr,Math.max(Mr,Ze-qe)]);m.style.minWidth=We+"px",m.style.left=st+"px"}else{const fe=L.right-se.right,Se=window.innerWidth-_.right-fe,ze=window.innerWidth-k.right-Se,We=k.width+ze,qe=Math.max(We,L.width),Ze=window.innerWidth-Mr,st=no(Se,[Mr,Math.max(Mr,Ze-qe)]);m.style.minWidth=We+"px",m.style.right=st+"px"}const le=C(),ie=window.innerHeight-Mr*2,ee=S.scrollHeight,G=window.getComputedStyle(y),Q=parseInt(G.borderTopWidth,10),ce=parseInt(G.paddingTop,10),re=parseInt(G.borderBottomWidth,10),A=parseInt(G.paddingBottom,10),ne=Q+ce+ee+A+re,W=Math.min(b.offsetHeight*5,ne),M=window.getComputedStyle(S),O=parseInt(M.paddingTop,10),F=parseInt(M.paddingBottom,10),X=k.top+k.height/2-Mr,H=ie-X,ue=b.offsetHeight/2,K=b.offsetTop+ue,ye=Q+ce+K,ge=ne-ye;if(ye<=X){const fe=le.length>0&&b===le[le.length-1].ref.current;m.style.bottom="0px";const Se=y.clientHeight-S.offsetTop-S.offsetHeight,ze=Math.max(H,ue+(fe?F:0)+Se+re),We=ye+ze;m.style.height=We+"px"}else{const fe=le.length>0&&b===le[0].ref.current;m.style.top="0px";const ze=Math.max(X,Q+S.offsetTop+(fe?O:0)+ue)+ge;m.style.height=ze+"px",S.scrollTop=ye-X+S.offsetTop}m.style.margin=`${Mr}px 0`,m.style.minHeight=W+"px",m.style.maxHeight=ie+"px",o==null||o(),requestAnimationFrame(()=>P.current=!0)}},[C,d.trigger,d.valueNode,m,y,S,b,N,d.dir,o]);qt(()=>j(),[j]);const[R,B]=f.useState();qt(()=>{y&&B(window.getComputedStyle(y).zIndex)},[y]);const U=f.useCallback(k=>{k&&T.current===!0&&(j(),E==null||E(),T.current=!1)},[j,E]);return e.jsx(gC,{scope:l,contentWrapper:m,shouldExpandOnScrollRef:P,onScrollButtonChange:U,children:e.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:e.jsx(Ke.div,{...c,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});Bg.displayName=xC;var pC="SelectPopperPosition",Xd=f.forwardRef((s,a)=>{const{__scopeSelect:l,align:o="start",collisionPadding:c=Mr,...d}=s,h=Po(l);return e.jsx(tC,{...h,...d,ref:a,align:o,collisionPadding:c,style:{boxSizing:"border-box",...d.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Xd.displayName=pC;var[gC,Lu]=xa(Cn,{}),Jd="SelectViewport",Ug=f.forwardRef((s,a)=>{const{__scopeSelect:l,nonce:o,...c}=s,d=rn(Jd,l),h=Lu(Jd,l),m=et(a,d.onViewportChange),p=f.useRef(0);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),e.jsx(ko.Slot,{scope:l,children:e.jsx(Ke.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:m,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:Be(c.onScroll,y=>{const g=y.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:C}=h;if(C!=null&&C.current&&v){const P=Math.abs(p.current-g.scrollTop);if(P>0){const T=window.innerHeight-Mr*2,S=parseFloat(v.style.minHeight),b=parseFloat(v.style.height),N=Math.max(S,b);if(N<T){const E=N+P,j=Math.min(T,E),R=E-j;v.style.height=j+"px",v.style.bottom==="0px"&&(g.scrollTop=R>0?R:0,v.style.justifyContent="flex-end")}}}p.current=g.scrollTop})})})]})});Ug.displayName=Jd;var Vg="SelectGroup",[yC,vC]=xa(Vg),jC=f.forwardRef((s,a)=>{const{__scopeSelect:l,...o}=s,c=Gs();return e.jsx(yC,{scope:l,id:c,children:e.jsx(Ke.div,{role:"group","aria-labelledby":c,...o,ref:a})})});jC.displayName=Vg;var Wg="SelectLabel",bC=f.forwardRef((s,a)=>{const{__scopeSelect:l,...o}=s,c=vC(Wg,l);return e.jsx(Ke.div,{id:c.id,...o,ref:a})});bC.displayName=Wg;var co="SelectItem",[NC,Hg]=xa(co),Kg=f.forwardRef((s,a)=>{const{__scopeSelect:l,value:o,disabled:c=!1,textValue:d,...h}=s,m=tn(co,l),p=rn(co,l),y=m.value===o,[g,v]=f.useState(d??""),[C,P]=f.useState(!1),T=et(a,E=>{var j;return(j=p.itemRefCallback)==null?void 0:j.call(p,E,o,c)}),S=Gs(),b=f.useRef("touch"),N=()=>{c||(m.onValueChange(o),m.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return e.jsx(NC,{scope:l,value:o,disabled:c,textId:S,isSelected:y,onItemTextChange:f.useCallback(E=>{v(j=>j||((E==null?void 0:E.textContent)??"").trim())},[]),children:e.jsx(ko.ItemSlot,{scope:l,value:o,disabled:c,textValue:g,children:e.jsx(Ke.div,{role:"option","aria-labelledby":S,"data-highlighted":C?"":void 0,"aria-selected":y&&C,"data-state":y?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...h,ref:T,onFocus:Be(h.onFocus,()=>P(!0)),onBlur:Be(h.onBlur,()=>P(!1)),onClick:Be(h.onClick,()=>{b.current!=="mouse"&&N()}),onPointerUp:Be(h.onPointerUp,()=>{b.current==="mouse"&&N()}),onPointerDown:Be(h.onPointerDown,E=>{b.current=E.pointerType}),onPointerMove:Be(h.onPointerMove,E=>{var j;b.current=E.pointerType,c?(j=p.onItemLeave)==null||j.call(p):b.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Be(h.onPointerLeave,E=>{var j;E.currentTarget===document.activeElement&&((j=p.onItemLeave)==null||j.call(p))}),onKeyDown:Be(h.onKeyDown,E=>{var R;((R=p.searchRef)==null?void 0:R.current)!==""&&E.key===" "||(lC.includes(E.key)&&N(),E.key===" "&&E.preventDefault())})})})})});Kg.displayName=co;var cl="SelectItemText",Yg=f.forwardRef((s,a)=>{const{__scopeSelect:l,className:o,style:c,...d}=s,h=tn(cl,l),m=rn(cl,l),p=Hg(cl,l),y=dC(cl,l),[g,v]=f.useState(null),C=et(a,N=>v(N),p.onItemTextChange,N=>{var E;return(E=m.itemTextRefCallback)==null?void 0:E.call(m,N,p.value,p.disabled)}),P=g==null?void 0:g.textContent,T=f.useMemo(()=>e.jsx("option",{value:p.value,disabled:p.disabled,children:P},p.value),[p.disabled,p.value,P]),{onNativeOptionAdd:S,onNativeOptionRemove:b}=y;return qt(()=>(S(T),()=>b(T)),[S,b,T]),e.jsxs(e.Fragment,{children:[e.jsx(Ke.span,{id:p.textId,...d,ref:C}),p.isSelected&&h.valueNode&&!h.valueNodeHasChildren?gl.createPortal(d.children,h.valueNode):null]})});Yg.displayName=cl;var Gg="SelectItemIndicator",Qg=f.forwardRef((s,a)=>{const{__scopeSelect:l,...o}=s;return Hg(Gg,l).isSelected?e.jsx(Ke.span,{"aria-hidden":!0,...o,ref:a}):null});Qg.displayName=Gg;var Zd="SelectScrollUpButton",qg=f.forwardRef((s,a)=>{const l=rn(Zd,s.__scopeSelect),o=Lu(Zd,s.__scopeSelect),[c,d]=f.useState(!1),h=et(a,o.onScrollButtonChange);return qt(()=>{if(l.viewport&&l.isPositioned){let m=function(){const y=p.scrollTop>0;d(y)};const p=l.viewport;return m(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[l.viewport,l.isPositioned]),c?e.jsx(Jg,{...s,ref:h,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=l;m&&p&&(m.scrollTop=m.scrollTop-p.offsetHeight)}}):null});qg.displayName=Zd;var eu="SelectScrollDownButton",Xg=f.forwardRef((s,a)=>{const l=rn(eu,s.__scopeSelect),o=Lu(eu,s.__scopeSelect),[c,d]=f.useState(!1),h=et(a,o.onScrollButtonChange);return qt(()=>{if(l.viewport&&l.isPositioned){let m=function(){const y=p.scrollHeight-p.clientHeight,g=Math.ceil(p.scrollTop)<y;d(g)};const p=l.viewport;return m(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[l.viewport,l.isPositioned]),c?e.jsx(Jg,{...s,ref:h,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=l;m&&p&&(m.scrollTop=m.scrollTop+p.offsetHeight)}}):null});Xg.displayName=eu;var Jg=f.forwardRef((s,a)=>{const{__scopeSelect:l,onAutoScroll:o,...c}=s,d=rn("SelectScrollButton",l),h=f.useRef(null),m=Eo(l),p=f.useCallback(()=>{h.current!==null&&(window.clearInterval(h.current),h.current=null)},[]);return f.useEffect(()=>()=>p(),[p]),qt(()=>{var g;const y=m().find(v=>v.ref.current===document.activeElement);(g=y==null?void 0:y.ref.current)==null||g.scrollIntoView({block:"nearest"})},[m]),e.jsx(Ke.div,{"aria-hidden":!0,...c,ref:a,style:{flexShrink:0,...c.style},onPointerDown:Be(c.onPointerDown,()=>{h.current===null&&(h.current=window.setInterval(o,50))}),onPointerMove:Be(c.onPointerMove,()=>{var y;(y=d.onItemLeave)==null||y.call(d),h.current===null&&(h.current=window.setInterval(o,50))}),onPointerLeave:Be(c.onPointerLeave,()=>{p()})})}),wC="SelectSeparator",SC=f.forwardRef((s,a)=>{const{__scopeSelect:l,...o}=s;return e.jsx(Ke.div,{"aria-hidden":!0,...o,ref:a})});SC.displayName=wC;var tu="SelectArrow",CC=f.forwardRef((s,a)=>{const{__scopeSelect:l,...o}=s,c=Po(l),d=tn(tu,l),h=rn(tu,l);return d.open&&h.position==="popper"?e.jsx(rC,{...c,...o,ref:a}):null});CC.displayName=tu;var kC="SelectBubbleInput",Zg=f.forwardRef(({__scopeSelect:s,value:a,...l},o)=>{const c=f.useRef(null),d=et(o,c),h=Su(a);return f.useEffect(()=>{const m=c.current;if(!m)return;const p=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(p,"value").set;if(h!==a&&g){const v=new Event("change",{bubbles:!0});g.call(m,a),m.dispatchEvent(v)}},[h,a]),e.jsx(Ke.select,{...l,style:{...Rg,...l.style},ref:d,defaultValue:a})});Zg.displayName=kC;function e0(s){return s===""||s===void 0}function t0(s){const a=Qs(s),l=f.useRef(""),o=f.useRef(0),c=f.useCallback(h=>{const m=l.current+h;a(m),(function p(y){l.current=y,window.clearTimeout(o.current),y!==""&&(o.current=window.setTimeout(()=>p(""),1e3))})(m)},[a]),d=f.useCallback(()=>{l.current="",window.clearTimeout(o.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(o.current),[]),[l,c,d]}function r0(s,a,l){const c=a.length>1&&Array.from(a).every(y=>y===a[0])?a[0]:a,d=l?s.indexOf(l):-1;let h=EC(s,Math.max(d,0));c.length===1&&(h=h.filter(y=>y!==l));const p=h.find(y=>y.textValue.toLowerCase().startsWith(c.toLowerCase()));return p!==l?p:void 0}function EC(s,a){return s.map((l,o)=>s[(a+o)%s.length])}var PC=Ig,s0=Mg,TC=Dg,RC=Lg,IC=Og,n0=Fg,_C=Ug,a0=Kg,MC=Yg,AC=Qg,DC=qg,LC=Xg;const il=PC,ol=TC,ea=f.forwardRef(({className:s,children:a,...l},o)=>e.jsxs(s0,{ref:o,className:tt("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),...l,children:[a,e.jsx(RC,{asChild:!0,children:e.jsx(ml,{className:"h-4 w-4 opacity-50"})})]}));ea.displayName=s0.displayName;const ta=f.forwardRef(({className:s,children:a,position:l="popper",...o},c)=>e.jsx(IC,{children:e.jsxs(n0,{ref:c,className:tt("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",l==="popper"&&"data-[side=bottom]:translate-y-1",s),position:l,...o,children:[e.jsx(DC,{className:"flex cursor-default items-center justify-center py-1",children:e.jsx(Ax,{className:"h-4 w-4"})}),e.jsx(_C,{className:"p-1",children:a}),e.jsx(LC,{className:"flex cursor-default items-center justify-center py-1",children:e.jsx(ml,{className:"h-4 w-4"})})]})}));ta.displayName=n0.displayName;const Hr=f.forwardRef(({className:s,children:a,...l},o)=>e.jsxs(a0,{ref:o,className:tt("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...l,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(AC,{children:e.jsx(fo,{className:"h-4 w-4"})})}),e.jsx(MC,{children:a})]}));Hr.displayName=a0.displayName;const OC=["一","二","三","四","五","六","七","八","九","十"];function Ad(s){return s.startsWith("part:")?{type:"part",id:s.slice(5)}:s.startsWith("chapter:")?{type:"chapter",id:s.slice(8)}:s.startsWith("section:")?{type:"section",id:s.slice(8)}:null}function FC({parts:s,expandedParts:a,onTogglePart:l,onReorder:o,onReadSection:c,onDeleteSection:d,onAddSectionInPart:h,onAddChapterInPart:m,onDeleteChapter:p,onEditPart:y,onDeletePart:g,onEditChapter:v,selectedSectionIds:C=[],onToggleSectionSelect:P,onShowSectionOrders:T}){const[S,b]=f.useState(null),[N,E]=f.useState(null),j=(_,se)=>(S==null?void 0:S.type)===_&&(S==null?void 0:S.id)===se,R=(_,se)=>(N==null?void 0:N.type)===_&&(N==null?void 0:N.id)===se,B=f.useCallback(()=>{const _=[];for(const se of s)for(const le of se.chapters)for(const ie of le.sections)_.push({id:ie.id,partId:se.id,partTitle:se.title,chapterId:le.id,chapterTitle:le.title});return _},[s]),U=f.useCallback(async(_,se,le,ie)=>{var re;_.preventDefault(),_.stopPropagation();const ee=_.dataTransfer.getData("text/plain"),G=Ad(ee);if(!G||G.type===se&&G.id===le)return;const Q=B(),ce=new Map(Q.map(A=>[A.id,A]));if(G.type==="part"&&se==="part"){const A=s.map(F=>F.id),ne=A.indexOf(G.id),W=A.indexOf(le);if(ne===-1||W===-1)return;const M=[...A];M.splice(ne,1),M.splice(ne<W?W-1:W,0,G.id);const O=[];for(const F of M){const X=s.find(H=>H.id===F);if(X)for(const H of X.chapters)for(const ue of H.sections){const K=ce.get(ue.id);K&&O.push(K)}}await o(O);return}if(G.type==="chapter"&&(se==="chapter"||se==="section"||se==="part")){const A=s.find(K=>K.chapters.some(ye=>ye.id===G.id)),ne=A==null?void 0:A.chapters.find(K=>K.id===G.id);if(!A||!ne)return;let W,M,O=null;if(se==="section"){const K=ce.get(le);if(!K)return;W=K.partId,M=K.partTitle,O=le}else if(se==="chapter"){const K=s.find(D=>D.chapters.some(fe=>fe.id===le)),ye=K==null?void 0:K.chapters.find(D=>D.id===le);if(!K||!ye)return;W=K.id,M=K.title;const ge=Q.filter(D=>D.chapterId===le).pop();O=(ge==null?void 0:ge.id)??null}else{const K=s.find(ge=>ge.id===le);if(!K||!K.chapters[0])return;W=K.id,M=K.title;const ye=Q.filter(ge=>ge.partId===K.id&&ge.chapterId===K.chapters[0].id);O=((re=ye[ye.length-1])==null?void 0:re.id)??null}const F=ne.sections.map(K=>K.id),X=Q.filter(K=>!F.includes(K.id));let H=X.length;if(O){const K=X.findIndex(ye=>ye.id===O);K>=0&&(H=K+1)}const ue=F.map(K=>({...ce.get(K),partId:W,partTitle:M,chapterId:ne.id,chapterTitle:ne.title}));await o([...X.slice(0,H),...ue,...X.slice(H)]);return}if(G.type==="section"&&(se==="section"||se==="chapter"||se==="part")){if(!ie)return;const{partId:A,partTitle:ne,chapterId:W,chapterTitle:M}=ie;let O;if(se==="section")O=Q.findIndex(ye=>ye.id===le);else if(se==="chapter"){const ye=Q.filter(ge=>ge.chapterId===le).pop();O=ye?Q.findIndex(ge=>ge.id===ye.id)+1:Q.length}else{const ye=s.find(fe=>fe.id===le);if(!(ye!=null&&ye.chapters[0]))return;const ge=Q.filter(fe=>fe.partId===ye.id&&fe.chapterId===ye.chapters[0].id),D=ge[ge.length-1];O=D?Q.findIndex(fe=>fe.id===D.id)+1:0}const F=Q.findIndex(ye=>ye.id===G.id);if(F===-1)return;const X=Q.filter(ye=>ye.id!==G.id),H=F<O?O-1:O,K={...Q[F],partId:A,partTitle:ne,chapterId:W,chapterTitle:M};X.splice(H,0,K),await o(X)}},[s,B,o]),k=(_,se,le)=>({onDragEnter:ie=>{ie.preventDefault(),ie.stopPropagation(),ie.dataTransfer.dropEffect="move",E({type:_,id:se})},onDragOver:ie=>{ie.preventDefault(),ie.stopPropagation(),ie.dataTransfer.dropEffect="move",E({type:_,id:se})},onDragLeave:()=>E(null),onDrop:ie=>{E(null);const ee=Ad(ie.dataTransfer.getData("text/plain"));if(ee&&!(_==="section"&&ee.type==="section"&&ee.id===se))if(_==="part")if(ee.type==="part")U(ie,"part",se);else{const G=s.find(ce=>ce.id===se);(G==null?void 0:G.chapters[0])&&le&&U(ie,"part",se,le)}else _==="chapter"&&le?(ee.type==="section"||ee.type==="chapter")&&U(ie,"chapter",se,le):_==="section"&&le&&U(ie,"section",se,le)}}),L=_=>OC[_]??String(_+1);return e.jsx("div",{className:"space-y-3",children:s.map((_,se)=>{var ne,W,M,O;const le=_.title==="序言"||_.title.includes("序言"),ie=_.title==="尾声"||_.title.includes("尾声"),ee=_.title==="附录"||_.title.includes("附录"),G=R("part",_.id),Q=a.includes(_.id),ce=_.chapters.length,re=_.chapters.reduce((F,X)=>F+X.sections.length,0);if(le&&_.chapters.length===1&&_.chapters[0].sections.length===1){const F=_.chapters[0].sections[0],X=R("section",F.id),H={partId:_.id,partTitle:_.title,chapterId:_.chapters[0].id,chapterTitle:_.chapters[0].title};return e.jsxs("div",{draggable:!0,onDragStart:ue=>{ue.stopPropagation(),ue.dataTransfer.setData("text/plain","section:"+F.id),ue.dataTransfer.effectAllowed="move",b({type:"section",id:F.id})},onDragEnd:()=>{b(null),E(null)},className:`rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between hover:border-[#38bdac]/30 transition-colors cursor-grab active:cursor-grabbing select-none min-h-[40px] ${X?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",F.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...k("section",F.id,H),children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[e.jsx(is,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:ue=>ue.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(F.id),onChange:()=>P(F.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gray-600/50 flex items-center justify-center shrink-0",children:e.jsx(us,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[_.chapters[0].title," | ",F.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:ue=>ue.stopPropagation(),onClick:ue=>ue.stopPropagation(),children:[F.price===0||F.isFree?e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):e.jsxs("span",{className:"text-xs text-gray-500",children:["¥",F.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",F.clickCount??0," · 付款 ",F.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(F.hotScore??0).toFixed(1)," · 第",F.hotRank&&F.hotRank>0?F.hotRank:"-","名"]}),T&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(F),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(F),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(ds,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(F),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(F),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]}),e.jsx(Vs,{className:"w-4 h-4 text-gray-500"})]})]},_.id)}if(_.title==="2026每日派对干货"||_.title.includes("2026每日派对干货")){const F=R("part",_.id);return e.jsxs("div",{className:`rounded-xl border overflow-hidden transition-all duration-200 ${F?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50 bg-[#1C1C1E]"}`,...k("part",_.id,{partId:_.id,partTitle:_.title,chapterId:((ne=_.chapters[0])==null?void 0:ne.id)??"",chapterTitle:((W=_.chapters[0])==null?void 0:W.title)??""}),children:[e.jsxs("div",{draggable:!0,onDragStart:X=>{X.stopPropagation(),X.dataTransfer.setData("text/plain","part:"+_.id),X.dataTransfer.effectAllowed="move",b({type:"part",id:_.id})},onDragEnd:()=>{b(null),E(null)},className:`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${j("part",_.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":"hover:bg-[#162840]/50"}`,onClick:()=>l(_.id),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(is,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),e.jsx("div",{className:"w-10 h-10 rounded-xl bg-[#38bdac]/80 flex items-center justify-center text-white font-bold shrink-0",children:"派"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-white text-base",children:_.title}),e.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["共 ",re," 节"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:X=>X.stopPropagation(),onClick:X=>X.stopPropagation(),children:[h&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>h(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:e.jsx(At,{className:"w-3.5 h-3.5"})}),y&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>y(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"编辑篇名",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),g&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>g(_),className:"text-gray-500 hover:text-red-400 h-7 px-2",title:"删除本篇",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})}),e.jsxs("span",{className:"text-xs text-gray-500",children:[ce,"章"]}),Q?e.jsx(ml,{className:"w-5 h-5 text-gray-500"}):e.jsx(Vs,{className:"w-5 h-5 text-gray-500"})]})]}),Q&&_.chapters.length>0&&e.jsx("div",{className:"border-t border-gray-700/50 pl-4 pr-4 pb-4 pt-3 space-y-4",children:_.chapters.map(X=>e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsx("p",{className:"text-xs text-gray-500 pb-1 flex-1",children:X.title}),e.jsxs("div",{className:"flex gap-0.5 shrink-0",onClick:H=>H.stopPropagation(),children:[v&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>v(_,X),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"编辑章节名称",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),m&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>m(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"新增第X章",children:e.jsx(At,{className:"w-3.5 h-3.5"})}),p&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>p(_,X),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",title:"删除本章",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{className:"space-y-1 pl-2",children:X.sections.map(H=>{const ue=R("section",H.id);return e.jsxs("div",{draggable:!0,onDragStart:K=>{K.stopPropagation(),K.dataTransfer.setData("text/plain","section:"+H.id),K.dataTransfer.effectAllowed="move",b({type:"section",id:H.id})},onDragEnd:()=>{b(null),E(null)},className:`flex items-center justify-between py-2 px-3 rounded-lg min-h-[40px] cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${ue?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${j("section",H.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...k("section",H.id,{partId:_.id,partTitle:_.title,chapterId:X.id,chapterTitle:X.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(is,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:K=>K.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(H.id),onChange:()=>P(H.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsxs("span",{className:"text-sm text-gray-200 truncate",children:[H.id," ",H.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",H.clickCount??0," · 付款 ",H.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(H.hotScore??0).toFixed(1)," · 第",H.hotRank&&H.hotRank>0?H.hotRank:"-","名"]}),T&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>T(H),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(H),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(ds,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(H),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(H),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]})]},H.id)})})]},X.id))})]},_.id)}if(ee)return e.jsxs("div",{className:"rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-5",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-4",children:"附录"}),e.jsx("div",{className:"space-y-3",children:_.chapters.map((F,X)=>F.sections.length>0?F.sections.map(H=>{const ue=R("section",H.id);return e.jsxs("div",{draggable:!0,onDragStart:K=>{K.stopPropagation(),K.dataTransfer.setData("text/plain","section:"+H.id),K.dataTransfer.effectAllowed="move",b({type:"section",id:H.id})},onDragEnd:()=>{b(null),E(null)},className:`flex justify-between items-center py-2 select-none rounded px-2 -mx-2 group cursor-grab active:cursor-grabbing min-h-[40px] transition-all duration-200 ${ue?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${j("section",H.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...k("section",H.id,{partId:_.id,partTitle:_.title,chapterId:F.id,chapterTitle:F.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(is,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:K=>K.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(H.id),onChange:()=>P(H.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsxs("span",{className:"text-sm text-gray-300 truncate",children:["附录",X+1," | ",F.title," | ",H.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",H.clickCount??0," · 付款 ",H.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(H.hotScore??0).toFixed(1)," · 第",H.hotRank&&H.hotRank>0?H.hotRank:"-","名"]}),T&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>T(H),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>c(H),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(ds,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>c(H),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>d(H),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]})]}),e.jsx(Vs,{className:"w-4 h-4 text-gray-500 shrink-0"})]},H.id)}):e.jsxs("div",{className:"flex justify-between items-center py-2 select-none hover:bg-[#162840]/50 rounded px-2 -mx-2",children:[e.jsxs("span",{className:"text-sm text-gray-500",children:["附录",X+1," | ",F.title,"(空)"]}),e.jsx(Vs,{className:"w-4 h-4 text-gray-500 shrink-0"})]},F.id))})]},_.id);if(ie&&_.chapters.length===1&&_.chapters[0].sections.length===1){const F=_.chapters[0].sections[0],X=R("section",F.id),H={partId:_.id,partTitle:_.title,chapterId:_.chapters[0].id,chapterTitle:_.chapters[0].title};return e.jsxs("div",{draggable:!0,onDragStart:ue=>{ue.stopPropagation(),ue.dataTransfer.setData("text/plain","section:"+F.id),ue.dataTransfer.effectAllowed="move",b({type:"section",id:F.id})},onDragEnd:()=>{b(null),E(null)},className:`rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between hover:border-[#38bdac]/30 transition-colors cursor-grab active:cursor-grabbing select-none min-h-[40px] ${X?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",F.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...k("section",F.id,H),children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[e.jsx(is,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:ue=>ue.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(F.id),onChange:()=>P(F.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gray-600/50 flex items-center justify-center shrink-0",children:e.jsx(us,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[_.chapters[0].title," | ",F.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:ue=>ue.stopPropagation(),onClick:ue=>ue.stopPropagation(),children:[F.price===0||F.isFree?e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):e.jsxs("span",{className:"text-xs text-gray-500",children:["¥",F.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",F.clickCount??0," · 付款 ",F.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(F.hotScore??0).toFixed(1)," · 第",F.hotRank&&F.hotRank>0?F.hotRank:"-","名"]}),T&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(F),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(F),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(ds,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(F),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(F),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]}),e.jsx(Vs,{className:"w-4 h-4 text-gray-500"})]})]},_.id)}return ie?e.jsxs("div",{className:"rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-5",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-4",children:"尾声"}),e.jsx("div",{className:"space-y-3",children:_.chapters.map(F=>F.sections.map(X=>{const H=R("section",X.id);return e.jsxs("div",{draggable:!0,onDragStart:ue=>{ue.stopPropagation(),ue.dataTransfer.setData("text/plain","section:"+X.id),ue.dataTransfer.effectAllowed="move",b({type:"section",id:X.id})},onDragEnd:()=>{b(null),E(null)},className:`flex justify-between items-center py-2 select-none rounded px-2 -mx-2 cursor-grab active:cursor-grabbing min-h-[40px] transition-all duration-200 ${H?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${j("section",X.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...k("section",X.id,{partId:_.id,partTitle:_.title,chapterId:F.id,chapterTitle:F.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(is,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:ue=>ue.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(X.id),onChange:()=>P(X.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsxs("span",{className:"text-sm text-gray-300",children:[F.title," | ",X.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",X.clickCount??0," · 付款 ",X.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(X.hotScore??0).toFixed(1)," · 第",X.hotRank&&X.hotRank>0?X.hotRank:"-","名"]}),T&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(X),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(X),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(ds,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(X),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(X),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]})]})]},X.id)}))})]},_.id):e.jsxs("div",{className:`rounded-xl border bg-[#1C1C1E] overflow-hidden transition-all duration-200 ${G?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50"}`,...k("part",_.id,{partId:_.id,partTitle:_.title,chapterId:((M=_.chapters[0])==null?void 0:M.id)??"",chapterTitle:((O=_.chapters[0])==null?void 0:O.title)??""}),children:[e.jsxs("div",{draggable:!0,onDragStart:F=>{F.stopPropagation(),F.dataTransfer.setData("text/plain","part:"+_.id),F.dataTransfer.effectAllowed="move",b({type:"part",id:_.id})},onDragEnd:()=>{b(null),E(null)},className:`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${j("part",_.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] rounded-xl shadow-xl shadow-[#38bdac]/20":"hover:bg-[#162840]/50"}`,onClick:()=>l(_.id),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(is,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),e.jsx("div",{className:"w-10 h-10 rounded-xl bg-[#38bdac] flex items-center justify-center text-white font-bold shadow-lg shadow-[#38bdac]/30 shrink-0",children:L(se)}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-white text-base",children:_.title}),e.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["共 ",re," 节"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:F=>F.stopPropagation(),onClick:F=>F.stopPropagation(),children:[h&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>h(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:e.jsx(At,{className:"w-3.5 h-3.5"})}),y&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>y(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"编辑篇名",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),g&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>g(_),className:"text-gray-500 hover:text-red-400 h-7 px-2",title:"删除本篇",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})}),e.jsxs("span",{className:"text-xs text-gray-500",children:[ce,"章"]}),Q?e.jsx(ml,{className:"w-5 h-5 text-gray-500"}):e.jsx(Vs,{className:"w-5 h-5 text-gray-500"})]})]}),Q&&e.jsx("div",{className:"border-t border-gray-700/50 pl-4 pr-4 pb-4 pt-3 space-y-4",children:_.chapters.map(F=>{const X=R("chapter",F.id);return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsxs("div",{draggable:!0,onDragStart:H=>{H.stopPropagation(),H.dataTransfer.setData("text/plain","chapter:"+F.id),H.dataTransfer.effectAllowed="move",b({type:"chapter",id:F.id})},onDragEnd:()=>{b(null),E(null)},onDragEnter:H=>{H.preventDefault(),H.stopPropagation(),H.dataTransfer.dropEffect="move",E({type:"chapter",id:F.id})},onDragOver:H=>{H.preventDefault(),H.stopPropagation(),H.dataTransfer.dropEffect="move",E({type:"chapter",id:F.id})},onDragLeave:()=>E(null),onDrop:H=>{E(null);const ue=Ad(H.dataTransfer.getData("text/plain"));if(!ue)return;const K={partId:_.id,partTitle:_.title,chapterId:F.id,chapterTitle:F.title};(ue.type==="section"||ue.type==="chapter")&&U(H,"chapter",F.id,K)},className:`flex-1 min-w-0 py-2 px-2 rounded cursor-grab active:cursor-grabbing select-none -mx-2 transition-all duration-200 flex items-center gap-2 ${X?"bg-[#38bdac]/15 ring-1 ring-[#38bdac]/50":""} ${j("chapter",F.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":"hover:bg-[#162840]/30"}`,children:[e.jsx(is,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),e.jsx("p",{className:"text-xs text-gray-500 pb-1 flex-1",children:F.title})]}),e.jsxs("div",{className:"flex gap-0.5 shrink-0",onClick:H=>H.stopPropagation(),children:[v&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>v(_,F),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"编辑章节名称",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),m&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>m(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"新增第X章",children:e.jsx(At,{className:"w-3.5 h-3.5"})}),p&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>p(_,F),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",title:"删除本章",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{className:"space-y-1 pl-2",children:F.sections.map(H=>{const ue=R("section",H.id);return e.jsxs("div",{draggable:!0,onDragStart:K=>{K.stopPropagation(),K.dataTransfer.setData("text/plain","section:"+H.id),K.dataTransfer.effectAllowed="move",b({type:"section",id:H.id})},onDragEnd:()=>{b(null),E(null)},className:`flex items-center justify-between py-2 px-3 rounded-lg group cursor-grab active:cursor-grabbing select-none min-h-[40px] transition-all duration-200 ${ue?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",H.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] shadow-lg":"hover:bg-[#162840]/50"}`,...k("section",H.id,{partId:_.id,partTitle:_.title,chapterId:F.id,chapterTitle:F.title}),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:K=>K.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(H.id),onChange:()=>P(H.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx(is,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),e.jsx("div",{className:`w-2 h-2 rounded-full shrink-0 ${H.price===0||H.isFree?"border-2 border-[#38bdac] bg-transparent":"bg-gray-500"}`}),e.jsxs("span",{className:"text-sm text-gray-200 truncate",children:[H.id," ",H.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:K=>K.stopPropagation(),onClick:K=>K.stopPropagation(),children:[H.isNew&&e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"NEW"}),H.price===0||H.isFree?e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):e.jsxs("span",{className:"text-xs text-gray-500",children:["¥",H.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",title:"点击次数 · 付款笔数",children:["点击 ",H.clickCount??0," · 付款 ",H.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(H.hotScore??0).toFixed(1)," · 第",H.hotRank&&H.hotRank>0?H.hotRank:"-","名"]}),T&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>T(H),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5 shrink-0",children:"付款记录"}),e.jsxs("div",{className:"flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(H),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(ds,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(H),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(H),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]}),e.jsx(Vs,{className:"w-4 h-4 text-gray-500"})]})]},H.id)})})]},F.id)})})]},_.id)})})}function zC(s){const a=new Map;for(const m of s){const p=m.partId||"part-1",y=m.partTitle||"未分类",g=m.chapterId||"chapter-1",v=m.chapterTitle||"未分类";a.has(p)||a.set(p,{id:p,title:y,chapters:new Map});const C=a.get(p);C.chapters.has(g)||C.chapters.set(g,{id:g,title:v,sections:[]}),C.chapters.get(g).sections.push({id:m.id,title:m.title,price:m.price??1,filePath:m.filePath,isFree:m.isFree,isNew:m.isNew,clickCount:m.clickCount??0,payCount:m.payCount??0,hotScore:m.hotScore??0,hotRank:m.hotRank??0})}const l="part-2026-daily",o="2026每日派对干货";Array.from(a.values()).some(m=>m.title===o||m.title.includes(o))||a.set(l,{id:l,title:o,chapters:new Map([["chapter-2026-daily",{id:"chapter-2026-daily",title:o,sections:[]}]])});const d=Array.from(a.values()).map(m=>({...m,chapters:Array.from(m.chapters.values())})),h=m=>m.includes("序言")?0:m.includes(o)?1.5:m.includes("附录")?2:m.includes("尾声")?3:1;return d.sort((m,p)=>{const y=h(m.title),g=h(p.title);return y!==g?y-g:0})}function $C(){var js,Pl,bs;const[s,a]=f.useState([]),[l,o]=f.useState(!0),[c,d]=f.useState([]),[h,m]=f.useState(null),[p,y]=f.useState(!1),[g,v]=f.useState(!1),[C,P]=f.useState(!1),[T,S]=f.useState(""),[b,N]=f.useState([]),[E,j]=f.useState(!1),[R,B]=f.useState(!1),U=f.useRef(null),[k,L]=f.useState({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),[_,se]=f.useState(null),[le,ie]=f.useState(!1),[ee,G]=f.useState(!1),[Q,ce]=f.useState(null),[re,A]=f.useState(!1),[ne,W]=f.useState([]),[M,O]=f.useState(!1),[F,X]=f.useState(""),[H,ue]=f.useState(""),[K,ye]=f.useState(!1),[ge,D]=f.useState(""),[fe,Se]=f.useState(!1),[ze,We]=f.useState(null),[qe,Ze]=f.useState(!1),[st,ft]=f.useState(!1),[nt,Vt]=f.useState({readWeight:.5,recencyWeight:.3,payWeight:.2}),[Fr,Xr]=f.useState(!1),[xs,ps]=f.useState(!1),$t=zC(s),gs=s.length,oe=async()=>{o(!0);try{const z=await Fe("/api/db/book?action=list",{cache:"no-store"});a(Array.isArray(z==null?void 0:z.sections)?z.sections:[])}catch(z){console.error(z),a([])}finally{o(!1)}};f.useEffect(()=>{oe()},[]);const Qe=z=>{d(ae=>ae.includes(z)?ae.filter(be=>be!==z):[...ae,z])},Tt=f.useCallback(z=>{const ae=s,be=z.flatMap(Ee=>{const mt=ae.find(gr=>gr.id===Ee.id);return mt?[{...mt,partId:Ee.partId,partTitle:Ee.partTitle,chapterId:Ee.chapterId,chapterTitle:Ee.chapterTitle}]:[]});return a(be),Nt("/api/db/book",{action:"reorder",items:z}).then(Ee=>{Ee&&Ee.success===!1&&(a(ae),alert("排序失败: "+(Ee&&typeof Ee=="object"&&"error"in Ee?Ee.error:"未知错误")))}).catch(Ee=>{a(ae),console.error("排序失败:",Ee),alert("排序失败: "+(Ee instanceof Error?Ee.message:"网络或服务异常"))}),Promise.resolve()},[s]),dr=async z=>{if(confirm(`确定要删除章节「${z.title}」吗?此操作不可恢复。`))try{const ae=await vn(`/api/db/book?id=${encodeURIComponent(z.id)}`);ae&&ae.success!==!1?(alert("已删除"),oe()):alert("删除失败: "+(ae&&typeof ae=="object"&&"error"in ae?ae.error:"未知错误"))}catch(ae){console.error(ae),alert("删除失败")}},zr=f.useCallback(async()=>{Xr(!0);try{const z=await Fe("/api/db/config/full?key=article_ranking_weights",{cache:"no-store"}),ae=z&&z.data;ae&&typeof ae.readWeight=="number"&&typeof ae.recencyWeight=="number"&&typeof ae.payWeight=="number"&&Vt({readWeight:Math.max(0,Math.min(1,ae.readWeight)),recencyWeight:Math.max(0,Math.min(1,ae.recencyWeight)),payWeight:Math.max(0,Math.min(1,ae.payWeight))})}catch{}finally{Xr(!1)}},[]);f.useEffect(()=>{st&&zr()},[st,zr]);const Ro=async()=>{const{readWeight:z,recencyWeight:ae,payWeight:be}=nt,Ee=z+ae+be;if(Math.abs(Ee-1)>.001){alert("三个权重之和必须等于 1");return}ps(!0);try{const mt=await Et("/api/db/config",{key:"article_ranking_weights",value:{readWeight:z,recencyWeight:ae,payWeight:be},description:"文章排名算法权重"});mt&&mt.success!==!1?(alert("已保存"),oe()):alert("保存失败: "+(mt&&typeof mt=="object"&&"error"in mt?mt.error:""))}catch(mt){console.error(mt),alert("保存失败")}finally{ps(!1)}},Nl=async z=>{We({section:z,orders:[]}),Ze(!0);try{const ae=await Fe(`/api/db/book?action=section-orders&id=${encodeURIComponent(z.id)}`),be=ae!=null&&ae.success&&Array.isArray(ae.orders)?ae.orders:[];We(Ee=>Ee?{...Ee,orders:be}:null)}catch(ae){console.error(ae),We(be=>be?{...be,orders:[]}:null)}finally{Ze(!1)}},ga=async z=>{v(!0);try{const ae=await Fe(`/api/db/book?action=read&id=${encodeURIComponent(z.id)}`);if(ae!=null&&ae.success&&ae.section){const be=ae.section;m({id:z.id,title:ae.section.title??z.title,price:ae.section.price??z.price,content:ae.section.content??"",filePath:z.filePath,isFree:z.isFree||z.price===0,isNew:be.isNew??z.isNew})}else m({id:z.id,title:z.title,price:z.price,content:"",filePath:z.filePath,isFree:z.isFree,isNew:z.isNew}),ae&&!ae.success&&alert("无法读取文件内容: "+(ae.error||"未知错误"))}catch(ae){console.error(ae),m({id:z.id,title:z.title,price:z.price,content:"",filePath:z.filePath,isFree:z.isFree})}finally{v(!1)}},Io=async()=>{var z;if(h){P(!0);try{let ae=h.content||"";const be=[new RegExp(`^#+\\s*${h.id.replace(".","\\.")}\\s+.*$`,"gm"),new RegExp(`^#+\\s*${h.id.replace(".","\\.")}[:].*$`,"gm"),new RegExp(`^#\\s+.*${(z=h.title)==null?void 0:z.slice(0,10).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*$`,"gm")];for(const mt of be)ae=ae.replace(mt,"");ae=ae.replace(/^\s*\n+/,"").trim();const Ee=await Nt("/api/db/book",{id:h.id,title:h.title,price:h.isFree?0:h.price,content:ae,isFree:h.isFree||h.price===0,isNew:h.isNew,saveToFile:!0});Ee&&Ee.success!==!1?(alert(`已保存章节: ${h.title}`),m(null),oe()):alert("保存失败: "+(Ee&&typeof Ee=="object"&&"error"in Ee?Ee.error:"未知错误"))}catch(ae){console.error(ae),alert("保存失败")}finally{P(!1)}}},ya=async()=>{if(!k.id||!k.title){alert("请填写章节ID和标题");return}P(!0);try{const z=await Nt("/api/db/book",{id:k.id,title:k.title,price:k.price,content:k.content,partId:k.partId,chapterId:k.chapterId,saveToFile:!1});z&&z.success!==!1?(alert(`章节创建成功: ${k.title}`),y(!1),L({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),oe()):alert("创建失败: "+(z&&typeof z=="object"&&"error"in z?z.error:"未知错误"))}catch(z){console.error(z),alert("创建失败")}finally{P(!1)}},va=z=>{L(ae=>{var be;return{...ae,partId:z.id,chapterId:((be=z.chapters[0])==null?void 0:be.id)??"chapter-1"}}),y(!0)},ja=z=>{se({id:z.id,title:z.title})},ba=async()=>{var z;if((z=_==null?void 0:_.title)!=null&&z.trim()){ie(!0);try{const ae=s.map(Ee=>({id:Ee.id,partId:Ee.partId||"part-1",partTitle:Ee.partId===_.id?_.title.trim():Ee.partTitle||"",chapterId:Ee.chapterId||"chapter-1",chapterTitle:Ee.chapterTitle||""})),be=await Nt("/api/db/book",{action:"reorder",items:ae});be&&be.success!==!1?(se(null),oe()):alert("更新篇名失败: "+(be&&typeof be=="object"&&"error"in be?be.error:"未知错误"))}catch(ae){console.error(ae),alert("更新篇名失败")}finally{ie(!1)}}},Na=z=>{const ae=z.chapters.length+1,be=`chapter-${z.id}-${ae}-${Date.now()}`;L({id:`${ae}.1`,title:"新章节",price:1,partId:z.id,chapterId:be,content:""}),y(!0)},ys=(z,ae)=>{ce({part:z,chapter:ae,title:ae.title})},vs=async()=>{var z;if((z=Q==null?void 0:Q.title)!=null&&z.trim()){A(!0);try{const ae=s.map(Ee=>({id:Ee.id,partId:Ee.partId||Q.part.id,partTitle:Ee.partId===Q.part.id?Q.part.title:Ee.partTitle||"",chapterId:Ee.chapterId||Q.chapter.id,chapterTitle:Ee.partId===Q.part.id&&Ee.chapterId===Q.chapter.id?Q.title.trim():Ee.chapterTitle||""})),be=await Nt("/api/db/book",{action:"reorder",items:ae});be&&be.success!==!1?(ce(null),oe()):alert("保存失败: "+(be&&typeof be=="object"&&"error"in be?be.error:"未知错误"))}catch(ae){console.error(ae),alert("保存失败")}finally{A(!1)}}},wl=async(z,ae)=>{const be=ae.sections.map(Ee=>Ee.id);if(be.length===0){alert("该章下无小节,无需删除");return}if(confirm(`确定要删除「第${z.chapters.indexOf(ae)+1}章 | ${ae.title}」吗?将删除共 ${be.length} 节,此操作不可恢复。`))try{for(const Ee of be)await vn(`/api/db/book?id=${encodeURIComponent(Ee)}`);oe()}catch(Ee){console.error(Ee),alert("删除失败")}},Sl=async()=>{if(!ge.trim()){alert("请输入篇名");return}Se(!0);try{const z=`part-new-${Date.now()}`,ae="chapter-1",be=`part-placeholder-${Date.now()}`,Ee=await Nt("/api/db/book",{id:be,title:"占位节(可编辑)",price:0,content:"",partId:z,partTitle:ge.trim(),chapterId:ae,chapterTitle:"第1章 | 待编辑",saveToFile:!1});Ee&&Ee.success!==!1?(alert(`篇「${ge}」创建成功,请编辑占位节`),G(!1),D(""),oe()):alert("创建失败: "+(Ee&&typeof Ee=="object"&&"error"in Ee?Ee.error:"未知错误"))}catch(z){console.error(z),alert("创建失败")}finally{Se(!1)}},Cl=async()=>{if(ne.length===0){alert("请先勾选要移动的章节");return}const z=$t.find(be=>be.id===F),ae=z==null?void 0:z.chapters.find(be=>be.id===H);if(!z||!ae||!F||!H){alert("请选择目标篇和章");return}ye(!0);try{const be=()=>{const at=new Set(ne),Cr=s.map(Rt=>({id:Rt.id,partId:Rt.partId||"",partTitle:Rt.partTitle||"",chapterId:Rt.chapterId||"",chapterTitle:Rt.chapterTitle||""})),Tl=Cr.filter(Rt=>at.has(Rt.id)).map(Rt=>({...Rt,partId:F,partTitle:z.title||F,chapterId:H,chapterTitle:ae.title||H})),sn=Cr.filter(Rt=>!at.has(Rt.id));let En=sn.length;for(let Rt=sn.length-1;Rt>=0;Rt-=1){const Ca=sn[Rt];if(Ca.partId===F&&Ca.chapterId===H){En=Rt+1;break}}return[...sn.slice(0,En),...Tl,...sn.slice(En)]},Ee=async()=>{const at=be(),Cr=await Nt("/api/db/book",{action:"reorder",items:at});return Cr&&Cr.success!==!1?(alert(`已移动 ${ne.length} 节到「${z.title}」-「${ae.title}`),O(!1),W([]),await oe(),!0):!1},mt={action:"move-sections",sectionIds:ne,targetPartId:F,targetChapterId:H,targetPartTitle:z.title||F,targetChapterTitle:ae.title||H},gr=await Nt("/api/db/book",mt);if(gr&&gr.success!==!1)alert(`已移动 ${gr.count??ne.length} 节到「${z.title}」-「${ae.title}`),O(!1),W([]),await oe();else{const at=gr&&typeof gr=="object"&&"error"in gr?gr.error||"":"未知错误";if((at.includes("缺少 id")||at.includes("无效的 action"))&&await Ee())return;alert("移动失败: "+at)}}catch(be){console.error(be),alert("移动失败: "+(be instanceof Error?be.message:"网络或服务异常"))}finally{ye(!1)}},kl=z=>{W(ae=>ae.includes(z)?ae.filter(be=>be!==z):[...ae,z])},El=async z=>{const ae=s.filter(be=>be.partId===z.id).map(be=>be.id);if(ae.length===0){alert("该篇下暂无小节可删除");return}if(confirm(`确定要删除「${z.title}」整篇吗?将删除共 ${ae.length} 节内容,此操作不可恢复。`))try{for(const be of ae)await vn(`/api/db/book?id=${encodeURIComponent(be)}`);oe()}catch(be){console.error(be),alert("删除失败")}},wa=async z=>{var be,Ee;const ae=(be=z.target.files)==null?void 0:be[0];if(ae){B(!0);try{const mt=new FormData;mt.append("file",ae),mt.append("folder","book-images");const at=await(await fetch(la("/api/upload"),{method:"POST",body:mt,credentials:"include"})).json();if(at!=null&&at.success&&((Ee=at==null?void 0:at.data)!=null&&Ee.url)){const Cr=`![${ae.name}](${at.data.url})`;h&&m({...h,content:(h.content||"")+`
`+Cr}),alert(`图片上传成功: ${at.data.url}`)}else alert("上传失败: "+((at==null?void 0:at.error)||"未知错误"))}catch(mt){console.error(mt),alert("上传失败")}finally{B(!1),U.current&&(U.current.value="")}}},Sa=async()=>{var z;if(T.trim()){j(!0);try{const ae=await Fe(`/api/search?q=${encodeURIComponent(T)}`);ae!=null&&ae.success&&((z=ae.data)!=null&&z.results)?N(ae.data.results):(N([]),ae&&!ae.success&&alert("搜索失败: "+ae.error))}catch(ae){console.error(ae),N([]),alert("搜索失败")}finally{j(!1)}}},Jr=$t.find(z=>z.id===k.partId),kn=(Jr==null?void 0:Jr.chapters)??[];return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"内容管理"}),e.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",$t.length," 篇 · ",gs," 节内容"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(Z,{onClick:()=>ft(!0),variant:"outline",className:"border-amber-500/50 text-amber-400 hover:bg-amber-500/10 bg-transparent",children:[e.jsx(jd,{className:"w-4 h-4 mr-2"}),"排名算法"]}),e.jsxs(Z,{onClick:()=>{const z=typeof window<"u"?`${window.location.origin}/api-doc`:"";z&&window.open(z,"_blank","noopener,noreferrer")},variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Ys,{className:"w-4 h-4 mr-2"}),"API 接口"]})]})]}),e.jsx(wt,{open:p,onOpenChange:y,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(At,{className:"w-5 h-5 text-[#38bdac]"}),"新建章节"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节ID *"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 9.15",value:k.id,onChange:z=>L({...k,id:z.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"价格 (元)"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:k.price,onChange:z=>L({...k,price:Number(z.target.value)})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节标题 *"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入章节标题",value:k.title,onChange:z=>L({...k,title:z.target.value})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"所属篇"}),e.jsxs(il,{value:k.partId,onValueChange:z=>L({...k,partId:z,chapterId:"chapter-1"}),children:[e.jsx(ea,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(ol,{})}),e.jsxs(ta,{className:"bg-[#0f2137] border-gray-700",children:[$t.map(z=>e.jsx(Hr,{value:z.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:z.title},z.id)),$t.length===0&&e.jsx(Hr,{value:"part-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认篇"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"所属章"}),e.jsxs(il,{value:k.chapterId,onValueChange:z=>L({...k,chapterId:z}),children:[e.jsx(ea,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(ol,{})}),e.jsxs(ta,{className:"bg-[#0f2137] border-gray-700",children:[kn.map(z=>e.jsx(Hr,{value:z.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:z.title},z.id)),kn.length===0&&e.jsx(Hr,{value:"chapter-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认章"})]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"内容 (Markdown格式)"}),e.jsx(jn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[300px] font-mono text-sm placeholder:text-gray-500",placeholder:"输入章节内容...",value:k.content,onChange:z=>L({...k,content:z.target.value})})]})]}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",onClick:()=>y(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(Z,{onClick:ya,disabled:C||!k.id||!k.title,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:C?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"创建章节"]})})]})]})}),e.jsx(wt,{open:!!_,onOpenChange:z=>!z&&se(null),children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(yt,{className:"w-5 h-5 text-[#38bdac]"}),"编辑篇名"]})}),_&&e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"篇名"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:_.title,onChange:z=>se({..._,title:z.target.value}),placeholder:"输入篇名"})]})}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",onClick:()=>se(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(Z,{onClick:ba,disabled:le||!((js=_==null?void 0:_.title)!=null&&js.trim()),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:le?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),e.jsx(wt,{open:!!Q,onOpenChange:z=>!z&&ce(null),children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(yt,{className:"w-5 h-5 text-[#38bdac]"}),"编辑章节名称"]})}),Q&&e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节名称第8章底层结构"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:Q.title,onChange:z=>ce({...Q,title:z.target.value}),placeholder:"输入章节名称"})]})}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",onClick:()=>ce(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(Z,{onClick:vs,disabled:re||!((Pl=Q==null?void 0:Q.title)!=null&&Pl.trim()),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:re?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),e.jsx(wt,{open:M,onOpenChange:z=>{var ae;if(O(z),z&&$t.length>0){const be=$t[0];X(be.id),ue(((ae=be.chapters[0])==null?void 0:ae.id)??"")}},children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(St,{children:e.jsx(Ct,{className:"text-white",children:"批量移动至指定目录"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["已选 ",e.jsx("span",{className:"text-[#38bdac] font-medium",children:ne.length})," 节,请选择目标篇与章。"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"目标篇"}),e.jsxs(il,{value:F,onValueChange:z=>{var be;X(z);const ae=$t.find(Ee=>Ee.id===z);ue(((be=ae==null?void 0:ae.chapters[0])==null?void 0:be.id)??"")},children:[e.jsx(ea,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(ol,{placeholder:"选择篇"})}),e.jsx(ta,{className:"bg-[#0f2137] border-gray-700",children:$t.map(z=>e.jsx(Hr,{value:z.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:z.title},z.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"目标章"}),e.jsxs(il,{value:H,onValueChange:ue,children:[e.jsx(ea,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(ol,{placeholder:"选择章"})}),e.jsx(ta,{className:"bg-[#0f2137] border-gray-700",children:(((bs=$t.find(z=>z.id===F))==null?void 0:bs.chapters)??[]).map(z=>e.jsx(Hr,{value:z.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:z.title},z.id))})]})]})]}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",onClick:()=>O(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(Z,{onClick:Cl,disabled:K||ne.length===0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:K?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"移动中..."]}):"确认移动"})]})]})}),e.jsx(wt,{open:!!ze,onOpenChange:z=>!z&&We(null),children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-3xl max-h-[85vh] overflow-hidden flex flex-col",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white",children:["付款记录 — ",(ze==null?void 0:ze.section.title)??""]})}),e.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:qe?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):ze&&ze.orders.length===0?e.jsx("p",{className:"text-gray-500 text-center py-6",children:"暂无付款记录"}):ze?e.jsxs("table",{className:"w-full text-sm border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-700 text-left text-gray-400",children:[e.jsx("th",{className:"py-2 pr-2",children:"订单号"}),e.jsx("th",{className:"py-2 pr-2",children:"用户ID"}),e.jsx("th",{className:"py-2 pr-2",children:"金额"}),e.jsx("th",{className:"py-2 pr-2",children:"状态"}),e.jsx("th",{className:"py-2 pr-2",children:"支付时间"})]})}),e.jsx("tbody",{children:ze.orders.map(z=>e.jsxs("tr",{className:"border-b border-gray-700/50",children:[e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:z.orderSn??"-"}),e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:z.userId??z.openId??"-"}),e.jsxs("td",{className:"py-2 pr-2 text-gray-300",children:["¥",z.amount??0]}),e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:z.status??"-"}),e.jsx("td",{className:"py-2 pr-2 text-gray-500",children:z.payTime??z.createdAt??"-"})]},z.id??z.orderSn??""))})]}):null})]})}),e.jsx(wt,{open:st,onOpenChange:ft,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(jd,{className:"w-5 h-5 text-amber-400"}),"文章排名算法"]})}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsx("p",{className:"text-sm text-gray-400",children:"热度积分 = 阅读权重×阅读排名分 + 新度权重×新度排名分 + 付款权重×付款排名分(三权重之和须为 1"}),Fr?e.jsx("p",{className:"text-gray-500",children:"加载中..."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(te,{className:"text-gray-400 text-xs",children:"阅读权重"}),e.jsx(de,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:nt.readWeight,onChange:z=>Vt(ae=>({...ae,readWeight:Math.max(0,Math.min(1,parseFloat(z.target.value)||0))}))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(te,{className:"text-gray-400 text-xs",children:"新度权重"}),e.jsx(de,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:nt.recencyWeight,onChange:z=>Vt(ae=>({...ae,recencyWeight:Math.max(0,Math.min(1,parseFloat(z.target.value)||0))}))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(te,{className:"text-gray-400 text-xs",children:"付款权重"}),e.jsx(de,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:nt.payWeight,onChange:z=>Vt(ae=>({...ae,payWeight:Math.max(0,Math.min(1,parseFloat(z.target.value)||0))}))})]})]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["当前之和: ",(nt.readWeight+nt.recencyWeight+nt.payWeight).toFixed(1)]}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 text-xs text-gray-400",children:[e.jsx("li",{children:"阅读量前 20 名:得分 201"}),e.jsx("li",{children:"最近更新前 30 篇:得分 301"}),e.jsx("li",{children:"付款数前 20 名:得分 201"})]}),e.jsx(Z,{onClick:Ro,disabled:xs||Math.abs(nt.readWeight+nt.recencyWeight+nt.payWeight-1)>.001,className:"w-full bg-amber-500 hover:bg-amber-600 text-white",children:xs?"保存中...":"保存权重"})]})]})]})}),e.jsx(wt,{open:ee,onOpenChange:G,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(At,{className:"w-5 h-5 text-amber-400"}),"新建篇"]})}),e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"篇名(如:第六篇|真实的社会)"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:ge,onChange:z=>D(z.target.value),placeholder:"输入篇名"})]})}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",onClick:()=>{G(!1),D("")},className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(Z,{onClick:Sl,disabled:fe||!ge.trim(),className:"bg-amber-500 hover:bg-amber-600 text-white",children:fe?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"创建篇"]})})]})]})}),e.jsx(wt,{open:!!h,onOpenChange:()=>m(null),children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] flex flex-col p-0 gap-0",showCloseButton:!0,children:[e.jsx(St,{className:"shrink-0 px-6 pt-6 pb-2",children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(yt,{className:"w-5 h-5 text-[#38bdac]"}),"编辑章节"]})}),h&&e.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0 px-6 space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节ID"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:h.id,disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"价格 (元)"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:h.isFree?0:h.price,onChange:z=>m({...h,price:Number(z.target.value),isFree:Number(z.target.value)===0}),disabled:h.isFree})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"免费章节(唯一入口,小程序以 is_free 或 price=0 为准)"}),e.jsx("div",{className:"flex items-center h-10",children:e.jsxs("label",{className:"flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:h.isFree||h.price===0,onChange:z=>m({...h,isFree:z.target.checked,price:z.target.checked?0:1}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),e.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"设为免费"})]})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"最新新增"}),e.jsx("div",{className:"flex items-center h-10",children:e.jsxs("label",{className:"flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:h.isNew??!1,onChange:z=>m({...h,isNew:z.target.checked}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),e.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"标记 NEW"})]})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节标题"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:h.title,onChange:z=>m({...h,title:z.target.value})})]}),h.filePath&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"文件路径"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-gray-400 text-sm",value:h.filePath,disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(te,{className:"text-gray-300",children:"内容 (Markdown格式)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{ref:U,type:"file",accept:"image/*",onChange:wa,className:"hidden"}),e.jsxs(Z,{variant:"outline",size:"sm",onClick:()=>{var z;return(z=U.current)==null?void 0:z.click()},disabled:R,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[R?e.jsx($e,{className:"w-4 h-4 mr-1 animate-spin"}):e.jsx($x,{className:"w-4 h-4 mr-1"}),"上传图片"]})]})]}),g?e.jsxs("div",{className:"bg-[#0a1628] border border-gray-700 rounded-md min-h-[400px] flex items-center justify-center",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsx(jn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[400px] font-mono text-sm placeholder:text-gray-500",placeholder:"此处输入章节内容支持Markdown格式...",value:h.content,onChange:z=>m({...h,content:z.target.value})})]})]}),e.jsxs(Ft,{className:"shrink-0 px-6 py-4 border-t border-gray-700/50",children:[e.jsxs(Z,{variant:"outline",onClick:()=>m(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Sr,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsx(Z,{onClick:Io,disabled:C,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:C?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),"保存修改"]})})]})]})}),e.jsxs(bo,{defaultValue:"chapters",className:"space-y-6",children:[e.jsxs(jl,{className:"bg-[#0f2137] border border-gray-700/50 p-1",children:[e.jsxs(Zt,{value:"chapters",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[e.jsx(us,{className:"w-4 h-4 mr-2"}),"章节管理"]}),e.jsxs(Zt,{value:"search",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[e.jsx(yn,{className:"w-4 h-4 mr-2"}),"内容搜索"]}),e.jsxs(Zt,{value:"hooks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[e.jsx(jd,{className:"w-4 h-4 mr-2"}),"钩子配置"]})]}),e.jsxs(er,{value:"chapters",className:"space-y-4",children:[e.jsxs("div",{className:"rounded-2xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#38bdac] flex items-center justify-center text-white shadow-lg shadow-[#38bdac]/20 shrink-0",children:e.jsx(us,{className:"w-6 h-6"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold text-base text-white leading-tight mb-1",children:"一场SOUL的创业实验场"}),e.jsx("p",{className:"text-xs text-gray-500",children:"来自Soul派对房的真实商业故事"})]})]}),e.jsxs("div",{className:"text-center shrink-0",children:[e.jsx("span",{className:"block text-2xl font-bold text-[#38bdac]",children:gs}),e.jsx("span",{className:"text-xs text-gray-500",children:"章节"})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(Z,{onClick:()=>y(!0),className:"flex-1 min-w-[120px] bg-[#38bdac]/10 hover:bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/30",children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"新建章节"]}),e.jsxs(Z,{onClick:()=>G(!0),className:"flex-1 min-w-[120px] bg-amber-500/10 hover:bg-amber-500/20 text-amber-400 border border-amber-500/30",children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"新建篇"]}),e.jsxs(Z,{variant:"outline",onClick:()=>O(!0),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:["批量移动(已选 ",ne.length," 节)"]})]}),l?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsx(FC,{parts:$t,expandedParts:c,onTogglePart:Qe,onReorder:Tt,onReadSection:ga,onDeleteSection:dr,onAddSectionInPart:va,onAddChapterInPart:Na,onDeleteChapter:wl,onEditPart:ja,onDeletePart:El,onEditChapter:ys,selectedSectionIds:ne,onToggleSectionSelect:kl,onShowSectionOrders:Nl})]}),e.jsx(er,{value:"search",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white",children:"内容搜索"})}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",placeholder:"搜索标题或内容...",value:T,onChange:z=>S(z.target.value),onKeyDown:z=>z.key==="Enter"&&Sa()}),e.jsx(Z,{onClick:Sa,disabled:E||!T.trim(),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:E?e.jsx($e,{className:"w-4 h-4 animate-spin"}):e.jsx(yn,{className:"w-4 h-4"})})]}),b.length>0&&e.jsxs("div",{className:"space-y-2 mt-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["找到 ",b.length," 个结果"]}),b.map(z=>e.jsxs("div",{className:"p-3 rounded-lg bg-[#162840] hover:bg-[#1a3050] cursor-pointer transition-colors",onClick:()=>ga({id:z.id,title:z.title,price:z.price??1,filePath:""}),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[#38bdac] font-mono text-xs mr-2",children:z.id}),e.jsx("span",{className:"text-white",children:z.title})]}),e.jsx(Oe,{variant:"outline",className:"text-gray-400 border-gray-600 text-xs",children:z.matchType==="title"?"标题匹配":"内容匹配"})]}),z.snippet&&e.jsx("p",{className:"text-gray-500 text-xs mt-2 line-clamp-2",children:z.snippet}),(z.partTitle||z.chapterTitle)&&e.jsxs("p",{className:"text-gray-600 text-xs mt-1",children:[z.partTitle," · ",z.chapterTitle]})]},z.id))]})]})]})}),e.jsx(er,{value:"hooks",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white",children:"引流钩子配置"})}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid w-full max-w-sm items-center gap-1.5",children:[e.jsx(te,{htmlFor:"hook-chapter",className:"text-gray-300",children:"触发章节"}),e.jsxs(il,{defaultValue:"3",children:[e.jsx(ea,{id:"hook-chapter",className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(ol,{placeholder:"选择章节"})}),e.jsxs(ta,{className:"bg-[#0f2137] border-gray-700",children:[e.jsx(Hr,{value:"1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第一章"}),e.jsx(Hr,{value:"2",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第二章"}),e.jsx(Hr,{value:"3",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第三章 (默认)"})]})]})]}),e.jsxs("div",{className:"grid w-full gap-1.5",children:[e.jsx(te,{htmlFor:"message",className:"text-gray-300",children:"引流文案"}),e.jsx(jn,{placeholder:"输入引导用户加群的文案...",id:"message",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",defaultValue:"阅读更多精彩内容请加入Soul创业实验派对群..."})]}),e.jsx(Z,{className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:"保存配置"})]})]})})]})]})}var l0=["PageUp","PageDown"],i0=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],o0={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},pa="Slider",[ru,BC,UC]=ku(pa),[c0]=en(pa,[UC]),[VC,To]=c0(pa),d0=f.forwardRef((s,a)=>{const{name:l,min:o=0,max:c=100,step:d=1,orientation:h="horizontal",disabled:m=!1,minStepsBetweenThumbs:p=0,defaultValue:y=[o],value:g,onValueChange:v=()=>{},onValueCommit:C=()=>{},inverted:P=!1,form:T,...S}=s,b=f.useRef(new Set),N=f.useRef(0),j=h==="horizontal"?WC:HC,[R=[],B]=bn({prop:g,defaultProp:y,onChange:le=>{var ee;(ee=[...b.current][N.current])==null||ee.focus(),v(le)}}),U=f.useRef(R);function k(le){const ie=qC(R,le);se(le,ie)}function L(le){se(le,N.current)}function _(){const le=U.current[N.current];R[N.current]!==le&&C(R)}function se(le,ie,{commit:ee}={commit:!1}){const G=e4(d),Q=t4(Math.round((le-o)/d)*d+o,G),ce=no(Q,[o,c]);B((re=[])=>{const A=GC(re,ce,ie);if(ZC(A,p*d)){N.current=A.indexOf(ce);const ne=String(A)!==String(re);return ne&&ee&&C(A),ne?A:re}else return re})}return e.jsx(VC,{scope:s.__scopeSlider,name:l,disabled:m,min:o,max:c,valueIndexToChangeRef:N,thumbs:b.current,values:R,orientation:h,form:T,children:e.jsx(ru.Provider,{scope:s.__scopeSlider,children:e.jsx(ru.Slot,{scope:s.__scopeSlider,children:e.jsx(j,{"aria-disabled":m,"data-disabled":m?"":void 0,...S,ref:a,onPointerDown:Be(S.onPointerDown,()=>{m||(U.current=R)}),min:o,max:c,inverted:P,onSlideStart:m?void 0:k,onSlideMove:m?void 0:L,onSlideEnd:m?void 0:_,onHomeKeyDown:()=>!m&&se(o,0,{commit:!0}),onEndKeyDown:()=>!m&&se(c,R.length-1,{commit:!0}),onStepKeyDown:({event:le,direction:ie})=>{if(!m){const Q=l0.includes(le.key)||le.shiftKey&&i0.includes(le.key)?10:1,ce=N.current,re=R[ce],A=d*Q*ie;se(re+A,ce,{commit:!0})}}})})})})});d0.displayName=pa;var[u0,h0]=c0(pa,{startEdge:"left",endEdge:"right",size:"width",direction:1}),WC=f.forwardRef((s,a)=>{const{min:l,max:o,dir:c,inverted:d,onSlideStart:h,onSlideMove:m,onSlideEnd:p,onStepKeyDown:y,...g}=s,[v,C]=f.useState(null),P=et(a,j=>C(j)),T=f.useRef(void 0),S=vo(c),b=S==="ltr",N=b&&!d||!b&&d;function E(j){const R=T.current||v.getBoundingClientRect(),B=[0,R.width],k=Ou(B,N?[l,o]:[o,l]);return T.current=R,k(j-R.left)}return e.jsx(u0,{scope:s.__scopeSlider,startEdge:N?"left":"right",endEdge:N?"right":"left",direction:N?1:-1,size:"width",children:e.jsx(f0,{dir:S,"data-orientation":"horizontal",...g,ref:P,style:{...g.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:j=>{const R=E(j.clientX);h==null||h(R)},onSlideMove:j=>{const R=E(j.clientX);m==null||m(R)},onSlideEnd:()=>{T.current=void 0,p==null||p()},onStepKeyDown:j=>{const B=o0[N?"from-left":"from-right"].includes(j.key);y==null||y({event:j,direction:B?-1:1})}})})}),HC=f.forwardRef((s,a)=>{const{min:l,max:o,inverted:c,onSlideStart:d,onSlideMove:h,onSlideEnd:m,onStepKeyDown:p,...y}=s,g=f.useRef(null),v=et(a,g),C=f.useRef(void 0),P=!c;function T(S){const b=C.current||g.current.getBoundingClientRect(),N=[0,b.height],j=Ou(N,P?[o,l]:[l,o]);return C.current=b,j(S-b.top)}return e.jsx(u0,{scope:s.__scopeSlider,startEdge:P?"bottom":"top",endEdge:P?"top":"bottom",size:"height",direction:P?1:-1,children:e.jsx(f0,{"data-orientation":"vertical",...y,ref:v,style:{...y.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:S=>{const b=T(S.clientY);d==null||d(b)},onSlideMove:S=>{const b=T(S.clientY);h==null||h(b)},onSlideEnd:()=>{C.current=void 0,m==null||m()},onStepKeyDown:S=>{const N=o0[P?"from-bottom":"from-top"].includes(S.key);p==null||p({event:S,direction:N?-1:1})}})})}),f0=f.forwardRef((s,a)=>{const{__scopeSlider:l,onSlideStart:o,onSlideMove:c,onSlideEnd:d,onHomeKeyDown:h,onEndKeyDown:m,onStepKeyDown:p,...y}=s,g=To(pa,l);return e.jsx(Ke.span,{...y,ref:a,onKeyDown:Be(s.onKeyDown,v=>{v.key==="Home"?(h(v),v.preventDefault()):v.key==="End"?(m(v),v.preventDefault()):l0.concat(i0).includes(v.key)&&(p(v),v.preventDefault())}),onPointerDown:Be(s.onPointerDown,v=>{const C=v.target;C.setPointerCapture(v.pointerId),v.preventDefault(),g.thumbs.has(C)?C.focus():o(v)}),onPointerMove:Be(s.onPointerMove,v=>{v.target.hasPointerCapture(v.pointerId)&&c(v)}),onPointerUp:Be(s.onPointerUp,v=>{const C=v.target;C.hasPointerCapture(v.pointerId)&&(C.releasePointerCapture(v.pointerId),d(v))})})}),m0="SliderTrack",x0=f.forwardRef((s,a)=>{const{__scopeSlider:l,...o}=s,c=To(m0,l);return e.jsx(Ke.span,{"data-disabled":c.disabled?"":void 0,"data-orientation":c.orientation,...o,ref:a})});x0.displayName=m0;var su="SliderRange",p0=f.forwardRef((s,a)=>{const{__scopeSlider:l,...o}=s,c=To(su,l),d=h0(su,l),h=f.useRef(null),m=et(a,h),p=c.values.length,y=c.values.map(C=>v0(C,c.min,c.max)),g=p>1?Math.min(...y):0,v=100-Math.max(...y);return e.jsx(Ke.span,{"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,...o,ref:m,style:{...s.style,[d.startEdge]:g+"%",[d.endEdge]:v+"%"}})});p0.displayName=su;var nu="SliderThumb",g0=f.forwardRef((s,a)=>{const l=BC(s.__scopeSlider),[o,c]=f.useState(null),d=et(a,m=>c(m)),h=f.useMemo(()=>o?l().findIndex(m=>m.ref.current===o):-1,[l,o]);return e.jsx(KC,{...s,ref:d,index:h})}),KC=f.forwardRef((s,a)=>{const{__scopeSlider:l,index:o,name:c,...d}=s,h=To(nu,l),m=h0(nu,l),[p,y]=f.useState(null),g=et(a,E=>y(E)),v=p?h.form||!!p.closest("form"):!0,C=Cu(p),P=h.values[o],T=P===void 0?0:v0(P,h.min,h.max),S=QC(o,h.values.length),b=C==null?void 0:C[m.size],N=b?XC(b,T,m.direction):0;return f.useEffect(()=>{if(p)return h.thumbs.add(p),()=>{h.thumbs.delete(p)}},[p,h.thumbs]),e.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[m.startEdge]:`calc(${T}% + ${N}px)`},children:[e.jsx(ru.ItemSlot,{scope:s.__scopeSlider,children:e.jsx(Ke.span,{role:"slider","aria-label":s["aria-label"]||S,"aria-valuemin":h.min,"aria-valuenow":P,"aria-valuemax":h.max,"aria-orientation":h.orientation,"data-orientation":h.orientation,"data-disabled":h.disabled?"":void 0,tabIndex:h.disabled?void 0:0,...d,ref:g,style:P===void 0?{display:"none"}:s.style,onFocus:Be(s.onFocus,()=>{h.valueIndexToChangeRef.current=o})})}),v&&e.jsx(y0,{name:c??(h.name?h.name+(h.values.length>1?"[]":""):void 0),form:h.form,value:P},o)]})});g0.displayName=nu;var YC="RadioBubbleInput",y0=f.forwardRef(({__scopeSlider:s,value:a,...l},o)=>{const c=f.useRef(null),d=et(c,o),h=Su(a);return f.useEffect(()=>{const m=c.current;if(!m)return;const p=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(p,"value").set;if(h!==a&&g){const v=new Event("input",{bubbles:!0});g.call(m,a),m.dispatchEvent(v)}},[h,a]),e.jsx(Ke.input,{style:{display:"none"},...l,ref:d,defaultValue:a})});y0.displayName=YC;function GC(s=[],a,l){const o=[...s];return o[l]=a,o.sort((c,d)=>c-d)}function v0(s,a,l){const d=100/(l-a)*(s-a);return no(d,[0,100])}function QC(s,a){return a>2?`Value ${s+1} of ${a}`:a===2?["Minimum","Maximum"][s]:void 0}function qC(s,a){if(s.length===1)return 0;const l=s.map(c=>Math.abs(c-a)),o=Math.min(...l);return l.indexOf(o)}function XC(s,a,l){const o=s/2,d=Ou([0,50],[0,o]);return(o-d(a)*l)*l}function JC(s){return s.slice(0,-1).map((a,l)=>s[l+1]-a)}function ZC(s,a){if(a>0){const l=JC(s);return Math.min(...l)>=a}return!0}function Ou(s,a){return l=>{if(s[0]===s[1]||a[0]===a[1])return a[0];const o=(a[1]-a[0])/(s[1]-s[0]);return a[0]+o*(l-s[0])}}function e4(s){return(String(s).split(".")[1]||"").length}function t4(s,a){const l=Math.pow(10,a);return Math.round(s*l)/l}var r4=d0,s4=x0,n4=p0,a4=g0;function l4({className:s,defaultValue:a,value:l,min:o=0,max:c=100,...d}){const h=f.useMemo(()=>Array.isArray(l)?l:Array.isArray(a)?a:[o,c],[l,a,o,c]);return e.jsxs(r4,{defaultValue:a,value:l,min:o,max:c,className:tt("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50",s),...d,children:[e.jsx(s4,{className:"bg-gray-600 relative grow overflow-hidden rounded-full h-1.5 w-full",children:e.jsx(n4,{className:"bg-[#38bdac] absolute h-full rounded-full"})}),Array.from({length:h.length},(m,p)=>e.jsx(a4,{className:"block size-4 shrink-0 rounded-full border-2 border-[#38bdac] bg-white shadow-sm focus-visible:ring-2 focus-visible:ring-[#38bdac] focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"},p))]})}const i4={distributorShare:90,minWithdrawAmount:10,bindingDays:30,userDiscount:5,enableAutoWithdraw:!1,vipOrderShareVip:20,vipOrderShareNonVip:10};function o4(){const[s,a]=f.useState(i4),[l,o]=f.useState(!0),[c,d]=f.useState(!1);f.useEffect(()=>{Fe("/api/admin/referral-settings").then(p=>{const y=p==null?void 0:p.data;y&&typeof y=="object"&&a({distributorShare:y.distributorShare??90,minWithdrawAmount:y.minWithdrawAmount??10,bindingDays:y.bindingDays??30,userDiscount:y.userDiscount??5,enableAutoWithdraw:y.enableAutoWithdraw??!1,vipOrderShareVip:y.vipOrderShareVip??20,vipOrderShareNonVip:y.vipOrderShareNonVip??10})}).catch(console.error).finally(()=>o(!1))},[]);const h=async()=>{d(!0);try{const p={distributorShare:Number(s.distributorShare)||0,minWithdrawAmount:Number(s.minWithdrawAmount)||0,bindingDays:Number(s.bindingDays)||0,userDiscount:Number(s.userDiscount)||0,enableAutoWithdraw:!!s.enableAutoWithdraw,vipOrderShareVip:Number(s.vipOrderShareVip)||20,vipOrderShareNonVip:Number(s.vipOrderShareNonVip)||10},y=await Et("/api/admin/referral-settings",p);if(!y||y.success===!1){alert("保存失败: "+(y&&typeof y=="object"&&"error"in y?y.error:""));return}alert(`✅ 分销配置已保存成功!
• 小程序与网站的推广规则会一起生效
• 绑定关系会使用新的天数配置
• 佣金比例会立即应用到新订单
如有缓存,请刷新前台/小程序页面。`)}catch(p){console.error(p),alert("保存失败: "+(p instanceof Error?p.message:String(p)))}finally{d(!1)}},m=p=>y=>{const g=parseFloat(y.target.value||"0");a(v=>({...v,[p]:isNaN(g)?0:g}))};return l?e.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(aa,{className:"w-5 h-5 text-[#38bdac]"}),"推广 / 分销设置"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理「好友优惠」「你得 90% 收益」「绑定期 30 天」「提现门槛」等规则,小程序和 Web 共用这套配置。"})]}),e.jsxs(Z,{onClick:h,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"flex items-center gap-2 text-white",children:[e.jsx(Ub,{className:"w-4 h-4 text-[#38bdac]"}),"推广规则"]}),e.jsx(ht,{className:"text-gray-400",children:"这三项会直接体现在小程序「推广规则」卡片上,同时影响实收佣金计算。"})]}),e.jsx(we,{className:"space-y-6",children:e.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Li,{className:"w-3 h-3 text-[#38bdac]"}),"好友优惠(%"]}),e.jsx(de,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:s.userDiscount,onChange:m("userDiscount")}),e.jsx("p",{className:"text-xs text-gray-500",children:"例如 5 表示好友立减 5%(在价格配置基础上生效)。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Qt,{className:"w-3 h-3 text-[#38bdac]"}),"推广者分成(%"]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(l4,{className:"flex-1",min:10,max:100,step:1,value:[s.distributorShare],onValueChange:([p])=>a(y=>({...y,distributorShare:p}))}),e.jsx(de,{type:"number",min:0,max:100,className:"w-20 bg-[#0a1628] border-gray-700 text-white text-center",value:s.distributorShare,onChange:m("distributorShare")})]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["内容订单佣金 = 订单金额 ×"," ",e.jsxs("span",{className:"text-[#38bdac] font-mono",children:[s.distributorShare,"%"]}),";会员订单见下方。"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Li,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者是会员 %"]}),e.jsx(de,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:s.vipOrderShareVip,onChange:m("vipOrderShareVip")}),e.jsx("p",{className:"text-xs text-gray-500",children:"推广者已是会员时,会员订单佣金比例,默认 20%。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Li,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者非会员 %"]}),e.jsx(de,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:s.vipOrderShareNonVip,onChange:m("vipOrderShareNonVip")}),e.jsx("p",{className:"text-xs text-gray-500",children:"推广者非会员时,会员订单佣金比例,默认 10%。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Qt,{className:"w-3 h-3 text-[#38bdac]"}),"绑定有效期(天)"]}),e.jsx(de,{type:"number",min:1,max:365,className:"bg-[#0a1628] border-gray-700 text-white",value:s.bindingDays,onChange:m("bindingDays")}),e.jsx("p",{className:"text-xs text-gray-500",children:"好友通过你的链接进来并登录后,绑定在你名下的天数。"})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"flex items-center gap-2 text-white",children:[e.jsx(aa,{className:"w-4 h-4 text-[#38bdac]"}),"提现规则"]}),e.jsx(ht,{className:"text-gray-400",children:"与「提现中心」「自动提现」相关的参数,影响推广者看到的可提现金额和最低门槛。"})]}),e.jsx(we,{className:"space-y-6",children:e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"最低提现金额(元)"}),e.jsx(de,{type:"number",min:0,step:1,className:"bg-[#0a1628] border-gray-700 text-white",value:s.minWithdrawAmount,onChange:m("minWithdrawAmount")}),e.jsx("p",{className:"text-xs text-gray-500",children:"小程序「满 X 元可提现」展示的门槛,同时用于后端接口校验。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:["自动提现开关",e.jsx(Oe,{variant:"outline",className:"border-[#38bdac]/40 text-[#38bdac] text-[10px]",children:"预留"})]}),e.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[e.jsx(it,{checked:s.enableAutoWithdraw,onCheckedChange:p=>a(y=>({...y,enableAutoWithdraw:p}))}),e.jsx("span",{className:"text-sm text-gray-400",children:"开启后,可结合定时任务实现「收益自动打款到微信零钱」。"})]})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ue,{children:e.jsxs(Ve,{className:"flex items-center gap-2 text-gray-200 text-sm",children:[e.jsx(Li,{className:"w-4 h-4 text-[#38bdac]"}),"使用说明"]})}),e.jsxs(we,{className:"space-y-2 text-xs text-gray-400 leading-relaxed",children:[e.jsxs("p",{children:["1. 以上配置会写入"," ",e.jsx("code",{className:"font-mono text-[11px] text-[#38bdac]",children:"system_config.referral_config"}),"小程序「推广中心」、Web 推广页以及支付回调都会读取同一份配置。"]}),e.jsx("p",{children:"2. 修改后新订单立即生效;旧订单的历史佣金不会自动重算,只影响之后产生的订单。"}),e.jsx("p",{children:"3. 如遇前端展示与实际结算不一致,优先以此处配置为准,再排查缓存和小程序版本。"})]})]})]})]})}const cs={name:"卡若",avatar:"K",avatarImg:"",title:"Soul派对房主理人 · 私域运营专家",bio:'每天早上6点到9点在Soul派对房分享真实的创业故事。专注私域运营与项目变现用"云阿米巴"模式帮助创业者构建可持续的商业体系。',stats:[{label:"商业案例",value:"62"},{label:"连续直播",value:"365天"},{label:"派对分享",value:"1000+"}],highlights:["5年私域运营经验","帮助100+品牌从0到1增长","连续创业者,擅长商业模式设计"]};function mx(s){return Array.isArray(s)?s.map(a=>a&&typeof a=="object"&&"label"in a&&"value"in a?{label:String(a.label),value:String(a.value)}:{label:"",value:""}).filter(a=>a.label||a.value):cs.stats}function xx(s){return Array.isArray(s)?s.map(a=>typeof a=="string"?a:String(a??"")).filter(Boolean):cs.highlights}function c4(){const[s,a]=f.useState(cs),[l,o]=f.useState(!0),[c,d]=f.useState(!1),[h,m]=f.useState(!1),p=f.useRef(null);f.useEffect(()=>{Fe("/api/admin/author-settings").then(N=>{const E=N==null?void 0:N.data;E&&typeof E=="object"&&a({name:String(E.name??cs.name),avatar:String(E.avatar??cs.avatar),avatarImg:String(E.avatarImg??""),title:String(E.title??cs.title),bio:String(E.bio??cs.bio),stats:mx(E.stats).length?mx(E.stats):cs.stats,highlights:xx(E.highlights).length?xx(E.highlights):cs.highlights})}).catch(console.error).finally(()=>o(!1))},[]);const y=async()=>{d(!0);try{const N={name:s.name,avatar:s.avatar||"K",avatarImg:s.avatarImg,title:s.title,bio:s.bio,stats:s.stats.filter(R=>R.label||R.value),highlights:s.highlights.filter(Boolean)},E=await Et("/api/admin/author-settings",N);if(!E||E.success===!1){alert("保存失败: "+(E&&typeof E=="object"&&"error"in E?E.error:""));return}d(!1);const j=document.createElement("div");j.className="fixed top-4 right-4 z-50 px-4 py-2 rounded-lg bg-[#38bdac] text-white text-sm shadow-lg",j.textContent="作者设置已保存",document.body.appendChild(j),setTimeout(()=>j.remove(),2e3)}catch(N){console.error(N),alert("保存失败: "+(N instanceof Error?N.message:String(N)))}finally{d(!1)}},g=async N=>{var j;const E=(j=N.target.files)==null?void 0:j[0];if(E){m(!0);try{const R=new FormData;R.append("file",E),R.append("folder","avatars");const B=fu(),U={};B&&(U.Authorization=`Bearer ${B}`);const L=await(await fetch(la("/api/upload"),{method:"POST",body:R,credentials:"include",headers:U})).json();L!=null&&L.success&&(L!=null&&L.url)?a(_=>({..._,avatarImg:L.url})):alert("上传失败: "+((L==null?void 0:L.error)||"未知错误"))}catch(R){console.error(R),alert("上传失败")}finally{m(!1),p.current&&(p.current.value="")}}},v=()=>a(N=>({...N,stats:[...N.stats,{label:"",value:""}]})),C=N=>a(E=>({...E,stats:E.stats.filter((j,R)=>R!==N)})),P=(N,E,j)=>a(R=>({...R,stats:R.stats.map((B,U)=>U===N?{...B,[E]:j}:B)})),T=()=>a(N=>({...N,highlights:[...N.highlights,""]})),S=N=>a(E=>({...E,highlights:E.highlights.filter((j,R)=>R!==N)})),b=(N,E)=>a(j=>({...j,highlights:j.highlights.map((R,B)=>B===N?E:R)}));return l?e.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(ra,{className:"w-5 h-5 text-[#38bdac]"}),"作者详情"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置小程序「关于作者」页展示的作者信息,包括头像、简介、统计数据与亮点标签。"})]}),e.jsxs(Z,{onClick:y,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"flex items-center gap-2 text-white",children:[e.jsx(ra,{className:"w-4 h-4 text-[#38bdac]"}),"基本信息"]}),e.jsx(ht,{className:"text-gray-400",children:"作者姓名、头像、头衔与个人简介,将展示在「关于作者」页顶部。"})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"姓名"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:s.name,onChange:N=>a(E=>({...E,name:N.target.value})),placeholder:"卡若"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"首字母占位(无头像时显示)"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white w-20",value:s.avatar,onChange:N=>a(E=>({...E,avatar:N.target.value.slice(0,1)||"K"})),placeholder:"K"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx($x,{className:"w-3 h-3 text-[#38bdac]"}),"头像图片"]}),e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(de,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:s.avatarImg,onChange:N=>a(E=>({...E,avatarImg:N.target.value})),placeholder:"上传或粘贴 URL如 /uploads/avatars/xxx.png"}),e.jsx("input",{ref:p,type:"file",accept:"image/*",className:"hidden",onChange:g}),e.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:h,onClick:()=>{var N;return(N=p.current)==null?void 0:N.click()},children:[e.jsx(Zi,{className:"w-4 h-4 mr-2"}),h?"上传中...":"上传"]})]}),s.avatarImg&&e.jsx("div",{className:"mt-2",children:e.jsx("img",{src:s.avatarImg.startsWith("http")?s.avatarImg:la(s.avatarImg),alt:"头像预览",className:"w-20 h-20 rounded-full object-cover border border-gray-600"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"头衔"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:s.title,onChange:N=>a(E=>({...E,title:N.target.value})),placeholder:"Soul派对房主理人 · 私域运营专家"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"个人简介"}),e.jsx(jn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[120px]",value:s.bio,onChange:N=>a(E=>({...E,bio:N.target.value})),placeholder:"每天早上6点到9点..."})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsx(Ve,{className:"text-white",children:"统计数据"}),e.jsx(ht,{className:"text-gray-400",children:"展示在作者卡片中的数字指标,如「商业案例 62」「连续直播 365天」。第一个「商业案例」的值可由书籍统计自动更新。"})]}),e.jsxs(we,{className:"space-y-3",children:[s.stats.map((N,E)=>e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(de,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:N.label,onChange:j=>P(E,"label",j.target.value),placeholder:"标签"}),e.jsx(de,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:N.value,onChange:j=>P(E,"value",j.target.value),placeholder:"数值"}),e.jsx(Z,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>C(E),children:e.jsx(Sr,{className:"w-4 h-4"})})]},E)),e.jsxs(Z,{variant:"outline",size:"sm",onClick:v,className:"border-gray-600 text-gray-400",children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"添加统计项"]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsx(Ve,{className:"text-white",children:"亮点标签"}),e.jsx(ht,{className:"text-gray-400",children:"作者优势或成就的简短描述,以标签形式展示。"})]}),e.jsxs(we,{className:"space-y-3",children:[s.highlights.map((N,E)=>e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(de,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:N,onChange:j=>b(E,j.target.value),placeholder:"5年私域运营经验"}),e.jsx(Z,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>S(E),children:e.jsx(Sr,{className:"w-4 h-4"})})]},E)),e.jsxs(Z,{variant:"outline",size:"sm",onClick:T,className:"border-gray-600 text-gray-400",children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"添加亮点"]})]})]})]})]})}function d4(){const[s,a]=f.useState([]),[l,o]=f.useState(0),[c,d]=f.useState(1),[h]=f.useState(10),[m,p]=f.useState(0),[y,g]=f.useState(""),v=wu(y,300),[C,P]=f.useState(!0),[T,S]=f.useState(null),[b,N]=f.useState(!1),[E,j]=f.useState(null),[R,B]=f.useState(""),[U,k]=f.useState(""),[L,_]=f.useState(""),[se,le]=f.useState("admin"),[ie,ee]=f.useState("active"),[G,Q]=f.useState(!1);async function ce(){var O;P(!0),S(null);try{const F=new URLSearchParams({page:String(c),pageSize:String(h)});v.trim()&&F.set("search",v.trim());const X=await Fe(`/api/admin/users?${F}`);X!=null&&X.success?(a(X.records||[]),o(X.total??0),p(X.totalPages??0)):S(X.error||"加载失败")}catch(F){const X=F;S(X.status===403?"无权限访问":((O=X==null?void 0:X.data)==null?void 0:O.error)||"加载失败"),a([])}finally{P(!1)}}f.useEffect(()=>{ce()},[c,h,v]);const re=()=>{j(null),B(""),k(""),_(""),le("admin"),ee("active"),N(!0)},A=O=>{j(O),B(O.username),k(""),_(O.name||""),le(O.role==="super_admin"?"super_admin":"admin"),ee(O.status==="disabled"?"disabled":"active"),N(!0)},ne=async()=>{var O;if(!R.trim()){S("用户名不能为空");return}if(!E&&!U){S("新建时密码必填,至少 6 位");return}if(U&&U.length<6){S("密码至少 6 位");return}S(null),Q(!0);try{if(E){const F=await Nt("/api/admin/users",{id:E.id,password:U||void 0,name:L.trim(),role:se,status:ie});F!=null&&F.success?(N(!1),ce()):S((F==null?void 0:F.error)||"保存失败")}else{const F=await Et("/api/admin/users",{username:R.trim(),password:U,name:L.trim(),role:se});F!=null&&F.success?(N(!1),ce()):S((F==null?void 0:F.error)||"保存失败")}}catch(F){const X=F;S(((O=X==null?void 0:X.data)==null?void 0:O.error)||"保存失败")}finally{Q(!1)}},W=async O=>{var F;if(confirm("确定删除该管理员?"))try{const X=await vn(`/api/admin/users?id=${O}`);X!=null&&X.success?ce():S((X==null?void 0:X.error)||"删除失败")}catch(X){const H=X;S(((F=H==null?void 0:H.data)==null?void 0:F.error)||"删除失败")}},M=O=>{if(!O)return"-";try{const F=new Date(O);return isNaN(F.getTime())?O:F.toLocaleString("zh-CN")}catch{return O}};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(uu,{className:"w-5 h-5 text-[#38bdac]"}),"管理员用户"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"后台登录账号管理,仅超级管理员可操作"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(de,{placeholder:"搜索用户名/昵称",value:y,onChange:O=>g(O.target.value),className:"w-48 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500"}),e.jsx(Z,{variant:"outline",size:"sm",onClick:ce,disabled:C,className:"border-gray-600 text-gray-300",children:e.jsx($e,{className:`w-4 h-4 ${C?"animate-spin":""}`})}),e.jsxs(Z,{onClick:re,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"新增管理员"]})]})]}),T&&e.jsxs("div",{className:"mb-4 p-3 rounded-lg bg-red-500/10 border border-red-500/20 text-red-400 text-sm flex justify-between items-center",children:[e.jsx("span",{children:T}),e.jsx("button",{type:"button",onClick:()=>S(null),className:"text-red-400 hover:text-red-300",children:"×"})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:C?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(e.Fragment,{children:[e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"ID"}),e.jsx(je,{className:"text-gray-400",children:"用户名"}),e.jsx(je,{className:"text-gray-400",children:"昵称"}),e.jsx(je,{className:"text-gray-400",children:"角色"}),e.jsx(je,{className:"text-gray-400",children:"状态"}),e.jsx(je,{className:"text-gray-400",children:"创建时间"}),e.jsx(je,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(cr,{children:[s.map(O=>e.jsxs(Ge,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:O.id}),e.jsx(pe,{className:"text-white font-medium",children:O.username}),e.jsx(pe,{className:"text-gray-400",children:O.name||"-"}),e.jsx(pe,{children:e.jsx(Oe,{variant:"outline",className:O.role==="super_admin"?"border-amber-500/50 text-amber-400":"border-gray-600 text-gray-400",children:O.role==="super_admin"?"超级管理员":"管理员"})}),e.jsx(pe,{children:e.jsx(Oe,{variant:"outline",className:O.status==="active"?"border-[#38bdac]/50 text-[#38bdac]":"border-gray-500 text-gray-500",children:O.status==="active"?"正常":"已禁用"})}),e.jsx(pe,{className:"text-gray-500 text-sm",children:M(O.createdAt)}),e.jsxs(pe,{className:"text-right",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>A(O),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(yt,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>W(O.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Gt,{className:"w-4 h-4"})})]})]},O.id)),s.length===0&&!C&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:7,className:"text-center py-12 text-gray-500",children:T==="无权限访问"?"仅超级管理员可查看":"暂无管理员"})})]})]}),m>1&&e.jsx("div",{className:"p-4 border-t border-gray-700/50",children:e.jsx(Ar,{page:c,pageSize:h,total:l,totalPages:m,onPageChange:d})})]})})}),e.jsx(wt,{open:b,onOpenChange:N,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[e.jsx(St,{children:e.jsx(Ct,{className:"text-white",children:E?"编辑管理员":"新增管理员"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"用户名"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"登录用户名",value:R,onChange:O=>B(O.target.value),disabled:!!E}),E&&e.jsx("p",{className:"text-xs text-gray-500",children:"用户名不可修改"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:E?"新密码(留空不改)":"密码"}),e.jsx(de,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:E?"留空表示不修改":"至少 6 位",value:U,onChange:O=>k(O.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"昵称"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"显示名称",value:L,onChange:O=>_(O.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"角色"}),e.jsxs("select",{value:se,onChange:O=>le(O.target.value),className:"w-full h-10 px-3 rounded-md bg-[#0a1628] border border-gray-700 text-white",children:[e.jsx("option",{value:"admin",children:"管理员"}),e.jsx("option",{value:"super_admin",children:"超级管理员"})]})]}),E&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"状态"}),e.jsxs("select",{value:ie,onChange:O=>ee(O.target.value),className:"w-full h-10 px-3 rounded-md bg-[#0a1628] border border-gray-700 text-white",children:[e.jsx("option",{value:"active",children:"正常"}),e.jsx("option",{value:"disabled",children:"禁用"})]})]})]}),e.jsxs(Ft,{children:[e.jsxs(Z,{variant:"outline",onClick:()=>N(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(Sr,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(Z,{onClick:ne,disabled:G,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),G?"保存中...":"保存"]})]})]})})]})}const u4={appId:"wxb8bbb2b10dec74aa",withdrawSubscribeTmplId:"u3MbZGPRkrZIk-I7QdpwzFxnO_CeQPaCWF2FkiIablE",mchId:"1318592501",minWithdraw:10},h4={name:"卡若",startDate:"2025年10月15日",bio:"连续创业者,私域运营专家,每天早上6-9点在Soul派对房分享真实商业故事",liveTime:"06:00-09:00",platform:"Soul派对房",description:"连续创业者,私域运营专家"},f4={sectionPrice:1,baseBookPrice:9.9,distributorShare:90,authorInfo:{...h4}},m4={matchEnabled:!0,referralEnabled:!0,searchEnabled:!0,aboutEnabled:!0},x4=["system","author","admin"];function p4(){const[s,a]=Cj(),l=s.get("tab")??"system",o=x4.includes(l)?l:"system",[c,d]=f.useState(f4),[h,m]=f.useState(m4),[p,y]=f.useState(u4),[g,v]=f.useState(!1),[C,P]=f.useState(!0),[T,S]=f.useState(!1),[b,N]=f.useState(""),[E,j]=f.useState(""),[R,B]=f.useState(!1),[U,k]=f.useState(!1),L=(ee,G,Q=!1)=>{N(ee),j(G),B(Q),S(!0)};f.useEffect(()=>{(async()=>{try{const G=await Fe("/api/admin/settings");if(!G||G.success===!1)return;if(G.featureConfig&&Object.keys(G.featureConfig).length&&m(Q=>({...Q,...G.featureConfig})),G.mpConfig&&typeof G.mpConfig=="object"&&y(Q=>({...Q,...G.mpConfig})),G.siteSettings&&typeof G.siteSettings=="object"){const Q=G.siteSettings;d(ce=>({...ce,...typeof Q.sectionPrice=="number"&&{sectionPrice:Q.sectionPrice},...typeof Q.baseBookPrice=="number"&&{baseBookPrice:Q.baseBookPrice},...typeof Q.distributorShare=="number"&&{distributorShare:Q.distributorShare},...Q.authorInfo&&typeof Q.authorInfo=="object"&&{authorInfo:{...ce.authorInfo,...Q.authorInfo}}}))}}catch(G){console.error("Load settings error:",G)}finally{P(!1)}})()},[]);const _=async(ee,G)=>{k(!0);try{const Q=await Et("/api/admin/settings",{featureConfig:ee});if(!Q||Q.success===!1){G(),L("保存失败",(Q==null?void 0:Q.error)??"未知错误",!0);return}L("已保存","功能开关已更新,相关入口将随之显示或隐藏。")}catch(Q){console.error("Save feature config error:",Q),G(),L("保存失败",Q instanceof Error?Q.message:String(Q),!0)}finally{k(!1)}},se=(ee,G)=>{const Q=h,ce={...Q,[ee]:G};m(ce),_(ce,()=>m(Q))},le=async()=>{v(!0);try{const ee=await Et("/api/admin/settings",{featureConfig:h,siteSettings:{sectionPrice:c.sectionPrice,baseBookPrice:c.baseBookPrice,distributorShare:c.distributorShare,authorInfo:c.authorInfo},mpConfig:{...p,appId:p.appId||"",withdrawSubscribeTmplId:p.withdrawSubscribeTmplId||"",mchId:p.mchId||"",minWithdraw:typeof p.minWithdraw=="number"?p.minWithdraw:10}});if(!ee||ee.success===!1){L("保存失败",(ee==null?void 0:ee.error)??"未知错误",!0);return}L("已保存","设置已保存成功。")}catch(ee){console.error("Save settings error:",ee),L("保存失败",ee instanceof Error?ee.message:String(ee),!0)}finally{v(!1)}},ie=ee=>{a(ee==="system"?{}:{tab:ee})};return C?e.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"系统设置"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置全站基础参数与开关"})]}),o==="system"&&e.jsxs(Z,{onClick:le,disabled:g,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),g?"保存中...":"保存设置"]})]}),e.jsxs(bo,{value:o,onValueChange:ie,className:"w-full",children:[e.jsxs(jl,{className:"mb-6 bg-[#0f2137] border border-gray-700/50 p-1",children:[e.jsxs(Zt,{value:"system",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400 data-[state=active]:font-medium",children:[e.jsx(dl,{className:"w-4 h-4 mr-2"}),"系统设置"]}),e.jsxs(Zt,{value:"author",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400 data-[state=active]:font-medium",children:[e.jsx(vd,{className:"w-4 h-4 mr-2"}),"作者详情"]}),e.jsxs(Zt,{value:"admin",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400 data-[state=active]:font-medium",children:[e.jsx(uu,{className:"w-4 h-4 mr-2"}),"管理员"]})]}),e.jsx(er,{value:"system",className:"mt-0",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(vd,{className:"w-5 h-5 text-[#38bdac]"}),"关于作者"]}),e.jsx(ht,{className:"text-gray-400",children:'配置作者信息,将在"关于作者"页面显示'})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{htmlFor:"author-name",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(vd,{className:"w-3 h-3"}),"主理人名称"]}),e.jsx(de,{id:"author-name",className:"bg-[#0a1628] border-gray-700 text-white",value:c.authorInfo.name??"",onChange:ee=>d(G=>({...G,authorInfo:{...G.authorInfo,name:ee.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{htmlFor:"start-date",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(qi,{className:"w-3 h-3"}),"开播日期"]}),e.jsx(de,{id:"start-date",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 2025年10月15日",value:c.authorInfo.startDate??"",onChange:ee=>d(G=>({...G,authorInfo:{...G.authorInfo,startDate:ee.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{htmlFor:"live-time",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(qi,{className:"w-3 h-3"}),"直播时间"]}),e.jsx(de,{id:"live-time",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 06:00-09:00",value:c.authorInfo.liveTime??"",onChange:ee=>d(G=>({...G,authorInfo:{...G.authorInfo,liveTime:ee.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{htmlFor:"platform",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(Mb,{className:"w-3 h-3"}),"直播平台"]}),e.jsx(de,{id:"platform",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: Soul派对房",value:c.authorInfo.platform??"",onChange:ee=>d(G=>({...G,authorInfo:{...G.authorInfo,platform:ee.target.value}}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{htmlFor:"description",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(us,{className:"w-3 h-3"}),"简介描述"]}),e.jsx(de,{id:"description",className:"bg-[#0a1628] border-gray-700 text-white",value:c.authorInfo.description??"",onChange:ee=>d(G=>({...G,authorInfo:{...G.authorInfo,description:ee.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"bio",className:"text-gray-300",children:"详细介绍"}),e.jsx(jn,{id:"bio",className:"bg-[#0a1628] border-gray-700 text-white min-h-[100px]",placeholder:"输入作者详细介绍...",value:c.authorInfo.bio??"",onChange:ee=>d(G=>({...G,authorInfo:{...G.authorInfo,bio:ee.target.value}}))})]}),e.jsxs("div",{className:"mt-4 p-4 rounded-xl bg-[#0a1628] border border-[#38bdac]/30",children:[e.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"预览效果"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-gradient-to-br from-[#00CED1] to-[#20B2AA] flex items-center justify-center text-xl font-bold text-white",children:(c.authorInfo.name??"K").charAt(0)}),e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-semibold",children:c.authorInfo.name}),e.jsx("p",{className:"text-gray-400 text-xs",children:c.authorInfo.description}),e.jsxs("p",{className:"text-[#38bdac] text-xs mt-1",children:["每日 ",c.authorInfo.liveTime," · ",c.authorInfo.platform]})]})]})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(Xi,{className:"w-5 h-5 text-[#38bdac]"}),"价格设置"]}),e.jsx(ht,{className:"text-gray-400",children:"配置书籍和章节的定价"})]}),e.jsx(we,{className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"单节价格 (元)"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:c.sectionPrice,onChange:ee=>d(G=>({...G,sectionPrice:Number.parseFloat(ee.target.value)||1}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"整本价格 (元)"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:c.baseBookPrice,onChange:ee=>d(G=>({...G,baseBookPrice:Number.parseFloat(ee.target.value)||9.9}))})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(Ud,{className:"w-5 h-5 text-[#38bdac]"}),"小程序配置"]}),e.jsx(ht,{className:"text-gray-400",children:"订阅消息模板、支付商户号等,小程序从 /api/miniprogram/config 读取API 地址由 app.js baseUrl 控制)"})]}),e.jsx(we,{className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"小程序 AppID"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"wxb8bbb2b10dec74aa",value:p.appId??"",onChange:ee=>y(G=>({...G,appId:ee.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"提现订阅模板 ID"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"用户申请提现时需授权",value:p.withdrawSubscribeTmplId??"",onChange:ee=>y(G=>({...G,withdrawSubscribeTmplId:ee.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"微信支付商户号"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"1318592501",value:p.mchId??"",onChange:ee=>y(G=>({...G,mchId:ee.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"最低提现金额 (元)"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:p.minWithdraw??10,onChange:ee=>y(G=>({...G,minWithdraw:Number.parseFloat(ee.target.value)||10}))})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(dl,{className:"w-5 h-5 text-[#38bdac]"}),"功能开关"]}),e.jsx(ht,{className:"text-gray-400",children:"控制各个功能模块的显示/隐藏"})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Qt,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(te,{htmlFor:"match-enabled",className:"text-white font-medium cursor-pointer",children:"找伙伴功能"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制小程序和Web端的找伙伴功能显示"})]}),e.jsx(it,{id:"match-enabled",checked:h.matchEnabled,disabled:U,onCheckedChange:ee=>se("matchEnabled",ee)})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ob,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(te,{htmlFor:"referral-enabled",className:"text-white font-medium cursor-pointer",children:"推广功能"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制推广中心的显示(我的页面入口)"})]}),e.jsx(it,{id:"referral-enabled",checked:h.referralEnabled,disabled:U,onCheckedChange:ee=>se("referralEnabled",ee)})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(us,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(te,{htmlFor:"search-enabled",className:"text-white font-medium cursor-pointer",children:"搜索功能"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制首页搜索栏的显示"})]}),e.jsx(it,{id:"search-enabled",checked:h.searchEnabled,disabled:U,onCheckedChange:ee=>se("searchEnabled",ee)})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(dl,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(te,{htmlFor:"about-enabled",className:"text-white font-medium cursor-pointer",children:"关于页面"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制关于页面的访问"})]}),e.jsx(it,{id:"about-enabled",checked:h.aboutEnabled,disabled:U,onCheckedChange:ee=>se("aboutEnabled",ee)})]})]}),e.jsx("div",{className:"p-3 rounded-lg bg-blue-500/10 border border-blue-500/30",children:e.jsx("p",{className:"text-xs text-blue-300",children:"💡 关闭功能后,相关入口会自动隐藏。建议在功能开发完成后再开启。"})})]})]})]})}),e.jsx(er,{value:"author",className:"mt-0",children:e.jsx(c4,{})}),e.jsx(er,{value:"admin",className:"mt-0",children:e.jsx(d4,{})})]}),e.jsx(wt,{open:T,onOpenChange:S,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white",showCloseButton:!0,children:[e.jsxs(St,{children:[e.jsx(Ct,{className:R?"text-red-400":"text-[#38bdac]",children:b}),e.jsx(s2,{className:"text-gray-400 whitespace-pre-wrap pt-2",children:E})]}),e.jsx(Ft,{className:"mt-4",children:e.jsx(Z,{onClick:()=>S(!1),className:R?"bg-gray-600 hover:bg-gray-500":"bg-[#38bdac] hover:bg-[#2da396]",children:"确定"})})]})})]})}const px={wechat:{enabled:!0,qrCode:"/images/wechat-pay.png",account:"卡若",websiteAppId:"",merchantId:"",groupQrCode:"/images/party-group-qr.png"},alipay:{enabled:!0,qrCode:"/images/alipay.png",account:"卡若",partnerId:"",securityKey:""},usdt:{enabled:!1,network:"TRC20",address:"",exchangeRate:7.2},paypal:{enabled:!1,email:"",exchangeRate:7.2}};function g4(){const[s,a]=f.useState(!1),[l,o]=f.useState(px),[c,d]=f.useState(""),h=async()=>{a(!0);try{const N=await Fe("/api/config");N!=null&&N.paymentMethods&&o({...px,...N.paymentMethods})}catch(N){console.error(N)}finally{a(!1)}};f.useEffect(()=>{h()},[]);const m=async()=>{a(!0);try{await Et("/api/db/config",{key:"payment_methods",value:l,description:"支付方式配置"}),alert("配置已保存!")}catch(N){console.error("保存失败:",N),alert("保存失败: "+(N instanceof Error?N.message:String(N)))}finally{a(!1)}},p=(N,E)=>{navigator.clipboard.writeText(N),d(E),setTimeout(()=>d(""),2e3)},y=(N,E)=>{o(j=>({...j,wechat:{...j.wechat,[N]:E}}))},g=(N,E)=>{o(j=>({...j,alipay:{...j.alipay,[N]:E}}))},v=(N,E)=>{o(j=>({...j,usdt:{...j.usdt,[N]:E}}))},C=(N,E)=>{o(j=>({...j,paypal:{...j.paypal,[N]:E}}))},P=l.wechat,T=l.alipay,S=l.usdt,b=l.paypal;return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold mb-2 text-white",children:"支付配置"}),e.jsx("p",{className:"text-gray-400",children:"配置微信、支付宝、USDT、PayPal等支付参数"})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(Z,{variant:"outline",onClick:h,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${s?"animate-spin":""}`}),"同步配置"]}),e.jsxs(Z,{onClick:m,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),"保存配置"]})]})]}),e.jsx("div",{className:"mb-6 bg-[#07C160]/10 border border-[#07C160]/30 rounded-xl p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Dx,{className:"w-5 h-5 text-[#07C160] flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"font-medium mb-2 text-[#07C160]",children:"如何获取微信群跳转链接?"}),e.jsxs("ol",{className:"text-[#07C160]/80 space-y-1 list-decimal list-inside",children:[e.jsx("li",{children:"打开微信,进入目标微信群"}),e.jsx("li",{children:'点击右上角"..." → "群二维码"'}),e.jsx("li",{children:'点击右上角"..." → "发送到电脑"'}),e.jsx("li",{children:"在电脑上保存二维码图片上传到图床获取URL"}),e.jsx("li",{children:"或使用草料二维码等工具解析二维码获取链接"})]}),e.jsx("p",{className:"text-[#07C160]/60 mt-2",children:"提示微信群二维码7天后失效建议使用活码工具"})]})]})}),e.jsxs(bo,{defaultValue:"wechat",className:"space-y-6",children:[e.jsxs(jl,{className:"bg-[#0f2137] border border-gray-700/50 p-1 grid grid-cols-4 w-full",children:[e.jsxs(Zt,{value:"wechat",className:"data-[state=active]:bg-[#07C160]/20 data-[state=active]:text-[#07C160] text-gray-400",children:[e.jsx(Ud,{className:"w-4 h-4 mr-2"}),"微信"]}),e.jsxs(Zt,{value:"alipay",className:"data-[state=active]:bg-[#1677FF]/20 data-[state=active]:text-[#1677FF] text-gray-400",children:[e.jsx(zd,{className:"w-4 h-4 mr-2"}),"支付宝"]}),e.jsxs(Zt,{value:"usdt",className:"data-[state=active]:bg-[#26A17B]/20 data-[state=active]:text-[#26A17B] text-gray-400",children:[e.jsx(Rm,{className:"w-4 h-4 mr-2"}),"USDT"]}),e.jsxs(Zt,{value:"paypal",className:"data-[state=active]:bg-[#003087]/20 data-[state=active]:text-[#169BD7] text-gray-400",children:[e.jsx($d,{className:"w-4 h-4 mr-2"}),"PayPal"]})]}),e.jsx(er,{value:"wechat",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ve,{className:"text-[#07C160] flex items-center gap-2",children:[e.jsx(Ud,{className:"w-5 h-5"}),"微信支付配置"]}),e.jsx(ht,{className:"text-gray-400",children:"配置微信支付参数和跳转链接"})]}),e.jsx(it,{checked:!!P.enabled,onCheckedChange:N=>y("enabled",N)})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"网站AppID"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(P.websiteAppId??""),onChange:N=>y("websiteAppId",N.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"商户号"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(P.merchantId??""),onChange:N=>y("merchantId",N.target.value)})]})]}),e.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[e.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[e.jsx(Ji,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置(核心功能)"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"微信收款码/支付链接"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://收款码图片URL 或 weixin://支付链接",value:String(P.qrCode??""),onChange:N=>y("qrCode",N.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户点击微信支付后显示的二维码图片URL"})]}),e.jsxs("div",{className:"space-y-2 bg-[#07C160]/5 p-4 rounded-xl border border-[#07C160]/20",children:[e.jsx(te,{className:"text-[#07C160] font-medium",children:"微信群跳转链接(支付成功后跳转)"}),e.jsx(de,{className:"bg-[#0a1628] border-[#07C160]/30 text-white placeholder:text-gray-500",placeholder:"https://weixin.qq.com/g/... 或微信群二维码图片URL",value:String(P.groupQrCode??""),onChange:N=>y("groupQrCode",N.target.value)}),e.jsx("p",{className:"text-xs text-[#07C160]/70",children:"用户支付成功后将自动跳转到此链接,进入指定微信群"})]})]})]})]})}),e.jsx(er,{value:"alipay",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ve,{className:"text-[#1677FF] flex items-center gap-2",children:[e.jsx(zd,{className:"w-5 h-5"}),"支付宝配置"]}),e.jsx(ht,{className:"text-gray-400",children:"已加载真实支付宝参数"})]}),e.jsx(it,{checked:!!T.enabled,onCheckedChange:N=>g("enabled",N)})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"合作者身份 (PID)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(T.partnerId??""),onChange:N=>g("partnerId",N.target.value)}),e.jsx(Z,{size:"icon",variant:"outline",className:"border-gray-700 bg-transparent",onClick:()=>p(String(T.partnerId??""),"pid"),children:c==="pid"?e.jsx(fo,{className:"w-4 h-4 text-green-500"}):e.jsx(Fx,{className:"w-4 h-4 text-gray-400"})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"安全校验码 (Key)"}),e.jsx(de,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(T.securityKey??""),onChange:N=>g("securityKey",N.target.value)})]})]}),e.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[e.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[e.jsx(Ji,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"支付宝收款码/跳转链接"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://qr.alipay.com/... 或收款码图片URL",value:String(T.qrCode??""),onChange:N=>g("qrCode",N.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户点击支付宝支付后显示的二维码"})]})]})]})]})}),e.jsx(er,{value:"usdt",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ve,{className:"text-[#26A17B] flex items-center gap-2",children:[e.jsx(Rm,{className:"w-5 h-5"}),"USDT配置"]}),e.jsx(ht,{className:"text-gray-400",children:"配置加密货币收款地址"})]}),e.jsx(it,{checked:!!S.enabled,onCheckedChange:N=>v("enabled",N)})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"网络类型"}),e.jsxs("select",{className:"w-full bg-[#0a1628] border border-gray-700 text-white rounded-md p-2",value:String(S.network??"TRC20"),onChange:N=>v("network",N.target.value),children:[e.jsx("option",{value:"TRC20",children:"TRC20 (波场)"}),e.jsx("option",{value:"ERC20",children:"ERC20 (以太坊)"}),e.jsx("option",{value:"BEP20",children:"BEP20 (币安链)"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"收款地址"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",placeholder:"T... (TRC20地址)",value:String(S.address??""),onChange:N=>v("address",N.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(S.exchangeRate)??7.2,onChange:N=>v("exchangeRate",Number.parseFloat(N.target.value)||7.2)})]})]})]})}),e.jsx(er,{value:"paypal",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ve,{className:"text-[#169BD7] flex items-center gap-2",children:[e.jsx($d,{className:"w-5 h-5"}),"PayPal配置"]}),e.jsx(ht,{className:"text-gray-400",children:"配置PayPal收款账户"})]}),e.jsx(it,{checked:!!b.enabled,onCheckedChange:N=>C("enabled",N)})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"PayPal邮箱"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"your@email.com",value:String(b.email??""),onChange:N=>C("email",N.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(b.exchangeRate)??7.2,onChange:N=>C("exchangeRate",Number(N.target.value)||7.2)})]})]})]})})]})]})}const y4={siteName:"卡若日记",siteTitle:"一场SOUL的创业实验场",siteDescription:"来自Soul派对房的真实商业故事",logo:"/logo.png",favicon:"/favicon.ico",primaryColor:"#00CED1"},v4={home:{enabled:!0,label:"首页"},chapters:{enabled:!0,label:"目录"},match:{enabled:!0,label:"匹配"},my:{enabled:!0,label:"我的"}},j4={homeTitle:"一场SOUL的创业实验场",homeSubtitle:"来自Soul派对房的真实商业故事",chaptersTitle:"我要看",matchTitle:"语音匹配",myTitle:"我的",aboutTitle:"关于作者"};function b4(){const[s,a]=f.useState({siteConfig:{...y4},menuConfig:{...v4},pageConfig:{...j4}}),[l,o]=f.useState(!1),[c,d]=f.useState(!1);f.useEffect(()=>{Fe("/api/config").then(g=>{g!=null&&g.siteConfig&&a(v=>({...v,siteConfig:{...v.siteConfig,...g.siteConfig}})),g!=null&&g.menuConfig&&a(v=>({...v,menuConfig:{...v.menuConfig,...g.menuConfig}})),g!=null&&g.pageConfig&&a(v=>({...v,pageConfig:{...v.pageConfig,...g.pageConfig}}))}).catch(console.error)},[]);const h=async()=>{d(!0);try{await Et("/api/db/config",{key:"site_config",value:s.siteConfig,description:"网站基础配置"}),await Et("/api/db/config",{key:"menu_config",value:s.menuConfig,description:"底部菜单配置"}),await Et("/api/db/config",{key:"page_config",value:s.pageConfig,description:"页面标题配置"}),o(!0),setTimeout(()=>o(!1),2e3),alert("配置已保存")}catch(g){console.error(g),alert("保存失败: "+(g instanceof Error?g.message:String(g)))}finally{d(!1)}},m=s.siteConfig,p=s.menuConfig,y=s.pageConfig;return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"网站配置"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置网站名称、图标、菜单和页面标题"})]}),e.jsxs(Z,{onClick:h,disabled:c,className:`${l?"bg-green-500":"bg-[#00CED1]"} hover:bg-[#20B2AA] text-white transition-colors`,children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),c?"保存中...":l?"已保存":"保存设置"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx($d,{className:"w-5 h-5 text-[#00CED1]"}),"网站基础信息"]}),e.jsx(ht,{className:"text-gray-400",children:"配置网站名称、标题和描述"})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"site-name",className:"text-gray-300",children:"网站名称"}),e.jsx(de,{id:"site-name",className:"bg-[#0a1628] border-gray-700 text-white",value:m.siteName??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,siteName:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"site-title",className:"text-gray-300",children:"网站标题"}),e.jsx(de,{id:"site-title",className:"bg-[#0a1628] border-gray-700 text-white",value:m.siteTitle??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,siteTitle:g.target.value}}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"site-desc",className:"text-gray-300",children:"网站描述"}),e.jsx(de,{id:"site-desc",className:"bg-[#0a1628] border-gray-700 text-white",value:m.siteDescription??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,siteDescription:g.target.value}}))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"logo",className:"text-gray-300",children:"Logo地址"}),e.jsx(de,{id:"logo",className:"bg-[#0a1628] border-gray-700 text-white",value:m.logo??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,logo:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"favicon",className:"text-gray-300",children:"Favicon地址"}),e.jsx(de,{id:"favicon",className:"bg-[#0a1628] border-gray-700 text-white",value:m.favicon??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,favicon:g.target.value}}))})]})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(zb,{className:"w-5 h-5 text-[#00CED1]"}),"主题颜色"]}),e.jsx(ht,{className:"text-gray-400",children:"配置网站主题色"})]}),e.jsx(we,{children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"space-y-2 flex-1",children:[e.jsx(te,{htmlFor:"primary-color",className:"text-gray-300",children:"主色调"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(de,{id:"primary-color",type:"color",className:"w-16 h-10 bg-[#0a1628] border-gray-700 cursor-pointer p-1",value:m.primaryColor??"#00CED1",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,primaryColor:g.target.value}}))}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white flex-1",value:m.primaryColor??"#00CED1",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,primaryColor:g.target.value}}))})]})]}),e.jsx("div",{className:"w-24 h-24 rounded-xl flex items-center justify-center text-white font-bold",style:{backgroundColor:m.primaryColor??"#00CED1"},children:"预览"})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(Db,{className:"w-5 h-5 text-[#00CED1]"}),"底部菜单配置"]}),e.jsx(ht,{className:"text-gray-400",children:"控制底部导航栏菜单的显示和名称"})]}),e.jsx(we,{className:"space-y-4",children:Object.entries(p).map(([g,v])=>e.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[e.jsx(it,{checked:(v==null?void 0:v.enabled)??!0,onCheckedChange:C=>a(P=>({...P,menuConfig:{...P.menuConfig,[g]:{...v,enabled:C}}}))}),e.jsx("span",{className:"text-gray-300 w-16 capitalize",children:g}),e.jsx(de,{className:"bg-[#0f2137] border-gray-700 text-white max-w-[200px]",value:(v==null?void 0:v.label)??"",onChange:C=>a(P=>({...P,menuConfig:{...P.menuConfig,[g]:{...v,label:C.target.value}}}))})]}),e.jsx("span",{className:`text-sm ${v!=null&&v.enabled?"text-green-400":"text-gray-500"}`,children:v!=null&&v.enabled?"显示":"隐藏"})]},g))})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(nb,{className:"w-5 h-5 text-[#00CED1]"}),"页面标题配置"]}),e.jsx(ht,{className:"text-gray-400",children:"配置各个页面的标题和副标题"})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"首页标题"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.homeTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,homeTitle:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"首页副标题"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.homeSubtitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,homeSubtitle:g.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"目录页标题"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.chaptersTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,chaptersTitle:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"匹配页标题"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.matchTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,matchTitle:g.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"我的页标题"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.myTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,myTitle:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"关于作者标题"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.aboutTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,aboutTitle:g.target.value}}))})]})]})]})]})]})]})}function N4(){const[s,a]=f.useState(""),[l,o]=f.useState(""),[c,d]=f.useState(""),[h,m]=f.useState({}),p=async()=>{var P,T,S,b;try{const N=await Fe("/api/config"),E=(T=(P=N==null?void 0:N.liveQRCodes)==null?void 0:P[0])==null?void 0:T.urls;Array.isArray(E)&&a(E.join(`
`));const j=(b=(S=N==null?void 0:N.paymentMethods)==null?void 0:S.wechat)==null?void 0:b.groupQrCode;j&&o(j),m({paymentMethods:N==null?void 0:N.paymentMethods,liveQRCodes:N==null?void 0:N.liveQRCodes})}catch(N){console.error(N)}};f.useEffect(()=>{p()},[]);const y=(P,T)=>{navigator.clipboard.writeText(P),d(T),setTimeout(()=>d(""),2e3)},g=async()=>{try{const P=s.split(`
`).map(S=>S.trim()).filter(Boolean),T=[...h.liveQRCodes||[]];T[0]?T[0].urls=P:T.push({id:"live-1",name:"微信群活码",urls:P,clickCount:0}),await Et("/api/db/config",{key:"live_qr_codes",value:T,description:"群活码配置"}),alert("群活码配置已保存!"),await p()}catch(P){console.error(P),alert("保存失败: "+(P instanceof Error?P.message:String(P)))}},v=async()=>{var P;try{await Et("/api/db/config",{key:"payment_methods",value:{...h.paymentMethods||{},wechat:{...((P=h.paymentMethods)==null?void 0:P.wechat)||{},groupQrCode:l}},description:"支付方式配置"}),alert("微信群链接已保存!用户支付成功后将自动跳转"),await p()}catch(T){console.error(T),alert("保存失败: "+(T instanceof Error?T.message:String(T)))}},C=()=>{l?window.open(l,"_blank"):alert("请先配置微信群链接")};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"微信群活码管理"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置微信群跳转链接,用户支付后自动跳转加群"})]}),e.jsx("div",{className:"mb-6 bg-[#07C160]/10 border border-[#07C160]/30 rounded-xl p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Dx,{className:"w-5 h-5 text-[#07C160] flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"font-medium mb-2 text-[#07C160]",children:"微信群活码配置指南"}),e.jsxs("div",{className:"text-[#07C160]/80 space-y-2",children:[e.jsx("p",{className:"font-medium",children:"方法一:使用草料活码(推荐)"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[e.jsx("li",{children:"访问草料二维码创建活码"}),e.jsx("li",{children:"上传微信群二维码图片,生成永久链接"}),e.jsx("li",{children:"复制生成的短链接填入下方配置"}),e.jsx("li",{children:"群满后可直接在草料后台更换新群码,链接不变"})]}),e.jsx("p",{className:"font-medium mt-3",children:"方法二:直接使用微信群链接"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[e.jsx("li",{children:'微信打开目标群 → 右上角"..." → 群二维码'}),e.jsx("li",{children:"长按二维码 → 识别二维码 → 复制链接"})]}),e.jsx("p",{className:"text-[#07C160]/60 mt-2",children:"注意微信原生群二维码7天后失效建议使用草料活码"})]})]})]})}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-[#07C160] flex items-center gap-2",children:[e.jsx(Dm,{className:"w-5 h-5"}),"支付成功跳转链接(核心配置)"]}),e.jsx(ht,{className:"text-gray-400",children:"用户支付完成后自动跳转到此链接,进入指定微信群"})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Am,{className:"w-4 h-4"}),"微信群链接 / 活码链接"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(de,{placeholder:"https://cli.im/xxxxx 或 https://weixin.qq.com/g/...",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",value:l,onChange:P=>o(P.target.value)}),e.jsx(Z,{variant:"outline",size:"icon",className:"border-gray-700 bg-transparent hover:bg-gray-700/50",onClick:()=>y(l,"group"),children:c==="group"?e.jsx(fo,{className:"w-4 h-4 text-green-500"}):e.jsx(Fx,{className:"w-4 h-4 text-gray-400"})})]}),e.jsxs("p",{className:"text-xs text-gray-500 flex items-center gap-1",children:[e.jsx(Ji,{className:"w-3 h-3"}),"支持格式:草料短链、微信群链接(https://weixin.qq.com/g/...)、企业微信链接等"]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(Z,{onClick:v,className:"flex-1 bg-[#07C160] hover:bg-[#06AD51] text-white",children:[e.jsx(Zi,{className:"w-4 h-4 mr-2"}),"保存配置"]}),e.jsxs(Z,{onClick:C,variant:"outline",className:"border-[#07C160] text-[#07C160] hover:bg-[#07C160]/10 bg-transparent",children:[e.jsx(Ji,{className:"w-4 h-4 mr-2"}),"测试跳转"]})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(Dm,{className:"w-5 h-5 text-[#38bdac]"}),"多群轮换(高级配置)"]}),e.jsx(ht,{className:"text-gray-400",children:"配置多个群链接,系统自动轮换分配,避免单群满员"})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Am,{className:"w-4 h-4"}),"多个群链接(每行一个)"]}),e.jsx(jn,{placeholder:"https://cli.im/group1\\nhttps://cli.im/group2",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 min-h-[120px] font-mono text-sm",value:s,onChange:P=>a(P.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"每行填写一个群链接,系统将按顺序或随机分配"})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a1628] rounded-lg border border-gray-700/50",children:[e.jsx("span",{className:"text-sm text-gray-400",children:"已配置群数量"}),e.jsxs("span",{className:"font-bold text-[#38bdac]",children:[s.split(`
`).filter(Boolean).length," 个"]})]}),e.jsxs(Z,{onClick:g,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Zi,{className:"w-4 h-4 mr-2"}),"保存多群配置"]})]})]})]}),e.jsxs("div",{className:"mt-6 bg-[#0f2137] rounded-xl p-4 border border-gray-700/50",children:[e.jsx("h4",{className:"text-white font-medium mb-3",children:"常见问题"}),e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[#38bdac]",children:"Q: 为什么推荐使用草料活码?"}),e.jsx("p",{className:"text-gray-400",children:"A: 草料活码是永久链接群满后可直接在后台更换新群码无需修改网站配置。微信原生群码7天失效。"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[#38bdac]",children:"Q: 支付后没有跳转怎么办?"}),e.jsx("p",{className:"text-gray-400",children:"A: 1) 检查链接是否正确填写 2) 部分浏览器可能拦截弹窗,用户需手动允许 3) 建议使用https开头的链接"})]})]})]})]})}const gx={matchTypes:[{id:"partner",label:"创业合伙",matchLabel:"创业伙伴",icon:"⭐",matchFromDB:!0,showJoinAfterMatch:!1,price:1,enabled:!0},{id:"investor",label:"资源对接",matchLabel:"资源对接",icon:"👥",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0},{id:"mentor",label:"导师顾问",matchLabel:"导师顾问",icon:"❤️",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0},{id:"team",label:"团队招募",matchLabel:"加入项目",icon:"🎮",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}],freeMatchLimit:3,matchPrice:1,settings:{enableFreeMatches:!0,enablePaidMatches:!0,maxMatchesPerDay:10}},w4=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function S4(){const[s,a]=f.useState(gx),[l,o]=f.useState(!0),[c,d]=f.useState(!1),[h,m]=f.useState(!1),[p,y]=f.useState(null),[g,v]=f.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),C=async()=>{o(!0);try{const j=await Fe("/api/db/config/full?key=match_config"),R=(j==null?void 0:j.data)??(j==null?void 0:j.config);R&&a({...gx,...R})}catch(j){console.error("加载匹配配置失败:",j)}finally{o(!1)}};f.useEffect(()=>{C()},[]);const P=async()=>{d(!0);try{const j=await Et("/api/db/config",{key:"match_config",value:s,description:"匹配功能配置"});j&&j.success!==!1?alert("配置保存成功!"):alert("保存失败: "+(j&&typeof j=="object"&&"error"in j?j.error:"未知错误"))}catch(j){console.error("保存配置失败:",j),alert("保存失败")}finally{d(!1)}},T=j=>{y(j),v({id:j.id,label:j.label,matchLabel:j.matchLabel,icon:j.icon,matchFromDB:j.matchFromDB,showJoinAfterMatch:j.showJoinAfterMatch,price:j.price,enabled:j.enabled}),m(!0)},S=()=>{y(null),v({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),m(!0)},b=()=>{if(!g.id||!g.label){alert("请填写类型ID和名称");return}const j=[...s.matchTypes];if(p){const R=j.findIndex(B=>B.id===p.id);R!==-1&&(j[R]={...g})}else{if(j.some(R=>R.id===g.id)){alert("类型ID已存在");return}j.push({...g})}a({...s,matchTypes:j}),m(!1)},N=j=>{confirm("确定要删除这个匹配类型吗?")&&a({...s,matchTypes:s.matchTypes.filter(R=>R.id!==j)})},E=j=>{a({...s,matchTypes:s.matchTypes.map(R=>R.id===j?{...R,enabled:!R.enabled}:R)})};return e.jsxs("div",{className:"p-8 w-full space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(dl,{className:"w-6 h-6 text-[#38bdac]"}),"匹配功能配置"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"管理找伙伴功能的匹配类型和价格"})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(Z,{variant:"outline",onClick:C,disabled:l,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]}),e.jsxs(Z,{onClick:P,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(eo,{className:"w-5 h-5 text-yellow-400"}),"基础设置"]}),e.jsx(ht,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),e.jsxs(we,{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"每日免费匹配次数"}),e.jsx(de,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:s.freeMatchLimit,onChange:j=>a({...s,freeMatchLimit:parseInt(j.target.value,10)||0})}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户每天可免费匹配的次数"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"付费匹配价格(元)"}),e.jsx(de,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:s.matchPrice,onChange:j=>a({...s,matchPrice:parseFloat(j.target.value)||1})}),e.jsx("p",{className:"text-xs text-gray-500",children:"免费次数用完后的单次匹配价格"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"每日最大匹配次数"}),e.jsx(de,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:s.settings.maxMatchesPerDay,onChange:j=>a({...s,settings:{...s.settings,maxMatchesPerDay:parseInt(j.target.value,10)||10}})}),e.jsx("p",{className:"text-xs text-gray-500",children:"包含免费和付费的总次数"})]})]}),e.jsxs("div",{className:"flex gap-8 pt-4 border-t border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:s.settings.enableFreeMatches,onCheckedChange:j=>a({...s,settings:{...s.settings,enableFreeMatches:j}})}),e.jsx(te,{className:"text-gray-300",children:"启用免费匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:s.settings.enablePaidMatches,onCheckedChange:j=>a({...s,settings:{...s.settings,enablePaidMatches:j}})}),e.jsx(te,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"}),"匹配类型管理"]}),e.jsx(ht,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),e.jsxs(Z,{onClick:S,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(At,{className:"w-4 h-4 mr-1"}),"添加类型"]})]}),e.jsx(we,{children:e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"图标"}),e.jsx(je,{className:"text-gray-400",children:"类型ID"}),e.jsx(je,{className:"text-gray-400",children:"显示名称"}),e.jsx(je,{className:"text-gray-400",children:"匹配标签"}),e.jsx(je,{className:"text-gray-400",children:"价格"}),e.jsx(je,{className:"text-gray-400",children:"数据库匹配"}),e.jsx(je,{className:"text-gray-400",children:"状态"}),e.jsx(je,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsx(cr,{children:s.matchTypes.map(j=>e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsx("span",{className:"text-2xl",children:j.icon})}),e.jsx(pe,{className:"font-mono text-gray-300",children:j.id}),e.jsx(pe,{className:"text-white font-medium",children:j.label}),e.jsx(pe,{className:"text-gray-300",children:j.matchLabel}),e.jsx(pe,{children:e.jsxs(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",j.price]})}),e.jsx(pe,{children:j.matchFromDB?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"是"}):e.jsx(Oe,{variant:"outline",className:"text-gray-500 border-gray-600",children:"否"})}),e.jsx(pe,{children:e.jsx(it,{checked:j.enabled,onCheckedChange:()=>E(j.id)})}),e.jsx(pe,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>T(j),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(yt,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>N(j.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Gt,{className:"w-4 h-4"})})]})})]},j.id))})]})})]}),e.jsx(wt,{open:h,onOpenChange:m,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[p?e.jsx(yt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(At,{className:"w-5 h-5 text-[#38bdac]"}),p?"编辑匹配类型":"添加匹配类型"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"类型ID英文"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:g.id,onChange:j=>v({...g,id:j.target.value}),disabled:!!p})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"图标"}),e.jsx("div",{className:"flex gap-1 flex-wrap",children:w4.map(j=>e.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${g.icon===j?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>v({...g,icon:j}),children:j},j))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"显示名称"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业合伙",value:g.label,onChange:j=>v({...g,label:j.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"匹配标签"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业伙伴",value:g.matchLabel,onChange:j=>v({...g,matchLabel:j.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"单次匹配价格(元)"}),e.jsx(de,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:g.price,onChange:j=>v({...g,price:parseFloat(j.target.value)||1})})]}),e.jsxs("div",{className:"flex gap-6 pt-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:g.matchFromDB,onCheckedChange:j=>v({...g,matchFromDB:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:g.showJoinAfterMatch,onCheckedChange:j=>v({...g,showJoinAfterMatch:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:g.enabled,onCheckedChange:j=>v({...g,enabled:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",onClick:()=>m(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsxs(Z,{onClick:b,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),"保存"]})]})]})})]})}const yx={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function C4(){const[s,a]=f.useState([]),[l,o]=f.useState(0),[c,d]=f.useState(1),[h,m]=f.useState(10),[p,y]=f.useState(""),[g,v]=f.useState(!0),[C,P]=f.useState(null);async function T(){v(!0),P(null);try{const b=new URLSearchParams({page:String(c),pageSize:String(h)});p&&b.set("matchType",p);const N=await Fe(`/api/db/match-records?${b}`);N!=null&&N.success?(a(N.records||[]),o(N.total??0)):P("加载匹配记录失败")}catch(b){console.error("加载匹配记录失败",b),P("加载失败,请检查网络后重试")}finally{v(!1)}}f.useEffect(()=>{T()},[c,p]);const S=Math.ceil(l/h)||1;return e.jsxs("div",{className:"p-8 w-full",children:[C&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:C}),e.jsx("button",{type:"button",onClick:()=>P(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"匹配记录"}),e.jsxs("p",{className:"text-gray-400 mt-1",children:["找伙伴匹配统计,共 ",l," 条记录"]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("select",{value:p,onChange:b=>{y(b.target.value),d(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"",children:"全部类型"}),Object.entries(yx).map(([b,N])=>e.jsx("option",{value:b,children:N},b))]}),e.jsxs("button",{type:"button",onClick:T,disabled:g,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700/50 transition-colors disabled:opacity-50",children:[e.jsx($e,{className:`w-4 h-4 ${g?"animate-spin":""}`}),"刷新"]})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:g?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"发起人"}),e.jsx(je,{className:"text-gray-400",children:"匹配到"}),e.jsx(je,{className:"text-gray-400",children:"类型"}),e.jsx(je,{className:"text-gray-400",children:"联系方式"}),e.jsx(je,{className:"text-gray-400",children:"匹配时间"})]})}),e.jsxs(cr,{children:[s.map(b=>e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[b.userAvatar?e.jsx("img",{src:b.userAvatar,alt:"",className:"w-full h-full object-cover",onError:N=>{N.currentTarget.style.display="none";const E=N.currentTarget.nextElementSibling;E&&E.classList.remove("hidden")}}):null,e.jsx("span",{className:b.userAvatar?"hidden":"",children:(b.userNickname||b.userId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.userNickname||b.userId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.userId.slice(0,16),"..."]})]})]})}),e.jsx(pe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[b.matchedUserAvatar?e.jsx("img",{src:b.matchedUserAvatar,alt:"",className:"w-full h-full object-cover",onError:N=>{N.currentTarget.style.display="none";const E=N.currentTarget.nextElementSibling;E&&E.classList.remove("hidden")}}):null,e.jsx("span",{className:b.matchedUserAvatar?"hidden":"",children:(b.matchedNickname||b.matchedUserId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.matchedNickname||b.matchedUserId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.matchedUserId.slice(0,16),"..."]})]})]})}),e.jsx(pe,{children:e.jsx(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:yx[b.matchType]||b.matchType})}),e.jsxs(pe,{className:"text-gray-400 text-sm",children:[b.phone&&e.jsxs("div",{children:["📱 ",b.phone]}),b.wechatId&&e.jsxs("div",{children:["💬 ",b.wechatId]}),!b.phone&&!b.wechatId&&"-"]}),e.jsx(pe,{className:"text-gray-400",children:b.createdAt?new Date(b.createdAt).toLocaleString():"-"})]},b.id)),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),e.jsx(Ar,{page:c,totalPages:S,total:l,pageSize:h,onPageChange:d,onPageSizeChange:b=>{m(b),d(1)}})]})})})]})}function k4(){const[s,a]=f.useState([]),[l,o]=f.useState(!0),[c,d]=f.useState(!1),[h,m]=f.useState(null),[p,y]=f.useState(""),[g,v]=f.useState(0),[C,P]=f.useState(!1);async function T(){o(!0);try{const j=await Fe("/api/db/vip-roles");j!=null&&j.success&&j.data&&a(j.data)}catch(j){console.error("Load roles error:",j)}finally{o(!1)}}f.useEffect(()=>{T()},[]);const S=()=>{m(null),y(""),v(s.length>0?Math.max(...s.map(j=>j.sort))+1:0),d(!0)},b=j=>{m(j),y(j.name),v(j.sort),d(!0)},N=async()=>{if(!p.trim()){alert("角色名称不能为空");return}P(!0);try{if(h){const j=await Nt("/api/db/vip-roles",{id:h.id,name:p.trim(),sort:g});j!=null&&j.success?(d(!1),T()):alert("更新失败: "+(j==null?void 0:j.error))}else{const j=await Et("/api/db/vip-roles",{name:p.trim(),sort:g});j!=null&&j.success?(d(!1),T()):alert("新增失败: "+(j==null?void 0:j.error))}}catch(j){console.error("Save error:",j),alert("保存失败")}finally{P(!1)}},E=async j=>{if(confirm("确定删除该角色?已设置该角色的 VIP 用户将保留角色名称。"))try{const R=await vn(`/api/db/vip-roles?id=${j}`);R!=null&&R.success?T():alert("删除失败: "+(R==null?void 0:R.error))}catch(R){console.error("Delete error:",R),alert("删除失败")}};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(mo,{className:"w-5 h-5 text-amber-400"}),"VIP 角色管理"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"超级个体固定角色,在「设置 VIP」时可选择或手动填写"})]}),e.jsxs(Z,{onClick:S,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"新增角色"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"ID"}),e.jsx(je,{className:"text-gray-400",children:"角色名称"}),e.jsx(je,{className:"text-gray-400",children:"排序"}),e.jsx(je,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(cr,{children:[s.map(j=>e.jsxs(Ge,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:j.id}),e.jsx(pe,{className:"text-white",children:j.name}),e.jsx(pe,{className:"text-gray-400",children:j.sort}),e.jsxs(pe,{className:"text-right",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>b(j),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(yt,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>E(j.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Gt,{className:"w-4 h-4"})})]})]},j.id)),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无角色,点击「新增角色」添加"})})]})]})})}),e.jsx(wt,{open:c,onOpenChange:d,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[e.jsx(St,{children:e.jsx(Ct,{className:"text-white",children:h?"编辑角色":"新增角色"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"角色名称"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:创始人、投资人",value:p,onChange:j=>y(j.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"排序(下拉展示顺序,越小越前)"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:g,onChange:j=>v(parseInt(j.target.value,10)||0)})]})]}),e.jsxs(Ft,{children:[e.jsxs(Z,{variant:"outline",onClick:()=>d(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(Sr,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(Z,{onClick:N,disabled:C,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),C?"保存中...":"保存"]})]})]})})]})}function E4(){const[s,a]=f.useState([]),[l,o]=f.useState(!0),[c,d]=f.useState(!1),[h,m]=f.useState(null),[p,y]=f.useState({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:0,enabled:!0}),[g,v]=f.useState(!1),[C,P]=f.useState(!1),T=f.useRef(null),S=async k=>{var _;const L=(_=k.target.files)==null?void 0:_[0];if(L){P(!0);try{const se=new FormData;se.append("file",L),se.append("folder","mentors");const le=fu(),ie={};le&&(ie.Authorization=`Bearer ${le}`);const G=await(await fetch(la("/api/upload"),{method:"POST",body:se,credentials:"include",headers:ie})).json();G!=null&&G.success&&(G!=null&&G.url)?y(Q=>({...Q,avatar:G.url})):alert("上传失败: "+((G==null?void 0:G.error)||"未知错误"))}catch(se){console.error(se),alert("上传失败")}finally{P(!1),T.current&&(T.current.value="")}}};async function b(){o(!0);try{const k=await Fe("/api/db/mentors");k!=null&&k.success&&k.data&&a(k.data)}catch(k){console.error("Load mentors error:",k)}finally{o(!1)}}f.useEffect(()=>{b()},[]);const N=()=>{y({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:s.length>0?Math.max(...s.map(k=>k.sort))+1:0,enabled:!0})},E=()=>{m(null),N(),d(!0)},j=k=>{m(k),y({name:k.name,avatar:k.avatar||"",intro:k.intro||"",tags:k.tags||"",priceSingle:k.priceSingle!=null?String(k.priceSingle):"",priceHalfYear:k.priceHalfYear!=null?String(k.priceHalfYear):"",priceYear:k.priceYear!=null?String(k.priceYear):"",quote:k.quote||"",whyFind:k.whyFind||"",offering:k.offering||"",judgmentStyle:k.judgmentStyle||"",sort:k.sort,enabled:k.enabled??!0}),d(!0)},R=async()=>{if(!p.name.trim()){alert("导师姓名不能为空");return}v(!0);try{const k=_=>_===""?void 0:parseFloat(_),L={name:p.name.trim(),avatar:p.avatar.trim()||void 0,intro:p.intro.trim()||void 0,tags:p.tags.trim()||void 0,priceSingle:k(p.priceSingle),priceHalfYear:k(p.priceHalfYear),priceYear:k(p.priceYear),quote:p.quote.trim()||void 0,whyFind:p.whyFind.trim()||void 0,offering:p.offering.trim()||void 0,judgmentStyle:p.judgmentStyle.trim()||void 0,sort:p.sort,enabled:p.enabled};if(h){const _=await Nt("/api/db/mentors",{id:h.id,...L});_!=null&&_.success?(d(!1),b()):alert("更新失败: "+(_==null?void 0:_.error))}else{const _=await Et("/api/db/mentors",L);_!=null&&_.success?(d(!1),b()):alert("新增失败: "+(_==null?void 0:_.error))}}catch(k){console.error("Save error:",k),alert("保存失败")}finally{v(!1)}},B=async k=>{if(confirm("确定删除该导师?"))try{const L=await vn(`/api/db/mentors?id=${k}`);L!=null&&L.success?b():alert("删除失败: "+(L==null?void 0:L.error))}catch(L){console.error("Delete error:",L),alert("删除失败")}},U=k=>k!=null?`¥${k}`:"-";return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"}),"导师管理"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"stitch_soul 导师列表,支持每个导师独立配置单次/半年/年度价格"})]}),e.jsxs(Z,{onClick:E,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"新增导师"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"ID"}),e.jsx(je,{className:"text-gray-400",children:"姓名"}),e.jsx(je,{className:"text-gray-400",children:"简介"}),e.jsx(je,{className:"text-gray-400",children:"单次"}),e.jsx(je,{className:"text-gray-400",children:"半年"}),e.jsx(je,{className:"text-gray-400",children:"年度"}),e.jsx(je,{className:"text-gray-400",children:"排序"}),e.jsx(je,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(cr,{children:[s.map(k=>e.jsxs(Ge,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:k.id}),e.jsx(pe,{className:"text-white",children:k.name}),e.jsx(pe,{className:"text-gray-400 max-w-[200px] truncate",children:k.intro||"-"}),e.jsx(pe,{className:"text-gray-400",children:U(k.priceSingle)}),e.jsx(pe,{className:"text-gray-400",children:U(k.priceHalfYear)}),e.jsx(pe,{className:"text-gray-400",children:U(k.priceYear)}),e.jsx(pe,{className:"text-gray-400",children:k.sort}),e.jsxs(pe,{className:"text-right",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>j(k),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(yt,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>B(k.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Gt,{className:"w-4 h-4"})})]})]},k.id)),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:8,className:"text-center py-12 text-gray-500",children:"暂无导师,点击「新增导师」添加"})})]})]})})}),e.jsx(wt,{open:c,onOpenChange:d,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsx(St,{children:e.jsx(Ct,{className:"text-white",children:h?"编辑导师":"新增导师"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"姓名 *"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:卡若",value:p.name,onChange:k=>y(L=>({...L,name:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"排序"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:p.sort,onChange:k=>y(L=>({...L,sort:parseInt(k.target.value,10)||0}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"头像"}),e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(de,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:p.avatar,onChange:k=>y(L=>({...L,avatar:k.target.value})),placeholder:"点击上传或粘贴图片地址"}),e.jsx("input",{ref:T,type:"file",accept:"image/*",className:"hidden",onChange:S}),e.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:C,onClick:()=>{var k;return(k=T.current)==null?void 0:k.click()},children:[e.jsx(Zi,{className:"w-4 h-4 mr-2"}),C?"上传中...":"上传"]})]}),p.avatar&&e.jsx("div",{className:"mt-2",children:e.jsx("img",{src:p.avatar.startsWith("http")?p.avatar:la(p.avatar),alt:"头像预览",className:"w-20 h-20 rounded-full object-cover border border-gray-600"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"简介"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:结构判断型咨询 · Decision > Execution",value:p.intro,onChange:k=>y(L=>({...L,intro:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"技能标签(逗号分隔)"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:项目结构判断、风险止损、人×项目匹配",value:p.tags,onChange:k=>y(L=>({...L,tags:k.target.value}))})]}),e.jsxs("div",{className:"border-t border-gray-700 pt-4",children:[e.jsx(te,{className:"text-gray-300 block mb-2",children:"价格配置(每个导师独立)"}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-500 text-xs",children:"单次咨询 ¥"}),e.jsx(de,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"980",value:p.priceSingle,onChange:k=>y(L=>({...L,priceSingle:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-500 text-xs",children:"半年咨询 ¥"}),e.jsx(de,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"19800",value:p.priceHalfYear,onChange:k=>y(L=>({...L,priceHalfYear:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-500 text-xs",children:"年度咨询 ¥"}),e.jsx(de,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"29800",value:p.priceYear,onChange:k=>y(L=>({...L,priceYear:k.target.value}))})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"引言"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:大多数人失败,不是因为不努力...",value:p.quote,onChange:k=>y(L=>({...L,quote:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"为什么找(文本)"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:p.whyFind,onChange:k=>y(L=>({...L,whyFind:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"提供什么(文本)"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:p.offering,onChange:k=>y(L=>({...L,offering:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"判断风格(逗号分隔)"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:冷静、克制、偏风险视角",value:p.judgmentStyle,onChange:k=>y(L=>({...L,judgmentStyle:k.target.value}))})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"enabled",checked:p.enabled,onChange:k=>y(L=>({...L,enabled:k.target.checked})),className:"rounded border-gray-600 bg-[#0a1628]"}),e.jsx(te,{htmlFor:"enabled",className:"text-gray-300 cursor-pointer",children:"上架(小程序可见)"})]})]}),e.jsxs(Ft,{children:[e.jsxs(Z,{variant:"outline",onClick:()=>d(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(Sr,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(Z,{onClick:R,disabled:g,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),g?"保存中...":"保存"]})]})]})})]})}function P4(){const[s,a]=f.useState([]),[l,o]=f.useState(!0),[c,d]=f.useState("");async function h(){o(!0);try{const y=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",g=await Fe(y);g!=null&&g.success&&g.data&&a(g.data)}catch(y){console.error("Load consultations error:",y)}finally{o(!1)}}f.useEffect(()=>{h()},[c]);const m={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},p={single:"单次",half_year:"半年",year:"年度"};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(qi,{className:"w-5 h-5 text-[#38bdac]"}),"导师预约列表"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"stitch_soul 导师咨询预约记录"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:c,onChange:y=>d(y.target.value),className:"bg-[#0f2137] border border-gray-700 rounded-lg px-3 py-2 text-gray-300 text-sm",children:[e.jsx("option",{value:"",children:"全部状态"}),Object.entries(m).map(([y,g])=>e.jsx("option",{value:y,children:g},y))]}),e.jsxs(Z,{onClick:h,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"ID"}),e.jsx(je,{className:"text-gray-400",children:"用户ID"}),e.jsx(je,{className:"text-gray-400",children:"导师ID"}),e.jsx(je,{className:"text-gray-400",children:"类型"}),e.jsx(je,{className:"text-gray-400",children:"金额"}),e.jsx(je,{className:"text-gray-400",children:"状态"}),e.jsx(je,{className:"text-gray-400",children:"创建时间"})]})}),e.jsxs(cr,{children:[s.map(y=>e.jsxs(Ge,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:y.id}),e.jsx(pe,{className:"text-gray-400",children:y.userId}),e.jsx(pe,{className:"text-gray-400",children:y.mentorId}),e.jsx(pe,{className:"text-gray-400",children:p[y.consultationType]||y.consultationType}),e.jsxs(pe,{className:"text-white",children:["¥",y.amount]}),e.jsx(pe,{className:"text-gray-400",children:m[y.status]||y.status}),e.jsx(pe,{className:"text-gray-500 text-sm",children:y.createdAt})]},y.id)),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}const vx={matchTypes:[{id:"partner",label:"超级个体",matchLabel:"超级个体",icon:"⭐",matchFromDB:!0,showJoinAfterMatch:!1,price:1,enabled:!0},{id:"investor",label:"资源对接",matchLabel:"资源对接",icon:"👥",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0},{id:"mentor",label:"导师顾问",matchLabel:"导师顾问",icon:"❤️",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0},{id:"team",label:"团队招募",matchLabel:"加入项目",icon:"🎮",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}],freeMatchLimit:3,matchPrice:1,settings:{enableFreeMatches:!0,enablePaidMatches:!0,maxMatchesPerDay:10}},T4=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function R4(){const[s,a]=f.useState(vx),[l,o]=f.useState(!0),[c,d]=f.useState(!1),[h,m]=f.useState(!1),[p,y]=f.useState(null),[g,v]=f.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),C=async()=>{o(!0);try{const j=await Fe("/api/db/config/full?key=match_config"),R=(j==null?void 0:j.data)??(j==null?void 0:j.config);R&&a({...vx,...R})}catch(j){console.error("加载匹配配置失败:",j)}finally{o(!1)}};f.useEffect(()=>{C()},[]);const P=async()=>{d(!0);try{const j=await Et("/api/db/config",{key:"match_config",value:s,description:"匹配功能配置"});alert((j==null?void 0:j.success)!==!1?"配置保存成功!":"保存失败: "+((j==null?void 0:j.error)||"未知错误"))}catch(j){console.error(j),alert("保存失败")}finally{d(!1)}},T=j=>{y(j),v({...j}),m(!0)},S=()=>{y(null),v({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),m(!0)},b=()=>{if(!g.id||!g.label){alert("请填写类型ID和名称");return}const j=[...s.matchTypes];if(p){const R=j.findIndex(B=>B.id===p.id);R!==-1&&(j[R]={...g})}else{if(j.some(R=>R.id===g.id)){alert("类型ID已存在");return}j.push({...g})}a({...s,matchTypes:j}),m(!1)},N=j=>{confirm("确定要删除这个匹配类型吗?")&&a({...s,matchTypes:s.matchTypes.filter(R=>R.id!==j)})},E=j=>{a({...s,matchTypes:s.matchTypes.map(R=>R.id===j?{...R,enabled:!R.enabled}:R)})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsxs(Z,{variant:"outline",onClick:C,disabled:l,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`})," 刷新"]}),e.jsxs(Z,{onClick:P,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"})," ",c?"保存中...":"保存配置"]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(eo,{className:"w-5 h-5 text-yellow-400"})," 基础设置"]}),e.jsx(ht,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),e.jsxs(we,{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"每日免费匹配次数"}),e.jsx(de,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:s.freeMatchLimit,onChange:j=>a({...s,freeMatchLimit:parseInt(j.target.value,10)||0})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"付费匹配价格(元)"}),e.jsx(de,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:s.matchPrice,onChange:j=>a({...s,matchPrice:parseFloat(j.target.value)||1})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"每日最大匹配次数"}),e.jsx(de,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:s.settings.maxMatchesPerDay,onChange:j=>a({...s,settings:{...s.settings,maxMatchesPerDay:parseInt(j.target.value,10)||10}})})]})]}),e.jsxs("div",{className:"flex gap-8 pt-4 border-t border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:s.settings.enableFreeMatches,onCheckedChange:j=>a({...s,settings:{...s.settings,enableFreeMatches:j}})}),e.jsx(te,{className:"text-gray-300",children:"启用免费匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:s.settings.enablePaidMatches,onCheckedChange:j=>a({...s,settings:{...s.settings,enablePaidMatches:j}})}),e.jsx(te,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"})," 匹配类型管理"]}),e.jsx(ht,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),e.jsxs(Z,{onClick:S,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(At,{className:"w-4 h-4 mr-1"})," 添加类型"]})]}),e.jsx(we,{children:e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"图标"}),e.jsx(je,{className:"text-gray-400",children:"类型ID"}),e.jsx(je,{className:"text-gray-400",children:"显示名称"}),e.jsx(je,{className:"text-gray-400",children:"匹配标签"}),e.jsx(je,{className:"text-gray-400",children:"价格"}),e.jsx(je,{className:"text-gray-400",children:"数据库匹配"}),e.jsx(je,{className:"text-gray-400",children:"状态"}),e.jsx(je,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsx(cr,{children:s.matchTypes.map(j=>e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsx("span",{className:"text-2xl",children:j.icon})}),e.jsx(pe,{className:"font-mono text-gray-300",children:j.id}),e.jsx(pe,{className:"text-white font-medium",children:j.label}),e.jsx(pe,{className:"text-gray-300",children:j.matchLabel}),e.jsx(pe,{children:e.jsxs(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",j.price]})}),e.jsx(pe,{children:j.matchFromDB?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"是"}):e.jsx(Oe,{variant:"outline",className:"text-gray-500 border-gray-600",children:"否"})}),e.jsx(pe,{children:e.jsx(it,{checked:j.enabled,onCheckedChange:()=>E(j.id)})}),e.jsx(pe,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>T(j),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(yt,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>N(j.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Gt,{className:"w-4 h-4"})})]})})]},j.id))})]})})]}),e.jsx(wt,{open:h,onOpenChange:m,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[p?e.jsx(yt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(At,{className:"w-5 h-5 text-[#38bdac]"}),p?"编辑匹配类型":"添加匹配类型"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"类型ID英文"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:g.id,onChange:j=>v({...g,id:j.target.value}),disabled:!!p})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"图标"}),e.jsx("div",{className:"flex gap-1 flex-wrap",children:T4.map(j=>e.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${g.icon===j?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>v({...g,icon:j}),children:j},j))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"显示名称"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 超级个体",value:g.label,onChange:j=>v({...g,label:j.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"匹配标签"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 超级个体",value:g.matchLabel,onChange:j=>v({...g,matchLabel:j.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"单次匹配价格(元)"}),e.jsx(de,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:g.price,onChange:j=>v({...g,price:parseFloat(j.target.value)||1})})]}),e.jsxs("div",{className:"flex gap-6 pt-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:g.matchFromDB,onCheckedChange:j=>v({...g,matchFromDB:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:g.showJoinAfterMatch,onCheckedChange:j=>v({...g,showJoinAfterMatch:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:g.enabled,onCheckedChange:j=>v({...g,enabled:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",onClick:()=>m(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsxs(Z,{onClick:b,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"})," 保存"]})]})]})})]})}const jx={partner:"超级个体",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function I4(){const[s,a]=f.useState([]),[l,o]=f.useState(0),[c,d]=f.useState(1),[h,m]=f.useState(10),[p,y]=f.useState(""),[g,v]=f.useState(!0),[C,P]=f.useState(null);async function T(){v(!0),P(null);try{const b=new URLSearchParams({page:String(c),pageSize:String(h)});p&&b.set("matchType",p);const N=await Fe(`/api/db/match-records?${b}`);N!=null&&N.success?(a(N.records||[]),o(N.total??0)):P("加载匹配记录失败")}catch{P("加载失败,请检查网络后重试")}finally{v(!1)}}f.useEffect(()=>{T()},[c,p]);const S=Math.ceil(l/h)||1;return e.jsxs("div",{children:[C&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:C}),e.jsx("button",{type:"button",onClick:()=>P(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("p",{className:"text-gray-400",children:["共 ",l," 条匹配记录"]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("select",{value:p,onChange:b=>{y(b.target.value),d(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"",children:"全部类型"}),Object.entries(jx).map(([b,N])=>e.jsx("option",{value:b,children:N},b))]}),e.jsxs("button",{type:"button",onClick:T,disabled:g,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700/50 transition-colors disabled:opacity-50",children:[e.jsx($e,{className:`w-4 h-4 ${g?"animate-spin":""}`})," 刷新"]})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:g?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"发起人"}),e.jsx(je,{className:"text-gray-400",children:"匹配到"}),e.jsx(je,{className:"text-gray-400",children:"类型"}),e.jsx(je,{className:"text-gray-400",children:"联系方式"}),e.jsx(je,{className:"text-gray-400",children:"匹配时间"})]})}),e.jsxs(cr,{children:[s.map(b=>e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[b.userAvatar?e.jsx("img",{src:b.userAvatar,alt:"",className:"w-full h-full object-cover",onError:N=>{N.currentTarget.style.display="none"}}):null,e.jsx("span",{className:b.userAvatar?"hidden":"",children:(b.userNickname||b.userId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.userNickname||b.userId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.userId.slice(0,16),"..."]})]})]})}),e.jsx(pe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[b.matchedUserAvatar?e.jsx("img",{src:b.matchedUserAvatar,alt:"",className:"w-full h-full object-cover",onError:N=>{N.currentTarget.style.display="none"}}):null,e.jsx("span",{className:b.matchedUserAvatar?"hidden":"",children:(b.matchedNickname||b.matchedUserId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.matchedNickname||b.matchedUserId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.matchedUserId.slice(0,16),"..."]})]})]})}),e.jsx(pe,{children:e.jsx(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:jx[b.matchType]||b.matchType})}),e.jsxs(pe,{className:"text-gray-400 text-sm",children:[b.phone&&e.jsxs("div",{children:["📱 ",b.phone]}),b.wechatId&&e.jsxs("div",{children:["💬 ",b.wechatId]}),!b.phone&&!b.wechatId&&"-"]}),e.jsx(pe,{className:"text-gray-400",children:b.createdAt?new Date(b.createdAt).toLocaleString():"-"})]},b.id)),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),e.jsx(Ar,{page:c,totalPages:S,total:l,pageSize:h,onPageChange:d,onPageSizeChange:b=>{m(b),d(1)}})]})})})]})}function _4(){const[s,a]=f.useState([]),[l,o]=f.useState(0),[c,d]=f.useState(1),[h,m]=f.useState(10),[p,y]=f.useState(!0);async function g(){y(!0);try{const C=new URLSearchParams({page:String(c),pageSize:String(h),matchType:"investor"}),P=await Fe(`/api/db/match-records?${C}`);P!=null&&P.success&&(a(P.records||[]),o(P.total??0))}catch(C){console.error(C)}finally{y(!1)}}f.useEffect(()=>{g()},[c]);const v=Math.ceil(l/h)||1;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-gray-400",children:["资源对接匹配记录,共 ",l," 条"]}),e.jsx("p",{className:"text-gray-500 text-xs mt-1",children:"用户填写「我能帮到你什么」和「我需要什么帮助」后提交到存客宝"})]}),e.jsxs("button",{type:"button",onClick:g,disabled:p,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700/50 transition-colors disabled:opacity-50",children:[e.jsx($e,{className:`w-4 h-4 ${p?"animate-spin":""}`})," 刷新"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:p?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"发起人"}),e.jsx(je,{className:"text-gray-400",children:"匹配到"}),e.jsx(je,{className:"text-gray-400",children:"联系方式"}),e.jsx(je,{className:"text-gray-400",children:"时间"})]})}),e.jsxs(cr,{children:[s.map(C=>e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{className:"text-white",children:C.userNickname||C.userId}),e.jsx(pe,{className:"text-white",children:C.matchedNickname||C.matchedUserId}),e.jsxs(pe,{className:"text-gray-400 text-sm",children:[C.phone&&e.jsxs("div",{children:["📱 ",C.phone]}),C.wechatId&&e.jsxs("div",{children:["💬 ",C.wechatId]}),!C.phone&&!C.wechatId&&"-"]}),e.jsx(pe,{className:"text-gray-400",children:C.createdAt?new Date(C.createdAt).toLocaleString():"-"})]},C.id)),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无资源对接记录"})})]})]}),e.jsx(Ar,{page:c,totalPages:v,total:l,pageSize:h,onPageChange:d,onPageSizeChange:C=>{m(C),d(1)}})]})})})]})}const bx={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},M4={single:"单次",half_year:"半年",year:"年度"};function A4(){const[s,a]=f.useState([]),[l,o]=f.useState(!0),[c,d]=f.useState("");async function h(){o(!0);try{const m=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",p=await Fe(m);p!=null&&p.success&&p.data&&a(p.data)}catch(m){console.error(m)}finally{o(!1)}}return f.useEffect(()=>{h()},[c]),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("p",{className:"text-gray-400",children:"导师咨询预约记录"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:c,onChange:m=>d(m.target.value),className:"bg-[#0f2137] border border-gray-700 rounded-lg px-3 py-2 text-gray-300 text-sm",children:[e.jsx("option",{value:"",children:"全部状态"}),Object.entries(bx).map(([m,p])=>e.jsx("option",{value:m,children:p},m))]}),e.jsxs(Z,{onClick:h,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`})," 刷新"]})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"ID"}),e.jsx(je,{className:"text-gray-400",children:"用户ID"}),e.jsx(je,{className:"text-gray-400",children:"导师ID"}),e.jsx(je,{className:"text-gray-400",children:"类型"}),e.jsx(je,{className:"text-gray-400",children:"金额"}),e.jsx(je,{className:"text-gray-400",children:"状态"}),e.jsx(je,{className:"text-gray-400",children:"创建时间"})]})}),e.jsxs(cr,{children:[s.map(m=>e.jsxs(Ge,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:m.id}),e.jsx(pe,{className:"text-gray-400",children:m.userId}),e.jsx(pe,{className:"text-gray-400",children:m.mentorId}),e.jsx(pe,{className:"text-gray-400",children:M4[m.consultationType]||m.consultationType}),e.jsxs(pe,{className:"text-white",children:["¥",m.amount]}),e.jsx(pe,{className:"text-gray-400",children:bx[m.status]||m.status}),e.jsx(pe,{className:"text-gray-500 text-sm",children:m.createdAt?new Date(m.createdAt).toLocaleString():"-"})]},m.id)),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}function D4(){const[s,a]=f.useState([]),[l,o]=f.useState(0),[c,d]=f.useState(1),[h,m]=f.useState(10),[p,y]=f.useState(!0);async function g(){y(!0);try{const C=new URLSearchParams({page:String(c),pageSize:String(h),matchType:"team"}),P=await Fe(`/api/db/match-records?${C}`);P!=null&&P.success&&(a(P.records||[]),o(P.total??0))}catch(C){console.error(C)}finally{y(!1)}}f.useEffect(()=>{g()},[c]);const v=Math.ceil(l/h)||1;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-gray-400",children:["团队招募匹配记录,共 ",l," 条"]}),e.jsx("p",{className:"text-gray-500 text-xs mt-1",children:"用户通过「团队招募」提交联系方式到存客宝"})]}),e.jsxs("button",{type:"button",onClick:g,disabled:p,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700/50 transition-colors disabled:opacity-50",children:[e.jsx($e,{className:`w-4 h-4 ${p?"animate-spin":""}`})," 刷新"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:p?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"发起人"}),e.jsx(je,{className:"text-gray-400",children:"匹配到"}),e.jsx(je,{className:"text-gray-400",children:"联系方式"}),e.jsx(je,{className:"text-gray-400",children:"时间"})]})}),e.jsxs(cr,{children:[s.map(C=>e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{className:"text-white",children:C.userNickname||C.userId}),e.jsx(pe,{className:"text-white",children:C.matchedNickname||C.matchedUserId}),e.jsxs(pe,{className:"text-gray-400 text-sm",children:[C.phone&&e.jsxs("div",{children:["📱 ",C.phone]}),C.wechatId&&e.jsxs("div",{children:["💬 ",C.wechatId]}),!C.phone&&!C.wechatId&&"-"]}),e.jsx(pe,{className:"text-gray-400",children:C.createdAt?new Date(C.createdAt).toLocaleString():"-"})]},C.id)),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无团队招募记录"})})]})]}),e.jsx(Ar,{page:c,totalPages:v,total:l,pageSize:h,onPageChange:d,onPageSizeChange:C=>{m(C),d(1)}})]})})})]})}function L4(){const[s,a]=f.useState(null),[l,o]=f.useState(!0),[c,d]=f.useState([{endpoint:"/api/ckb/join",label:"CKB 加入ckb/join",status:"idle"},{endpoint:"/api/ckb/match",label:"CKB 匹配上报ckb/match",status:"idle"},{endpoint:"/api/miniprogram/ckb/lead",label:"CKB 链接卡若ckb/lead",status:"idle"},{endpoint:"/api/match/config",label:"匹配配置match/config",status:"idle"}]),h={partner:"超级个体",investor:"资源对接",mentor:"导师顾问",team:"团队招募"},m=f.useCallback(async()=>{o(!0);try{const g=await Fe("/api/db/match-records?stats=true");if(g!=null&&g.success&&g.data)a(g.data);else{const v=await Fe("/api/db/match-records?page=1&pageSize=1");v!=null&&v.success&&a({totalMatches:v.total??0,todayMatches:0,byType:[],uniqueUsers:0})}}catch(g){console.error("加载统计失败:",g)}finally{o(!1)}},[]);f.useEffect(()=>{m()},[m]);const p=async g=>{const v=c[g],C=[...c];C[g]={...v,status:"testing",message:void 0,responseTime:void 0},d(C);const P=performance.now();try{let T;v.endpoint.includes("match/config")?T=await Fe(v.endpoint):T=await Et(v.endpoint,{type:"partner",phone:"00000000000",wechat:"test_ping",userId:"test_admin_ping",matchType:"partner",name:"接口测试"});const S=Math.round(performance.now()-P),b=[...c],N=(T==null?void 0:T.success)!==void 0||(T==null?void 0:T.code)===200||(T==null?void 0:T.code)===400;b[g]={...v,status:N?"success":"error",message:(T==null?void 0:T.message)||(N?"接口可用":"响应异常"),responseTime:S},d(b)}catch(T){const S=Math.round(performance.now()-P),b=[...c];b[g]={...v,status:"error",message:T instanceof Error?T.message:"请求失败",responseTime:S},d(b)}},y=async()=>{for(let g=0;g<c.length;g++)await p(g)};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总匹配次数"}),e.jsx("p",{className:"text-3xl font-bold text-white mt-1",children:l?"-":(s==null?void 0:s.totalMatches)??0})]}),e.jsx(Qt,{className:"w-10 h-10 text-[#38bdac]/50"})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日匹配"}),e.jsx("p",{className:"text-3xl font-bold text-white mt-1",children:l?"-":(s==null?void 0:s.todayMatches)??0})]}),e.jsx(eo,{className:"w-10 h-10 text-yellow-400/50"})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"独立用户数"}),e.jsx("p",{className:"text-3xl font-bold text-white mt-1",children:l?"-":(s==null?void 0:s.uniqueUsers)??0})]}),e.jsx(oN,{className:"w-10 h-10 text-blue-400/50"})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"人均匹配"}),e.jsx("p",{className:"text-3xl font-bold text-white mt-1",children:l?"-":s!=null&&s.uniqueUsers?(s.totalMatches/s.uniqueUsers).toFixed(1):"0"})]}),e.jsx(ul,{className:"w-10 h-10 text-green-400/50"})]})})})]}),(s==null?void 0:s.byType)&&s.byType.length>0&&e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white text-lg",children:"按类型分布"})}),e.jsx(we,{children:e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:s.byType.map(g=>e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-4 text-center",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:h[g.matchType]||g.matchType}),e.jsx("p",{className:"text-2xl font-bold text-white mt-2",children:g.count}),e.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:[s.totalMatches>0?(g.count/s.totalMatches*100).toFixed(1):0,"%"]})]},g.matchType))})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(Ys,{className:"w-5 h-5 text-[#38bdac]"}),"存客宝接口连通性测试"]}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"测试所有找伙伴相关的 CKB 接口是否正常可用"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(Z,{onClick:m,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`})," 刷新统计"]}),e.jsxs(Z,{onClick:y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(eo,{className:"w-4 h-4 mr-2"})," 全部测试"]})]})]}),e.jsx(we,{children:e.jsx("div",{className:"space-y-3",children:c.map((g,v)=>e.jsxs("div",{className:"flex items-center justify-between bg-[#0a1628] rounded-lg px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[g.status==="idle"&&e.jsx("div",{className:"w-3 h-3 rounded-full bg-gray-500"}),g.status==="testing"&&e.jsx($e,{className:"w-4 h-4 text-yellow-400 animate-spin"}),g.status==="success"&&e.jsx(Wj,{className:"w-4 h-4 text-green-400"}),g.status==="error"&&e.jsx(Lx,{className:"w-4 h-4 text-red-400"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm font-medium",children:g.label}),e.jsx("p",{className:"text-gray-500 text-xs font-mono",children:g.endpoint})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[g.message&&e.jsx("span",{className:`text-xs ${g.status==="success"?"text-green-400":g.status==="error"?"text-red-400":"text-gray-400"}`,children:g.message}),g.responseTime!==void 0&&e.jsxs(Oe,{className:"bg-gray-700 text-gray-300 border-0",children:[g.responseTime,"ms"]}),e.jsx(Z,{size:"sm",variant:"outline",onClick:()=>p(v),disabled:g.status==="testing",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent text-xs",children:"测试"})]})]},g.endpoint))})})]})]})}const O4=[{id:"pool",label:"匹配池",icon:Qt},{id:"records",label:"匹配记录",icon:Eb},{id:"resource",label:"资源对接",icon:xb},{id:"mentor",label:"导师预约",icon:zx},{id:"team",label:"团队招募",icon:Vd},{id:"stats",label:"存客宝统计",icon:Dj}];function F4(){const[s,a]=f.useState("pool");return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-6 h-6 text-[#38bdac]"}),"找伙伴"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"管理匹配池、匹配记录、资源对接、导师预约、团队招募及存客宝数据统计"})]}),e.jsx("div",{className:"flex gap-1 mb-6 bg-[#0f2137] rounded-lg p-1 border border-gray-700/50",children:O4.map(l=>{const o=s===l.id;return e.jsxs("button",{type:"button",onClick:()=>a(l.id),className:`flex items-center gap-2 px-4 py-2.5 rounded-md text-sm font-medium transition-all ${o?"bg-[#38bdac] text-white shadow-lg":"text-gray-400 hover:text-white hover:bg-gray-700/50"}`,children:[e.jsx(l.icon,{className:"w-4 h-4"}),l.label]},l.id)})}),s==="pool"&&e.jsx(R4,{}),s==="records"&&e.jsx(I4,{}),s==="resource"&&e.jsx(_4,{}),s==="mentor"&&e.jsx(A4,{}),s==="team"&&e.jsx(D4,{}),s==="stats"&&e.jsx(L4,{})]})}function z4(){return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-8",children:[e.jsx(Ys,{className:"w-8 h-8 text-[#38bdac]"}),e.jsx("h1",{className:"text-2xl font-bold text-white",children:"API 接口文档"})]}),e.jsx("p",{className:"text-gray-400 mb-6",children:"API 风格RESTful · 版本 v1.0 · 基础路径 /api · 简单、清晰、易用。"}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white",children:"1. 接口总览"})}),e.jsxs(we,{className:"space-y-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 mb-2",children:"接口分类"}),e.jsxs("ul",{className:"space-y-1 text-gray-300 font-mono",children:[e.jsx("li",{children:"/api/book — 书籍内容(章节列表、内容获取、同步)"}),e.jsx("li",{children:"/api/payment — 支付系统(订单创建、回调、状态查询)"}),e.jsx("li",{children:"/api/referral — 分销系统(邀请码、收益、提现)"}),e.jsx("li",{children:"/api/user — 用户系统(登录、注册、信息更新)"}),e.jsx("li",{children:"/api/match — 匹配系统(寻找匹配、匹配历史)"}),e.jsx("li",{children:"/api/admin — 管理后台(内容/订单/用户/分销管理)"}),e.jsx("li",{children:"/api/config — 配置系统"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 mb-2",children:"认证方式"}),e.jsx("p",{className:"text-gray-300",children:"用户Cookie session_id可选"}),e.jsx("p",{className:"text-gray-300",children:"管理端Authorization: Bearer admin-token-secret"})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white",children:"2. 书籍内容"})}),e.jsxs(we,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"GET /api/book/all-chapters — 获取所有章节"}),e.jsx("p",{children:"GET /api/book/chapter/:id — 获取单章内容"}),e.jsx("p",{children:"POST /api/book/sync — 同步章节(需管理员认证)"})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white",children:"3. 支付"})}),e.jsxs(we,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"POST /api/payment/create-order — 创建订单"}),e.jsx("p",{children:"POST /api/payment/alipay/notify — 支付宝回调"}),e.jsx("p",{children:"POST /api/payment/wechat/notify — 微信回调"})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white",children:"4. 分销与用户"})}),e.jsxs(we,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"/api/referral/* — 邀请码、收益查询、提现"}),e.jsx("p",{children:"/api/user/* — 登录、注册、信息更新"}),e.jsx("p",{children:"/api/match/* — 匹配、匹配历史"})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white",children:"5. 管理后台"})}),e.jsxs(we,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"GET/POST /api/admin/referral-settings — 推广/分销设置(含 VIP 配置)"}),e.jsx("p",{children:"GET /api/db/users、/api/db/book — 用户与章节数据"}),e.jsx("p",{children:"GET /api/orders — 订单列表"})]})]}),e.jsx("p",{className:"text-gray-500 text-xs",children:"完整说明见项目内 开发文档/5、接口/API接口完整文档.md"})]})}function $4(){const s=Zs();return e.jsx("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-8",children:e.jsxs("div",{className:"text-center max-w-md",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-red-500/20 text-red-400 mb-6",children:e.jsx(Bj,{className:"w-10 h-10"})}),e.jsx("h1",{className:"text-4xl font-bold text-white mb-2",children:"404"}),e.jsx("p",{className:"text-gray-400 mb-1",children:"页面不存在"}),e.jsx("p",{className:"text-sm text-gray-500 font-mono mb-8 break-all",children:s.pathname}),e.jsx(Z,{asChild:!0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:e.jsxs(Hi,{to:"/",children:[e.jsx(yb,{className:"w-4 h-4 mr-2"}),"返回首页"]})})]})})}function B4(){return e.jsxs(fj,{children:[e.jsx(dt,{path:"/login",element:e.jsx(gw,{})}),e.jsxs(dt,{path:"/",element:e.jsx(jN,{}),children:[e.jsx(dt,{index:!0,element:e.jsx(yd,{to:"/dashboard",replace:!0})}),e.jsx(dt,{path:"dashboard",element:e.jsx(vw,{})}),e.jsx(dt,{path:"orders",element:e.jsx(n2,{})}),e.jsx(dt,{path:"users",element:e.jsx(I2,{})}),e.jsx(dt,{path:"distribution",element:e.jsx(_2,{})}),e.jsx(dt,{path:"withdrawals",element:e.jsx(M2,{})}),e.jsx(dt,{path:"content",element:e.jsx($C,{})}),e.jsx(dt,{path:"referral-settings",element:e.jsx(o4,{})}),e.jsx(dt,{path:"author-settings",element:e.jsx(yd,{to:"/settings?tab=author",replace:!0})}),e.jsx(dt,{path:"admin-users",element:e.jsx(yd,{to:"/settings?tab=admin",replace:!0})}),e.jsx(dt,{path:"vip-roles",element:e.jsx(k4,{})}),e.jsx(dt,{path:"mentors",element:e.jsx(E4,{})}),e.jsx(dt,{path:"mentor-consultations",element:e.jsx(P4,{})}),e.jsx(dt,{path:"settings",element:e.jsx(p4,{})}),e.jsx(dt,{path:"payment",element:e.jsx(g4,{})}),e.jsx(dt,{path:"site",element:e.jsx(b4,{})}),e.jsx(dt,{path:"qrcodes",element:e.jsx(N4,{})}),e.jsx(dt,{path:"find-partner",element:e.jsx(F4,{})}),e.jsx(dt,{path:"match",element:e.jsx(S4,{})}),e.jsx(dt,{path:"match-records",element:e.jsx(C4,{})}),e.jsx(dt,{path:"api-doc",element:e.jsx(z4,{})})]}),e.jsx(dt,{path:"*",element:e.jsx($4,{})})]})}gv.createRoot(document.getElementById("root")).render(e.jsx(f.StrictMode,{children:e.jsx(bj,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:e.jsx(B4,{})})}));